codexapp 0.1.39 → 0.1.40
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.
- package/dist/assets/index-CfRse5RN.js +1438 -0
- package/dist/assets/index-LibuijWc.css +1 -0
- package/dist/index.html +2 -2
- package/dist-cli/index.js +1268 -446
- package/dist-cli/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/assets/index-BPh5uQ3U.js +0 -42
- package/dist/assets/index-D7HKxnG0.css +0 -1
|
@@ -0,0 +1,1438 @@
|
|
|
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.28
|
|
3
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
+
* @license MIT
|
|
5
|
+
**/function Oa(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const _t={},ss=[],On=()=>{},Ru=()=>!1,Xo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Na=e=>e.startsWith("onUpdate:"),Nt=Object.assign,$a=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},oh=Object.prototype.hasOwnProperty,dt=(e,t)=>oh.call(e,t),Be=Array.isArray,os=e=>oo(e)==="[object Map]",Pu=e=>oo(e)==="[object Set]",kl=e=>oo(e)==="[object Date]",qe=e=>typeof e=="function",Rt=e=>typeof e=="string",wn=e=>typeof e=="symbol",ht=e=>e!==null&&typeof e=="object",xu=e=>(ht(e)||qe(e))&&qe(e.then)&&qe(e.catch),Mu=Object.prototype.toString,oo=e=>Mu.call(e),ih=e=>oo(e).slice(8,-1),Ou=e=>oo(e)==="[object Object]",Da=e=>Rt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,$s=Oa(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Qo=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ah=/-\w/g,fn=Qo(e=>e.replace(ah,t=>t.slice(1).toUpperCase())),lh=/\B([A-Z])/g,Sr=Qo(e=>e.replace(lh,"-$1").toLowerCase()),Zo=Qo(e=>e.charAt(0).toUpperCase()+e.slice(1)),bi=Qo(e=>e?`on${Zo(e)}`:""),_r=(e,t)=>!Object.is(e,t),So=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Nu=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},La=e=>{const t=parseFloat(e);return isNaN(t)?e:t},ch=e=>{const t=Rt(e)?Number(e):NaN;return isNaN(t)?e:t};let Tl;const ei=()=>Tl||(Tl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Wr(e){if(Be(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=Rt(r)?hh(r):Wr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(Rt(e)||ht(e))return e}const uh=/;(?![^(]*\))/g,dh=/:([^]+)/,fh=/\/\*[^]*?\*\//g;function hh(e){const t={};return e.replace(fh,"").split(uh).forEach(n=>{if(n){const r=n.split(dh);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function at(e){let t="";if(Rt(e))t=e;else if(Be(e))for(let n=0;n<e.length;n++){const r=at(e[n]);r&&(t+=r+" ")}else if(ht(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const ph="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",mh=Oa(ph);function $u(e){return!!e||e===""}function gh(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=ja(e[r],t[r]);return n}function ja(e,t){if(e===t)return!0;let n=kl(e),r=kl(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=wn(e),r=wn(t),n||r)return e===t;if(n=Be(e),r=Be(t),n||r)return n&&r?gh(e,t):!1;if(n=ht(e),r=ht(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||!ja(e[i],t[i]))return!1}}return String(e)===String(t)}const Du=e=>!!(e&&e.__v_isRef===!0),se=e=>Rt(e)?e:e==null?"":Be(e)||ht(e)&&(e.toString===Mu||!qe(e.toString))?Du(e)?se(e.value):JSON.stringify(e,Lu,2):String(e),Lu=(e,t)=>Du(t)?Lu(e,t.value):os(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[_i(r,o)+" =>"]=s,n),{})}:Pu(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>_i(n))}:wn(t)?_i(t):ht(t)&&!Be(t)&&!Ou(t)?String(t):t,_i=(e,t="")=>{var n;return wn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
|
6
|
+
* @vue/reactivity v3.5.28
|
|
7
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8
|
+
* @license MIT
|
|
9
|
+
**/let sn;class vh{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=sn,!t&&sn&&(this.index=(sn.scopes||(sn.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=sn;try{return sn=this,t()}finally{sn=n}}}on(){++this._on===1&&(this.prevScope=sn,sn=this)}off(){this._on>0&&--this._on===0&&(sn=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 yh(){return sn}let kt;const ki=new WeakSet;class ju{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,sn&&sn.active&&sn.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ki.has(this)&&(ki.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Fu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Il(this),Uu(this);const t=kt,n=gn;kt=this,gn=!0;try{return this.fn()}finally{Hu(this),kt=t,gn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ua(t);this.deps=this.depsTail=void 0,Il(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ki.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ea(this)&&this.run()}get dirty(){return ea(this)}}let Bu=0,Ds,Ls;function Fu(e,t=!1){if(e.flags|=8,t){e.next=Ls,Ls=e;return}e.next=Ds,Ds=e}function Ba(){Bu++}function Fa(){if(--Bu>0)return;if(Ls){let t=Ls;for(Ls=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Ds;){let t=Ds;for(Ds=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 Uu(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Hu(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),Ua(r),wh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function ea(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Vu(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Vu(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Gs)||(e.globalVersion=Gs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ea(e))))return;e.flags|=2;const t=e.dep,n=kt,r=gn;kt=e,gn=!0;try{Uu(e);const s=e.fn(e._value);(t.version===0||_r(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{kt=n,gn=r,Hu(e),e.flags&=-3}}function Ua(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)Ua(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function wh(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let gn=!0;const Wu=[];function Yn(){Wu.push(gn),gn=!1}function Xn(){const e=Wu.pop();gn=e===void 0?!0:e}function Il(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=kt;kt=void 0;try{t()}finally{kt=n}}}let Gs=0;class bh{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 Ha{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(!kt||!gn||kt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==kt)n=this.activeLink=new bh(kt,this),kt.deps?(n.prevDep=kt.depsTail,kt.depsTail.nextDep=n,kt.depsTail=n):kt.deps=kt.depsTail=n,Gu(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=kt.depsTail,n.nextDep=void 0,kt.depsTail.nextDep=n,kt.depsTail=n,kt.deps===n&&(kt.deps=r)}return n}trigger(t){this.version++,Gs++,this.notify(t)}notify(t){Ba();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Fa()}}}function Gu(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)Gu(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ta=new WeakMap,Ur=Symbol(""),na=Symbol(""),zs=Symbol("");function zt(e,t,n){if(gn&&kt){let r=ta.get(e);r||ta.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new Ha),s.map=r,s.key=n),s.track()}}function Gn(e,t,n,r,s,o){const i=ta.get(e);if(!i){Gs++;return}const a=l=>{l&&l.trigger()};if(Ba(),t==="clear")i.forEach(a);else{const l=Be(e),u=l&&Da(n);if(l&&n==="length"){const c=Number(r);i.forEach((f,h)=>{(h==="length"||h===zs||!wn(h)&&h>=c)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),u&&a(i.get(zs)),t){case"add":l?u&&a(i.get("length")):(a(i.get(Ur)),os(e)&&a(i.get(na)));break;case"delete":l||(a(i.get(Ur)),os(e)&&a(i.get(na)));break;case"set":os(e)&&a(i.get(Ur));break}}Fa()}function Zr(e){const t=lt(e);return t===e?t:(zt(t,"iterate",zs),dn(e)?t:t.map(bn))}function ti(e){return zt(e=lt(e),"iterate",zs),e}function pr(e,t){return Qn(e)?hs(Hr(e)?bn(t):t):bn(t)}const _h={__proto__:null,[Symbol.iterator](){return Ti(this,Symbol.iterator,e=>pr(this,e))},concat(...e){return Zr(this).concat(...e.map(t=>Be(t)?Zr(t):t))},entries(){return Ti(this,"entries",e=>(e[1]=pr(this,e[1]),e))},every(e,t){return Fn(this,"every",e,t,void 0,arguments)},filter(e,t){return Fn(this,"filter",e,t,n=>n.map(r=>pr(this,r)),arguments)},find(e,t){return Fn(this,"find",e,t,n=>pr(this,n),arguments)},findIndex(e,t){return Fn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Fn(this,"findLast",e,t,n=>pr(this,n),arguments)},findLastIndex(e,t){return Fn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Fn(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ii(this,"includes",e)},indexOf(...e){return Ii(this,"indexOf",e)},join(e){return Zr(this).join(e)},lastIndexOf(...e){return Ii(this,"lastIndexOf",e)},map(e,t){return Fn(this,"map",e,t,void 0,arguments)},pop(){return As(this,"pop")},push(...e){return As(this,"push",e)},reduce(e,...t){return Sl(this,"reduce",e,t)},reduceRight(e,...t){return Sl(this,"reduceRight",e,t)},shift(){return As(this,"shift")},some(e,t){return Fn(this,"some",e,t,void 0,arguments)},splice(...e){return As(this,"splice",e)},toReversed(){return Zr(this).toReversed()},toSorted(e){return Zr(this).toSorted(e)},toSpliced(...e){return Zr(this).toSpliced(...e)},unshift(...e){return As(this,"unshift",e)},values(){return Ti(this,"values",e=>pr(this,e))}};function Ti(e,t,n){const r=ti(e),s=r[t]();return r!==e&&!dn(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const kh=Array.prototype;function Fn(e,t,n,r,s,o){const i=ti(e),a=i!==e&&!dn(e),l=i[t];if(l!==kh[t]){const f=l.apply(e,o);return a?bn(f):f}let u=n;i!==e&&(a?u=function(f,h){return n.call(this,pr(e,f),h,e)}:n.length>2&&(u=function(f,h){return n.call(this,f,h,e)}));const c=l.call(i,u,r);return a&&s?s(c):c}function Sl(e,t,n,r){const s=ti(e);let o=n;return s!==e&&(dn(e)?n.length>3&&(o=function(i,a,l){return n.call(this,i,a,l,e)}):o=function(i,a,l){return n.call(this,i,pr(e,a),l,e)}),s[t](o,...r)}function Ii(e,t,n){const r=lt(e);zt(r,"iterate",zs);const s=r[t](...n);return(s===-1||s===!1)&&Ga(n[0])?(n[0]=lt(n[0]),r[t](...n)):s}function As(e,t,n=[]){Yn(),Ba();const r=lt(e)[t].apply(e,n);return Fa(),Xn(),r}const Th=Oa("__proto__,__v_isRef,__isVue"),zu=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(wn));function Ih(e){wn(e)||(e=String(e));const t=lt(this);return zt(t,"has",e),t.hasOwnProperty(e)}class qu{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?Nh:Xu:o?Yu:Ju).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Be(t);if(!s){let l;if(i&&(l=_h[n]))return l;if(n==="hasOwnProperty")return Ih}const a=Reflect.get(t,n,Jt(t)?t:r);if((wn(n)?zu.has(n):Th(n))||(s||zt(t,"get",n),o))return a;if(Jt(a)){const l=i&&Da(n)?a:a.value;return s&&ht(l)?sa(l):l}return ht(a)?s?sa(a):ni(a):a}}class Ku extends qu{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Be(t)&&Da(n);if(!this._isShallow){const u=Qn(o);if(!dn(r)&&!Qn(r)&&(o=lt(o),r=lt(r)),!i&&Jt(o)&&!Jt(r))return u||(o.value=r),!0}const a=i?Number(n)<t.length:dt(t,n),l=Reflect.set(t,n,r,Jt(t)?t:s);return t===lt(s)&&(a?_r(r,o)&&Gn(t,"set",n,r):Gn(t,"add",n,r)),l}deleteProperty(t,n){const r=dt(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&Gn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!wn(n)||!zu.has(n))&&zt(t,"has",n),r}ownKeys(t){return zt(t,"iterate",Be(t)?"length":Ur),Reflect.ownKeys(t)}}class Sh extends qu{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Eh=new Ku,Ch=new Sh,Ah=new Ku(!0);const ra=e=>e,go=e=>Reflect.getPrototypeOf(e);function Rh(e,t,n){return function(...r){const s=this.__v_raw,o=lt(s),i=os(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,u=s[e](...r),c=n?ra:t?hs:bn;return!t&&zt(o,"iterate",l?na:Ur),Nt(Object.create(u),{next(){const{value:f,done:h}=u.next();return h?{value:f,done:h}:{value:a?[c(f[0]),c(f[1])]:c(f),done:h}}})}}function vo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Ph(e,t){const n={get(s){const o=this.__v_raw,i=lt(o),a=lt(s);e||(_r(s,a)&&zt(i,"get",s),zt(i,"get",a));const{has:l}=go(i),u=t?ra:e?hs:bn;if(l.call(i,s))return u(o.get(s));if(l.call(i,a))return u(o.get(a));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&zt(lt(s),"iterate",Ur),s.size},has(s){const o=this.__v_raw,i=lt(o),a=lt(s);return e||(_r(s,a)&&zt(i,"has",s),zt(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=lt(a),u=t?ra:e?hs:bn;return!e&&zt(l,"iterate",Ur),a.forEach((c,f)=>s.call(o,u(c),u(f),i))}};return Nt(n,e?{add:vo("add"),set:vo("set"),delete:vo("delete"),clear:vo("clear")}:{add(s){!t&&!dn(s)&&!Qn(s)&&(s=lt(s));const o=lt(this);return go(o).has.call(o,s)||(o.add(s),Gn(o,"add",s,s)),this},set(s,o){!t&&!dn(o)&&!Qn(o)&&(o=lt(o));const i=lt(this),{has:a,get:l}=go(i);let u=a.call(i,s);u||(s=lt(s),u=a.call(i,s));const c=l.call(i,s);return i.set(s,o),u?_r(o,c)&&Gn(i,"set",s,o):Gn(i,"add",s,o),this},delete(s){const o=lt(this),{has:i,get:a}=go(o);let l=i.call(o,s);l||(s=lt(s),l=i.call(o,s)),a&&a.call(o,s);const u=o.delete(s);return l&&Gn(o,"delete",s,void 0),u},clear(){const s=lt(this),o=s.size!==0,i=s.clear();return o&&Gn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Rh(s,e,t)}),n}function Va(e,t){const n=Ph(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(dt(n,s)&&s in r?n:r,s,o)}const xh={get:Va(!1,!1)},Mh={get:Va(!1,!0)},Oh={get:Va(!0,!1)};const Ju=new WeakMap,Yu=new WeakMap,Xu=new WeakMap,Nh=new WeakMap;function $h(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Dh(e){return e.__v_skip||!Object.isExtensible(e)?0:$h(ih(e))}function ni(e){return Qn(e)?e:Wa(e,!1,Eh,xh,Ju)}function Qu(e){return Wa(e,!1,Ah,Mh,Yu)}function sa(e){return Wa(e,!0,Ch,Oh,Xu)}function Wa(e,t,n,r,s){if(!ht(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Dh(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 Hr(e){return Qn(e)?Hr(e.__v_raw):!!(e&&e.__v_isReactive)}function Qn(e){return!!(e&&e.__v_isReadonly)}function dn(e){return!!(e&&e.__v_isShallow)}function Ga(e){return e?!!e.__v_raw:!1}function lt(e){const t=e&&e.__v_raw;return t?lt(t):e}function Lh(e){return!dt(e,"__v_skip")&&Object.isExtensible(e)&&Nu(e,"__v_skip",!0),e}const bn=e=>ht(e)?ni(e):e,hs=e=>ht(e)?sa(e):e;function Jt(e){return e?e.__v_isRef===!0:!1}function D(e){return Zu(e,!1)}function jh(e){return Zu(e,!0)}function Zu(e,t){return Jt(e)?e:new Bh(e,t)}class Bh{constructor(t,n){this.dep=new Ha,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:lt(t),this._value=n?t:bn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||dn(t)||Qn(t);t=r?t:lt(t),_r(t,n)&&(this._rawValue=t,this._value=r?t:bn(t),this.dep.trigger())}}function ge(e){return Jt(e)?e.value:e}const Fh={get:(e,t,n)=>t==="__v_raw"?e:ge(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return Jt(s)&&!Jt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function ed(e){return Hr(e)?e:new Proxy(e,Fh)}class Uh{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Ha(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Gs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&kt!==this)return Fu(this,!0),!0}get value(){const t=this.dep.track();return Vu(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Hh(e,t,n=!1){let r,s;return qe(e)?r=e:(r=e.get,s=e.set),new Uh(r,s,n)}const yo={},$o=new WeakMap;let $r;function Vh(e,t=!1,n=$r){if(n){let r=$o.get(n);r||$o.set(n,r=[]),r.push(e)}}function Wh(e,t,n=_t){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,u=W=>s?W:dn(W)||s===!1||s===0?zn(W,1):zn(W);let c,f,h,_,L=!1,C=!1;if(Jt(e)?(f=()=>e.value,L=dn(e)):Hr(e)?(f=()=>u(e),L=!0):Be(e)?(C=!0,L=e.some(W=>Hr(W)||dn(W)),f=()=>e.map(W=>{if(Jt(W))return W.value;if(Hr(W))return u(W);if(qe(W))return l?l(W,2):W()})):qe(e)?t?f=l?()=>l(e,2):e:f=()=>{if(h){Yn();try{h()}finally{Xn()}}const W=$r;$r=c;try{return l?l(e,3,[_]):e(_)}finally{$r=W}}:f=On,t&&s){const W=f,ae=s===!0?1/0:s;f=()=>zn(W(),ae)}const j=yh(),Z=()=>{c.stop(),j&&j.active&&$a(j.effects,c)};if(o&&t){const W=t;t=(...ae)=>{W(...ae),Z()}}let B=C?new Array(e.length).fill(yo):yo;const J=W=>{if(!(!(c.flags&1)||!c.dirty&&!W))if(t){const ae=c.run();if(s||L||(C?ae.some((le,ve)=>_r(le,B[ve])):_r(ae,B))){h&&h();const le=$r;$r=c;try{const ve=[ae,B===yo?void 0:C&&B[0]===yo?[]:B,_];B=ae,l?l(t,3,ve):t(...ve)}finally{$r=le}}}else c.run()};return a&&a(J),c=new ju(f),c.scheduler=i?()=>i(J,!1):J,_=W=>Vh(W,!1,c),h=c.onStop=()=>{const W=$o.get(c);if(W){if(l)l(W,4);else for(const ae of W)ae();$o.delete(c)}},t?r?J(!0):B=c.run():i?i(J.bind(null,!0),!0):c.run(),Z.pause=c.pause.bind(c),Z.resume=c.resume.bind(c),Z.stop=Z,Z}function zn(e,t=1/0,n){if(t<=0||!ht(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Jt(e))zn(e.value,t,n);else if(Be(e))for(let r=0;r<e.length;r++)zn(e[r],t,n);else if(Pu(e)||os(e))e.forEach(r=>{zn(r,t,n)});else if(Ou(e)){for(const r in e)zn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&zn(e[r],t,n)}return e}/**
|
|
10
|
+
* @vue/runtime-core v3.5.28
|
|
11
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
|
+
* @license MIT
|
|
13
|
+
**/function io(e,t,n,r){try{return r?e(...r):e()}catch(s){ri(s,t,n)}}function _n(e,t,n,r){if(qe(e)){const s=io(e,t,n,r);return s&&xu(s)&&s.catch(o=>{ri(o,t,n)}),s}if(Be(e)){const s=[];for(let o=0;o<e.length;o++)s.push(_n(e[o],t,n,r));return s}}function ri(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||_t;if(t){let a=t.parent;const l=t.proxy,u=`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,u)===!1)return}a=a.parent}if(o){Yn(),io(o,null,10,[e,l,u]),Xn();return}}Gh(e,n,s,r,i)}function Gh(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Qt=[];let Cn=-1;const is=[];let mr=null,ts=0;const td=Promise.resolve();let Do=null;function en(e){const t=Do||td;return e?t.then(this?e.bind(this):e):t}function zh(e){let t=Cn+1,n=Qt.length;for(;t<n;){const r=t+n>>>1,s=Qt[r],o=qs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function za(e){if(!(e.flags&1)){const t=qs(e),n=Qt[Qt.length-1];!n||!(e.flags&2)&&t>=qs(n)?Qt.push(e):Qt.splice(zh(t),0,e),e.flags|=1,nd()}}function nd(){Do||(Do=td.then(sd))}function qh(e){Be(e)?is.push(...e):mr&&e.id===-1?mr.splice(ts+1,0,e):e.flags&1||(is.push(e),e.flags|=1),nd()}function El(e,t,n=Cn+1){for(;n<Qt.length;n++){const r=Qt[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Qt.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function rd(e){if(is.length){const t=[...new Set(is)].sort((n,r)=>qs(n)-qs(r));if(is.length=0,mr){mr.push(...t);return}for(mr=t,ts=0;ts<mr.length;ts++){const n=mr[ts];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}mr=null,ts=0}}const qs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function sd(e){try{for(Cn=0;Cn<Qt.length;Cn++){const t=Qt[Cn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),io(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Cn<Qt.length;Cn++){const t=Qt[Cn];t&&(t.flags&=-2)}Cn=-1,Qt.length=0,rd(),Do=null,(Qt.length||is.length)&&sd()}}let Ut=null,od=null;function Lo(e){const t=Ut;return Ut=e,od=e&&e.type.__scopeId||null,t}function gt(e,t=Ut,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&Uo(-1);const o=Lo(t);let i;try{i=e(...s)}finally{Lo(o),r._d&&Uo(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Zn(e,t){if(Ut===null)return e;const n=ci(Ut),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=_t]=t[s];o&&(qe(o)&&(o={mounted:o,updated:o}),o.deep&&zn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function Pr(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&&(Yn(),_n(l,n,8,[e.el,a,e,t]),Xn())}}function Eo(e,t){if(Kt){let n=Kt.provides;const r=Kt.parent&&Kt.parent.provides;r===n&&(n=Kt.provides=Object.create(r)),n[e]=t}}function vn(e,t,n=!1){const r=Xa();if(r||ls){let s=ls?ls._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&&qe(t)?t.call(r&&r.proxy):t}}const Kh=Symbol.for("v-scx"),Jh=()=>vn(Kh);function vt(e,t,n){return id(e,t,n)}function id(e,t,n=_t){const{immediate:r,deep:s,flush:o,once:i}=n,a=Nt({},n),l=t&&r||!t&&o!=="post";let u;if(Qs){if(o==="sync"){const _=Jh();u=_.__watcherHandles||(_.__watcherHandles=[])}else if(!l){const _=()=>{};return _.stop=On,_.resume=On,_.pause=On,_}}const c=Kt;a.call=(_,L,C)=>_n(_,c,L,C);let f=!1;o==="post"?a.scheduler=_=>{Gt(_,c&&c.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(_,L)=>{L?_():za(_)}),a.augmentJob=_=>{t&&(_.flags|=4),f&&(_.flags|=2,c&&(_.id=c.uid,_.i=c))};const h=Wh(e,t,a);return Qs&&(u?u.push(h):l&&h()),h}function Yh(e,t,n){const r=this.proxy,s=Rt(e)?e.includes(".")?ad(r,e):()=>r[e]:e.bind(r,r);let o;qe(t)?o=t:(o=t.handler,n=t);const i=ao(this),a=id(s,o.bind(r),n);return i(),a}function ad(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 ld=Symbol("_vte"),cd=e=>e.__isTeleport,js=e=>e&&(e.disabled||e.disabled===""),Cl=e=>e&&(e.defer||e.defer===""),Al=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Rl=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,oa=(e,t)=>{const n=e&&e.to;return Rt(n)?t?t(n):null:n},ud={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,u){const{mc:c,pc:f,pbc:h,o:{insert:_,querySelector:L,createText:C,createComment:j}}=u,Z=js(t.props);let{shapeFlag:B,children:J,dynamicChildren:W}=t;if(e==null){const ae=t.el=C(""),le=t.anchor=C("");_(ae,n,r),_(le,n,r);const ve=(ne,q)=>{B&16&&c(J,ne,q,s,o,i,a,l)},ke=()=>{const ne=t.target=oa(t.props,L),q=ia(ne,t,C,_);ne&&(i!=="svg"&&Al(ne)?i="svg":i!=="mathml"&&Rl(ne)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(ne),Z||(ve(ne,q),Co(t,!1)))};Z&&(ve(n,le),Co(t,!0)),Cl(t.props)?(t.el.__isMounted=!1,Gt(()=>{ke(),delete t.el.__isMounted},o)):ke()}else{if(Cl(t.props)&&e.el.__isMounted===!1){Gt(()=>{ud.process(e,t,n,r,s,o,i,a,l,u)},o);return}t.el=e.el,t.targetStart=e.targetStart;const ae=t.anchor=e.anchor,le=t.target=e.target,ve=t.targetAnchor=e.targetAnchor,ke=js(e.props),ne=ke?n:le,q=ke?ae:ve;if(i==="svg"||Al(le)?i="svg":(i==="mathml"||Rl(le))&&(i="mathml"),W?(h(e.dynamicChildren,W,ne,s,o,i,a),Ja(e,t,!0)):l||f(e,t,ne,q,s,o,i,a,!1),Z)ke?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):wo(t,n,ae,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const oe=t.target=oa(t.props,L);oe&&wo(t,oe,null,u,0)}else ke&&wo(t,le,ve,u,1);Co(t,Z)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:u,targetAnchor:c,target:f,props:h}=e;if(f&&(s(u),s(c)),o&&s(l),i&16){const _=o||!js(h);for(let L=0;L<a.length;L++){const C=a[L];r(C,t,n,_,!!C.dynamicChildren)}}},move:wo,hydrate:Xh};function wo(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:u,props:c}=e,f=o===2;if(f&&r(i,t,n),(!f||js(c))&&l&16)for(let h=0;h<u.length;h++)s(u[h],t,n,2);f&&r(a,t,n)}function Xh(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:u,createText:c}},f){function h(j,Z){let B=Z;for(;B;){if(B&&B.nodeType===8){if(B.data==="teleport start anchor")t.targetStart=B;else if(B.data==="teleport anchor"){t.targetAnchor=B,j._lpa=t.targetAnchor&&i(t.targetAnchor);break}}B=i(B)}}function _(j,Z){Z.anchor=f(i(j),Z,a(j),n,r,s,o)}const L=t.target=oa(t.props,l),C=js(t.props);if(L){const j=L._lpa||L.firstChild;t.shapeFlag&16&&(C?(_(e,t),h(L,j),t.targetAnchor||ia(L,t,c,u,a(e)===L?e:null)):(t.anchor=i(e),h(L,j),t.targetAnchor||ia(L,t,c,u),f(j&&i(j),t,L,n,r,s,o))),Co(t,C)}else C&&t.shapeFlag&16&&(_(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const jo=ud;function Co(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 ia(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[ld]=i,e&&(r(o,e,s),r(i,e,s)),i}const An=Symbol("_leaveCb"),Rs=Symbol("_enterCb");function Qh(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return sr(()=>{e.isMounted=!0}),or(()=>{e.isUnmounting=!0}),e}const cn=[Function,Array],dd={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:cn,onEnter:cn,onAfterEnter:cn,onEnterCancelled:cn,onBeforeLeave:cn,onLeave:cn,onAfterLeave:cn,onLeaveCancelled:cn,onBeforeAppear:cn,onAppear:cn,onAfterAppear:cn,onAppearCancelled:cn},fd=e=>{const t=e.subTree;return t.component?fd(t.component):t},Zh={name:"BaseTransition",props:dd,setup(e,{slots:t}){const n=Xa(),r=Qh();return()=>{const s=t.default&&md(t.default(),!0);if(!s||!s.length)return;const o=hd(s),i=lt(e),{mode:a}=i;if(r.isLeaving)return Si(o);const l=Pl(o);if(!l)return Si(o);let u=aa(l,i,r,n,f=>u=f);l.type!==qt&&Ks(l,u);let c=n.subTree&&Pl(n.subTree);if(c&&c.type!==qt&&!Lr(c,l)&&fd(n).type!==qt){let f=aa(c,i,r,n);if(Ks(c,f),a==="out-in"&&l.type!==qt)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,c=void 0},Si(o);a==="in-out"&&l.type!==qt?f.delayLeave=(h,_,L)=>{const C=pd(r,c);C[String(c.key)]=c,h[An]=()=>{_(),h[An]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{L(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function hd(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==qt){t=n;break}}return t}const ep=Zh;function pd(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 aa(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:h,onLeave:_,onAfterLeave:L,onLeaveCancelled:C,onBeforeAppear:j,onAppear:Z,onAfterAppear:B,onAppearCancelled:J}=t,W=String(e.key),ae=pd(n,e),le=(ne,q)=>{ne&&_n(ne,r,9,q)},ve=(ne,q)=>{const oe=q[1];le(ne,q),Be(ne)?ne.every(Q=>Q.length<=1)&&oe():ne.length<=1&&oe()},ke={mode:i,persisted:a,beforeEnter(ne){let q=l;if(!n.isMounted)if(o)q=j||l;else return;ne[An]&&ne[An](!0);const oe=ae[W];oe&&Lr(e,oe)&&oe.el[An]&&oe.el[An](),le(q,[ne])},enter(ne){let q=u,oe=c,Q=f;if(!n.isMounted)if(o)q=Z||u,oe=B||c,Q=J||f;else return;let Ie=!1;ne[Rs]=Le=>{Ie||(Ie=!0,Le?le(Q,[ne]):le(oe,[ne]),ke.delayedLeave&&ke.delayedLeave(),ne[Rs]=void 0)};const Ce=ne[Rs].bind(null,!1);q?ve(q,[ne,Ce]):Ce()},leave(ne,q){const oe=String(e.key);if(ne[Rs]&&ne[Rs](!0),n.isUnmounting)return q();le(h,[ne]);let Q=!1;ne[An]=Ce=>{Q||(Q=!0,q(),Ce?le(C,[ne]):le(L,[ne]),ne[An]=void 0,ae[oe]===e&&delete ae[oe])};const Ie=ne[An].bind(null,!1);ae[oe]=e,_?ve(_,[ne,Ie]):Ie()},clone(ne){const q=aa(ne,t,n,r,s);return s&&s(q),q}};return ke}function Si(e){if(si(e))return e=Ir(e),e.children=null,e}function Pl(e){if(!si(e))return cd(e.type)&&e.children?hd(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&&qe(n.default))return n.default()}}function Ks(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Ks(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 md(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===je?(i.patchFlag&128&&s++,r=r.concat(md(i.children,t,a))):(t||i.type!==qt)&&r.push(a!=null?Ir(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function Lt(e,t){return qe(e)?Nt({name:e.name},t,{setup:e}):e}function gd(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function xl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Bo=new WeakMap;function Bs(e,t,n,r,s=!1){if(Be(e)){e.forEach((C,j)=>Bs(C,t&&(Be(t)?t[j]:t),n,r,s));return}if(as(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Bs(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?ci(r.component):r.el,i=s?null:o,{i:a,r:l}=e,u=t&&t.r,c=a.refs===_t?a.refs={}:a.refs,f=a.setupState,h=lt(f),_=f===_t?Ru:C=>xl(c,C)?!1:dt(h,C),L=(C,j)=>!(j&&xl(c,j));if(u!=null&&u!==l){if(Ml(t),Rt(u))c[u]=null,_(u)&&(f[u]=null);else if(Jt(u)){const C=t;L(u,C.k)&&(u.value=null),C.k&&(c[C.k]=null)}}if(qe(l))io(l,a,12,[i,c]);else{const C=Rt(l),j=Jt(l);if(C||j){const Z=()=>{if(e.f){const B=C?_(l)?f[l]:c[l]:L()||!e.k?l.value:c[e.k];if(s)Be(B)&&$a(B,o);else if(Be(B))B.includes(o)||B.push(o);else if(C)c[l]=[o],_(l)&&(f[l]=c[l]);else{const J=[o];L(l,e.k)&&(l.value=J),e.k&&(c[e.k]=J)}}else C?(c[l]=i,_(l)&&(f[l]=i)):j&&(L(l,e.k)&&(l.value=i),e.k&&(c[e.k]=i))};if(i){const B=()=>{Z(),Bo.delete(e)};B.id=-1,Bo.set(e,B),Gt(B,n)}else Ml(e),Z()}}}function Ml(e){const t=Bo.get(e);t&&(t.flags|=8,Bo.delete(e))}ei().requestIdleCallback;ei().cancelIdleCallback;const as=e=>!!e.type.__asyncLoader,si=e=>e.type.__isKeepAlive;function tp(e,t){vd(e,"a",t)}function np(e,t){vd(e,"da",t)}function vd(e,t,n=Kt){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(oi(t,r,n),n){let s=n.parent;for(;s&&s.parent;)si(s.parent.vnode)&&rp(r,t,n,s),s=s.parent}}function rp(e,t,n,r){const s=oi(t,e,r,!0);ii(()=>{$a(r[t],s)},n)}function oi(e,t,n=Kt,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Yn();const a=ao(n),l=_n(t,n,e,i);return a(),Xn(),l});return r?s.unshift(o):s.push(o),o}}const rr=e=>(t,n=Kt)=>{(!Qs||e==="sp")&&oi(e,(...r)=>t(...r),n)},sp=rr("bm"),sr=rr("m"),op=rr("bu"),ip=rr("u"),or=rr("bum"),ii=rr("um"),ap=rr("sp"),lp=rr("rtg"),cp=rr("rtc");function up(e,t=Kt){oi("ec",e,t)}const dp="components",yd=Symbol.for("v-ndc");function la(e){return Rt(e)?fp(dp,e,!1)||e:e||yd}function fp(e,t,n=!0,r=!1){const s=Ut||Kt;if(s){const o=s.type;{const a=Yp(o,!1);if(a&&(a===t||a===fn(t)||a===Zo(fn(t))))return o}const i=Ol(s[e]||o[e],t)||Ol(s.appContext[e],t);return!i&&r?o:i}}function Ol(e,t){return e&&(e[t]||e[fn(t)]||e[Zo(fn(t))])}function Ct(e,t,n,r){let s;const o=n,i=Be(e);if(i||Rt(e)){const a=i&&Hr(e);let l=!1,u=!1;a&&(l=!dn(e),u=Qn(e),e=ti(e)),s=new Array(e.length);for(let c=0,f=e.length;c<f;c++)s[c]=t(l?u?hs(bn(e[c])):bn(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(ht(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,u=a.length;l<u;l++){const c=a[l];s[l]=t(e[c],c,l,o)}}else s=[];return s}function Mn(e,t,n={},r,s){if(Ut.ce||Ut.parent&&as(Ut.parent)&&Ut.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),ft(je,null,[Ee("slot",n,r)],u?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),w();const i=o&&wd(o(n)),a=n.key||i&&i.key,l=ft(je,{key:(a&&!wn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function wd(e){return e.some(t=>Ys(t)?!(t.type===qt||t.type===je&&!wd(t.children)):!0)?e:null}const ca=e=>e?Bd(e)?ci(e):ca(e.parent):null,Fs=Nt(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=>ca(e.parent),$root:e=>ca(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>_d(e),$forceUpdate:e=>e.f||(e.f=()=>{za(e.update)}),$nextTick:e=>e.n||(e.n=en.bind(e.proxy)),$watch:e=>Yh.bind(e)}),Ei=(e,t)=>e!==_t&&!e.__isScriptSetup&&dt(e,t),hp={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 h=i[t];if(h!==void 0)switch(h){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(Ei(r,t))return i[t]=1,r[t];if(s!==_t&&dt(s,t))return i[t]=2,s[t];if(dt(o,t))return i[t]=3,o[t];if(n!==_t&&dt(n,t))return i[t]=4,n[t];ua&&(i[t]=0)}}const u=Fs[t];let c,f;if(u)return t==="$attrs"&&zt(e.attrs,"get",""),u(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==_t&&dt(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,dt(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return Ei(s,t)?(s[t]=n,!0):r!==_t&&dt(r,t)?(r[t]=n,!0):dt(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!==_t&&a[0]!=="$"&&dt(e,a)||Ei(t,a)||dt(o,a)||dt(r,a)||dt(Fs,a)||dt(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:dt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function pp(){return mp().slots}function mp(e){const t=Xa();return t.setupContext||(t.setupContext=Ud(t))}function Nl(e){return Be(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let ua=!0;function gp(e){const t=_d(e),n=e.proxy,r=e.ctx;ua=!1,t.beforeCreate&&$l(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:u,created:c,beforeMount:f,mounted:h,beforeUpdate:_,updated:L,activated:C,deactivated:j,beforeDestroy:Z,beforeUnmount:B,destroyed:J,unmounted:W,render:ae,renderTracked:le,renderTriggered:ve,errorCaptured:ke,serverPrefetch:ne,expose:q,inheritAttrs:oe,components:Q,directives:Ie,filters:Ce}=t;if(u&&vp(u,r,null),i)for(const _e in i){const Re=i[_e];qe(Re)&&(r[_e]=Re.bind(n))}if(s){const _e=s.call(n,n);ht(_e)&&(e.data=ni(_e))}if(ua=!0,o)for(const _e in o){const Re=o[_e],ct=qe(Re)?Re.bind(n,n):qe(Re.get)?Re.get.bind(n,n):On,We=!qe(Re)&&qe(Re.set)?Re.set.bind(n):On,Ge=ie({get:ct,set:We});Object.defineProperty(r,_e,{enumerable:!0,configurable:!0,get:()=>Ge.value,set:Ye=>Ge.value=Ye})}if(a)for(const _e in a)bd(a[_e],r,n,_e);if(l){const _e=qe(l)?l.call(n):l;Reflect.ownKeys(_e).forEach(Re=>{Eo(Re,_e[Re])})}c&&$l(c,e,"c");function Ae(_e,Re){Be(Re)?Re.forEach(ct=>_e(ct.bind(n))):Re&&_e(Re.bind(n))}if(Ae(sp,f),Ae(sr,h),Ae(op,_),Ae(ip,L),Ae(tp,C),Ae(np,j),Ae(up,ke),Ae(cp,le),Ae(lp,ve),Ae(or,B),Ae(ii,W),Ae(ap,ne),Be(q))if(q.length){const _e=e.exposed||(e.exposed={});q.forEach(Re=>{Object.defineProperty(_e,Re,{get:()=>n[Re],set:ct=>n[Re]=ct,enumerable:!0})})}else e.exposed||(e.exposed={});ae&&e.render===On&&(e.render=ae),oe!=null&&(e.inheritAttrs=oe),Q&&(e.components=Q),Ie&&(e.directives=Ie),ne&&gd(e)}function vp(e,t,n=On){Be(e)&&(e=da(e));for(const r in e){const s=e[r];let o;ht(s)?"default"in s?o=vn(s.from||r,s.default,!0):o=vn(s.from||r):o=vn(s),Jt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function $l(e,t,n){_n(Be(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function bd(e,t,n,r){let s=r.includes(".")?ad(n,r):()=>n[r];if(Rt(e)){const o=t[e];qe(o)&&vt(s,o)}else if(qe(e))vt(s,e.bind(n));else if(ht(e))if(Be(e))e.forEach(o=>bd(o,t,n,r));else{const o=qe(e.handler)?e.handler.bind(n):t[e.handler];qe(o)&&vt(s,o,e)}}function _d(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(u=>Fo(l,u,i,!0)),Fo(l,t,i)),ht(t)&&o.set(t,l),l}function Fo(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Fo(e,o,n,!0),s&&s.forEach(i=>Fo(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=yp[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const yp={data:Dl,props:Ll,emits:Ll,methods:Ns,computed:Ns,beforeCreate:Yt,created:Yt,beforeMount:Yt,mounted:Yt,beforeUpdate:Yt,updated:Yt,beforeDestroy:Yt,beforeUnmount:Yt,destroyed:Yt,unmounted:Yt,activated:Yt,deactivated:Yt,errorCaptured:Yt,serverPrefetch:Yt,components:Ns,directives:Ns,watch:bp,provide:Dl,inject:wp};function Dl(e,t){return t?e?function(){return Nt(qe(e)?e.call(this,this):e,qe(t)?t.call(this,this):t)}:t:e}function wp(e,t){return Ns(da(e),da(t))}function da(e){if(Be(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Yt(e,t){return e?[...new Set([].concat(e,t))]:t}function Ns(e,t){return e?Nt(Object.create(null),e,t):t}function Ll(e,t){return e?Be(e)&&Be(t)?[...new Set([...e,...t])]:Nt(Object.create(null),Nl(e),Nl(t??{})):t}function bp(e,t){if(!e)return t;if(!t)return e;const n=Nt(Object.create(null),e);for(const r in t)n[r]=Yt(e[r],t[r]);return n}function kd(){return{app:null,config:{isNativeTag:Ru,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 _p=0;function kp(e,t){return function(r,s=null){qe(r)||(r=Nt({},r)),s!=null&&!ht(s)&&(s=null);const o=kd(),i=new WeakSet,a=[];let l=!1;const u=o.app={_uid:_p++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:Qp,get config(){return o.config},set config(c){},use(c,...f){return i.has(c)||(c&&qe(c.install)?(i.add(c),c.install(u,...f)):qe(c)&&(i.add(c),c(u,...f))),u},mixin(c){return o.mixins.includes(c)||o.mixins.push(c),u},component(c,f){return f?(o.components[c]=f,u):o.components[c]},directive(c,f){return f?(o.directives[c]=f,u):o.directives[c]},mount(c,f,h){if(!l){const _=u._ceVNode||Ee(r,s);return _.appContext=o,h===!0?h="svg":h===!1&&(h=void 0),e(_,c,h),l=!0,u._container=c,c.__vue_app__=u,ci(_.component)}},onUnmount(c){a.push(c)},unmount(){l&&(_n(a,u._instance,16),e(null,u._container),delete u._container.__vue_app__)},provide(c,f){return o.provides[c]=f,u},runWithContext(c){const f=ls;ls=u;try{return c()}finally{ls=f}}};return u}}let ls=null;const Tp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${fn(t)}Modifiers`]||e[`${Sr(t)}Modifiers`];function Ip(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||_t;let s=n;const o=t.startsWith("update:"),i=o&&Tp(r,t.slice(7));i&&(i.trim&&(s=n.map(c=>Rt(c)?c.trim():c)),i.number&&(s=n.map(La)));let a,l=r[a=bi(t)]||r[a=bi(fn(t))];!l&&o&&(l=r[a=bi(Sr(t))]),l&&_n(l,e,6,s);const u=r[a+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,_n(u,e,6,s)}}const Sp=new WeakMap;function Td(e,t,n=!1){const r=n?Sp:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!qe(e)){const l=u=>{const c=Td(u,t,!0);c&&(a=!0,Nt(i,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(ht(e)&&r.set(e,null),null):(Be(o)?o.forEach(l=>i[l]=null):Nt(i,o),ht(e)&&r.set(e,i),i)}function ai(e,t){return!e||!Xo(t)?!1:(t=t.slice(2).replace(/Once$/,""),dt(e,t[0].toLowerCase()+t.slice(1))||dt(e,Sr(t))||dt(e,t))}function jl(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:u,renderCache:c,props:f,data:h,setupState:_,ctx:L,inheritAttrs:C}=e,j=Lo(e);let Z,B;try{if(n.shapeFlag&4){const W=s||r,ae=W;Z=Rn(u.call(ae,W,c,f,_,h,L)),B=a}else{const W=t;Z=Rn(W.length>1?W(f,{attrs:a,slots:i,emit:l}):W(f,null)),B=t.props?a:Ep(a)}}catch(W){Us.length=0,ri(W,e,1),Z=Ee(qt)}let J=Z;if(B&&C!==!1){const W=Object.keys(B),{shapeFlag:ae}=J;W.length&&ae&7&&(o&&W.some(Na)&&(B=Cp(B,o)),J=Ir(J,B,!1,!0))}return n.dirs&&(J=Ir(J,null,!1,!0),J.dirs=J.dirs?J.dirs.concat(n.dirs):n.dirs),n.transition&&Ks(J,n.transition),Z=J,Lo(j),Z}const Ep=e=>{let t;for(const n in e)(n==="class"||n==="style"||Xo(n))&&((t||(t={}))[n]=e[n]);return t},Cp=(e,t)=>{const n={};for(const r in e)(!Na(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Ap(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:a,patchFlag:l}=t,u=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?Bl(r,i,u):!!i;if(l&8){const c=t.dynamicProps;for(let f=0;f<c.length;f++){const h=c[f];if(Id(i,r,h)&&!ai(u,h))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?Bl(r,i,u):!0:!!i;return!1}function Bl(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(Id(t,e,o)&&!ai(n,o))return!0}return!1}function Id(e,t,n){const r=e[n],s=t[n];return n==="style"&&ht(r)&&ht(s)?!ja(r,s):r!==s}function Rp({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 Sd={},Ed=()=>Object.create(Sd),Cd=e=>Object.getPrototypeOf(e)===Sd;function Pp(e,t,n,r=!1){const s={},o=Ed();e.propsDefaults=Object.create(null),Ad(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:Qu(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function xp(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=lt(s),[l]=e.propsOptions;let u=!1;if((r||i>0)&&!(i&16)){if(i&8){const c=e.vnode.dynamicProps;for(let f=0;f<c.length;f++){let h=c[f];if(ai(e.emitsOptions,h))continue;const _=t[h];if(l)if(dt(o,h))_!==o[h]&&(o[h]=_,u=!0);else{const L=fn(h);s[L]=fa(l,a,L,_,e,!1)}else _!==o[h]&&(o[h]=_,u=!0)}}}else{Ad(e,t,s,o)&&(u=!0);let c;for(const f in a)(!t||!dt(t,f)&&((c=Sr(f))===f||!dt(t,c)))&&(l?n&&(n[f]!==void 0||n[c]!==void 0)&&(s[f]=fa(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!dt(t,f))&&(delete o[f],u=!0)}u&&Gn(e.attrs,"set","")}function Ad(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if($s(l))continue;const u=t[l];let c;s&&dt(s,c=fn(l))?!o||!o.includes(c)?n[c]=u:(a||(a={}))[c]=u:ai(e.emitsOptions,l)||(!(l in r)||u!==r[l])&&(r[l]=u,i=!0)}if(o){const l=lt(n),u=a||_t;for(let c=0;c<o.length;c++){const f=o[c];n[f]=fa(s,l,f,u[f],e,!dt(u,f))}}return i}function fa(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=dt(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&qe(l)){const{propsDefaults:u}=s;if(n in u)r=u[n];else{const c=ao(s);r=u[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===Sr(n))&&(r=!0))}return r}const Mp=new WeakMap;function Rd(e,t,n=!1){const r=n?Mp:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!qe(e)){const c=f=>{l=!0;const[h,_]=Rd(f,t,!0);Nt(i,h),_&&a.push(..._)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!o&&!l)return ht(e)&&r.set(e,ss),ss;if(Be(o))for(let c=0;c<o.length;c++){const f=fn(o[c]);Fl(f)&&(i[f]=_t)}else if(o)for(const c in o){const f=fn(c);if(Fl(f)){const h=o[c],_=i[f]=Be(h)||qe(h)?{type:h}:Nt({},h),L=_.type;let C=!1,j=!0;if(Be(L))for(let Z=0;Z<L.length;++Z){const B=L[Z],J=qe(B)&&B.name;if(J==="Boolean"){C=!0;break}else J==="String"&&(j=!1)}else C=qe(L)&&L.name==="Boolean";_[0]=C,_[1]=j,(C||dt(_,"default"))&&a.push(f)}}const u=[i,a];return ht(e)&&r.set(e,u),u}function Fl(e){return e[0]!=="$"&&!$s(e)}const qa=e=>e==="_"||e==="_ctx"||e==="$stable",Ka=e=>Be(e)?e.map(Rn):[Rn(e)],Op=(e,t,n)=>{if(t._n)return t;const r=gt((...s)=>Ka(t(...s)),n);return r._c=!1,r},Pd=(e,t,n)=>{const r=e._ctx;for(const s in e){if(qa(s))continue;const o=e[s];if(qe(o))t[s]=Op(s,o,r);else if(o!=null){const i=Ka(o);t[s]=()=>i}}},xd=(e,t)=>{const n=Ka(t);e.slots.default=()=>n},Md=(e,t,n)=>{for(const r in t)(n||!qa(r))&&(e[r]=t[r])},Np=(e,t,n)=>{const r=e.slots=Ed();if(e.vnode.shapeFlag&32){const s=t._;s?(Md(r,t,n),n&&Nu(r,"_",s,!0)):Pd(t,r)}else t&&xd(e,t)},$p=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=_t;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:Md(s,t,n):(o=!t.$stable,Pd(t,s)),i=t}else t&&(xd(e,t),i={default:1});if(o)for(const a in s)!qa(a)&&i[a]==null&&delete s[a]},Gt=Fp;function Dp(e){return Lp(e)}function Lp(e,t){const n=ei();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:u,setElementText:c,parentNode:f,nextSibling:h,setScopeId:_=On,insertStaticContent:L}=e,C=(v,y,R,V=null,U=null,x=null,H=void 0,F=null,K=!!y.dynamicChildren)=>{if(v===y)return;v&&!Lr(v,y)&&(V=z(v),Ye(v,U,x,!0),v=null),y.patchFlag===-2&&(K=!1,y.dynamicChildren=null);const{type:G,ref:we,shapeFlag:ue}=y;switch(G){case li:j(v,y,R,V);break;case qt:Z(v,y,R,V);break;case Ai:v==null&&B(y,R,V,H);break;case je:Q(v,y,R,V,U,x,H,F,K);break;default:ue&1?ae(v,y,R,V,U,x,H,F,K):ue&6?Ie(v,y,R,V,U,x,H,F,K):(ue&64||ue&128)&&G.process(v,y,R,V,U,x,H,F,K,he)}we!=null&&U?Bs(we,v&&v.ref,x,y||v,!y):we==null&&v&&v.ref!=null&&Bs(v.ref,null,x,v,!0)},j=(v,y,R,V)=>{if(v==null)r(y.el=a(y.children),R,V);else{const U=y.el=v.el;y.children!==v.children&&u(U,y.children)}},Z=(v,y,R,V)=>{v==null?r(y.el=l(y.children||""),R,V):y.el=v.el},B=(v,y,R,V)=>{[v.el,v.anchor]=L(v.children,y,R,V,v.el,v.anchor)},J=({el:v,anchor:y},R,V)=>{let U;for(;v&&v!==y;)U=h(v),r(v,R,V),v=U;r(y,R,V)},W=({el:v,anchor:y})=>{let R;for(;v&&v!==y;)R=h(v),s(v),v=R;s(y)},ae=(v,y,R,V,U,x,H,F,K)=>{if(y.type==="svg"?H="svg":y.type==="math"&&(H="mathml"),v==null)le(y,R,V,U,x,H,F,K);else{const G=v.el&&v.el._isVueCE?v.el:null;try{G&&G._beginPatch(),ne(v,y,U,x,H,F,K)}finally{G&&G._endPatch()}}},le=(v,y,R,V,U,x,H,F)=>{let K,G;const{props:we,shapeFlag:ue,transition:me,dirs:Te}=v;if(K=v.el=i(v.type,x,we&&we.is,we),ue&8?c(K,v.children):ue&16&&ke(v.children,K,null,V,U,Ci(v,x),H,F),Te&&Pr(v,null,V,"created"),ve(K,v,v.scopeId,H,V),we){for(const ze in we)ze!=="value"&&!$s(ze)&&o(K,ze,null,we[ze],x,V);"value"in we&&o(K,"value",null,we.value,x),(G=we.onVnodeBeforeMount)&&En(G,V,v)}Te&&Pr(v,null,V,"beforeMount");const Oe=jp(U,me);Oe&&me.beforeEnter(K),r(K,y,R),((G=we&&we.onVnodeMounted)||Oe||Te)&&Gt(()=>{G&&En(G,V,v),Oe&&me.enter(K),Te&&Pr(v,null,V,"mounted")},U)},ve=(v,y,R,V,U)=>{if(R&&_(v,R),V)for(let x=0;x<V.length;x++)_(v,V[x]);if(U){let x=U.subTree;if(y===x||$d(x.type)&&(x.ssContent===y||x.ssFallback===y)){const H=U.vnode;ve(v,H,H.scopeId,H.slotScopeIds,U.parent)}}},ke=(v,y,R,V,U,x,H,F,K=0)=>{for(let G=K;G<v.length;G++){const we=v[G]=F?Wn(v[G]):Rn(v[G]);C(null,we,y,R,V,U,x,H,F)}},ne=(v,y,R,V,U,x,H)=>{const F=y.el=v.el;let{patchFlag:K,dynamicChildren:G,dirs:we}=y;K|=v.patchFlag&16;const ue=v.props||_t,me=y.props||_t;let Te;if(R&&xr(R,!1),(Te=me.onVnodeBeforeUpdate)&&En(Te,R,y,v),we&&Pr(y,v,R,"beforeUpdate"),R&&xr(R,!0),(ue.innerHTML&&me.innerHTML==null||ue.textContent&&me.textContent==null)&&c(F,""),G?q(v.dynamicChildren,G,F,R,V,Ci(y,U),x):H||Re(v,y,F,null,R,V,Ci(y,U),x,!1),K>0){if(K&16)oe(F,ue,me,R,U);else if(K&2&&ue.class!==me.class&&o(F,"class",null,me.class,U),K&4&&o(F,"style",ue.style,me.style,U),K&8){const Oe=y.dynamicProps;for(let ze=0;ze<Oe.length;ze++){const Ve=Oe[ze],De=ue[Ve],pt=me[Ve];(pt!==De||Ve==="value")&&o(F,Ve,De,pt,U,R)}}K&1&&v.children!==y.children&&c(F,y.children)}else!H&&G==null&&oe(F,ue,me,R,U);((Te=me.onVnodeUpdated)||we)&&Gt(()=>{Te&&En(Te,R,y,v),we&&Pr(y,v,R,"updated")},V)},q=(v,y,R,V,U,x,H)=>{for(let F=0;F<y.length;F++){const K=v[F],G=y[F],we=K.el&&(K.type===je||!Lr(K,G)||K.shapeFlag&198)?f(K.el):R;C(K,G,we,null,V,U,x,H,!0)}},oe=(v,y,R,V,U)=>{if(y!==R){if(y!==_t)for(const x in y)!$s(x)&&!(x in R)&&o(v,x,y[x],null,U,V);for(const x in R){if($s(x))continue;const H=R[x],F=y[x];H!==F&&x!=="value"&&o(v,x,F,H,U,V)}"value"in R&&o(v,"value",y.value,R.value,U)}},Q=(v,y,R,V,U,x,H,F,K)=>{const G=y.el=v?v.el:a(""),we=y.anchor=v?v.anchor:a("");let{patchFlag:ue,dynamicChildren:me,slotScopeIds:Te}=y;Te&&(F=F?F.concat(Te):Te),v==null?(r(G,R,V),r(we,R,V),ke(y.children||[],R,we,U,x,H,F,K)):ue>0&&ue&64&&me&&v.dynamicChildren&&v.dynamicChildren.length===me.length?(q(v.dynamicChildren,me,R,U,x,H,F),(y.key!=null||U&&y===U.subTree)&&Ja(v,y,!0)):Re(v,y,R,we,U,x,H,F,K)},Ie=(v,y,R,V,U,x,H,F,K)=>{y.slotScopeIds=F,v==null?y.shapeFlag&512?U.ctx.activate(y,R,V,H,K):Ce(y,R,V,U,x,H,K):Le(v,y,K)},Ce=(v,y,R,V,U,x,H)=>{const F=v.component=zp(v,V,U);if(si(v)&&(F.ctx.renderer=he),qp(F,!1,H),F.asyncDep){if(U&&U.registerDep(F,Ae,H),!v.el){const K=F.subTree=Ee(qt);Z(null,K,y,R),v.placeholder=K.el}}else Ae(F,v,y,R,U,x,H)},Le=(v,y,R)=>{const V=y.component=v.component;if(Ap(v,y,R))if(V.asyncDep&&!V.asyncResolved){_e(V,y,R);return}else V.next=y,V.update();else y.el=v.el,V.vnode=y},Ae=(v,y,R,V,U,x,H)=>{const F=()=>{if(v.isMounted){let{next:ue,bu:me,u:Te,parent:Oe,vnode:ze}=v;{const Ze=Od(v);if(Ze){ue&&(ue.el=ze.el,_e(v,ue,H)),Ze.asyncDep.then(()=>{Gt(()=>{v.isUnmounted||G()},U)});return}}let Ve=ue,De;xr(v,!1),ue?(ue.el=ze.el,_e(v,ue,H)):ue=ze,me&&So(me),(De=ue.props&&ue.props.onVnodeBeforeUpdate)&&En(De,Oe,ue,ze),xr(v,!0);const pt=jl(v),Xe=v.subTree;v.subTree=pt,C(Xe,pt,f(Xe.el),z(Xe),v,U,x),ue.el=pt.el,Ve===null&&Rp(v,pt.el),Te&&Gt(Te,U),(De=ue.props&&ue.props.onVnodeUpdated)&&Gt(()=>En(De,Oe,ue,ze),U)}else{let ue;const{el:me,props:Te}=y,{bm:Oe,m:ze,parent:Ve,root:De,type:pt}=v,Xe=as(y);xr(v,!1),Oe&&So(Oe),!Xe&&(ue=Te&&Te.onVnodeBeforeMount)&&En(ue,Ve,y),xr(v,!0);{De.ce&&De.ce._hasShadowRoot()&&De.ce._injectChildStyle(pt);const Ze=v.subTree=jl(v);C(null,Ze,R,V,v,U,x),y.el=Ze.el}if(ze&&Gt(ze,U),!Xe&&(ue=Te&&Te.onVnodeMounted)){const Ze=y;Gt(()=>En(ue,Ve,Ze),U)}(y.shapeFlag&256||Ve&&as(Ve.vnode)&&Ve.vnode.shapeFlag&256)&&v.a&&Gt(v.a,U),v.isMounted=!0,y=R=V=null}};v.scope.on();const K=v.effect=new ju(F);v.scope.off();const G=v.update=K.run.bind(K),we=v.job=K.runIfDirty.bind(K);we.i=v,we.id=v.uid,K.scheduler=()=>za(we),xr(v,!0),G()},_e=(v,y,R)=>{y.component=v;const V=v.vnode.props;v.vnode=y,v.next=null,xp(v,y.props,V,R),$p(v,y.children,R),Yn(),El(v),Xn()},Re=(v,y,R,V,U,x,H,F,K=!1)=>{const G=v&&v.children,we=v?v.shapeFlag:0,ue=y.children,{patchFlag:me,shapeFlag:Te}=y;if(me>0){if(me&128){We(G,ue,R,V,U,x,H,F,K);return}else if(me&256){ct(G,ue,R,V,U,x,H,F,K);return}}Te&8?(we&16&&tt(G,U,x),ue!==G&&c(R,ue)):we&16?Te&16?We(G,ue,R,V,U,x,H,F,K):tt(G,U,x,!0):(we&8&&c(R,""),Te&16&&ke(ue,R,V,U,x,H,F,K))},ct=(v,y,R,V,U,x,H,F,K)=>{v=v||ss,y=y||ss;const G=v.length,we=y.length,ue=Math.min(G,we);let me;for(me=0;me<ue;me++){const Te=y[me]=K?Wn(y[me]):Rn(y[me]);C(v[me],Te,R,null,U,x,H,F,K)}G>we?tt(v,U,x,!0,!1,ue):ke(y,R,V,U,x,H,F,K,ue)},We=(v,y,R,V,U,x,H,F,K)=>{let G=0;const we=y.length;let ue=v.length-1,me=we-1;for(;G<=ue&&G<=me;){const Te=v[G],Oe=y[G]=K?Wn(y[G]):Rn(y[G]);if(Lr(Te,Oe))C(Te,Oe,R,null,U,x,H,F,K);else break;G++}for(;G<=ue&&G<=me;){const Te=v[ue],Oe=y[me]=K?Wn(y[me]):Rn(y[me]);if(Lr(Te,Oe))C(Te,Oe,R,null,U,x,H,F,K);else break;ue--,me--}if(G>ue){if(G<=me){const Te=me+1,Oe=Te<we?y[Te].el:V;for(;G<=me;)C(null,y[G]=K?Wn(y[G]):Rn(y[G]),R,Oe,U,x,H,F,K),G++}}else if(G>me)for(;G<=ue;)Ye(v[G],U,x,!0),G++;else{const Te=G,Oe=G,ze=new Map;for(G=Oe;G<=me;G++){const mt=y[G]=K?Wn(y[G]):Rn(y[G]);mt.key!=null&&ze.set(mt.key,G)}let Ve,De=0;const pt=me-Oe+1;let Xe=!1,Ze=0;const jt=new Array(pt);for(G=0;G<pt;G++)jt[G]=0;for(G=Te;G<=ue;G++){const mt=v[G];if(De>=pt){Ye(mt,U,x,!0);continue}let Tt;if(mt.key!=null)Tt=ze.get(mt.key);else for(Ve=Oe;Ve<=me;Ve++)if(jt[Ve-Oe]===0&&Lr(mt,y[Ve])){Tt=Ve;break}Tt===void 0?Ye(mt,U,x,!0):(jt[Tt-Oe]=G+1,Tt>=Ze?Ze=Tt:Xe=!0,C(mt,y[Tt],R,null,U,x,H,F,K),De++)}const Bt=Xe?Bp(jt):ss;for(Ve=Bt.length-1,G=pt-1;G>=0;G--){const mt=Oe+G,Tt=y[mt],$t=y[mt+1],It=mt+1<we?$t.el||Nd($t):V;jt[G]===0?C(null,Tt,R,It,U,x,H,F,K):Xe&&(Ve<0||G!==Bt[Ve]?Ge(Tt,R,It,2):Ve--)}}},Ge=(v,y,R,V,U=null)=>{const{el:x,type:H,transition:F,children:K,shapeFlag:G}=v;if(G&6){Ge(v.component.subTree,y,R,V);return}if(G&128){v.suspense.move(y,R,V);return}if(G&64){H.move(v,y,R,he);return}if(H===je){r(x,y,R);for(let ue=0;ue<K.length;ue++)Ge(K[ue],y,R,V);r(v.anchor,y,R);return}if(H===Ai){J(v,y,R);return}if(V!==2&&G&1&&F)if(V===0)F.beforeEnter(x),r(x,y,R),Gt(()=>F.enter(x),U);else{const{leave:ue,delayLeave:me,afterLeave:Te}=F,Oe=()=>{v.ctx.isUnmounted?s(x):r(x,y,R)},ze=()=>{x._isLeaving&&x[An](!0),ue(x,()=>{Oe(),Te&&Te()})};me?me(x,Oe,ze):ze()}else r(x,y,R)},Ye=(v,y,R,V=!1,U=!1)=>{const{type:x,props:H,ref:F,children:K,dynamicChildren:G,shapeFlag:we,patchFlag:ue,dirs:me,cacheIndex:Te}=v;if(ue===-2&&(U=!1),F!=null&&(Yn(),Bs(F,null,R,v,!0),Xn()),Te!=null&&(y.renderCache[Te]=void 0),we&256){y.ctx.deactivate(v);return}const Oe=we&1&&me,ze=!as(v);let Ve;if(ze&&(Ve=H&&H.onVnodeBeforeUnmount)&&En(Ve,y,v),we&6)Fe(v.component,R,V);else{if(we&128){v.suspense.unmount(R,V);return}Oe&&Pr(v,null,y,"beforeUnmount"),we&64?v.type.remove(v,y,R,he,V):G&&!G.hasOnce&&(x!==je||ue>0&&ue&64)?tt(G,y,R,!1,!0):(x===je&&ue&384||!U&&we&16)&&tt(K,y,R),V&&st(v)}(ze&&(Ve=H&&H.onVnodeUnmounted)||Oe)&&Gt(()=>{Ve&&En(Ve,y,v),Oe&&Pr(v,null,y,"unmounted")},R)},st=v=>{const{type:y,el:R,anchor:V,transition:U}=v;if(y===je){nt(R,V);return}if(y===Ai){W(v);return}const x=()=>{s(R),U&&!U.persisted&&U.afterLeave&&U.afterLeave()};if(v.shapeFlag&1&&U&&!U.persisted){const{leave:H,delayLeave:F}=U,K=()=>H(R,x);F?F(v.el,x,K):K()}else x()},nt=(v,y)=>{let R;for(;v!==y;)R=h(v),s(v),v=R;s(y)},Fe=(v,y,R)=>{const{bum:V,scope:U,job:x,subTree:H,um:F,m:K,a:G}=v;Ul(K),Ul(G),V&&So(V),U.stop(),x&&(x.flags|=8,Ye(H,v,y,R)),F&&Gt(F,y),Gt(()=>{v.isUnmounted=!0},y)},tt=(v,y,R,V=!1,U=!1,x=0)=>{for(let H=x;H<v.length;H++)Ye(v[H],y,R,V,U)},z=v=>{if(v.shapeFlag&6)return z(v.component.subTree);if(v.shapeFlag&128)return v.suspense.next();const y=h(v.anchor||v.el),R=y&&y[ld];return R?h(R):y};let fe=!1;const ce=(v,y,R)=>{let V;v==null?y._vnode&&(Ye(y._vnode,null,null,!0),V=y._vnode.component):C(y._vnode||null,v,y,null,null,null,R),y._vnode=v,fe||(fe=!0,El(V),rd(),fe=!1)},he={p:C,um:Ye,m:Ge,r:st,mt:Ce,mc:ke,pc:Re,pbc:q,n:z,o:e};return{render:ce,hydrate:void 0,createApp:kp(ce)}}function Ci({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 xr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function jp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ja(e,t,n=!1){const r=e.children,s=t.children;if(Be(r)&&Be(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]=Wn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&Ja(i,a)),a.type===li&&(a.patchFlag===-1&&(a=s[o]=Wn(a)),a.el=i.el),a.type===qt&&!a.el&&(a.el=i.el)}}function Bp(e){const t=e.slice(),n=[0];let r,s,o,i,a;const l=e.length;for(r=0;r<l;r++){const u=e[r];if(u!==0){if(s=n[n.length-1],e[s]<u){t[r]=s,n.push(r);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,e[n[a]]<u?o=a+1:i=a;u<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 Od(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Od(t)}function Ul(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Nd(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Nd(t.subTree):null}const $d=e=>e.__isSuspense;function Fp(e,t){t&&t.pendingBranch?Be(e)?t.effects.push(...e):t.effects.push(e):qh(e)}const je=Symbol.for("v-fgt"),li=Symbol.for("v-txt"),qt=Symbol.for("v-cmt"),Ai=Symbol.for("v-stc"),Us=[];let an=null;function w(e=!1){Us.push(an=e?null:[])}function Up(){Us.pop(),an=Us[Us.length-1]||null}let Js=1;function Uo(e,t=!1){Js+=e,e<0&&an&&t&&(an.hasOnce=!0)}function Dd(e){return e.dynamicChildren=Js>0?an||ss:null,Up(),Js>0&&an&&an.push(e),e}function T(e,t,n,r,s,o){return Dd(p(e,t,n,r,s,o,!0))}function ft(e,t,n,r,s){return Dd(Ee(e,t,n,r,s,!0))}function Ys(e){return e?e.__v_isVNode===!0:!1}function Lr(e,t){return e.type===t.type&&e.key===t.key}const Ld=({key:e})=>e??null,Ao=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Rt(e)||Jt(e)||qe(e)?{i:Ut,r:e,k:t,f:!!n}:e:null);function p(e,t=null,n=null,r=0,s=null,o=e===je?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ld(t),ref:t&&Ao(t),scopeId:od,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:Ut};return a?(Ya(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=Rt(n)?8:16),Js>0&&!i&&an&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&an.push(l),l}const Ee=Hp;function Hp(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===yd)&&(e=qt),Ys(e)){const a=Ir(e,t,!0);return n&&Ya(a,n),Js>0&&!o&&an&&(a.shapeFlag&6?an[an.indexOf(e)]=a:an.push(a)),a.patchFlag=-2,a}if(Xp(e)&&(e=e.__vccOpts),t){t=Vp(t);let{class:a,style:l}=t;a&&!Rt(a)&&(t.class=at(a)),ht(l)&&(Ga(l)&&!Be(l)&&(l=Nt({},l)),t.style=Wr(l))}const i=Rt(e)?1:$d(e)?128:cd(e)?64:ht(e)?4:qe(e)?2:0;return p(e,t,n,r,s,i,o,!0)}function Vp(e){return e?Ga(e)||Cd(e)?Nt({},e):e:null}function Ir(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,u=t?jd(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Ld(u),ref:t&&t.ref?n&&o?Be(o)?o.concat(Ao(t)):[o,Ao(t)]:Ao(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!==je?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&&Ir(e.ssContent),ssFallback:e.ssFallback&&Ir(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Ks(c,l.clone(c)),c}function Xs(e=" ",t=0){return Ee(li,null,e,t)}function re(e="",t=!1){return t?(w(),ft(qt,null,e)):Ee(qt,null,e)}function Rn(e){return e==null||typeof e=="boolean"?Ee(qt):Be(e)?Ee(je,null,e.slice()):Ys(e)?Wn(e):Ee(li,null,String(e))}function Wn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ir(e)}function Ya(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Be(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),Ya(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!Cd(t)?t._ctx=Ut:s===3&&Ut&&(Ut.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else qe(t)?(t={default:t,_ctx:Ut},n=32):(t=String(t),r&64?(n=16,t=[Xs(t)]):n=8);e.children=t,e.shapeFlag|=n}function jd(...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=at([t.class,r.class]));else if(s==="style")t.style=Wr([t.style,r.style]);else if(Xo(s)){const o=t[s],i=r[s];i&&o!==i&&!(Be(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function En(e,t,n,r=null){_n(e,t,7,[n,r])}const Wp=kd();let Gp=0;function zp(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||Wp,o={uid:Gp++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new vh(!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:Rd(r,s),emitsOptions:Td(r,s),emit:null,emitted:null,propsDefaults:_t,inheritAttrs:r.inheritAttrs,ctx:_t,data:_t,props:_t,attrs:_t,slots:_t,refs:_t,setupState:_t,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=Ip.bind(null,o),e.ce&&e.ce(o),o}let Kt=null;const Xa=()=>Kt||Ut;let Ho,ha;{const e=ei(),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)}};Ho=t("__VUE_INSTANCE_SETTERS__",n=>Kt=n),ha=t("__VUE_SSR_SETTERS__",n=>Qs=n)}const ao=e=>{const t=Kt;return Ho(e),e.scope.on(),()=>{e.scope.off(),Ho(t)}},Hl=()=>{Kt&&Kt.scope.off(),Ho(null)};function Bd(e){return e.vnode.shapeFlag&4}let Qs=!1;function qp(e,t=!1,n=!1){t&&ha(t);const{props:r,children:s}=e.vnode,o=Bd(e);Pp(e,r,o,t),Np(e,s,n||t);const i=o?Kp(e,t):void 0;return t&&ha(!1),i}function Kp(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,hp);const{setup:r}=n;if(r){Yn();const s=e.setupContext=r.length>1?Ud(e):null,o=ao(e),i=io(r,e,0,[e.props,s]),a=xu(i);if(Xn(),o(),(a||e.sp)&&!as(e)&&gd(e),a){if(i.then(Hl,Hl),t)return i.then(l=>{Vl(e,l)}).catch(l=>{ri(l,e,0)});e.asyncDep=i}else Vl(e,i)}else Fd(e)}function Vl(e,t,n){qe(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ht(t)&&(e.setupState=ed(t)),Fd(e)}function Fd(e,t,n){const r=e.type;e.render||(e.render=r.render||On);{const s=ao(e);Yn();try{gp(e)}finally{Xn(),s()}}}const Jp={get(e,t){return zt(e,"get",""),e[t]}};function Ud(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Jp),slots:e.slots,emit:e.emit,expose:t}}function ci(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ed(Lh(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Fs)return Fs[n](e)},has(t,n){return n in t||n in Fs}})):e.proxy}function Yp(e,t=!0){return qe(e)?e.displayName||e.name:e.name||t&&e.__name}function Xp(e){return qe(e)&&"__vccOpts"in e}const ie=(e,t)=>Hh(e,t,Qs);function Qa(e,t,n){try{Uo(-1);const r=arguments.length;return r===2?ht(t)&&!Be(t)?Ys(t)?Ee(e,null,[t]):Ee(e,t):Ee(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ys(n)&&(n=[n]),Ee(e,t,n))}finally{Uo(1)}}const Qp="3.5.28";/**
|
|
14
|
+
* @vue/runtime-dom v3.5.28
|
|
15
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
16
|
+
* @license MIT
|
|
17
|
+
**/let pa;const Wl=typeof window<"u"&&window.trustedTypes;if(Wl)try{pa=Wl.createPolicy("vue",{createHTML:e=>e})}catch{}const Hd=pa?e=>pa.createHTML(e):e=>e,Zp="http://www.w3.org/2000/svg",em="http://www.w3.org/1998/Math/MathML",Vn=typeof document<"u"?document:null,Gl=Vn&&Vn.createElement("template"),tm={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"?Vn.createElementNS(Zp,e):t==="mathml"?Vn.createElementNS(em,e):n?Vn.createElement(e,{is:n}):Vn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>Vn.createTextNode(e),createComment:e=>Vn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Vn.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{Gl.innerHTML=Hd(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Gl.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]}},ur="transition",Ps="animation",Zs=Symbol("_vtc"),Vd={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},nm=Nt({},dd,Vd),rm=e=>(e.displayName="Transition",e.props=nm,e),Wd=rm((e,{slots:t})=>Qa(ep,sm(e),t)),Mr=(e,t=[])=>{Be(e)?e.forEach(n=>n(...t)):e&&e(...t)},zl=e=>e?Be(e)?e.some(t=>t.length>1):e.length>1:!1;function sm(e){const t={};for(const Q in e)Q in Vd||(t[Q]=e[Q]);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:u=i,appearToClass:c=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:_=`${n}-leave-to`}=e,L=om(s),C=L&&L[0],j=L&&L[1],{onBeforeEnter:Z,onEnter:B,onEnterCancelled:J,onLeave:W,onLeaveCancelled:ae,onBeforeAppear:le=Z,onAppear:ve=B,onAppearCancelled:ke=J}=t,ne=(Q,Ie,Ce,Le)=>{Q._enterCancelled=Le,Or(Q,Ie?c:a),Or(Q,Ie?u:i),Ce&&Ce()},q=(Q,Ie)=>{Q._isLeaving=!1,Or(Q,f),Or(Q,_),Or(Q,h),Ie&&Ie()},oe=Q=>(Ie,Ce)=>{const Le=Q?ve:B,Ae=()=>ne(Ie,Q,Ce);Mr(Le,[Ie,Ae]),ql(()=>{Or(Ie,Q?l:o),Un(Ie,Q?c:a),zl(Le)||Kl(Ie,r,C,Ae)})};return Nt(t,{onBeforeEnter(Q){Mr(Z,[Q]),Un(Q,o),Un(Q,i)},onBeforeAppear(Q){Mr(le,[Q]),Un(Q,l),Un(Q,u)},onEnter:oe(!1),onAppear:oe(!0),onLeave(Q,Ie){Q._isLeaving=!0;const Ce=()=>q(Q,Ie);Un(Q,f),Q._enterCancelled?(Un(Q,h),Xl(Q)):(Xl(Q),Un(Q,h)),ql(()=>{Q._isLeaving&&(Or(Q,f),Un(Q,_),zl(W)||Kl(Q,r,j,Ce))}),Mr(W,[Q,Ce])},onEnterCancelled(Q){ne(Q,!1,void 0,!0),Mr(J,[Q])},onAppearCancelled(Q){ne(Q,!0,void 0,!0),Mr(ke,[Q])},onLeaveCancelled(Q){q(Q),Mr(ae,[Q])}})}function om(e){if(e==null)return null;if(ht(e))return[Ri(e.enter),Ri(e.leave)];{const t=Ri(e);return[t,t]}}function Ri(e){return ch(e)}function Un(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Zs]||(e[Zs]=new Set)).add(t)}function Or(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Zs];n&&(n.delete(t),n.size||(e[Zs]=void 0))}function ql(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let im=0;function Kl(e,t,n,r){const s=e._endId=++im,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=am(e,t);if(!i)return r();const u=i+"end";let c=0;const f=()=>{e.removeEventListener(u,h),o()},h=_=>{_.target===e&&++c>=l&&f()};setTimeout(()=>{c<l&&f()},a+1),e.addEventListener(u,h)}function am(e,t){const n=window.getComputedStyle(e),r=L=>(n[L]||"").split(", "),s=r(`${ur}Delay`),o=r(`${ur}Duration`),i=Jl(s,o),a=r(`${Ps}Delay`),l=r(`${Ps}Duration`),u=Jl(a,l);let c=null,f=0,h=0;t===ur?i>0&&(c=ur,f=i,h=o.length):t===Ps?u>0&&(c=Ps,f=u,h=l.length):(f=Math.max(i,u),c=f>0?i>u?ur:Ps:null,h=c?c===ur?o.length:l.length:0);const _=c===ur&&/\b(?:transform|all)(?:,|$)/.test(r(`${ur}Property`).toString());return{type:c,timeout:f,propCount:h,hasTransform:_}}function Jl(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Yl(n)+Yl(e[r])))}function Yl(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Xl(e){return(e?e.ownerDocument:document).body.offsetHeight}function lm(e,t,n){const r=e[Zs];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Ql=Symbol("_vod"),cm=Symbol("_vsh"),um=Symbol(""),dm=/(?:^|;)\s*display\s*:/;function fm(e,t,n){const r=e.style,s=Rt(n);let o=!1;if(n&&!s){if(t)if(Rt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Ro(r,a,"")}else for(const i in t)n[i]==null&&Ro(r,i,"");for(const i in n)i==="display"&&(o=!0),Ro(r,i,n[i])}else if(s){if(t!==n){const i=r[um];i&&(n+=";"+i),r.cssText=n,o=dm.test(n)}}else t&&e.removeAttribute("style");Ql in e&&(e[Ql]=o?r.display:"",e[cm]&&(r.display="none"))}const Zl=/\s*!important$/;function Ro(e,t,n){if(Be(n))n.forEach(r=>Ro(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=hm(e,t);Zl.test(n)?e.setProperty(Sr(r),n.replace(Zl,""),"important"):e[r]=n}}const ec=["Webkit","Moz","ms"],Pi={};function hm(e,t){const n=Pi[t];if(n)return n;let r=fn(t);if(r!=="filter"&&r in e)return Pi[t]=r;r=Zo(r);for(let s=0;s<ec.length;s++){const o=ec[s]+r;if(o in e)return Pi[t]=o}return t}const tc="http://www.w3.org/1999/xlink";function nc(e,t,n,r,s,o=mh(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(tc,t.slice(6,t.length)):e.setAttributeNS(tc,t,n):n==null||o&&!$u(n)?e.removeAttribute(t):e.setAttribute(t,o?"":wn(n)?String(n):n)}function rc(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Hd(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=$u(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 ns(e,t,n,r){e.addEventListener(t,n,r)}function pm(e,t,n,r){e.removeEventListener(t,n,r)}const sc=Symbol("_vei");function mm(e,t,n,r,s=null){const o=e[sc]||(e[sc]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=gm(t);if(r){const u=o[t]=wm(r,s);ns(e,a,u,l)}else i&&(pm(e,a,i,l),o[t]=void 0)}}const oc=/(?:Once|Passive|Capture)$/;function gm(e){let t;if(oc.test(e)){t={};let r;for(;r=e.match(oc);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Sr(e.slice(2)),t]}let xi=0;const vm=Promise.resolve(),ym=()=>xi||(vm.then(()=>xi=0),xi=Date.now());function wm(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;_n(bm(r,n.value),t,5,[r])};return n.value=e,n.attached=ym(),n}function bm(e,t){if(Be(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 ic=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,_m=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?lm(e,r,i):t==="style"?fm(e,n,r):Xo(t)?Na(t)||mm(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):km(e,t,r,i))?(rc(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&nc(e,t,r,i,o,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Rt(r))?rc(e,fn(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),nc(e,t,r,i))};function km(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&ic(t)&&qe(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 ic(t)&&Rt(n)?!1:t in e}const ac=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Be(t)?n=>So(t,n):t};function Tm(e){e.target.composing=!0}function lc(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Mi=Symbol("_assign");function cc(e,t,n){return t&&(e=e.trim()),n&&(e=La(e)),e}const er={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[Mi]=ac(s);const o=r||s.props&&s.props.type==="number";ns(e,t?"change":"input",i=>{i.target.composing||e[Mi](cc(e.value,n,o))}),(n||o)&&ns(e,"change",()=>{e.value=cc(e.value,n,o)}),t||(ns(e,"compositionstart",Tm),ns(e,"compositionend",lc),ns(e,"change",lc))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[Mi]=ac(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?La(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))}},Im=["ctrl","shift","alt","meta"],Sm={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)=>Im.some(n=>e[`${n}Key`]&&!t.includes(n))},it=(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=Sm[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},Em={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Zt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=Sr(s.key);if(t.some(i=>i===o||Em[i]===o))return e(s)}))},Cm=Nt({patchProp:_m},tm);let uc;function Am(){return uc||(uc=Dp(Cm))}const Rm=((...e)=>{const t=Am().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=xm(r);if(!s)return;const o=t._component;!qe(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Pm(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Pm(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function xm(e){return Rt(e)?document.querySelector(e):e}/*!
|
|
18
|
+
* vue-router v4.6.4
|
|
19
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
20
|
+
* @license MIT
|
|
21
|
+
*/const rs=typeof document<"u";function Gd(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Mm(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Gd(e.default)}const ut=Object.assign;function Oi(e,t){const n={};for(const r in t){const s=t[r];n[r]=kn(s)?s.map(e):e(s)}return n}const Hs=()=>{},kn=Array.isArray;function dc(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const zd=/#/g,Om=/&/g,Nm=/\//g,$m=/=/g,Dm=/\?/g,qd=/\+/g,Lm=/%5B/g,jm=/%5D/g,Kd=/%5E/g,Bm=/%60/g,Jd=/%7B/g,Fm=/%7C/g,Yd=/%7D/g,Um=/%20/g;function Za(e){return e==null?"":encodeURI(""+e).replace(Fm,"|").replace(Lm,"[").replace(jm,"]")}function Hm(e){return Za(e).replace(Jd,"{").replace(Yd,"}").replace(Kd,"^")}function ma(e){return Za(e).replace(qd,"%2B").replace(Um,"+").replace(zd,"%23").replace(Om,"%26").replace(Bm,"`").replace(Jd,"{").replace(Yd,"}").replace(Kd,"^")}function Vm(e){return ma(e).replace($m,"%3D")}function Wm(e){return Za(e).replace(zd,"%23").replace(Dm,"%3F")}function Gm(e){return Wm(e).replace(Nm,"%2F")}function eo(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const zm=/\/$/,qm=e=>e.replace(zm,"");function Ni(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=Xm(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:eo(i)}}function Km(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function fc(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Jm(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&ps(t.matched[r],n.matched[s])&&Xd(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function ps(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Xd(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Ym(e[n],t[n]))return!1;return!0}function Ym(e,t){return kn(e)?hc(e,t):kn(t)?hc(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function hc(e,t){return kn(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function Xm(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 dr={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let ga=(function(e){return e.pop="pop",e.push="push",e})({}),$i=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Qm(e){if(!e)if(rs){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),qm(e)}const Zm=/^[^#]+#/;function eg(e,t){return e.replace(Zm,"#")+t}function tg(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 ui=()=>({left:window.scrollX,top:window.scrollY});function ng(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=tg(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 pc(e,t){return(history.state?history.state.position-t:-1)+e}const va=new Map;function rg(e,t){va.set(e,t)}function sg(e){const t=va.get(e);return va.delete(e),t}function og(e){return typeof e=="string"||e&&typeof e=="object"}function Qd(e){return typeof e=="string"||typeof e=="symbol"}let Pt=(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 Zd=Symbol("");Pt.MATCHER_NOT_FOUND+"",Pt.NAVIGATION_GUARD_REDIRECT+"",Pt.NAVIGATION_ABORTED+"",Pt.NAVIGATION_CANCELLED+"",Pt.NAVIGATION_DUPLICATED+"";function ms(e,t){return ut(new Error,{type:e,[Zd]:!0},t)}function Hn(e,t){return e instanceof Error&&Zd in e&&(t==null||!!(e.type&t))}const ig=["params","query","hash"];function ag(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of ig)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function lg(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(qd," "),o=s.indexOf("="),i=eo(o<0?s:s.slice(0,o)),a=o<0?null:eo(s.slice(o+1));if(i in t){let l=t[i];kn(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function mc(e){let t="";for(let n in e){const r=e[n];if(n=Vm(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(kn(r)?r.map(s=>s&&ma(s)):[r&&ma(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function cg(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=kn(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const ug=Symbol(""),gc=Symbol(""),di=Symbol(""),el=Symbol(""),ya=Symbol("");function xs(){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 gr(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const u=h=>{h===!1?l(ms(Pt.NAVIGATION_ABORTED,{from:n,to:t})):h instanceof Error?l(h):og(h)?l(ms(Pt.NAVIGATION_GUARD_REDIRECT,{from:t,to:h})):(i&&r.enterCallbacks[s]===i&&typeof h=="function"&&i.push(h),a())},c=o(()=>e.call(r&&r.instances[s],t,n,u));let f=Promise.resolve(c);e.length<3&&(f=f.then(u)),f.catch(h=>l(h))})}function Di(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(Gd(l)){const u=(l.__vccOpts||l)[t];u&&o.push(gr(u,n,r,i,a,s))}else{let u=l();o.push(()=>u.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const f=Mm(c)?c.default:c;i.mods[a]=c,i.components[a]=f;const h=(f.__vccOpts||f)[t];return h&&gr(h,n,r,i,a,s)()}))}}return o}function dg(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(u=>ps(u,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(u=>ps(u,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 fg=()=>location.protocol+"//"+location.host;function ef(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),fc(a,"")}return fc(n,e)+r+s}function hg(e,t,n,r){let s=[],o=[],i=null;const a=({state:h})=>{const _=ef(e,location),L=n.value,C=t.value;let j=0;if(h){if(n.value=_,t.value=h,i&&i===L){i=null;return}j=C?h.position-C.position:0}else r(_);s.forEach(Z=>{Z(n.value,L,{delta:j,type:ga.pop,direction:j?j>0?$i.forward:$i.back:$i.unknown})})};function l(){i=n.value}function u(h){s.push(h);const _=()=>{const L=s.indexOf(h);L>-1&&s.splice(L,1)};return o.push(_),_}function c(){if(document.visibilityState==="hidden"){const{history:h}=window;if(!h.state)return;h.replaceState(ut({},h.state,{scroll:ui()}),"")}}function f(){for(const h of o)h();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:u,destroy:f}}function vc(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?ui():null}}function pg(e){const{history:t,location:n}=window,r={value:ef(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,u,c){const f=e.indexOf("#"),h=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:fg()+e+l;try{t[c?"replaceState":"pushState"](u,"",h),s.value=u}catch(_){console.error(_),n[c?"replace":"assign"](h)}}function i(l,u){o(l,ut({},t.state,vc(s.value.back,l,s.value.forward,!0),u,{position:s.value.position}),!0),r.value=l}function a(l,u){const c=ut({},s.value,t.state,{forward:l,scroll:ui()});o(c.current,c,!0),o(l,ut({},vc(r.value,l,null),{position:c.position+1},u),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function mg(e){e=Qm(e);const t=pg(e),n=hg(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=ut({location:"",base:e,go:r,createHref:eg.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 gg(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),mg(e)}let Br=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Ot=(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})(Ot||{});const vg={type:Br.Static,value:""},yg=/[a-zA-Z0-9_]/;function wg(e){if(!e)return[[]];if(e==="/")return[[vg]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(_){throw new Error(`ERR (${n})/"${u}": ${_}`)}let n=Ot.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,u="",c="";function f(){u&&(n===Ot.Static?o.push({type:Br.Static,value:u}):n===Ot.Param||n===Ot.ParamRegExp||n===Ot.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),o.push({type:Br.Param,value:u,regexp:c,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),u="")}function h(){u+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==Ot.ParamRegExp){r=n,n=Ot.EscapeNext;continue}switch(n){case Ot.Static:l==="/"?(u&&f(),i()):l===":"?(f(),n=Ot.Param):h();break;case Ot.EscapeNext:h(),n=r;break;case Ot.Param:l==="("?n=Ot.ParamRegExp:yg.test(l)?h():(f(),n=Ot.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Ot.ParamRegExp:l===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+l:n=Ot.ParamRegExpEnd:c+=l;break;case Ot.ParamRegExpEnd:f(),n=Ot.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===Ot.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),f(),i(),s}const yc="[^/]+?",bg={sensitive:!1,strict:!1,start:!0,end:!0};var Xt=(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})(Xt||{});const _g=/[.+*?^${}()[\]/\\]/g;function kg(e,t){const n=ut({},bg,t),r=[];let s=n.start?"^":"";const o=[];for(const u of e){const c=u.length?[]:[Xt.Root];n.strict&&!u.length&&(s+="/");for(let f=0;f<u.length;f++){const h=u[f];let _=Xt.Segment+(n.sensitive?Xt.BonusCaseSensitive:0);if(h.type===Br.Static)f||(s+="/"),s+=h.value.replace(_g,"\\$&"),_+=Xt.Static;else if(h.type===Br.Param){const{value:L,repeatable:C,optional:j,regexp:Z}=h;o.push({name:L,repeatable:C,optional:j});const B=Z||yc;if(B!==yc){_+=Xt.BonusCustomRegExp;try{`${B}`}catch(W){throw new Error(`Invalid custom RegExp for param "${L}" (${B}): `+W.message)}}let J=C?`((?:${B})(?:/(?:${B}))*)`:`(${B})`;f||(J=j&&u.length<2?`(?:/${J})`:"/"+J),j&&(J+="?"),s+=J,_+=Xt.Dynamic,j&&(_+=Xt.BonusOptional),C&&(_+=Xt.BonusRepeatable),B===".*"&&(_+=Xt.BonusWildcard)}c.push(_)}r.push(c)}if(n.strict&&n.end){const u=r.length-1;r[u][r[u].length-1]+=Xt.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const i=new RegExp(s,n.sensitive?"":"i");function a(u){const c=u.match(i),f={};if(!c)return null;for(let h=1;h<c.length;h++){const _=c[h]||"",L=o[h-1];f[L.name]=_&&L.repeatable?_.split("/"):_}return f}function l(u){let c="",f=!1;for(const h of e){(!f||!c.endsWith("/"))&&(c+="/"),f=!1;for(const _ of h)if(_.type===Br.Static)c+=_.value;else if(_.type===Br.Param){const{value:L,repeatable:C,optional:j}=_,Z=L in u?u[L]:"";if(kn(Z)&&!C)throw new Error(`Provided param "${L}" is an array but it is not repeatable (* or + modifiers)`);const B=kn(Z)?Z.join("/"):Z;if(!B)if(j)h.length<2&&(c.endsWith("/")?c=c.slice(0,-1):f=!0);else throw new Error(`Missing required param "${L}"`);c+=B}}return c||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function Tg(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]===Xt.Static+Xt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Xt.Static+Xt.Segment?1:-1:0}function tf(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=Tg(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(wc(r))return 1;if(wc(s))return-1}return s.length-r.length}function wc(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Ig={strict:!1,end:!0,sensitive:!1};function Sg(e,t,n){const r=kg(wg(e.path),n),s=ut(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function Eg(e,t){const n=[],r=new Map;t=dc(Ig,t);function s(f){return r.get(f)}function o(f,h,_){const L=!_,C=_c(f);C.aliasOf=_&&_.record;const j=dc(t,f),Z=[C];if("alias"in f){const W=typeof f.alias=="string"?[f.alias]:f.alias;for(const ae of W)Z.push(_c(ut({},C,{components:_?_.record.components:C.components,path:ae,aliasOf:_?_.record:C})))}let B,J;for(const W of Z){const{path:ae}=W;if(h&&ae[0]!=="/"){const le=h.record.path,ve=le[le.length-1]==="/"?"":"/";W.path=h.record.path+(ae&&ve+ae)}if(B=Sg(W,h,j),_?_.alias.push(B):(J=J||B,J!==B&&J.alias.push(B),L&&f.name&&!kc(B)&&i(f.name)),nf(B)&&l(B),C.children){const le=C.children;for(let ve=0;ve<le.length;ve++)o(le[ve],B,_&&_.children[ve])}_=_||B}return J?()=>{i(J)}:Hs}function i(f){if(Qd(f)){const h=r.get(f);h&&(r.delete(f),n.splice(n.indexOf(h),1),h.children.forEach(i),h.alias.forEach(i))}else{const h=n.indexOf(f);h>-1&&(n.splice(h,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 h=Rg(f,n);n.splice(h,0,f),f.record.name&&!kc(f)&&r.set(f.record.name,f)}function u(f,h){let _,L={},C,j;if("name"in f&&f.name){if(_=r.get(f.name),!_)throw ms(Pt.MATCHER_NOT_FOUND,{location:f});j=_.record.name,L=ut(bc(h.params,_.keys.filter(J=>!J.optional).concat(_.parent?_.parent.keys.filter(J=>J.optional):[]).map(J=>J.name)),f.params&&bc(f.params,_.keys.map(J=>J.name))),C=_.stringify(L)}else if(f.path!=null)C=f.path,_=n.find(J=>J.re.test(C)),_&&(L=_.parse(C),j=_.record.name);else{if(_=h.name?r.get(h.name):n.find(J=>J.re.test(h.path)),!_)throw ms(Pt.MATCHER_NOT_FOUND,{location:f,currentLocation:h});j=_.record.name,L=ut({},h.params,f.params),C=_.stringify(L)}const Z=[];let B=_;for(;B;)Z.unshift(B.record),B=B.parent;return{name:j,path:C,params:L,matched:Z,meta:Ag(Z)}}e.forEach(f=>o(f));function c(){n.length=0,r.clear()}return{addRoute:o,resolve:u,removeRoute:i,clearRoutes:c,getRoutes:a,getRecordMatcher:s}}function bc(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function _c(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Cg(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 Cg(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 kc(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Ag(e){return e.reduce((t,n)=>ut(t,n.meta),{})}function Rg(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;tf(e,t[o])<0?r=o:n=o+1}const s=Pg(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Pg(e){let t=e;for(;t=t.parent;)if(nf(t)&&tf(e,t)===0)return t}function nf({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Tc(e){const t=vn(di),n=vn(el),r=ie(()=>{const l=ge(e.to);return t.resolve(l)}),s=ie(()=>{const{matched:l}=r.value,{length:u}=l,c=l[u-1],f=n.matched;if(!c||!f.length)return-1;const h=f.findIndex(ps.bind(null,c));if(h>-1)return h;const _=Ic(l[u-2]);return u>1&&Ic(c)===_&&f[f.length-1].path!==_?f.findIndex(ps.bind(null,l[u-2])):h}),o=ie(()=>s.value>-1&&$g(n.params,r.value.params)),i=ie(()=>s.value>-1&&s.value===n.matched.length-1&&Xd(n.params,r.value.params));function a(l={}){if(Ng(l)){const u=t[ge(e.replace)?"replace":"push"](ge(e.to)).catch(Hs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:r,href:ie(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function xg(e){return e.length===1?e[0]:e}const Mg=Lt({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:Tc,setup(e,{slots:t}){const n=ni(Tc(e)),{options:r}=vn(di),s=ie(()=>({[Sc(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Sc(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&xg(t.default(n));return e.custom?o:Qa("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),Og=Mg;function Ng(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 $g(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(!kn(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function Ic(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Sc=(e,t,n)=>e??t??n,Dg=Lt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=vn(ya),s=ie(()=>e.route||r.value),o=vn(gc,0),i=ie(()=>{let u=ge(o);const{matched:c}=s.value;let f;for(;(f=c[u])&&!f.components;)u++;return u}),a=ie(()=>s.value.matched[i.value]);Eo(gc,ie(()=>i.value+1)),Eo(ug,a),Eo(ya,s);const l=D();return vt(()=>[l.value,a.value,e.name],([u,c,f],[h,_,L])=>{c&&(c.instances[f]=u,_&&_!==c&&u&&u===h&&(c.leaveGuards.size||(c.leaveGuards=_.leaveGuards),c.updateGuards.size||(c.updateGuards=_.updateGuards))),u&&c&&(!_||!ps(c,_)||!h)&&(c.enterCallbacks[f]||[]).forEach(C=>C(u))},{flush:"post"}),()=>{const u=s.value,c=e.name,f=a.value,h=f&&f.components[c];if(!h)return Ec(n.default,{Component:h,route:u});const _=f.props[c],L=_?_===!0?u.params:typeof _=="function"?_(u):_:null,j=Qa(h,ut({},L,t,{onVnodeUnmounted:Z=>{Z.component.isUnmounted&&(f.instances[c]=null)},ref:l}));return Ec(n.default,{Component:j,route:u})||j}}});function Ec(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Lg=Dg;function jg(e){const t=Eg(e.routes,e),n=e.parseQuery||lg,r=e.stringifyQuery||mc,s=e.history,o=xs(),i=xs(),a=xs(),l=jh(dr);let u=dr;rs&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Oi.bind(null,z=>""+z),f=Oi.bind(null,Gm),h=Oi.bind(null,eo);function _(z,fe){let ce,he;return Qd(z)?(ce=t.getRecordMatcher(z),he=fe):he=z,t.addRoute(he,ce)}function L(z){const fe=t.getRecordMatcher(z);fe&&t.removeRoute(fe)}function C(){return t.getRoutes().map(z=>z.record)}function j(z){return!!t.getRecordMatcher(z)}function Z(z,fe){if(fe=ut({},fe||l.value),typeof z=="string"){const R=Ni(n,z,fe.path),V=t.resolve({path:R.path},fe),U=s.createHref(R.fullPath);return ut(R,V,{params:h(V.params),hash:eo(R.hash),redirectedFrom:void 0,href:U})}let ce;if(z.path!=null)ce=ut({},z,{path:Ni(n,z.path,fe.path).path});else{const R=ut({},z.params);for(const V in R)R[V]==null&&delete R[V];ce=ut({},z,{params:f(R)}),fe.params=f(fe.params)}const he=t.resolve(ce,fe),$e=z.hash||"";he.params=c(h(he.params));const v=Km(r,ut({},z,{hash:Hm($e),path:he.path})),y=s.createHref(v);return ut({fullPath:v,hash:$e,query:r===mc?cg(z.query):z.query||{}},he,{redirectedFrom:void 0,href:y})}function B(z){return typeof z=="string"?Ni(n,z,l.value.path):ut({},z)}function J(z,fe){if(u!==z)return ms(Pt.NAVIGATION_CANCELLED,{from:fe,to:z})}function W(z){return ve(z)}function ae(z){return W(ut(B(z),{replace:!0}))}function le(z,fe){const ce=z.matched[z.matched.length-1];if(ce&&ce.redirect){const{redirect:he}=ce;let $e=typeof he=="function"?he(z,fe):he;return typeof $e=="string"&&($e=$e.includes("?")||$e.includes("#")?$e=B($e):{path:$e},$e.params={}),ut({query:z.query,hash:z.hash,params:$e.path!=null?{}:z.params},$e)}}function ve(z,fe){const ce=u=Z(z),he=l.value,$e=z.state,v=z.force,y=z.replace===!0,R=le(ce,he);if(R)return ve(ut(B(R),{state:typeof R=="object"?ut({},$e,R.state):$e,force:v,replace:y}),fe||ce);const V=ce;V.redirectedFrom=fe;let U;return!v&&Jm(r,he,ce)&&(U=ms(Pt.NAVIGATION_DUPLICATED,{to:V,from:he}),Ge(he,he,!0,!1)),(U?Promise.resolve(U):q(V,he)).catch(x=>Hn(x)?Hn(x,Pt.NAVIGATION_GUARD_REDIRECT)?x:We(x):Re(x,V,he)).then(x=>{if(x){if(Hn(x,Pt.NAVIGATION_GUARD_REDIRECT))return ve(ut({replace:y},B(x.to),{state:typeof x.to=="object"?ut({},$e,x.to.state):$e,force:v}),fe||V)}else x=Q(V,he,!0,y,$e);return oe(V,he,x),x})}function ke(z,fe){const ce=J(z,fe);return ce?Promise.reject(ce):Promise.resolve()}function ne(z){const fe=nt.values().next().value;return fe&&typeof fe.runWithContext=="function"?fe.runWithContext(z):z()}function q(z,fe){let ce;const[he,$e,v]=dg(z,fe);ce=Di(he.reverse(),"beforeRouteLeave",z,fe);for(const R of he)R.leaveGuards.forEach(V=>{ce.push(gr(V,z,fe))});const y=ke.bind(null,z,fe);return ce.push(y),tt(ce).then(()=>{ce=[];for(const R of o.list())ce.push(gr(R,z,fe));return ce.push(y),tt(ce)}).then(()=>{ce=Di($e,"beforeRouteUpdate",z,fe);for(const R of $e)R.updateGuards.forEach(V=>{ce.push(gr(V,z,fe))});return ce.push(y),tt(ce)}).then(()=>{ce=[];for(const R of v)if(R.beforeEnter)if(kn(R.beforeEnter))for(const V of R.beforeEnter)ce.push(gr(V,z,fe));else ce.push(gr(R.beforeEnter,z,fe));return ce.push(y),tt(ce)}).then(()=>(z.matched.forEach(R=>R.enterCallbacks={}),ce=Di(v,"beforeRouteEnter",z,fe,ne),ce.push(y),tt(ce))).then(()=>{ce=[];for(const R of i.list())ce.push(gr(R,z,fe));return ce.push(y),tt(ce)}).catch(R=>Hn(R,Pt.NAVIGATION_CANCELLED)?R:Promise.reject(R))}function oe(z,fe,ce){a.list().forEach(he=>ne(()=>he(z,fe,ce)))}function Q(z,fe,ce,he,$e){const v=J(z,fe);if(v)return v;const y=fe===dr,R=rs?history.state:{};ce&&(he||y?s.replace(z.fullPath,ut({scroll:y&&R&&R.scroll},$e)):s.push(z.fullPath,$e)),l.value=z,Ge(z,fe,ce,y),We()}let Ie;function Ce(){Ie||(Ie=s.listen((z,fe,ce)=>{if(!Fe.listening)return;const he=Z(z),$e=le(he,Fe.currentRoute.value);if($e){ve(ut($e,{replace:!0,force:!0}),he).catch(Hs);return}u=he;const v=l.value;rs&&rg(pc(v.fullPath,ce.delta),ui()),q(he,v).catch(y=>Hn(y,Pt.NAVIGATION_ABORTED|Pt.NAVIGATION_CANCELLED)?y:Hn(y,Pt.NAVIGATION_GUARD_REDIRECT)?(ve(ut(B(y.to),{force:!0}),he).then(R=>{Hn(R,Pt.NAVIGATION_ABORTED|Pt.NAVIGATION_DUPLICATED)&&!ce.delta&&ce.type===ga.pop&&s.go(-1,!1)}).catch(Hs),Promise.reject()):(ce.delta&&s.go(-ce.delta,!1),Re(y,he,v))).then(y=>{y=y||Q(he,v,!1),y&&(ce.delta&&!Hn(y,Pt.NAVIGATION_CANCELLED)?s.go(-ce.delta,!1):ce.type===ga.pop&&Hn(y,Pt.NAVIGATION_ABORTED|Pt.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),oe(he,v,y)}).catch(Hs)}))}let Le=xs(),Ae=xs(),_e;function Re(z,fe,ce){We(z);const he=Ae.list();return he.length?he.forEach($e=>$e(z,fe,ce)):console.error(z),Promise.reject(z)}function ct(){return _e&&l.value!==dr?Promise.resolve():new Promise((z,fe)=>{Le.add([z,fe])})}function We(z){return _e||(_e=!z,Ce(),Le.list().forEach(([fe,ce])=>z?ce(z):fe()),Le.reset()),z}function Ge(z,fe,ce,he){const{scrollBehavior:$e}=e;if(!rs||!$e)return Promise.resolve();const v=!ce&&sg(pc(z.fullPath,0))||(he||!ce)&&history.state&&history.state.scroll||null;return en().then(()=>$e(z,fe,v)).then(y=>y&&ng(y)).catch(y=>Re(y,z,fe))}const Ye=z=>s.go(z);let st;const nt=new Set,Fe={currentRoute:l,listening:!0,addRoute:_,removeRoute:L,clearRoutes:t.clearRoutes,hasRoute:j,getRoutes:C,resolve:Z,options:e,push:W,replace:ae,go:Ye,back:()=>Ye(-1),forward:()=>Ye(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Ae.add,isReady:ct,install(z){z.component("RouterLink",Og),z.component("RouterView",Lg),z.config.globalProperties.$router=Fe,Object.defineProperty(z.config.globalProperties,"$route",{enumerable:!0,get:()=>ge(l)}),rs&&!st&&l.value===dr&&(st=!0,W(s.location).catch(he=>{}));const fe={};for(const he in dr)Object.defineProperty(fe,he,{get:()=>l.value[he],enumerable:!0});z.provide(di,Fe),z.provide(el,Qu(fe)),z.provide(ya,l);const ce=z.unmount;nt.add(z),z.unmount=function(){nt.delete(z),nt.size<1&&(u=dr,Ie&&Ie(),Ie=null,l.value=dr,st=!1,_e=!1),ce()}}};function tt(z){return z.reduce((fe,ce)=>fe.then(()=>ne(ce)),Promise.resolve())}return Fe}function Bg(){return vn(di)}function Fg(e){return vn(el)}const Cc=768;function rf(){const e=D(typeof window<"u"?window.innerWidth<Cc:!1);let t=null;function n(r){e.value=r.matches}return sr(()=>{t=window.matchMedia(`(max-width: ${Cc-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),ii(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Ug={key:0,class:"desktop-sidebar"},Hg={class:"desktop-main"},Ac="codex-web-local.sidebar-width.v1",Vg=260,Wg=620,Rc=320,Gg=Lt({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=rf();function r(u){return Math.min(Wg,Math.max(Vg,u))}function s(){if(typeof window>"u")return Rc;const u=window.localStorage.getItem(Ac),c=Number(u);return Number.isFinite(c)?r(c):Rc}const o=D(s()),i=ie(()=>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(u){typeof window>"u"||window.localStorage.setItem(Ac,String(u))}function l(u){u.preventDefault();const c=u.clientX,f=o.value,h=L=>{const C=L.clientX-c;o.value=r(f+C)},_=()=>{a(o.value),window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",_)};window.addEventListener("mousemove",h),window.addEventListener("mouseup",_)}return(u,c)=>(w(),T("div",{class:at(["desktop-layout",{"is-mobile":ge(n)}]),style:Wr(i.value)},[ge(n)?(w(),ft(jo,{key:0,to:"body"},[Ee(Wd,{name:"drawer"},{default:gt(()=>[e.isSidebarCollapsed?re("",!0):(w(),T("div",{key:0,class:"mobile-drawer-backdrop",onClick:c[1]||(c[1]=f=>u.$emit("close-sidebar"))},[p("aside",{class:"mobile-drawer",onClick:c[0]||(c[0]=it(()=>{},["stop"]))},[Mn(u.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):re("",!0),ge(n)?re("",!0):(w(),T(je,{key:1},[e.isSidebarCollapsed?re("",!0):(w(),T("aside",Ug,[Mn(u.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?re("",!0):(w(),T("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),p("section",Hg,[Mn(u.$slots,"content",{},void 0)])],6))}}),rt=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},zg=rt(Gg,[["__scopeId","data-v-df29c633"]]),qg={},Kg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Jg(e,t){return w(),T("svg",Kg,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const fi=rt(qg,[["render",Jg]]),Yg={},Xg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Qg(e,t){return w(),T("svg",Xg,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const sf=rt(Yg,[["render",Qg]]),Zg={},ev={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function tv(e,t){return w(),T("svg",ev,[...t[0]||(t[0]=[p("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 Ms=rt(Zg,[["render",tv]]),nv={},rv={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function sv(e,t){return w(),T("svg",rv,[...t[0]||(t[0]=[p("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 Vo=rt(nv,[["render",sv]]),ov={},iv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function av(e,t){return w(),T("svg",iv,[...t[0]||(t[0]=[p("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 tl=rt(ov,[["render",av]]),lv={},cv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function uv(e,t){return w(),T("svg",cv,[...t[0]||(t[0]=[p("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 dv=rt(lv,[["render",uv]]),fv={},hv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function pv(e,t){return w(),T("svg",hv,[...t[0]||(t[0]=[p("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 Po=rt(fv,[["render",pv]]),mv={},gv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function vv(e,t){return w(),T("svg",gv,[...t[0]||(t[0]=[p("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 Li=rt(mv,[["render",vv]]),yv={key:0,class:"sidebar-menu-row-left"},wv={class:"sidebar-menu-row-main"},bv={key:1,class:"sidebar-menu-row-right"},_v={key:0,class:"sidebar-menu-row-right-default"},kv={key:1,class:"sidebar-menu-row-right-hover"},Tv=Lt({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=pp(),r=ie(()=>!!n.left),s=ie(()=>!!n.right),o=ie(()=>!!n["right-hover"]),i=ie(()=>s.value||o.value);return(a,l)=>(w(),ft(la(t.as),jd({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:gt(()=>[r.value?(w(),T("span",yv,[Mn(a.$slots,"left",{},void 0,!0)])):re("",!0),p("span",wv,[Mn(a.$slots,"default",{},void 0,!0)]),i.value?(w(),T("span",bv,[s.value?(w(),T("span",_v,[Mn(a.$slots,"right",{},void 0,!0)])):re("",!0),o.value?(w(),T("span",kv,[Mn(a.$slots,"right-hover",{},void 0,!0)])):re("",!0)])):re("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),Nr=rt(Tv,[["__scopeId","data-v-daeca4df"]]),Iv={class:"thread-tree-root"},Sv={key:0,class:"pinned-section"},Ev={class:"thread-list"},Cv={class:"thread-left-stack"},Av=["data-state"],Rv=["onClick"],Pv=["onClick"],xv={class:"thread-row-title-wrap"},Mv={class:"thread-row-title"},Ov={class:"thread-row-time"},Nv=["onClick"],$v=["onClick"],Dv=["onClick"],Lv=["onClick"],jv=["aria-expanded"],Bv=["data-active"],Fv={key:0},Uv=["data-active"],Hv={key:0},Vv={key:1,class:"thread-tree-no-results"},Wv={key:2,class:"thread-tree-loading"},Gv={key:3,class:"thread-list thread-list-global"},zv={class:"thread-left-stack"},qv=["data-state"],Kv=["onClick"],Jv=["onClick"],Yv={class:"thread-row-title-wrap"},Xv={class:"thread-row-title"},Qv={class:"thread-row-time"},Zv=["onClick"],ey=["onClick"],ty=["onClick"],ny=["onClick"],ry=["data-project-name","data-expanded","data-dragging"],sy={class:"project-icon-stack"},oy={class:"project-icon-folder"},iy={class:"project-icon-chevron"},ay=["data-dragging-handle","onMousedown"],ly={class:"project-title"},cy={class:"project-hover-controls"},uy=["onClick"],dy=["onClick"],fy=["onClick"],hy=["onClick"],py=["onInput"],my=["aria-label","title","onClick"],gy={key:0,class:"thread-list"},vy={class:"thread-left-stack"},yy=["data-state"],wy=["onClick"],by=["onClick"],_y={class:"thread-row-title-wrap"},ky={class:"thread-row-title"},Ty={class:"thread-row-time"},Iy=["onClick"],Sy=["onClick"],Ey=["onClick"],Cy=["onClick"],Ay=["onClick"],Ry={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},Py=["onKeydown"],xy={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},My={class:"rename-thread-subtitle"},Oy=4,Pc=6,xc="codex-web-local.thread-view-mode.v1",Mc="codex-web-local.collapsed-projects.v1",Ny=Lt({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-project-files","rename-project","rename-thread","remove-project","reorder-project","export-thread"],setup(e,{emit:t}){const n=e,r=t,s=D({}),o=D({}),i=D([]),a=D(""),l=D(""),u=D("actions"),c=D(""),f=D(!1),h=D(""),_=D(""),L=D(null),C=D(!1),j=D(""),Z=D(""),B=D(null),J=D(null),W=D(null);let ae=null,le=null;const ve=D(""),ke=D({}),ne=new Map,q=new Map,oe=new Map,Q=new WeakMap,Ie=D(null),Ce=D(!1),Le=D(Re()),Ae=typeof window<"u"?new ResizeObserver(I=>{for(const N of I){const $=N.target,Y=Q.get($);Y&&de(Y,$)}}):null;function _e(){if(typeof window>"u")return{};try{const I=window.localStorage.getItem(Mc);if(!I)return{};const N=JSON.parse(I);return!N||typeof N!="object"||Array.isArray(N)?{}:N}catch{return{}}}function Re(){return typeof window>"u"?"project":window.localStorage.getItem(xc)==="chronological"?"chronological":"project"}o.value=_e(),vt(o,I=>{typeof window>"u"||window.localStorage.setItem(Mc,JSON.stringify(I))},{deep:!0}),vt(Le,I=>{typeof window>"u"||window.localStorage.setItem(xc,I)});const ct=ie(()=>n.searchQuery.trim().toLowerCase()),We=ie(()=>ct.value.length>0),Ge=ie(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function Ye(I){if(!We.value)return!0;if(Ge.value)return Ge.value.has(I.id);const N=ct.value;return I.title.toLowerCase().includes(N)||I.preview.toLowerCase().includes(N)}const st=ie(()=>We.value?n.groups.map(I=>({...I,threads:I.threads.filter(Ye)})).filter(I=>I.threads.length>0):n.groups),nt=ie(()=>Le.value==="chronological"),Fe=ie(()=>{const I=st.value,N=[];for(const $ of I)for(const Y of $.threads)y(Y.id)||N.push(Y);return N.sort(($,Y)=>{const Ue=new Date($.updatedAtIso||$.createdAtIso).getTime();return new Date(Y.updatedAtIso||Y.createdAtIso).getTime()-Ue})}),tt=ie(()=>{const I=new Map;for(const N of n.groups)for(const $ of N.threads)I.set($.id,$);return I}),z=ie(()=>i.value.map(I=>tt.value.get(I)??null).filter(I=>I!==null).filter(Ye)),fe=ie(()=>{const I=W.value;if(!I||I.dropTargetIndexFull===null||n.groups.length===0)return null;const N=Math.max(0,Math.min(I.dropTargetIndexFull,n.groups.length)),$=N>I.fromIndex?N-1:N,Y=Math.max(0,Math.min($,n.groups.length-1));return Y===I.fromIndex?null:Y}),ce=ie(()=>{const N=(We.value?st.value:n.groups).map(rn=>rn.projectName),$=W.value,Y=fe.value;if(!$||Y===null)return N;const Ue=[...N],[Mt]=Ue.splice($.fromIndex,1);return Mt?(Ue.splice(Y,0,Mt),Ue):N}),he=ie(()=>{const I={};let N=0;for(const $ of ce.value)I[$]=N,N+=xt($);return I}),$e=ie(()=>{let I=0;for(const N of ce.value)I+=xt(N);return{height:`${Math.max(0,I)}px`}});function v(I){const N=new Date(I).getTime();if(Number.isNaN(N))return"n/a";const $=Math.abs(Date.now()-N);if($<6e4)return"now";const Y=Math.floor($/6e4);if(Y<60)return`${Y}m`;const Ue=Math.floor(Y/60);return Ue<24?`${Ue}h`:`${Math.floor(Ue/24)}d`}function y(I){return i.value.includes(I)}function R(I){if(y(I)){i.value=i.value.filter(N=>N!==I);return}i.value=[I,...i.value]}function V(I){r("select",I)}function U(I){r("export-thread",I),G()}function x(I){return`start new thread ${De(I)}`}function H(I){r("start-new-thread",I)}function F(I){l.value===I&&G()}function K(I){return l.value===I}function G(){l.value=""}function we(I){if(l.value===I){G();return}l.value=I}function ue(I,N){h.value=I,_.value=N,f.value=!0,G(),en(()=>{var $,Y;($=L.value)==null||$.focus(),(Y=L.value)==null||Y.select()})}function me(){f.value=!1,h.value="",_.value=""}function Te(){const I=h.value,N=_.value.trim();!I||!N||(r("rename-thread",{threadId:I,title:N}),me())}function Oe(I,N){j.value=I,Z.value=N,C.value=!0,G()}function ze(){C.value=!1,j.value="",Z.value=""}function Ve(){const I=j.value;I&&(i.value=i.value.filter(N=>N!==I),r("archive",I),ze())}function De(I){return n.projectDisplayNameById[I]??I}function pt(I){return a.value===I}function Xe(){a.value="",u.value="actions",c.value=""}function Ze(){Ce.value=!Ce.value}function jt(I){Le.value=I,Ce.value=!1}function Bt(I){if(a.value===I){Xe();return}a.value=I,u.value="actions",c.value=De(I)}function mt(I){a.value=I,u.value="rename",c.value=De(I)}function Tt(I){r("rename-project",{projectName:I,displayName:c.value})}function $t(I){r("remove-project",I),Xe()}function It(I){r("browse-project-files",I),Xe()}function Dn(I,N){if(!I.altKey||I.key!=="ArrowUp"&&I.key!=="ArrowDown")return;const $=n.groups.findIndex(Mt=>Mt.projectName===N);if($<0)return;const Y=I.key==="ArrowUp"?-1:1,Ue=Math.max(0,Math.min($+Y,n.groups.length-1));Ue!==$&&(I.preventDefault(),r("reorder-project",{projectName:N,toIndex:Ue}))}function Ht(I){return s.value[I]===!0}function xe(I){return o.value[I]===!0}function Pe(I){s.value={...s.value,[I]:!Ht(I)}}function nn(I){if(ve.value===I){ve.value="";return}o.value={...o.value,[I]:!xe(I)}}function xt(I){const N=ke.value[I]??0,$=W.value,Ue=(($==null?void 0:$.projectName)===I?$.groupHeight:null)??N,Mt=xe(I)?0:Pc;return Math.max(0,Ue+Mt)}function Tn(I,N){const $=N instanceof HTMLElement?N:N&&"$el"in N&&N.$el instanceof HTMLElement?N.$el:null;if($){q.set(I,$);return}q.delete(I)}function ln(I,N){const $=N instanceof HTMLElement?N:N&&"$el"in N&&N.$el instanceof HTMLElement?N.$el:null;if($){oe.set(I,$);return}oe.delete(I)}function hn(I){const N=a.value;if(!N)return!1;const $=q.get(N);if(!$)return!1;if((typeof I.composedPath=="function"?I.composedPath():[]).includes($))return!0;const Ue=I.target;return Ue instanceof Node?$.contains(Ue):!1}function k(I){const N=l.value;if(!N)return!1;const $=oe.get(N);if(!$)return!1;if((typeof I.composedPath=="function"?I.composedPath():[]).includes($))return!0;const Ue=I.target;return Ue instanceof Node?$.contains(Ue):!1}function S(I){if(Ce.value){const N=Ie.value,$=typeof I.composedPath=="function"?I.composedPath():[];!!N&&($.includes(N)||I.target instanceof Node&&N.contains(I.target))||(Ce.value=!1)}a.value&&(hn(I)||Xe(),l.value&&(k(I)||G()))}function E(I){a.value&&!hn(I)&&Xe(),l.value&&!k(I)&&G()}function g(){Ce.value&&(Ce.value=!1),a.value&&Xe(),l.value&&G()}function M(){window.addEventListener("pointerdown",S,{capture:!0}),window.addEventListener("focusin",E,{capture:!0}),window.addEventListener("blur",g)}function O(){window.removeEventListener("pointerdown",S,{capture:!0}),window.removeEventListener("focusin",E,{capture:!0}),window.removeEventListener("blur",g)}function de(I,N){const $=N.getBoundingClientRect().height;if(!Number.isFinite($)||$<=0)return;const Y=ke.value[I];Y!==void 0&&Math.abs(Y-$)<.5||(ke.value={...ke.value,[I]:$})}function pe(I,N){const $=ne.get(I);$&&$!==N&&Ae&&Ae.unobserve($);const Y=N instanceof HTMLElement?N:N&&"$el"in N&&N.$el instanceof HTMLElement?N.$el:null;if(Y){ne.set(I,Y),Q.set(Y,I),de(I,Y),Ae==null||Ae.observe(Y);return}$&&(Ae==null||Ae.unobserve($)),ne.delete(I)}function Ne(I,N){if(I.button!==0||J.value||W.value)return;const $=n.groups.findIndex(rn=>rn.projectName===N),Y=ne.get(N);if($<0||!Y)return;const Ue=Y.getBoundingClientRect(),Mt=xe(N)?0:Pc;J.value={projectName:N,fromIndex:$,startClientX:I.clientX,startClientY:I.clientY,pointerOffsetY:I.clientY-Ue.top,groupLeft:Ue.left,groupWidth:Ue.width,groupHeight:Ue.height,groupOuterHeight:Ue.height+Mt},I.preventDefault(),Ke()}function Ke(){window.addEventListener("mousemove",St),window.addEventListener("mouseup",At),window.addEventListener("keydown",In)}function Je(){window.removeEventListener("mousemove",St),window.removeEventListener("mouseup",At),window.removeEventListener("keydown",In)}function St(I){ae={clientX:I.clientX,clientY:I.clientY},zr()}function At(I){qr({clientX:I.clientX,clientY:I.clientY});const N=W.value;if(N&&fe.value!==null){const $=n.groups.findIndex(Y=>Y.projectName===N.projectName);if($>=0){const Y=fe.value;Y!==$&&r("reorder-project",{projectName:N.projectName,toIndex:Y})}}pn()}function In(I){I.key==="Escape"&&(!J.value&&!W.value||(I.preventDefault(),pn()))}function pn(){le!==null&&(window.cancelAnimationFrame(le),le=null),ae=null,J.value=null,W.value=null,ve.value="",Je()}function zr(){le===null&&(le=window.requestAnimationFrame(()=>{if(le=null,!ae)return;const I=ae;ae=null,qr(I)}))}function qr(I){const N=J.value;if(!W.value&&N){const $=I.clientX-N.startClientX,Y=I.clientY-N.startClientY;if(Math.hypot($,Y)<Oy)return;Xe(),ve.value=N.projectName,W.value={projectName:N.projectName,fromIndex:N.fromIndex,pointerOffsetY:N.pointerOffsetY,groupLeft:N.groupLeft,groupWidth:N.groupWidth,groupHeight:N.groupHeight,groupOuterHeight:N.groupOuterHeight,ghostTop:I.clientY-N.pointerOffsetY,dropTargetIndexFull:null}}W.value&&Kr(I)}function Kr(I){const N=W.value;if(!N)return;if(N.ghostTop=I.clientY-N.pointerOffsetY,!ir(I)){N.dropTargetIndexFull=null;return}const $=I.clientY,Y=B.value;if(!Y){N.dropTargetIndexFull=null;return}const Ue=Y.getBoundingClientRect(),Mt=new Map(n.groups.map((Vt,lr)=>[Vt.projectName,lr])),rn=n.groups.map(Vt=>Vt.projectName).filter(Vt=>Vt!==N.projectName);let Yr=0,jn=n.groups.length;for(const Vt of rn){const lr=Mt.get(Vt);if(lr===void 0)continue;const Xr=xt(Vt),Ss=Ue.top+Yr+Xr/2;if($<Ss){jn=lr;break}Yr+=Xr}N.dropTargetIndexFull=jn}function ir(I){const N=B.value;if(!N)return!1;const $=N.getBoundingClientRect(),Y=I.clientX>=$.left&&I.clientX<=$.right,Ue=I.clientY>=$.top-32&&I.clientY<=$.bottom+32;return Y&&Ue}function ar(I){var N;return((N=W.value)==null?void 0:N.projectName)===I}function ks(I){const N=W.value,$=he.value[I]??0,Y=a.value===I;return!N||N.projectName!==I?{position:"absolute",top:"0",left:"0",right:"0",zIndex:Y?"40":"1",transform:`translate3d(0, ${$}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${N.groupLeft}px`,width:`${N.groupWidth}px`,height:`${N.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${N.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function Ln(I){return I.threads.filter(N=>!y(N.id))}function Jr(I){if(We.value)return Ln(I);if(xe(I.projectName))return[];const N=Ln(I);return Ht(I.projectName)?N:N.slice(0,10)}function Ts(I){return We.value?!1:!xe(I.projectName)&&Ln(I).length>10}function Is(I){return Ln(I).length>0}function Cr(I){return I.inProgress?"working":I.unread?"unread":"idle"}vt(()=>n.groups.map(I=>I.projectName),I=>{var Ue,Mt;const N=((Ue=W.value)==null?void 0:Ue.projectName)??((Mt=J.value)==null?void 0:Mt.projectName)??"";N&&!n.groups.some(rn=>rn.projectName===N)&&pn();const $=new Set(I),Y=Object.fromEntries(Object.entries(ke.value).filter(([rn])=>$.has(rn)));Object.keys(Y).length!==Object.keys(ke.value).length&&(ke.value=Y)});const Ar=ie(()=>Ce.value||a.value!=="");return vt(Ar,I=>{if(I){M();return}O()}),or(()=>{for(const I of ne.values())Ae==null||Ae.unobserve(I);ne.clear(),q.clear(),O(),pn()}),(I,N)=>(w(),T("section",Iv,[z.value.length>0?(w(),T("section",Sv,[p("ul",Ev,[(w(!0),T(je,null,Ct(z.value,$=>(w(),T("li",{key:$.id,class:"thread-row-item"},[Ee(Nr,{class:"thread-row","data-active":$.id===e.selectedThreadId,"data-pinned":y($.id),onMouseleave:Y=>F($.id)},{left:gt(()=>[p("span",Cv,[$.inProgress||$.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Cr($)},null,8,Av)):re("",!0),p("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Y=>R($.id)},[Ee(Li,{class:"thread-icon"})],8,Rv)])]),right:gt(()=>[p("span",Ov,se(v($.createdAtIso||$.updatedAtIso)),1)]),"right-hover":gt(()=>[p("div",{ref_for:!0,ref:Y=>ln($.id,Y),class:"thread-menu-wrap"},[p("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:it(Y=>we($.id),["stop"])},[Ee(Ms,{class:"thread-icon"})],8,Nv),K($.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:N[0]||(N[0]=it(()=>{},["stop"]))},[p("button",{class:"thread-menu-item",type:"button",onClick:Y=>U($.id)}," Export chat ",8,$v),p("button",{class:"thread-menu-item",type:"button",onClick:Y=>ue($.id,$.title)}," Rename thread ",8,Dv),p("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Y=>Oe($.id,$.title)}," Delete thread ",8,Lv)])):re("",!0)],512)]),default:gt(()=>[p("button",{class:"thread-main-button",type:"button",onClick:Y=>V($.id)},[p("span",xv,[p("span",Mv,se($.title),1),$.hasWorktree?(w(),ft(Po,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):re("",!0)])],8,Pv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):re("",!0),Ee(Nr,{as:"header",class:"thread-tree-header-row"},{right:gt(()=>[p("div",{ref_key:"organizeMenuWrapRef",ref:Ie,class:"organize-menu-wrap"},[p("button",{class:"organize-menu-trigger",type:"button","aria-expanded":Ce.value,"aria-label":"Organize threads",title:"Organize threads",onClick:Ze},[Ee(Ms,{class:"thread-icon"})],8,jv),Ce.value?(w(),T("div",{key:0,class:"organize-menu-panel",onClick:N[3]||(N[3]=it(()=>{},["stop"]))},[N[11]||(N[11]=p("p",{class:"organize-menu-title"},"Organize",-1)),p("button",{class:"organize-menu-item","data-active":Le.value==="project",type:"button",onClick:N[1]||(N[1]=$=>jt("project"))},[N[9]||(N[9]=p("span",null,"By project",-1)),Le.value==="project"?(w(),T("span",Fv,"✓")):re("",!0)],8,Bv),p("button",{class:"organize-menu-item","data-active":Le.value==="chronological",type:"button",onClick:N[2]||(N[2]=$=>jt("chronological"))},[N[10]||(N[10]=p("span",null,"Chronological list",-1)),Le.value==="chronological"?(w(),T("span",Hv,"✓")):re("",!0)],8,Uv)])):re("",!0)],512)]),default:gt(()=>[N[12]||(N[12]=p("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),We.value&&st.value.length===0?(w(),T("p",Vv,"No matching threads")):e.isLoading&&e.groups.length===0?(w(),T("p",Wv,"Loading threads...")):nt.value?(w(),T("ul",Gv,[(w(!0),T(je,null,Ct(Fe.value,$=>(w(),T("li",{key:$.id,class:"thread-row-item"},[Ee(Nr,{class:"thread-row","data-active":$.id===e.selectedThreadId,"data-pinned":y($.id),onMouseleave:Y=>F($.id)},{left:gt(()=>[p("span",zv,[$.inProgress||$.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Cr($)},null,8,qv)):re("",!0),p("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Y=>R($.id)},[Ee(Li,{class:"thread-icon"})],8,Kv)])]),right:gt(()=>[p("span",Qv,se(v($.createdAtIso||$.updatedAtIso)),1)]),"right-hover":gt(()=>[p("div",{ref_for:!0,ref:Y=>ln($.id,Y),class:"thread-menu-wrap"},[p("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:it(Y=>we($.id),["stop"])},[Ee(Ms,{class:"thread-icon"})],8,Zv),K($.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:N[4]||(N[4]=it(()=>{},["stop"]))},[p("button",{class:"thread-menu-item",type:"button",onClick:Y=>U($.id)}," Export chat ",8,ey),p("button",{class:"thread-menu-item",type:"button",onClick:Y=>ue($.id,$.title)}," Rename thread ",8,ty),p("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Y=>Oe($.id,$.title)}," Delete thread ",8,ny)])):re("",!0)],512)]),default:gt(()=>[p("button",{class:"thread-main-button",type:"button",onClick:Y=>V($.id)},[p("span",Yv,[p("span",Xv,se($.title),1),$.hasWorktree?(w(),ft(Po,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):re("",!0)])],8,Jv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),T("div",{key:4,ref_key:"groupsContainerRef",ref:B,class:"thread-tree-groups",style:Wr($e.value)},[(w(!0),T(je,null,Ct(st.value,$=>(w(),T("article",{key:$.projectName,ref_for:!0,ref:Y=>pe($.projectName,Y),class:"project-group","data-project-name":$.projectName,"data-expanded":!xe($.projectName),"data-dragging":ar($.projectName),style:Wr(ks($.projectName))},[Ee(Nr,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:Y=>nn($.projectName),onKeydown:[Y=>Dn(Y,$.projectName),Zt(it(Y=>nn($.projectName),["prevent"]),["enter"]),Zt(it(Y=>nn($.projectName),["prevent"]),["space"])]},{left:gt(()=>[p("span",sy,[p("span",oy,[xe($.projectName)?(w(),ft(tl,{key:0,class:"thread-icon"})):(w(),ft(dv,{key:1,class:"thread-icon"}))]),p("span",iy,[xe($.projectName)?(w(),ft(sf,{key:0,class:"thread-icon"})):(w(),ft(fi,{key:1,class:"thread-icon"}))])])]),right:gt(()=>[p("div",cy,[p("div",{ref_for:!0,ref:Y=>Tn($.projectName,Y),class:"project-menu-wrap"},[p("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:it(Y=>Bt($.projectName),["stop"])},[Ee(Ms,{class:"thread-icon"})],8,uy),pt($.projectName)?(w(),T("div",{key:0,class:"project-menu-panel",onClick:N[6]||(N[6]=it(()=>{},["stop"]))},[u.value==="actions"?(w(),T(je,{key:0},[p("button",{class:"project-menu-item",type:"button",onClick:Y=>It($.projectName)}," Browse files ",8,dy),p("button",{class:"project-menu-item",type:"button",onClick:Y=>mt($.projectName)}," Edit name ",8,fy),p("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:Y=>$t($.projectName)}," Remove ",8,hy)],64)):(w(),T(je,{key:1},[N[13]||(N[13]=p("label",{class:"project-menu-label"},"Project name",-1)),Zn(p("input",{"onUpdate:modelValue":N[5]||(N[5]=Y=>c.value=Y),class:"project-menu-input",type:"text",onInput:Y=>Tt($.projectName)},null,40,py),[[er,c.value]])],64))])):re("",!0)],512),p("button",{class:"thread-start-button",type:"button","aria-label":x($.projectName),title:x($.projectName),onClick:it(Y=>H($.projectName),["stop"])},[Ee(Vo,{class:"thread-icon"})],8,my)])]),default:gt(()=>[p("span",{class:"project-main-button","data-dragging-handle":ar($.projectName),onMousedown:it(Y=>Ne(Y,$.projectName),["left"])},[p("span",ly,se(De($.projectName)),1)],40,ay)]),_:2},1032,["onClick","onKeydown"]),Is($)?(w(),T("ul",gy,[(w(!0),T(je,null,Ct(Jr($),Y=>(w(),T("li",{key:Y.id,class:"thread-row-item"},[Ee(Nr,{class:"thread-row","data-active":Y.id===e.selectedThreadId,"data-pinned":y(Y.id),onMouseleave:Ue=>F(Y.id)},{left:gt(()=>[p("span",vy,[Y.inProgress||Y.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Cr(Y)},null,8,yy)):re("",!0),p("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Ue=>R(Y.id)},[Ee(Li,{class:"thread-icon"})],8,wy)])]),right:gt(()=>[p("span",Ty,se(v(Y.createdAtIso||Y.updatedAtIso)),1)]),"right-hover":gt(()=>[p("div",{ref_for:!0,ref:Ue=>ln(Y.id,Ue),class:"thread-menu-wrap"},[p("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:it(Ue=>we(Y.id),["stop"])},[Ee(Ms,{class:"thread-icon"})],8,Iy),K(Y.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:N[7]||(N[7]=it(()=>{},["stop"]))},[p("button",{class:"thread-menu-item",type:"button",onClick:Ue=>U(Y.id)}," Export chat ",8,Sy),p("button",{class:"thread-menu-item",type:"button",onClick:Ue=>ue(Y.id,Y.title)}," Rename thread ",8,Ey),p("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Ue=>Oe(Y.id,Y.title)}," Delete thread ",8,Cy)])):re("",!0)],512)]),default:gt(()=>[p("button",{class:"thread-main-button",type:"button",onClick:Ue=>V(Y.id)},[p("span",_y,[p("span",ky,se(Y.title),1),Y.hasWorktree?(w(),ft(Po,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):re("",!0)])],8,by)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),ft(Nr,{key:1,as:"p",class:"project-empty-row"},{left:gt(()=>[...N[14]||(N[14]=[p("span",{class:"project-empty-spacer"},null,-1)])]),default:gt(()=>[N[15]||(N[15]=p("span",{class:"project-empty"},"No threads",-1))]),_:1})),Ts($)?(w(),ft(Nr,{key:2,class:"thread-show-more-row"},{left:gt(()=>[...N[16]||(N[16]=[p("span",{class:"thread-show-more-spacer"},null,-1)])]),default:gt(()=>[p("button",{class:"thread-show-more-button",type:"button",onClick:Y=>Pe($.projectName)},se(Ht($.projectName)?"Show less":"Show more"),9,Ay)]),_:2},1024)):re("",!0)],12,ry))),128))],4)),(w(),ft(jo,{to:"body"},[f.value?(w(),T("div",{key:0,class:"rename-thread-overlay",onClick:it(me,["self"])},[p("div",Ry,[N[17]||(N[17]=p("h3",{class:"rename-thread-title"},"Rename thread",-1)),N[18]||(N[18]=p("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),Zn(p("input",{ref_key:"renameThreadInputRef",ref:L,"onUpdate:modelValue":N[8]||(N[8]=$=>_.value=$),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Zt(it(Te,["prevent"]),["enter"]),Zt(it(me,["prevent"]),["esc"])]},null,40,Py),[[er,_.value]]),p("div",{class:"rename-thread-actions"},[p("button",{class:"rename-thread-button",type:"button",onClick:me},"Cancel"),p("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:Te},"Save")])])])):re("",!0)])),(w(),ft(jo,{to:"body"},[C.value?(w(),T("div",{key:0,class:"rename-thread-overlay",onClick:it(ze,["self"])},[p("div",xy,[N[19]||(N[19]=p("h3",{class:"rename-thread-title"},"Delete thread?",-1)),p("p",My,' This will archive the thread "'+se(Z.value)+'". You can find it later in archived threads. ',1),p("div",{class:"rename-thread-actions"},[p("button",{class:"rename-thread-button",type:"button",onClick:ze},"Cancel"),p("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:Ve},"Delete")])])])):re("",!0)]))]))}}),$y=rt(Ny,[["__scopeId","data-v-e2f8a8e1"]]),Dy={class:"content-header"},Ly={class:"content-leading"},jy={class:"content-title"},By={class:"content-actions"},Fy=Lt({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(w(),T("header",Dy,[p("div",Ly,[Mn(t.$slots,"leading",{},void 0)]),p("h1",jy,se(e.title),1),p("div",By,[Mn(t.$slots,"actions",{},void 0)])]))}}),Uy=rt(Fy,[["__scopeId","data-v-66ee223c"]]),Hy={},Vy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Wy(e,t){return w(),T("svg",Vy,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const nl=rt(Hy,[["render",Wy]]),Gy={},zy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function qy(e,t){return w(),T("svg",zy,[...t[0]||(t[0]=[p("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 Ky=rt(Gy,[["render",qy]]),Jy={},Yy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Xy(e,t){return w(),T("svg",Yy,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2zm-4 4a2 2 0 0 1-2-2V8m4 8h10"},null,-1)])])}const Qy=rt(Jy,[["render",Xy]]),Zy={class:"conversation-root"},ew={key:0,class:"conversation-loading"},tw={key:1,class:"conversation-empty"},nw={class:"message-row"},rw={class:"message-stack"},sw={class:"request-card"},ow={class:"request-title"},iw={class:"request-meta"},aw={key:0,class:"request-reason"},lw={key:1,class:"request-actions"},cw=["onClick"],uw=["onClick"],dw=["onClick"],fw=["onClick"],hw={key:2,class:"request-actions"},pw=["onClick"],mw=["onClick"],gw=["onClick"],vw=["onClick"],yw={key:3,class:"request-user-input"},ww={class:"request-question-title"},bw={key:0,class:"request-question-text"},_w=["value","onChange"],kw=["value"],Tw=["value","onInput"],Iw=["onClick"],Sw={key:4,class:"request-actions"},Ew=["onClick"],Cw=["onClick"],Aw={key:5,class:"request-actions"},Rw=["onClick"],Pw=["onClick"],xw=["data-role","data-message-type"],Mw={key:0,class:"message-row","data-role":"system"},Ow={class:"message-stack","data-role":"system"},Nw=["onClick"],$w={class:"cmd-label"},Dw={class:"cmd-status"},Lw={class:"cmd-output-inner"},jw={class:"cmd-output"},Bw=["data-role","data-message-type"],Fw=["data-role"],Uw=["data-role"],Hw=["data-role"],Vw=["onClick"],Ww=["src"],Gw={key:1,class:"message-file-attachments"},zw=["href","title"],qw=["data-role"],Kw={key:0,class:"worked-separator-wrap","aria-live":"polite"},Jw=["onClick"],Yw={class:"worked-separator-text"},Xw={key:0,class:"worked-details"},Qw=["onClick"],Zw={class:"cmd-label"},eb={class:"cmd-status"},tb={class:"cmd-output-inner"},nb={class:"cmd-output"},rb={key:1,class:"message-text-flow"},sb={key:0,class:"message-text"},ob={key:0},ib={key:1,class:"message-bold-text"},ab=["href","title"],lb=["href","title"],cb={key:4,class:"message-inline-code"},ub={key:1,class:"message-text"},db=["onClick"],fb=["src","alt","onError"],hb={key:0,class:"message-actions"},pb=["onClick"],mb=["onClick"],gb={key:0,class:"conversation-item conversation-item-overlay"},vb={class:"message-row"},yb={class:"message-stack"},wb={class:"live-overlay-inline","aria-live":"polite"},bb={class:"live-overlay-label"},_b={key:1,class:"live-overlay-error"},kb=["src"],Tb=16,Ib=Lt({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},cwd:{},scrollState:{},isTurnInProgress:{type:Boolean},isRollingBack:{type:Boolean}},emits:["updateScrollState","respondServerRequest","rollback"],setup(e,{emit:t}){const n=D(new Set),r=D(new Set),s=D(new Set),o=D({});function i(k){return k.messageType==="commandExecution"&&!!k.commandExecution}function a(k){var S;return((S=k.commandExecution)==null?void 0:S.status)==="inProgress"||r.value.has(k.id)?!0:n.value.has(k.id)}function l(k){return r.value.has(k.id)}function u(k){var E;if(((E=k.commandExecution)==null?void 0:E.status)==="inProgress")return;const S=new Set(n.value);S.has(k.id)?S.delete(k.id):S.add(k.id),n.value=S}function c(k){const S=new Set(s.value);S.has(k.id)?S.delete(k.id):S.add(k.id),s.value=S}function f(k){return s.value.has(k.id)}function h(k){const S=k.commandExecution;if(!S)return"";switch(S.status){case"inProgress":return"⟳ Running";case"completed":return S.exitCode===0?"✓ Completed":`✗ Exit ${S.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function _(k){var E,g;const S=(E=k.commandExecution)==null?void 0:E.status;return S==="inProgress"?"cmd-status-running":S==="completed"&&((g=k.commandExecution)==null?void 0:g.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function L(k){const S=new Set(r.value);S.add(k),r.value=S,setTimeout(()=>{const E=new Set(r.value);E.delete(k),r.value=E},1e3)}function C(k,S){const E=[];for(let g=S-1;g>=0;g--){const M=k[g];if(M.messageType==="commandExecution")E.unshift(M);else if(M.role==="user"||M.messageType==="worked")break}return E}const j=e,Z=t,B=D(null),J=D(null),W=D(null),ae=D(""),le=D({}),ve=D({});let ke=0,ne=0,q=0;const oe=new WeakSet,Q=D(new Set);function Ie(k){if(!k||/\s/u.test(k)||k.endsWith("/")||k.endsWith("\\"))return!1;if(k.startsWith("file://"))return!0;if(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(k))return!1;const S=k.startsWith("/"),E=/^[A-Za-z]:[\\/]/u.test(k),g=k.startsWith("./")||k.startsWith("../")||k.startsWith("~/"),M=k.includes("/")||k.includes("\\");return S||E||g||M}function Ce(k){return k.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||k}function Le(k){return k.replace(/\\/gu,"/")}function Ae(k){if(!k.startsWith("file://"))return k;let S=k.replace(/^file:\/\//u,"");try{S=decodeURIComponent(S)}catch{}return/^\/[A-Za-z]:\//u.test(S)&&(S=S.slice(1)),S}function _e(k){const S=Le(k),E=S.match(/^\/Users\/([^/]+)/u);if(E)return`/Users/${E[1]}`;const g=S.match(/^\/home\/([^/]+)/u);return g?`/home/${g[1]}`:""}function Re(k){const S=Le(k);if(!S)return S;let E="",g=S;const M=g.match(/^([A-Za-z]:)(\/.*)?$/u);M?(E=`${M[1]}/`,g=(M[2]??"").replace(/^\/+/u,"")):g.startsWith("/")&&(E="/",g=g.slice(1));const O=g.split("/").filter(Boolean),de=[];for(const Ne of O)if(Ne!=="."){if(Ne===".."){de.length>0&&de.pop();continue}de.push(Ne)}const pe=de.join("/");return E?`${E}${pe}`.replace(/\/+$/u,"")||E:pe||S}function ct(k,S){const E=Le(Ae(k.trim()));if(!E)return"";if(E.startsWith("/")||/^[A-Za-z]:\//u.test(E))return Re(E);if(E.startsWith("~/")){const O=_e(S);if(O)return Re(`${O}/${E.slice(2)}`)}const M=Le(S.trim());return Re(M?`${M.replace(/\/+$/u,"")}/${E}`:E)}function We(k){if(!k)return null;let S=k.trim();S=Ge(S).core.trim();let g=null;const M=S.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(M)S=M[1],g=Number(M[2]);else{const O=S.match(/^(.*):(\d+)(?::\d+)?$/u);O&&(S=O[1],g=Number(O[2]))}return S=Ae(S),Ie(S)?{path:S,line:g}:null}function Ge(k){let S=k,E="",g="";for(;/^[('"`[{<“‘]/u.test(S);)E+=S[0],S=S.slice(1);for(;/[)"'`\]}>”’]$/u.test(S);)g=S.slice(-1)+g,S=S.slice(0,-1);return{core:S,leading:E,trailing:g}}function Ye(k){const E=k.trim().match(/^\[([^\]\n]+)\]\(([^)\n]+)\)$/u);if(!E)return null;const g=(E[1]??"").trim(),M=(E[2]??"").trim(),O=Ge(g).core.trim()||g,de=Ge(M).core.trim();return de?{label:O,target:de}:null}function st(k){const S=[],E=/https?:\/\/\S+|file:\/\/\S+|\S*[\\/]\S+/gu;let g=0;for(const M of k.matchAll(E)){if(typeof M.index!="number")continue;const O=M.index,de=O+M[0].length;O>g&&S.push({kind:"text",value:k.slice(g,O)});let pe=M[0],Ne="";for(;/[.,;:]$/u.test(pe);)Ne=pe.slice(-1)+Ne,pe=pe.slice(0,-1);const Ke=Ge(pe);pe=Ke.core;const Je=Ke.leading,St=Ke.trailing+Ne;if(Je&&S.push({kind:"text",value:Je}),pe.startsWith("**")&&pe.endsWith("**")&&pe.length>4)S.push({kind:"bold",value:pe.slice(2,-2)}),St&&S.push({kind:"text",value:St});else if(/^https?:\/\//u.test(pe))S.push({kind:"url",value:pe,href:pe}),St&&S.push({kind:"text",value:St});else{const At=We(pe);At?(S.push({kind:"file",value:pe,path:At.path,displayPath:pe,downloadName:Ce(At.path)}),St&&S.push({kind:"text",value:St})):S.push({kind:"text",value:M[0]})}g=de}return g<k.length&&S.push({kind:"text",value:k.slice(g)}),nt(S)}function nt(k){const S=[];let E=!1,g="";const M=O=>{O&&S.push({kind:"text",value:O})};for(const O of k){if(O.kind!=="text"){E&&(M(`**${g}`),E=!1,g=""),S.push(O);continue}let de=O.value;for(;de.length>0;){const pe=de.indexOf("**");if(pe<0){E?g+=de:M(de);break}const Ne=de.slice(0,pe);E?g+=Ne:M(Ne),de=de.slice(pe+2),E?(g.length>0?S.push({kind:"bold",value:g}):M("****"),g="",E=!1):E=!0}}return E&&M(`**${g}`),S}function Fe(k){const S=/\[([^\]\n]+)\]\(([^)\n]+)\)/gu,E=[];let g=0;for(const M of k.matchAll(S)){if(typeof M.index!="number")continue;const[O,de,pe]=M,Ne=M.index,Ke=Ne+O.length;Ne>g&&E.push(...st(k.slice(g,Ne)));const Je=Ye(`[${de??""}](${pe??""})`),St=(Je==null?void 0:Je.label)??(de??"").trim(),At=(Je==null?void 0:Je.target)??(pe??"").trim();if(/^https?:\/\//u.test(At))E.push({kind:"url",value:St||At,href:At});else{const In=We(At);In?E.push({kind:"file",value:At,path:In.path,displayPath:St||At,downloadName:Ce(In.path)}):E.push({kind:"text",value:O})}g=Ke}return g<k.length&&E.push(...st(k.slice(g))),E}function tt(k){if(!k.includes("`"))return Fe(k);const S=[];let E=0,g=0;for(;E<k.length;){if(k[E]!=="`"){E+=1;continue}let M=1;for(;E+M<k.length&&k[E+M]==="`";)M+=1;const O="`".repeat(M);let de=E+M,pe=-1;for(;de<k.length;){const Ke=k.indexOf(O,de);if(Ke<0)break;const Je=Ke>0&&k[Ke-1]==="`",St=Ke+M<k.length&&k[Ke+M]==="`",At=k.slice(E+M,Ke).includes(`
|
|
26
|
+
`);if(!Je&&!St&&!At){pe=Ke;break}de=Ke+1}if(pe<0){E+=M;continue}E>g&&S.push(...Fe(k.slice(g,E)));const Ne=k.slice(E+M,pe);if(Ne.length>0){const Ke=Ye(Ne);if(Ke)if(/^https?:\/\//u.test(Ke.target))S.push({kind:"url",value:Ke.label||Ke.target,href:Ke.target});else{const Je=We(Ke.target);Je?S.push({kind:"file",value:Ke.target,path:Je.path,displayPath:Ke.label||Ke.target,downloadName:Ce(Je.path)}):S.push({kind:"code",value:Ne})}else{const Je=We(Ne);if(Je){const St=Je.line?`${Je.path}:${String(Je.line)}`:Je.path;S.push({kind:"file",value:Ne,path:Je.path,displayPath:St,downloadName:Ce(Je.path)})}else S.push({kind:"code",value:Ne})}}else S.push({kind:"text",value:`${O}${O}`});E=pe+M,g=E}return g<k.length&&S.push(...Fe(k.slice(g))),S}function z(k){const S=k.trim();if(!S)return"";if(S.startsWith("data:")||S.startsWith("blob:")||S.startsWith("http://")||S.startsWith("https://")||S.startsWith("/codex-local-image?"))return S;if(S.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(S)}`;const E=S.startsWith("/"),g=/^[A-Za-z]:[\\/]/u.test(S);return E||g?`/codex-local-image?path=${encodeURIComponent(S)}`:S}function fe(k){const S=k.trim();if(!S)return"#";const E=de=>de.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(de),g=We(S),M=(g==null?void 0:g.path)??S,O=ct(M,j.cwd);if(E(O)){const de=O.startsWith("/")?O:`/${O}`;return`/codex-local-browse${encodeURI(de)}`}return"#"}function ce(k){if(!k.includes(")return[{kind:"text",value:k}];const S=[],E=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let g=0;for(const M of k.matchAll(E)){const[O,de,pe]=M;if(typeof M.index!="number")continue;const Ne=M.index,Ke=Ne+O.length,Je=z(pe.trim());Je&&(Ne>g&&S.push({kind:"text",value:k.slice(g,Ne)}),S.push({kind:"image",url:Je,alt:de.trim(),markdown:O}),g=Ke)}return g<k.length&&S.push({kind:"text",value:k.slice(g)}),S.length>0?S:[{kind:"text",value:k}]}function he(k){return k!==null&&typeof k=="object"&&!Array.isArray(k)?k:null}function $e(k){const S=new Date(k);return Number.isNaN(S.getTime())?k:S.toLocaleTimeString()}function v(k){const S=he(k.params),E=S==null?void 0:S.reason;return typeof E=="string"?E.trim():""}function y(k,S){return`${String(k)}:${S}`}function R(k){const S=he(k.params),E=Array.isArray(S==null?void 0:S.questions)?S.questions:[],g=[];for(const M of E){const O=he(M);if(!O)continue;const de=typeof O.id=="string"?O.id:"";if(!de)continue;const pe=Array.isArray(O.options)?O.options.map(Ne=>he(Ne)).map(Ne=>Ne==null?void 0:Ne.label).filter(Ne=>typeof Ne=="string"&&Ne.length>0):[];g.push({id:de,header:typeof O.header=="string"?O.header:"",question:typeof O.question=="string"?O.question:"",isOther:O.isOther===!0,options:pe})}return g}function V(k,S,E){const g=y(k,S),M=le.value[g];return typeof M=="string"&&M.length>0?M:E}function U(k,S){const E=y(k,S);return ve.value[E]??""}function x(k,S,E){const g=E.target;if(!(g instanceof HTMLSelectElement))return;const M=y(k,S);le.value={...le.value,[M]:g.value}}function H(k,S,E){const g=E.target;if(!(g instanceof HTMLInputElement))return;const M=y(k,S);ve.value={...ve.value,[M]:g.value}}function F(k,S){Z("respondServerRequest",{id:k,result:{decision:S}})}function K(k){const S=R(k),E={};for(const g of S){const M=V(k.id,g.id,g.options[0]||""),O=U(k.id,g.id).trim(),de=[M,O].map(pe=>pe.trim()).filter(pe=>pe.length>0);E[g.id]={answers:de}}Z("respondServerRequest",{id:k.id,result:{answers:E}})}function G(k){Z("respondServerRequest",{id:k,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function we(k){Z("respondServerRequest",{id:k,result:{success:!0,contentItems:[]}})}function ue(k){Z("respondServerRequest",{id:k,result:{}})}function me(k){Z("respondServerRequest",{id:k,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function Te(k){return!(k.role!=="user"&&k.role!=="assistant"||typeof k.turnIndex!="number"||j.isTurnInProgress||j.isRollingBack)}function Oe(k){return k.role!=="user"&&k.role!=="assistant"?!1:k.text.trim().length>0}function ze(k){return Oe(k)||Te(k)}async function Ve(k){if(!Oe(k))return;const S=k.text.trim();try{await navigator.clipboard.writeText(S)}catch{const E=document.createElement("textarea");E.value=S,E.setAttribute("readonly","true"),E.style.position="fixed",E.style.opacity="0",document.body.appendChild(E),E.select(),document.execCommand("copy"),document.body.removeChild(E)}}function De(k){Te(k)&&Z("rollback",{turnIndex:k.turnIndex})}function pt(){const k=B.value,S=J.value;!k||!S||(k.scrollTop=k.scrollHeight,S.scrollIntoView({block:"end"}))}function Xe(k){return k.scrollHeight-(k.scrollTop+k.clientHeight)<=Tb}function Ze(k){if(!j.activeThreadId)return;const S=Math.max(k.scrollHeight-k.clientHeight,0),E=S>0?Math.min(Math.max(k.scrollTop/S,0),1):1;Z("updateScrollState",{threadId:j.activeThreadId,state:{scrollTop:k.scrollTop,isAtBottom:Xe(k),scrollRatio:E}})}function jt(){const k=B.value;if(!k)return;const S=j.scrollState;if(!S||S.isAtBottom){Bt();return}const E=Math.max(k.scrollHeight-k.clientHeight,0),g=typeof S.scrollRatio=="number"?S.scrollRatio*E:S.scrollTop;k.scrollTop=Math.min(Math.max(g,0),E),Ze(k)}function Bt(){const k=B.value;k&&(pt(),Ze(k))}function mt(){const k=j.scrollState;return!k||k.isAtBottom===!0}function Tt(){if(!mt()){q=0,ne=0;return}if(Bt(),q-=1,q<=0){ne=0;return}ne=requestAnimationFrame(Tt)}function $t(k=6){mt()&&(ne&&(cancelAnimationFrame(ne),ne=0),q=Math.max(k,1),ne=requestAnimationFrame(Tt))}function It(){$t(3)}function Dn(){if(!mt())return;const k=B.value;if(!k)return;const S=k.querySelectorAll("img.message-image-preview");for(const E of S)E.complete||oe.has(E)||(oe.add(E),E.addEventListener("load",It,{once:!0}),E.addEventListener("error",It,{once:!0}))}async function Ht(){await en(),ke&&cancelAnimationFrame(ke),ke=requestAnimationFrame(()=>{ke=0,jt(),Dn(),$t()})}vt(()=>j.messages,async k=>{if(!j.isLoading){for(const S of k){if(S.messageType!=="commandExecution"||!S.commandExecution)continue;const E=o.value[S.id],g=S.commandExecution.status;E==="inProgress"&&g!=="inProgress"&&L(S.id),o.value[S.id]=g}await Ht()}}),vt(()=>j.liveOverlay,async k=>{k&&(await en(),Bt(),$t(8))},{deep:!0}),vt(()=>j.isLoading,async k=>{k||await Ht()}),vt(()=>j.activeThreadId,()=>{ae.value="",Q.value=new Set},{flush:"post"});function xe(){const k=B.value;!k||j.isLoading||Ze(k)}function Pe(k){ae.value=z(k)}function nn(k,S){return`${k}:${String(S)}`}function xt(k,S){const E=new Set(Q.value);E.add(nn(k,S)),Q.value=E}function Tn(k,S){return Q.value.has(nn(k,S))}function ln(){ae.value=""}function hn(){const k=W.value;k&&(k.scrollTop=k.scrollHeight)}return vt(()=>{var k;return(k=j.liveOverlay)==null?void 0:k.reasoningText},async k=>{k&&(await en(),hn())}),or(()=>{ke&&cancelAnimationFrame(ke),ne&&cancelAnimationFrame(ne)}),(k,S)=>(w(),T("section",Zy,[e.isLoading?(w(),T("p",ew,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(w(),T("p",tw," No messages in this thread yet. ")):(w(),T("ul",{key:2,ref_key:"conversationListRef",ref:B,class:"conversation-list",onScroll:xe},[(w(!0),T(je,null,Ct(e.pendingRequests,E=>(w(),T("li",{key:`server-request:${E.id}`,class:"conversation-item conversation-item-request"},[p("div",nw,[p("div",rw,[p("article",sw,[p("p",ow,se(E.method),1),p("p",iw,"Request #"+se(E.id)+" · "+se($e(E.receivedAtIso)),1),v(E)?(w(),T("p",aw,se(v(E)),1)):re("",!0),E.method==="item/commandExecution/requestApproval"?(w(),T("section",lw,[p("button",{type:"button",class:"request-button request-button-primary",onClick:g=>F(E.id,"accept")},"Accept",8,cw),p("button",{type:"button",class:"request-button",onClick:g=>F(E.id,"acceptForSession")},"Accept for Session",8,uw),p("button",{type:"button",class:"request-button",onClick:g=>F(E.id,"decline")},"Decline",8,dw),p("button",{type:"button",class:"request-button",onClick:g=>F(E.id,"cancel")},"Cancel",8,fw)])):E.method==="item/fileChange/requestApproval"?(w(),T("section",hw,[p("button",{type:"button",class:"request-button request-button-primary",onClick:g=>F(E.id,"accept")},"Accept",8,pw),p("button",{type:"button",class:"request-button",onClick:g=>F(E.id,"acceptForSession")},"Accept for Session",8,mw),p("button",{type:"button",class:"request-button",onClick:g=>F(E.id,"decline")},"Decline",8,gw),p("button",{type:"button",class:"request-button",onClick:g=>F(E.id,"cancel")},"Cancel",8,vw)])):E.method==="item/tool/requestUserInput"?(w(),T("section",yw,[(w(!0),T(je,null,Ct(R(E),g=>(w(),T("div",{key:`${E.id}:${g.id}`,class:"request-question"},[p("p",ww,se(g.header||g.question),1),g.header&&g.question?(w(),T("p",bw,se(g.question),1)):re("",!0),p("select",{class:"request-select",value:V(E.id,g.id,g.options[0]||""),onChange:M=>x(E.id,g.id,M)},[(w(!0),T(je,null,Ct(g.options,M=>(w(),T("option",{key:`${E.id}:${g.id}:${M}`,value:M},se(M),9,kw))),128))],40,_w),g.isOther?(w(),T("input",{key:1,class:"request-input",type:"text",value:U(E.id,g.id),placeholder:"Other answer",onInput:M=>H(E.id,g.id,M)},null,40,Tw)):re("",!0)]))),128)),p("button",{type:"button",class:"request-button request-button-primary",onClick:g=>K(E)}," Submit Answers ",8,Iw)])):E.method==="item/tool/call"?(w(),T("section",Sw,[p("button",{type:"button",class:"request-button request-button-primary",onClick:g=>G(E.id)},"Fail Tool Call",8,Ew),p("button",{type:"button",class:"request-button",onClick:g=>we(E.id)},"Success (Empty)",8,Cw)])):(w(),T("section",Aw,[p("button",{type:"button",class:"request-button request-button-primary",onClick:g=>ue(E.id)},"Return Empty Result",8,Rw),p("button",{type:"button",class:"request-button",onClick:g=>me(E.id)},"Reject Request",8,Pw)]))])])])]))),128)),(w(!0),T(je,null,Ct(e.messages,E=>{var g,M;return w(),T("li",{key:E.id,class:at(["conversation-item",{"conversation-item-actionable":ze(E)}]),"data-role":E.role,"data-message-type":E.messageType||""},[i(E)?(w(),T("div",Mw,[p("div",Ow,[p("button",{type:"button",class:at(["cmd-row",[_(E),{"cmd-expanded":a(E)}]]),onClick:O=>u(E)},[p("span",{class:at(["cmd-chevron",{"cmd-chevron-open":a(E)}])},"▶",2),p("code",$w,se(((g=E.commandExecution)==null?void 0:g.command)||"(command)"),1),p("span",Dw,se(h(E)),1)],10,Nw),p("div",{class:at(["cmd-output-wrap",{"cmd-output-visible":a(E),"cmd-output-collapsing":l(E)}])},[p("div",Lw,[p("pre",jw,se(((M=E.commandExecution)==null?void 0:M.aggregatedOutput)||"(no output)"),1)])],2)])])):(w(),T("div",{key:1,class:"message-row","data-role":E.role,"data-message-type":E.messageType||""},[p("div",{class:"message-stack","data-role":E.role},[p("article",{class:"message-body","data-role":E.role},[E.images&&E.images.length>0?(w(),T("ul",{key:0,class:"message-image-list","data-role":E.role},[(w(!0),T(je,null,Ct(E.images,O=>(w(),T("li",{key:O,class:"message-image-item"},[p("button",{class:"message-image-button",type:"button",onClick:de=>Pe(O)},[p("img",{class:"message-image-preview",src:z(O),alt:"Message image preview",loading:"lazy"},null,8,Ww)],8,Vw)]))),128))],8,Hw)):re("",!0),E.fileAttachments&&E.fileAttachments.length>0?(w(),T("div",Gw,[(w(!0),T(je,null,Ct(E.fileAttachments,O=>(w(),T("span",{key:O.path,class:"message-file-chip"},[S[1]||(S[1]=p("span",{class:"message-file-chip-icon"},"📄",-1)),p("a",{class:"message-file-link message-file-chip-name",href:fe(O.path),target:"_blank",rel:"noopener noreferrer",title:O.path},se(O.path),9,zw)]))),128))])):re("",!0),E.text.length>0?(w(),T("article",{key:2,class:"message-card","data-role":E.role},[E.messageType==="worked"?(w(),T("div",Kw,[p("button",{type:"button",class:"worked-separator",onClick:O=>c(E)},[S[2]||(S[2]=p("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),p("span",{class:at(["worked-chevron",{"worked-chevron-open":f(E)}])},"▶",2),p("p",Yw,se(E.text),1),S[3]||(S[3]=p("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Jw),f(E)?(w(),T("div",Xw,[(w(!0),T(je,null,Ct(C(e.messages,e.messages.indexOf(E)),O=>{var de,pe;return w(),T("div",{key:`worked-cmd-${O.id}`,class:"worked-cmd-item"},[p("button",{type:"button",class:at(["cmd-row",[_(O),{"cmd-expanded":a(O)}]]),onClick:Ne=>u(O)},[p("span",{class:at(["cmd-chevron",{"cmd-chevron-open":a(O)}])},"▶",2),p("code",Zw,se(((de=O.commandExecution)==null?void 0:de.command)||"(command)"),1),p("span",eb,se(h(O)),1)],10,Qw),p("div",{class:at(["cmd-output-wrap",{"cmd-output-visible":a(O),"cmd-output-collapsing":l(O)}])},[p("div",tb,[p("pre",nb,se(((pe=O.commandExecution)==null?void 0:pe.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):re("",!0)])):(w(),T("div",rb,[(w(!0),T(je,null,Ct(ce(E.text),(O,de)=>(w(),T(je,{key:`block-${de}`},[O.kind==="text"?(w(),T("p",sb,[(w(!0),T(je,null,Ct(tt(O.value),(pe,Ne)=>(w(),T(je,{key:`seg-${de}-${Ne}`},[pe.kind==="text"?(w(),T("span",ob,se(pe.value),1)):pe.kind==="bold"?(w(),T("strong",ib,se(pe.value),1)):pe.kind==="file"?(w(),T("a",{key:2,class:"message-file-link",href:fe(pe.path),target:"_blank",rel:"noopener noreferrer",title:pe.path},se(pe.displayPath),9,ab)):pe.kind==="url"?(w(),T("a",{key:3,class:"message-file-link",href:pe.href,target:"_blank",rel:"noopener noreferrer",title:pe.href},se(pe.value),9,lb)):(w(),T("code",cb,se(pe.value),1))],64))),128))])):Tn(E.id,de)?(w(),T("p",ub,se(O.markdown),1)):(w(),T("button",{key:2,class:"message-image-button",type:"button",onClick:pe=>Pe(O.url)},[p("img",{class:"message-image-preview message-markdown-image",src:O.url,alt:O.alt||"Embedded message image",loading:"lazy",onError:pe=>xt(E.id,de)},null,40,fb)],8,db))],64))),128))]))],8,qw)):re("",!0)],8,Uw),ze(E)?(w(),T("div",hb,[Oe(E)?(w(),T("button",{key:0,class:"message-action-button",type:"button",title:"Copy message text",onClick:O=>Ve(E)},[Ee(Qy,{class:"message-action-icon"}),S[4]||(S[4]=p("span",{class:"message-action-label"},"Copy",-1))],8,pb)):re("",!0),Te(E)?(w(),T("button",{key:1,class:"message-action-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:O=>De(E)},[Ee(Ky,{class:"message-action-icon"}),S[5]||(S[5]=p("span",{class:"message-action-label"},"Rollback",-1))],8,mb)):re("",!0)])):re("",!0)],8,Fw)],8,Bw))],10,xw)}),128)),e.liveOverlay?(w(),T("li",gb,[p("div",vb,[p("div",yb,[p("article",wb,[p("p",bb,se(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(w(),T("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:W},se(e.liveOverlay.reasoningText),513)):re("",!0),e.liveOverlay.errorText?(w(),T("p",_b,se(e.liveOverlay.errorText),1)):re("",!0)])])])])):re("",!0),p("li",{ref_key:"bottomAnchorRef",ref:J,class:"conversation-bottom-anchor"},null,512)],544)),ae.value.length>0?(w(),T("div",{key:3,class:"image-modal-backdrop",onClick:ln},[p("div",{class:"image-modal-content",onClick:S[0]||(S[0]=it(()=>{},["stop"]))},[p("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:ln},[Ee(nl,{class:"icon-svg"})]),p("img",{class:"image-modal-image",src:ae.value,alt:"Expanded message image"},null,8,kb)])])):re("",!0)]))}}),Sb=rt(Ib,[["__scopeId","data-v-b2208f01"]]),Oc=.0025,ji=3,Nc=2,Eb=256;function Cb(e){var ke;const t=D("idle"),n=D(typeof navigator<"u"&&!!((ke=navigator.mediaDevices)!=null&&ke.getUserMedia)),r=D(0),s=D(null);let o=null,i=null,a=[],l=null,u=null,c=null,f=null,h=[],_=!1,L=!1;function C(){const ne=s.value;if(!ne||typeof window>"u")return;const q=ne.getContext("2d");if(!q)return;const oe=Math.max(1,Math.floor(ne.clientWidth)),Q=Math.max(1,Math.floor(ne.clientHeight||36)),Ie=window.devicePixelRatio||1,Ce=Math.max(1,Math.floor(oe*Ie)),Le=Math.max(1,Math.floor(Q*Ie));(ne.width!==Ce||ne.height!==Le)&&(ne.width=Ce,ne.height=Le),q.setTransform(Ie,0,0,Ie,0,0),q.clearRect(0,0,oe,Q);const Ae=Math.max(12,Math.floor(oe/(ji+Nc))),_e=h.slice(-Ae),Re=Math.max(0,Ae-_e.length),ct=Q/2,We=getComputedStyle(ne).color||"#000000";for(let Ge=0;Ge<Ae;Ge+=1){const Ye=_e[Ge-Re]??0,nt=Math.max(.08,Math.min(1,Ye*18))*ct,Fe=Ge*(ji+Nc);q.globalAlpha=Ye<=Oc?.35:1,q.fillStyle=We,q.fillRect(Fe,ct-nt,ji,nt*2)}q.globalAlpha=1}function j(){h=[],r.value=0,C()}function Z(){c&&(c.disconnect(),c.onaudioprocess=null,c=null),u&&(u.disconnect(),u=null),l&&(l.close(),l=null),f=null}function B(ne){if(typeof window>"u")return;const q=window.webkitAudioContext,oe=window.AudioContext??q;oe&&(Z(),j(),l=new oe,u=l.createMediaStreamSource(ne),c=l.createScriptProcessor(2048,1,1),f=performance.now(),c.onaudioprocess=Q=>{const Ie=Q.inputBuffer.getChannelData(0);let Ce=0;for(let Le=0;Le<Ie.length;Le+=1){const Ae=Math.abs(Ie[Le]??0);Ce+=Ae<Oc?0:Ae}h.push(Ce/Ie.length),h.length>Eb&&h.shift(),f!==null&&(r.value=Math.max(0,performance.now()-f)),C()},u.connect(c),c.connect(l.destination),C())}async function J(){var ne;if(!(t.value!=="idle"||!n.value||_)){_=!0,L=!1;try{i=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),a=[],o=new MediaRecorder(i),o.ondataavailable=q=>{q.data.size>0&&a.push(q.data)},o.onstop=()=>{var Q;const q=a,oe=(o==null?void 0:o.mimeType)||((Q=q[0])==null?void 0:Q.type)||"audio/webm";le(),ae(q,oe)},B(i),o.start(250),t.value="recording",L&&W()}catch(q){le(),t.value="idle",(ne=e.onError)==null||ne.call(e,q)}finally{_=!1}}}function W(){if(_&&t.value==="idle"){L=!0;return}if(!(t.value!=="recording"||!o)&&o.state!=="inactive"){t.value="transcribing";try{o.requestData()}catch{}o.stop()}}async function ae(ne,q){var Q,Ie,Ce,Le;if(ne.length===0){(Q=e.onEmpty)==null||Q.call(e),t.value="idle";return}const oe=new Blob(ne,{type:q});t.value="transcribing";try{const Ae=q.split(/[/;]/)[1]??"webm",_e=new FormData;_e.append("file",oe,`codex.${Ae}`);const Re=await fetch("/codex-api/transcribe",{method:"POST",body:_e}),ct=await Re.text();let We=null;try{We=ct.trim()?JSON.parse(ct):null}catch{We=null}if(!Re.ok){const Ye=(Ie=We==null?void 0:We.error)==null?void 0:Ie.trim(),st=ct.trim();throw new Error(Ye||st||`Transcription failed: ${Re.status}`)}const Ge=((We==null?void 0:We.text)??"").trim();Ge.length>0?e.onTranscript(Ge):(Ce=e.onEmpty)==null||Ce.call(e)}catch(Ae){(Le=e.onError)==null||Le.call(e,Ae)}finally{t.value="idle"}}function le(){Z(),j(),o&&(o.ondataavailable=null,o.onstop=null,o=null),i&&(i.getTracks().forEach(ne=>ne.stop()),i=null),a=[]}or(le);function ve(){if(t.value==="recording"){W();return}t.value==="idle"&&J()}return{state:t,isSupported:n,recordingDurationMs:r,waveformCanvasRef:s,startRecording:J,stopRecording:W,toggleRecording:ve}}function $c(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 rl(e,t){const n=$c(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=$c(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function ws(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 of(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function Ab(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(rl(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 Dc(e){const t=of(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 Rb(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=Dc(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 u=JSON.parse(String(l.data)),c=Dc(u);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 Pb(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(rl(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function xb(){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(rl(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=of(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function Lc(e){return new Date(e*1e3).toISOString()}function Mb(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Ob(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Nb=/^##\s+(.+?):\s+(.+?)\s*$/,$b=/^#\s*files mentioned by the user\s*:?\s*$/i;function Db(e){var s,o;const t=e.split(`
|
|
27
|
+
`).findIndex(i=>$b.test(i.trim()));if(t<0)return[];const n=e.split(`
|
|
28
|
+
`).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(Nb);if(!l)break;const u=(s=l[1])==null?void 0:s.trim(),c=(o=l[2])==null?void 0:o.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");u&&c&&r.push({label:u,path:c})}return r}function Lb(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 jb(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:Ob(l),isUnhandled:!0});const o=n.join(`
|
|
29
|
+
`),i=Db(o);return{text:Lb(o),images:r,fileAttachments:i,rawBlocks:s}}function Bb(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=jb(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=Fb(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 Fb(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function Ub(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function Hb(e){const t=Ub(e);return t.length>0?t:"Untitled thread"}function af(e){return(e==null?void 0:e.status)==="inProgress"}function Vb(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 af(r)}function Wb(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:Hb(e),projectName:Mb(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:Lc(e.createdAt),updatedAtIso:Lc(e.updatedAt),preview:e.preview,unread:!1,inProgress:Vb(e)}}function Gb(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 zb(e){const t=e.data.map(Wb);return Gb(t)}function lf(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 Bb(i))n.push({...a,turnIndex:r})}return n}function qb(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return af(t.at(-1))}async function on(e,t){try{return await Ab(e,t)}catch(n){throw ws(n,`RPC ${e} failed`,e)}}function Kb(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function Jb(){const e=await on("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return zb(e)}async function Yb(e){const t=await on("thread/read",{threadId:e,includeTurns:!0});return{messages:lf(t),inProgress:qb(t)}}async function Xb(){try{return await Jb()}catch(e){throw ws(e,"Failed to load thread groups","thread/list")}}async function Qb(e){try{return await Yb(e)}catch(t){throw ws(t,`Failed to load thread ${e}`,"thread/read")}}function Zb(e){return Rb(e)}async function e_(e,t){await Pb({id:e,...t})}async function t_(){return xb()}async function Bi(e){await on("thread/resume",{threadId:e})}async function n_(e){await on("thread/archive",{threadId:e})}async function r_(e,t){await on("thread/name/set",{threadId:e,name:t})}async function jc(e,t){const n=await on("thread/rollback",{threadId:e,numTurns:t});return lf(n)}function s_(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 Bc(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 on("thread/start",n),s=s_(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw ws(n,"Failed to start a new thread","thread/start")}}function o_(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
|
|
30
|
+
`;for(const r of t)n+=`
|
|
31
|
+
## ${r.label}: ${r.path}
|
|
32
|
+
`;return`${n}
|
|
33
|
+
## My request for Codex:
|
|
34
|
+
|
|
35
|
+
${e}
|
|
36
|
+
`}async function Fi(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:o_(t,i)}];for(const f of n){const h=f.trim();h&&l.push({type:"image",url:h,image_url:h})}if(o)for(const f of o)l.push({type:"skill",name:f.name,path:f.path});const u=i.map(f=>({label:f.label,path:f.path,fsPath:f.fsPath})),c={threadId:e,input:l};u.length>0&&(c.attachments=u),typeof r=="string"&&r.length>0&&(c.model=r),typeof s=="string"&&s.length>0&&(c.effort=s),await on("turn/start",c)}catch(a){throw ws(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function i_(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 on("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw ws(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function a_(e){await on("setDefaultModel",{model:e})}async function l_(){const e=await on("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 c_(){const e=await on("config/read",{}),t=e.config.model??"",n=Kb(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function u_(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 wa(){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 u_(n.data)}async function d_(e){const t=await fetch("/codex-api/worktree/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceCwd:e})}),n=await t.json();if(!t.ok||!n.data)throw new Error(n.error||"Failed to create worktree");return n.data}async function Fc(){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 f_(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 h_(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=sl(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 p_(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=sl(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 m_(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 u=sl(o,"Failed to search files");throw new Error(u)}const i=o&&typeof o=="object"&&!Array.isArray(o)?o:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const u of a){if(!u||typeof u!="object"||Array.isArray(u))continue;const f=u.path,h=typeof f=="string"?f.trim():"";h&&l.push({path:h})}return l}async function g_(e,t=200){const n=await fetch("/codex-api/thread-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,limit:t})}),r=await n.json();if(!n.ok)throw new Error(r.error||"Failed to search threads");return r.data??{threadIds:[],indexedThreadCount:0}}function sl(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 v_(){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 Ui(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 y_(e,t){var n;try{return((n=(await on("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function w_(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await on("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 Uc(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 b_={},__={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function k_(e,t){return w(),T("svg",__,[...t[0]||(t[0]=[p("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 T_=rt(b_,[["render",k_]]),I_={},S_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function E_(e,t){return w(),T("svg",S_,[...t[0]||(t[0]=[p("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 C_=rt(I_,[["render",E_]]),A_={},R_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function P_(e,t){return w(),T("svg",R_,[...t[0]||(t[0]=[p("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),p("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 Hc=rt(A_,[["render",P_]]),x_=["disabled"],M_={class:"composer-dropdown-value"},O_={class:"composer-dropdown-menu"},N_={key:0,class:"composer-dropdown-search-wrap"},$_=["placeholder","onKeydown"],D_={class:"composer-dropdown-options",role:"listbox"},L_=["onClick"],j_={key:0,class:"composer-dropdown-empty"},B_={key:1,class:"composer-dropdown-add-wrap"},F_=["placeholder","onKeydown"],U_=Lt({__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=D(null),o=D(null),i=D(null),a=D(!1),l=D(""),u=D(!1),c=D(""),f=ie(()=>{var oe;const q=n.options.find(Q=>Q.value===n.modelValue);return q?q.label:((oe=n.placeholder)==null?void 0:oe.trim())||""}),h=ie(()=>n.openDirection??"down"),_=ie(()=>n.enableSearch===!0),L=ie(()=>n.showAddAction===!0),C=ie(()=>{var q;return((q=n.searchPlaceholder)==null?void 0:q.trim())||"Quick search projects"}),j=ie(()=>{var q;return((q=n.addActionLabel)==null?void 0:q.trim())||"Add new project"}),Z=ie(()=>{var q;return((q=n.addPlaceholder)==null?void 0:q.trim())||"Project name or absolute path"}),B=ie(()=>{const q=l.value.trim().toLowerCase();return q?n.options.filter(oe=>oe.label.toLowerCase().includes(q)||oe.value.toLowerCase().includes(q)):n.options});function J(){n.disabled||(a.value=!a.value)}function W(q){r("update:modelValue",q),a.value=!1,l.value=""}function ae(){var q;u.value=!0,c.value=((q=n.defaultAddValue)==null?void 0:q.trim())||"",en(()=>{var oe;return(oe=i.value)==null?void 0:oe.focus()})}function le(){if(l.value.length>0){l.value="";return}a.value=!1}function ve(){const q=c.value.trim();q&&(r("add",q),u.value=!1,c.value="",a.value=!1,l.value="")}function ke(){u.value=!1,c.value="",a.value=!1,l.value=""}function ne(q){if(!a.value)return;const oe=s.value;if(!oe)return;const Q=q.target;Q instanceof Node&&(oe.contains(Q)||(a.value=!1,l.value="",u.value=!1,c.value=""))}return vt(a,q=>{if(!q){u.value=!1,c.value="";return}_.value&&en(()=>{var oe;return(oe=o.value)==null?void 0:oe.focus()})}),sr(()=>{window.addEventListener("pointerdown",ne)}),or(()=>{window.removeEventListener("pointerdown",ne)}),(q,oe)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[p("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:J},[p("span",M_,se(f.value),1),Ee(fi,{class:"composer-dropdown-chevron"})],8,x_),a.value?(w(),T("div",{key:0,class:at(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":h.value==="up","composer-dropdown-menu-wrap-down":h.value==="down"}])},[p("div",O_,[_.value?(w(),T("div",N_,[Zn(p("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":oe[0]||(oe[0]=Q=>l.value=Q),class:"composer-dropdown-search-input",type:"text",placeholder:C.value,onKeydown:Zt(it(le,["prevent"]),["esc"])},null,40,$_),[[er,l.value]])])):re("",!0),p("ul",D_,[(w(!0),T(je,null,Ct(B.value,Q=>(w(),T("li",{key:Q.value},[p("button",{class:at(["composer-dropdown-option",{"is-selected":Q.value===e.modelValue}]),type:"button",onClick:Ie=>W(Q.value)},se(Q.label),11,L_)]))),128)),B.value.length===0?(w(),T("li",j_," No matching projects ")):re("",!0)]),L.value?(w(),T("div",B_,[u.value?(w(),T(je,{key:0},[Zn(p("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":oe[1]||(oe[1]=Q=>c.value=Q),class:"composer-dropdown-add-input",type:"text",placeholder:Z.value,onKeydown:[Zt(it(ve,["prevent"]),["enter"]),Zt(it(ke,["prevent"]),["esc"])]},null,40,F_),[[er,c.value]]),p("div",{class:"composer-dropdown-add-actions"},[p("button",{type:"button",class:"composer-dropdown-add-btn",onClick:ve},"Open"),p("button",{type:"button",class:"composer-dropdown-add-btn",onClick:ke},"Cancel")])],64)):(w(),T("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:ae},se(j.value),1))])):re("",!0)])],2)):re("",!0)],512))}}),ba=rt(U_,[["__scopeId","data-v-7cfa2012"]]),H_=["disabled"],V_={class:"search-dropdown-value"},W_={class:"search-dropdown-search-wrap"},G_=["placeholder","onKeydown"],z_={key:0,class:"search-dropdown-list",role:"listbox"},q_=["onClick","onPointerenter"],K_={class:"search-dropdown-option-check"},J_={class:"search-dropdown-option-label"},Y_={key:0,class:"search-dropdown-option-desc"},X_={key:1,class:"search-dropdown-empty"},Q_=Lt({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(!1),a=D(""),l=D(0),u=ie(()=>n.openDirection??"down"),c=ie(()=>new Set(n.selectedValues)),f=ie(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const B=n.options.find(J=>J.value===n.selectedValues[0]);return(B==null?void 0:B.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),h=ie(()=>{const B=a.value.toLowerCase().trim();return B?n.options.filter(J=>{var W;return J.label.toLowerCase().includes(B)||(((W=J.description)==null?void 0:W.toLowerCase().includes(B))??!1)}):n.options});function _(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,en(()=>{var B;return(B=o.value)==null?void 0:B.focus()})))}function L(B){r("toggle",B.value,!c.value.has(B.value))}function C(B){h.value.length!==0&&(l.value=(l.value+B+h.value.length)%h.value.length)}function j(){const B=h.value[l.value];B&&L(B)}function Z(B){if(!i.value)return;const J=s.value;if(!J)return;const W=B.target;W instanceof Node&&(J.contains(W)||(i.value=!1))}return vt(a,()=>{l.value=0}),sr(()=>window.addEventListener("pointerdown",Z)),or(()=>window.removeEventListener("pointerdown",Z)),(B,J)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[p("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:_},[p("span",V_,se(f.value),1),Ee(fi,{class:"search-dropdown-chevron"})],8,H_),i.value?(w(),T("div",{key:0,class:at(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":u.value==="up","search-dropdown-menu-wrap-down":u.value==="down"}])},[p("div",W_,[Zn(p("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":J[0]||(J[0]=W=>a.value=W),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[J[1]||(J[1]=Zt(it(W=>i.value=!1,["prevent"]),["escape"])),Zt(it(j,["prevent"]),["enter"]),J[2]||(J[2]=Zt(it(W=>C(1),["prevent"]),["arrow-down"])),J[3]||(J[3]=Zt(it(W=>C(-1),["prevent"]),["arrow-up"]))]},null,40,G_),[[er,a.value]])]),h.value.length>0?(w(),T("ul",z_,[(w(!0),T(je,null,Ct(h.value,(W,ae)=>(w(),T("li",{key:W.value},[p("button",{class:at(["search-dropdown-option",{"is-selected":c.value.has(W.value),"is-highlighted":ae===l.value}]),type:"button",onClick:le=>L(W),onPointerenter:le=>l.value=ae},[p("span",K_,se(c.value.has(W.value)?"✓":""),1),p("span",J_,se(W.label),1),W.description?(w(),T("span",Y_,se(W.description),1)):re("",!0)],42,q_)]))),128))])):(w(),T("div",X_,"No results"))],2)):re("",!0)],512))}}),Z_=rt(Q_,[["__scopeId","data-v-a0f2edd4"]]),ek={class:"skill-picker-header"},tk=["onKeydown"],nk={key:0,class:"skill-picker-list",role:"listbox"},rk=["onClick","onPointerenter"],sk={class:"skill-picker-name"},ok={key:0,class:"skill-picker-desc"},ik={key:1,class:"skill-picker-empty"},ak=Lt({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(""),a=D(0),l=ie(()=>{const h=i.value.toLowerCase().trim();return h?n.skills.filter(_=>_.name.toLowerCase().includes(h)||_.description.toLowerCase().includes(h)):n.skills}),u=ie(()=>{const h={};return n.anchorBottom!=null&&(h.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(h.left=`${n.anchorLeft}px`),h});function c(h){l.value.length!==0&&(a.value=(a.value+h+l.value.length)%l.value.length)}function f(){const h=l.value[a.value];h&&r("select",h)}return vt(()=>n.visible,h=>{h&&(i.value="",a.value=0,en(()=>{var _;return(_=o.value)==null?void 0:_.focus()}))}),vt(i,()=>{a.value=0}),(h,_)=>e.visible?(w(),T("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:Wr(u.value)},[p("div",ek,[Zn(p("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":_[0]||(_[0]=L=>i.value=L),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[_[1]||(_[1]=Zt(it(L=>h.$emit("close"),["prevent"]),["escape"])),Zt(it(f,["prevent"]),["enter"]),_[2]||(_[2]=Zt(it(L=>c(1),["prevent"]),["arrow-down"])),_[3]||(_[3]=Zt(it(L=>c(-1),["prevent"]),["arrow-up"]))]},null,40,tk),[[er,i.value]])]),l.value.length>0?(w(),T("ul",nk,[(w(!0),T(je,null,Ct(l.value,(L,C)=>(w(),T("li",{key:L.path},[p("button",{class:at(["skill-picker-item",{"is-highlighted":C===a.value}]),type:"button",onClick:j=>h.$emit("select",L),onPointerenter:j=>a.value=C},[p("span",sk,se(L.name),1),L.description?(w(),T("span",ok,se(L.description),1)):re("",!0)],42,rk)]))),128))])):(w(),T("div",ik,"No skills found"))],4)):re("",!0)}}),lk=rt(ak,[["__scopeId","data-v-ff3fb7dc"]]),ck={key:0,class:"thread-composer-dictation-error"},uk={key:0,class:"thread-composer-attachments"},dk=["src","alt"],fk=["aria-label","disabled","onClick"],hk={key:1,class:"thread-composer-folder-chips"},pk=["title"],mk={class:"thread-composer-folder-chip-meta"},gk=["aria-label","disabled","onClick"],vk={key:2,class:"thread-composer-file-chips"},yk=["title"],wk=["aria-label","disabled","onClick"],bk={key:3,class:"thread-composer-skill-chips"},_k={class:"thread-composer-skill-chip-name"},kk=["aria-label","onClick"],Tk={class:"thread-composer-input-wrap"},Ik={key:0,class:"thread-composer-file-mentions"},Sk=["onMousedown"],Ek={key:1,class:"thread-composer-file-mention-icon-markdown"},Ck={class:"thread-composer-file-mention-text"},Ak={class:"thread-composer-file-mention-name"},Rk={key:0,class:"thread-composer-file-mention-dir"},Pk={key:1,class:"thread-composer-file-mention-empty"},xk=["placeholder","disabled"],Mk=["disabled"],Ok={key:0,class:"thread-composer-attach-menu"},Nk=["disabled"],$k=["disabled"],Dk=["disabled"],Lk={key:0,class:"thread-composer-dictation-waveform-wrap","aria-hidden":"true"},jk={key:1,class:"thread-composer-dictation-timer"},Bk=["aria-label","title","disabled"],Fk={key:1,class:"thread-composer-mic-spinner","aria-hidden":"true"},Uk=["disabled"],Hk=["aria-label","title","disabled"],Vk=["disabled"],Wk=["disabled"],Gk=["disabled"],zk=Lt({__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:{},dictationClickToToggle:{type:Boolean}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(e,{emit:t}){const n=e,r=t,s=D(""),o=D([]),i=D([]),a=D([]),l=D([]),u=D(""),{state:c,isSupported:f,recordingDurationMs:h,waveformCanvasRef:_,startRecording:L,stopRecording:C,toggleRecording:j}=Cb({onTranscript:g=>{s.value=s.value?`${s.value}
|
|
37
|
+
${g}`:g,u.value="",en(()=>{var M;return(M=ae.value)==null?void 0:M.focus()})},onEmpty:()=>{u.value=n.dictationClickToToggle?"No speech detected. Click again after speaking.":"No speech detected. Hold the mic and speak."},onError:g=>{if(g instanceof DOMException&&g.name==="NotAllowedError"){u.value="Microphone access was denied.";return}u.value=g instanceof Error?g.message:"Dictation failed."}}),Z=D(null),B=D(null),J=D(null),W=D(null),ae=D(null),le=D(!1),ve=D(!1),ke=D(null),ne=D(""),q=D([]),oe=D(!1),Q=D(0);let Ie=0,Ce=null,Le=!1;const Ae=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),_e=[{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"}],Re=ie(()=>n.models.map(g=>({value:g,label:g}))),ct=ie(()=>n.skills??[]),We=ie(()=>i.value.map(g=>g.path)),Ge=ie(()=>(n.skills??[]).map(g=>({value:g.path,label:g.name,description:g.description}))),Ye=ie(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),st=ie(()=>{const g=new Set;for(const M of l.value)for(const O of M.filePaths)g.add(O);return a.value.filter(M=>!g.has(M.fsPath))}),nt=ie(()=>n.disabled||!n.activeThreadId),Fe=ie(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),tt=ie(()=>c.value==="recording"),z=ie(()=>c.value==="recording"?"Stop dictation":c.value==="transcribing"?"Transcribing dictation":n.dictationClickToToggle?"Click to dictate":"Hold to dictate"),fe=ie(()=>c.value==="idle"?u.value.trim():""),ce=ie(()=>{const g=Math.max(0,Math.floor(h.value/1e3)),M=Math.floor(g/60),O=g%60;return`${M}:${String(O).padStart(2,"0")}`}),he=ie(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function $e(g="steer"){var O;const M=s.value.trim();if(Ye.value){if(r("submit",{text:M,imageUrls:o.value.map(de=>de.url),fileAttachments:[...a.value],skills:i.value.map(de=>({name:de.name,path:de.path})),mode:g}),s.value="",o.value=[],i.value=[],a.value=[],l.value=[],le.value=!1,ve.value=!1,It(),Ae){(O=ae.value)==null||O.blur();return}en(()=>{var de;return(de=ae.value)==null?void 0:de.focus()})}}function v(){r("interrupt")}function y(g){r("update:selected-model",g)}function R(g){r("update:selected-reasoning-effort",g)}function V(){n.dictationClickToToggle&&(u.value&&(u.value=""),j())}function U(g){if(n.dictationClickToToggle||(g.preventDefault(),Le))return;Le=!0;const M=g.currentTarget;if(M)try{M.setPointerCapture(g.pointerId)}catch{}u.value&&(u.value=""),window.addEventListener("pointerup",x),window.addEventListener("pointercancel",x),window.addEventListener("blur",x),L()}function x(){n.dictationClickToToggle||Le&&(Le=!1,window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x),window.removeEventListener("blur",x),C())}function H(){nt.value||(le.value=!le.value)}function F(){var g;(g=B.value)==null||g.click()}function K(){var g;(g=J.value)==null||g.click()}function G(){var g;(g=W.value)==null||g.click()}function we(g){o.value=o.value.filter(M=>M.id!==g)}function ue(g){i.value=i.value.filter(M=>M.path!==g)}function me(g){a.value=a.value.filter(M=>M.fsPath!==g)}function Te(g){const M=l.value.find(de=>de.id===g);if(!M)return;const O=new Set(M.filePaths);a.value=a.value.filter(de=>!O.has(de.fsPath)),l.value=l.value.filter(de=>de.id!==g)}function Oe(g){return g.total<=0?0:Math.round(g.processed/g.total*100)}function ze(g,M){const O=g.replace(/\\/g,"/");if(a.value.some(Ne=>Ne.fsPath===O))return;const de=O.split("/").filter(Boolean),pe=(M==null?void 0:M.trim())||de[de.length-1]||O;a.value=[...a.value,{label:pe,path:O,fsPath:O}]}function Ve(g){return g.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(g.name)}function De(g){if(!(!g||g.length===0))for(const M of Array.from(g))if(Ve(M)){const O=new FileReader;O.onload=()=>{typeof O.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:M.name,url:O.result})},O.readAsDataURL(M)}else Uc(M).then(O=>{O&&ze(O)}).catch(()=>{})}async function pt(g){if(!g||g.length===0)return;const M=Array.from(g),de=(M[0].webkitRelativePath||M[0].name).split("/").filter(Boolean)[0]||"Folder",pe=`${Date.now()}-${Math.random().toString(36).slice(2)}`;l.value=[...l.value,{id:pe,name:de,total:M.length,processed:0,filePaths:[],isUploading:!0}];const Ne=Ke=>{l.value=l.value.map(Je=>Je.id===pe?Ke(Je):Je)};for(const Ke of M)try{const Je=await Uc(Ke);if(Je){const St=Ke.webkitRelativePath||Ke.name;ze(Je,St),Ne(At=>({...At,processed:At.processed+1,filePaths:[...At.filePaths,Je]}));continue}Ne(St=>({...St,processed:St.processed+1}))}catch{Ne(Je=>({...Je,processed:Je.processed+1}))}Ne(Ke=>({...Ke,isUploading:!1}))}function Xe(g){g&&(g.value="")}function Ze(g){const M=g.target;De((M==null?void 0:M.files)??null),Xe(M),le.value=!1}function jt(g){const M=g.target;De((M==null?void 0:M.files)??null),Xe(M),le.value=!1}function Bt(g){const M=g.target;pt((M==null?void 0:M.files)??null),Xe(M),le.value=!1}function mt(){u.value&&(u.value="");const M=s.value.startsWith("/");M!==ve.value&&(ve.value=M),Dn()}function Tt(g){if(oe.value){if(g.key==="Escape"){g.preventDefault(),It();return}if(g.key==="ArrowDown"){g.preventDefault(),q.value.length>0&&(Q.value=(Q.value+1)%q.value.length);return}if(g.key==="ArrowUp"){if(g.preventDefault(),q.value.length>0){const O=q.value.length;Q.value=(Q.value+O-1)%O}return}if(g.key==="Enter"||g.key==="Tab"){g.preventDefault();const O=q.value[Q.value];O?xe(O):It();return}}if(n.sendWithEnter!==!1?g.key==="Enter"&&!g.shiftKey:g.key==="Enter"&&(g.metaKey||g.ctrlKey)){g.preventDefault(),$e(n.isTurnInProgress?Fe.value:"steer");return}if(ve.value){if(g.key==="Escape"){g.preventDefault(),$t();return}if(g.key==="ArrowDown"||g.key==="ArrowUp"){g.preventDefault();return}}}function $t(){var g;ve.value=!1,(g=ae.value)==null||g.focus()}function It(){oe.value=!1,ke.value=null,ne.value="",q.value=[],Q.value=0}function Dn(){const g=ae.value;if(!g){It();return}const M=g.selectionStart??s.value.length,de=s.value.slice(0,M).match(/(^|\s)(@[^\s@]*)$/);if(!de){It();return}const pe=de[2]??"",Ne=pe.length,Ke=M-Ne;ke.value=Ke,ne.value=pe.slice(1),oe.value=!0,Ht()}async function Ht(){if(!oe.value)return;const g=(n.cwd??"").trim();if(!g){q.value=[];return}Ce&&clearTimeout(Ce);const M=++Ie;Ce=setTimeout(async()=>{try{const O=await m_(g,ne.value,20);if(!oe.value||M!==Ie)return;q.value=O,Q.value=0}catch{if(!oe.value||M!==Ie)return;q.value=[]}},120)}function xe(g){const M=ae.value,O=ke.value;if(O!==null&&M){const de=M.selectionStart??s.value.length;s.value=`${s.value.slice(0,O)}${s.value.slice(de)}`.trimEnd()}ze(g.path),It(),en(()=>M==null?void 0:M.focus())}function Pe(g){const M=g.lastIndexOf("/");return M<0?g:g.slice(M+1)}function nn(g){const M=g.lastIndexOf("/");return M<=0?"":g.slice(0,M)}function xt(g){const M=Pe(g),O=M.lastIndexOf(".");return O<=0?"":M.slice(O+1).toLowerCase()}function Tn(g){const M=xt(g);return M==="ts"?"TS":M==="tsx"?"TSX":M==="js"?"JS":M==="jsx"?"JSX":M==="json"?"{}":""}function ln(g){const M=xt(g);return M.startsWith("ts")?"ts":M.startsWith("js")?"js":M==="json"?"json":"default"}function hn(g){const M=xt(g);return M==="md"||M==="mdx"}function k(g){var M;i.value.some(O=>O.path===g.path)||(i.value=[...i.value,g]),s.value=s.value.startsWith("/")?"":s.value,ve.value=!1,(M=ae.value)==null||M.focus()}function S(g,M){if(M){const O=(n.skills??[]).find(de=>de.path===g);O&&!i.value.some(de=>de.path===g)&&(i.value=[...i.value,O])}else i.value=i.value.filter(O=>O.path!==g)}function E(g){if(!le.value)return;const M=Z.value;if(!M)return;const O=g.target;!O||M.contains(O)||(le.value=!1)}return sr(()=>{document.addEventListener("click",E)}),or(()=>{document.removeEventListener("click",E),window.removeEventListener("pointerup",x),window.removeEventListener("pointercancel",x),window.removeEventListener("blur",x),Ce&&clearTimeout(Ce)}),vt(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],l.value=[],u.value="",le.value=!1,ve.value=!1,It()}),vt(()=>n.cwd,()=>{oe.value&&Ht()}),(g,M)=>(w(),T("form",{class:"thread-composer",onSubmit:M[2]||(M[2]=it(O=>$e("steer"),["prevent"]))},[fe.value?(w(),T("p",ck,se(fe.value),1)):re("",!0),p("div",{class:at(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(w(),T("div",uk,[(w(!0),T(je,null,Ct(o.value,O=>(w(),T("div",{key:O.id,class:"thread-composer-attachment"},[p("img",{class:"thread-composer-attachment-image",src:O.url,alt:O.name||"Selected image"},null,8,dk),p("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${O.name||"image"}`,disabled:nt.value,onClick:de=>we(O.id)}," x ",8,fk)]))),128))])):re("",!0),l.value.length>0?(w(),T("div",hk,[(w(!0),T(je,null,Ct(l.value,O=>(w(),T("span",{key:O.id,class:"thread-composer-folder-chip"},[Ee(tl,{class:"thread-composer-folder-chip-icon"}),p("span",{class:"thread-composer-folder-chip-name",title:O.name},se(O.name),9,pk),p("span",mk,[O.isUploading?(w(),T(je,{key:0},[Xs(se(Oe(O))+"% uploading ("+se(O.processed)+"/"+se(O.total)+") ",1)],64)):(w(),T(je,{key:1},[Xs(se(O.filePaths.length)+" file"+se(O.filePaths.length===1?"":"s"),1)],64))]),p("button",{class:"thread-composer-folder-chip-remove",type:"button","aria-label":`Remove folder ${O.name}`,disabled:nt.value,onClick:de=>Te(O.id)},"×",8,gk)]))),128))])):re("",!0),st.value.length>0?(w(),T("div",vk,[(w(!0),T(je,null,Ct(st.value,O=>(w(),T("span",{key:O.fsPath,class:"thread-composer-file-chip"},[Ee(Vo,{class:"thread-composer-file-chip-icon"}),p("span",{class:"thread-composer-file-chip-name",title:O.fsPath},se(O.label),9,yk),p("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${O.label}`,disabled:nt.value,onClick:de=>me(O.fsPath)},"×",8,wk)]))),128))])):re("",!0),i.value.length>0?(w(),T("div",bk,[(w(!0),T(je,null,Ct(i.value,O=>(w(),T("span",{key:O.path,class:"thread-composer-skill-chip"},[p("span",_k,se(O.name),1),p("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${O.name}`,onClick:de=>ue(O.path)},"×",8,kk)]))),128))])):re("",!0),p("div",Tk,[oe.value?(w(),T("div",Ik,[q.value.length>0?(w(!0),T(je,{key:0},Ct(q.value,(O,de)=>(w(),T("button",{key:O.path,class:at(["thread-composer-file-mention-row",{"is-active":de===Q.value}]),type:"button",onMousedown:it(pe=>xe(O),["prevent"])},[Tn(O.path)?(w(),T("span",{key:0,class:at(["thread-composer-file-mention-icon-badge",`is-${ln(O.path)}`])},se(Tn(O.path)),3)):hn(O.path)?(w(),T("span",Ek,"↓")):(w(),ft(Vo,{key:2,class:"thread-composer-file-mention-icon-file"})),p("span",Ck,[p("span",Ak,se(Pe(O.path)),1),nn(O.path)?(w(),T("span",Rk,se(nn(O.path)),1)):re("",!0)])],42,Sk))),128)):(w(),T("div",Pk,"No matching files"))])):re("",!0),Zn(p("textarea",{ref_key:"inputRef",ref:ae,"onUpdate:modelValue":M[0]||(M[0]=O=>s.value=O),class:"thread-composer-input",placeholder:he.value,disabled:nt.value,onInput:mt,onKeydown:Tt},null,40,xk),[[er,s.value]]),Ee(lk,{skills:ct.value,visible:ve.value,"anchor-bottom":44,"anchor-left":0,onSelect:k,onClose:$t},null,8,["skills","visible"])]),p("div",{class:at(["thread-composer-controls",{"thread-composer-controls--recording":tt.value}])},[p("div",{ref_key:"attachMenuRootRef",ref:Z,class:"thread-composer-attach"},[p("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:nt.value,onClick:H}," + ",8,Mk),le.value?(w(),T("div",Ok,[p("button",{class:"thread-composer-attach-item",type:"button",disabled:nt.value,onClick:F}," Add photos & files ",8,Nk),p("button",{class:"thread-composer-attach-item",type:"button",disabled:nt.value,onClick:G}," Add folder ",8,$k),p("button",{class:"thread-composer-attach-item",type:"button",disabled:nt.value,onClick:K}," Take photo ",8,Dk)])):re("",!0)],512),tt.value?re("",!0):(w(),T(je,{key:0},[Ee(ba,{class:"thread-composer-control","model-value":e.selectedModel,options:Re.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":y},null,8,["model-value","options","disabled"]),Ee(Z_,{class:"thread-composer-control",options:Ge.value,"selected-values":We.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:S},null,8,["options","selected-values","disabled"]),Ee(ba,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:_e,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":R},null,8,["model-value","disabled"])],64)),p("div",{class:at(["thread-composer-actions",{"thread-composer-actions--recording":tt.value}])},[ge(c)==="recording"?(w(),T("div",Lk,[p("canvas",{ref_key:"dictationWaveformCanvasRef",ref:_,class:"thread-composer-dictation-waveform"},null,512)])):re("",!0),ge(c)==="recording"?(w(),T("span",jk,se(ce.value),1)):re("",!0),ge(f)&&!e.isTurnInProgress?(w(),T("button",{key:2,class:at(["thread-composer-mic",{"thread-composer-mic--active":ge(c)==="recording","thread-composer-mic--transcribing":ge(c)==="transcribing"}]),type:"button","aria-label":z.value,title:z.value,disabled:nt.value||ge(c)==="transcribing",onClick:V,onPointerdown:U,onPointerup:x,onPointercancel:x},[ge(c)==="recording"?(w(),ft(Hc,{key:0,class:"thread-composer-mic-icon thread-composer-mic-icon--stop"})):ge(c)==="transcribing"?(w(),T("span",Fk)):(w(),ft(C_,{key:2,class:"thread-composer-mic-icon"}))],42,Bk)):re("",!0),e.isTurnInProgress?(w(),T("button",{key:3,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:v},[Ee(Hc,{class:"thread-composer-stop-icon"})],8,Uk)):re("",!0),p("button",{class:at(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&Fe.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&Fe.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${Fe.value}`:"Send",disabled:!Ye.value,onClick:M[1]||(M[1]=O=>$e(e.isTurnInProgress?Fe.value:"steer"))},[Ee(T_,{class:"thread-composer-submit-icon"})],10,Hk)],2)],2)],2),p("input",{ref_key:"photoLibraryInputRef",ref:B,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:nt.value,onChange:Ze},null,40,Vk),p("input",{ref_key:"cameraCaptureInputRef",ref:J,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:nt.value,onChange:jt},null,40,Wk),p("input",{ref_key:"folderPickerInputRef",ref:W,class:"thread-composer-hidden-input",type:"file",multiple:"",webkitdirectory:"",directory:"",disabled:nt.value,onChange:Bt},null,40,Gk)],32))}}),Vc=rt(zk,[["__scopeId","data-v-4970afc6"]]),qk={key:0,class:"queued-messages"},Kk={class:"queued-messages-inner"},Jk={class:"queued-row-text"},Yk={class:"queued-row-actions"},Xk=["onClick"],Qk=["onClick"],Zk=Lt({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(w(),T("div",qk,[p("div",Kk,[(w(!0),T(je,null,Ct(e.messages,r=>(w(),T("div",{key:r.id,class:"queued-row"},[n[1]||(n[1]=p("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[p("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)),p("span",Jk,se(r.text),1),p("div",Yk,[p("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,Xk),p("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]=[p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[p("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,Qk)])]))),128))])])):re("",!0)}}),e0=rt(Zk,[["__scopeId","data-v-ea583733"]]),t0={class:"runtime-dropdown-trigger-label"},n0={key:0,class:"runtime-dropdown-menu-wrap"},r0={class:"runtime-dropdown-menu"},s0=["onClick"],o0={class:"runtime-dropdown-option-label"},i0={key:0,class:"runtime-dropdown-option-check"},a0=Lt({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(!1),i=[{value:"local",label:"Local project",icon:tl},{value:"worktree",label:"New worktree",icon:Po}],a=ie(()=>i.find(c=>c.value===n.modelValue)??i[0]);function l(c){r("update:modelValue",c),o.value=!1}function u(c){if(!o.value)return;const f=s.value;if(!f)return;const h=c.target;h instanceof Node&&(f.contains(h)||(o.value=!1))}return sr(()=>{window.addEventListener("pointerdown",u)}),or(()=>{window.removeEventListener("pointerdown",u)}),(c,f)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"runtime-dropdown"},[p("button",{class:"runtime-dropdown-trigger",type:"button",onClick:f[0]||(f[0]=h=>o.value=!o.value)},[(w(),ft(la(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),p("span",t0,se(a.value.label),1),Ee(fi,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(w(),T("div",n0,[p("div",r0,[f[1]||(f[1]=p("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(w(),T(je,null,Ct(i,h=>p("button",{key:h.value,class:at(["runtime-dropdown-option",{"is-selected":e.modelValue===h.value}]),type:"button",onClick:_=>l(h.value)},[(w(),ft(la(h.icon),{class:"runtime-dropdown-option-icon"})),p("span",o0,se(h.label),1),e.modelValue===h.value?(w(),T("span",i0,"✓")):re("",!0)],10,s0)),64))])])):re("",!0)],512))}}),l0=rt(a0,[["__scopeId","data-v-9c9b71e5"]]),c0={},u0={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function d0(e,t){return w(),T("svg",u0,[...t[0]||(t[0]=[p("circle",{cx:"11",cy:"11",r:"8"},null,-1),p("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const _a=rt(c0,[["render",d0]]),f0={class:"skill-card-top"},h0=["src","alt"],p0={key:1,class:"skill-card-avatar-fallback"},m0={class:"skill-card-info"},g0={class:"skill-card-header"},v0={class:"skill-card-name"},y0={key:0,class:"skill-card-badge-disabled"},w0={key:1,class:"skill-card-badge"},b0={class:"skill-card-owner"},_0={key:0,class:"skill-card-desc"},k0={key:1,class:"skill-card-date"},T0=Lt({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=ie(()=>{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)=>(w(),T("button",{class:at(["skill-card",{"is-disabled":e.skill.installed&&e.skill.enabled===!1}]),type:"button",onClick:o[0]||(o[0]=i=>s.$emit("select",e.skill))},[p("div",f0,[e.skill.avatarUrl?(w(),T("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,h0)):(w(),T("div",p0,se(e.skill.owner.charAt(0)),1)),p("div",m0,[p("div",g0,[p("span",v0,se(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(w(),T("span",y0,"Disabled")):e.skill.installed?(w(),T("span",w0,"Installed")):re("",!0)]),p("span",b0,se(e.skill.owner),1)])]),e.skill.description?(w(),T("p",_0,se(e.skill.description),1)):re("",!0),n.value?(w(),T("span",k0,se(n.value),1)):re("",!0)],2))}}),Wc=rt(T0,[["__scopeId","data-v-2a1e8196"]]),I0={class:"sdm-panel"},S0={class:"sdm-header"},E0={class:"sdm-title-area"},C0=["src","alt"],A0={class:"sdm-title-col"},R0={class:"sdm-title-row"},P0={class:"sdm-title"},x0={key:0,class:"sdm-badge-disabled"},M0={class:"sdm-owner"},O0={class:"sdm-body"},N0={key:0,class:"sdm-desc"},$0={key:1,class:"sdm-readme-loading"},D0=["innerHTML"],L0=["href"],j0={class:"sdm-footer"},B0={class:"sdm-footer-actions"},F0=["disabled"],U0=["disabled"],H0=["disabled"],V0=Lt({__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=D(null),o=D(""),i=D(!1),a=ie(()=>s.value??n.skill.enabled??!0),l=ie(()=>n.isInstalling===!0||n.isUninstalling===!0),u=ie(()=>{const C=o.value;if(!C)return"";const j=C.replace(/^---[\s\S]*?---\s*/,"");return c(j)});function c(C){return C.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").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 C=new URLSearchParams({owner:n.skill.owner,name:n.skill.name}),j=await fetch(`/codex-api/skills-hub/readme?${C}`);if(!j.ok)return;const Z=await j.json();o.value=Z.content??""}catch{}finally{i.value=!1}}}vt(()=>n.visible,C=>{C&&(s.value=null,o.value="",f())});function h(){r("install",n.skill)}function _(){r("uninstall",n.skill)}function L(){const C=!a.value;s.value=C,r("toggle-enabled",n.skill,C)}return(C,j)=>(w(),ft(jo,{to:"body"},[e.visible?(w(),T("div",{key:0,class:"sdm-overlay",onClick:j[1]||(j[1]=it(Z=>C.$emit("close"),["self"]))},[p("div",I0,[p("div",S0,[p("div",E0,[e.skill.avatarUrl?(w(),T("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,C0)):re("",!0),p("div",A0,[p("div",R0,[p("h3",P0,se(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(w(),T("span",x0,"Disabled")):re("",!0)]),p("span",M0,se(e.skill.owner),1)])]),p("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:j[0]||(j[0]=Z=>C.$emit("close"))},[Ee(nl,{class:"sdm-close-icon"})])]),p("div",O0,[e.skill.description?(w(),T("p",N0,se(e.skill.description),1)):re("",!0),i.value?(w(),T("div",$0,"Loading skill contents...")):o.value?(w(),T("div",{key:2,class:"sdm-readme",innerHTML:u.value},null,8,D0)):re("",!0),p("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,L0)]),p("div",j0,[p("div",B0,[e.skill.installed?(w(),T("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:_},se(n.isUninstalling?"Uninstalling...":"Uninstall"),9,F0)):(w(),T("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:h},se(n.isInstalling?"Installing...":"Install"),9,U0)),e.skill.installed?(w(),T("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:L},se(a.value?"Disable":"Enable"),9,H0)):re("",!0)])])])])):re("",!0)]))}}),W0=rt(V0,[["__scopeId","data-v-19a385ca"]]),G0=()=>{};var Gc={};/**
|
|
38
|
+
* @license
|
|
39
|
+
* Copyright 2017 Google LLC
|
|
40
|
+
*
|
|
41
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
42
|
+
* you may not use this file except in compliance with the License.
|
|
43
|
+
* You may obtain a copy of the License at
|
|
44
|
+
*
|
|
45
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
46
|
+
*
|
|
47
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
48
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
49
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
50
|
+
* See the License for the specific language governing permissions and
|
|
51
|
+
* limitations under the License.
|
|
52
|
+
*/const cf=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},z0=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("")},uf={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,u=l?e[s+2]:0,c=o>>2,f=(o&3)<<4|a>>4;let h=(a&15)<<2|u>>6,_=u&63;l||(_=64,i||(h=64)),r.push(n[c],n[f],n[h],n[_])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(cf(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):z0(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 u=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||u==null||f==null)throw new q0;const h=o<<2|a>>4;if(r.push(h),u!==64){const _=a<<4&240|u>>2;if(r.push(_),f!==64){const L=u<<6&192|f;r.push(L)}}}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 q0 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const K0=function(e){const t=cf(e);return uf.encodeByteArray(t,!0)},df=function(e){return K0(e).replace(/\./g,"")},ff=function(e){try{return uf.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
|
|
53
|
+
* @license
|
|
54
|
+
* Copyright 2022 Google LLC
|
|
55
|
+
*
|
|
56
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
57
|
+
* you may not use this file except in compliance with the License.
|
|
58
|
+
* You may obtain a copy of the License at
|
|
59
|
+
*
|
|
60
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
61
|
+
*
|
|
62
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
63
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
64
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
65
|
+
* See the License for the specific language governing permissions and
|
|
66
|
+
* limitations under the License.
|
|
67
|
+
*/function J0(){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.")}/**
|
|
68
|
+
* @license
|
|
69
|
+
* Copyright 2022 Google LLC
|
|
70
|
+
*
|
|
71
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
72
|
+
* you may not use this file except in compliance with the License.
|
|
73
|
+
* You may obtain a copy of the License at
|
|
74
|
+
*
|
|
75
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
76
|
+
*
|
|
77
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
78
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
79
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
80
|
+
* See the License for the specific language governing permissions and
|
|
81
|
+
* limitations under the License.
|
|
82
|
+
*/const Y0=()=>J0().__FIREBASE_DEFAULTS__,X0=()=>{if(typeof process>"u"||typeof Gc>"u")return;const e=Gc.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},Q0=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&ff(e[1]);return t&&JSON.parse(t)},ol=()=>{try{return G0()||Y0()||X0()||Q0()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},Z0=e=>{var t,n;return(n=(t=ol())==null?void 0:t.emulatorHosts)==null?void 0:n[e]},hf=()=>{var e;return(e=ol())==null?void 0:e.config},pf=e=>{var t;return(t=ol())==null?void 0:t[`_${e}`]};/**
|
|
83
|
+
* @license
|
|
84
|
+
* Copyright 2017 Google LLC
|
|
85
|
+
*
|
|
86
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
87
|
+
* you may not use this file except in compliance with the License.
|
|
88
|
+
* You may obtain a copy of the License at
|
|
89
|
+
*
|
|
90
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
91
|
+
*
|
|
92
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
93
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
94
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
95
|
+
* See the License for the specific language governing permissions and
|
|
96
|
+
* limitations under the License.
|
|
97
|
+
*/class eT{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))}}}/**
|
|
98
|
+
* @license
|
|
99
|
+
* Copyright 2025 Google LLC
|
|
100
|
+
*
|
|
101
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
102
|
+
* you may not use this file except in compliance with the License.
|
|
103
|
+
* You may obtain a copy of the License at
|
|
104
|
+
*
|
|
105
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
106
|
+
*
|
|
107
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
108
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
109
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
110
|
+
* See the License for the specific language governing permissions and
|
|
111
|
+
* limitations under the License.
|
|
112
|
+
*/function hi(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function tT(e){return(await fetch(e,{credentials:"include"})).ok}const Vs={};function nT(){const e={prod:[],emulator:[]};for(const t of Object.keys(Vs))Vs[t]?e.emulator.push(t):e.prod.push(t);return e}function rT(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 zc=!1;function sT(e,t){if(typeof window>"u"||typeof document>"u"||!hi(window.location.host)||Vs[e]===t||Vs[e]||zc)return;Vs[e]=t;function n(h){return`__firebase__banner__${h}`}const r="__firebase__banner",o=nT().prod.length>0;function i(){const h=document.getElementById(r);h&&h.remove()}function a(h){h.style.display="flex",h.style.background="#7faaf0",h.style.position="fixed",h.style.bottom="5px",h.style.left="5px",h.style.padding=".5em",h.style.borderRadius="5px",h.style.alignItems="center"}function l(h,_){h.setAttribute("width","24"),h.setAttribute("id",_),h.setAttribute("height","24"),h.setAttribute("viewBox","0 0 24 24"),h.setAttribute("fill","none"),h.style.marginLeft="-6px"}function u(){const h=document.createElement("span");return h.style.cursor="pointer",h.style.marginLeft="16px",h.style.fontSize="24px",h.innerHTML=" ×",h.onclick=()=>{zc=!0,i()},h}function c(h,_){h.setAttribute("id",_),h.innerText="Learn more",h.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",h.setAttribute("target","__blank"),h.style.paddingLeft="5px",h.style.textDecoration="underline"}function f(){const h=rT(r),_=n("text"),L=document.getElementById(_)||document.createElement("span"),C=n("learnmore"),j=document.getElementById(C)||document.createElement("a"),Z=n("preprendIcon"),B=document.getElementById(Z)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(h.created){const J=h.element;a(J),c(j,C);const W=u();l(B,Z),J.append(B,L,j,W),document.body.appendChild(J)}o?(L.innerText="Preview backend disconnected.",B.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
|
|
113
|
+
<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"/>
|
|
114
|
+
</g>
|
|
115
|
+
<defs>
|
|
116
|
+
<clipPath id="clip0_6013_33858">
|
|
117
|
+
<rect width="24" height="24" fill="white"/>
|
|
118
|
+
</clipPath>
|
|
119
|
+
</defs>`):(B.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
|
|
120
|
+
<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"/>
|
|
121
|
+
</g>
|
|
122
|
+
<defs>
|
|
123
|
+
<clipPath id="clip0_6083_34804">
|
|
124
|
+
<rect width="24" height="24" fill="white"/>
|
|
125
|
+
</clipPath>
|
|
126
|
+
</defs>`,L.innerText="Preview backend running in this workspace."),L.setAttribute("id",_)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",f):f()}/**
|
|
127
|
+
* @license
|
|
128
|
+
* Copyright 2017 Google LLC
|
|
129
|
+
*
|
|
130
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
131
|
+
* you may not use this file except in compliance with the License.
|
|
132
|
+
* You may obtain a copy of the License at
|
|
133
|
+
*
|
|
134
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
135
|
+
*
|
|
136
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
137
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
138
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
139
|
+
* See the License for the specific language governing permissions and
|
|
140
|
+
* limitations under the License.
|
|
141
|
+
*/function tn(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function oT(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(tn())}function iT(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function aT(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function lT(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function cT(){const e=tn();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function uT(){try{return typeof indexedDB=="object"}catch{return!1}}function dT(){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)}})}/**
|
|
142
|
+
* @license
|
|
143
|
+
* Copyright 2017 Google LLC
|
|
144
|
+
*
|
|
145
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
146
|
+
* you may not use this file except in compliance with the License.
|
|
147
|
+
* You may obtain a copy of the License at
|
|
148
|
+
*
|
|
149
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
150
|
+
*
|
|
151
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
152
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
153
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
154
|
+
* See the License for the specific language governing permissions and
|
|
155
|
+
* limitations under the License.
|
|
156
|
+
*/const fT="FirebaseError";class Er extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=fT,Object.setPrototypeOf(this,Er.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,lo.prototype.create)}}class lo{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?hT(o,r):"Error",a=`${this.serviceName}: ${i} (${s}).`;return new Er(s,a,r)}}function hT(e,t){return e.replace(pT,(n,r)=>{const s=t[r];return s!=null?String(s):`<${r}?>`})}const pT=/\{\$([^}]+)}/g;function mT(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function gs(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(qc(o)&&qc(i)){if(!gs(o,i))return!1}else if(o!==i)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function qc(e){return e!==null&&typeof e=="object"}/**
|
|
157
|
+
* @license
|
|
158
|
+
* Copyright 2017 Google LLC
|
|
159
|
+
*
|
|
160
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
161
|
+
* you may not use this file except in compliance with the License.
|
|
162
|
+
* You may obtain a copy of the License at
|
|
163
|
+
*
|
|
164
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
165
|
+
*
|
|
166
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
167
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
168
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
169
|
+
* See the License for the specific language governing permissions and
|
|
170
|
+
* limitations under the License.
|
|
171
|
+
*/function co(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 gT(e,t){const n=new vT(e,t);return n.subscribe.bind(n)}class vT{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.");yT(t,["next","error","complete"])?s=t:s={next:t,error:n,complete:r},s.next===void 0&&(s.next=Hi),s.error===void 0&&(s.error=Hi),s.complete===void 0&&(s.complete=Hi);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 yT(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 Hi(){}/**
|
|
172
|
+
* @license
|
|
173
|
+
* Copyright 2021 Google LLC
|
|
174
|
+
*
|
|
175
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
176
|
+
* you may not use this file except in compliance with the License.
|
|
177
|
+
* You may obtain a copy of the License at
|
|
178
|
+
*
|
|
179
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
180
|
+
*
|
|
181
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
182
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
183
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
184
|
+
* See the License for the specific language governing permissions and
|
|
185
|
+
* limitations under the License.
|
|
186
|
+
*/function bs(e){return e&&e._delegate?e._delegate:e}class vs{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}}/**
|
|
187
|
+
* @license
|
|
188
|
+
* Copyright 2019 Google LLC
|
|
189
|
+
*
|
|
190
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
191
|
+
* you may not use this file except in compliance with the License.
|
|
192
|
+
* You may obtain a copy of the License at
|
|
193
|
+
*
|
|
194
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
195
|
+
*
|
|
196
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
197
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
198
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
199
|
+
* See the License for the specific language governing permissions and
|
|
200
|
+
* limitations under the License.
|
|
201
|
+
*/const Dr="[DEFAULT]";/**
|
|
202
|
+
* @license
|
|
203
|
+
* Copyright 2019 Google LLC
|
|
204
|
+
*
|
|
205
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
206
|
+
* you may not use this file except in compliance with the License.
|
|
207
|
+
* You may obtain a copy of the License at
|
|
208
|
+
*
|
|
209
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
210
|
+
*
|
|
211
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
212
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
213
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
214
|
+
* See the License for the specific language governing permissions and
|
|
215
|
+
* limitations under the License.
|
|
216
|
+
*/class wT{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 eT;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(_T(t))try{this.getOrInitializeService({instanceIdentifier:Dr})}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=Dr){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=Dr){return this.instances.has(t)}getOptions(t=Dr){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:bT(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=Dr){return this.component?this.component.multipleInstances?t:Dr:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function bT(e){return e===Dr?void 0:e}function _T(e){return e.instantiationMode==="EAGER"}/**
|
|
217
|
+
* @license
|
|
218
|
+
* Copyright 2019 Google LLC
|
|
219
|
+
*
|
|
220
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
221
|
+
* you may not use this file except in compliance with the License.
|
|
222
|
+
* You may obtain a copy of the License at
|
|
223
|
+
*
|
|
224
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
225
|
+
*
|
|
226
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
227
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
228
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
229
|
+
* See the License for the specific language governing permissions and
|
|
230
|
+
* limitations under the License.
|
|
231
|
+
*/class kT{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 wT(t,this);return this.providers.set(t,n),n}getProviders(){return Array.from(this.providers.values())}}/**
|
|
232
|
+
* @license
|
|
233
|
+
* Copyright 2017 Google LLC
|
|
234
|
+
*
|
|
235
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
236
|
+
* you may not use this file except in compliance with the License.
|
|
237
|
+
* You may obtain a copy of the License at
|
|
238
|
+
*
|
|
239
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
240
|
+
*
|
|
241
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
242
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
243
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
244
|
+
* See the License for the specific language governing permissions and
|
|
245
|
+
* limitations under the License.
|
|
246
|
+
*/var bt;(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"})(bt||(bt={}));const TT={debug:bt.DEBUG,verbose:bt.VERBOSE,info:bt.INFO,warn:bt.WARN,error:bt.ERROR,silent:bt.SILENT},IT=bt.INFO,ST={[bt.DEBUG]:"log",[bt.VERBOSE]:"log",[bt.INFO]:"info",[bt.WARN]:"warn",[bt.ERROR]:"error"},ET=(e,t,...n)=>{if(t<e.logLevel)return;const r=new Date().toISOString(),s=ST[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 mf{constructor(t){this.name=t,this._logLevel=IT,this._logHandler=ET,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in bt))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?TT[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,bt.DEBUG,...t),this._logHandler(this,bt.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,bt.VERBOSE,...t),this._logHandler(this,bt.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,bt.INFO,...t),this._logHandler(this,bt.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,bt.WARN,...t),this._logHandler(this,bt.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,bt.ERROR,...t),this._logHandler(this,bt.ERROR,...t)}}const CT=(e,t)=>t.some(n=>e instanceof n);let Kc,Jc;function AT(){return Kc||(Kc=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function RT(){return Jc||(Jc=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const gf=new WeakMap,ka=new WeakMap,vf=new WeakMap,Vi=new WeakMap,il=new WeakMap;function PT(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{n(kr(e.result)),s()},i=()=>{r(e.error),s()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(n=>{n instanceof IDBCursor&&gf.set(n,e)}).catch(()=>{}),il.set(t,e),t}function xT(e){if(ka.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)});ka.set(e,t)}let Ta={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return ka.get(e);if(t==="objectStoreNames")return e.objectStoreNames||vf.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return kr(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 MT(e){Ta=e(Ta)}function OT(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(Wi(this),t,...n);return vf.set(r,t.sort?t.sort():[t]),kr(r)}:RT().includes(e)?function(...t){return e.apply(Wi(this),t),kr(gf.get(this))}:function(...t){return kr(e.apply(Wi(this),t))}}function NT(e){return typeof e=="function"?OT(e):(e instanceof IDBTransaction&&xT(e),CT(e,AT())?new Proxy(e,Ta):e)}function kr(e){if(e instanceof IDBRequest)return PT(e);if(Vi.has(e))return Vi.get(e);const t=NT(e);return t!==e&&(Vi.set(e,t),il.set(t,e)),t}const Wi=e=>il.get(e);function $T(e,t,{blocked:n,upgrade:r,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=kr(i);return r&&i.addEventListener("upgradeneeded",l=>{r(kr(i.result),l.oldVersion,l.newVersion,kr(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",u=>s(u.oldVersion,u.newVersion,u))}).catch(()=>{}),a}const DT=["get","getKey","getAll","getAllKeys","count"],LT=["put","add","delete","clear"],Gi=new Map;function Yc(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Gi.get(t))return Gi.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=LT.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||DT.includes(n)))return;const o=async function(i,...a){const l=this.transaction(i,s?"readwrite":"readonly");let u=l.store;return r&&(u=u.index(a.shift())),(await Promise.all([u[n](...a),s&&l.done]))[0]};return Gi.set(t,o),o}MT(e=>({...e,get:(t,n,r)=>Yc(t,n)||e.get(t,n,r),has:(t,n)=>!!Yc(t,n)||e.has(t,n)}));/**
|
|
247
|
+
* @license
|
|
248
|
+
* Copyright 2019 Google LLC
|
|
249
|
+
*
|
|
250
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
251
|
+
* you may not use this file except in compliance with the License.
|
|
252
|
+
* You may obtain a copy of the License at
|
|
253
|
+
*
|
|
254
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
255
|
+
*
|
|
256
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
257
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
258
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
259
|
+
* See the License for the specific language governing permissions and
|
|
260
|
+
* limitations under the License.
|
|
261
|
+
*/class jT{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(BT(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function BT(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const Ia="@firebase/app",Xc="0.14.9";/**
|
|
262
|
+
* @license
|
|
263
|
+
* Copyright 2019 Google LLC
|
|
264
|
+
*
|
|
265
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
266
|
+
* you may not use this file except in compliance with the License.
|
|
267
|
+
* You may obtain a copy of the License at
|
|
268
|
+
*
|
|
269
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
270
|
+
*
|
|
271
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
272
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
273
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
274
|
+
* See the License for the specific language governing permissions and
|
|
275
|
+
* limitations under the License.
|
|
276
|
+
*/const tr=new mf("@firebase/app"),FT="@firebase/app-compat",UT="@firebase/analytics-compat",HT="@firebase/analytics",VT="@firebase/app-check-compat",WT="@firebase/app-check",GT="@firebase/auth",zT="@firebase/auth-compat",qT="@firebase/database",KT="@firebase/data-connect",JT="@firebase/database-compat",YT="@firebase/functions",XT="@firebase/functions-compat",QT="@firebase/installations",ZT="@firebase/installations-compat",e1="@firebase/messaging",t1="@firebase/messaging-compat",n1="@firebase/performance",r1="@firebase/performance-compat",s1="@firebase/remote-config",o1="@firebase/remote-config-compat",i1="@firebase/storage",a1="@firebase/storage-compat",l1="@firebase/firestore",c1="@firebase/ai",u1="@firebase/firestore-compat",d1="firebase",f1="12.10.0";/**
|
|
277
|
+
* @license
|
|
278
|
+
* Copyright 2019 Google LLC
|
|
279
|
+
*
|
|
280
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
281
|
+
* you may not use this file except in compliance with the License.
|
|
282
|
+
* You may obtain a copy of the License at
|
|
283
|
+
*
|
|
284
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
285
|
+
*
|
|
286
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
287
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
288
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
289
|
+
* See the License for the specific language governing permissions and
|
|
290
|
+
* limitations under the License.
|
|
291
|
+
*/const Sa="[DEFAULT]",h1={[Ia]:"fire-core",[FT]:"fire-core-compat",[HT]:"fire-analytics",[UT]:"fire-analytics-compat",[WT]:"fire-app-check",[VT]:"fire-app-check-compat",[GT]:"fire-auth",[zT]:"fire-auth-compat",[qT]:"fire-rtdb",[KT]:"fire-data-connect",[JT]:"fire-rtdb-compat",[YT]:"fire-fn",[XT]:"fire-fn-compat",[QT]:"fire-iid",[ZT]:"fire-iid-compat",[e1]:"fire-fcm",[t1]:"fire-fcm-compat",[n1]:"fire-perf",[r1]:"fire-perf-compat",[s1]:"fire-rc",[o1]:"fire-rc-compat",[i1]:"fire-gcs",[a1]:"fire-gcs-compat",[l1]:"fire-fst",[u1]:"fire-fst-compat",[c1]:"fire-vertex","fire-js":"fire-js",[d1]:"fire-js-all"};/**
|
|
292
|
+
* @license
|
|
293
|
+
* Copyright 2019 Google LLC
|
|
294
|
+
*
|
|
295
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
296
|
+
* you may not use this file except in compliance with the License.
|
|
297
|
+
* You may obtain a copy of the License at
|
|
298
|
+
*
|
|
299
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
300
|
+
*
|
|
301
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
302
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
303
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
304
|
+
* See the License for the specific language governing permissions and
|
|
305
|
+
* limitations under the License.
|
|
306
|
+
*/const to=new Map,p1=new Map,Ea=new Map;function Qc(e,t){try{e.container.addComponent(t)}catch(n){tr.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function no(e){const t=e.name;if(Ea.has(t))return tr.debug(`There were multiple attempts to register component ${t}.`),!1;Ea.set(t,e);for(const n of to.values())Qc(n,e);for(const n of p1.values())Qc(n,e);return!0}function yf(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function Pn(e){return e==null?!1:e.settings!==void 0}/**
|
|
307
|
+
* @license
|
|
308
|
+
* Copyright 2019 Google LLC
|
|
309
|
+
*
|
|
310
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
311
|
+
* you may not use this file except in compliance with the License.
|
|
312
|
+
* You may obtain a copy of the License at
|
|
313
|
+
*
|
|
314
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
315
|
+
*
|
|
316
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
317
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
318
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
319
|
+
* See the License for the specific language governing permissions and
|
|
320
|
+
* limitations under the License.
|
|
321
|
+
*/const m1={"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."},Tr=new lo("app","Firebase",m1);/**
|
|
322
|
+
* @license
|
|
323
|
+
* Copyright 2019 Google LLC
|
|
324
|
+
*
|
|
325
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
326
|
+
* you may not use this file except in compliance with the License.
|
|
327
|
+
* You may obtain a copy of the License at
|
|
328
|
+
*
|
|
329
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
330
|
+
*
|
|
331
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
332
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
333
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
334
|
+
* See the License for the specific language governing permissions and
|
|
335
|
+
* limitations under the License.
|
|
336
|
+
*/class g1{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 vs("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 Tr.create("app-deleted",{appName:this._name})}}/**
|
|
337
|
+
* @license
|
|
338
|
+
* Copyright 2019 Google LLC
|
|
339
|
+
*
|
|
340
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
341
|
+
* you may not use this file except in compliance with the License.
|
|
342
|
+
* You may obtain a copy of the License at
|
|
343
|
+
*
|
|
344
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
345
|
+
*
|
|
346
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
347
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
348
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
349
|
+
* See the License for the specific language governing permissions and
|
|
350
|
+
* limitations under the License.
|
|
351
|
+
*/const uo=f1;function wf(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r={name:Sa,automaticDataCollectionEnabled:!0,...t},s=r.name;if(typeof s!="string"||!s)throw Tr.create("bad-app-name",{appName:String(s)});if(n||(n=hf()),!n)throw Tr.create("no-options");const o=to.get(s);if(o){if(gs(n,o.options)&&gs(r,o.config))return o;throw Tr.create("duplicate-app",{appName:s})}const i=new kT(s);for(const l of Ea.values())i.addComponent(l);const a=new g1(n,r,i);return to.set(s,a),a}function bf(e=Sa){const t=to.get(e);if(!t&&e===Sa&&hf())return wf();if(!t)throw Tr.create("no-app",{appName:e});return t}function v1(){return Array.from(to.values())}function cs(e,t,n){let r=h1[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 "/")`),tr.warn(i.join(" "));return}no(new vs(`${r}-version`,()=>({library:r,version:t}),"VERSION"))}/**
|
|
352
|
+
* @license
|
|
353
|
+
* Copyright 2021 Google LLC
|
|
354
|
+
*
|
|
355
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
356
|
+
* you may not use this file except in compliance with the License.
|
|
357
|
+
* You may obtain a copy of the License at
|
|
358
|
+
*
|
|
359
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
360
|
+
*
|
|
361
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
362
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
363
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
364
|
+
* See the License for the specific language governing permissions and
|
|
365
|
+
* limitations under the License.
|
|
366
|
+
*/const y1="firebase-heartbeat-database",w1=1,ro="firebase-heartbeat-store";let zi=null;function _f(){return zi||(zi=$T(y1,w1,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(ro)}catch(n){console.warn(n)}}}}).catch(e=>{throw Tr.create("idb-open",{originalErrorMessage:e.message})})),zi}async function b1(e){try{const n=(await _f()).transaction(ro),r=await n.objectStore(ro).get(kf(e));return await n.done,r}catch(t){if(t instanceof Er)tr.warn(t.message);else{const n=Tr.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});tr.warn(n.message)}}}async function Zc(e,t){try{const r=(await _f()).transaction(ro,"readwrite");await r.objectStore(ro).put(t,kf(e)),await r.done}catch(n){if(n instanceof Er)tr.warn(n.message);else{const r=Tr.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});tr.warn(r.message)}}}function kf(e){return`${e.name}!${e.options.appId}`}/**
|
|
367
|
+
* @license
|
|
368
|
+
* Copyright 2021 Google LLC
|
|
369
|
+
*
|
|
370
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
371
|
+
* you may not use this file except in compliance with the License.
|
|
372
|
+
* You may obtain a copy of the License at
|
|
373
|
+
*
|
|
374
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
375
|
+
*
|
|
376
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
377
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
378
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
379
|
+
* See the License for the specific language governing permissions and
|
|
380
|
+
* limitations under the License.
|
|
381
|
+
*/const _1=1024,k1=30;class T1{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new S1(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=eu();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>k1){const i=E1(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(i,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){tr.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=eu(),{heartbeatsToSend:r,unsentEntries:s}=I1(this._heartbeatsCache.heartbeats),o=df(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 tr.warn(n),""}}}function eu(){return new Date().toISOString().substring(0,10)}function I1(e,t=_1){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),tu(n)>t){o.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),tu(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class S1{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return uT()?dT().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await b1(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 Zc(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 Zc(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...t.heartbeats]})}else return}}function tu(e){return df(JSON.stringify({version:2,heartbeats:e})).length}function E1(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}/**
|
|
382
|
+
* @license
|
|
383
|
+
* Copyright 2019 Google LLC
|
|
384
|
+
*
|
|
385
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
386
|
+
* you may not use this file except in compliance with the License.
|
|
387
|
+
* You may obtain a copy of the License at
|
|
388
|
+
*
|
|
389
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
390
|
+
*
|
|
391
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
392
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
393
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
394
|
+
* See the License for the specific language governing permissions and
|
|
395
|
+
* limitations under the License.
|
|
396
|
+
*/function C1(e){no(new vs("platform-logger",t=>new jT(t),"PRIVATE")),no(new vs("heartbeat",t=>new T1(t),"PRIVATE")),cs(Ia,Xc,e),cs(Ia,Xc,"esm2020"),cs("fire-js","")}C1("");var A1="firebase",R1="12.10.0";/**
|
|
397
|
+
* @license
|
|
398
|
+
* Copyright 2020 Google LLC
|
|
399
|
+
*
|
|
400
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
401
|
+
* you may not use this file except in compliance with the License.
|
|
402
|
+
* You may obtain a copy of the License at
|
|
403
|
+
*
|
|
404
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
405
|
+
*
|
|
406
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
407
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
408
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
409
|
+
* See the License for the specific language governing permissions and
|
|
410
|
+
* limitations under the License.
|
|
411
|
+
*/cs(A1,R1,"app");function Tf(){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 P1=Tf,If=new lo("auth","Firebase",Tf());/**
|
|
412
|
+
* @license
|
|
413
|
+
* Copyright 2020 Google LLC
|
|
414
|
+
*
|
|
415
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
416
|
+
* you may not use this file except in compliance with the License.
|
|
417
|
+
* You may obtain a copy of the License at
|
|
418
|
+
*
|
|
419
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
420
|
+
*
|
|
421
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
422
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
423
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
424
|
+
* See the License for the specific language governing permissions and
|
|
425
|
+
* limitations under the License.
|
|
426
|
+
*/const Wo=new mf("@firebase/auth");function x1(e,...t){Wo.logLevel<=bt.WARN&&Wo.warn(`Auth (${uo}): ${e}`,...t)}function xo(e,...t){Wo.logLevel<=bt.ERROR&&Wo.error(`Auth (${uo}): ${e}`,...t)}/**
|
|
427
|
+
* @license
|
|
428
|
+
* Copyright 2020 Google LLC
|
|
429
|
+
*
|
|
430
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
431
|
+
* you may not use this file except in compliance with the License.
|
|
432
|
+
* You may obtain a copy of the License at
|
|
433
|
+
*
|
|
434
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
435
|
+
*
|
|
436
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
437
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
438
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
439
|
+
* See the License for the specific language governing permissions and
|
|
440
|
+
* limitations under the License.
|
|
441
|
+
*/function $n(e,...t){throw ll(e,...t)}function yn(e,...t){return ll(e,...t)}function al(e,t,n){const r={...P1(),[t]:n};return new lo("auth","Firebase",r).create(t,{appName:e.name})}function Vr(e){return al(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function M1(e,t,n){const r=n;if(!(t instanceof r))throw r.name!==t.constructor.name&&$n(e,"argument-error"),al(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function ll(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 If.create(e,...t)}function He(e,t,...n){if(!e)throw ll(t,...n)}function qn(e){const t="INTERNAL ASSERTION FAILED: "+e;throw xo(t),new Error(t)}function nr(e,t){e||qn(t)}/**
|
|
442
|
+
* @license
|
|
443
|
+
* Copyright 2020 Google LLC
|
|
444
|
+
*
|
|
445
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
446
|
+
* you may not use this file except in compliance with the License.
|
|
447
|
+
* You may obtain a copy of the License at
|
|
448
|
+
*
|
|
449
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
450
|
+
*
|
|
451
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
452
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
453
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
454
|
+
* See the License for the specific language governing permissions and
|
|
455
|
+
* limitations under the License.
|
|
456
|
+
*/function Ca(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.href)||""}function O1(){return nu()==="http:"||nu()==="https:"}function nu(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.protocol)||null}/**
|
|
457
|
+
* @license
|
|
458
|
+
* Copyright 2020 Google LLC
|
|
459
|
+
*
|
|
460
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
461
|
+
* you may not use this file except in compliance with the License.
|
|
462
|
+
* You may obtain a copy of the License at
|
|
463
|
+
*
|
|
464
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
465
|
+
*
|
|
466
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
467
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
468
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
469
|
+
* See the License for the specific language governing permissions and
|
|
470
|
+
* limitations under the License.
|
|
471
|
+
*/function N1(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(O1()||aT()||"connection"in navigator)?navigator.onLine:!0}function $1(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}/**
|
|
472
|
+
* @license
|
|
473
|
+
* Copyright 2020 Google LLC
|
|
474
|
+
*
|
|
475
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
476
|
+
* you may not use this file except in compliance with the License.
|
|
477
|
+
* You may obtain a copy of the License at
|
|
478
|
+
*
|
|
479
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
480
|
+
*
|
|
481
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
482
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
483
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
484
|
+
* See the License for the specific language governing permissions and
|
|
485
|
+
* limitations under the License.
|
|
486
|
+
*/class fo{constructor(t,n){this.shortDelay=t,this.longDelay=n,nr(n>t,"Short delay should be less than long delay!"),this.isMobile=oT()||lT()}get(){return N1()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
|
|
487
|
+
* @license
|
|
488
|
+
* Copyright 2020 Google LLC
|
|
489
|
+
*
|
|
490
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
491
|
+
* you may not use this file except in compliance with the License.
|
|
492
|
+
* You may obtain a copy of the License at
|
|
493
|
+
*
|
|
494
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
495
|
+
*
|
|
496
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
497
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
498
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
499
|
+
* See the License for the specific language governing permissions and
|
|
500
|
+
* limitations under the License.
|
|
501
|
+
*/function cl(e,t){nr(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}/**
|
|
502
|
+
* @license
|
|
503
|
+
* Copyright 2020 Google LLC
|
|
504
|
+
*
|
|
505
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
506
|
+
* you may not use this file except in compliance with the License.
|
|
507
|
+
* You may obtain a copy of the License at
|
|
508
|
+
*
|
|
509
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
510
|
+
*
|
|
511
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
512
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
513
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
514
|
+
* See the License for the specific language governing permissions and
|
|
515
|
+
* limitations under the License.
|
|
516
|
+
*/class Sf{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;qn("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;qn("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;qn("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
|
|
517
|
+
* @license
|
|
518
|
+
* Copyright 2020 Google LLC
|
|
519
|
+
*
|
|
520
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
521
|
+
* you may not use this file except in compliance with the License.
|
|
522
|
+
* You may obtain a copy of the License at
|
|
523
|
+
*
|
|
524
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
525
|
+
*
|
|
526
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
527
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
528
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
529
|
+
* See the License for the specific language governing permissions and
|
|
530
|
+
* limitations under the License.
|
|
531
|
+
*/const D1={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"};/**
|
|
532
|
+
* @license
|
|
533
|
+
* Copyright 2020 Google LLC
|
|
534
|
+
*
|
|
535
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
536
|
+
* you may not use this file except in compliance with the License.
|
|
537
|
+
* You may obtain a copy of the License at
|
|
538
|
+
*
|
|
539
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
540
|
+
*
|
|
541
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
542
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
543
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
544
|
+
* See the License for the specific language governing permissions and
|
|
545
|
+
* limitations under the License.
|
|
546
|
+
*/const L1=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],j1=new fo(3e4,6e4);function ul(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function _s(e,t,n,r,s={}){return Ef(e,s,async()=>{let o={},i={};r&&(t==="GET"?i=r:o={body:JSON.stringify(r)});const a=co({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 u={method:t,headers:l,...o};return iT()||(u.referrerPolicy="no-referrer"),e.emulatorConfig&&hi(e.emulatorConfig.host)&&(u.credentials="include"),Sf.fetch()(await Cf(e,e.config.apiHost,n,a),u)})}async function Ef(e,t,n){e._canInitEmulator=!1;const r={...D1,...t};try{const s=new F1(e),o=await Promise.race([n(),s.promise]);s.clearNetworkTimeout();const i=await o.json();if("needConfirmation"in i)throw bo(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,u]=a.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw bo(e,"credential-already-in-use",i);if(l==="EMAIL_EXISTS")throw bo(e,"email-already-in-use",i);if(l==="USER_DISABLED")throw bo(e,"user-disabled",i);const c=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw al(e,c,u);$n(e,c)}}catch(s){if(s instanceof Er)throw s;$n(e,"network-request-failed",{message:String(s)})}}async function B1(e,t,n,r,s={}){const o=await _s(e,t,n,r,s);return"mfaPendingCredential"in o&&$n(e,"multi-factor-auth-required",{_serverResponse:o}),o}async function Cf(e,t,n,r){const s=`${t}${n}?${r}`,o=e,i=o.config.emulator?cl(e.config,s):`${e.config.apiScheme}://${s}`;return L1.includes(n)&&(await o._persistenceManagerAvailable,o._getPersistenceType()==="COOKIE")?o._getPersistence()._getFinalTarget(i).toString():i}class F1{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(yn(this.auth,"network-request-failed")),j1.get())})}}function bo(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=yn(e,t,r);return s.customData._tokenResponse=n,s}/**
|
|
547
|
+
* @license
|
|
548
|
+
* Copyright 2020 Google LLC
|
|
549
|
+
*
|
|
550
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
551
|
+
* you may not use this file except in compliance with the License.
|
|
552
|
+
* You may obtain a copy of the License at
|
|
553
|
+
*
|
|
554
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
555
|
+
*
|
|
556
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
557
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
558
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
559
|
+
* See the License for the specific language governing permissions and
|
|
560
|
+
* limitations under the License.
|
|
561
|
+
*/async function U1(e,t){return _s(e,"POST","/v1/accounts:delete",t)}async function Go(e,t){return _s(e,"POST","/v1/accounts:lookup",t)}/**
|
|
562
|
+
* @license
|
|
563
|
+
* Copyright 2020 Google LLC
|
|
564
|
+
*
|
|
565
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
566
|
+
* you may not use this file except in compliance with the License.
|
|
567
|
+
* You may obtain a copy of the License at
|
|
568
|
+
*
|
|
569
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
570
|
+
*
|
|
571
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
572
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
573
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
574
|
+
* See the License for the specific language governing permissions and
|
|
575
|
+
* limitations under the License.
|
|
576
|
+
*/function Ws(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function H1(e,t=!1){const n=bs(e),r=await n.getIdToken(t),s=dl(r);He(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:Ws(qi(s.auth_time)),issuedAtTime:Ws(qi(s.iat)),expirationTime:Ws(qi(s.exp)),signInProvider:i||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}}function qi(e){return Number(e)*1e3}function dl(e){const[t,n,r]=e.split(".");if(t===void 0||n===void 0||r===void 0)return xo("JWT malformed, contained fewer than 3 sections"),null;try{const s=ff(n);return s?JSON.parse(s):(xo("Failed to decode base64 JWT payload"),null)}catch(s){return xo("Caught error parsing JWT payload as JSON",s==null?void 0:s.toString()),null}}function ru(e){const t=dl(e);return He(t,"internal-error"),He(typeof t.exp<"u","internal-error"),He(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/**
|
|
577
|
+
* @license
|
|
578
|
+
* Copyright 2020 Google LLC
|
|
579
|
+
*
|
|
580
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
581
|
+
* you may not use this file except in compliance with the License.
|
|
582
|
+
* You may obtain a copy of the License at
|
|
583
|
+
*
|
|
584
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
585
|
+
*
|
|
586
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
587
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
588
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
589
|
+
* See the License for the specific language governing permissions and
|
|
590
|
+
* limitations under the License.
|
|
591
|
+
*/async function so(e,t,n=!1){if(n)return t;try{return await t}catch(r){throw r instanceof Er&&V1(r)&&e.auth.currentUser===e&&await e.auth.signOut(),r}}function V1({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
|
|
592
|
+
* @license
|
|
593
|
+
* Copyright 2020 Google LLC
|
|
594
|
+
*
|
|
595
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
596
|
+
* you may not use this file except in compliance with the License.
|
|
597
|
+
* You may obtain a copy of the License at
|
|
598
|
+
*
|
|
599
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
600
|
+
*
|
|
601
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
602
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
603
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
604
|
+
* See the License for the specific language governing permissions and
|
|
605
|
+
* limitations under the License.
|
|
606
|
+
*/class W1{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()}}/**
|
|
607
|
+
* @license
|
|
608
|
+
* Copyright 2020 Google LLC
|
|
609
|
+
*
|
|
610
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
611
|
+
* you may not use this file except in compliance with the License.
|
|
612
|
+
* You may obtain a copy of the License at
|
|
613
|
+
*
|
|
614
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
615
|
+
*
|
|
616
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
617
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
618
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
619
|
+
* See the License for the specific language governing permissions and
|
|
620
|
+
* limitations under the License.
|
|
621
|
+
*/class Aa{constructor(t,n){this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Ws(this.lastLoginAt),this.creationTime=Ws(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
|
|
622
|
+
* @license
|
|
623
|
+
* Copyright 2019 Google LLC
|
|
624
|
+
*
|
|
625
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
626
|
+
* you may not use this file except in compliance with the License.
|
|
627
|
+
* You may obtain a copy of the License at
|
|
628
|
+
*
|
|
629
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
630
|
+
*
|
|
631
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
632
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
633
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
634
|
+
* See the License for the specific language governing permissions and
|
|
635
|
+
* limitations under the License.
|
|
636
|
+
*/async function zo(e){var f;const t=e.auth,n=await e.getIdToken(),r=await so(e,Go(t,{idToken:n}));He(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?Af(s.providerUserInfo):[],i=z1(e.providerData,o),a=e.isAnonymous,l=!(e.email&&s.passwordHash)&&!(i!=null&&i.length),u=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 Aa(s.createdAt,s.lastLoginAt),isAnonymous:u};Object.assign(e,c)}async function G1(e){const t=bs(e);await zo(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function z1(e,t){return[...e.filter(r=>!t.some(s=>s.providerId===r.providerId)),...t]}function Af(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}))}/**
|
|
637
|
+
* @license
|
|
638
|
+
* Copyright 2020 Google LLC
|
|
639
|
+
*
|
|
640
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
641
|
+
* you may not use this file except in compliance with the License.
|
|
642
|
+
* You may obtain a copy of the License at
|
|
643
|
+
*
|
|
644
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
645
|
+
*
|
|
646
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
647
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
648
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
649
|
+
* See the License for the specific language governing permissions and
|
|
650
|
+
* limitations under the License.
|
|
651
|
+
*/async function q1(e,t){const n=await Ef(e,{},async()=>{const r=co({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:s,apiKey:o}=e.config,i=await Cf(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&&hi(e.emulatorConfig.host)&&(l.credentials="include"),Sf.fetch()(i,l)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function K1(e,t){return _s(e,"POST","/v2/accounts:revokeToken",ul(e,t))}/**
|
|
652
|
+
* @license
|
|
653
|
+
* Copyright 2020 Google LLC
|
|
654
|
+
*
|
|
655
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
656
|
+
* you may not use this file except in compliance with the License.
|
|
657
|
+
* You may obtain a copy of the License at
|
|
658
|
+
*
|
|
659
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
660
|
+
*
|
|
661
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
662
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
663
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
664
|
+
* See the License for the specific language governing permissions and
|
|
665
|
+
* limitations under the License.
|
|
666
|
+
*/class us{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){He(t.idToken,"internal-error"),He(typeof t.idToken<"u","internal-error"),He(typeof t.refreshToken<"u","internal-error");const n="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):ru(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,n)}updateFromIdToken(t){He(t.length!==0,"internal-error");const n=ru(t);this.updateTokensAndExpiration(t,null,n)}async getToken(t,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(He(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 q1(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 us;return r&&(He(typeof r=="string","internal-error",{appName:t}),i.refreshToken=r),s&&(He(typeof s=="string","internal-error",{appName:t}),i.accessToken=s),o&&(He(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 us,this.toJSON())}_performRefresh(){return qn("not implemented")}}/**
|
|
667
|
+
* @license
|
|
668
|
+
* Copyright 2020 Google LLC
|
|
669
|
+
*
|
|
670
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
671
|
+
* you may not use this file except in compliance with the License.
|
|
672
|
+
* You may obtain a copy of the License at
|
|
673
|
+
*
|
|
674
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
675
|
+
*
|
|
676
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
677
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
678
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
679
|
+
* See the License for the specific language governing permissions and
|
|
680
|
+
* limitations under the License.
|
|
681
|
+
*/function fr(e,t){He(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class mn{constructor({uid:t,auth:n,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new W1(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 Aa(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const n=await so(this,this.stsTokenManager.getToken(this.auth,t));return He(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(t){return H1(this,t)}reload(){return G1(this)}_assign(t){this!==t&&(He(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 mn({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(t){He(!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 zo(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Pn(this.auth.app))return Promise.reject(Vr(this.auth));const t=await this.getIdToken();return await so(this,U1(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,u=n.createdAt??void 0,c=n.lastLoginAt??void 0,{uid:f,emailVerified:h,isAnonymous:_,providerData:L,stsTokenManager:C}=n;He(f&&C,t,"internal-error");const j=us.fromJSON(this.name,C);He(typeof f=="string",t,"internal-error"),fr(r,t.name),fr(s,t.name),He(typeof h=="boolean",t,"internal-error"),He(typeof _=="boolean",t,"internal-error"),fr(o,t.name),fr(i,t.name),fr(a,t.name),fr(l,t.name),fr(u,t.name),fr(c,t.name);const Z=new mn({uid:f,auth:t,email:s,emailVerified:h,displayName:r,isAnonymous:_,photoURL:i,phoneNumber:o,tenantId:a,stsTokenManager:j,createdAt:u,lastLoginAt:c});return L&&Array.isArray(L)&&(Z.providerData=L.map(B=>({...B}))),l&&(Z._redirectEventId=l),Z}static async _fromIdTokenResponse(t,n,r=!1){const s=new us;s.updateFromServerResponse(n);const o=new mn({uid:n.localId,auth:t,stsTokenManager:s,isAnonymous:r});return await zo(o),o}static async _fromGetAccountInfoResponse(t,n,r){const s=n.users[0];He(s.localId!==void 0,"internal-error");const o=s.providerUserInfo!==void 0?Af(s.providerUserInfo):[],i=!(s.email&&s.passwordHash)&&!(o!=null&&o.length),a=new us;a.updateFromIdToken(r);const l=new mn({uid:s.localId,auth:t,stsTokenManager:a,isAnonymous:i}),u={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 Aa(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(o!=null&&o.length)};return Object.assign(l,u),l}}/**
|
|
682
|
+
* @license
|
|
683
|
+
* Copyright 2020 Google LLC
|
|
684
|
+
*
|
|
685
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
686
|
+
* you may not use this file except in compliance with the License.
|
|
687
|
+
* You may obtain a copy of the License at
|
|
688
|
+
*
|
|
689
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
690
|
+
*
|
|
691
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
692
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
693
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
694
|
+
* See the License for the specific language governing permissions and
|
|
695
|
+
* limitations under the License.
|
|
696
|
+
*/const su=new Map;function Kn(e){nr(e instanceof Function,"Expected a class definition");let t=su.get(e);return t?(nr(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,su.set(e,t),t)}/**
|
|
697
|
+
* @license
|
|
698
|
+
* Copyright 2019 Google LLC
|
|
699
|
+
*
|
|
700
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
701
|
+
* you may not use this file except in compliance with the License.
|
|
702
|
+
* You may obtain a copy of the License at
|
|
703
|
+
*
|
|
704
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
705
|
+
*
|
|
706
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
707
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
708
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
709
|
+
* See the License for the specific language governing permissions and
|
|
710
|
+
* limitations under the License.
|
|
711
|
+
*/class Rf{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){}}Rf.type="NONE";const ou=Rf;/**
|
|
712
|
+
* @license
|
|
713
|
+
* Copyright 2019 Google LLC
|
|
714
|
+
*
|
|
715
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
716
|
+
* you may not use this file except in compliance with the License.
|
|
717
|
+
* You may obtain a copy of the License at
|
|
718
|
+
*
|
|
719
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
720
|
+
*
|
|
721
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
722
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
723
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
724
|
+
* See the License for the specific language governing permissions and
|
|
725
|
+
* limitations under the License.
|
|
726
|
+
*/function Mo(e,t,n){return`firebase:${e}:${t}:${n}`}class ds{constructor(t,n,r){this.persistence=t,this.auth=n,this.userKey=r;const{config:s,name:o}=this.auth;this.fullUserKey=Mo(this.userKey,s.apiKey,o),this.fullPersistenceKey=Mo("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 Go(this.auth,{idToken:t}).catch(()=>{});return n?mn._fromGetAccountInfoResponse(this.auth,n,t):null}return mn._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 ds(Kn(ou),t,r);const s=(await Promise.all(n.map(async u=>{if(await u._isAvailable())return u}))).filter(u=>u);let o=s[0]||Kn(ou);const i=Mo(r,t.config.apiKey,t.name);let a=null;for(const u of n)try{const c=await u._get(i);if(c){let f;if(typeof c=="string"){const h=await Go(t,{idToken:c}).catch(()=>{});if(!h)break;f=await mn._fromGetAccountInfoResponse(t,h,c)}else f=mn._fromJSON(t,c);u!==o&&(a=f),o=u;break}}catch{}const l=s.filter(u=>u._shouldAllowMigration);return!o._shouldAllowMigration||!l.length?new ds(o,t,r):(o=l[0],a&&await o._set(i,a.toJSON()),await Promise.all(n.map(async u=>{if(u!==o)try{await u._remove(i)}catch{}})),new ds(o,t,r))}}/**
|
|
727
|
+
* @license
|
|
728
|
+
* Copyright 2020 Google LLC
|
|
729
|
+
*
|
|
730
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
731
|
+
* you may not use this file except in compliance with the License.
|
|
732
|
+
* You may obtain a copy of the License at
|
|
733
|
+
*
|
|
734
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
735
|
+
*
|
|
736
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
737
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
738
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
739
|
+
* See the License for the specific language governing permissions and
|
|
740
|
+
* limitations under the License.
|
|
741
|
+
*/function iu(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(Of(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(Pf(t))return"Firefox";if(t.includes("silk/"))return"Silk";if($f(t))return"Blackberry";if(Df(t))return"Webos";if(xf(t))return"Safari";if((t.includes("chrome/")||Mf(t))&&!t.includes("edge/"))return"Chrome";if(Nf(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 Pf(e=tn()){return/firefox\//i.test(e)}function xf(e=tn()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function Mf(e=tn()){return/crios\//i.test(e)}function Of(e=tn()){return/iemobile/i.test(e)}function Nf(e=tn()){return/android/i.test(e)}function $f(e=tn()){return/blackberry/i.test(e)}function Df(e=tn()){return/webos/i.test(e)}function fl(e=tn()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function J1(e=tn()){var t;return fl(e)&&!!((t=window.navigator)!=null&&t.standalone)}function Y1(){return cT()&&document.documentMode===10}function Lf(e=tn()){return fl(e)||Nf(e)||Df(e)||$f(e)||/windows phone/i.test(e)||Of(e)}/**
|
|
742
|
+
* @license
|
|
743
|
+
* Copyright 2020 Google LLC
|
|
744
|
+
*
|
|
745
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
746
|
+
* you may not use this file except in compliance with the License.
|
|
747
|
+
* You may obtain a copy of the License at
|
|
748
|
+
*
|
|
749
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
750
|
+
*
|
|
751
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
752
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
753
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
754
|
+
* See the License for the specific language governing permissions and
|
|
755
|
+
* limitations under the License.
|
|
756
|
+
*/function jf(e,t=[]){let n;switch(e){case"Browser":n=iu(tn());break;case"Worker":n=`${iu(tn())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${uo}/${r}`}/**
|
|
757
|
+
* @license
|
|
758
|
+
* Copyright 2022 Google LLC
|
|
759
|
+
*
|
|
760
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
761
|
+
* you may not use this file except in compliance with the License.
|
|
762
|
+
* You may obtain a copy of the License at
|
|
763
|
+
*
|
|
764
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
765
|
+
*
|
|
766
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
767
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
768
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
769
|
+
* See the License for the specific language governing permissions and
|
|
770
|
+
* limitations under the License.
|
|
771
|
+
*/class X1{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})}}}/**
|
|
772
|
+
* @license
|
|
773
|
+
* Copyright 2023 Google LLC
|
|
774
|
+
*
|
|
775
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
776
|
+
* you may not use this file except in compliance with the License.
|
|
777
|
+
* You may obtain a copy of the License at
|
|
778
|
+
*
|
|
779
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
780
|
+
*
|
|
781
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
782
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
783
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
784
|
+
* See the License for the specific language governing permissions and
|
|
785
|
+
* limitations under the License.
|
|
786
|
+
*/async function Q1(e,t={}){return _s(e,"GET","/v2/passwordPolicy",ul(e,t))}/**
|
|
787
|
+
* @license
|
|
788
|
+
* Copyright 2023 Google LLC
|
|
789
|
+
*
|
|
790
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
791
|
+
* you may not use this file except in compliance with the License.
|
|
792
|
+
* You may obtain a copy of the License at
|
|
793
|
+
*
|
|
794
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
795
|
+
*
|
|
796
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
797
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
798
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
799
|
+
* See the License for the specific language governing permissions and
|
|
800
|
+
* limitations under the License.
|
|
801
|
+
*/const Z1=6;class eI{constructor(t){var r;const n=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??Z1,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))}}/**
|
|
802
|
+
* @license
|
|
803
|
+
* Copyright 2020 Google LLC
|
|
804
|
+
*
|
|
805
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
806
|
+
* you may not use this file except in compliance with the License.
|
|
807
|
+
* You may obtain a copy of the License at
|
|
808
|
+
*
|
|
809
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
810
|
+
*
|
|
811
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
812
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
813
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
814
|
+
* See the License for the specific language governing permissions and
|
|
815
|
+
* limitations under the License.
|
|
816
|
+
*/class tI{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 au(this),this.idTokenSubscription=new au(this),this.beforeStateQueue=new X1(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=If,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=Kn(n)),this._initializationPromise=this.queue(async()=>{var r,s,o;if(!this._deleted&&(this.persistenceManager=await ds.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 Go(this,{idToken:t}),r=await mn._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(Pn(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 He(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 zo(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=$1()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(Pn(this.app))return Promise.reject(Vr(this));const n=t?bs(t):null;return n&&He(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&&He(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 Pn(this.app)?Promise.reject(Vr(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(t){return Pn(this.app)?Promise.reject(Vr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Kn(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 Q1(this),n=new eI(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 lo("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 K1(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&&Kn(t)||this._popupRedirectResolver;He(n,this,"argument-error"),this.redirectPersistenceManager=await ds.create(this,[Kn(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(He(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 He(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=jf(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(Pn(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&&x1(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function pi(e){return bs(e)}class au{constructor(t){this.auth=t,this.observer=null,this.addObserver=gT(n=>this.observer=n)}get next(){return He(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
|
|
817
|
+
* @license
|
|
818
|
+
* Copyright 2020 Google LLC
|
|
819
|
+
*
|
|
820
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
821
|
+
* you may not use this file except in compliance with the License.
|
|
822
|
+
* You may obtain a copy of the License at
|
|
823
|
+
*
|
|
824
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
825
|
+
*
|
|
826
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
827
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
828
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
829
|
+
* See the License for the specific language governing permissions and
|
|
830
|
+
* limitations under the License.
|
|
831
|
+
*/let hl={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function nI(e){hl=e}function rI(e){return hl.loadJS(e)}function sI(){return hl.gapiScript}function oI(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/**
|
|
832
|
+
* @license
|
|
833
|
+
* Copyright 2020 Google LLC
|
|
834
|
+
*
|
|
835
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
836
|
+
* you may not use this file except in compliance with the License.
|
|
837
|
+
* You may obtain a copy of the License at
|
|
838
|
+
*
|
|
839
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
840
|
+
*
|
|
841
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
842
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
843
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
844
|
+
* See the License for the specific language governing permissions and
|
|
845
|
+
* limitations under the License.
|
|
846
|
+
*/function iI(e,t){const n=yf(e,"auth");if(n.isInitialized()){const s=n.getImmediate(),o=n.getOptions();if(gs(o,t??{}))return s;$n(s,"already-initialized")}return n.initialize({options:t})}function aI(e,t){const n=(t==null?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Kn);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t==null?void 0:t.popupRedirectResolver)}function lI(e,t,n){const r=pi(e);He(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const s=!1,o=Bf(t),{host:i,port:a}=cI(t),l=a===null?"":`:${a}`,u={url:`${o}//${i}${l}/`},c=Object.freeze({host:i,port:a,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:s})});if(!r._canInitEmulator){He(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),He(gs(u,r.config.emulator)&&gs(c,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=u,r.emulatorConfig=c,r.settings.appVerificationDisabledForTesting=!0,hi(i)?(tT(`${o}//${i}${l}`),sT("Auth",!0)):uI()}function Bf(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function cI(e){const t=Bf(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:lu(r.substr(o.length+1))}}else{const[o,i]=r.split(":");return{host:o,port:lu(i)}}}function lu(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function uI(){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())}/**
|
|
847
|
+
* @license
|
|
848
|
+
* Copyright 2020 Google LLC
|
|
849
|
+
*
|
|
850
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
851
|
+
* you may not use this file except in compliance with the License.
|
|
852
|
+
* You may obtain a copy of the License at
|
|
853
|
+
*
|
|
854
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
855
|
+
*
|
|
856
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
857
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
858
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
859
|
+
* See the License for the specific language governing permissions and
|
|
860
|
+
* limitations under the License.
|
|
861
|
+
*/class Ff{constructor(t,n){this.providerId=t,this.signInMethod=n}toJSON(){return qn("not implemented")}_getIdTokenResponse(t){return qn("not implemented")}_linkToIdToken(t,n){return qn("not implemented")}_getReauthenticationResolver(t){return qn("not implemented")}}/**
|
|
862
|
+
* @license
|
|
863
|
+
* Copyright 2020 Google LLC
|
|
864
|
+
*
|
|
865
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
866
|
+
* you may not use this file except in compliance with the License.
|
|
867
|
+
* You may obtain a copy of the License at
|
|
868
|
+
*
|
|
869
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
870
|
+
*
|
|
871
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
872
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
873
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
874
|
+
* See the License for the specific language governing permissions and
|
|
875
|
+
* limitations under the License.
|
|
876
|
+
*/async function fs(e,t){return B1(e,"POST","/v1/accounts:signInWithIdp",ul(e,t))}/**
|
|
877
|
+
* @license
|
|
878
|
+
* Copyright 2020 Google LLC
|
|
879
|
+
*
|
|
880
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
881
|
+
* you may not use this file except in compliance with the License.
|
|
882
|
+
* You may obtain a copy of the License at
|
|
883
|
+
*
|
|
884
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
885
|
+
*
|
|
886
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
887
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
888
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
889
|
+
* See the License for the specific language governing permissions and
|
|
890
|
+
* limitations under the License.
|
|
891
|
+
*/const dI="http://localhost";class Gr extends Ff{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const n=new Gr(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):$n("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 Gr(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 fs(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,fs(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,fs(t,n)}buildRequest(){const t={requestUri:dI,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=co(n)}return t}}/**
|
|
892
|
+
* @license
|
|
893
|
+
* Copyright 2020 Google LLC
|
|
894
|
+
*
|
|
895
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
896
|
+
* you may not use this file except in compliance with the License.
|
|
897
|
+
* You may obtain a copy of the License at
|
|
898
|
+
*
|
|
899
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
900
|
+
*
|
|
901
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
902
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
903
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
904
|
+
* See the License for the specific language governing permissions and
|
|
905
|
+
* limitations under the License.
|
|
906
|
+
*/class pl{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}}/**
|
|
907
|
+
* @license
|
|
908
|
+
* Copyright 2019 Google LLC
|
|
909
|
+
*
|
|
910
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
911
|
+
* you may not use this file except in compliance with the License.
|
|
912
|
+
* You may obtain a copy of the License at
|
|
913
|
+
*
|
|
914
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
915
|
+
*
|
|
916
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
917
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
918
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
919
|
+
* See the License for the specific language governing permissions and
|
|
920
|
+
* limitations under the License.
|
|
921
|
+
*/class ho extends pl{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/**
|
|
922
|
+
* @license
|
|
923
|
+
* Copyright 2020 Google LLC
|
|
924
|
+
*
|
|
925
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
926
|
+
* you may not use this file except in compliance with the License.
|
|
927
|
+
* You may obtain a copy of the License at
|
|
928
|
+
*
|
|
929
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
930
|
+
*
|
|
931
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
932
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
933
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
934
|
+
* See the License for the specific language governing permissions and
|
|
935
|
+
* limitations under the License.
|
|
936
|
+
*/class yr extends ho{constructor(){super("facebook.com")}static credential(t){return Gr._fromParams({providerId:yr.PROVIDER_ID,signInMethod:yr.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return yr.credentialFromTaggedObject(t)}static credentialFromError(t){return yr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return yr.credential(t.oauthAccessToken)}catch{return null}}}yr.FACEBOOK_SIGN_IN_METHOD="facebook.com";yr.PROVIDER_ID="facebook.com";/**
|
|
937
|
+
* @license
|
|
938
|
+
* Copyright 2020 Google LLC
|
|
939
|
+
*
|
|
940
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
941
|
+
* you may not use this file except in compliance with the License.
|
|
942
|
+
* You may obtain a copy of the License at
|
|
943
|
+
*
|
|
944
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
945
|
+
*
|
|
946
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
947
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
948
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
949
|
+
* See the License for the specific language governing permissions and
|
|
950
|
+
* limitations under the License.
|
|
951
|
+
*/class wr extends ho{constructor(){super("google.com"),this.addScope("profile")}static credential(t,n){return Gr._fromParams({providerId:wr.PROVIDER_ID,signInMethod:wr.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:n})}static credentialFromResult(t){return wr.credentialFromTaggedObject(t)}static credentialFromError(t){return wr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return wr.credential(n,r)}catch{return null}}}wr.GOOGLE_SIGN_IN_METHOD="google.com";wr.PROVIDER_ID="google.com";/**
|
|
952
|
+
* @license
|
|
953
|
+
* Copyright 2020 Google LLC
|
|
954
|
+
*
|
|
955
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
956
|
+
* you may not use this file except in compliance with the License.
|
|
957
|
+
* You may obtain a copy of the License at
|
|
958
|
+
*
|
|
959
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
960
|
+
*
|
|
961
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
962
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
963
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
964
|
+
* See the License for the specific language governing permissions and
|
|
965
|
+
* limitations under the License.
|
|
966
|
+
*/class xn extends ho{constructor(){super("github.com")}static credential(t){return Gr._fromParams({providerId:xn.PROVIDER_ID,signInMethod:xn.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return xn.credentialFromTaggedObject(t)}static credentialFromError(t){return xn.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return xn.credential(t.oauthAccessToken)}catch{return null}}}xn.GITHUB_SIGN_IN_METHOD="github.com";xn.PROVIDER_ID="github.com";/**
|
|
967
|
+
* @license
|
|
968
|
+
* Copyright 2020 Google LLC
|
|
969
|
+
*
|
|
970
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
971
|
+
* you may not use this file except in compliance with the License.
|
|
972
|
+
* You may obtain a copy of the License at
|
|
973
|
+
*
|
|
974
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
975
|
+
*
|
|
976
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
977
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
978
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
979
|
+
* See the License for the specific language governing permissions and
|
|
980
|
+
* limitations under the License.
|
|
981
|
+
*/class br extends ho{constructor(){super("twitter.com")}static credential(t,n){return Gr._fromParams({providerId:br.PROVIDER_ID,signInMethod:br.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:n})}static credentialFromResult(t){return br.credentialFromTaggedObject(t)}static credentialFromError(t){return br.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return br.credential(n,r)}catch{return null}}}br.TWITTER_SIGN_IN_METHOD="twitter.com";br.PROVIDER_ID="twitter.com";/**
|
|
982
|
+
* @license
|
|
983
|
+
* Copyright 2020 Google LLC
|
|
984
|
+
*
|
|
985
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
986
|
+
* you may not use this file except in compliance with the License.
|
|
987
|
+
* You may obtain a copy of the License at
|
|
988
|
+
*
|
|
989
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
990
|
+
*
|
|
991
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
992
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
993
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
994
|
+
* See the License for the specific language governing permissions and
|
|
995
|
+
* limitations under the License.
|
|
996
|
+
*/class ys{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 mn._fromIdTokenResponse(t,r,s),i=cu(r);return new ys({user:o,providerId:i,_tokenResponse:r,operationType:n})}static async _forOperation(t,n,r){await t._updateTokensIfNecessary(r,!0);const s=cu(r);return new ys({user:t,providerId:s,_tokenResponse:r,operationType:n})}}function cu(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
|
|
997
|
+
* @license
|
|
998
|
+
* Copyright 2020 Google LLC
|
|
999
|
+
*
|
|
1000
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1001
|
+
* you may not use this file except in compliance with the License.
|
|
1002
|
+
* You may obtain a copy of the License at
|
|
1003
|
+
*
|
|
1004
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1005
|
+
*
|
|
1006
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1007
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1008
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1009
|
+
* See the License for the specific language governing permissions and
|
|
1010
|
+
* limitations under the License.
|
|
1011
|
+
*/class qo extends Er{constructor(t,n,r,s){super(n.code,n.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,qo.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 qo(t,n,r,s)}}function Uf(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?qo._fromErrorAndOperation(e,o,t,r):o})}async function fI(e,t,n=!1){const r=await so(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return ys._forOperation(e,"link",r)}/**
|
|
1012
|
+
* @license
|
|
1013
|
+
* Copyright 2019 Google LLC
|
|
1014
|
+
*
|
|
1015
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1016
|
+
* you may not use this file except in compliance with the License.
|
|
1017
|
+
* You may obtain a copy of the License at
|
|
1018
|
+
*
|
|
1019
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1020
|
+
*
|
|
1021
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1022
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1023
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1024
|
+
* See the License for the specific language governing permissions and
|
|
1025
|
+
* limitations under the License.
|
|
1026
|
+
*/async function hI(e,t,n=!1){const{auth:r}=e;if(Pn(r.app))return Promise.reject(Vr(r));const s="reauthenticate";try{const o=await so(e,Uf(r,s,t,e),n);He(o.idToken,r,"internal-error");const i=dl(o.idToken);He(i,r,"internal-error");const{sub:a}=i;return He(e.uid===a,r,"user-mismatch"),ys._forOperation(e,s,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&$n(r,"user-mismatch"),o}}/**
|
|
1027
|
+
* @license
|
|
1028
|
+
* Copyright 2020 Google LLC
|
|
1029
|
+
*
|
|
1030
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1031
|
+
* you may not use this file except in compliance with the License.
|
|
1032
|
+
* You may obtain a copy of the License at
|
|
1033
|
+
*
|
|
1034
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1035
|
+
*
|
|
1036
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1037
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1038
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1039
|
+
* See the License for the specific language governing permissions and
|
|
1040
|
+
* limitations under the License.
|
|
1041
|
+
*/async function pI(e,t,n=!1){if(Pn(e.app))return Promise.reject(Vr(e));const r="signIn",s=await Uf(e,r,t),o=await ys._fromIdTokenResponse(e,r,s);return n||await e._updateCurrentUser(o.user),o}function mI(e,t,n,r){return bs(e).onIdTokenChanged(t,n,r)}function gI(e,t,n){return bs(e).beforeAuthStateChanged(t,n)}const Ko="__sak";/**
|
|
1042
|
+
* @license
|
|
1043
|
+
* Copyright 2019 Google LLC
|
|
1044
|
+
*
|
|
1045
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1046
|
+
* you may not use this file except in compliance with the License.
|
|
1047
|
+
* You may obtain a copy of the License at
|
|
1048
|
+
*
|
|
1049
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1050
|
+
*
|
|
1051
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1052
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1053
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1054
|
+
* See the License for the specific language governing permissions and
|
|
1055
|
+
* limitations under the License.
|
|
1056
|
+
*/class Hf{constructor(t,n){this.storageRetriever=t,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Ko,"1"),this.storage.removeItem(Ko),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()}}/**
|
|
1057
|
+
* @license
|
|
1058
|
+
* Copyright 2020 Google LLC
|
|
1059
|
+
*
|
|
1060
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1061
|
+
* you may not use this file except in compliance with the License.
|
|
1062
|
+
* You may obtain a copy of the License at
|
|
1063
|
+
*
|
|
1064
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1065
|
+
*
|
|
1066
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1067
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1068
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1069
|
+
* See the License for the specific language governing permissions and
|
|
1070
|
+
* limitations under the License.
|
|
1071
|
+
*/const vI=1e3,yI=10;class Vf extends Hf{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,n)=>this.onStorageEvent(t,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Lf(),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);Y1()&&o!==t.newValue&&t.newValue!==t.oldValue?setTimeout(s,yI):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)})},vI)}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]}}Vf.type="LOCAL";const wI=Vf;/**
|
|
1072
|
+
* @license
|
|
1073
|
+
* Copyright 2020 Google LLC
|
|
1074
|
+
*
|
|
1075
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1076
|
+
* you may not use this file except in compliance with the License.
|
|
1077
|
+
* You may obtain a copy of the License at
|
|
1078
|
+
*
|
|
1079
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1080
|
+
*
|
|
1081
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1082
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1083
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1084
|
+
* See the License for the specific language governing permissions and
|
|
1085
|
+
* limitations under the License.
|
|
1086
|
+
*/class Wf extends Hf{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,n){}_removeListener(t,n){}}Wf.type="SESSION";const Gf=Wf;/**
|
|
1087
|
+
* @license
|
|
1088
|
+
* Copyright 2019 Google LLC
|
|
1089
|
+
*
|
|
1090
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1091
|
+
* you may not use this file except in compliance with the License.
|
|
1092
|
+
* You may obtain a copy of the License at
|
|
1093
|
+
*
|
|
1094
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1095
|
+
*
|
|
1096
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1097
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1098
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1099
|
+
* See the License for the specific language governing permissions and
|
|
1100
|
+
* limitations under the License.
|
|
1101
|
+
*/function bI(e){return Promise.all(e.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(n){return{fulfilled:!1,reason:n}}}))}/**
|
|
1102
|
+
* @license
|
|
1103
|
+
* Copyright 2019 Google LLC
|
|
1104
|
+
*
|
|
1105
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1106
|
+
* you may not use this file except in compliance with the License.
|
|
1107
|
+
* You may obtain a copy of the License at
|
|
1108
|
+
*
|
|
1109
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1110
|
+
*
|
|
1111
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1112
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1113
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1114
|
+
* See the License for the specific language governing permissions and
|
|
1115
|
+
* limitations under the License.
|
|
1116
|
+
*/class mi{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 mi(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 u=>u(n.origin,o)),l=await bI(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)}}mi.receivers=[];/**
|
|
1117
|
+
* @license
|
|
1118
|
+
* Copyright 2020 Google LLC
|
|
1119
|
+
*
|
|
1120
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1121
|
+
* you may not use this file except in compliance with the License.
|
|
1122
|
+
* You may obtain a copy of the License at
|
|
1123
|
+
*
|
|
1124
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1125
|
+
*
|
|
1126
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1127
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1128
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1129
|
+
* See the License for the specific language governing permissions and
|
|
1130
|
+
* limitations under the License.
|
|
1131
|
+
*/function ml(e="",t=10){let n="";for(let r=0;r<t;r++)n+=Math.floor(Math.random()*10);return e+n}/**
|
|
1132
|
+
* @license
|
|
1133
|
+
* Copyright 2019 Google LLC
|
|
1134
|
+
*
|
|
1135
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1136
|
+
* you may not use this file except in compliance with the License.
|
|
1137
|
+
* You may obtain a copy of the License at
|
|
1138
|
+
*
|
|
1139
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1140
|
+
*
|
|
1141
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1142
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1143
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1144
|
+
* See the License for the specific language governing permissions and
|
|
1145
|
+
* limitations under the License.
|
|
1146
|
+
*/class _I{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 u=ml("",20);s.port1.start();const c=setTimeout(()=>{l(new Error("unsupported_event"))},r);i={messageChannel:s,onMessage(f){const h=f;if(h.data.eventId===u)switch(h.data.status){case"ack":clearTimeout(c),o=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),a(h.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:u,data:n},[s.port2])}).finally(()=>{i&&this.removeMessageHandler(i)})}}/**
|
|
1147
|
+
* @license
|
|
1148
|
+
* Copyright 2020 Google LLC
|
|
1149
|
+
*
|
|
1150
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1151
|
+
* you may not use this file except in compliance with the License.
|
|
1152
|
+
* You may obtain a copy of the License at
|
|
1153
|
+
*
|
|
1154
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1155
|
+
*
|
|
1156
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1157
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1158
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1159
|
+
* See the License for the specific language governing permissions and
|
|
1160
|
+
* limitations under the License.
|
|
1161
|
+
*/function Nn(){return window}function kI(e){Nn().location.href=e}/**
|
|
1162
|
+
* @license
|
|
1163
|
+
* Copyright 2020 Google LLC.
|
|
1164
|
+
*
|
|
1165
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1166
|
+
* you may not use this file except in compliance with the License.
|
|
1167
|
+
* You may obtain a copy of the License at
|
|
1168
|
+
*
|
|
1169
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1170
|
+
*
|
|
1171
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1172
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1173
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1174
|
+
* See the License for the specific language governing permissions and
|
|
1175
|
+
* limitations under the License.
|
|
1176
|
+
*/function zf(){return typeof Nn().WorkerGlobalScope<"u"&&typeof Nn().importScripts=="function"}async function TI(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function II(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)==null?void 0:e.controller)||null}function SI(){return zf()?self:null}/**
|
|
1177
|
+
* @license
|
|
1178
|
+
* Copyright 2019 Google LLC
|
|
1179
|
+
*
|
|
1180
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1181
|
+
* you may not use this file except in compliance with the License.
|
|
1182
|
+
* You may obtain a copy of the License at
|
|
1183
|
+
*
|
|
1184
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1185
|
+
*
|
|
1186
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1187
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1188
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1189
|
+
* See the License for the specific language governing permissions and
|
|
1190
|
+
* limitations under the License.
|
|
1191
|
+
*/const qf="firebaseLocalStorageDb",EI=1,Jo="firebaseLocalStorage",Kf="fbase_key";class po{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 gi(e,t){return e.transaction([Jo],t?"readwrite":"readonly").objectStore(Jo)}function CI(){const e=indexedDB.deleteDatabase(qf);return new po(e).toPromise()}function Ra(){const e=indexedDB.open(qf,EI);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const r=e.result;try{r.createObjectStore(Jo,{keyPath:Kf})}catch(s){n(s)}}),e.addEventListener("success",async()=>{const r=e.result;r.objectStoreNames.contains(Jo)?t(r):(r.close(),await CI(),t(await Ra()))})})}async function uu(e,t,n){const r=gi(e,!0).put({[Kf]:t,value:n});return new po(r).toPromise()}async function AI(e,t){const n=gi(e,!1).get(t),r=await new po(n).toPromise();return r===void 0?null:r.value}function du(e,t){const n=gi(e,!0).delete(t);return new po(n).toPromise()}const RI=800,PI=3;class Jf{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 Ra(),this.db)}async _withRetries(t){let n=0;for(;;)try{const r=await this._openDb();return await t(r)}catch(r){if(n++>PI)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return zf()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=mi._getInstance(SI()),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 TI(),!this.activeServiceWorker)return;this.sender=new _I(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||II()!==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 Ra();return await uu(t,Ko,"1"),await du(t,Ko),!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=>uu(r,t,n)),this.localCache[t]=n,this.notifyServiceWorker(t)))}async _get(t){const n=await this._withRetries(r=>AI(r,t));return this.localCache[t]=n,n}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(n=>du(n,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(s=>{const o=gi(s,!1).getAll();return new po(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(),RI)}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()}}Jf.type="LOCAL";const xI=Jf;new fo(3e4,6e4);/**
|
|
1192
|
+
* @license
|
|
1193
|
+
* Copyright 2021 Google LLC
|
|
1194
|
+
*
|
|
1195
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1196
|
+
* you may not use this file except in compliance with the License.
|
|
1197
|
+
* You may obtain a copy of the License at
|
|
1198
|
+
*
|
|
1199
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1200
|
+
*
|
|
1201
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1202
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1203
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1204
|
+
* See the License for the specific language governing permissions and
|
|
1205
|
+
* limitations under the License.
|
|
1206
|
+
*/function Yf(e,t){return t?Kn(t):(He(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/**
|
|
1207
|
+
* @license
|
|
1208
|
+
* Copyright 2019 Google LLC
|
|
1209
|
+
*
|
|
1210
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1211
|
+
* you may not use this file except in compliance with the License.
|
|
1212
|
+
* You may obtain a copy of the License at
|
|
1213
|
+
*
|
|
1214
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1215
|
+
*
|
|
1216
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1217
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1218
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1219
|
+
* See the License for the specific language governing permissions and
|
|
1220
|
+
* limitations under the License.
|
|
1221
|
+
*/class gl extends Ff{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return fs(t,this._buildIdpRequest())}_linkToIdToken(t,n){return fs(t,this._buildIdpRequest(n))}_getReauthenticationResolver(t){return fs(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 MI(e){return pI(e.auth,new gl(e),e.bypassAuthState)}function OI(e){const{auth:t,user:n}=e;return He(n,t,"internal-error"),hI(n,new gl(e),e.bypassAuthState)}async function NI(e){const{auth:t,user:n}=e;return He(n,t,"internal-error"),fI(n,new gl(e),e.bypassAuthState)}/**
|
|
1222
|
+
* @license
|
|
1223
|
+
* Copyright 2020 Google LLC
|
|
1224
|
+
*
|
|
1225
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1226
|
+
* you may not use this file except in compliance with the License.
|
|
1227
|
+
* You may obtain a copy of the License at
|
|
1228
|
+
*
|
|
1229
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1230
|
+
*
|
|
1231
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1232
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1233
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1234
|
+
* See the License for the specific language governing permissions and
|
|
1235
|
+
* limitations under the License.
|
|
1236
|
+
*/class Xf{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(u){this.reject(u)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return MI;case"linkViaPopup":case"linkViaRedirect":return NI;case"reauthViaPopup":case"reauthViaRedirect":return OI;default:$n(this.auth,"internal-error")}}resolve(t){nr(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){nr(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()}}/**
|
|
1237
|
+
* @license
|
|
1238
|
+
* Copyright 2020 Google LLC
|
|
1239
|
+
*
|
|
1240
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1241
|
+
* you may not use this file except in compliance with the License.
|
|
1242
|
+
* You may obtain a copy of the License at
|
|
1243
|
+
*
|
|
1244
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1245
|
+
*
|
|
1246
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1247
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1248
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1249
|
+
* See the License for the specific language governing permissions and
|
|
1250
|
+
* limitations under the License.
|
|
1251
|
+
*/const $I=new fo(2e3,1e4);async function DI(e,t,n){if(Pn(e.app))return Promise.reject(yn(e,"operation-not-supported-in-this-environment"));const r=pi(e);M1(e,t,pl);const s=Yf(r,n);return new Fr(r,"signInViaPopup",t,s).executeNotNull()}class Fr extends Xf{constructor(t,n,r,s,o){super(t,n,s,o),this.provider=r,this.authWindow=null,this.pollId=null,Fr.currentPopupAction&&Fr.currentPopupAction.cancel(),Fr.currentPopupAction=this}async executeNotNull(){const t=await this.execute();return He(t,this.auth,"internal-error"),t}async onExecution(){nr(this.filter.length===1,"Popup operations only handle one event");const t=ml();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(yn(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)==null?void 0:t.associatedEvent)||null}cancel(){this.reject(yn(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Fr.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(yn(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,$I.get())};t()}}Fr.currentPopupAction=null;/**
|
|
1252
|
+
* @license
|
|
1253
|
+
* Copyright 2020 Google LLC
|
|
1254
|
+
*
|
|
1255
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1256
|
+
* you may not use this file except in compliance with the License.
|
|
1257
|
+
* You may obtain a copy of the License at
|
|
1258
|
+
*
|
|
1259
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1260
|
+
*
|
|
1261
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1262
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1263
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1264
|
+
* See the License for the specific language governing permissions and
|
|
1265
|
+
* limitations under the License.
|
|
1266
|
+
*/const LI="pendingRedirect",Oo=new Map;class jI extends Xf{constructor(t,n,r=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let t=Oo.get(this.auth._key());if(!t){try{const r=await BI(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(r)}catch(n){t=()=>Promise.reject(n)}Oo.set(this.auth._key(),t)}return this.bypassAuthState||Oo.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 BI(e,t){const n=HI(t),r=UI(e);if(!await r._isAvailable())return!1;const s=await r._get(n)==="true";return await r._remove(n),s}function FI(e,t){Oo.set(e._key(),t)}function UI(e){return Kn(e._redirectPersistence)}function HI(e){return Mo(LI,e.config.apiKey,e.name)}async function VI(e,t,n=!1){if(Pn(e.app))return Promise.reject(Vr(e));const r=pi(e),s=Yf(r,t),i=await new jI(r,s,n).execute();return i&&!n&&(delete i.user._redirectEventId,await r._persistUserIfCurrent(i.user),await r._setRedirectUser(null,t)),i}/**
|
|
1267
|
+
* @license
|
|
1268
|
+
* Copyright 2020 Google LLC
|
|
1269
|
+
*
|
|
1270
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1271
|
+
* you may not use this file except in compliance with the License.
|
|
1272
|
+
* You may obtain a copy of the License at
|
|
1273
|
+
*
|
|
1274
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1275
|
+
*
|
|
1276
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1277
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1278
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1279
|
+
* See the License for the specific language governing permissions and
|
|
1280
|
+
* limitations under the License.
|
|
1281
|
+
*/const WI=600*1e3;class GI{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||!zI(t)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=t,n=!0)),n}sendToConsumer(t,n){var r;if(t.error&&!Qf(t)){const s=((r=t.error.code)==null?void 0:r.split("auth/")[1])||"internal-error";n.onError(yn(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>=WI&&this.cachedEventUids.clear(),this.cachedEventUids.has(fu(t))}saveEventToCache(t){this.cachedEventUids.add(fu(t)),this.lastProcessedEventTime=Date.now()}}function fu(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function Qf({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function zI(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Qf(e);default:return!1}}/**
|
|
1282
|
+
* @license
|
|
1283
|
+
* Copyright 2020 Google LLC
|
|
1284
|
+
*
|
|
1285
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1286
|
+
* you may not use this file except in compliance with the License.
|
|
1287
|
+
* You may obtain a copy of the License at
|
|
1288
|
+
*
|
|
1289
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1290
|
+
*
|
|
1291
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1292
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1293
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1294
|
+
* See the License for the specific language governing permissions and
|
|
1295
|
+
* limitations under the License.
|
|
1296
|
+
*/async function qI(e,t={}){return _s(e,"GET","/v1/projects",t)}/**
|
|
1297
|
+
* @license
|
|
1298
|
+
* Copyright 2020 Google LLC
|
|
1299
|
+
*
|
|
1300
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1301
|
+
* you may not use this file except in compliance with the License.
|
|
1302
|
+
* You may obtain a copy of the License at
|
|
1303
|
+
*
|
|
1304
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1305
|
+
*
|
|
1306
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1307
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1308
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1309
|
+
* See the License for the specific language governing permissions and
|
|
1310
|
+
* limitations under the License.
|
|
1311
|
+
*/const KI=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,JI=/^https?/;async function YI(e){if(e.config.emulator)return;const{authorizedDomains:t}=await qI(e);for(const n of t)try{if(XI(n))return}catch{}$n(e,"unauthorized-domain")}function XI(e){const t=Ca(),{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(!JI.test(n))return!1;if(KI.test(e))return r===e;const s=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}/**
|
|
1312
|
+
* @license
|
|
1313
|
+
* Copyright 2020 Google LLC.
|
|
1314
|
+
*
|
|
1315
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1316
|
+
* you may not use this file except in compliance with the License.
|
|
1317
|
+
* You may obtain a copy of the License at
|
|
1318
|
+
*
|
|
1319
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1320
|
+
*
|
|
1321
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1322
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1323
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1324
|
+
* See the License for the specific language governing permissions and
|
|
1325
|
+
* limitations under the License.
|
|
1326
|
+
*/const QI=new fo(3e4,6e4);function hu(){const e=Nn().___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 ZI(e){return new Promise((t,n)=>{var s,o,i;function r(){hu(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{hu(),n(yn(e,"network-request-failed"))},timeout:QI.get()})}if((o=(s=Nn().gapi)==null?void 0:s.iframes)!=null&&o.Iframe)t(gapi.iframes.getContext());else if((i=Nn().gapi)!=null&&i.load)r();else{const a=oI("iframefcb");return Nn()[a]=()=>{gapi.load?r():n(yn(e,"network-request-failed"))},rI(`${sI()}?onload=${a}`).catch(l=>n(l))}}).catch(t=>{throw No=null,t})}let No=null;function eS(e){return No=No||ZI(e),No}/**
|
|
1327
|
+
* @license
|
|
1328
|
+
* Copyright 2020 Google LLC.
|
|
1329
|
+
*
|
|
1330
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1331
|
+
* you may not use this file except in compliance with the License.
|
|
1332
|
+
* You may obtain a copy of the License at
|
|
1333
|
+
*
|
|
1334
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1335
|
+
*
|
|
1336
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1337
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1338
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1339
|
+
* See the License for the specific language governing permissions and
|
|
1340
|
+
* limitations under the License.
|
|
1341
|
+
*/const tS=new fo(5e3,15e3),nS="__/auth/iframe",rS="emulator/auth/iframe",sS={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},oS=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function iS(e){const t=e.config;He(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?cl(t,rS):`https://${e.config.authDomain}/${nS}`,r={apiKey:t.apiKey,appName:e.name,v:uo},s=oS.get(e.config.apiHost);s&&(r.eid=s);const o=e._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${co(r).slice(1)}`}async function aS(e){const t=await eS(e),n=Nn().gapi;return He(n,e,"internal-error"),t.open({where:document.body,url:iS(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:sS,dontclear:!0},r=>new Promise(async(s,o)=>{await r.restyle({setHideOnLeave:!1});const i=yn(e,"network-request-failed"),a=Nn().setTimeout(()=>{o(i)},tS.get());function l(){Nn().clearTimeout(a),s(r)}r.ping(l).then(l,()=>{o(i)})}))}/**
|
|
1342
|
+
* @license
|
|
1343
|
+
* Copyright 2020 Google LLC.
|
|
1344
|
+
*
|
|
1345
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1346
|
+
* you may not use this file except in compliance with the License.
|
|
1347
|
+
* You may obtain a copy of the License at
|
|
1348
|
+
*
|
|
1349
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1350
|
+
*
|
|
1351
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1352
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1353
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1354
|
+
* See the License for the specific language governing permissions and
|
|
1355
|
+
* limitations under the License.
|
|
1356
|
+
*/const lS={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},cS=500,uS=600,dS="_blank",fS="http://localhost";class pu{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function hS(e,t,n,r=cS,s=uS){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={...lS,width:r.toString(),height:s.toString(),top:o,left:i},u=tn().toLowerCase();n&&(a=Mf(u)?dS:n),Pf(u)&&(t=t||fS,l.scrollbars="yes");const c=Object.entries(l).reduce((h,[_,L])=>`${h}${_}=${L},`,"");if(J1(u)&&a!=="_self")return pS(t||"",a),new pu(null);const f=window.open(t||"",a,c);He(f,e,"popup-blocked");try{f.focus()}catch{}return new pu(f)}function pS(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)}/**
|
|
1357
|
+
* @license
|
|
1358
|
+
* Copyright 2021 Google LLC
|
|
1359
|
+
*
|
|
1360
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1361
|
+
* you may not use this file except in compliance with the License.
|
|
1362
|
+
* You may obtain a copy of the License at
|
|
1363
|
+
*
|
|
1364
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1365
|
+
*
|
|
1366
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1367
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1368
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1369
|
+
* See the License for the specific language governing permissions and
|
|
1370
|
+
* limitations under the License.
|
|
1371
|
+
*/const mS="__/auth/handler",gS="emulator/auth/handler",vS=encodeURIComponent("fac");async function mu(e,t,n,r,s,o){He(e.config.authDomain,e,"auth-domain-config-required"),He(e.config.apiKey,e,"invalid-api-key");const i={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:uo,eventId:s};if(t instanceof pl){t.setDefaultLanguage(e.languageCode),i.providerId=t.providerId||"",mT(t.getCustomParameters())||(i.customParameters=JSON.stringify(t.getCustomParameters()));for(const[c,f]of Object.entries({}))i[c]=f}if(t instanceof ho){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(),u=l?`#${vS}=${encodeURIComponent(l)}`:"";return`${yS(e)}?${co(a).slice(1)}${u}`}function yS({config:e}){return e.emulator?cl(e,gS):`https://${e.authDomain}/${mS}`}/**
|
|
1372
|
+
* @license
|
|
1373
|
+
* Copyright 2020 Google LLC
|
|
1374
|
+
*
|
|
1375
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1376
|
+
* you may not use this file except in compliance with the License.
|
|
1377
|
+
* You may obtain a copy of the License at
|
|
1378
|
+
*
|
|
1379
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1380
|
+
*
|
|
1381
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1382
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1383
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1384
|
+
* See the License for the specific language governing permissions and
|
|
1385
|
+
* limitations under the License.
|
|
1386
|
+
*/const Ki="webStorageSupport";class wS{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Gf,this._completeRedirectFn=VI,this._overrideRedirectResult=FI}async _openPopup(t,n,r,s){var i;nr((i=this.eventManagers[t._key()])==null?void 0:i.manager,"_initialize() not called before _openPopup()");const o=await mu(t,n,r,Ca(),s);return hS(t,o,ml())}async _openRedirect(t,n,r,s){await this._originValidation(t);const o=await mu(t,n,r,Ca(),s);return kI(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):(nr(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 aS(t),r=new GI(t);return n.register("authEvent",s=>(He(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(Ki,{type:Ki},s=>{var i;const o=(i=s==null?void 0:s[0])==null?void 0:i[Ki];o!==void 0&&n(!!o),$n(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=YI(t)),this.originValidationPromises[n]}get _shouldInitProactively(){return Lf()||xf()||fl()}}const bS=wS;var gu="@firebase/auth",vu="1.12.1";/**
|
|
1387
|
+
* @license
|
|
1388
|
+
* Copyright 2020 Google LLC
|
|
1389
|
+
*
|
|
1390
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1391
|
+
* you may not use this file except in compliance with the License.
|
|
1392
|
+
* You may obtain a copy of the License at
|
|
1393
|
+
*
|
|
1394
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1395
|
+
*
|
|
1396
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1397
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1398
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1399
|
+
* See the License for the specific language governing permissions and
|
|
1400
|
+
* limitations under the License.
|
|
1401
|
+
*/class _S{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(){He(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
|
|
1402
|
+
* @license
|
|
1403
|
+
* Copyright 2020 Google LLC
|
|
1404
|
+
*
|
|
1405
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1406
|
+
* you may not use this file except in compliance with the License.
|
|
1407
|
+
* You may obtain a copy of the License at
|
|
1408
|
+
*
|
|
1409
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1410
|
+
*
|
|
1411
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1412
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1413
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1414
|
+
* See the License for the specific language governing permissions and
|
|
1415
|
+
* limitations under the License.
|
|
1416
|
+
*/function kS(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 TS(e){no(new vs("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;He(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:jf(e)},u=new tI(r,s,o,l);return aI(u,n),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,n,r)=>{t.getProvider("auth-internal").initialize()})),no(new vs("auth-internal",t=>{const n=pi(t.getProvider("auth").getImmediate());return(r=>new _S(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),cs(gu,vu,kS(e)),cs(gu,vu,"esm2020")}/**
|
|
1417
|
+
* @license
|
|
1418
|
+
* Copyright 2021 Google LLC
|
|
1419
|
+
*
|
|
1420
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1421
|
+
* you may not use this file except in compliance with the License.
|
|
1422
|
+
* You may obtain a copy of the License at
|
|
1423
|
+
*
|
|
1424
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1425
|
+
*
|
|
1426
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
1427
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1428
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1429
|
+
* See the License for the specific language governing permissions and
|
|
1430
|
+
* limitations under the License.
|
|
1431
|
+
*/const IS=300,SS=pf("authIdTokenMaxAge")||IS;let yu=null;const ES=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>SS)return;const s=n==null?void 0:n.token;yu!==s&&(yu=s,await fetch(e,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function CS(e=bf()){const t=yf(e,"auth");if(t.isInitialized())return t.getImmediate();const n=iI(e,{popupRedirectResolver:bS,persistence:[xI,wI,Gf]}),r=pf("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const i=ES(o.toString());gI(n,i,()=>i(n.currentUser)),mI(n,a=>i(a))}}const s=Z0("auth");return s&&lI(n,`http://${s}`),n}function AS(){var e;return((e=document.getElementsByTagName("head"))==null?void 0:e[0])??document}nI({loadJS(e){return new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=s=>{const o=yn("internal-error");o.customData=s,n(o)},r.type="text/javascript",r.charset="UTF-8",AS().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="});TS("Browser");const RS={apiKey:"AIzaSyAf0CIHBZ-wEQJ8CCUUWo1Wl9P7typ_ZPI",authDomain:"gptcall-416910.firebaseapp.com",projectId:"gptcall-416910",storageBucket:"gptcall-416910.appspot.com",messagingSenderId:"99275526699",appId:"1:99275526699:web:3b623e1e2996108b52106e"};function PS(e){const t=D(null),n=D(""),r=D(""),s=D(""),o=D({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}}),i=ie(()=>s.value==="pull"),a=ie(()=>s.value==="push"),l=ie(()=>s.value!=="");async function u(){try{const C=await fetch("/codex-api/skills-sync/status");if(!C.ok)return;const j=await C.json();j.data&&(o.value=j.data)}catch{}}async function c(){try{const C=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),j=await C.json();if(!C.ok||!j.data)throw new Error("Failed to start GitHub login");t.value=j.data;const Z=30,B=Math.max((j.data.interval??5)*1e3,3e3);let J=!1;for(let W=0;W<Z;W++){await new Promise(ve=>setTimeout(ve,B));const ae=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:j.data.device_code})}),le=await ae.json();if(!ae.ok)throw new Error(le.error||"Failed to complete GitHub login");if(le.ok){J=!0;break}if(!le.pending)throw new Error(le.error||"Failed to complete GitHub login")}if(!J)throw new Error("GitHub login timed out. Please retry.");t.value=null,await u(),e.showToast("GitHub login successful")}catch(C){e.showToast(C instanceof Error?C.message:"Failed GitHub login","error")}}async function f(){try{const C=v1().length>0?bf():wf(RS),j=CS(C),Z=new xn;Z.addScope("repo");const B=await DI(j,Z),J=xn.credentialFromResult(B),W=(J==null?void 0:J.accessToken)??"";if(!W)throw new Error("GitHub access token missing from Firebase login");const ae=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:W})}),le=await ae.json();if(!ae.ok||!le.ok)throw new Error(le.error||"Failed to login with GitHub token");await u(),e.showToast("GitHub login successful")}catch(C){const j=C instanceof Error?C.message:"Failed Firebase GitHub login";e.showToast(j,"error")}}async function h(){r.value="",n.value="pull-started",s.value="pull";try{const C=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),j=await C.json();if(!C.ok||!j.ok)throw new Error(j.error||"Failed to pull synced skills");await e.onPulled(),n.value="pull-success",e.showToast(o.value.loggedIn?"Pulled skills from private sync repo":"Pulled skills from upstream repo")}catch(C){const j=C instanceof Error?C.message:"Failed to pull sync";r.value=j,n.value="pull-failed",e.showToast(j,"error")}finally{s.value=""}}async function _(){r.value="",n.value="push-started",s.value="push";try{const C=await fetch("/codex-api/skills-sync/push",{method:"POST"}),j=await C.json();if(!C.ok||!j.ok)throw new Error(j.error||"Failed to push synced skills");n.value="push-success",e.showToast("Pushed skills to private sync repo")}catch(C){const j=C instanceof Error?C.message:"Failed to push sync";r.value=j,n.value="push-failed",e.showToast(j,"error")}finally{s.value=""}}async function L(){try{const C=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),j=await C.json();if(!C.ok||!j.ok)throw new Error(j.error||"Failed to logout GitHub");await u(),e.showToast("Logged out from GitHub")}catch(C){e.showToast(C instanceof Error?C.message:"Failed to logout GitHub","error")}}return{deviceLogin:t,isPullInFlight:i,isPushInFlight:a,isSyncActionInFlight:l,loadSyncStatus:u,logoutGithub:L,pullSkillsSync:h,pushSkillsSync:_,startGithubFirebaseLogin:f,startGithubLogin:c,syncActionError:r,syncActionStatus:n,syncStatus:o}}const xS={class:"skills-hub"},MS={class:"skills-sync-panel"},OS={class:"skills-sync-header"},NS={key:0,class:"skills-sync-badge"},$S={key:1,class:"skills-sync-badge"},DS={key:2,class:"skills-sync-badge"},LS={class:"skills-sync-meta"},jS={key:0,class:"skills-sync-error"},BS={key:1,class:"skills-sync-meta"},FS={key:2,class:"skills-sync-error"},US={key:3,class:"skills-sync-device"},HS=["href"],VS={class:"skills-sync-actions"},WS=["disabled"],GS=["disabled"],zS=["disabled"],qS={key:1,class:"skills-hub-section"},KS={class:"skills-hub-section-title"},JS={key:0,class:"skills-hub-grid"},YS={class:"skills-hub-toolbar"},XS={class:"skills-hub-search-wrap"},QS={key:0,class:"skills-hub-count"},ZS={class:"skills-hub-section"},eE={key:0,class:"skills-hub-loading"},tE={key:1,class:"skills-hub-error"},nE={key:0,class:"skills-hub-grid"},rE={key:1,class:"skills-hub-empty"},_o="codex-web-local.skills-hub.cache.v1",sE=Lt({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=D(null),s=D(""),o=D("date"),i=D([]),a=D([]),l=D(0),u=D(!1),c=D(""),f=D(!0),h=D(!1),_=D(n),L=D(null),C=D(""),j=D(!1),Z=D(!1);let B=null,J=null;const W=t,ae=ie(()=>o.value==="date"?"Newest":"A-Z"),le=ie(()=>{var x;return((x=L.value)==null?void 0:x.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),ve=ie(()=>`${_.value.owner}/${_.value.name}`),ke=ie(()=>j.value&&C.value===ve.value),ne=ie(()=>Z.value&&C.value===ve.value),q=ie(()=>{const x=s.value.toLowerCase().trim();return x?a.value.filter(H=>H.name.toLowerCase().includes(x)||H.owner.toLowerCase().includes(x)||(H.displayName??"").toLowerCase().includes(x)):a.value});function oe(x,H="success"){L.value={text:x,type:H},J&&clearTimeout(J),J=setTimeout(()=>{L.value=null},3e3)}function Q(){o.value=o.value==="date"?"name":"date",Re(s.value)}function Ie(x){return`${o.value}::${x.trim().toLowerCase()}`}function Ce(x){var H;if(typeof window>"u")return null;try{const F=window.localStorage.getItem(_o);return F?((H=JSON.parse(F).byKey)==null?void 0:H[x])??null:null}catch{return null}}function Le(x,H){if(!(typeof window>"u"))try{const F=window.localStorage.getItem(_o),G=(F?JSON.parse(F):{}).byKey??{};G[x]=H,window.localStorage.setItem(_o,JSON.stringify({byKey:G}))}catch{}}function Ae(){if(!(typeof window>"u"))try{window.localStorage.removeItem(_o)}catch{}}function _e(x){const H=x.installed??[];a.value=H;const F=new Set(H.map(K=>K.name));i.value=x.data.map(K=>{if(K.installed||F.has(K.name)){const G=H.find(we=>we.name===K.name);return{...K,installed:!0,path:(G==null?void 0:G.path)??K.path,enabled:(G==null?void 0:G.enabled)??K.enabled}}return K}).filter(K=>!K.installed),l.value=x.total}async function Re(x){const H=Ie(x),F=Ce(H);F&&_e(F),u.value=!F,c.value="";try{const K=new URLSearchParams;x.trim()&&K.set("q",x.trim()),K.set("limit","100"),K.set("sort",o.value);const G=await fetch(`/codex-api/skills-hub?${K}`);if(!G.ok)throw new Error(`HTTP ${G.status}`);const we=await G.json();_e(we),Le(H,we)}catch(K){c.value=K instanceof Error?K.message:"Failed to load skills"}finally{u.value=!1}}function ct(){B&&clearTimeout(B),B=setTimeout(()=>Re(s.value),300)}function We(x){_.value=x,h.value=!0}async function Ge(x){C.value=`${x.owner}/${x.name}`,j.value=!0;try{const F=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:x.owner,name:x.name})})).json();if(!F.ok)throw new Error(F.error||"Install failed");const K={...x,installed:!0,path:F.path,enabled:!0};a.value=[...a.value,K],i.value=i.value.filter(G=>G.name!==x.name),_.value=K,oe(`${x.displayName||x.name} skill installed`),h.value=!1,Ae(),W("skills-changed")}catch(H){oe(H instanceof Error?H.message:"Failed to install skill","error")}finally{j.value=!1}}async function Ye(x){C.value=`${x.owner}/${x.name}`,Z.value=!0;try{const F=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:x.name,path:x.path})})).json();if(!F.ok)throw new Error(F.error||"Uninstall failed");a.value=a.value.filter(K=>K.name!==x.name),x.owner!=="local"&&(i.value=[...i.value,{...x,installed:!1,path:void 0,enabled:void 0}]),oe(`${x.displayName||x.name} skill uninstalled`),h.value=!1,Ae(),W("skills-changed")}catch(H){oe(H instanceof Error?H.message:"Failed to uninstall skill","error")}finally{Z.value=!1}}async function st(x,H){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:x.path,enabled:H}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),oe(`${x.displayName||x.name} skill ${H?"enabled":"disabled"}`),await Re(s.value)}catch(F){oe(F instanceof Error?F.message:"Failed to update skill","error")}}const{deviceLogin:nt,isPullInFlight:Fe,isPushInFlight:tt,isSyncActionInFlight:z,loadSyncStatus:fe,logoutGithub:ce,pullSkillsSync:he,pushSkillsSync:$e,startGithubFirebaseLogin:v,startGithubLogin:y,syncActionError:R,syncActionStatus:V,syncStatus:U}=PS({showToast:oe,onPulled:async()=>{await Re(s.value),W("skills-changed")}});return sr(()=>{Re(""),fe()}),(x,H)=>(w(),T("div",xS,[H[11]||(H[11]=p("div",{class:"skills-hub-header"},[p("h2",{class:"skills-hub-title"},"Skills Hub"),p("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),p("div",MS,[p("div",OS,[H[8]||(H[8]=p("strong",null,"Skills Sync (GitHub)",-1)),ge(U).configured?(w(),T("span",NS,"Connected: "+se(ge(U).repoOwner)+"/"+se(ge(U).repoName),1)):ge(U).loggedIn?(w(),T("span",$S,"Logged in as "+se(ge(U).githubUsername),1)):(w(),T("span",DS,"Not connected"))]),p("div",LS,[p("span",null,"Startup: "+se(ge(U).startup.mode),1),p("span",null,"Branch: "+se(ge(U).startup.branch),1),p("span",null,"Action: "+se(ge(U).startup.lastAction),1)]),ge(U).startup.lastError?(w(),T("div",jS,se(ge(U).startup.lastError),1)):re("",!0),ge(V)?(w(),T("div",BS,[p("span",null,"Manual sync: "+se(ge(V)),1)])):re("",!0),ge(R)?(w(),T("div",FS,se(ge(R)),1)):re("",!0),ge(nt)?(w(),T("div",US,[p("span",null,[H[9]||(H[9]=Xs("Open ",-1)),p("a",{href:ge(nt).verification_uri,target:"_blank",rel:"noreferrer"},"GitHub device login",8,HS),H[10]||(H[10]=Xs(" and enter code:",-1))]),p("code",null,se(ge(nt).user_code),1)])):re("",!0),p("div",VS,[ge(U).loggedIn?re("",!0):(w(),T("button",{key:0,class:"skills-hub-sort",type:"button",onClick:H[0]||(H[0]=(...F)=>ge(v)&&ge(v)(...F))},"Login with GitHub")),ge(U).loggedIn?re("",!0):(w(),T("button",{key:1,class:"skills-hub-sort",type:"button",onClick:H[1]||(H[1]=(...F)=>ge(y)&&ge(y)(...F))},"Device Login")),ge(U).loggedIn?(w(),T("button",{key:2,class:"skills-hub-sort",type:"button",onClick:H[2]||(H[2]=(...F)=>ge(ce)&&ge(ce)(...F)),disabled:ge(z)},"Logout GitHub",8,WS)):re("",!0),p("button",{class:"skills-hub-sort",type:"button",onClick:H[3]||(H[3]=(...F)=>ge(he)&&ge(he)(...F)),disabled:ge(z)},se(ge(Fe)?"Pulling...":"Pull"),9,GS),ge(U).loggedIn?(w(),T("button",{key:3,class:"skills-hub-sort",type:"button",onClick:H[4]||(H[4]=(...F)=>ge($e)&&ge($e)(...F)),disabled:!ge(U).configured||ge(z)},se(ge(tt)?"Pushing...":"Push"),9,zS)):re("",!0)])]),L.value?(w(),T("div",{key:0,class:at(["skills-hub-toast",le.value])},se(L.value.text),3)):re("",!0),q.value.length>0?(w(),T("div",qS,[p("button",{class:"skills-hub-section-toggle",type:"button",onClick:H[5]||(H[5]=F=>f.value=!f.value)},[p("span",KS,"Installed ("+se(q.value.length)+")",1),Ee(sf,{class:at(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(w(),T("div",JS,[(w(!0),T(je,null,Ct(q.value,F=>(w(),ft(Wc,{key:F.name,skill:F,onSelect:K=>We(K)},null,8,["skill","onSelect"]))),128))])):re("",!0)])):re("",!0),p("div",YS,[p("div",XS,[Ee(_a,{class:"skills-hub-search-icon"}),Zn(p("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":H[6]||(H[6]=F=>s.value=F),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:ct},null,544),[[er,s.value]]),l.value>0?(w(),T("span",QS,se(l.value)+" skills",1)):re("",!0)]),p("button",{class:"skills-hub-sort",type:"button",onClick:Q},se(ae.value),1)]),p("div",ZS,[u.value?(w(),T("div",eE,"Loading skills...")):c.value?(w(),T("div",tE,se(c.value),1)):(w(),T(je,{key:2},[i.value.length>0?(w(),T("div",nE,[(w(!0),T(je,null,Ct(i.value,F=>(w(),ft(Wc,{key:F.url,skill:F,onSelect:K=>We(K)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(w(),T("div",rE,'No skills found for "'+se(s.value)+'"',1)):re("",!0)],64))]),Ee(W0,{skill:_.value,visible:h.value,"is-installing":ke.value,"is-uninstalling":ne.value,onClose:H[7]||(H[7]=F=>h.value=!1),onInstall:Ge,onUninstall:Ye,onToggleEnabled:st},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),oE=rt(sE,[["__scopeId","data-v-2f6920be"]]),iE={},aE={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 lE(e,t){return w(),T("svg",aE,[...t[0]||(t[0]=[p("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),p("path",{d:"M9 4l0 16"},null,-1)])])}const cE=rt(iE,[["render",lE]]),uE={},dE={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function fE(e,t){return w(),T("svg",dE,[...t[0]||(t[0]=[p("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 hE=rt(uE,[["render",fE]]),pE={class:"sidebar-thread-controls"},mE=["aria-label","title"],gE=Lt({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(w(),T("div",pE,[p("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?(w(),ft(hE,{key:0,class:"sidebar-thread-controls-icon"})):(w(),ft(cE,{key:1,class:"sidebar-thread-controls-icon"}))],8,mE),Mn(t.$slots,"default",{},void 0),e.showNewThreadButton?(w(),T("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[1]||(n[1]=r=>t.$emit("start-new-thread"))},[Ee(Vo,{class:"sidebar-thread-controls-icon"})])):re("",!0)]))}}),wu=rt(gE,[["__scopeId","data-v-46a10052"]]),vE={},yE={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function wE(e,t){return w(),T("svg",yE,[...t[0]||(t[0]=[p("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[p("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"}),p("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const bE=rt(vE,[["render",wE]]);function vr(e){return e.flatMap(t=>t.threads)}const Zf="codex-web-local.thread-read-state.v1",eh="codex-web-local.thread-scroll-state.v1",Pa="codex-web-local.selected-thread-id.v1",th="codex-web-local.project-order.v1",nh="codex-web-local.project-display-name.v1",Ji=220,bu=["none","minimal","low","medium","high","xhigh"],Os="__global__",un="gpt-5.2-codex";function _E(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Zf);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function _u(e){typeof window>"u"||window.localStorage.setItem(Zf,JSON.stringify(e))}function rh(e,t,n){return Math.min(Math.max(e,t),n)}function kE(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=rh(t.scrollRatio,0,1)),n}function TE(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(eh);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=kE(s);o&&(n[r]=o)}return n}catch{return{}}}function ku(e){typeof window>"u"||window.localStorage.setItem(eh,JSON.stringify(e))}function IE(){return typeof window>"u"?"":window.localStorage.getItem(Pa)??""}function SE(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Pa);return}window.localStorage.setItem(Pa,e)}}function EE(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(th);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 es(e){typeof window>"u"||window.localStorage.setItem(th,JSON.stringify(e))}function CE(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(nh);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 Yi(e){typeof window>"u"||window.localStorage.setItem(nh,JSON.stringify(e))}function ko(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 jr(e,n)?e:n}function Xi(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 jr(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 AE(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 RE(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function To(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 xa(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&jr(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&RE(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function Yo(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 PE(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&&xa(f,c)?f:c});if(n.preserveMissing!==!0)return Yo(e,o)?e:o;const i=e.map(c=>{const f=s.get(c.id);return!f||xa(c,f)?c:f}),a=new Set(e.map(c=>c.id)),l=o.filter(c=>!a.has(c.id)),u=[...i,...l];return Yo(e,u)?e:u}function Ma(e){return e.replace(/\s+/gu," ").trim()}function xE(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>Ma(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=Ma(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function Tu(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(xa(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const sh="worked";function hr(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function ME(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 OE(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function NE(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 $E(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${ME(e.durationMs)}`,messageType:sh}}function DE(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function LE(e,t){const n=$E(t),r=e.filter(i=>i.messageType!==sh),s=DE(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function Ft(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function jE(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 BE(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 FE(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 Wt(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function Io(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 u=i.get(l.id);return u&&jE(u,l)?u:l});return o&&o.projectName===s.projectName&&BE(o.threads,a)?o:{projectName:s.projectName,threads:a}});return FE(e,r)?e:r}function UE(e,t,n){const r=new Set(vr(t).map(a=>a.id)),s=vr(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 u=i.findIndex(c=>c.projectName===a.projectName);u>=0&&(i[u]={projectName:i[u].projectName,threads:[a,...i[u].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function HE(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Qi(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function VE(e){const t=e.split(`
|
|
1432
|
+
`).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function WE(){const e=D([]),t=D([]),n=D(IE()),r=D({}),s=D({}),o=D({}),i=D({}),a=D({}),l=D({}),u=D({}),c=D([]),f=D(""),h=D("medium"),_=D(_E()),L=D(TE()),C=D(EE()),j=D(CE()),Z=D({}),B=D({}),J=D({}),W=D({}),ae=D({}),le=D({}),ve=D({}),ke=D({}),ne=D({}),q=D({}),oe=D([]),Q=D(!1),Ie=D(!1),Ce=D(!1),Le=D(!1),Ae=D(!1),_e=D(""),Re=D(!1),ct=D(!1);let We=null,Ge=null,Ye=!1;const st=new Set;let nt=!1,Fe=!1;const tt=new Map,z=new Set,fe=ie(()=>vr(e.value)),ce=ie(()=>fe.value.find(d=>d.id===n.value)??null),he=ie(()=>L.value[n.value]??null),$e=ie(()=>{const d=[],m=n.value;return m&&Array.isArray(ke.value[m])&&d.push(...ke.value[m]),Array.isArray(ke.value[Os])&&d.push(...ke.value[Os]),d.sort((b,A)=>b.receivedAtIso.localeCompare(A.receivedAtIso))}),v=ie(()=>{var ee;const d=n.value;if(!d)return null;const m=ae.value[d],b=(o.value[d]??"").trim(),A=(((ee=le.value[d])==null?void 0:ee.message)??"").trim();return!m&&!b&&!A?null:{activityLabel:(m==null?void 0:m.label)||"Thinking",activityDetails:(m==null?void 0:m.details)??[],reasoningText:b,errorText:A}}),y=ie(()=>{const d=n.value;if(!d)return[];const m=r.value[d]??[],b=s.value[d]??[],A=i.value[d]??[],ee=[...m,...A,...b],X=W.value[d];return X?LE(ee,X):ee});function R(d){n.value!==d&&(n.value=d,SE(d),Fe=!1)}function V(d){f.value=d.trim()}async function U(){f.value=un,c.value.includes(un)||(c.value=[...c.value,un]);try{await a_(un)}catch{}}function x(d,m){ne.value={...ne.value,[d]:m}}function H(d){ne.value[d]&&(ne.value=Ft(ne.value,d))}async function F(d){if(z.has(d))return;const m=ne.value[d];if(!(!m||m.fallbackRetried)){z.add(d),x(d,{...m,fallbackRetried:!0});try{await U();try{const b=await jc(d,1);mt(d,b),Tt(d,[]),Ht(d),i.value[d]&&(i.value=Ft(i.value,d))}catch{}Ze(d,null),_e.value="",Ve(d,null),Xe(d,{label:"Thinking",details:G(un,m.effort)}),De(d,!0),J.value[d]!==!0&&await Bi(d),await Fi(d,m.text,m.imageUrls,un,m.effort||void 0,m.skills.length>0?m.skills:void 0,m.fileAttachments),J.value={...J.value,[d]:!0},st.add(d),Ye=!0,await te()}catch(b){const A=b instanceof Error?b.message:"Unknown application error";Ze(d,A),_e.value=A,De(d,!1),Xe(d,null)}finally{z.delete(d)}}}function K(d){d&&!bu.includes(d)||(h.value=d)}function G(d,m){const b=d.trim()||"default",A=m||"default";return[`Model: ${b}`,`Thinking: ${A}`]}async function we(){try{const[d,m]=await Promise.all([l_(),c_()]);c.value=d,f.value.length>0&&d.includes(f.value)||(m.model&&d.includes(m.model)?f.value=m.model:d.length>0?f.value=d[0]:f.value=""),m.reasoningEffort&&bu.includes(m.reasoningEffort)&&(h.value=m.reasoningEffort)}catch{}}function ue(d){const m=q.value;return Object.keys(m).length===0?d:d.map(b=>({projectName:b.projectName,threads:b.threads.map(A=>{const ee=m[A.id];return ee?{...A,title:ee}:A})}))}function me(){const m=ue(t.value).map(b=>({projectName:b.projectName,threads:b.threads.map(A=>{const ee=a.value[A.id]===!0,X=n.value===A.id,be=_.value[A.id],Me=u.value[A.id]===!0,ye=!X&&!ee&&(Me||be!==A.updatedAtIso);return{...A,inProgress:ee,unread:ye}})}));e.value=Io(e.value,m)}function Te(d,m,b){const A=new Date().toISOString(),ee=m.trim(),X=HE(ee),be={id:d,title:VE(b),projectName:X,cwd:ee,hasWorktree:ee.includes("/.codex/worktrees/")||ee.includes("/.git/worktrees/"),createdAtIso:A,updatedAtIso:A,preview:b,unread:!1,inProgress:!1},Me=t.value.findIndex(ot=>ot.projectName===X);if(Me>=0){const Et=t.value[Me].threads.filter(cr=>cr.id!==d),Qr={projectName:X,threads:[be,...Et]},Bn=[...t.value];Bn.splice(Me,1,Qr),t.value=Bn}else t.value=[{projectName:X,threads:[be]},...t.value];const ye=ko(C.value,t.value);jr(C.value,ye)||(C.value=ye,es(C.value)),me()}function Oe(d){const m=new Set(d.map(X=>X.id)),b=Wt(_.value,m);b!==_.value&&(_.value=b,_u(b));const A=Wt(L.value,m);A!==L.value&&(L.value=A,ku(A)),B.value=Wt(B.value,m),Z.value=Wt(Z.value,m),J.value=Wt(J.value,m),r.value=Wt(r.value,m),s.value=Wt(s.value,m),o.value=Wt(o.value,m),i.value=Wt(i.value,m),W.value=Wt(W.value,m),ae.value=Wt(ae.value,m),le.value=Wt(le.value,m),ve.value=Wt(ve.value,m),u.value=Wt(u.value,m),a.value=Wt(a.value,m);const ee={};for(const[X,be]of Object.entries(ke.value))(X===Os||m.has(X))&&(ee[X]=be);ke.value=ee}function ze(d){const m=vr(t.value).find(b=>b.id===d);m&&(_.value={..._.value,[d]:m.updatedAtIso},_u(_.value),u.value[d]&&(u.value=Ft(u.value,d)),me())}function Ve(d,m){if(!d)return;const b=W.value[d];if(m){if(OE(b,m))return;W.value={...W.value,[d]:m}}else b&&(W.value=Ft(W.value,d))}function De(d,m){!d||a.value[d]===!0===m||(m?a.value={...a.value,[d]:!0}:a.value=Ft(a.value,d),me())}function pt(d){d&&d!==n.value&&u.value[d]!==!0&&(u.value={...u.value,[d]:!0},me())}function Xe(d,m){if(!d)return;const b=ae.value[d];if(!m){b&&(ae.value=Ft(ae.value,d));return}const A=g(m.label)||"Thinking",ee=m.details.map(Me=>g(Me)).filter(Me=>Me.length>0&&Me!==A),X=Array.from(new Set([...(b==null?void 0:b.details)??[],...ee])).slice(-3),be={label:A,details:X};NE(b,be)||(ae.value={...ae.value,[d]:be})}function Ze(d,m){if(!d)return;const b=le.value[d],A=m?Ma(m):"";if(!A){b&&(le.value=Ft(le.value,d));return}(b==null?void 0:b.message)!==A&&(le.value={...le.value,[d]:{message:A}})}function jt(d){const m=vr(t.value).find(b=>b.id===d);return(m==null?void 0:m.updatedAtIso)??""}function Bt(d,m){if(!d)return;const b={scrollTop:Math.max(0,m.scrollTop),isAtBottom:m.isAtBottom===!0};typeof m.scrollRatio=="number"&&Number.isFinite(m.scrollRatio)&&(b.scrollRatio=rh(m.scrollRatio,0,1));const A=L.value[d];A&&A.scrollTop===b.scrollTop&&A.isAtBottom===b.isAtBottom&&A.scrollRatio===b.scrollRatio||(L.value={...L.value,[d]:b},ku(L.value))}function mt(d,m){const b=r.value[d]??[];Yo(b,m)||(r.value={...r.value,[d]:m})}function Tt(d,m){const b=s.value[d]??[];Yo(b,m)||(s.value={...s.value,[d]:m})}function $t(d,m){const b=s.value[d]??[],A=Tu(b,m);Tt(d,A)}function It(d,m){if(!d)return;const b=m.trim(),A=o.value[d]??"";if(b.length===0){if(!A)return;o.value=Ft(o.value,d);return}A!==b&&(o.value={...o.value,[d]:b})}function Dn(d,m){if(!d)return;const b=o.value[d]??"";It(d,`${b}${m}`)}function Ht(d){d&&d in o.value&&(o.value=Ft(o.value,d))}function xe(d){return d!==null&&typeof d=="object"&&!Array.isArray(d)?d:null}function Pe(d){return typeof d=="string"?d:""}function nn(d){return typeof d=="number"&&Number.isFinite(d)?d:null}function xt(d){const m=xe(d.params);if(!m)return"";const b=Pe(m.threadId);if(b)return b;const A=Pe(m.thread_id);if(A)return A;const ee=Pe(m.conversationId);if(ee)return ee;const X=Pe(m.conversation_id);if(X)return X;const be=xe(m.thread),Me=Pe(be==null?void 0:be.id);if(Me)return Me;const ye=xe(m.turn),ot=Pe(ye==null?void 0:ye.threadId);if(ot)return ot;const Et=Pe(ye==null?void 0:ye.thread_id);return Et||""}function Tn(d){if(d.method!=="turn/completed")return"";const m=xe(d.params),b=xe(m==null?void 0:m.turn);if(!b||b.status!=="failed")return"";const A=xe(b.error);return Pe(A==null?void 0:A.message)}function ln(d){var b;if(d.method!=="error")return"";const m=xe(d.params);return Pe(m==null?void 0:m.message)||Pe((b=xe(m==null?void 0:m.error))==null?void 0:b.message)}function hn(d){const m=xe(d);if(!m)return null;const b=m.id,A=Pe(m.method),ee=m.params;if(typeof b!="number"||!Number.isInteger(b)||!A)return null;const X=xe(ee),be=Pe(X==null?void 0:X.threadId)||Os,Me=Pe(X==null?void 0:X.turnId),ye=Pe(X==null?void 0:X.itemId),ot=Pe(m.receivedAtIso)||new Date().toISOString();return{id:b,method:A,threadId:be,turnId:Me,itemId:ye,receivedAtIso:ot,params:ee??null}}function k(d){const m=d.threadId||Os,b=ke.value[m]??[],A=b.findIndex(X=>X.id===d.id),ee=[...b];A>=0?ee.splice(A,1,d):ee.push(d),ke.value={...ke.value,[m]:ee.sort((X,be)=>X.receivedAtIso.localeCompare(be.receivedAtIso))}}function S(d){const m={};for(const[b,A]of Object.entries(ke.value)){const ee=A.filter(X=>X.id!==d);ee.length>0&&(m[b]=ee)}ke.value=m}function E(d){if(d.method==="server/request"){const m=hn(d.params);return m&&k(m),!0}if(d.method==="server/request/resolved"){const m=xe(d.params),b=m==null?void 0:m.id;return typeof b=="number"&&Number.isInteger(b)&&S(b),!0}return!1}function g(d){return d.replace(/\s+/gu," ").trim()}function M(d){const m=xt(d);if(!m)return null;if(d.method==="turn/started")return{threadId:m,activity:{label:"Thinking",details:[]}};if(d.method==="item/started"){const b=xe(d.params),A=xe(b==null?void 0:b.item),ee=Pe(A==null?void 0:A.type).toLowerCase();if(ee==="reasoning")return{threadId:m,activity:{label:"Thinking",details:[]}};if(ee==="agentmessage")return{threadId:m,activity:{label:"Writing response",details:[]}};if(ee==="commandexecution"){const X=Pe(A==null?void 0:A.command);return{threadId:m,activity:{label:"Running command",details:X?[X]:[]}}}}return d.method==="item/commandExecution/outputDelta"?{threadId:m,activity:{label:"Running command",details:[]}}:d.method==="item/reasoning/summaryTextDelta"||d.method==="item/reasoning/summaryPartAdded"?{threadId:m,activity:{label:"Thinking",details:[]}}:d.method==="item/agentMessage/delta"?{threadId:m,activity:{label:"Writing response",details:[]}}:null}function O(d){if(d.method!=="turn/started")return null;const m=xe(d.params);if(!m)return null;const b=xt(d);if(!b)return null;const A=xe(m.turn),ee=Pe(A==null?void 0:A.id)||Pe(m.turnId)||`${b}:unknown`;if(!ee)return null;const X=hr(Pe(A==null?void 0:A.startedAt))??hr(Pe(m.startedAt))??hr(d.atIso)??Date.now();return{threadId:b,turnId:ee,startedAtMs:X}}function de(d){if(d.method!=="turn/completed")return null;const m=xe(d.params);if(!m)return null;const b=xt(d);if(!b)return null;const A=xe(m.turn),ee=Pe(A==null?void 0:A.id)||Pe(m.turnId)||`${b}:unknown`;if(!ee)return null;const X=hr(Pe(A==null?void 0:A.completedAt))??hr(Pe(m.completedAt))??hr(d.atIso)??Date.now(),be=hr(Pe(A==null?void 0:A.startedAt))??hr(Pe(m.startedAt))??void 0;return{threadId:b,turnId:ee,completedAtMs:X,startedAtMs:be}}function pe(d){return`${d}:live-reasoning`}function Ne(d){const m=xe(d.params);if(!m)return"";if(d.method==="item/started"){const b=xe(m.item);return!b||b.type!=="reasoning"?"":Pe(b.id)}return""}function Ke(d){const m=xe(d.params);if(!m)return null;if(d.method==="item/reasoning/summaryTextDelta"){const b=Pe(m.itemId),A=Pe(m.delta);return!b||!A?null:{messageId:pe(b),delta:A}}return null}function Je(d){const m=xe(d.params);if(!m)return"";if(d.method==="item/reasoning/summaryPartAdded"){const b=Pe(m.itemId);return b?pe(b):""}return""}function St(d){const m=xe(d.params);if(!m)return"";if(d.method==="item/completed"){const b=xe(m.item);return!b||b.type!=="reasoning"?"":pe(Pe(b.id))}return""}function At(d){const m=xe(d.params);if(!m)return"";if(d.method==="item/started"){const b=xe(m.item);return!b||b.type!=="agentMessage"?"":Pe(b.id)}return""}function In(d){const m=xe(d.params);if(!m)return null;if(d.method==="item/agentMessage/delta"){const b=Pe(m.itemId),A=Pe(m.delta);return!b||!A?null:{messageId:b,delta:A}}return null}function pn(d){const m=xe(d.params);if(!m)return null;if(d.method==="item/completed"){const b=xe(m.item);if(!b||b.type!=="agentMessage")return null;const A=Pe(b.id),ee=Pe(b.text);return!A||!ee?null:{id:A,role:"assistant",text:ee,messageType:"agentMessage.live"}}return null}function zr(d){if(d.method!=="item/started")return null;const m=xe(d.params),b=xe(m==null?void 0:m.item);if(!b||b.type!=="commandExecution")return null;const A=Pe(b.id),ee=Pe(b.command);if(!A)return null;const X=typeof b.cwd=="string"?b.cwd:null;return{id:A,role:"system",text:ee,messageType:"commandExecution",commandExecution:{command:ee,cwd:X,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function qr(d){if(d.method!=="item/commandExecution/outputDelta")return null;const m=xe(d.params);if(!m)return null;const b=Pe(m.itemId),A=Pe(m.delta);return!b||!A?null:{itemId:b,delta:A}}function Kr(d){if(d.method!=="item/completed")return null;const m=xe(d.params),b=xe(m==null?void 0:m.item);if(!b||b.type!=="commandExecution")return null;const A=Pe(b.id),ee=Pe(b.command);if(!A)return null;const X=typeof b.cwd=="string"?b.cwd:null,be=Pe(b.status),Me=be==="failed"?"failed":be==="declined"?"declined":be==="interrupted"?"interrupted":"completed",ye=typeof b.aggregatedOutput=="string"?b.aggregatedOutput:"",ot=typeof b.exitCode=="number"?b.exitCode:null;return{id:A,role:"system",text:ee,messageType:"commandExecution",commandExecution:{command:ee,cwd:X,status:Me,aggregatedOutput:ye,exitCode:ot}}}function ir(d,m){const b=i.value[d]??[],A=Tu(b,m);A!==b&&(i.value={...i.value,[d]:A})}function ar(d,m){const b=i.value[d];if(!b||b.length===0)return;const A=new Set(m.map(X=>X.id)),ee=b.filter(X=>!A.has(X.id));ee.length!==b.length&&(ee.length===0?i.value=Ft(i.value,d):i.value={...i.value,[d]:ee})}function ks(d){if(d.method==="item/agentMessage/delta")return!0;const m=xe(d.params);if(!m)return!1;if(d.method==="item/completed"){const b=xe(m.item);return(b==null?void 0:b.type)==="agentMessage"}return!1}function Ln(d){var yl,wl,bl,_l;if(E(d))return;if(d.method==="thread/name/updated"){const Qe=xe(d.params),Sn=Pe(Qe==null?void 0:Qe.threadId),Rr=Pe(Qe==null?void 0:Qe.threadName);Sn&&Rr&&(q.value={...q.value,[Sn]:Rr},me(),Ui(Sn,Rr))}const m=M(d);m&&Xe(m.threadId,m.activity);const b=O(d);b&&(tt.set(b.turnId,b),ve.value={...ve.value,[b.threadId]:b.turnId},Ve(b.threadId,null),Ze(b.threadId,null),De(b.threadId,!0),u.value[b.threadId]&&(u.value=Ft(u.value,b.threadId)));const A=de(d),ee=Tn(d),be=!!((A==null?void 0:A.threadId)??xt(d))&&!!ee&&f.value!==un&&To(new Error(ee));if(A){const Qe=tt.get(A.turnId);Qe&&tt.delete(A.turnId);const Sn=nn((yl=xe(d.params))==null?void 0:yl.durationMs)??nn((bl=xe((wl=xe(d.params))==null?void 0:wl.turn))==null?void 0:bl.durationMs)??(typeof A.startedAtMs=="number"?A.completedAtMs-A.startedAtMs:null)??(Qe?A.completedAtMs-Qe.startedAtMs:null),Rr=typeof Sn=="number"?Math.max(0,Sn):0;Ve(A.threadId,{turnId:A.turnId,durationMs:Rr}),ve.value[A.threadId]&&(ve.value=Ft(ve.value,A.threadId)),De(A.threadId,!1),Xe(A.threadId,null),pt(A.threadId),be||(H(A.threadId),Vt(A.threadId))}if(ee){const Qe=(A==null?void 0:A.threadId)||xt(d);Qe&&Ze(Qe,ee),_e.value=ee,Qe&&be&&F(Qe)}else A&&Ze(A.threadId,null);const Me=ln(d);if(Me){const Qe=xt(d);Qe&&Ze(Qe,Me),_e.value=Me,f.value!==un&&To(new Error(Me))&&(Qe?F(Qe):U())}const ye=xt(d);if(!ye||ye!==n.value)return;At(d);const ot=In(d);if(ot){const Qe=(s.value[ye]??[]).find(Rr=>Rr.id===ot.messageId),Sn=`${(Qe==null?void 0:Qe.text)??""}${ot.delta}`;$t(ye,{id:ot.messageId,role:"assistant",text:Sn,messageType:"agentMessage.live"})}const Et=pn(d);Et&&$t(ye,Et),Ne(d);const Qr=Ke(d);if(Qr&&Dn(ye,Qr.delta),Je(d)){const Qe=o.value[ye]??"";Qe.trim().length>0&&!Qe.endsWith(`
|
|
1433
|
+
|
|
1434
|
+
`)&&It(ye,`${Qe}
|
|
1435
|
+
|
|
1436
|
+
`)}St(d);const cr=zr(d);cr&&(ir(ye,cr),Xe(ye,{label:"Running command",details:[((_l=cr.commandExecution)==null?void 0:_l.command)??""]}));const wi=qr(d);if(wi){const Qe=(i.value[ye]??[]).find(Sn=>Sn.id===wi.itemId);Qe!=null&&Qe.commandExecution&&ir(ye,{...Qe,commandExecution:{...Qe.commandExecution,aggregatedOutput:`${Qe.commandExecution.aggregatedOutput}${wi.delta}`}})}const vl=Kr(d);if(vl&&ir(ye,vl),ks(d)&&(Fe&&n.value&&Bt(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),Ht(ye)),d.method==="turn/completed"){Fe=!1,Ht(ye),i.value[ye]&&(i.value=Ft(i.value,ye));const Qe=xt(d);Qe&&(De(Qe,!1),Xe(Qe,null),pt(Qe),be||(H(Qe),Vt(Qe)))}}function Jr(d){const m=xt(d);m&&st.add(m);const b=d.method;(b.startsWith("thread/")||b.startsWith("turn/")||b.startsWith("item/"))&&(Ye=!0),!(Ge!==null||typeof window>"u")&&(Ge=window.setTimeout(()=>{Ge=null,te()},Ji))}async function Ts(d){if(!nt){nt=!0;try{const m=await wa(),b=[];for(const A of m.order){const ee=Qi(A);b.includes(ee)||b.push(ee)}if(b.length>0){const A=ko(b,d);jr(C.value,A)||(C.value=A,es(C.value))}if(Object.keys(m.labels).length>0){const A={...j.value};let ee=!1;for(const[X,be]of Object.entries(m.labels)){const Me=Qi(X);A[Me]!==be&&(A[Me]=be,ee=!0)}ee&&(j.value=A,Yi(A))}}catch{}}}async function Is(){if(!(Object.keys(q.value).length>0))try{const d=await v_();Object.keys(d.titles).length>0&&(q.value=d.titles)}catch{}}async function Cr(d,m,b){if(q.value[d])return;const A=m.trim();if(!A)return;const ee=A.length>300?A.slice(0,300):A;try{const X=await y_(ee,b);if(!X||q.value[d])return;q.value={...q.value,[d]:X},me(),Ui(d,X)}catch{}}async function Ar(){var d;ct.value||(Q.value=!0);try{const[m]=await Promise.all([Xb(),Is()]);await Ts(m);const b=ko(C.value,m);jr(C.value,b)||(C.value=b,es(C.value));const A=Xi(m,C.value),ee=UE(t.value,A,a.value);t.value=Io(t.value,ee),a.value=Wt(a.value,new Set(vr(t.value).map(Me=>Me.id))),me(),ct.value=!0;const X=vr(e.value);Oe(X),X.some(Me=>Me.id===n.value)||R(((d=X[0])==null?void 0:d.id)??"")}finally{Q.value=!1}}async function I(d,m={}){if(!d)return;const b=B.value[d]===!0,A=m.silent!==!0&&!b;A&&(Ie.value=!0);try{J.value[d]!==!0&&(await Bi(d),J.value={...J.value,[d]:!0});const{messages:ee,inProgress:X}=await Qb(d),be=r.value[d]??[],Me=PE(be,ee,{preserveMissing:m.silent===!0});mt(d,Me);const ye=s.value[d]??[],ot=xE(ye,ee);Tt(d,ot),ar(d,ee),B.value={...B.value,[d]:!0};const Et=jt(d);Et&&(Z.value={...Z.value,[d]:Et}),De(d,X),ze(d)}finally{A&&(Ie.value=!1)}}async function N(){try{const d=t.value.flatMap(m=>m.threads.map(b=>b.cwd)).filter(Boolean);oe.value=await w_(d.length>0?[...new Set(d)]:void 0)}catch{}}async function $(){_e.value="";try{await Ar(),await Promise.all([we(),N()]),await I(n.value)}catch(d){_e.value=d instanceof Error?d.message:"Unknown application error"}}async function Y(d){R(d);try{await I(d)}catch(m){_e.value=m instanceof Error?m.message:"Unknown application error"}}async function Ue(d){try{await n_(d),await Ar(),n.value===d&&await I(n.value)}catch(m){_e.value=m instanceof Error?m.message:"Unknown application error"}}async function Mt(d,m){const b=m.trim();if(!(!d||!b))try{await r_(d,b),q.value={...q.value,[d]:b},me(),Ui(d,b)}catch(A){_e.value=A instanceof Error?A.message:"Unknown application error"}}async function rn(d,m=[],b=[],A="steer",ee=[]){const X=n.value,be=d.trim();if(!X||!be&&m.length===0&&ee.length===0)return;const Me=a.value[X]===!0;if(Me&&A==="queue"){const ye=l.value[X]??[],ot=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[X]:[...ye,{id:ot,text:be,imageUrls:m,skills:b,fileAttachments:ee}]};return}if(Me){Fe=!0,jn(X,be,m,b,ee).catch(ye=>{const ot=ye instanceof Error?ye.message:"Unknown application error";Ze(X,ot),_e.value=ot});return}_e.value="",Fe=!0,Ve(X,null),Xe(X,{label:"Thinking",details:G(f.value,h.value)}),Ze(X,null),De(X,!0);try{await jn(X,be,m,b,ee)}catch(ye){Fe=!1,De(X,!1),Xe(X,null);const ot=ye instanceof Error?ye.message:"Unknown application error";throw Ze(X,ot),_e.value=ot,ye}}async function Yr(d,m,b=[],A=[],ee=[]){const X=d.trim(),be=m.trim(),Me=f.value.trim();if(!X&&b.length===0&&ee.length===0)return"";Ce.value=!0,_e.value="";let ye="";try{try{ye=await Bc(be||void 0,Me||void 0)}catch(Bn){if(Me&&Me!==un&&To(Bn))await U(),ye=await Bc(be||void 0,un);else throw Bn}if(!ye)return"";Te(ye,be,X||"[Image]"),J.value={...J.value,[ye]:!0},R(ye),Fe=!0,Ve(ye,null),Xe(ye,{label:"Thinking",details:G(f.value,h.value)}),Ze(ye,null),De(ye,!0);const ot=ye,Et=be||null,Qr=X;return jn(ye,X,b,A,ee).catch(Bn=>{Fe=!1,De(ye,!1),Xe(ye,null);const cr=Bn instanceof Error?Bn.message:"Unknown application error";Ze(ye,cr),_e.value=cr}).finally(()=>{Ce.value=!1}),Cr(ot,Qr,Et),ye}catch(ot){Fe=!1,ye&&(De(ye,!1),Xe(ye,null));const Et=ot instanceof Error?ot.message:"Unknown application error";throw ye&&Ze(ye,Et),_e.value=Et,Ce.value=!1,ot}}async function jn(d,m,b=[],A=[],ee=[]){const X=f.value.trim(),be=h.value,Me=m.trim(),ye=A.map(Et=>({name:Et.name,path:Et.path})),ot=ee.map(Et=>({...Et}));x(d,{text:Me,imageUrls:[...b],skills:ye,fileAttachments:ot,effort:be,fallbackRetried:!1});try{J.value[d]!==!0&&await Bi(d);try{await Fi(d,m,b,X||void 0,be||void 0,A.length>0?A:void 0,ee)}catch(Et){if(X&&X!==un&&To(Et))await U(),x(d,{text:Me,imageUrls:[...b],skills:ye,fileAttachments:ot,effort:be,fallbackRetried:!0}),await Fi(d,m,b,un,be||void 0,A.length>0?A:void 0,ee);else throw Et}J.value={...J.value,[d]:!0},st.add(d),Ye=!0,await te()}catch(Et){throw Et}}async function Vt(d){const m=l.value[d];if(!m||m.length===0)return;const[b,...A]=m;l.value=A.length>0?{...l.value,[d]:A}:Ft(l.value,d),Ce.value=!0,_e.value="",Fe=!0,Ve(d,null),Xe(d,{label:"Thinking",details:G(f.value,h.value)}),Ze(d,null),De(d,!0);try{await jn(d,b.text,b.imageUrls,b.skills,b.fileAttachments)}catch{De(d,!1),Xe(d,null)}finally{Ce.value=!1}}async function lr(){const d=n.value;if(!d||a.value[d]!==!0)return;const m=ve.value[d];Le.value=!0,_e.value="";try{await i_(d,m),De(d,!1),Xe(d,null),Ze(d,null),ve.value[d]&&(ve.value=Ft(ve.value,d)),st.add(d),Ye=!0,await te()}catch(b){const A=b instanceof Error?b.message:"Failed to interrupt active turn";Ze(d,A),_e.value=A}finally{Le.value=!1}}async function Xr(d){const m=n.value;if(!m||Ae.value)return;const A=(r.value[m]??[]).reduce((X,be)=>typeof be.turnIndex=="number"&&be.turnIndex>X?be.turnIndex:X,-1);if(A<0||d>A)return;const ee=A-d+1;if(!(ee<1)){Ae.value=!0,_e.value="";try{const X=await jc(m,ee);mt(m,X),Tt(m,[]),Ht(m),i.value[m]&&(i.value=Ft(i.value,m)),Ve(m,null),Xe(m,null),Ze(m,null),Ye=!0,await te()}catch(X){_e.value=X instanceof Error?X.message:"Failed to rollback thread"}finally{Ae.value=!1}}}function Ss(d,m){d.length===0||(j.value[d]??"")===m||(j.value={...j.value,[d]:m},Yi(j.value))}function vi(d){var ee;if(d.length===0)return;const m=C.value.filter(X=>X!==d);if(jr(C.value,m)||(C.value=m,es(C.value)),t.value=t.value.filter(X=>X.projectName!==d),j.value[d]!==void 0){const X={...j.value};delete X[d],j.value=X,Yi(X)}me();const b=vr(e.value);Oe(b),b.some(X=>X.id===n.value)||R(((ee=b[0])==null?void 0:ee.id)??""),P()}function mo(d,m){if(d.length===0||t.value.length===0)return;const b=t.value.map(ye=>ye.projectName),A=b.indexOf(d);if(A===-1)return;const ee=Math.max(0,Math.min(m,b.length-1)),X=AE(b,A,ee);if(X===b)return;const be=ko(X,t.value);C.value=be,es(C.value);const Me=Xi(t.value,C.value);t.value=Io(t.value,Me),me(),P()}function yi(d){const m=d.trim();if(!m)return;const b=[m,...C.value.filter(ee=>ee!==m)];if(jr(C.value,b))return;C.value=b,es(C.value);const A=Xi(t.value,C.value);t.value=Io(t.value,A),me(),P()}async function P(){var d,m;try{const b=await wa(),A=new Map;for(const be of b.order){const Me=Qi(be);A.has(Me)||A.set(Me,be)}for(const be of t.value){const Me=((m=(d=be.threads[0])==null?void 0:d.cwd)==null?void 0:m.trim())??"";Me&&A.set(be.projectName,Me)}const ee=[];for(const be of C.value){const Me=A.get(be);Me&&!ee.includes(Me)&&ee.push(Me)}for(const be of b.order)ee.includes(be)||ee.push(be);const X=b.active.filter(be=>ee.includes(be));X.length===0&&ee.length>0&&X.push(ee[0]),await f_({order:ee,labels:b.labels,active:X})}catch{}}async function te(){if(Re.value){typeof window<"u"&&Ge===null&&(Ge=window.setTimeout(()=>{Ge=null,te()},Ji));return}Re.value=!0;const d=Ye,m=new Set(st);Ye=!1,st.clear();try{d&&await Ar();const b=n.value;if(!b)return;const A=m.has(b),ee=a.value[b]===!0,X=jt(b),be=Z.value[b]??"",Me=X.length>0&&X!==be;(A||ee||Me||d)&&await I(b,{silent:!0})}catch{}finally{Re.value=!1,(Ye||st.size>0)&&typeof window<"u"&&Ge===null&&(Ge=window.setTimeout(()=>{Ge=null,te()},Ji))}}function Se(){typeof window>"u"||We||(yt(),We=Zb(d=>{Ln(d),Jr(d)}))}async function yt(){try{const d=await t_();for(const m of d){const b=hn(m);b&&k(b)}}catch{}}async function wt(d){try{await e_(d.id,{result:d.result,error:d.error}),S(d.id)}catch(m){_e.value=m instanceof Error?m.message:"Failed to reply to server request"}}function et(){We&&(We(),We=null),Ye=!1,st.clear(),tt.clear(),Ge!==null&&typeof window<"u"&&(window.clearTimeout(Ge),Ge=null),Fe=!1,r.value={},s.value={},o.value={},i.value={},ae.value={},W.value={},le.value={},ve.value={},l.value={}}const Dt=ie(()=>{const d=n.value;return d?l.value[d]??[]:[]});function Es(d){const m=n.value;if(!m)return;const b=l.value[m];if(!b)return;const A=b.filter(ee=>ee.id!==d);l.value=A.length>0?{...l.value,[m]:A}:Ft(l.value,m)}function Cs(d){const m=n.value;if(!m)return;const b=l.value[m];if(!b)return;const A=b.find(ee=>ee.id===d);A&&(Es(d),rn(A.text,A.imageUrls,A.skills,"steer",A.fileAttachments))}return{projectGroups:e,projectDisplayNameById:j,selectedThread:ce,selectedThreadScrollState:he,selectedThreadServerRequests:$e,selectedLiveOverlay:v,selectedThreadId:n,availableModelIds:c,selectedModelId:f,selectedReasoningEffort:h,installedSkills:oe,messages:y,isLoadingThreads:Q,isLoadingMessages:Ie,isSendingMessage:Ce,isInterruptingTurn:Le,error:_e,refreshAll:$,refreshSkills:N,selectThread:Y,setThreadScrollState:Bt,archiveThreadById:Ue,renameThreadById:Mt,sendMessageToSelectedThread:rn,sendMessageToNewThread:Yr,interruptSelectedThreadTurn:lr,rollbackSelectedThread:Xr,isRollingBack:Ae,selectedThreadQueuedMessages:Dt,removeQueuedMessage:Es,steerQueuedMessage:Cs,setSelectedModelId:V,setSelectedReasoningEffort:K,respondToPendingServerRequest:wt,renameProject:Ss,removeProject:vi,reorderProject:mo,pinProjectToTop:yi,startPolling:Se,stopPolling:et}}const GE={class:"sidebar-root"},zE={class:"sidebar-scrollable"},qE=["aria-pressed"],KE={key:1,class:"sidebar-search-bar"},JE={key:0,class:"sidebar-settings-area"},YE={key:0,class:"sidebar-settings-panel"},XE={class:"sidebar-settings-value"},QE={class:"sidebar-settings-value"},ZE={class:"content-root"},eC={class:"content-body"},tC={key:1,class:"content-grid"},nC={class:"new-thread-empty"},rC={class:"worktree-init-status-title"},sC={class:"worktree-init-status-message"},oC={key:2,class:"content-grid"},iC={class:"content-thread"},aC={class:"composer-with-queue"},lC={class:"build-badge","aria-label":"Worktree name and version"},Iu="codex-web-local.sidebar-collapsed.v1",Su="codex-web-local.send-with-enter.v1",Eu="codex-web-local.in-progress-send-mode.v1",Cu="codex-web-local.dark-mode.v1",Au="codex-web-local.dictation-click-to-toggle.v1",cC=Lt({__name:"App",setup(e){const t="codex-web-local",n="0.1.40",{projectGroups:r,projectDisplayNameById:s,selectedThread:o,selectedThreadScrollState:i,selectedThreadServerRequests:a,selectedLiveOverlay:l,selectedThreadId:u,availableModelIds:c,selectedModelId:f,selectedReasoningEffort:h,installedSkills:_,messages:L,isLoadingThreads:C,isLoadingMessages:j,isInterruptingTurn:Z,refreshAll:B,refreshSkills:J,selectThread:W,setThreadScrollState:ae,archiveThreadById:le,renameThreadById:ve,sendMessageToSelectedThread:ke,sendMessageToNewThread:ne,interruptSelectedThreadTurn:q,rollbackSelectedThread:oe,isRollingBack:Q,selectedThreadQueuedMessages:Ie,removeQueuedMessage:Ce,steerQueuedMessage:Le,setSelectedModelId:Ae,setSelectedReasoningEffort:_e,respondToPendingServerRequest:Re,renameProject:ct,removeProject:We,reorderProject:Ge,pinProjectToTop:Ye,startPolling:st,stopPolling:nt}=WE(),Fe=Fg(),tt=Bg(),{isMobile:z}=rf(),fe=D(!1),ce=D(!1),he=D(""),$e=D("local"),v=D({order:[],labels:{}}),y=D({phase:"idle",title:"",message:""}),R=D(lr()),V=D(""),U=D(!1),x=D(null),H=D(null);let F=null;const K=D("New Project (1)"),G=D(""),we=D(!1),ue=D($(Su,!0)),me=D(Ue()),Te=D(Y()),Oe=D($(Au,!1)),ze=ie(()=>{const P=Fe.params.threadId;return typeof P=="string"?P:""}),Ve=ie(()=>{const P=new Set;for(const te of r.value)for(const Se of te.threads)P.add(Se.id);return P}),De=ie(()=>Fe.name==="home"),pt=ie(()=>Fe.name==="skills"),Xe=ie(()=>{var P;return pt.value?"Skills":De.value?"New thread":((P=o.value)==null?void 0:P.title)??"Choose a thread"}),Ze=ie(()=>L.value.filter(P=>{const te=Ss(P.messageType,P.role);return te==="worked"?!0:!(te==="turnActivity.live"||te==="turnError.live"||te==="agentReasoning.live")})),jt=ie(()=>l.value),Bt=ie(()=>De.value?"__new-thread__":u.value),mt=ie(()=>{var P,te;return De.value?he.value.trim():((te=(P=o.value)==null?void 0:P.cwd)==null?void 0:te.trim())??""}),Tt=ie(()=>{var P;return!De.value&&((P=o.value)==null?void 0:P.inProgress)===!0}),$t=ie(()=>{var yt,wt;const P=[],te=new Set;for(const et of v.value.order){const Dt=et.trim();!Dt||te.has(Dt)||(te.add(Dt),P.push({value:Dt,label:v.value.labels[Dt]||ar(Dt)}))}for(const et of r.value){const Dt=((wt=(yt=et.threads[0])==null?void 0:yt.cwd)==null?void 0:wt.trim())??"";!Dt||te.has(Dt)||(te.add(Dt),P.push({value:Dt,label:s.value[et.projectName]??et.projectName}))}const Se=he.value.trim();return Se&&!te.has(Se)&&P.unshift({value:Se,label:ar(Se)}),P}),It=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;sr(()=>{window.addEventListener("keydown",Ne),Vt(),It==null||It.addEventListener("change",Vt),vi(),qr(),Kr(),pn()}),ii(()=>{window.removeEventListener("keydown",Ne),It==null||It.removeEventListener("change",Vt),F&&(clearTimeout(F),F=null),nt()}),vt(V,P=>{const te=P.trim();if(F&&(clearTimeout(F),F=null),!te){H.value=null;return}F=setTimeout(()=>{g_(te,1e3).then(Se=>{V.value.trim()===te&&(H.value=Se.threadIds)}).catch(()=>{V.value.trim()===te&&(H.value=null)})},220)});function Dn(){J()}function Ht(){U.value=!U.value,U.value?en(()=>{var P;return(P=x.value)==null?void 0:P.focus()}):V.value=""}function xe(){var P;V.value="",(P=x.value)==null||P.focus()}function Pe(P){P.key==="Escape"&&(U.value=!1,V.value="")}function nn(P){P&&(Fe.name==="thread"&&ze.value===P||(tt.push({name:"thread",params:{threadId:P}}),z.value&&pe(!0)))}async function xt(P){P&&(u.value!==P&&(await W(P),await tt.push({name:"thread",params:{threadId:P}})),await en(),Cr())}function Tn(P){le(P)}function ln(P){var yt,wt;const te=r.value.find(et=>et.projectName===P),Se=((wt=(yt=te==null?void 0:te.threads[0])==null?void 0:yt.cwd)==null?void 0:wt.trim())??"";Se&&(he.value=Se),z.value&&pe(!0),!De.value&&tt.push({name:"home"})}function hn(P){var yt,wt;const te=r.value.find(et=>et.projectName===P),Se=((wt=(yt=te==null?void 0:te.threads[0])==null?void 0:yt.cwd)==null?void 0:wt.trim())??"";!Se||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(Se)}`,"_blank","noopener,noreferrer")}function k(){var te,Se;const P=((Se=(te=o.value)==null?void 0:te.cwd)==null?void 0:Se.trim())??"";P&&(he.value=P),z.value&&pe(!0),!De.value&&tt.push({name:"home"})}function S(P){ct(P.projectName,P.displayName)}function E(P){ve(P.threadId,P.title)}function g(P){We(P)}function M(P){Ge(P.projectName,P.toIndex)}function O(P){ae(P.threadId,P.state)}function de(P){Re(P)}function pe(P){R.value!==P&&(R.value=P,Xr(P))}function Ne(P){P.defaultPrevented||!P.ctrlKey&&!P.metaKey||P.shiftKey||P.altKey||P.key.toLowerCase()==="b"&&(P.preventDefault(),pe(!R.value))}function Ke(P){const te=P.text;if(De.value){yi(te,P.imageUrls,P.skills,P.fileAttachments);return}ke(te,P.imageUrls,P.skills,P.mode,P.fileAttachments)}function Je(P){he.value=P.trim()}async function St(P){const te=P.trim();if(!te)return;const Se=In(te),yt=await At(),wt=Se?te:ks(yt,te);if(wt)try{const et=await h_(wt,{createIfMissing:!Se,label:Se?"":te});et&&(he.value=et,Ye(ar(et)),Kr(),pn())}catch{}}async function At(){const P=zr();if(P)return P;try{const te=await Fc();if(te)return G.value=te,te}catch{}return""}function In(P){return P?P.startsWith("~/")||P.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(P):!1}async function pn(){const P=zr();if(!P){K.value="New Project (1)";return}try{const te=await p_(P);K.value=te.name||"New Project (1)"}catch{K.value="New Project (1)"}}function zr(){var Se,yt;const P=he.value.trim();if(P)return ir(P);const te=((yt=(Se=$t.value[0])==null?void 0:Se.value)==null?void 0:yt.trim())??"";return te?ir(te):G.value.trim()}async function qr(){try{G.value=await Fc()}catch{G.value=""}}async function Kr(){try{const P=await wa();v.value={order:[...P.order],labels:{...P.labels}}}catch{v.value={order:[],labels:{}}}}function ir(P){const te=P.trim().replace(/\/+$/,"");if(!te)return"";const Se=te.lastIndexOf("/");return Se<=0?"":te.slice(0,Se)}function ar(P){const te=P.trim().replace(/\/+$/,"");if(!te)return"";const Se=te.lastIndexOf("/");return Se<0?te:te.slice(Se+1)}function ks(P,te){const Se=P.trim().replace(/\/+$/,""),yt=te.trim().replace(/^\/+/,"");return!Se||!yt?"":`${Se}/${yt}`}function Ln(P){Ae(P)}function Jr(P){_e(P)}function Ts(){q()}function Is(P){oe(P.turnIndex)}function Cr(){if(De.value||pt.value||typeof document>"u"||!o.value||Ze.value.length===0)return;const P=Ar(),te=I(),Se=new Blob([P],{type:"text/markdown;charset=utf-8"}),yt=URL.createObjectURL(Se),wt=document.createElement("a");wt.href=yt,wt.download=te,document.body.appendChild(wt),wt.click(),document.body.removeChild(wt),window.setTimeout(()=>URL.revokeObjectURL(yt),0)}function Ar(){var Se,yt,wt;const P=[],te=((yt=(Se=o.value)==null?void 0:Se.title)==null?void 0:yt.trim())||"Untitled thread";P.push(`# ${N(te)}`),P.push(""),P.push(`- Exported: ${new Date().toISOString()}`),P.push(`- Thread ID: ${((wt=o.value)==null?void 0:wt.id)??""}`),P.push(""),P.push("---"),P.push("");for(const et of Ze.value){const Dt=et.role?et.role.toUpperCase():"MESSAGE";P.push(`## ${Dt}`),P.push("");const Es=et.text.trim();if(Es&&(P.push(Es),P.push("")),et.commandExecution&&(P.push("```text"),P.push(`command: ${et.commandExecution.command}`),P.push(`status: ${et.commandExecution.status}`),et.commandExecution.cwd&&P.push(`cwd: ${et.commandExecution.cwd}`),et.commandExecution.exitCode!==null&&P.push(`exitCode: ${et.commandExecution.exitCode}`),P.push(et.commandExecution.aggregatedOutput||"(no output)"),P.push("```"),P.push("")),et.fileAttachments&&et.fileAttachments.length>0){P.push("Attachments:");for(const Cs of et.fileAttachments)P.push(`- ${Cs.path}`);P.push("")}if(et.images&&et.images.length>0){P.push("Images:");for(const Cs of et.images)P.push(`- ${Cs}`);P.push("")}}return`${P.join(`
|
|
1437
|
+
`).trimEnd()}
|
|
1438
|
+
`}function I(){var wt,et;const Se=(((et=(wt=o.value)==null?void 0:wt.title)==null?void 0:et.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",yt=new Date().toISOString().replace(/[:.]/g,"-");return`${Se}-${yt}.md`}function N(P){return P.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function $(P,te){if(typeof window>"u")return te;const Se=window.localStorage.getItem(P);return Se===null?te:Se==="1"}function Y(){if(typeof window>"u")return"system";const P=window.localStorage.getItem(Cu);return P==="light"||P==="dark"?P:"system"}function Ue(){return typeof window>"u"?"queue":window.localStorage.getItem(Eu)==="steer"?"steer":"queue"}function Mt(){ue.value=!ue.value,window.localStorage.setItem(Su,ue.value?"1":"0")}function rn(){me.value=me.value==="steer"?"queue":"steer",window.localStorage.setItem(Eu,me.value)}function Yr(){const P=["system","light","dark"],te=P.indexOf(Te.value);Te.value=P[(te+1)%P.length],window.localStorage.setItem(Cu,Te.value),Vt()}function jn(){Oe.value=!Oe.value,window.localStorage.setItem(Au,Oe.value?"1":"0")}function Vt(){const P=document.documentElement;if(Te.value==="dark")P.classList.add("dark");else if(Te.value==="light")P.classList.remove("dark");else{const te=window.matchMedia("(prefers-color-scheme: dark)").matches;P.classList.toggle("dark",te)}}function lr(){return typeof window>"u"?!1:window.localStorage.getItem(Iu)==="1"}function Xr(P){typeof window>"u"||window.localStorage.setItem(Iu,P?"1":"0")}function Ss(P,te){const Se=(P??"").trim();return Se.length>0?Se:te.trim()||"message"}async function vi(){await B(),ce.value=!0,await mo(),st()}async function mo(){if(!fe.value){fe.value=!0;try{if(Fe.name==="home"||Fe.name==="skills"){u.value!==""&&await W("");return}if(Fe.name==="thread"){const P=ze.value;if(!P)return;if(!Ve.value.has(P)){await tt.replace({name:"home"});return}u.value!==P&&await W(P);return}}finally{fe.value=!1}}}vt(()=>[Fe.name,ze.value,C.value,Ve.value.has(ze.value),u.value],async()=>{ce.value&&await mo()}),vt(()=>u.value,async P=>{if(ce.value&&!fe.value&&!(De.value||pt.value)){if(!P){Fe.name!=="home"&&await tt.replace({name:"home"});return}Fe.name==="thread"&&ze.value===P||await tt.replace({name:"thread",params:{threadId:P}})}}),vt(()=>$t.value,P=>{if(P.length===0){he.value="";return}P.some(Se=>Se.value===he.value)||(he.value=P[0].value),pn()},{immediate:!0}),vt(()=>he.value,()=>{y.value={phase:"idle",title:"",message:""},pn()}),vt(()=>$e.value,P=>{P==="local"&&(y.value={phase:"idle",title:"",message:""})}),vt(()=>Fe.name,P=>{P!=="home"&&(y.value={phase:"idle",title:"",message:""})}),vt(()=>u.value,()=>{y.value={phase:"idle",title:"",message:""}}),vt(z,P=>{P&&!R.value&&pe(!0)});async function yi(P,te=[],Se=[],yt=[]){try{y.value={phase:"idle",title:"",message:""};let wt=he.value;if($e.value==="worktree"){y.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const Dt=await d_(he.value);wt=Dt.cwd,he.value=Dt.cwd,y.value={phase:"idle",title:"",message:""}}catch{y.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const et=await ne(P,wt,te,Se,yt);if(!et)return;await tt.replace({name:"thread",params:{threadId:et}})}catch{}}return(P,te)=>(w(),T(je,null,[Ee(zg,{"is-sidebar-collapsed":R.value,onCloseSidebar:te[6]||(te[6]=Se=>pe(!0))},{sidebar:gt(()=>[p("section",GE,[p("div",zE,[R.value?re("",!0):(w(),ft(wu,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":R.value,"show-new-thread-button":!0,onToggleSidebar:te[0]||(te[0]=Se=>pe(!R.value)),onStartNewThread:k},{default:gt(()=>[p("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":U.value,"aria-label":"Search threads",title:"Search threads",onClick:Ht},[Ee(_a,{class:"sidebar-search-toggle-icon"})],8,qE)]),_:1},8,["is-sidebar-collapsed"])),!R.value&&U.value?(w(),T("div",KE,[Ee(_a,{class:"sidebar-search-bar-icon"}),Zn(p("input",{ref_key:"sidebarSearchInputRef",ref:x,"onUpdate:modelValue":te[1]||(te[1]=Se=>V.value=Se),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:Pe},null,544),[[er,V.value]]),V.value.length>0?(w(),T("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:xe},[Ee(nl,{class:"sidebar-search-clear-icon"})])):re("",!0)])):re("",!0),R.value?re("",!0):(w(),T("button",{key:2,class:at(["sidebar-skills-link",{"is-active":pt.value}]),type:"button",onClick:te[2]||(te[2]=Se=>{ge(tt).push({name:"skills"}),ge(z)&&pe(!0)})}," Skills Hub ",2)),R.value?re("",!0):(w(),ft($y,{key:3,groups:ge(r),"project-display-name-by-id":ge(s),"selected-thread-id":ge(u),"is-loading":ge(C),"search-query":V.value,"search-matched-thread-ids":H.value,onSelect:nn,onArchive:Tn,onStartNewThread:ln,onRenameProject:S,onBrowseProjectFiles:hn,onRenameThread:E,onRemoveProject:g,onReorderProject:M,onExportThread:xt},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),R.value?re("",!0):(w(),T("div",JE,[Ee(Wd,{name:"settings-panel"},{default:gt(()=>[we.value?(w(),T("div",YE,[p("button",{class:"sidebar-settings-row",type:"button",onClick:Mt},[te[7]||(te[7]=p("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),p("span",{class:at(["sidebar-settings-toggle",{"is-on":!ue.value}])},null,2)]),p("button",{class:"sidebar-settings-row",type:"button",onClick:rn},[te[8]||(te[8]=p("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),p("span",XE,se(me.value==="steer"?"Steer":"Queue"),1)]),p("button",{class:"sidebar-settings-row",type:"button",onClick:Yr},[te[9]||(te[9]=p("span",{class:"sidebar-settings-label"},"Appearance",-1)),p("span",QE,se(Te.value==="system"?"System":Te.value==="dark"?"Dark":"Light"),1)]),p("button",{class:"sidebar-settings-row",type:"button",onClick:jn},[te[10]||(te[10]=p("span",{class:"sidebar-settings-label"},"Click to toggle dictation",-1)),p("span",{class:at(["sidebar-settings-toggle",{"is-on":Oe.value}])},null,2)])])):re("",!0)]),_:1}),p("button",{class:"sidebar-settings-button",type:"button",onClick:te[3]||(te[3]=Se=>we.value=!we.value)},[Ee(bE,{class:"sidebar-settings-icon"}),te[11]||(te[11]=p("span",null,"Settings",-1))])]))])]),content:gt(()=>[p("section",ZE,[Ee(Uy,{title:Xe.value},{leading:gt(()=>[R.value||ge(z)?(w(),ft(wu,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":R.value,"show-new-thread-button":!0,onToggleSidebar:te[4]||(te[4]=Se=>pe(!R.value)),onStartNewThread:k},null,8,["is-sidebar-collapsed"])):re("",!0)]),_:1},8,["title"]),p("section",eC,[pt.value?(w(),ft(oE,{key:0,onSkillsChanged:Dn})):De.value?(w(),T("div",tC,[p("div",nC,[te[12]||(te[12]=p("p",{class:"new-thread-hero"},"Let's build",-1)),Ee(ba,{class:"new-thread-folder-dropdown","model-value":he.value,options:$t.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":K.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":Je,onAdd:St},null,8,["model-value","options","default-add-value"]),Ee(l0,{class:"new-thread-runtime-dropdown",modelValue:$e.value,"onUpdate:modelValue":te[5]||(te[5]=Se=>$e.value=Se)},null,8,["modelValue"]),y.value.phase!=="idle"?(w(),T("div",{key:0,class:at(["worktree-init-status",{"is-running":y.value.phase==="running","is-error":y.value.phase==="error"}])},[p("strong",rC,se(y.value.title),1),p("span",sC,se(y.value.message),1)],2)):re("",!0)]),Ee(Vc,{"active-thread-id":Bt.value,cwd:mt.value,models:ge(c),"selected-model":ge(f),"selected-reasoning-effort":ge(h),skills:ge(_),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":ue.value,"in-progress-submit-mode":me.value,"dictation-click-to-toggle":Oe.value,onSubmit:Ke,"onUpdate:selectedModel":Ln,"onUpdate:selectedReasoningEffort":Jr},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle"])])):(w(),T("div",oC,[p("div",iC,[Ee(Sb,{messages:Ze.value,"is-loading":ge(j),"active-thread-id":Bt.value,cwd:mt.value,"scroll-state":ge(i),"live-overlay":jt.value,"pending-requests":ge(a),"is-turn-in-progress":Tt.value,"is-rolling-back":ge(Q),onUpdateScrollState:O,onRespondServerRequest:de,onRollback:Is},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),p("div",aC,[Ee(e0,{messages:ge(Ie),onSteer:ge(Le),onDelete:ge(Ce)},null,8,["messages","onSteer","onDelete"]),Ee(Vc,{"active-thread-id":Bt.value,cwd:mt.value,models:ge(c),"selected-model":ge(f),"selected-reasoning-effort":ge(h),skills:ge(_),"is-turn-in-progress":Tt.value,"is-interrupting-turn":ge(Z),"has-queue-above":ge(Ie).length>0,"send-with-enter":ue.value,"in-progress-submit-mode":me.value,"dictation-click-to-toggle":Oe.value,onSubmit:Ke,"onUpdate:selectedModel":Ln,"onUpdate:selectedReasoningEffort":Jr,onInterrupt:Ts},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","dictation-click-to-toggle"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),p("div",lC," WT "+se(ge(t))+" · v"+se(ge(n)),1)],64))}}),uC=rt(cC,[["__scopeId","data-v-8b24c1e3"]]),Zi={render:()=>null},dC=jg({history:gg(),routes:[{path:"/",name:"home",component:Zi},{path:"/thread/:threadId",name:"thread",component:Zi},{path:"/skills",name:"skills",component:Zi},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Rm(uC).use(dC).mount("#app");
|