codexapp 0.1.34 → 0.1.36
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-C62Rl1-Z.js +1444 -0
- package/dist/assets/index-Di9X0XLd.css +1 -0
- package/dist/index.html +2 -2
- package/dist-cli/index.js +652 -601
- package/dist-cli/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/assets/index-5eZebBiF.js +0 -1442
- package/dist/assets/index-zaSJxL5w.css +0 -1
|
@@ -1,1442 +0,0 @@
|
|
|
1
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();/**
|
|
2
|
-
* @vue/shared v3.5.28
|
|
3
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
-
* @license MIT
|
|
5
|
-
**/function Sa(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const bt={},es=[],xn=()=>{},gu=()=>!1,Wo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ea=e=>e.startsWith("onUpdate:"),Mt=Object.assign,Ca=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Zf=Object.prototype.hasOwnProperty,dt=(e,t)=>Zf.call(e,t),De=Array.isArray,ts=e=>Zs(e)==="[object Map]",vu=e=>Zs(e)==="[object Set]",pl=e=>Zs(e)==="[object Date]",Ve=e=>typeof e=="function",It=e=>typeof e=="string",gn=e=>typeof e=="symbol",ft=e=>e!==null&&typeof e=="object",yu=e=>(ft(e)||Ve(e))&&Ve(e.then)&&Ve(e.catch),wu=Object.prototype.toString,Zs=e=>wu.call(e),eh=e=>Zs(e).slice(8,-1),bu=e=>Zs(e)==="[object Object]",Aa=e=>It(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ps=Sa(",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)))},th=/-\w/g,un=qo(e=>e.replace(th,t=>t.slice(1).toUpperCase())),nh=/\B([A-Z])/g,_r=qo(e=>e.replace(nh,"-$1").toLowerCase()),zo=qo(e=>e.charAt(0).toUpperCase()+e.slice(1)),fi=qo(e=>e?`on${zo(e)}`:""),vr=(e,t)=>!Object.is(e,t),yo=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},_u=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Ra=e=>{const t=parseFloat(e);return isNaN(t)?e:t},rh=e=>{const t=It(e)?Number(e):NaN;return isNaN(t)?e:t};let ml;const Go=()=>ml||(ml=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Wr(e){if(De(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=It(r)?ah(r):Wr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(It(e)||ft(e))return e}const sh=/;(?![^(]*\))/g,oh=/:([^]+)/,ih=/\/\*[^]*?\*\//g;function ah(e){const t={};return e.replace(ih,"").split(sh).forEach(n=>{if(n){const r=n.split(oh);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function gt(e){let t="";if(It(e))t=e;else if(De(e))for(let n=0;n<e.length;n++){const r=gt(e[n]);r&&(t+=r+" ")}else if(ft(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const lh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",ch=Sa(lh);function ku(e){return!!e||e===""}function uh(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Pa(e[r],t[r]);return n}function Pa(e,t){if(e===t)return!0;let n=pl(e),r=pl(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=gn(e),r=gn(t),n||r)return e===t;if(n=De(e),r=De(t),n||r)return n&&r?uh(e,t):!1;if(n=ft(e),r=ft(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||!Pa(e[i],t[i]))return!1}}return String(e)===String(t)}const Tu=e=>!!(e&&e.__v_isRef===!0),de=e=>It(e)?e:e==null?"":De(e)||ft(e)&&(e.toString===wu||!Ve(e.toString))?Tu(e)?de(e.value):JSON.stringify(e,Iu,2):String(e),Iu=(e,t)=>Tu(t)?Iu(e,t.value):ts(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[hi(r,o)+" =>"]=s,n),{})}:vu(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>hi(n))}:gn(t)?hi(t):ft(t)&&!De(t)&&!bu(t)?String(t):t,hi=(e,t="")=>{var n;return gn(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 en;class dh{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=en,!t&&en&&(this.index=(en.scopes||(en.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=en;try{return en=this,t()}finally{en=n}}}on(){++this._on===1&&(this.prevScope=en,en=this)}off(){this._on>0&&--this._on===0&&(en=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 fh(){return en}let _t;const pi=new WeakSet;class Su{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,en&&en.active&&en.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,pi.has(this)&&(pi.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Cu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,gl(this),Au(this);const t=_t,n=hn;_t=this,hn=!0;try{return this.fn()}finally{Ru(this),_t=t,hn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Oa(t);this.deps=this.depsTail=void 0,gl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?pi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){qi(this)&&this.run()}get dirty(){return qi(this)}}let Eu=0,xs,Ms;function Cu(e,t=!1){if(e.flags|=8,t){e.next=Ms,Ms=e;return}e.next=xs,xs=e}function xa(){Eu++}function Ma(){if(--Eu>0)return;if(Ms){let t=Ms;for(Ms=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;xs;){let t=xs;for(xs=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 Au(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ru(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),Oa(r),hh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function qi(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Pu(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Pu(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Fs)||(e.globalVersion=Fs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!qi(e))))return;e.flags|=2;const t=e.dep,n=_t,r=hn;_t=e,hn=!0;try{Au(e);const s=e.fn(e._value);(t.version===0||vr(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{_t=n,hn=r,Ru(e),e.flags&=-3}}function Oa(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)Oa(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function hh(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let hn=!0;const xu=[];function Kn(){xu.push(hn),hn=!1}function Jn(){const e=xu.pop();hn=e===void 0?!0:e}function gl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=_t;_t=void 0;try{t()}finally{_t=n}}}let Fs=0;class ph{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 Na{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(!_t||!hn||_t===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==_t)n=this.activeLink=new ph(_t,this),_t.deps?(n.prevDep=_t.depsTail,_t.depsTail.nextDep=n,_t.depsTail=n):_t.deps=_t.depsTail=n,Mu(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=_t.depsTail,n.nextDep=void 0,_t.depsTail.nextDep=n,_t.depsTail=n,_t.deps===n&&(_t.deps=r)}return n}trigger(t){this.version++,Fs++,this.notify(t)}notify(t){xa();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ma()}}}function Mu(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)Mu(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const zi=new WeakMap,Ur=Symbol(""),Gi=Symbol(""),Us=Symbol("");function Vt(e,t,n){if(hn&&_t){let r=zi.get(e);r||zi.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new Na),s.map=r,s.key=n),s.track()}}function Vn(e,t,n,r,s,o){const i=zi.get(e);if(!i){Fs++;return}const a=l=>{l&&l.trigger()};if(xa(),t==="clear")i.forEach(a);else{const l=De(e),u=l&&Aa(n);if(l&&n==="length"){const c=Number(r);i.forEach((f,h)=>{(h==="length"||h===Us||!gn(h)&&h>=c)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),u&&a(i.get(Us)),t){case"add":l?u&&a(i.get("length")):(a(i.get(Ur)),ts(e)&&a(i.get(Gi)));break;case"delete":l||(a(i.get(Ur)),ts(e)&&a(i.get(Gi)));break;case"set":ts(e)&&a(i.get(Ur));break}}Ma()}function Jr(e){const t=ct(e);return t===e?t:(Vt(t,"iterate",Us),cn(e)?t:t.map(vn))}function Ko(e){return Vt(e=ct(e),"iterate",Us),e}function ur(e,t){return Yn(e)?cs(Hr(e)?vn(t):t):vn(t)}const mh={__proto__:null,[Symbol.iterator](){return mi(this,Symbol.iterator,e=>ur(this,e))},concat(...e){return Jr(this).concat(...e.map(t=>De(t)?Jr(t):t))},entries(){return mi(this,"entries",e=>(e[1]=ur(this,e[1]),e))},every(e,t){return jn(this,"every",e,t,void 0,arguments)},filter(e,t){return jn(this,"filter",e,t,n=>n.map(r=>ur(this,r)),arguments)},find(e,t){return jn(this,"find",e,t,n=>ur(this,n),arguments)},findIndex(e,t){return jn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return jn(this,"findLast",e,t,n=>ur(this,n),arguments)},findLastIndex(e,t){return jn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return jn(this,"forEach",e,t,void 0,arguments)},includes(...e){return gi(this,"includes",e)},indexOf(...e){return gi(this,"indexOf",e)},join(e){return Jr(this).join(e)},lastIndexOf(...e){return gi(this,"lastIndexOf",e)},map(e,t){return jn(this,"map",e,t,void 0,arguments)},pop(){return Ts(this,"pop")},push(...e){return Ts(this,"push",e)},reduce(e,...t){return vl(this,"reduce",e,t)},reduceRight(e,...t){return vl(this,"reduceRight",e,t)},shift(){return Ts(this,"shift")},some(e,t){return jn(this,"some",e,t,void 0,arguments)},splice(...e){return Ts(this,"splice",e)},toReversed(){return Jr(this).toReversed()},toSorted(e){return Jr(this).toSorted(e)},toSpliced(...e){return Jr(this).toSpliced(...e)},unshift(...e){return Ts(this,"unshift",e)},values(){return mi(this,"values",e=>ur(this,e))}};function mi(e,t,n){const r=Ko(e),s=r[t]();return r!==e&&!cn(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const gh=Array.prototype;function jn(e,t,n,r,s,o){const i=Ko(e),a=i!==e&&!cn(e),l=i[t];if(l!==gh[t]){const f=l.apply(e,o);return a?vn(f):f}let u=n;i!==e&&(a?u=function(f,h){return n.call(this,ur(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 vl(e,t,n,r){const s=Ko(e);let o=n;return s!==e&&(cn(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,ur(e,a),l,e)}),s[t](o,...r)}function gi(e,t,n){const r=ct(e);Vt(r,"iterate",Us);const s=r[t](...n);return(s===-1||s===!1)&&La(n[0])?(n[0]=ct(n[0]),r[t](...n)):s}function Ts(e,t,n=[]){Kn(),xa();const r=ct(e)[t].apply(e,n);return Ma(),Jn(),r}const vh=Sa("__proto__,__v_isRef,__isVue"),Ou=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(gn));function yh(e){gn(e)||(e=String(e));const t=ct(this);return Vt(t,"has",e),t.hasOwnProperty(e)}class Nu{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?Ah:ju:o?Lu:Du).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=De(t);if(!s){let l;if(i&&(l=mh[n]))return l;if(n==="hasOwnProperty")return yh}const a=Reflect.get(t,n,zt(t)?t:r);if((gn(n)?Ou.has(n):vh(n))||(s||Vt(t,"get",n),o))return a;if(zt(a)){const l=i&&Aa(n)?a:a.value;return s&&ft(l)?Ji(l):l}return ft(a)?s?Ji(a):Jo(a):a}}class $u extends Nu{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=De(t)&&Aa(n);if(!this._isShallow){const u=Yn(o);if(!cn(r)&&!Yn(r)&&(o=ct(o),r=ct(r)),!i&&zt(o)&&!zt(r))return u||(o.value=r),!0}const a=i?Number(n)<t.length:dt(t,n),l=Reflect.set(t,n,r,zt(t)?t:s);return t===ct(s)&&(a?vr(r,o)&&Vn(t,"set",n,r):Vn(t,"add",n,r)),l}deleteProperty(t,n){const r=dt(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&Vn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!gn(n)||!Ou.has(n))&&Vt(t,"has",n),r}ownKeys(t){return Vt(t,"iterate",De(t)?"length":Ur),Reflect.ownKeys(t)}}class wh extends Nu{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const bh=new $u,_h=new wh,kh=new $u(!0);const Ki=e=>e,lo=e=>Reflect.getPrototypeOf(e);function Th(e,t,n){return function(...r){const s=this.__v_raw,o=ct(s),i=ts(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,u=s[e](...r),c=n?Ki:t?cs:vn;return!t&&Vt(o,"iterate",l?Gi:Ur),Mt(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 co(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Ih(e,t){const n={get(s){const o=this.__v_raw,i=ct(o),a=ct(s);e||(vr(s,a)&&Vt(i,"get",s),Vt(i,"get",a));const{has:l}=lo(i),u=t?Ki:e?cs:vn;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&&Vt(ct(s),"iterate",Ur),s.size},has(s){const o=this.__v_raw,i=ct(o),a=ct(s);return e||(vr(s,a)&&Vt(i,"has",s),Vt(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=ct(a),u=t?Ki:e?cs:vn;return!e&&Vt(l,"iterate",Ur),a.forEach((c,f)=>s.call(o,u(c),u(f),i))}};return Mt(n,e?{add:co("add"),set:co("set"),delete:co("delete"),clear:co("clear")}:{add(s){!t&&!cn(s)&&!Yn(s)&&(s=ct(s));const o=ct(this);return lo(o).has.call(o,s)||(o.add(s),Vn(o,"add",s,s)),this},set(s,o){!t&&!cn(o)&&!Yn(o)&&(o=ct(o));const i=ct(this),{has:a,get:l}=lo(i);let u=a.call(i,s);u||(s=ct(s),u=a.call(i,s));const c=l.call(i,s);return i.set(s,o),u?vr(o,c)&&Vn(i,"set",s,o):Vn(i,"add",s,o),this},delete(s){const o=ct(this),{has:i,get:a}=lo(o);let l=i.call(o,s);l||(s=ct(s),l=i.call(o,s)),a&&a.call(o,s);const u=o.delete(s);return l&&Vn(o,"delete",s,void 0),u},clear(){const s=ct(this),o=s.size!==0,i=s.clear();return o&&Vn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Th(s,e,t)}),n}function $a(e,t){const n=Ih(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 Sh={get:$a(!1,!1)},Eh={get:$a(!1,!0)},Ch={get:$a(!0,!1)};const Du=new WeakMap,Lu=new WeakMap,ju=new WeakMap,Ah=new WeakMap;function Rh(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ph(e){return e.__v_skip||!Object.isExtensible(e)?0:Rh(eh(e))}function Jo(e){return Yn(e)?e:Da(e,!1,bh,Sh,Du)}function Bu(e){return Da(e,!1,kh,Eh,Lu)}function Ji(e){return Da(e,!0,_h,Ch,ju)}function Da(e,t,n,r,s){if(!ft(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Ph(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 Yn(e)?Hr(e.__v_raw):!!(e&&e.__v_isReactive)}function Yn(e){return!!(e&&e.__v_isReadonly)}function cn(e){return!!(e&&e.__v_isShallow)}function La(e){return e?!!e.__v_raw:!1}function ct(e){const t=e&&e.__v_raw;return t?ct(t):e}function xh(e){return!dt(e,"__v_skip")&&Object.isExtensible(e)&&_u(e,"__v_skip",!0),e}const vn=e=>ft(e)?Jo(e):e,cs=e=>ft(e)?Ji(e):e;function zt(e){return e?e.__v_isRef===!0:!1}function L(e){return Fu(e,!1)}function Mh(e){return Fu(e,!0)}function Fu(e,t){return zt(e)?e:new Oh(e,t)}class Oh{constructor(t,n){this.dep=new Na,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:ct(t),this._value=n?t:vn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||cn(t)||Yn(t);t=r?t:ct(t),vr(t,n)&&(this._rawValue=t,this._value=r?t:vn(t),this.dep.trigger())}}function $e(e){return zt(e)?e.value:e}const Nh={get:(e,t,n)=>t==="__v_raw"?e:$e(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return zt(s)&&!zt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Uu(e){return Hr(e)?e:new Proxy(e,Nh)}class $h{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Na(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Fs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&_t!==this)return Cu(this,!0),!0}get value(){const t=this.dep.track();return Pu(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Dh(e,t,n=!1){let r,s;return Ve(e)?r=e:(r=e.get,s=e.set),new $h(r,s,n)}const uo={},Ao=new WeakMap;let $r;function Lh(e,t=!1,n=$r){if(n){let r=Ao.get(n);r||Ao.set(n,r=[]),r.push(e)}}function jh(e,t,n=bt){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,u=j=>s?j:cn(j)||s===!1||s===0?Wn(j,1):Wn(j);let c,f,h,b,$=!1,P=!1;if(zt(e)?(f=()=>e.value,$=cn(e)):Hr(e)?(f=()=>u(e),$=!0):De(e)?(P=!0,$=e.some(j=>Hr(j)||cn(j)),f=()=>e.map(j=>{if(zt(j))return j.value;if(Hr(j))return u(j);if(Ve(j))return l?l(j,2):j()})):Ve(e)?t?f=l?()=>l(e,2):e:f=()=>{if(h){Kn();try{h()}finally{Jn()}}const j=$r;$r=c;try{return l?l(e,3,[b]):e(b)}finally{$r=j}}:f=xn,t&&s){const j=f,ue=s===!0?1/0:s;f=()=>Wn(j(),ue)}const H=fh(),Y=()=>{c.stop(),H&&H.active&&Ca(H.effects,c)};if(o&&t){const j=t;t=(...ue)=>{j(...ue),Y()}}let D=P?new Array(e.length).fill(uo):uo;const W=j=>{if(!(!(c.flags&1)||!c.dirty&&!j))if(t){const ue=c.run();if(s||$||(P?ue.some((ae,ve)=>vr(ae,D[ve])):vr(ue,D))){h&&h();const ae=$r;$r=c;try{const ve=[ue,D===uo?void 0:P&&D[0]===uo?[]:D,b];D=ue,l?l(t,3,ve):t(...ve)}finally{$r=ae}}}else c.run()};return a&&a(W),c=new Su(f),c.scheduler=i?()=>i(W,!1):W,b=j=>Lh(j,!1,c),h=c.onStop=()=>{const j=Ao.get(c);if(j){if(l)l(j,4);else for(const ue of j)ue();Ao.delete(c)}},t?r?W(!0):D=c.run():i?i(W.bind(null,!0),!0):c.run(),Y.pause=c.pause.bind(c),Y.resume=c.resume.bind(c),Y.stop=Y,Y}function Wn(e,t=1/0,n){if(t<=0||!ft(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,zt(e))Wn(e.value,t,n);else if(De(e))for(let r=0;r<e.length;r++)Wn(e[r],t,n);else if(vu(e)||ts(e))e.forEach(r=>{Wn(r,t,n)});else if(bu(e)){for(const r in e)Wn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Wn(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 eo(e,t,n,r){try{return r?e(...r):e()}catch(s){Yo(s,t,n)}}function yn(e,t,n,r){if(Ve(e)){const s=eo(e,t,n,r);return s&&yu(s)&&s.catch(o=>{Yo(o,t,n)}),s}if(De(e)){const s=[];for(let o=0;o<e.length;o++)s.push(yn(e[o],t,n,r));return s}}function Yo(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||bt;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){Kn(),eo(o,null,10,[e,l,u]),Jn();return}}Bh(e,n,s,r,i)}function Bh(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Qt=[];let Sn=-1;const ns=[];let dr=null,Qr=0;const Hu=Promise.resolve();let Ro=null;function on(e){const t=Ro||Hu;return e?t.then(this?e.bind(this):e):t}function Fh(e){let t=Sn+1,n=Qt.length;for(;t<n;){const r=t+n>>>1,s=Qt[r],o=Hs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function ja(e){if(!(e.flags&1)){const t=Hs(e),n=Qt[Qt.length-1];!n||!(e.flags&2)&&t>=Hs(n)?Qt.push(e):Qt.splice(Fh(t),0,e),e.flags|=1,Vu()}}function Vu(){Ro||(Ro=Hu.then(qu))}function Uh(e){De(e)?ns.push(...e):dr&&e.id===-1?dr.splice(Qr+1,0,e):e.flags&1||(ns.push(e),e.flags|=1),Vu()}function yl(e,t,n=Sn+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 Wu(e){if(ns.length){const t=[...new Set(ns)].sort((n,r)=>Hs(n)-Hs(r));if(ns.length=0,dr){dr.push(...t);return}for(dr=t,Qr=0;Qr<dr.length;Qr++){const n=dr[Qr];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}dr=null,Qr=0}}const Hs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function qu(e){try{for(Sn=0;Sn<Qt.length;Sn++){const t=Qt[Sn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),eo(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Sn<Qt.length;Sn++){const t=Qt[Sn];t&&(t.flags&=-2)}Sn=-1,Qt.length=0,Wu(),Ro=null,(Qt.length||ns.length)&&qu()}}let jt=null,zu=null;function Po(e){const t=jt;return jt=e,zu=e&&e.type.__scopeId||null,t}function pt(e,t=jt,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&No(-1);const o=Po(t);let i;try{i=e(...s)}finally{Po(o),r._d&&No(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Qn(e,t){if(jt===null)return e;const n=ni(jt),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=bt]=t[s];o&&(Ve(o)&&(o={mounted:o,updated:o}),o.deep&&Wn(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&&(Kn(),yn(l,n,8,[e.el,a,e,t]),Jn())}}function wo(e,t){if(qt){let n=qt.provides;const r=qt.parent&&qt.parent.provides;r===n&&(n=qt.provides=Object.create(r)),n[e]=t}}function pn(e,t,n=!1){const r=Va();if(r||ss){let s=ss?ss._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&&Ve(t)?t.call(r&&r.proxy):t}}const Hh=Symbol.for("v-scx"),Vh=()=>pn(Hh);function mt(e,t,n){return Gu(e,t,n)}function Gu(e,t,n=bt){const{immediate:r,deep:s,flush:o,once:i}=n,a=Mt({},n),l=t&&r||!t&&o!=="post";let u;if(zs){if(o==="sync"){const b=Vh();u=b.__watcherHandles||(b.__watcherHandles=[])}else if(!l){const b=()=>{};return b.stop=xn,b.resume=xn,b.pause=xn,b}}const c=qt;a.call=(b,$,P)=>yn(b,c,$,P);let f=!1;o==="post"?a.scheduler=b=>{Ht(b,c&&c.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(b,$)=>{$?b():ja(b)}),a.augmentJob=b=>{t&&(b.flags|=4),f&&(b.flags|=2,c&&(b.id=c.uid,b.i=c))};const h=jh(e,t,a);return zs&&(u?u.push(h):l&&h()),h}function Wh(e,t,n){const r=this.proxy,s=It(e)?e.includes(".")?Ku(r,e):()=>r[e]:e.bind(r,r);let o;Ve(t)?o=t:(o=t.handler,n=t);const i=to(this),a=Gu(s,o.bind(r),n);return i(),a}function Ku(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 Ju=Symbol("_vte"),Yu=e=>e.__isTeleport,Os=e=>e&&(e.disabled||e.disabled===""),wl=e=>e&&(e.defer||e.defer===""),bl=e=>typeof SVGElement<"u"&&e instanceof SVGElement,_l=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Yi=(e,t)=>{const n=e&&e.to;return It(n)?t?t(n):null:n},Qu={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,u){const{mc:c,pc:f,pbc:h,o:{insert:b,querySelector:$,createText:P,createComment:H}}=u,Y=Os(t.props);let{shapeFlag:D,children:W,dynamicChildren:j}=t;if(e==null){const ue=t.el=P(""),ae=t.anchor=P("");b(ue,n,r),b(ae,n,r);const ve=(ie,ne)=>{D&16&&c(W,ie,ne,s,o,i,a,l)},_e=()=>{const ie=t.target=Yi(t.props,$),ne=Qi(ie,t,P,b);ie&&(i!=="svg"&&bl(ie)?i="svg":i!=="mathml"&&_l(ie)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(ie),Y||(ve(ie,ne),bo(t,!1)))};Y&&(ve(n,ae),bo(t,!0)),wl(t.props)?(t.el.__isMounted=!1,Ht(()=>{_e(),delete t.el.__isMounted},o)):_e()}else{if(wl(t.props)&&e.el.__isMounted===!1){Ht(()=>{Qu.process(e,t,n,r,s,o,i,a,l,u)},o);return}t.el=e.el,t.targetStart=e.targetStart;const ue=t.anchor=e.anchor,ae=t.target=e.target,ve=t.targetAnchor=e.targetAnchor,_e=Os(e.props),ie=_e?n:ae,ne=_e?ue:ve;if(i==="svg"||bl(ae)?i="svg":(i==="mathml"||_l(ae))&&(i="mathml"),j?(h(e.dynamicChildren,j,ie,s,o,i,a),Ua(e,t,!0)):l||f(e,t,ie,ne,s,o,i,a,!1),Y)_e?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):fo(t,n,ue,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Te=t.target=Yi(t.props,$);Te&&fo(t,Te,null,u,0)}else _e&&fo(t,ae,ve,u,1);bo(t,Y)}},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 b=o||!Os(h);for(let $=0;$<a.length;$++){const P=a[$];r(P,t,n,b,!!P.dynamicChildren)}}},move:fo,hydrate:qh};function fo(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||Os(c))&&l&16)for(let h=0;h<u.length;h++)s(u[h],t,n,2);f&&r(a,t,n)}function qh(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:u,createText:c}},f){function h(H,Y){let D=Y;for(;D;){if(D&&D.nodeType===8){if(D.data==="teleport start anchor")t.targetStart=D;else if(D.data==="teleport anchor"){t.targetAnchor=D,H._lpa=t.targetAnchor&&i(t.targetAnchor);break}}D=i(D)}}function b(H,Y){Y.anchor=f(i(H),Y,a(H),n,r,s,o)}const $=t.target=Yi(t.props,l),P=Os(t.props);if($){const H=$._lpa||$.firstChild;t.shapeFlag&16&&(P?(b(e,t),h($,H),t.targetAnchor||Qi($,t,c,u,a(e)===$?e:null)):(t.anchor=i(e),h($,H),t.targetAnchor||Qi($,t,c,u),f(H&&i(H),t,$,n,r,s,o))),bo(t,P)}else P&&t.shapeFlag&16&&(b(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const xo=Qu;function bo(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 Qi(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Ju]=i,e&&(r(o,e,s),r(i,e,s)),i}const En=Symbol("_leaveCb"),Is=Symbol("_enterCb");function zh(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return nr(()=>{e.isMounted=!0}),rr(()=>{e.isUnmounting=!0}),e}const an=[Function,Array],Xu={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:an,onEnter:an,onAfterEnter:an,onEnterCancelled:an,onBeforeLeave:an,onLeave:an,onAfterLeave:an,onLeaveCancelled:an,onBeforeAppear:an,onAppear:an,onAfterAppear:an,onAppearCancelled:an},Zu=e=>{const t=e.subTree;return t.component?Zu(t.component):t},Gh={name:"BaseTransition",props:Xu,setup(e,{slots:t}){const n=Va(),r=zh();return()=>{const s=t.default&&nd(t.default(),!0);if(!s||!s.length)return;const o=ed(s),i=ct(e),{mode:a}=i;if(r.isLeaving)return vi(o);const l=kl(o);if(!l)return vi(o);let u=Xi(l,i,r,n,f=>u=f);l.type!==Wt&&Vs(l,u);let c=n.subTree&&kl(n.subTree);if(c&&c.type!==Wt&&!Lr(c,l)&&Zu(n).type!==Wt){let f=Xi(c,i,r,n);if(Vs(c,f),a==="out-in"&&l.type!==Wt)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,c=void 0},vi(o);a==="in-out"&&l.type!==Wt?f.delayLeave=(h,b,$)=>{const P=td(r,c);P[String(c.key)]=c,h[En]=()=>{b(),h[En]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{$(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function ed(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Wt){t=n;break}}return t}const Kh=Gh;function td(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 Xi(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:h,onLeave:b,onAfterLeave:$,onLeaveCancelled:P,onBeforeAppear:H,onAppear:Y,onAfterAppear:D,onAppearCancelled:W}=t,j=String(e.key),ue=td(n,e),ae=(ie,ne)=>{ie&&yn(ie,r,9,ne)},ve=(ie,ne)=>{const Te=ne[1];ae(ie,ne),De(ie)?ie.every(re=>re.length<=1)&&Te():ie.length<=1&&Te()},_e={mode:i,persisted:a,beforeEnter(ie){let ne=l;if(!n.isMounted)if(o)ne=H||l;else return;ie[En]&&ie[En](!0);const Te=ue[j];Te&&Lr(e,Te)&&Te.el[En]&&Te.el[En](),ae(ne,[ie])},enter(ie){let ne=u,Te=c,re=f;if(!n.isMounted)if(o)ne=Y||u,Te=D||c,re=W||f;else return;let Le=!1;ie[Is]=Xe=>{Le||(Le=!0,Xe?ae(re,[ie]):ae(Te,[ie]),_e.delayedLeave&&_e.delayedLeave(),ie[Is]=void 0)};const je=ie[Is].bind(null,!1);ne?ve(ne,[ie,je]):je()},leave(ie,ne){const Te=String(e.key);if(ie[Is]&&ie[Is](!0),n.isUnmounting)return ne();ae(h,[ie]);let re=!1;ie[En]=je=>{re||(re=!0,ne(),je?ae(P,[ie]):ae($,[ie]),ie[En]=void 0,ue[Te]===e&&delete ue[Te])};const Le=ie[En].bind(null,!1);ue[Te]=e,b?ve(b,[ie,Le]):Le()},clone(ie){const ne=Xi(ie,t,n,r,s);return s&&s(ne),ne}};return _e}function vi(e){if(Qo(e))return e=br(e),e.children=null,e}function kl(e){if(!Qo(e))return Yu(e.type)&&e.children?ed(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&&Ve(n.default))return n.default()}}function Vs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Vs(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 nd(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===He?(i.patchFlag&128&&s++,r=r.concat(nd(i.children,t,a))):(t||i.type!==Wt)&&r.push(a!=null?br(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function $t(e,t){return Ve(e)?Mt({name:e.name},t,{setup:e}):e}function rd(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Tl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Mo=new WeakMap;function Ns(e,t,n,r,s=!1){if(De(e)){e.forEach((P,H)=>Ns(P,t&&(De(t)?t[H]:t),n,r,s));return}if(rs(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Ns(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?ni(r.component):r.el,i=s?null:o,{i:a,r:l}=e,u=t&&t.r,c=a.refs===bt?a.refs={}:a.refs,f=a.setupState,h=ct(f),b=f===bt?gu:P=>Tl(c,P)?!1:dt(h,P),$=(P,H)=>!(H&&Tl(c,H));if(u!=null&&u!==l){if(Il(t),It(u))c[u]=null,b(u)&&(f[u]=null);else if(zt(u)){const P=t;$(u,P.k)&&(u.value=null),P.k&&(c[P.k]=null)}}if(Ve(l))eo(l,a,12,[i,c]);else{const P=It(l),H=zt(l);if(P||H){const Y=()=>{if(e.f){const D=P?b(l)?f[l]:c[l]:$()||!e.k?l.value:c[e.k];if(s)De(D)&&Ca(D,o);else if(De(D))D.includes(o)||D.push(o);else if(P)c[l]=[o],b(l)&&(f[l]=c[l]);else{const W=[o];$(l,e.k)&&(l.value=W),e.k&&(c[e.k]=W)}}else P?(c[l]=i,b(l)&&(f[l]=i)):H&&($(l,e.k)&&(l.value=i),e.k&&(c[e.k]=i))};if(i){const D=()=>{Y(),Mo.delete(e)};D.id=-1,Mo.set(e,D),Ht(D,n)}else Il(e),Y()}}}function Il(e){const t=Mo.get(e);t&&(t.flags|=8,Mo.delete(e))}Go().requestIdleCallback;Go().cancelIdleCallback;const rs=e=>!!e.type.__asyncLoader,Qo=e=>e.type.__isKeepAlive;function Jh(e,t){sd(e,"a",t)}function Yh(e,t){sd(e,"da",t)}function sd(e,t,n=qt){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(Xo(t,r,n),n){let s=n.parent;for(;s&&s.parent;)Qo(s.parent.vnode)&&Qh(r,t,n,s),s=s.parent}}function Qh(e,t,n,r){const s=Xo(t,e,r,!0);Zo(()=>{Ca(r[t],s)},n)}function Xo(e,t,n=qt,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Kn();const a=to(n),l=yn(t,n,e,i);return a(),Jn(),l});return r?s.unshift(o):s.push(o),o}}const tr=e=>(t,n=qt)=>{(!zs||e==="sp")&&Xo(e,(...r)=>t(...r),n)},Xh=tr("bm"),nr=tr("m"),Zh=tr("bu"),ep=tr("u"),rr=tr("bum"),Zo=tr("um"),tp=tr("sp"),np=tr("rtg"),rp=tr("rtc");function sp(e,t=qt){Xo("ec",e,t)}const op="components",od=Symbol.for("v-ndc");function Zi(e){return It(e)?ip(op,e,!1)||e:e||od}function ip(e,t,n=!0,r=!1){const s=jt||qt;if(s){const o=s.type;{const a=Wp(o,!1);if(a&&(a===t||a===un(t)||a===zo(un(t))))return o}const i=Sl(s[e]||o[e],t)||Sl(s.appContext[e],t);return!i&&r?o:i}}function Sl(e,t){return e&&(e[t]||e[un(t)]||e[zo(un(t))])}function Tt(e,t,n,r){let s;const o=n,i=De(e);if(i||It(e)){const a=i&&Hr(e);let l=!1,u=!1;a&&(l=!cn(e),u=Yn(e),e=Ko(e)),s=new Array(e.length);for(let c=0,f=e.length;c<f;c++)s[c]=t(l?u?cs(vn(e[c])):vn(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(ft(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 Pn(e,t,n={},r,s){if(jt.ce||jt.parent&&rs(jt.parent)&&jt.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),vt(He,null,[Ie("slot",n,r)],u?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),w();const i=o&&id(o(n)),a=n.key||i&&i.key,l=vt(He,{key:(a&&!gn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function id(e){return e.some(t=>qs(t)?!(t.type===Wt||t.type===He&&!id(t.children)):!0)?e:null}const ea=e=>e?Ed(e)?ni(e):ea(e.parent):null,$s=Mt(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=>ea(e.parent),$root:e=>ea(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ld(e),$forceUpdate:e=>e.f||(e.f=()=>{ja(e.update)}),$nextTick:e=>e.n||(e.n=on.bind(e.proxy)),$watch:e=>Wh.bind(e)}),yi=(e,t)=>e!==bt&&!e.__isScriptSetup&&dt(e,t),ap={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(yi(r,t))return i[t]=1,r[t];if(s!==bt&&dt(s,t))return i[t]=2,s[t];if(dt(o,t))return i[t]=3,o[t];if(n!==bt&&dt(n,t))return i[t]=4,n[t];ta&&(i[t]=0)}}const u=$s[t];let c,f;if(u)return t==="$attrs"&&Vt(e.attrs,"get",""),u(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==bt&&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 yi(s,t)?(s[t]=n,!0):r!==bt&&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!==bt&&a[0]!=="$"&&dt(e,a)||yi(t,a)||dt(o,a)||dt(r,a)||dt($s,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 lp(){return cp().slots}function cp(e){const t=Va();return t.setupContext||(t.setupContext=Ad(t))}function El(e){return De(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let ta=!0;function up(e){const t=ld(e),n=e.proxy,r=e.ctx;ta=!1,t.beforeCreate&&Cl(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:u,created:c,beforeMount:f,mounted:h,beforeUpdate:b,updated:$,activated:P,deactivated:H,beforeDestroy:Y,beforeUnmount:D,destroyed:W,unmounted:j,render:ue,renderTracked:ae,renderTriggered:ve,errorCaptured:_e,serverPrefetch:ie,expose:ne,inheritAttrs:Te,components:re,directives:Le,filters:je}=t;if(u&&dp(u,r,null),i)for(const ke in i){const Ne=i[ke];Ve(Ne)&&(r[ke]=Ne.bind(n))}if(s){const ke=s.call(n,n);ft(ke)&&(e.data=Jo(ke))}if(ta=!0,o)for(const ke in o){const Ne=o[ke],ze=Ve(Ne)?Ne.bind(n,n):Ve(Ne.get)?Ne.get.bind(n,n):xn,rt=!Ve(Ne)&&Ve(Ne.set)?Ne.set.bind(n):xn,Ze=fe({get:ze,set:rt});Object.defineProperty(r,ke,{enumerable:!0,configurable:!0,get:()=>Ze.value,set:et=>Ze.value=et})}if(a)for(const ke in a)ad(a[ke],r,n,ke);if(l){const ke=Ve(l)?l.call(n):l;Reflect.ownKeys(ke).forEach(Ne=>{wo(Ne,ke[Ne])})}c&&Cl(c,e,"c");function Ee(ke,Ne){De(Ne)?Ne.forEach(ze=>ke(ze.bind(n))):Ne&&ke(Ne.bind(n))}if(Ee(Xh,f),Ee(nr,h),Ee(Zh,b),Ee(ep,$),Ee(Jh,P),Ee(Yh,H),Ee(sp,_e),Ee(rp,ae),Ee(np,ve),Ee(rr,D),Ee(Zo,j),Ee(tp,ie),De(ne))if(ne.length){const ke=e.exposed||(e.exposed={});ne.forEach(Ne=>{Object.defineProperty(ke,Ne,{get:()=>n[Ne],set:ze=>n[Ne]=ze,enumerable:!0})})}else e.exposed||(e.exposed={});ue&&e.render===xn&&(e.render=ue),Te!=null&&(e.inheritAttrs=Te),re&&(e.components=re),Le&&(e.directives=Le),ie&&rd(e)}function dp(e,t,n=xn){De(e)&&(e=na(e));for(const r in e){const s=e[r];let o;ft(s)?"default"in s?o=pn(s.from||r,s.default,!0):o=pn(s.from||r):o=pn(s),zt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function Cl(e,t,n){yn(De(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function ad(e,t,n,r){let s=r.includes(".")?Ku(n,r):()=>n[r];if(It(e)){const o=t[e];Ve(o)&&mt(s,o)}else if(Ve(e))mt(s,e.bind(n));else if(ft(e))if(De(e))e.forEach(o=>ad(o,t,n,r));else{const o=Ve(e.handler)?e.handler.bind(n):t[e.handler];Ve(o)&&mt(s,o,e)}}function ld(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=>Oo(l,u,i,!0)),Oo(l,t,i)),ft(t)&&o.set(t,l),l}function Oo(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Oo(e,o,n,!0),s&&s.forEach(i=>Oo(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=fp[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const fp={data:Al,props:Rl,emits:Rl,methods:Rs,computed:Rs,beforeCreate:Jt,created:Jt,beforeMount:Jt,mounted:Jt,beforeUpdate:Jt,updated:Jt,beforeDestroy:Jt,beforeUnmount:Jt,destroyed:Jt,unmounted:Jt,activated:Jt,deactivated:Jt,errorCaptured:Jt,serverPrefetch:Jt,components:Rs,directives:Rs,watch:pp,provide:Al,inject:hp};function Al(e,t){return t?e?function(){return Mt(Ve(e)?e.call(this,this):e,Ve(t)?t.call(this,this):t)}:t:e}function hp(e,t){return Rs(na(e),na(t))}function na(e){if(De(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Jt(e,t){return e?[...new Set([].concat(e,t))]:t}function Rs(e,t){return e?Mt(Object.create(null),e,t):t}function Rl(e,t){return e?De(e)&&De(t)?[...new Set([...e,...t])]:Mt(Object.create(null),El(e),El(t??{})):t}function pp(e,t){if(!e)return t;if(!t)return e;const n=Mt(Object.create(null),e);for(const r in t)n[r]=Jt(e[r],t[r]);return n}function cd(){return{app:null,config:{isNativeTag:gu,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 mp=0;function gp(e,t){return function(r,s=null){Ve(r)||(r=Mt({},r)),s!=null&&!ft(s)&&(s=null);const o=cd(),i=new WeakSet,a=[];let l=!1;const u=o.app={_uid:mp++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:zp,get config(){return o.config},set config(c){},use(c,...f){return i.has(c)||(c&&Ve(c.install)?(i.add(c),c.install(u,...f)):Ve(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 b=u._ceVNode||Ie(r,s);return b.appContext=o,h===!0?h="svg":h===!1&&(h=void 0),e(b,c,h),l=!0,u._container=c,c.__vue_app__=u,ni(b.component)}},onUnmount(c){a.push(c)},unmount(){l&&(yn(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=ss;ss=u;try{return c()}finally{ss=f}}};return u}}let ss=null;const vp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${un(t)}Modifiers`]||e[`${_r(t)}Modifiers`];function yp(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||bt;let s=n;const o=t.startsWith("update:"),i=o&&vp(r,t.slice(7));i&&(i.trim&&(s=n.map(c=>It(c)?c.trim():c)),i.number&&(s=n.map(Ra)));let a,l=r[a=fi(t)]||r[a=fi(un(t))];!l&&o&&(l=r[a=fi(_r(t))]),l&&yn(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,yn(u,e,6,s)}}const wp=new WeakMap;function ud(e,t,n=!1){const r=n?wp:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!Ve(e)){const l=u=>{const c=ud(u,t,!0);c&&(a=!0,Mt(i,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(ft(e)&&r.set(e,null),null):(De(o)?o.forEach(l=>i[l]=null):Mt(i,o),ft(e)&&r.set(e,i),i)}function ei(e,t){return!e||!Wo(t)?!1:(t=t.slice(2).replace(/Once$/,""),dt(e,t[0].toLowerCase()+t.slice(1))||dt(e,_r(t))||dt(e,t))}function Pl(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:b,ctx:$,inheritAttrs:P}=e,H=Po(e);let Y,D;try{if(n.shapeFlag&4){const j=s||r,ue=j;Y=Cn(u.call(ue,j,c,f,b,h,$)),D=a}else{const j=t;Y=Cn(j.length>1?j(f,{attrs:a,slots:i,emit:l}):j(f,null)),D=t.props?a:bp(a)}}catch(j){Ds.length=0,Yo(j,e,1),Y=Ie(Wt)}let W=Y;if(D&&P!==!1){const j=Object.keys(D),{shapeFlag:ue}=W;j.length&&ue&7&&(o&&j.some(Ea)&&(D=_p(D,o)),W=br(W,D,!1,!0))}return n.dirs&&(W=br(W,null,!1,!0),W.dirs=W.dirs?W.dirs.concat(n.dirs):n.dirs),n.transition&&Vs(W,n.transition),Y=W,Po(H),Y}const bp=e=>{let t;for(const n in e)(n==="class"||n==="style"||Wo(n))&&((t||(t={}))[n]=e[n]);return t},_p=(e,t)=>{const n={};for(const r in e)(!Ea(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function kp(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?xl(r,i,u):!!i;if(l&8){const c=t.dynamicProps;for(let f=0;f<c.length;f++){const h=c[f];if(dd(i,r,h)&&!ei(u,h))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?xl(r,i,u):!0:!!i;return!1}function xl(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(dd(t,e,o)&&!ei(n,o))return!0}return!1}function dd(e,t,n){const r=e[n],s=t[n];return n==="style"&&ft(r)&&ft(s)?!Pa(r,s):r!==s}function Tp({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 fd={},hd=()=>Object.create(fd),pd=e=>Object.getPrototypeOf(e)===fd;function Ip(e,t,n,r=!1){const s={},o=hd();e.propsDefaults=Object.create(null),md(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:Bu(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function Sp(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=ct(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(ei(e.emitsOptions,h))continue;const b=t[h];if(l)if(dt(o,h))b!==o[h]&&(o[h]=b,u=!0);else{const $=un(h);s[$]=ra(l,a,$,b,e,!1)}else b!==o[h]&&(o[h]=b,u=!0)}}}else{md(e,t,s,o)&&(u=!0);let c;for(const f in a)(!t||!dt(t,f)&&((c=_r(f))===f||!dt(t,c)))&&(l?n&&(n[f]!==void 0||n[c]!==void 0)&&(s[f]=ra(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&&Vn(e.attrs,"set","")}function md(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(Ps(l))continue;const u=t[l];let c;s&&dt(s,c=un(l))?!o||!o.includes(c)?n[c]=u:(a||(a={}))[c]=u:ei(e.emitsOptions,l)||(!(l in r)||u!==r[l])&&(r[l]=u,i=!0)}if(o){const l=ct(n),u=a||bt;for(let c=0;c<o.length;c++){const f=o[c];n[f]=ra(s,l,f,u[f],e,!dt(u,f))}}return i}function ra(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&&Ve(l)){const{propsDefaults:u}=s;if(n in u)r=u[n];else{const c=to(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===_r(n))&&(r=!0))}return r}const Ep=new WeakMap;function gd(e,t,n=!1){const r=n?Ep:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!Ve(e)){const c=f=>{l=!0;const[h,b]=gd(f,t,!0);Mt(i,h),b&&a.push(...b)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!o&&!l)return ft(e)&&r.set(e,es),es;if(De(o))for(let c=0;c<o.length;c++){const f=un(o[c]);Ml(f)&&(i[f]=bt)}else if(o)for(const c in o){const f=un(c);if(Ml(f)){const h=o[c],b=i[f]=De(h)||Ve(h)?{type:h}:Mt({},h),$=b.type;let P=!1,H=!0;if(De($))for(let Y=0;Y<$.length;++Y){const D=$[Y],W=Ve(D)&&D.name;if(W==="Boolean"){P=!0;break}else W==="String"&&(H=!1)}else P=Ve($)&&$.name==="Boolean";b[0]=P,b[1]=H,(P||dt(b,"default"))&&a.push(f)}}const u=[i,a];return ft(e)&&r.set(e,u),u}function Ml(e){return e[0]!=="$"&&!Ps(e)}const Ba=e=>e==="_"||e==="_ctx"||e==="$stable",Fa=e=>De(e)?e.map(Cn):[Cn(e)],Cp=(e,t,n)=>{if(t._n)return t;const r=pt((...s)=>Fa(t(...s)),n);return r._c=!1,r},vd=(e,t,n)=>{const r=e._ctx;for(const s in e){if(Ba(s))continue;const o=e[s];if(Ve(o))t[s]=Cp(s,o,r);else if(o!=null){const i=Fa(o);t[s]=()=>i}}},yd=(e,t)=>{const n=Fa(t);e.slots.default=()=>n},wd=(e,t,n)=>{for(const r in t)(n||!Ba(r))&&(e[r]=t[r])},Ap=(e,t,n)=>{const r=e.slots=hd();if(e.vnode.shapeFlag&32){const s=t._;s?(wd(r,t,n),n&&_u(r,"_",s,!0)):vd(t,r)}else t&&yd(e,t)},Rp=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=bt;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:wd(s,t,n):(o=!t.$stable,vd(t,s)),i=t}else t&&(yd(e,t),i={default:1});if(o)for(const a in s)!Ba(a)&&i[a]==null&&delete s[a]},Ht=Np;function Pp(e){return xp(e)}function xp(e,t){const n=Go();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:b=xn,insertStaticContent:$}=e,P=(g,v,S,B=null,q=null,V=null,Z=void 0,R=null,x=!!v.dynamicChildren)=>{if(g===v)return;g&&!Lr(g,v)&&(B=U(g),et(g,q,V,!0),g=null),v.patchFlag===-2&&(x=!1,v.dynamicChildren=null);const{type:N,ref:te,shapeFlag:X}=v;switch(N){case ti:H(g,v,S,B);break;case Wt:Y(g,v,S,B);break;case bi:g==null&&D(v,S,B,Z);break;case He:re(g,v,S,B,q,V,Z,R,x);break;default:X&1?ue(g,v,S,B,q,V,Z,R,x):X&6?Le(g,v,S,B,q,V,Z,R,x):(X&64||X&128)&&N.process(g,v,S,B,q,V,Z,R,x,me)}te!=null&&q?Ns(te,g&&g.ref,V,v||g,!v):te==null&&g&&g.ref!=null&&Ns(g.ref,null,V,g,!0)},H=(g,v,S,B)=>{if(g==null)r(v.el=a(v.children),S,B);else{const q=v.el=g.el;v.children!==g.children&&u(q,v.children)}},Y=(g,v,S,B)=>{g==null?r(v.el=l(v.children||""),S,B):v.el=g.el},D=(g,v,S,B)=>{[g.el,g.anchor]=$(g.children,v,S,B,g.el,g.anchor)},W=({el:g,anchor:v},S,B)=>{let q;for(;g&&g!==v;)q=h(g),r(g,S,B),g=q;r(v,S,B)},j=({el:g,anchor:v})=>{let S;for(;g&&g!==v;)S=h(g),s(g),g=S;s(v)},ue=(g,v,S,B,q,V,Z,R,x)=>{if(v.type==="svg"?Z="svg":v.type==="math"&&(Z="mathml"),g==null)ae(v,S,B,q,V,Z,R,x);else{const N=g.el&&g.el._isVueCE?g.el:null;try{N&&N._beginPatch(),ie(g,v,q,V,Z,R,x)}finally{N&&N._endPatch()}}},ae=(g,v,S,B,q,V,Z,R)=>{let x,N;const{props:te,shapeFlag:X,transition:oe,dirs:ye}=g;if(x=g.el=i(g.type,V,te&&te.is,te),X&8?c(x,g.children):X&16&&_e(g.children,x,null,B,q,wi(g,V),Z,R),ye&&Pr(g,null,B,"created"),ve(x,g,g.scopeId,Z,B),te){for(const Ye in te)Ye!=="value"&&!Ps(Ye)&&o(x,Ye,null,te[Ye],V,B);"value"in te&&o(x,"value",null,te.value,V),(N=te.onVnodeBeforeMount)&&In(N,B,g)}ye&&Pr(g,null,B,"beforeMount");const Se=Mp(q,oe);Se&&oe.beforeEnter(x),r(x,v,S),((N=te&&te.onVnodeMounted)||Se||ye)&&Ht(()=>{N&&In(N,B,g),Se&&oe.enter(x),ye&&Pr(g,null,B,"mounted")},q)},ve=(g,v,S,B,q)=>{if(S&&b(g,S),B)for(let V=0;V<B.length;V++)b(g,B[V]);if(q){let V=q.subTree;if(v===V||kd(V.type)&&(V.ssContent===v||V.ssFallback===v)){const Z=q.vnode;ve(g,Z,Z.scopeId,Z.slotScopeIds,q.parent)}}},_e=(g,v,S,B,q,V,Z,R,x=0)=>{for(let N=x;N<g.length;N++){const te=g[N]=R?Hn(g[N]):Cn(g[N]);P(null,te,v,S,B,q,V,Z,R)}},ie=(g,v,S,B,q,V,Z)=>{const R=v.el=g.el;let{patchFlag:x,dynamicChildren:N,dirs:te}=v;x|=g.patchFlag&16;const X=g.props||bt,oe=v.props||bt;let ye;if(S&&xr(S,!1),(ye=oe.onVnodeBeforeUpdate)&&In(ye,S,v,g),te&&Pr(v,g,S,"beforeUpdate"),S&&xr(S,!0),(X.innerHTML&&oe.innerHTML==null||X.textContent&&oe.textContent==null)&&c(R,""),N?ne(g.dynamicChildren,N,R,S,B,wi(v,q),V):Z||Ne(g,v,R,null,S,B,wi(v,q),V,!1),x>0){if(x&16)Te(R,X,oe,S,q);else if(x&2&&X.class!==oe.class&&o(R,"class",null,oe.class,q),x&4&&o(R,"style",X.style,oe.style,q),x&8){const Se=v.dynamicProps;for(let Ye=0;Ye<Se.length;Ye++){const Ce=Se[Ye],Je=X[Ce],ot=oe[Ce];(ot!==Je||Ce==="value")&&o(R,Ce,Je,ot,q,S)}}x&1&&g.children!==v.children&&c(R,v.children)}else!Z&&N==null&&Te(R,X,oe,S,q);((ye=oe.onVnodeUpdated)||te)&&Ht(()=>{ye&&In(ye,S,v,g),te&&Pr(v,g,S,"updated")},B)},ne=(g,v,S,B,q,V,Z)=>{for(let R=0;R<v.length;R++){const x=g[R],N=v[R],te=x.el&&(x.type===He||!Lr(x,N)||x.shapeFlag&198)?f(x.el):S;P(x,N,te,null,B,q,V,Z,!0)}},Te=(g,v,S,B,q)=>{if(v!==S){if(v!==bt)for(const V in v)!Ps(V)&&!(V in S)&&o(g,V,v[V],null,q,B);for(const V in S){if(Ps(V))continue;const Z=S[V],R=v[V];Z!==R&&V!=="value"&&o(g,V,R,Z,q,B)}"value"in S&&o(g,"value",v.value,S.value,q)}},re=(g,v,S,B,q,V,Z,R,x)=>{const N=v.el=g?g.el:a(""),te=v.anchor=g?g.anchor:a("");let{patchFlag:X,dynamicChildren:oe,slotScopeIds:ye}=v;ye&&(R=R?R.concat(ye):ye),g==null?(r(N,S,B),r(te,S,B),_e(v.children||[],S,te,q,V,Z,R,x)):X>0&&X&64&&oe&&g.dynamicChildren&&g.dynamicChildren.length===oe.length?(ne(g.dynamicChildren,oe,S,q,V,Z,R),(v.key!=null||q&&v===q.subTree)&&Ua(g,v,!0)):Ne(g,v,S,te,q,V,Z,R,x)},Le=(g,v,S,B,q,V,Z,R,x)=>{v.slotScopeIds=R,g==null?v.shapeFlag&512?q.ctx.activate(v,S,B,Z,x):je(v,S,B,q,V,Z,x):Xe(g,v,x)},je=(g,v,S,B,q,V,Z)=>{const R=g.component=Fp(g,B,q);if(Qo(g)&&(R.ctx.renderer=me),Up(R,!1,Z),R.asyncDep){if(q&&q.registerDep(R,Ee,Z),!g.el){const x=R.subTree=Ie(Wt);Y(null,x,v,S),g.placeholder=x.el}}else Ee(R,g,v,S,q,V,Z)},Xe=(g,v,S)=>{const B=v.component=g.component;if(kp(g,v,S))if(B.asyncDep&&!B.asyncResolved){ke(B,v,S);return}else B.next=v,B.update();else v.el=g.el,B.vnode=v},Ee=(g,v,S,B,q,V,Z)=>{const R=()=>{if(g.isMounted){let{next:X,bu:oe,u:ye,parent:Se,vnode:Ye}=g;{const z=bd(g);if(z){X&&(X.el=Ye.el,ke(g,X,Z)),z.asyncDep.then(()=>{Ht(()=>{g.isUnmounted||N()},q)});return}}let Ce=X,Je;xr(g,!1),X?(X.el=Ye.el,ke(g,X,Z)):X=Ye,oe&&yo(oe),(Je=X.props&&X.props.onVnodeBeforeUpdate)&&In(Je,Se,X,Ye),xr(g,!0);const ot=Pl(g),F=g.subTree;g.subTree=ot,P(F,ot,f(F.el),U(F),g,q,V),X.el=ot.el,Ce===null&&Tp(g,ot.el),ye&&Ht(ye,q),(Je=X.props&&X.props.onVnodeUpdated)&&Ht(()=>In(Je,Se,X,Ye),q)}else{let X;const{el:oe,props:ye}=v,{bm:Se,m:Ye,parent:Ce,root:Je,type:ot}=g,F=rs(v);xr(g,!1),Se&&yo(Se),!F&&(X=ye&&ye.onVnodeBeforeMount)&&In(X,Ce,v),xr(g,!0);{Je.ce&&Je.ce._hasShadowRoot()&&Je.ce._injectChildStyle(ot);const z=g.subTree=Pl(g);P(null,z,S,B,g,q,V),v.el=z.el}if(Ye&&Ht(Ye,q),!F&&(X=ye&&ye.onVnodeMounted)){const z=v;Ht(()=>In(X,Ce,z),q)}(v.shapeFlag&256||Ce&&rs(Ce.vnode)&&Ce.vnode.shapeFlag&256)&&g.a&&Ht(g.a,q),g.isMounted=!0,v=S=B=null}};g.scope.on();const x=g.effect=new Su(R);g.scope.off();const N=g.update=x.run.bind(x),te=g.job=x.runIfDirty.bind(x);te.i=g,te.id=g.uid,x.scheduler=()=>ja(te),xr(g,!0),N()},ke=(g,v,S)=>{v.component=g;const B=g.vnode.props;g.vnode=v,g.next=null,Sp(g,v.props,B,S),Rp(g,v.children,S),Kn(),yl(g),Jn()},Ne=(g,v,S,B,q,V,Z,R,x=!1)=>{const N=g&&g.children,te=g?g.shapeFlag:0,X=v.children,{patchFlag:oe,shapeFlag:ye}=v;if(oe>0){if(oe&128){rt(N,X,S,B,q,V,Z,R,x);return}else if(oe&256){ze(N,X,S,B,q,V,Z,R,x);return}}ye&8?(te&16&&Ke(N,q,V),X!==N&&c(S,X)):te&16?ye&16?rt(N,X,S,B,q,V,Z,R,x):Ke(N,q,V,!0):(te&8&&c(S,""),ye&16&&_e(X,S,B,q,V,Z,R,x))},ze=(g,v,S,B,q,V,Z,R,x)=>{g=g||es,v=v||es;const N=g.length,te=v.length,X=Math.min(N,te);let oe;for(oe=0;oe<X;oe++){const ye=v[oe]=x?Hn(v[oe]):Cn(v[oe]);P(g[oe],ye,S,null,q,V,Z,R,x)}N>te?Ke(g,q,V,!0,!1,X):_e(v,S,B,q,V,Z,R,x,X)},rt=(g,v,S,B,q,V,Z,R,x)=>{let N=0;const te=v.length;let X=g.length-1,oe=te-1;for(;N<=X&&N<=oe;){const ye=g[N],Se=v[N]=x?Hn(v[N]):Cn(v[N]);if(Lr(ye,Se))P(ye,Se,S,null,q,V,Z,R,x);else break;N++}for(;N<=X&&N<=oe;){const ye=g[X],Se=v[oe]=x?Hn(v[oe]):Cn(v[oe]);if(Lr(ye,Se))P(ye,Se,S,null,q,V,Z,R,x);else break;X--,oe--}if(N>X){if(N<=oe){const ye=oe+1,Se=ye<te?v[ye].el:B;for(;N<=oe;)P(null,v[N]=x?Hn(v[N]):Cn(v[N]),S,Se,q,V,Z,R,x),N++}}else if(N>oe)for(;N<=X;)et(g[N],q,V,!0),N++;else{const ye=N,Se=N,Ye=new Map;for(N=Se;N<=oe;N++){const lt=v[N]=x?Hn(v[N]):Cn(v[N]);lt.key!=null&&Ye.set(lt.key,N)}let Ce,Je=0;const ot=oe-Se+1;let F=!1,z=0;const se=new Array(ot);for(N=0;N<ot;N++)se[N]=0;for(N=ye;N<=X;N++){const lt=g[N];if(Je>=ot){et(lt,q,V,!0);continue}let yt;if(lt.key!=null)yt=Ye.get(lt.key);else for(Ce=Se;Ce<=oe;Ce++)if(se[Ce-Se]===0&&Lr(lt,v[Ce])){yt=Ce;break}yt===void 0?et(lt,q,V,!0):(se[yt-Se]=N+1,yt>=z?z=yt:F=!0,P(lt,v[yt],S,null,q,V,Z,R,x),Je++)}const Qe=F?Op(se):es;for(Ce=Qe.length-1,N=ot-1;N>=0;N--){const lt=Se+N,yt=v[lt],At=v[lt+1],dn=lt+1<te?At.el||_d(At):B;se[N]===0?P(null,yt,S,dn,q,V,Z,R,x):F&&(Ce<0||N!==Qe[Ce]?Ze(yt,S,dn,2):Ce--)}}},Ze=(g,v,S,B,q=null)=>{const{el:V,type:Z,transition:R,children:x,shapeFlag:N}=g;if(N&6){Ze(g.component.subTree,v,S,B);return}if(N&128){g.suspense.move(v,S,B);return}if(N&64){Z.move(g,v,S,me);return}if(Z===He){r(V,v,S);for(let X=0;X<x.length;X++)Ze(x[X],v,S,B);r(g.anchor,v,S);return}if(Z===bi){W(g,v,S);return}if(B!==2&&N&1&&R)if(B===0)R.beforeEnter(V),r(V,v,S),Ht(()=>R.enter(V),q);else{const{leave:X,delayLeave:oe,afterLeave:ye}=R,Se=()=>{g.ctx.isUnmounted?s(V):r(V,v,S)},Ye=()=>{V._isLeaving&&V[En](!0),X(V,()=>{Se(),ye&&ye()})};oe?oe(V,Se,Ye):Ye()}else r(V,v,S)},et=(g,v,S,B=!1,q=!1)=>{const{type:V,props:Z,ref:R,children:x,dynamicChildren:N,shapeFlag:te,patchFlag:X,dirs:oe,cacheIndex:ye}=g;if(X===-2&&(q=!1),R!=null&&(Kn(),Ns(R,null,S,g,!0),Jn()),ye!=null&&(v.renderCache[ye]=void 0),te&256){v.ctx.deactivate(g);return}const Se=te&1&&oe,Ye=!rs(g);let Ce;if(Ye&&(Ce=Z&&Z.onVnodeBeforeUnmount)&&In(Ce,v,g),te&6)Ge(g.component,S,B);else{if(te&128){g.suspense.unmount(S,B);return}Se&&Pr(g,null,v,"beforeUnmount"),te&64?g.type.remove(g,v,S,me,B):N&&!N.hasOnce&&(V!==He||X>0&&X&64)?Ke(N,v,S,!1,!0):(V===He&&X&384||!q&&te&16)&&Ke(x,v,S),B&&ht(g)}(Ye&&(Ce=Z&&Z.onVnodeUnmounted)||Se)&&Ht(()=>{Ce&&In(Ce,v,g),Se&&Pr(g,null,v,"unmounted")},S)},ht=g=>{const{type:v,el:S,anchor:B,transition:q}=g;if(v===He){St(S,B);return}if(v===bi){j(g);return}const V=()=>{s(S),q&&!q.persisted&&q.afterLeave&&q.afterLeave()};if(g.shapeFlag&1&&q&&!q.persisted){const{leave:Z,delayLeave:R}=q,x=()=>Z(S,V);R?R(g.el,V,x):x()}else V()},St=(g,v)=>{let S;for(;g!==v;)S=h(g),s(g),g=S;s(v)},Ge=(g,v,S)=>{const{bum:B,scope:q,job:V,subTree:Z,um:R,m:x,a:N}=g;Ol(x),Ol(N),B&&yo(B),q.stop(),V&&(V.flags|=8,et(Z,g,v,S)),R&&Ht(R,v),Ht(()=>{g.isUnmounted=!0},v)},Ke=(g,v,S,B=!1,q=!1,V=0)=>{for(let Z=V;Z<g.length;Z++)et(g[Z],v,S,B,q)},U=g=>{if(g.shapeFlag&6)return U(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const v=h(g.anchor||g.el),S=v&&v[Ju];return S?h(S):v};let he=!1;const ce=(g,v,S)=>{let B;g==null?v._vnode&&(et(v._vnode,null,null,!0),B=v._vnode.component):P(v._vnode||null,g,v,null,null,null,S),v._vnode=g,he||(he=!0,yl(B),Wu(),he=!1)},me={p:P,um:et,m:Ze,r:ht,mt:je,mc:_e,pc:Ne,pbc:ne,n:U,o:e};return{render:ce,hydrate:void 0,createApp:gp(ce)}}function wi({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 Mp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Ua(e,t,n=!1){const r=e.children,s=t.children;if(De(r)&&De(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]=Hn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&Ua(i,a)),a.type===ti&&(a.patchFlag===-1&&(a=s[o]=Hn(a)),a.el=i.el),a.type===Wt&&!a.el&&(a.el=i.el)}}function Op(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 bd(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:bd(t)}function Ol(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function _d(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?_d(t.subTree):null}const kd=e=>e.__isSuspense;function Np(e,t){t&&t.pendingBranch?De(e)?t.effects.push(...e):t.effects.push(e):Uh(e)}const He=Symbol.for("v-fgt"),ti=Symbol.for("v-txt"),Wt=Symbol.for("v-cmt"),bi=Symbol.for("v-stc"),Ds=[];let sn=null;function w(e=!1){Ds.push(sn=e?null:[])}function $p(){Ds.pop(),sn=Ds[Ds.length-1]||null}let Ws=1;function No(e,t=!1){Ws+=e,e<0&&sn&&t&&(sn.hasOnce=!0)}function Td(e){return e.dynamicChildren=Ws>0?sn||es:null,$p(),Ws>0&&sn&&sn.push(e),e}function T(e,t,n,r,s,o){return Td(m(e,t,n,r,s,o,!0))}function vt(e,t,n,r,s){return Td(Ie(e,t,n,r,s,!0))}function qs(e){return e?e.__v_isVNode===!0:!1}function Lr(e,t){return e.type===t.type&&e.key===t.key}const Id=({key:e})=>e??null,_o=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?It(e)||zt(e)||Ve(e)?{i:jt,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,r=0,s=null,o=e===He?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Id(t),ref:t&&_o(t),scopeId:zu,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:jt};return a?(Ha(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=It(n)?8:16),Ws>0&&!i&&sn&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&sn.push(l),l}const Ie=Dp;function Dp(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===od)&&(e=Wt),qs(e)){const a=br(e,t,!0);return n&&Ha(a,n),Ws>0&&!o&&sn&&(a.shapeFlag&6?sn[sn.indexOf(e)]=a:sn.push(a)),a.patchFlag=-2,a}if(qp(e)&&(e=e.__vccOpts),t){t=Lp(t);let{class:a,style:l}=t;a&&!It(a)&&(t.class=gt(a)),ft(l)&&(La(l)&&!De(l)&&(l=Mt({},l)),t.style=Wr(l))}const i=It(e)?1:kd(e)?128:Yu(e)?64:ft(e)?4:Ve(e)?2:0;return m(e,t,n,r,s,i,o,!0)}function Lp(e){return e?La(e)||pd(e)?Mt({},e):e:null}function br(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,u=t?Sd(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&Id(u),ref:t&&t.ref?n&&o?De(o)?o.concat(_o(t)):[o,_o(t)]:_o(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!==He?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&&br(e.ssContent),ssFallback:e.ssFallback&&br(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Vs(c,l.clone(c)),c}function sa(e=" ",t=0){return Ie(ti,null,e,t)}function le(e="",t=!1){return t?(w(),vt(Wt,null,e)):Ie(Wt,null,e)}function Cn(e){return e==null||typeof e=="boolean"?Ie(Wt):De(e)?Ie(He,null,e.slice()):qs(e)?Hn(e):Ie(ti,null,String(e))}function Hn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:br(e)}function Ha(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(De(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),Ha(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!pd(t)?t._ctx=jt:s===3&&jt&&(jt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ve(t)?(t={default:t,_ctx:jt},n=32):(t=String(t),r&64?(n=16,t=[sa(t)]):n=8);e.children=t,e.shapeFlag|=n}function Sd(...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=gt([t.class,r.class]));else if(s==="style")t.style=Wr([t.style,r.style]);else if(Wo(s)){const o=t[s],i=r[s];i&&o!==i&&!(De(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function In(e,t,n,r=null){yn(e,t,7,[n,r])}const jp=cd();let Bp=0;function Fp(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||jp,o={uid:Bp++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new dh(!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:gd(r,s),emitsOptions:ud(r,s),emit:null,emitted:null,propsDefaults:bt,inheritAttrs:r.inheritAttrs,ctx:bt,data:bt,props:bt,attrs:bt,slots:bt,refs:bt,setupState:bt,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=yp.bind(null,o),e.ce&&e.ce(o),o}let qt=null;const Va=()=>qt||jt;let $o,oa;{const e=Go(),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)}};$o=t("__VUE_INSTANCE_SETTERS__",n=>qt=n),oa=t("__VUE_SSR_SETTERS__",n=>zs=n)}const to=e=>{const t=qt;return $o(e),e.scope.on(),()=>{e.scope.off(),$o(t)}},Nl=()=>{qt&&qt.scope.off(),$o(null)};function Ed(e){return e.vnode.shapeFlag&4}let zs=!1;function Up(e,t=!1,n=!1){t&&oa(t);const{props:r,children:s}=e.vnode,o=Ed(e);Ip(e,r,o,t),Ap(e,s,n||t);const i=o?Hp(e,t):void 0;return t&&oa(!1),i}function Hp(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ap);const{setup:r}=n;if(r){Kn();const s=e.setupContext=r.length>1?Ad(e):null,o=to(e),i=eo(r,e,0,[e.props,s]),a=yu(i);if(Jn(),o(),(a||e.sp)&&!rs(e)&&rd(e),a){if(i.then(Nl,Nl),t)return i.then(l=>{$l(e,l)}).catch(l=>{Yo(l,e,0)});e.asyncDep=i}else $l(e,i)}else Cd(e)}function $l(e,t,n){Ve(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ft(t)&&(e.setupState=Uu(t)),Cd(e)}function Cd(e,t,n){const r=e.type;e.render||(e.render=r.render||xn);{const s=to(e);Kn();try{up(e)}finally{Jn(),s()}}}const Vp={get(e,t){return Vt(e,"get",""),e[t]}};function Ad(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Vp),slots:e.slots,emit:e.emit,expose:t}}function ni(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Uu(xh(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in $s)return $s[n](e)},has(t,n){return n in t||n in $s}})):e.proxy}function Wp(e,t=!0){return Ve(e)?e.displayName||e.name:e.name||t&&e.__name}function qp(e){return Ve(e)&&"__vccOpts"in e}const fe=(e,t)=>Dh(e,t,zs);function Wa(e,t,n){try{No(-1);const r=arguments.length;return r===2?ft(t)&&!De(t)?qs(t)?Ie(e,null,[t]):Ie(e,t):Ie(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&qs(n)&&(n=[n]),Ie(e,t,n))}finally{No(1)}}const zp="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 ia;const Dl=typeof window<"u"&&window.trustedTypes;if(Dl)try{ia=Dl.createPolicy("vue",{createHTML:e=>e})}catch{}const Rd=ia?e=>ia.createHTML(e):e=>e,Gp="http://www.w3.org/2000/svg",Kp="http://www.w3.org/1998/Math/MathML",Un=typeof document<"u"?document:null,Ll=Un&&Un.createElement("template"),Jp={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"?Un.createElementNS(Gp,e):t==="mathml"?Un.createElementNS(Kp,e):n?Un.createElement(e,{is:n}):Un.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>Un.createTextNode(e),createComment:e=>Un.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Un.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{Ll.innerHTML=Rd(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Ll.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]}},ir="transition",Ss="animation",Gs=Symbol("_vtc"),Pd={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},Yp=Mt({},Xu,Pd),Qp=e=>(e.displayName="Transition",e.props=Yp,e),xd=Qp((e,{slots:t})=>Wa(Kh,Xp(e),t)),Mr=(e,t=[])=>{De(e)?e.forEach(n=>n(...t)):e&&e(...t)},jl=e=>e?De(e)?e.some(t=>t.length>1):e.length>1:!1;function Xp(e){const t={};for(const re in e)re in Pd||(t[re]=e[re]);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:b=`${n}-leave-to`}=e,$=Zp(s),P=$&&$[0],H=$&&$[1],{onBeforeEnter:Y,onEnter:D,onEnterCancelled:W,onLeave:j,onLeaveCancelled:ue,onBeforeAppear:ae=Y,onAppear:ve=D,onAppearCancelled:_e=W}=t,ie=(re,Le,je,Xe)=>{re._enterCancelled=Xe,Or(re,Le?c:a),Or(re,Le?u:i),je&&je()},ne=(re,Le)=>{re._isLeaving=!1,Or(re,f),Or(re,b),Or(re,h),Le&&Le()},Te=re=>(Le,je)=>{const Xe=re?ve:D,Ee=()=>ie(Le,re,je);Mr(Xe,[Le,Ee]),Bl(()=>{Or(Le,re?l:o),Bn(Le,re?c:a),jl(Xe)||Fl(Le,r,P,Ee)})};return Mt(t,{onBeforeEnter(re){Mr(Y,[re]),Bn(re,o),Bn(re,i)},onBeforeAppear(re){Mr(ae,[re]),Bn(re,l),Bn(re,u)},onEnter:Te(!1),onAppear:Te(!0),onLeave(re,Le){re._isLeaving=!0;const je=()=>ne(re,Le);Bn(re,f),re._enterCancelled?(Bn(re,h),Vl(re)):(Vl(re),Bn(re,h)),Bl(()=>{re._isLeaving&&(Or(re,f),Bn(re,b),jl(j)||Fl(re,r,H,je))}),Mr(j,[re,je])},onEnterCancelled(re){ie(re,!1,void 0,!0),Mr(W,[re])},onAppearCancelled(re){ie(re,!0,void 0,!0),Mr(_e,[re])},onLeaveCancelled(re){ne(re),Mr(ue,[re])}})}function Zp(e){if(e==null)return null;if(ft(e))return[_i(e.enter),_i(e.leave)];{const t=_i(e);return[t,t]}}function _i(e){return rh(e)}function Bn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Gs]||(e[Gs]=new Set)).add(t)}function Or(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Gs];n&&(n.delete(t),n.size||(e[Gs]=void 0))}function Bl(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let em=0;function Fl(e,t,n,r){const s=e._endId=++em,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=tm(e,t);if(!i)return r();const u=i+"end";let c=0;const f=()=>{e.removeEventListener(u,h),o()},h=b=>{b.target===e&&++c>=l&&f()};setTimeout(()=>{c<l&&f()},a+1),e.addEventListener(u,h)}function tm(e,t){const n=window.getComputedStyle(e),r=$=>(n[$]||"").split(", "),s=r(`${ir}Delay`),o=r(`${ir}Duration`),i=Ul(s,o),a=r(`${Ss}Delay`),l=r(`${Ss}Duration`),u=Ul(a,l);let c=null,f=0,h=0;t===ir?i>0&&(c=ir,f=i,h=o.length):t===Ss?u>0&&(c=Ss,f=u,h=l.length):(f=Math.max(i,u),c=f>0?i>u?ir:Ss:null,h=c?c===ir?o.length:l.length:0);const b=c===ir&&/\b(?:transform|all)(?:,|$)/.test(r(`${ir}Property`).toString());return{type:c,timeout:f,propCount:h,hasTransform:b}}function Ul(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Hl(n)+Hl(e[r])))}function Hl(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Vl(e){return(e?e.ownerDocument:document).body.offsetHeight}function nm(e,t,n){const r=e[Gs];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Wl=Symbol("_vod"),rm=Symbol("_vsh"),sm=Symbol(""),om=/(?:^|;)\s*display\s*:/;function im(e,t,n){const r=e.style,s=It(n);let o=!1;if(n&&!s){if(t)if(It(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&ko(r,a,"")}else for(const i in t)n[i]==null&&ko(r,i,"");for(const i in n)i==="display"&&(o=!0),ko(r,i,n[i])}else if(s){if(t!==n){const i=r[sm];i&&(n+=";"+i),r.cssText=n,o=om.test(n)}}else t&&e.removeAttribute("style");Wl in e&&(e[Wl]=o?r.display:"",e[rm]&&(r.display="none"))}const ql=/\s*!important$/;function ko(e,t,n){if(De(n))n.forEach(r=>ko(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=am(e,t);ql.test(n)?e.setProperty(_r(r),n.replace(ql,""),"important"):e[r]=n}}const zl=["Webkit","Moz","ms"],ki={};function am(e,t){const n=ki[t];if(n)return n;let r=un(t);if(r!=="filter"&&r in e)return ki[t]=r;r=zo(r);for(let s=0;s<zl.length;s++){const o=zl[s]+r;if(o in e)return ki[t]=o}return t}const Gl="http://www.w3.org/1999/xlink";function Kl(e,t,n,r,s,o=ch(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Gl,t.slice(6,t.length)):e.setAttributeNS(Gl,t,n):n==null||o&&!ku(n)?e.removeAttribute(t):e.setAttribute(t,o?"":gn(n)?String(n):n)}function Jl(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Rd(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=ku(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 Xr(e,t,n,r){e.addEventListener(t,n,r)}function lm(e,t,n,r){e.removeEventListener(t,n,r)}const Yl=Symbol("_vei");function cm(e,t,n,r,s=null){const o=e[Yl]||(e[Yl]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=um(t);if(r){const u=o[t]=hm(r,s);Xr(e,a,u,l)}else i&&(lm(e,a,i,l),o[t]=void 0)}}const Ql=/(?:Once|Passive|Capture)$/;function um(e){let t;if(Ql.test(e)){t={};let r;for(;r=e.match(Ql);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):_r(e.slice(2)),t]}let Ti=0;const dm=Promise.resolve(),fm=()=>Ti||(dm.then(()=>Ti=0),Ti=Date.now());function hm(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;yn(pm(r,n.value),t,5,[r])};return n.value=e,n.attached=fm(),n}function pm(e,t){if(De(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 Xl=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,mm=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?nm(e,r,i):t==="style"?im(e,n,r):Wo(t)?Ea(t)||cm(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):gm(e,t,r,i))?(Jl(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Kl(e,t,r,i,o,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!It(r))?Jl(e,un(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Kl(e,t,r,i))};function gm(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Xl(t)&&Ve(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 Xl(t)&&It(n)?!1:t in e}const Zl=e=>{const t=e.props["onUpdate:modelValue"]||!1;return De(t)?n=>yo(t,n):t};function vm(e){e.target.composing=!0}function ec(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ii=Symbol("_assign");function tc(e,t,n){return t&&(e=e.trim()),n&&(e=Ra(e)),e}const Xn={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[Ii]=Zl(s);const o=r||s.props&&s.props.type==="number";Xr(e,t?"change":"input",i=>{i.target.composing||e[Ii](tc(e.value,n,o))}),(n||o)&&Xr(e,"change",()=>{e.value=tc(e.value,n,o)}),t||(Xr(e,"compositionstart",vm),Xr(e,"compositionend",ec),Xr(e,"change",ec))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[Ii]=Zl(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?Ra(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))}},ym=["ctrl","shift","alt","meta"],wm={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)=>ym.some(n=>e[`${n}Key`]&&!t.includes(n))},tt=(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=wm[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},bm={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Xt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=_r(s.key);if(t.some(i=>i===o||bm[i]===o))return e(s)}))},_m=Mt({patchProp:mm},Jp);let nc;function km(){return nc||(nc=Pp(_m))}const Tm=((...e)=>{const t=km().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Sm(r);if(!s)return;const o=t._component;!Ve(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Im(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Im(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Sm(e){return It(e)?document.querySelector(e):e}/*!
|
|
18
|
-
* vue-router v4.6.4
|
|
19
|
-
* (c) 2025 Eduardo San Martin Morote
|
|
20
|
-
* @license MIT
|
|
21
|
-
*/const Zr=typeof document<"u";function Md(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Em(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Md(e.default)}const ut=Object.assign;function Si(e,t){const n={};for(const r in t){const s=t[r];n[r]=wn(s)?s.map(e):e(s)}return n}const Ls=()=>{},wn=Array.isArray;function rc(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Od=/#/g,Cm=/&/g,Am=/\//g,Rm=/=/g,Pm=/\?/g,Nd=/\+/g,xm=/%5B/g,Mm=/%5D/g,$d=/%5E/g,Om=/%60/g,Dd=/%7B/g,Nm=/%7C/g,Ld=/%7D/g,$m=/%20/g;function qa(e){return e==null?"":encodeURI(""+e).replace(Nm,"|").replace(xm,"[").replace(Mm,"]")}function Dm(e){return qa(e).replace(Dd,"{").replace(Ld,"}").replace($d,"^")}function aa(e){return qa(e).replace(Nd,"%2B").replace($m,"+").replace(Od,"%23").replace(Cm,"%26").replace(Om,"`").replace(Dd,"{").replace(Ld,"}").replace($d,"^")}function Lm(e){return aa(e).replace(Rm,"%3D")}function jm(e){return qa(e).replace(Od,"%23").replace(Pm,"%3F")}function Bm(e){return jm(e).replace(Am,"%2F")}function Ks(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Fm=/\/$/,Um=e=>e.replace(Fm,"");function Ei(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=qm(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:Ks(i)}}function Hm(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function sc(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Vm(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&us(t.matched[r],n.matched[s])&&jd(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function us(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function jd(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Wm(e[n],t[n]))return!1;return!0}function Wm(e,t){return wn(e)?oc(e,t):wn(t)?oc(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function oc(e,t){return wn(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function qm(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 ar={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let la=(function(e){return e.pop="pop",e.push="push",e})({}),Ci=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function zm(e){if(!e)if(Zr){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Um(e)}const Gm=/^[^#]+#/;function Km(e,t){return e.replace(Gm,"#")+t}function Jm(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 ri=()=>({left:window.scrollX,top:window.scrollY});function Ym(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=Jm(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 ic(e,t){return(history.state?history.state.position-t:-1)+e}const ca=new Map;function Qm(e,t){ca.set(e,t)}function Xm(e){const t=ca.get(e);return ca.delete(e),t}function Zm(e){return typeof e=="string"||e&&typeof e=="object"}function Bd(e){return typeof e=="string"||typeof e=="symbol"}let Et=(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 Fd=Symbol("");Et.MATCHER_NOT_FOUND+"",Et.NAVIGATION_GUARD_REDIRECT+"",Et.NAVIGATION_ABORTED+"",Et.NAVIGATION_CANCELLED+"",Et.NAVIGATION_DUPLICATED+"";function ds(e,t){return ut(new Error,{type:e,[Fd]:!0},t)}function Fn(e,t){return e instanceof Error&&Fd in e&&(t==null||!!(e.type&t))}const eg=["params","query","hash"];function tg(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of eg)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function ng(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(Nd," "),o=s.indexOf("="),i=Ks(o<0?s:s.slice(0,o)),a=o<0?null:Ks(s.slice(o+1));if(i in t){let l=t[i];wn(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function ac(e){let t="";for(let n in e){const r=e[n];if(n=Lm(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(wn(r)?r.map(s=>s&&aa(s)):[r&&aa(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function rg(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=wn(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const sg=Symbol(""),lc=Symbol(""),si=Symbol(""),za=Symbol(""),ua=Symbol("");function Es(){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 fr(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(ds(Et.NAVIGATION_ABORTED,{from:n,to:t})):h instanceof Error?l(h):Zm(h)?l(ds(Et.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 Ai(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(Md(l)){const u=(l.__vccOpts||l)[t];u&&o.push(fr(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=Em(c)?c.default:c;i.mods[a]=c,i.components[a]=f;const h=(f.__vccOpts||f)[t];return h&&fr(h,n,r,i,a,s)()}))}}return o}function og(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=>us(u,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(u=>us(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 ig=()=>location.protocol+"//"+location.host;function Ud(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),sc(a,"")}return sc(n,e)+r+s}function ag(e,t,n,r){let s=[],o=[],i=null;const a=({state:h})=>{const b=Ud(e,location),$=n.value,P=t.value;let H=0;if(h){if(n.value=b,t.value=h,i&&i===$){i=null;return}H=P?h.position-P.position:0}else r(b);s.forEach(Y=>{Y(n.value,$,{delta:H,type:la.pop,direction:H?H>0?Ci.forward:Ci.back:Ci.unknown})})};function l(){i=n.value}function u(h){s.push(h);const b=()=>{const $=s.indexOf(h);$>-1&&s.splice($,1)};return o.push(b),b}function c(){if(document.visibilityState==="hidden"){const{history:h}=window;if(!h.state)return;h.replaceState(ut({},h.state,{scroll:ri()}),"")}}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 cc(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?ri():null}}function lg(e){const{history:t,location:n}=window,r={value:Ud(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:ig()+e+l;try{t[c?"replaceState":"pushState"](u,"",h),s.value=u}catch(b){console.error(b),n[c?"replace":"assign"](h)}}function i(l,u){o(l,ut({},t.state,cc(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:ri()});o(c.current,c,!0),o(l,ut({},cc(r.value,l,null),{position:c.position+1},u),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function cg(e){e=zm(e);const t=lg(e),n=ag(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:Km.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 ug(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),cg(e)}let Br=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var xt=(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})(xt||{});const dg={type:Br.Static,value:""},fg=/[a-zA-Z0-9_]/;function hg(e){if(!e)return[[]];if(e==="/")return[[dg]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(b){throw new Error(`ERR (${n})/"${u}": ${b}`)}let n=xt.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,u="",c="";function f(){u&&(n===xt.Static?o.push({type:Br.Static,value:u}):n===xt.Param||n===xt.ParamRegExp||n===xt.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!==xt.ParamRegExp){r=n,n=xt.EscapeNext;continue}switch(n){case xt.Static:l==="/"?(u&&f(),i()):l===":"?(f(),n=xt.Param):h();break;case xt.EscapeNext:h(),n=r;break;case xt.Param:l==="("?n=xt.ParamRegExp:fg.test(l)?h():(f(),n=xt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case xt.ParamRegExp:l===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+l:n=xt.ParamRegExpEnd:c+=l;break;case xt.ParamRegExpEnd:f(),n=xt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===xt.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),f(),i(),s}const uc="[^/]+?",pg={sensitive:!1,strict:!1,start:!0,end:!0};var Yt=(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})(Yt||{});const mg=/[.+*?^${}()[\]/\\]/g;function gg(e,t){const n=ut({},pg,t),r=[];let s=n.start?"^":"";const o=[];for(const u of e){const c=u.length?[]:[Yt.Root];n.strict&&!u.length&&(s+="/");for(let f=0;f<u.length;f++){const h=u[f];let b=Yt.Segment+(n.sensitive?Yt.BonusCaseSensitive:0);if(h.type===Br.Static)f||(s+="/"),s+=h.value.replace(mg,"\\$&"),b+=Yt.Static;else if(h.type===Br.Param){const{value:$,repeatable:P,optional:H,regexp:Y}=h;o.push({name:$,repeatable:P,optional:H});const D=Y||uc;if(D!==uc){b+=Yt.BonusCustomRegExp;try{`${D}`}catch(j){throw new Error(`Invalid custom RegExp for param "${$}" (${D}): `+j.message)}}let W=P?`((?:${D})(?:/(?:${D}))*)`:`(${D})`;f||(W=H&&u.length<2?`(?:/${W})`:"/"+W),H&&(W+="?"),s+=W,b+=Yt.Dynamic,H&&(b+=Yt.BonusOptional),P&&(b+=Yt.BonusRepeatable),D===".*"&&(b+=Yt.BonusWildcard)}c.push(b)}r.push(c)}if(n.strict&&n.end){const u=r.length-1;r[u][r[u].length-1]+=Yt.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 b=c[h]||"",$=o[h-1];f[$.name]=b&&$.repeatable?b.split("/"):b}return f}function l(u){let c="",f=!1;for(const h of e){(!f||!c.endsWith("/"))&&(c+="/"),f=!1;for(const b of h)if(b.type===Br.Static)c+=b.value;else if(b.type===Br.Param){const{value:$,repeatable:P,optional:H}=b,Y=$ in u?u[$]:"";if(wn(Y)&&!P)throw new Error(`Provided param "${$}" is an array but it is not repeatable (* or + modifiers)`);const D=wn(Y)?Y.join("/"):Y;if(!D)if(H)h.length<2&&(c.endsWith("/")?c=c.slice(0,-1):f=!0);else throw new Error(`Missing required param "${$}"`);c+=D}}return c||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function vg(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]===Yt.Static+Yt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Yt.Static+Yt.Segment?1:-1:0}function Hd(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=vg(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(dc(r))return 1;if(dc(s))return-1}return s.length-r.length}function dc(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const yg={strict:!1,end:!0,sensitive:!1};function wg(e,t,n){const r=gg(hg(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 bg(e,t){const n=[],r=new Map;t=rc(yg,t);function s(f){return r.get(f)}function o(f,h,b){const $=!b,P=hc(f);P.aliasOf=b&&b.record;const H=rc(t,f),Y=[P];if("alias"in f){const j=typeof f.alias=="string"?[f.alias]:f.alias;for(const ue of j)Y.push(hc(ut({},P,{components:b?b.record.components:P.components,path:ue,aliasOf:b?b.record:P})))}let D,W;for(const j of Y){const{path:ue}=j;if(h&&ue[0]!=="/"){const ae=h.record.path,ve=ae[ae.length-1]==="/"?"":"/";j.path=h.record.path+(ue&&ve+ue)}if(D=wg(j,h,H),b?b.alias.push(D):(W=W||D,W!==D&&W.alias.push(D),$&&f.name&&!pc(D)&&i(f.name)),Vd(D)&&l(D),P.children){const ae=P.children;for(let ve=0;ve<ae.length;ve++)o(ae[ve],D,b&&b.children[ve])}b=b||D}return W?()=>{i(W)}:Ls}function i(f){if(Bd(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=Tg(f,n);n.splice(h,0,f),f.record.name&&!pc(f)&&r.set(f.record.name,f)}function u(f,h){let b,$={},P,H;if("name"in f&&f.name){if(b=r.get(f.name),!b)throw ds(Et.MATCHER_NOT_FOUND,{location:f});H=b.record.name,$=ut(fc(h.params,b.keys.filter(W=>!W.optional).concat(b.parent?b.parent.keys.filter(W=>W.optional):[]).map(W=>W.name)),f.params&&fc(f.params,b.keys.map(W=>W.name))),P=b.stringify($)}else if(f.path!=null)P=f.path,b=n.find(W=>W.re.test(P)),b&&($=b.parse(P),H=b.record.name);else{if(b=h.name?r.get(h.name):n.find(W=>W.re.test(h.path)),!b)throw ds(Et.MATCHER_NOT_FOUND,{location:f,currentLocation:h});H=b.record.name,$=ut({},h.params,f.params),P=b.stringify($)}const Y=[];let D=b;for(;D;)Y.unshift(D.record),D=D.parent;return{name:H,path:P,params:$,matched:Y,meta:kg(Y)}}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 fc(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function hc(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:_g(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 _g(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 pc(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function kg(e){return e.reduce((t,n)=>ut(t,n.meta),{})}function Tg(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;Hd(e,t[o])<0?r=o:n=o+1}const s=Ig(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Ig(e){let t=e;for(;t=t.parent;)if(Vd(t)&&Hd(e,t)===0)return t}function Vd({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function mc(e){const t=pn(si),n=pn(za),r=fe(()=>{const l=$e(e.to);return t.resolve(l)}),s=fe(()=>{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(us.bind(null,c));if(h>-1)return h;const b=gc(l[u-2]);return u>1&&gc(c)===b&&f[f.length-1].path!==b?f.findIndex(us.bind(null,l[u-2])):h}),o=fe(()=>s.value>-1&&Rg(n.params,r.value.params)),i=fe(()=>s.value>-1&&s.value===n.matched.length-1&&jd(n.params,r.value.params));function a(l={}){if(Ag(l)){const u=t[$e(e.replace)?"replace":"push"]($e(e.to)).catch(Ls);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:r,href:fe(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function Sg(e){return e.length===1?e[0]:e}const Eg=$t({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:mc,setup(e,{slots:t}){const n=Jo(mc(e)),{options:r}=pn(si),s=fe(()=>({[vc(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[vc(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Sg(t.default(n));return e.custom?o:Wa("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),Cg=Eg;function Ag(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 Rg(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(!wn(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function gc(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const vc=(e,t,n)=>e??t??n,Pg=$t({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=pn(ua),s=fe(()=>e.route||r.value),o=pn(lc,0),i=fe(()=>{let u=$e(o);const{matched:c}=s.value;let f;for(;(f=c[u])&&!f.components;)u++;return u}),a=fe(()=>s.value.matched[i.value]);wo(lc,fe(()=>i.value+1)),wo(sg,a),wo(ua,s);const l=L();return mt(()=>[l.value,a.value,e.name],([u,c,f],[h,b,$])=>{c&&(c.instances[f]=u,b&&b!==c&&u&&u===h&&(c.leaveGuards.size||(c.leaveGuards=b.leaveGuards),c.updateGuards.size||(c.updateGuards=b.updateGuards))),u&&c&&(!b||!us(c,b)||!h)&&(c.enterCallbacks[f]||[]).forEach(P=>P(u))},{flush:"post"}),()=>{const u=s.value,c=e.name,f=a.value,h=f&&f.components[c];if(!h)return yc(n.default,{Component:h,route:u});const b=f.props[c],$=b?b===!0?u.params:typeof b=="function"?b(u):b:null,H=Wa(h,ut({},$,t,{onVnodeUnmounted:Y=>{Y.component.isUnmounted&&(f.instances[c]=null)},ref:l}));return yc(n.default,{Component:H,route:u})||H}}});function yc(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const xg=Pg;function Mg(e){const t=bg(e.routes,e),n=e.parseQuery||ng,r=e.stringifyQuery||ac,s=e.history,o=Es(),i=Es(),a=Es(),l=Mh(ar);let u=ar;Zr&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Si.bind(null,U=>""+U),f=Si.bind(null,Bm),h=Si.bind(null,Ks);function b(U,he){let ce,me;return Bd(U)?(ce=t.getRecordMatcher(U),me=he):me=U,t.addRoute(me,ce)}function $(U){const he=t.getRecordMatcher(U);he&&t.removeRoute(he)}function P(){return t.getRoutes().map(U=>U.record)}function H(U){return!!t.getRecordMatcher(U)}function Y(U,he){if(he=ut({},he||l.value),typeof U=="string"){const S=Ei(n,U,he.path),B=t.resolve({path:S.path},he),q=s.createHref(S.fullPath);return ut(S,B,{params:h(B.params),hash:Ks(S.hash),redirectedFrom:void 0,href:q})}let ce;if(U.path!=null)ce=ut({},U,{path:Ei(n,U.path,he.path).path});else{const S=ut({},U.params);for(const B in S)S[B]==null&&delete S[B];ce=ut({},U,{params:f(S)}),he.params=f(he.params)}const me=t.resolve(ce,he),Oe=U.hash||"";me.params=c(h(me.params));const g=Hm(r,ut({},U,{hash:Dm(Oe),path:me.path})),v=s.createHref(g);return ut({fullPath:g,hash:Oe,query:r===ac?rg(U.query):U.query||{}},me,{redirectedFrom:void 0,href:v})}function D(U){return typeof U=="string"?Ei(n,U,l.value.path):ut({},U)}function W(U,he){if(u!==U)return ds(Et.NAVIGATION_CANCELLED,{from:he,to:U})}function j(U){return ve(U)}function ue(U){return j(ut(D(U),{replace:!0}))}function ae(U,he){const ce=U.matched[U.matched.length-1];if(ce&&ce.redirect){const{redirect:me}=ce;let Oe=typeof me=="function"?me(U,he):me;return typeof Oe=="string"&&(Oe=Oe.includes("?")||Oe.includes("#")?Oe=D(Oe):{path:Oe},Oe.params={}),ut({query:U.query,hash:U.hash,params:Oe.path!=null?{}:U.params},Oe)}}function ve(U,he){const ce=u=Y(U),me=l.value,Oe=U.state,g=U.force,v=U.replace===!0,S=ae(ce,me);if(S)return ve(ut(D(S),{state:typeof S=="object"?ut({},Oe,S.state):Oe,force:g,replace:v}),he||ce);const B=ce;B.redirectedFrom=he;let q;return!g&&Vm(r,me,ce)&&(q=ds(Et.NAVIGATION_DUPLICATED,{to:B,from:me}),Ze(me,me,!0,!1)),(q?Promise.resolve(q):ne(B,me)).catch(V=>Fn(V)?Fn(V,Et.NAVIGATION_GUARD_REDIRECT)?V:rt(V):Ne(V,B,me)).then(V=>{if(V){if(Fn(V,Et.NAVIGATION_GUARD_REDIRECT))return ve(ut({replace:v},D(V.to),{state:typeof V.to=="object"?ut({},Oe,V.to.state):Oe,force:g}),he||B)}else V=re(B,me,!0,v,Oe);return Te(B,me,V),V})}function _e(U,he){const ce=W(U,he);return ce?Promise.reject(ce):Promise.resolve()}function ie(U){const he=St.values().next().value;return he&&typeof he.runWithContext=="function"?he.runWithContext(U):U()}function ne(U,he){let ce;const[me,Oe,g]=og(U,he);ce=Ai(me.reverse(),"beforeRouteLeave",U,he);for(const S of me)S.leaveGuards.forEach(B=>{ce.push(fr(B,U,he))});const v=_e.bind(null,U,he);return ce.push(v),Ke(ce).then(()=>{ce=[];for(const S of o.list())ce.push(fr(S,U,he));return ce.push(v),Ke(ce)}).then(()=>{ce=Ai(Oe,"beforeRouteUpdate",U,he);for(const S of Oe)S.updateGuards.forEach(B=>{ce.push(fr(B,U,he))});return ce.push(v),Ke(ce)}).then(()=>{ce=[];for(const S of g)if(S.beforeEnter)if(wn(S.beforeEnter))for(const B of S.beforeEnter)ce.push(fr(B,U,he));else ce.push(fr(S.beforeEnter,U,he));return ce.push(v),Ke(ce)}).then(()=>(U.matched.forEach(S=>S.enterCallbacks={}),ce=Ai(g,"beforeRouteEnter",U,he,ie),ce.push(v),Ke(ce))).then(()=>{ce=[];for(const S of i.list())ce.push(fr(S,U,he));return ce.push(v),Ke(ce)}).catch(S=>Fn(S,Et.NAVIGATION_CANCELLED)?S:Promise.reject(S))}function Te(U,he,ce){a.list().forEach(me=>ie(()=>me(U,he,ce)))}function re(U,he,ce,me,Oe){const g=W(U,he);if(g)return g;const v=he===ar,S=Zr?history.state:{};ce&&(me||v?s.replace(U.fullPath,ut({scroll:v&&S&&S.scroll},Oe)):s.push(U.fullPath,Oe)),l.value=U,Ze(U,he,ce,v),rt()}let Le;function je(){Le||(Le=s.listen((U,he,ce)=>{if(!Ge.listening)return;const me=Y(U),Oe=ae(me,Ge.currentRoute.value);if(Oe){ve(ut(Oe,{replace:!0,force:!0}),me).catch(Ls);return}u=me;const g=l.value;Zr&&Qm(ic(g.fullPath,ce.delta),ri()),ne(me,g).catch(v=>Fn(v,Et.NAVIGATION_ABORTED|Et.NAVIGATION_CANCELLED)?v:Fn(v,Et.NAVIGATION_GUARD_REDIRECT)?(ve(ut(D(v.to),{force:!0}),me).then(S=>{Fn(S,Et.NAVIGATION_ABORTED|Et.NAVIGATION_DUPLICATED)&&!ce.delta&&ce.type===la.pop&&s.go(-1,!1)}).catch(Ls),Promise.reject()):(ce.delta&&s.go(-ce.delta,!1),Ne(v,me,g))).then(v=>{v=v||re(me,g,!1),v&&(ce.delta&&!Fn(v,Et.NAVIGATION_CANCELLED)?s.go(-ce.delta,!1):ce.type===la.pop&&Fn(v,Et.NAVIGATION_ABORTED|Et.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),Te(me,g,v)}).catch(Ls)}))}let Xe=Es(),Ee=Es(),ke;function Ne(U,he,ce){rt(U);const me=Ee.list();return me.length?me.forEach(Oe=>Oe(U,he,ce)):console.error(U),Promise.reject(U)}function ze(){return ke&&l.value!==ar?Promise.resolve():new Promise((U,he)=>{Xe.add([U,he])})}function rt(U){return ke||(ke=!U,je(),Xe.list().forEach(([he,ce])=>U?ce(U):he()),Xe.reset()),U}function Ze(U,he,ce,me){const{scrollBehavior:Oe}=e;if(!Zr||!Oe)return Promise.resolve();const g=!ce&&Xm(ic(U.fullPath,0))||(me||!ce)&&history.state&&history.state.scroll||null;return on().then(()=>Oe(U,he,g)).then(v=>v&&Ym(v)).catch(v=>Ne(v,U,he))}const et=U=>s.go(U);let ht;const St=new Set,Ge={currentRoute:l,listening:!0,addRoute:b,removeRoute:$,clearRoutes:t.clearRoutes,hasRoute:H,getRoutes:P,resolve:Y,options:e,push:j,replace:ue,go:et,back:()=>et(-1),forward:()=>et(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Ee.add,isReady:ze,install(U){U.component("RouterLink",Cg),U.component("RouterView",xg),U.config.globalProperties.$router=Ge,Object.defineProperty(U.config.globalProperties,"$route",{enumerable:!0,get:()=>$e(l)}),Zr&&!ht&&l.value===ar&&(ht=!0,j(s.location).catch(me=>{}));const he={};for(const me in ar)Object.defineProperty(he,me,{get:()=>l.value[me],enumerable:!0});U.provide(si,Ge),U.provide(za,Bu(he)),U.provide(ua,l);const ce=U.unmount;St.add(U),U.unmount=function(){St.delete(U),St.size<1&&(u=ar,Le&&Le(),Le=null,l.value=ar,ht=!1,ke=!1),ce()}}};function Ke(U){return U.reduce((he,ce)=>he.then(()=>ie(ce)),Promise.resolve())}return Ge}function Og(){return pn(si)}function Ng(e){return pn(za)}const wc=768;function Wd(){const e=L(typeof window<"u"?window.innerWidth<wc:!1);let t=null;function n(r){e.value=r.matches}return nr(()=>{t=window.matchMedia(`(max-width: ${wc-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),Zo(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const $g={key:0,class:"desktop-sidebar"},Dg={class:"desktop-main"},bc="codex-web-local.sidebar-width.v1",Lg=260,jg=620,_c=320,Bg=$t({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Wd();function r(u){return Math.min(jg,Math.max(Lg,u))}function s(){if(typeof window>"u")return _c;const u=window.localStorage.getItem(bc),c=Number(u);return Number.isFinite(c)?r(c):_c}const o=L(s()),i=fe(()=>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(bc,String(u))}function l(u){u.preventDefault();const c=u.clientX,f=o.value,h=$=>{const P=$.clientX-c;o.value=r(f+P)},b=()=>{a(o.value),window.removeEventListener("mousemove",h),window.removeEventListener("mouseup",b)};window.addEventListener("mousemove",h),window.addEventListener("mouseup",b)}return(u,c)=>(w(),T("div",{class:gt(["desktop-layout",{"is-mobile":$e(n)}]),style:Wr(i.value)},[$e(n)?(w(),vt(xo,{key:0,to:"body"},[Ie(xd,{name:"drawer"},{default:pt(()=>[e.isSidebarCollapsed?le("",!0):(w(),T("div",{key:0,class:"mobile-drawer-backdrop",onClick:c[1]||(c[1]=f=>u.$emit("close-sidebar"))},[m("aside",{class:"mobile-drawer",onClick:c[0]||(c[0]=tt(()=>{},["stop"]))},[Pn(u.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):le("",!0),$e(n)?le("",!0):(w(),T(He,{key:1},[e.isSidebarCollapsed?le("",!0):(w(),T("aside",$g,[Pn(u.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?le("",!0):(w(),T("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),m("section",Dg,[Pn(u.$slots,"content",{},void 0)])],6))}}),nt=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},Fg=nt(Bg,[["__scopeId","data-v-df29c633"]]),Ug={},Hg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Vg(e,t){return w(),T("svg",Hg,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const oi=nt(Ug,[["render",Vg]]),Wg={},qg={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function zg(e,t){return w(),T("svg",qg,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const qd=nt(Wg,[["render",zg]]),Gg={},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]=[m("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 Cs=nt(Gg,[["render",Jg]]),Yg={},Qg={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function Xg(e,t){return w(),T("svg",Qg,[...t[0]||(t[0]=[m("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 Do=nt(Yg,[["render",Xg]]),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]=[m("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 zd=nt(Zg,[["render",tv]]),nv={},rv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function sv(e,t){return w(),T("svg",rv,[...t[0]||(t[0]=[m("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 ov=nt(nv,[["render",sv]]),iv={},av={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function lv(e,t){return w(),T("svg",av,[...t[0]||(t[0]=[m("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 To=nt(iv,[["render",lv]]),cv={},uv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function dv(e,t){return w(),T("svg",uv,[...t[0]||(t[0]=[m("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 Ri=nt(cv,[["render",dv]]),fv={key:0,class:"sidebar-menu-row-left"},hv={class:"sidebar-menu-row-main"},pv={key:1,class:"sidebar-menu-row-right"},mv={key:0,class:"sidebar-menu-row-right-default"},gv={key:1,class:"sidebar-menu-row-right-hover"},vv=$t({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=lp(),r=fe(()=>!!n.left),s=fe(()=>!!n.right),o=fe(()=>!!n["right-hover"]),i=fe(()=>s.value||o.value);return(a,l)=>(w(),vt(Zi(t.as),Sd({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:pt(()=>[r.value?(w(),T("span",fv,[Pn(a.$slots,"left",{},void 0,!0)])):le("",!0),m("span",hv,[Pn(a.$slots,"default",{},void 0,!0)]),i.value?(w(),T("span",pv,[s.value?(w(),T("span",mv,[Pn(a.$slots,"right",{},void 0,!0)])):le("",!0),o.value?(w(),T("span",gv,[Pn(a.$slots,"right-hover",{},void 0,!0)])):le("",!0)])):le("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),Nr=nt(vv,[["__scopeId","data-v-daeca4df"]]),yv={class:"thread-tree-root"},wv={key:0,class:"pinned-section"},bv={class:"thread-list"},_v={class:"thread-left-stack"},kv=["data-state"],Tv=["onClick"],Iv=["onClick"],Sv={class:"thread-row-title-wrap"},Ev={class:"thread-row-title"},Cv={class:"thread-row-time"},Av=["onClick"],Rv=["onClick"],Pv=["onClick"],xv=["aria-expanded"],Mv=["data-active"],Ov={key:0},Nv=["data-active"],$v={key:0},Dv={key:1,class:"thread-tree-no-results"},Lv={key:2,class:"thread-tree-loading"},jv={key:3,class:"thread-list thread-list-global"},Bv={class:"thread-left-stack"},Fv=["data-state"],Uv=["onClick"],Hv=["onClick"],Vv={class:"thread-row-title-wrap"},Wv={class:"thread-row-title"},qv={class:"thread-row-time"},zv=["onClick"],Gv=["onClick"],Kv=["onClick"],Jv=["data-project-name","data-expanded","data-dragging"],Yv={class:"project-icon-stack"},Qv={class:"project-icon-folder"},Xv={class:"project-icon-chevron"},Zv=["data-dragging-handle","onMousedown"],ey={class:"project-title"},ty={class:"project-hover-controls"},ny=["onClick"],ry=["onClick"],sy=["onClick"],oy=["onClick"],iy=["onInput"],ay=["aria-label","title","onClick"],ly={key:0,class:"thread-list"},cy={class:"thread-left-stack"},uy=["data-state"],dy=["onClick"],fy=["onClick"],hy={class:"thread-row-title-wrap"},py={class:"thread-row-title"},my={class:"thread-row-time"},gy=["onClick"],vy=["onClick"],yy=["onClick"],wy=["onClick"],by={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},_y=["onKeydown"],ky={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},Ty={class:"rename-thread-subtitle"},Iy=4,kc=6,Tc="codex-web-local.thread-view-mode.v1",Ic="codex-web-local.collapsed-projects.v1",Sy=$t({__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"],setup(e,{emit:t}){const n=e,r=t,s=L({}),o=L({}),i=L([]),a=L(""),l=L(""),u=L("actions"),c=L(""),f=L(!1),h=L(""),b=L(""),$=L(null),P=L(!1),H=L(""),Y=L(""),D=L(null),W=L(null),j=L(null);let ue=null,ae=null;const ve=L(""),_e=L({}),ie=new Map,ne=new Map,Te=new Map,re=new WeakMap,Le=L(null),je=L(!1),Xe=L(Ne()),Ee=typeof window<"u"?new ResizeObserver(k=>{for(const A of k){const O=A.target,G=re.get(O);G&&Me(G,O)}}):null;function ke(){if(typeof window>"u")return{};try{const k=window.localStorage.getItem(Ic);if(!k)return{};const A=JSON.parse(k);return!A||typeof A!="object"||Array.isArray(A)?{}:A}catch{return{}}}function Ne(){return typeof window>"u"?"project":window.localStorage.getItem(Tc)==="chronological"?"chronological":"project"}o.value=ke(),mt(o,k=>{typeof window>"u"||window.localStorage.setItem(Ic,JSON.stringify(k))},{deep:!0}),mt(Xe,k=>{typeof window>"u"||window.localStorage.setItem(Tc,k)});const ze=fe(()=>n.searchQuery.trim().toLowerCase()),rt=fe(()=>ze.value.length>0),Ze=fe(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function et(k){if(!rt.value)return!0;if(Ze.value)return Ze.value.has(k.id);const A=ze.value;return k.title.toLowerCase().includes(A)||k.preview.toLowerCase().includes(A)}const ht=fe(()=>rt.value?n.groups.map(k=>({...k,threads:k.threads.filter(et)})).filter(k=>k.threads.length>0):n.groups),St=fe(()=>Xe.value==="chronological"),Ge=fe(()=>{const k=ht.value,A=[];for(const O of k)for(const G of O.threads)v(G.id)||A.push(G);return A.sort((O,G)=>{const Ue=new Date(O.updatedAtIso||O.createdAtIso).getTime();return new Date(G.updatedAtIso||G.createdAtIso).getTime()-Ue})}),Ke=fe(()=>{const k=new Map;for(const A of n.groups)for(const O of A.threads)k.set(O.id,O);return k}),U=fe(()=>i.value.map(k=>Ke.value.get(k)??null).filter(k=>k!==null).filter(et)),he=fe(()=>{const k=j.value;if(!k||k.dropTargetIndexFull===null||n.groups.length===0)return null;const A=Math.max(0,Math.min(k.dropTargetIndexFull,n.groups.length)),O=A>k.fromIndex?A-1:A,G=Math.max(0,Math.min(O,n.groups.length-1));return G===k.fromIndex?null:G}),ce=fe(()=>{const A=(rt.value?ht.value:n.groups).map(rn=>rn.projectName),O=j.value,G=he.value;if(!O||G===null)return A;const Ue=[...A],[Pt]=Ue.splice(O.fromIndex,1);return Pt?(Ue.splice(G,0,Pt),Ue):A}),me=fe(()=>{const k={};let A=0;for(const O of ce.value)k[O]=A,A+=_n(O);return k}),Oe=fe(()=>{let k=0;for(const A of ce.value)k+=_n(A);return{height:`${Math.max(0,k)}px`}});function g(k){const A=new Date(k).getTime();if(Number.isNaN(A))return"n/a";const O=Math.abs(Date.now()-A);if(O<6e4)return"now";const G=Math.floor(O/6e4);if(G<60)return`${G}m`;const Ue=Math.floor(G/60);return Ue<24?`${Ue}h`:`${Math.floor(Ue/24)}d`}function v(k){return i.value.includes(k)}function S(k){if(v(k)){i.value=i.value.filter(A=>A!==k);return}i.value=[k,...i.value]}function B(k){r("select",k)}function q(k){return`start new thread ${Ce(k)}`}function V(k){r("start-new-thread",k)}function Z(k){l.value===k&&x()}function R(k){return l.value===k}function x(){l.value=""}function N(k){if(l.value===k){x();return}l.value=k}function te(k,A){h.value=k,b.value=A,f.value=!0,x(),on(()=>{var O,G;(O=$.value)==null||O.focus(),(G=$.value)==null||G.select()})}function X(){f.value=!1,h.value="",b.value=""}function oe(){const k=h.value,A=b.value.trim();!k||!A||(r("rename-thread",{threadId:k,title:A}),X())}function ye(k,A){H.value=k,Y.value=A,P.value=!0,x()}function Se(){P.value=!1,H.value="",Y.value=""}function Ye(){const k=H.value;k&&(i.value=i.value.filter(A=>A!==k),r("archive",k),Se())}function Ce(k){return n.projectDisplayNameById[k]??k}function Je(k){return a.value===k}function ot(){a.value="",u.value="actions",c.value=""}function F(){je.value=!je.value}function z(k){Xe.value=k,je.value=!1}function se(k){if(a.value===k){ot();return}a.value=k,u.value="actions",c.value=Ce(k)}function Qe(k){a.value=k,u.value="rename",c.value=Ce(k)}function lt(k){r("rename-project",{projectName:k,displayName:c.value})}function yt(k){r("remove-project",k),ot()}function At(k){r("browse-project-files",k),ot()}function dn(k,A){if(!k.altKey||k.key!=="ArrowUp"&&k.key!=="ArrowDown")return;const O=n.groups.findIndex(Pt=>Pt.projectName===A);if(O<0)return;const G=k.key==="ArrowUp"?-1:1,Ue=Math.max(0,Math.min(O+G,n.groups.length-1));Ue!==O&&(k.preventDefault(),r("reorder-project",{projectName:A,toIndex:Ue}))}function bn(k){return s.value[k]===!0}function Dt(k){return o.value[k]===!0}function Fe(k){s.value={...s.value,[k]:!bn(k)}}function Re(k){if(ve.value===k){ve.value="";return}o.value={...o.value,[k]:!Dt(k)}}function _n(k){const A=_e.value[k]??0,O=j.value,Ue=((O==null?void 0:O.projectName)===k?O.groupHeight:null)??A,Pt=Dt(k)?0:kc;return Math.max(0,Ue+Pt)}function Gt(k,A){const O=A instanceof HTMLElement?A:A&&"$el"in A&&A.$el instanceof HTMLElement?A.$el:null;if(O){ne.set(k,O);return}ne.delete(k)}function kn(k,A){const O=A instanceof HTMLElement?A:A&&"$el"in A&&A.$el instanceof HTMLElement?A.$el:null;if(O){Te.set(k,O);return}Te.delete(k)}function Nn(k){const A=a.value;if(!A)return!1;const O=ne.get(A);if(!O)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes(O))return!0;const Ue=k.target;return Ue instanceof Node?O.contains(Ue):!1}function _(k){const A=l.value;if(!A)return!1;const O=Te.get(A);if(!O)return!1;if((typeof k.composedPath=="function"?k.composedPath():[]).includes(O))return!0;const Ue=k.target;return Ue instanceof Node?O.contains(Ue):!1}function E(k){if(je.value){const A=Le.value,O=typeof k.composedPath=="function"?k.composedPath():[];!!A&&(O.includes(A)||k.target instanceof Node&&A.contains(k.target))||(je.value=!1)}a.value&&(Nn(k)||ot(),l.value&&(_(k)||x()))}function C(k){a.value&&!Nn(k)&&ot(),l.value&&!_(k)&&x()}function K(){je.value&&(je.value=!1),a.value&&ot(),l.value&&x()}function ge(){window.addEventListener("pointerdown",E,{capture:!0}),window.addEventListener("focusin",C,{capture:!0}),window.addEventListener("blur",K)}function pe(){window.removeEventListener("pointerdown",E,{capture:!0}),window.removeEventListener("focusin",C,{capture:!0}),window.removeEventListener("blur",K)}function Me(k,A){const O=A.getBoundingClientRect().height;if(!Number.isFinite(O)||O<=0)return;const G=_e.value[k];G!==void 0&&Math.abs(G-O)<.5||(_e.value={..._e.value,[k]:O})}function Pe(k,A){const O=ie.get(k);O&&O!==A&&Ee&&Ee.unobserve(O);const G=A instanceof HTMLElement?A:A&&"$el"in A&&A.$el instanceof HTMLElement?A.$el:null;if(G){ie.set(k,G),re.set(G,k),Me(k,G),Ee==null||Ee.observe(G);return}O&&(Ee==null||Ee.unobserve(O)),ie.delete(k)}function We(k,A){if(k.button!==0||W.value||j.value)return;const O=n.groups.findIndex(rn=>rn.projectName===A),G=ie.get(A);if(O<0||!G)return;const Ue=G.getBoundingClientRect(),Pt=Dt(A)?0:kc;W.value={projectName:A,fromIndex:O,startClientX:k.clientX,startClientY:k.clientY,pointerOffsetY:k.clientY-Ue.top,groupLeft:Ue.left,groupWidth:Ue.width,groupHeight:Ue.height,groupOuterHeight:Ue.height+Pt},k.preventDefault(),it()}function it(){window.addEventListener("mousemove",Ot),window.addEventListener("mouseup",Rt),window.addEventListener("keydown",nn)}function at(){window.removeEventListener("mousemove",Ot),window.removeEventListener("mouseup",Rt),window.removeEventListener("keydown",nn)}function Ot(k){ue={clientX:k.clientX,clientY:k.clientY},ys()}function Rt(k){Tr({clientX:k.clientX,clientY:k.clientY});const A=j.value;if(A&&he.value!==null){const O=n.groups.findIndex(G=>G.projectName===A.projectName);if(O>=0){const G=he.value;G!==O&&r("reorder-project",{projectName:A.projectName,toIndex:G})}}$n()}function nn(k){k.key==="Escape"&&(!W.value&&!j.value||(k.preventDefault(),$n()))}function $n(){ae!==null&&(window.cancelAnimationFrame(ae),ae=null),ue=null,W.value=null,j.value=null,ve.value="",at()}function ys(){ae===null&&(ae=window.requestAnimationFrame(()=>{if(ae=null,!ue)return;const k=ue;ue=null,Tr(k)}))}function Tr(k){const A=W.value;if(!j.value&&A){const O=k.clientX-A.startClientX,G=k.clientY-A.startClientY;if(Math.hypot(O,G)<Iy)return;ot(),ve.value=A.projectName,j.value={projectName:A.projectName,fromIndex:A.fromIndex,pointerOffsetY:A.pointerOffsetY,groupLeft:A.groupLeft,groupWidth:A.groupWidth,groupHeight:A.groupHeight,groupOuterHeight:A.groupOuterHeight,ghostTop:k.clientY-A.pointerOffsetY,dropTargetIndexFull:null}}j.value&&zr(k)}function zr(k){const A=j.value;if(!A)return;if(A.ghostTop=k.clientY-A.pointerOffsetY,!Ir(k)){A.dropTargetIndexFull=null;return}const O=k.clientY,G=D.value;if(!G){A.dropTargetIndexFull=null;return}const Ue=G.getBoundingClientRect(),Pt=new Map(n.groups.map((Kt,M)=>[Kt.projectName,M])),rn=n.groups.map(Kt=>Kt.projectName).filter(Kt=>Kt!==A.projectName);let Er=0,Cr=n.groups.length;for(const Kt of rn){const M=Pt.get(Kt);if(M===void 0)continue;const ee=_n(Kt),Ae=Ue.top+Er+ee/2;if(O<Ae){Cr=M;break}Er+=ee}A.dropTargetIndexFull=Cr}function Ir(k){const A=D.value;if(!A)return!1;const O=A.getBoundingClientRect(),G=k.clientX>=O.left&&k.clientX<=O.right,Ue=k.clientY>=O.top-32&&k.clientY<=O.bottom+32;return G&&Ue}function sr(k){var A;return((A=j.value)==null?void 0:A.projectName)===k}function Gr(k){const A=j.value,O=me.value[k]??0,G=a.value===k;return!A||A.projectName!==k?{position:"absolute",top:"0",left:"0",right:"0",zIndex:G?"40":"1",transform:`translate3d(0, ${O}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${A.groupLeft}px`,width:`${A.groupWidth}px`,height:`${A.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${A.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function Dn(k){return k.threads.filter(A=>!v(A.id))}function ws(k){if(rt.value)return Dn(k);if(Dt(k.projectName))return[];const A=Dn(k);return bn(k.projectName)?A:A.slice(0,10)}function bs(k){return rt.value?!1:!Dt(k.projectName)&&Dn(k).length>10}function _s(k){return Dn(k).length>0}function Sr(k){return k.inProgress?"working":k.unread?"unread":"idle"}mt(()=>n.groups.map(k=>k.projectName),k=>{var Ue,Pt;const A=((Ue=j.value)==null?void 0:Ue.projectName)??((Pt=W.value)==null?void 0:Pt.projectName)??"";A&&!n.groups.some(rn=>rn.projectName===A)&&$n();const O=new Set(k),G=Object.fromEntries(Object.entries(_e.value).filter(([rn])=>O.has(rn)));Object.keys(G).length!==Object.keys(_e.value).length&&(_e.value=G)});const ks=fe(()=>je.value||a.value!=="");return mt(ks,k=>{if(k){ge();return}pe()}),rr(()=>{for(const k of ie.values())Ee==null||Ee.unobserve(k);ie.clear(),ne.clear(),pe(),$n()}),(k,A)=>(w(),T("section",yv,[U.value.length>0?(w(),T("section",wv,[m("ul",bv,[(w(!0),T(He,null,Tt(U.value,O=>(w(),T("li",{key:O.id,class:"thread-row-item"},[Ie(Nr,{class:"thread-row","data-active":O.id===e.selectedThreadId,"data-pinned":v(O.id),onMouseleave:G=>Z(O.id)},{left:pt(()=>[m("span",_v,[O.inProgress||O.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Sr(O)},null,8,kv)):le("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:G=>S(O.id)},[Ie(Ri,{class:"thread-icon"})],8,Tv)])]),right:pt(()=>[m("span",Cv,de(g(O.createdAtIso||O.updatedAtIso)),1)]),"right-hover":pt(()=>[m("div",{ref_for:!0,ref:G=>kn(O.id,G),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(G=>N(O.id),["stop"])},[Ie(Cs,{class:"thread-icon"})],8,Av),R(O.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:A[0]||(A[0]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:G=>te(O.id,O.title)}," Rename thread ",8,Rv),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:G=>ye(O.id,O.title)}," Delete thread ",8,Pv)])):le("",!0)],512)]),default:pt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:G=>B(O.id)},[m("span",Sv,[m("span",Ev,de(O.title),1),O.hasWorktree?(w(),vt(To,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):le("",!0)])],8,Iv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):le("",!0),Ie(Nr,{as:"header",class:"thread-tree-header-row"},{right:pt(()=>[m("div",{ref_key:"organizeMenuWrapRef",ref:Le,class:"organize-menu-wrap"},[m("button",{class:"organize-menu-trigger",type:"button","aria-expanded":je.value,"aria-label":"Organize threads",title:"Organize threads",onClick:F},[Ie(Cs,{class:"thread-icon"})],8,xv),je.value?(w(),T("div",{key:0,class:"organize-menu-panel",onClick:A[3]||(A[3]=tt(()=>{},["stop"]))},[A[11]||(A[11]=m("p",{class:"organize-menu-title"},"Organize",-1)),m("button",{class:"organize-menu-item","data-active":Xe.value==="project",type:"button",onClick:A[1]||(A[1]=O=>z("project"))},[A[9]||(A[9]=m("span",null,"By project",-1)),Xe.value==="project"?(w(),T("span",Ov,"✓")):le("",!0)],8,Mv),m("button",{class:"organize-menu-item","data-active":Xe.value==="chronological",type:"button",onClick:A[2]||(A[2]=O=>z("chronological"))},[A[10]||(A[10]=m("span",null,"Chronological list",-1)),Xe.value==="chronological"?(w(),T("span",$v,"✓")):le("",!0)],8,Nv)])):le("",!0)],512)]),default:pt(()=>[A[12]||(A[12]=m("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),rt.value&&ht.value.length===0?(w(),T("p",Dv,"No matching threads")):e.isLoading&&e.groups.length===0?(w(),T("p",Lv,"Loading threads...")):St.value?(w(),T("ul",jv,[(w(!0),T(He,null,Tt(Ge.value,O=>(w(),T("li",{key:O.id,class:"thread-row-item"},[Ie(Nr,{class:"thread-row","data-active":O.id===e.selectedThreadId,"data-pinned":v(O.id),onMouseleave:G=>Z(O.id)},{left:pt(()=>[m("span",Bv,[O.inProgress||O.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Sr(O)},null,8,Fv)):le("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:G=>S(O.id)},[Ie(Ri,{class:"thread-icon"})],8,Uv)])]),right:pt(()=>[m("span",qv,de(g(O.createdAtIso||O.updatedAtIso)),1)]),"right-hover":pt(()=>[m("div",{ref_for:!0,ref:G=>kn(O.id,G),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(G=>N(O.id),["stop"])},[Ie(Cs,{class:"thread-icon"})],8,zv),R(O.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:A[4]||(A[4]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:G=>te(O.id,O.title)}," Rename thread ",8,Gv),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:G=>ye(O.id,O.title)}," Delete thread ",8,Kv)])):le("",!0)],512)]),default:pt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:G=>B(O.id)},[m("span",Vv,[m("span",Wv,de(O.title),1),O.hasWorktree?(w(),vt(To,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):le("",!0)])],8,Hv)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),T("div",{key:4,ref_key:"groupsContainerRef",ref:D,class:"thread-tree-groups",style:Wr(Oe.value)},[(w(!0),T(He,null,Tt(ht.value,O=>(w(),T("article",{key:O.projectName,ref_for:!0,ref:G=>Pe(O.projectName,G),class:"project-group","data-project-name":O.projectName,"data-expanded":!Dt(O.projectName),"data-dragging":sr(O.projectName),style:Wr(Gr(O.projectName))},[Ie(Nr,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:G=>Re(O.projectName),onKeydown:[G=>dn(G,O.projectName),Xt(tt(G=>Re(O.projectName),["prevent"]),["enter"]),Xt(tt(G=>Re(O.projectName),["prevent"]),["space"])]},{left:pt(()=>[m("span",Yv,[m("span",Qv,[Dt(O.projectName)?(w(),vt(zd,{key:0,class:"thread-icon"})):(w(),vt(ov,{key:1,class:"thread-icon"}))]),m("span",Xv,[Dt(O.projectName)?(w(),vt(qd,{key:0,class:"thread-icon"})):(w(),vt(oi,{key:1,class:"thread-icon"}))])])]),right:pt(()=>[m("div",ty,[m("div",{ref_for:!0,ref:G=>Gt(O.projectName,G),class:"project-menu-wrap"},[m("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:tt(G=>se(O.projectName),["stop"])},[Ie(Cs,{class:"thread-icon"})],8,ny),Je(O.projectName)?(w(),T("div",{key:0,class:"project-menu-panel",onClick:A[6]||(A[6]=tt(()=>{},["stop"]))},[u.value==="actions"?(w(),T(He,{key:0},[m("button",{class:"project-menu-item",type:"button",onClick:G=>At(O.projectName)}," Browse files ",8,ry),m("button",{class:"project-menu-item",type:"button",onClick:G=>Qe(O.projectName)}," Edit name ",8,sy),m("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:G=>yt(O.projectName)}," Remove ",8,oy)],64)):(w(),T(He,{key:1},[A[13]||(A[13]=m("label",{class:"project-menu-label"},"Project name",-1)),Qn(m("input",{"onUpdate:modelValue":A[5]||(A[5]=G=>c.value=G),class:"project-menu-input",type:"text",onInput:G=>lt(O.projectName)},null,40,iy),[[Xn,c.value]])],64))])):le("",!0)],512),m("button",{class:"thread-start-button",type:"button","aria-label":q(O.projectName),title:q(O.projectName),onClick:tt(G=>V(O.projectName),["stop"])},[Ie(Do,{class:"thread-icon"})],8,ay)])]),default:pt(()=>[m("span",{class:"project-main-button","data-dragging-handle":sr(O.projectName),onMousedown:tt(G=>We(G,O.projectName),["left"])},[m("span",ey,de(Ce(O.projectName)),1)],40,Zv)]),_:2},1032,["onClick","onKeydown"]),_s(O)?(w(),T("ul",ly,[(w(!0),T(He,null,Tt(ws(O),G=>(w(),T("li",{key:G.id,class:"thread-row-item"},[Ie(Nr,{class:"thread-row","data-active":G.id===e.selectedThreadId,"data-pinned":v(G.id),onMouseleave:Ue=>Z(G.id)},{left:pt(()=>[m("span",cy,[G.inProgress||G.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Sr(G)},null,8,uy)):le("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Ue=>S(G.id)},[Ie(Ri,{class:"thread-icon"})],8,dy)])]),right:pt(()=>[m("span",my,de(g(G.createdAtIso||G.updatedAtIso)),1)]),"right-hover":pt(()=>[m("div",{ref_for:!0,ref:Ue=>kn(G.id,Ue),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(Ue=>N(G.id),["stop"])},[Ie(Cs,{class:"thread-icon"})],8,gy),R(G.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:A[7]||(A[7]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:Ue=>te(G.id,G.title)}," Rename thread ",8,vy),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Ue=>ye(G.id,G.title)}," Delete thread ",8,yy)])):le("",!0)],512)]),default:pt(()=>[m("button",{class:"thread-main-button",type:"button",onClick:Ue=>B(G.id)},[m("span",hy,[m("span",py,de(G.title),1),G.hasWorktree?(w(),vt(To,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):le("",!0)])],8,fy)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),vt(Nr,{key:1,as:"p",class:"project-empty-row"},{left:pt(()=>[...A[14]||(A[14]=[m("span",{class:"project-empty-spacer"},null,-1)])]),default:pt(()=>[A[15]||(A[15]=m("span",{class:"project-empty"},"No threads",-1))]),_:1})),bs(O)?(w(),vt(Nr,{key:2,class:"thread-show-more-row"},{left:pt(()=>[...A[16]||(A[16]=[m("span",{class:"thread-show-more-spacer"},null,-1)])]),default:pt(()=>[m("button",{class:"thread-show-more-button",type:"button",onClick:G=>Fe(O.projectName)},de(bn(O.projectName)?"Show less":"Show more"),9,wy)]),_:2},1024)):le("",!0)],12,Jv))),128))],4)),(w(),vt(xo,{to:"body"},[f.value?(w(),T("div",{key:0,class:"rename-thread-overlay",onClick:tt(X,["self"])},[m("div",by,[A[17]||(A[17]=m("h3",{class:"rename-thread-title"},"Rename thread",-1)),A[18]||(A[18]=m("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),Qn(m("input",{ref_key:"renameThreadInputRef",ref:$,"onUpdate:modelValue":A[8]||(A[8]=O=>b.value=O),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Xt(tt(oe,["prevent"]),["enter"]),Xt(tt(X,["prevent"]),["esc"])]},null,40,_y),[[Xn,b.value]]),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:X},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:oe},"Save")])])])):le("",!0)])),(w(),vt(xo,{to:"body"},[P.value?(w(),T("div",{key:0,class:"rename-thread-overlay",onClick:tt(Se,["self"])},[m("div",ky,[A[19]||(A[19]=m("h3",{class:"rename-thread-title"},"Delete thread?",-1)),m("p",Ty,' This will archive the thread "'+de(Y.value)+'". You can find it later in archived threads. ',1),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:Se},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:Ye},"Delete")])])])):le("",!0)]))]))}}),Ey=nt(Sy,[["__scopeId","data-v-7c022821"]]),Cy={class:"content-header"},Ay={class:"content-leading"},Ry={class:"content-title"},Py={class:"content-actions"},xy=$t({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(w(),T("header",Cy,[m("div",Ay,[Pn(t.$slots,"leading",{},void 0)]),m("h1",Ry,de(e.title),1),m("div",Py,[Pn(t.$slots,"actions",{},void 0)])]))}}),My=nt(xy,[["__scopeId","data-v-66ee223c"]]),Oy={},Ny={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function $y(e,t){return w(),T("svg",Ny,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const Ga=nt(Oy,[["render",$y]]),Dy={},Ly={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function jy(e,t){return w(),T("svg",Ly,[...t[0]||(t[0]=[m("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 By=nt(Dy,[["render",jy]]),Fy={},Uy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Hy(e,t){return w(),T("svg",Uy,[...t[0]||(t[0]=[m("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 Vy=nt(Fy,[["render",Hy]]),Wy={class:"conversation-root"},qy={key:0,class:"conversation-loading"},zy={key:1,class:"conversation-empty"},Gy={class:"message-row"},Ky={class:"message-stack"},Jy={class:"request-card"},Yy={class:"request-title"},Qy={class:"request-meta"},Xy={key:0,class:"request-reason"},Zy={key:1,class:"request-actions"},ew=["onClick"],tw=["onClick"],nw=["onClick"],rw=["onClick"],sw={key:2,class:"request-actions"},ow=["onClick"],iw=["onClick"],aw=["onClick"],lw=["onClick"],cw={key:3,class:"request-user-input"},uw={class:"request-question-title"},dw={key:0,class:"request-question-text"},fw=["value","onChange"],hw=["value"],pw=["value","onInput"],mw=["onClick"],gw={key:4,class:"request-actions"},vw=["onClick"],yw=["onClick"],ww={key:5,class:"request-actions"},bw=["onClick"],_w=["onClick"],kw=["data-role","data-message-type"],Tw={key:0,class:"message-row","data-role":"system"},Iw={class:"message-stack","data-role":"system"},Sw=["onClick"],Ew={class:"cmd-label"},Cw={class:"cmd-status"},Aw={class:"cmd-output-inner"},Rw={class:"cmd-output"},Pw=["data-role","data-message-type"],xw=["data-role"],Mw=["data-role"],Ow=["data-role"],Nw=["onClick"],$w=["src"],Dw={key:1,class:"message-file-attachments"},Lw=["href","title"],jw=["data-role"],Bw={key:0,class:"worked-separator-wrap","aria-live":"polite"},Fw=["onClick"],Uw={class:"worked-separator-text"},Hw={key:0,class:"worked-details"},Vw=["onClick"],Ww={class:"cmd-label"},qw={class:"cmd-status"},zw={class:"cmd-output-inner"},Gw={class:"cmd-output"},Kw={key:1,class:"message-text-flow"},Jw={key:0,class:"message-text"},Yw={key:0},Qw=["href","title"],Xw=["href","title"],Zw={key:3,class:"message-inline-code"},eb={key:1,class:"message-text"},tb=["onClick"],nb=["src","alt","onError"],rb={key:0,class:"message-actions"},sb=["onClick"],ob=["onClick"],ib={key:0,class:"conversation-item conversation-item-overlay"},ab={class:"message-row"},lb={class:"message-stack"},cb={class:"live-overlay-inline","aria-live":"polite"},ub={class:"live-overlay-label"},db={key:1,class:"live-overlay-error"},fb=["src"],hb=16,pb=$t({__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=L(new Set),r=L(new Set),s=L(new Set),o=L({});function i(_){return _.messageType==="commandExecution"&&!!_.commandExecution}function a(_){var E;return((E=_.commandExecution)==null?void 0:E.status)==="inProgress"||r.value.has(_.id)?!0:n.value.has(_.id)}function l(_){return r.value.has(_.id)}function u(_){var C;if(((C=_.commandExecution)==null?void 0:C.status)==="inProgress")return;const E=new Set(n.value);E.has(_.id)?E.delete(_.id):E.add(_.id),n.value=E}function c(_){const E=new Set(s.value);E.has(_.id)?E.delete(_.id):E.add(_.id),s.value=E}function f(_){return s.value.has(_.id)}function h(_){const E=_.commandExecution;if(!E)return"";switch(E.status){case"inProgress":return"⟳ Running";case"completed":return E.exitCode===0?"✓ Completed":`✗ Exit ${E.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function b(_){var C,K;const E=(C=_.commandExecution)==null?void 0:C.status;return E==="inProgress"?"cmd-status-running":E==="completed"&&((K=_.commandExecution)==null?void 0:K.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function $(_){const E=new Set(r.value);E.add(_),r.value=E,setTimeout(()=>{const C=new Set(r.value);C.delete(_),r.value=C},1e3)}function P(_,E){const C=[];for(let K=E-1;K>=0;K--){const ge=_[K];if(ge.messageType==="commandExecution")C.unshift(ge);else if(ge.role==="user"||ge.messageType==="worked")break}return C}const H=e,Y=t,D=L(null),W=L(null),j=L(null),ue=L(""),ae=L({}),ve=L({});let _e=0,ie=0,ne=0;const Te=new WeakSet,re=L(new Set);function Le(_){if(!_||/\s/u.test(_)||_.endsWith("/")||_.endsWith("\\"))return!1;if(_.startsWith("file://"))return!0;if(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(_))return!1;const E=_.startsWith("/"),C=/^[A-Za-z]:[\\/]/u.test(_),K=_.startsWith("./")||_.startsWith("../")||_.startsWith("~/"),ge=_.includes("/")||_.includes("\\");return E||C||K||ge}function je(_){return _.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||_}function Xe(_){return _.replace(/\\/gu,"/")}function Ee(_){if(!_.startsWith("file://"))return _;let E=_.replace(/^file:\/\//u,"");try{E=decodeURIComponent(E)}catch{}return/^\/[A-Za-z]:\//u.test(E)&&(E=E.slice(1)),E}function ke(_){const E=Xe(_),C=E.match(/^\/Users\/([^/]+)/u);if(C)return`/Users/${C[1]}`;const K=E.match(/^\/home\/([^/]+)/u);return K?`/home/${K[1]}`:""}function Ne(_){const E=Xe(_);if(!E)return E;let C="",K=E;const ge=K.match(/^([A-Za-z]:)(\/.*)?$/u);ge?(C=`${ge[1]}/`,K=(ge[2]??"").replace(/^\/+/u,"")):K.startsWith("/")&&(C="/",K=K.slice(1));const pe=K.split("/").filter(Boolean),Me=[];for(const We of pe)if(We!=="."){if(We===".."){Me.length>0&&Me.pop();continue}Me.push(We)}const Pe=Me.join("/");return C?`${C}${Pe}`.replace(/\/+$/u,"")||C:Pe||E}function ze(_,E){const C=Xe(Ee(_.trim()));if(!C)return"";if(C.startsWith("/")||/^[A-Za-z]:\//u.test(C))return Ne(C);if(C.startsWith("~/")){const pe=ke(E);if(pe)return Ne(`${pe}/${C.slice(2)}`)}const ge=Xe(E.trim());return Ne(ge?`${ge.replace(/\/+$/u,"")}/${C}`:C)}function rt(_){if(!_)return null;let E=_.trim();E=Ze(E).core.trim();let K=null;const ge=E.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(ge)E=ge[1],K=Number(ge[2]);else{const pe=E.match(/^(.*):(\d+)(?::\d+)?$/u);pe&&(E=pe[1],K=Number(pe[2]))}return E=Ee(E),Le(E)?{path:E,line:K}:null}function Ze(_){let E=_,C="",K="";for(;/^[('"`[{<“‘]/u.test(E);)C+=E[0],E=E.slice(1);for(;/[)"'`\]}>”’]$/u.test(E);)K=E.slice(-1)+K,E=E.slice(0,-1);return{core:E,leading:C,trailing:K}}function et(_){const C=_.trim().match(/^\[([^\]\n]+)\]\(([^)\n]+)\)$/u);if(!C)return null;const K=(C[1]??"").trim(),ge=(C[2]??"").trim(),pe=Ze(K).core.trim()||K,Me=Ze(ge).core.trim();return Me?{label:pe,target:Me}:null}function ht(_){const E=[],C=/\S+/gu;let K=0;for(const ge of _.matchAll(C)){if(typeof ge.index!="number")continue;const pe=ge.index,Me=pe+ge[0].length;pe>K&&E.push({kind:"text",value:_.slice(K,pe)});let Pe=ge[0],We="";for(;/[.,;:]$/u.test(Pe);)We=Pe.slice(-1)+We,Pe=Pe.slice(0,-1);const it=Ze(Pe);Pe=it.core;const at=it.leading,Ot=it.trailing+We;if(at&&E.push({kind:"text",value:at}),/^https?:\/\//u.test(Pe))E.push({kind:"url",value:Pe,href:Pe}),Ot&&E.push({kind:"text",value:Ot});else{const Rt=rt(Pe);Rt?(E.push({kind:"file",value:Pe,path:Rt.path,displayPath:Pe,downloadName:je(Rt.path)}),Ot&&E.push({kind:"text",value:Ot})):E.push({kind:"text",value:ge[0]})}K=Me}return K<_.length&&E.push({kind:"text",value:_.slice(K)}),E}function St(_){const E=/\[([^\]\n]+)\]\(([^)\n]+)\)/gu,C=[];let K=0;for(const ge of _.matchAll(E)){if(typeof ge.index!="number")continue;const[pe,Me,Pe]=ge,We=ge.index,it=We+pe.length;We>K&&C.push(...ht(_.slice(K,We)));const at=et(`[${Me??""}](${Pe??""})`),Ot=(at==null?void 0:at.label)??(Me??"").trim(),Rt=(at==null?void 0:at.target)??(Pe??"").trim();if(/^https?:\/\//u.test(Rt))C.push({kind:"url",value:Ot||Rt,href:Rt});else{const nn=rt(Rt);nn?C.push({kind:"file",value:Rt,path:nn.path,displayPath:Ot||Rt,downloadName:je(nn.path)}):C.push({kind:"text",value:pe})}K=it}return K<_.length&&C.push(...ht(_.slice(K))),C}function Ge(_){if(!_.includes("`"))return St(_);const E=[];let C=0,K=0;for(;C<_.length;){if(_[C]!=="`"){C+=1;continue}let ge=1;for(;C+ge<_.length&&_[C+ge]==="`";)ge+=1;const pe="`".repeat(ge);let Me=C+ge,Pe=-1;for(;Me<_.length;){const it=_.indexOf(pe,Me);if(it<0)break;const at=it>0&&_[it-1]==="`",Ot=it+ge<_.length&&_[it+ge]==="`",Rt=_.slice(C+ge,it).includes(`
|
|
26
|
-
`);if(!at&&!Ot&&!Rt){Pe=it;break}Me=it+1}if(Pe<0){C+=ge;continue}C>K&&E.push(...St(_.slice(K,C)));const We=_.slice(C+ge,Pe);if(We.length>0){const it=et(We);if(it)if(/^https?:\/\//u.test(it.target))E.push({kind:"url",value:it.label||it.target,href:it.target});else{const at=rt(it.target);at?E.push({kind:"file",value:it.target,path:at.path,displayPath:it.label||it.target,downloadName:je(at.path)}):E.push({kind:"code",value:We})}else{const at=rt(We);if(at){const Ot=at.line?`${at.path}:${String(at.line)}`:at.path;E.push({kind:"file",value:We,path:at.path,displayPath:Ot,downloadName:je(at.path)})}else E.push({kind:"code",value:We})}}else E.push({kind:"text",value:`${pe}${pe}`});C=Pe+ge,K=C}return K<_.length&&E.push(...St(_.slice(K))),E}function Ke(_){const E=_.trim();if(!E)return"";if(E.startsWith("data:")||E.startsWith("blob:")||E.startsWith("http://")||E.startsWith("https://")||E.startsWith("/codex-local-image?"))return E;if(E.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(E)}`;const C=E.startsWith("/"),K=/^[A-Za-z]:[\\/]/u.test(E);return C||K?`/codex-local-image?path=${encodeURIComponent(E)}`:E}function U(_){const E=_.trim();if(!E)return"#";const C=Me=>Me.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(Me),K=rt(E),ge=(K==null?void 0:K.path)??E,pe=ze(ge,H.cwd);if(C(pe)){const Me=pe.startsWith("/")?pe:`/${pe}`;return`/codex-local-browse${encodeURI(Me)}`}return"#"}function he(_){if(!_.includes(")return[{kind:"text",value:_}];const E=[],C=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let K=0;for(const ge of _.matchAll(C)){const[pe,Me,Pe]=ge;if(typeof ge.index!="number")continue;const We=ge.index,it=We+pe.length,at=Ke(Pe.trim());at&&(We>K&&E.push({kind:"text",value:_.slice(K,We)}),E.push({kind:"image",url:at,alt:Me.trim(),markdown:pe}),K=it)}return K<_.length&&E.push({kind:"text",value:_.slice(K)}),E.length>0?E:[{kind:"text",value:_}]}function ce(_){return _!==null&&typeof _=="object"&&!Array.isArray(_)?_:null}function me(_){const E=new Date(_);return Number.isNaN(E.getTime())?_:E.toLocaleTimeString()}function Oe(_){const E=ce(_.params),C=E==null?void 0:E.reason;return typeof C=="string"?C.trim():""}function g(_,E){return`${String(_)}:${E}`}function v(_){const E=ce(_.params),C=Array.isArray(E==null?void 0:E.questions)?E.questions:[],K=[];for(const ge of C){const pe=ce(ge);if(!pe)continue;const Me=typeof pe.id=="string"?pe.id:"";if(!Me)continue;const Pe=Array.isArray(pe.options)?pe.options.map(We=>ce(We)).map(We=>We==null?void 0:We.label).filter(We=>typeof We=="string"&&We.length>0):[];K.push({id:Me,header:typeof pe.header=="string"?pe.header:"",question:typeof pe.question=="string"?pe.question:"",isOther:pe.isOther===!0,options:Pe})}return K}function S(_,E,C){const K=g(_,E),ge=ae.value[K];return typeof ge=="string"&&ge.length>0?ge:C}function B(_,E){const C=g(_,E);return ve.value[C]??""}function q(_,E,C){const K=C.target;if(!(K instanceof HTMLSelectElement))return;const ge=g(_,E);ae.value={...ae.value,[ge]:K.value}}function V(_,E,C){const K=C.target;if(!(K instanceof HTMLInputElement))return;const ge=g(_,E);ve.value={...ve.value,[ge]:K.value}}function Z(_,E){Y("respondServerRequest",{id:_,result:{decision:E}})}function R(_){const E=v(_),C={};for(const K of E){const ge=S(_.id,K.id,K.options[0]||""),pe=B(_.id,K.id).trim(),Me=[ge,pe].map(Pe=>Pe.trim()).filter(Pe=>Pe.length>0);C[K.id]={answers:Me}}Y("respondServerRequest",{id:_.id,result:{answers:C}})}function x(_){Y("respondServerRequest",{id:_,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function N(_){Y("respondServerRequest",{id:_,result:{success:!0,contentItems:[]}})}function te(_){Y("respondServerRequest",{id:_,result:{}})}function X(_){Y("respondServerRequest",{id:_,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function oe(_){return!(_.role!=="user"&&_.role!=="assistant"||typeof _.turnIndex!="number"||H.isTurnInProgress||H.isRollingBack)}function ye(_){return _.role!=="user"&&_.role!=="assistant"?!1:_.text.trim().length>0}function Se(_){return ye(_)||oe(_)}async function Ye(_){if(!ye(_))return;const E=_.text.trim();try{await navigator.clipboard.writeText(E)}catch{const C=document.createElement("textarea");C.value=E,C.setAttribute("readonly","true"),C.style.position="fixed",C.style.opacity="0",document.body.appendChild(C),C.select(),document.execCommand("copy"),document.body.removeChild(C)}}function Ce(_){oe(_)&&Y("rollback",{turnIndex:_.turnIndex})}function Je(){const _=D.value,E=W.value;!_||!E||(_.scrollTop=_.scrollHeight,E.scrollIntoView({block:"end"}))}function ot(_){return _.scrollHeight-(_.scrollTop+_.clientHeight)<=hb}function F(_){if(!H.activeThreadId)return;const E=Math.max(_.scrollHeight-_.clientHeight,0),C=E>0?Math.min(Math.max(_.scrollTop/E,0),1):1;Y("updateScrollState",{threadId:H.activeThreadId,state:{scrollTop:_.scrollTop,isAtBottom:ot(_),scrollRatio:C}})}function z(){const _=D.value;if(!_)return;const E=H.scrollState;if(!E||E.isAtBottom){se();return}const C=Math.max(_.scrollHeight-_.clientHeight,0),K=typeof E.scrollRatio=="number"?E.scrollRatio*C:E.scrollTop;_.scrollTop=Math.min(Math.max(K,0),C),F(_)}function se(){const _=D.value;_&&(Je(),F(_))}function Qe(){const _=H.scrollState;return!_||_.isAtBottom===!0}function lt(){if(!Qe()){ne=0,ie=0;return}if(se(),ne-=1,ne<=0){ie=0;return}ie=requestAnimationFrame(lt)}function yt(_=6){Qe()&&(ie&&(cancelAnimationFrame(ie),ie=0),ne=Math.max(_,1),ie=requestAnimationFrame(lt))}function At(){yt(3)}function dn(){if(!Qe())return;const _=D.value;if(!_)return;const E=_.querySelectorAll("img.message-image-preview");for(const C of E)C.complete||Te.has(C)||(Te.add(C),C.addEventListener("load",At,{once:!0}),C.addEventListener("error",At,{once:!0}))}async function bn(){await on(),_e&&cancelAnimationFrame(_e),_e=requestAnimationFrame(()=>{_e=0,z(),dn(),yt()})}mt(()=>H.messages,async _=>{if(!H.isLoading){for(const E of _){if(E.messageType!=="commandExecution"||!E.commandExecution)continue;const C=o.value[E.id],K=E.commandExecution.status;C==="inProgress"&&K!=="inProgress"&&$(E.id),o.value[E.id]=K}await bn()}}),mt(()=>H.liveOverlay,async _=>{_&&(await on(),se(),yt(8))},{deep:!0}),mt(()=>H.isLoading,async _=>{_||await bn()}),mt(()=>H.activeThreadId,()=>{ue.value="",re.value=new Set},{flush:"post"});function Dt(){const _=D.value;!_||H.isLoading||F(_)}function Fe(_){ue.value=Ke(_)}function Re(_,E){return`${_}:${String(E)}`}function _n(_,E){const C=new Set(re.value);C.add(Re(_,E)),re.value=C}function Gt(_,E){return re.value.has(Re(_,E))}function kn(){ue.value=""}function Nn(){const _=j.value;_&&(_.scrollTop=_.scrollHeight)}return mt(()=>{var _;return(_=H.liveOverlay)==null?void 0:_.reasoningText},async _=>{_&&(await on(),Nn())}),rr(()=>{_e&&cancelAnimationFrame(_e),ie&&cancelAnimationFrame(ie)}),(_,E)=>(w(),T("section",Wy,[e.isLoading?(w(),T("p",qy,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(w(),T("p",zy," No messages in this thread yet. ")):(w(),T("ul",{key:2,ref_key:"conversationListRef",ref:D,class:"conversation-list",onScroll:Dt},[(w(!0),T(He,null,Tt(e.pendingRequests,C=>(w(),T("li",{key:`server-request:${C.id}`,class:"conversation-item conversation-item-request"},[m("div",Gy,[m("div",Ky,[m("article",Jy,[m("p",Yy,de(C.method),1),m("p",Qy,"Request #"+de(C.id)+" · "+de(me(C.receivedAtIso)),1),Oe(C)?(w(),T("p",Xy,de(Oe(C)),1)):le("",!0),C.method==="item/commandExecution/requestApproval"?(w(),T("section",Zy,[m("button",{type:"button",class:"request-button request-button-primary",onClick:K=>Z(C.id,"accept")},"Accept",8,ew),m("button",{type:"button",class:"request-button",onClick:K=>Z(C.id,"acceptForSession")},"Accept for Session",8,tw),m("button",{type:"button",class:"request-button",onClick:K=>Z(C.id,"decline")},"Decline",8,nw),m("button",{type:"button",class:"request-button",onClick:K=>Z(C.id,"cancel")},"Cancel",8,rw)])):C.method==="item/fileChange/requestApproval"?(w(),T("section",sw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:K=>Z(C.id,"accept")},"Accept",8,ow),m("button",{type:"button",class:"request-button",onClick:K=>Z(C.id,"acceptForSession")},"Accept for Session",8,iw),m("button",{type:"button",class:"request-button",onClick:K=>Z(C.id,"decline")},"Decline",8,aw),m("button",{type:"button",class:"request-button",onClick:K=>Z(C.id,"cancel")},"Cancel",8,lw)])):C.method==="item/tool/requestUserInput"?(w(),T("section",cw,[(w(!0),T(He,null,Tt(v(C),K=>(w(),T("div",{key:`${C.id}:${K.id}`,class:"request-question"},[m("p",uw,de(K.header||K.question),1),K.header&&K.question?(w(),T("p",dw,de(K.question),1)):le("",!0),m("select",{class:"request-select",value:S(C.id,K.id,K.options[0]||""),onChange:ge=>q(C.id,K.id,ge)},[(w(!0),T(He,null,Tt(K.options,ge=>(w(),T("option",{key:`${C.id}:${K.id}:${ge}`,value:ge},de(ge),9,hw))),128))],40,fw),K.isOther?(w(),T("input",{key:1,class:"request-input",type:"text",value:B(C.id,K.id),placeholder:"Other answer",onInput:ge=>V(C.id,K.id,ge)},null,40,pw)):le("",!0)]))),128)),m("button",{type:"button",class:"request-button request-button-primary",onClick:K=>R(C)}," Submit Answers ",8,mw)])):C.method==="item/tool/call"?(w(),T("section",gw,[m("button",{type:"button",class:"request-button request-button-primary",onClick:K=>x(C.id)},"Fail Tool Call",8,vw),m("button",{type:"button",class:"request-button",onClick:K=>N(C.id)},"Success (Empty)",8,yw)])):(w(),T("section",ww,[m("button",{type:"button",class:"request-button request-button-primary",onClick:K=>te(C.id)},"Return Empty Result",8,bw),m("button",{type:"button",class:"request-button",onClick:K=>X(C.id)},"Reject Request",8,_w)]))])])])]))),128)),(w(!0),T(He,null,Tt(e.messages,C=>{var K,ge;return w(),T("li",{key:C.id,class:gt(["conversation-item",{"conversation-item-actionable":Se(C)}]),"data-role":C.role,"data-message-type":C.messageType||""},[i(C)?(w(),T("div",Tw,[m("div",Iw,[m("button",{type:"button",class:gt(["cmd-row",[b(C),{"cmd-expanded":a(C)}]]),onClick:pe=>u(C)},[m("span",{class:gt(["cmd-chevron",{"cmd-chevron-open":a(C)}])},"▶",2),m("code",Ew,de(((K=C.commandExecution)==null?void 0:K.command)||"(command)"),1),m("span",Cw,de(h(C)),1)],10,Sw),m("div",{class:gt(["cmd-output-wrap",{"cmd-output-visible":a(C),"cmd-output-collapsing":l(C)}])},[m("div",Aw,[m("pre",Rw,de(((ge=C.commandExecution)==null?void 0:ge.aggregatedOutput)||"(no output)"),1)])],2)])])):(w(),T("div",{key:1,class:"message-row","data-role":C.role,"data-message-type":C.messageType||""},[m("div",{class:"message-stack","data-role":C.role},[m("article",{class:"message-body","data-role":C.role},[C.images&&C.images.length>0?(w(),T("ul",{key:0,class:"message-image-list","data-role":C.role},[(w(!0),T(He,null,Tt(C.images,pe=>(w(),T("li",{key:pe,class:"message-image-item"},[m("button",{class:"message-image-button",type:"button",onClick:Me=>Fe(pe)},[m("img",{class:"message-image-preview",src:Ke(pe),alt:"Message image preview",loading:"lazy"},null,8,$w)],8,Nw)]))),128))],8,Ow)):le("",!0),C.fileAttachments&&C.fileAttachments.length>0?(w(),T("div",Dw,[(w(!0),T(He,null,Tt(C.fileAttachments,pe=>(w(),T("span",{key:pe.path,class:"message-file-chip"},[E[1]||(E[1]=m("span",{class:"message-file-chip-icon"},"📄",-1)),m("a",{class:"message-file-link message-file-chip-name",href:U(pe.path),target:"_blank",rel:"noopener noreferrer",title:pe.path},de(pe.path),9,Lw)]))),128))])):le("",!0),C.text.length>0?(w(),T("article",{key:2,class:"message-card","data-role":C.role},[C.messageType==="worked"?(w(),T("div",Bw,[m("button",{type:"button",class:"worked-separator",onClick:pe=>c(C)},[E[2]||(E[2]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),m("span",{class:gt(["worked-chevron",{"worked-chevron-open":f(C)}])},"▶",2),m("p",Uw,de(C.text),1),E[3]||(E[3]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Fw),f(C)?(w(),T("div",Hw,[(w(!0),T(He,null,Tt(P(e.messages,e.messages.indexOf(C)),pe=>{var Me,Pe;return w(),T("div",{key:`worked-cmd-${pe.id}`,class:"worked-cmd-item"},[m("button",{type:"button",class:gt(["cmd-row",[b(pe),{"cmd-expanded":a(pe)}]]),onClick:We=>u(pe)},[m("span",{class:gt(["cmd-chevron",{"cmd-chevron-open":a(pe)}])},"▶",2),m("code",Ww,de(((Me=pe.commandExecution)==null?void 0:Me.command)||"(command)"),1),m("span",qw,de(h(pe)),1)],10,Vw),m("div",{class:gt(["cmd-output-wrap",{"cmd-output-visible":a(pe),"cmd-output-collapsing":l(pe)}])},[m("div",zw,[m("pre",Gw,de(((Pe=pe.commandExecution)==null?void 0:Pe.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):le("",!0)])):(w(),T("div",Kw,[(w(!0),T(He,null,Tt(he(C.text),(pe,Me)=>(w(),T(He,{key:`block-${Me}`},[pe.kind==="text"?(w(),T("p",Jw,[(w(!0),T(He,null,Tt(Ge(pe.value),(Pe,We)=>(w(),T(He,{key:`seg-${Me}-${We}`},[Pe.kind==="text"?(w(),T("span",Yw,de(Pe.value),1)):Pe.kind==="file"?(w(),T("a",{key:1,class:"message-file-link",href:U(Pe.path),target:"_blank",rel:"noopener noreferrer",title:Pe.path},de(Pe.displayPath),9,Qw)):Pe.kind==="url"?(w(),T("a",{key:2,class:"message-file-link",href:Pe.href,target:"_blank",rel:"noopener noreferrer",title:Pe.href},de(Pe.value),9,Xw)):(w(),T("code",Zw,de(Pe.value),1))],64))),128))])):Gt(C.id,Me)?(w(),T("p",eb,de(pe.markdown),1)):(w(),T("button",{key:2,class:"message-image-button",type:"button",onClick:Pe=>Fe(pe.url)},[m("img",{class:"message-image-preview message-markdown-image",src:pe.url,alt:pe.alt||"Embedded message image",loading:"lazy",onError:Pe=>_n(C.id,Me)},null,40,nb)],8,tb))],64))),128))]))],8,jw)):le("",!0)],8,Mw),Se(C)?(w(),T("div",rb,[ye(C)?(w(),T("button",{key:0,class:"message-action-button",type:"button",title:"Copy message text",onClick:pe=>Ye(C)},[Ie(Vy,{class:"message-action-icon"}),E[4]||(E[4]=m("span",{class:"message-action-label"},"Copy",-1))],8,sb)):le("",!0),oe(C)?(w(),T("button",{key:1,class:"message-action-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:pe=>Ce(C)},[Ie(By,{class:"message-action-icon"}),E[5]||(E[5]=m("span",{class:"message-action-label"},"Rollback",-1))],8,ob)):le("",!0)])):le("",!0)],8,xw)],8,Pw))],10,kw)}),128)),e.liveOverlay?(w(),T("li",ib,[m("div",ab,[m("div",lb,[m("article",cb,[m("p",ub,de(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(w(),T("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:j},de(e.liveOverlay.reasoningText),513)):le("",!0),e.liveOverlay.errorText?(w(),T("p",db,de(e.liveOverlay.errorText),1)):le("",!0)])])])])):le("",!0),m("li",{ref_key:"bottomAnchorRef",ref:W,class:"conversation-bottom-anchor"},null,512)],544)),ue.value.length>0?(w(),T("div",{key:3,class:"image-modal-backdrop",onClick:kn},[m("div",{class:"image-modal-content",onClick:E[0]||(E[0]=tt(()=>{},["stop"]))},[m("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:kn},[Ie(Ga,{class:"icon-svg"})]),m("img",{class:"image-modal-image",src:ue.value,alt:"Expanded message image"},null,8,fb)])])):le("",!0)]))}}),mb=nt(pb,[["__scopeId","data-v-886c74ad"]]);function gb(e){var c;const t=L("idle"),n=L(typeof navigator<"u"&&!!((c=navigator.mediaDevices)!=null&&c.getUserMedia));let r=null,s=null,o=[];async function i(){var f;if(!(t.value!=="idle"||!n.value))try{s=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),o=[],r=new MediaRecorder(s),r.ondataavailable=h=>{h.data.size>0&&o.push(h.data)},r.onstop=()=>{var $;const h=o,b=(r==null?void 0:r.mimeType)||(($=h[0])==null?void 0:$.type)||"audio/webm";u(),t.value="idle",l(h,b)},r.start(),t.value="recording"}catch(h){u(),(f=e.onError)==null||f.call(e,h)}}function a(){t.value!=="recording"||!r||r.state!=="inactive"&&r.stop()}async function l(f,h){var $;if(f.length===0)return;const b=new Blob(f,{type:h});try{const P=h.split(/[/;]/)[1]??"webm",H=`----codex-transcribe-${crypto.randomUUID()}`,Y=new Uint8Array(await b.arrayBuffer()),D=new TextEncoder,W=[];W.push(D.encode(`--${H}\r
|
|
27
|
-
`)),W.push(D.encode(`Content-Disposition: form-data; name="file"; filename="codex.${P}"\r
|
|
28
|
-
`)),W.push(D.encode(`Content-Type: ${h}\r
|
|
29
|
-
\r
|
|
30
|
-
`)),W.push(Y),W.push(D.encode(`\r
|
|
31
|
-
--${H}--\r
|
|
32
|
-
`));let j=0;for(const ne of W)j+=ne.byteLength;const ue=new Uint8Array(j);let ae=0;for(const ne of W)ue.set(ne,ae),ae+=ne.byteLength;const ve=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${H}`},body:ue});if(!ve.ok)throw new Error(`Transcription failed: ${ve.status}`);const ie=((await ve.json()).text??"").trim();ie.length>0&&e.onTranscript(ie)}catch(P){($=e.onError)==null||$.call(e,P)}finally{t.value!=="recording"&&(t.value="idle")}}function u(){r&&(r.ondataavailable=null,r.onstop=null,r=null),s&&(s.getTracks().forEach(f=>f.stop()),s=null),o=[]}return rr(u),{state:t,isSupported:n,startRecording:i,stopRecording:a}}function Sc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class Gn extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function Ka(e,t){const n=Sc(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=Sc(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function ms(e,t,n){return e instanceof Gn?e:e instanceof Error?new Gn(e.message||t,{code:"unknown_error",method:n}):new Gn(t,{code:"unknown_error",method:n})}function Gd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function vb(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 Gn(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 Gn(Ka(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 Gn(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function Ec(e){const t=Gd(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 yb(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=Ec(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=Ec(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 wb(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 Gn(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 Gn(Ka(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function bb(){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 Gn(Ka(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Gd(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function Cc(e){return new Date(e*1e3).toISOString()}function _b(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function kb(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Tb=/^##\s+(.+?):\s+(.+?)\s*$/,Ib=/^#\s*files mentioned by the user\s*:?\s*$/i;function Sb(e){var s,o;const t=e.split(`
|
|
33
|
-
`).findIndex(i=>Ib.test(i.trim()));if(t<0)return[];const n=e.split(`
|
|
34
|
-
`).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(Tb);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 Eb(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 Cb(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:kb(l),isUnhandled:!0});const o=n.join(`
|
|
35
|
-
`),i=Sb(o);return{text:Eb(o),images:r,fileAttachments:i,rawBlocks:s}}function Ab(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=Cb(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=Rb(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 Rb(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function Pb(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function xb(e){const t=Pb(e);return t.length>0?t:"Untitled thread"}function Kd(e){return(e==null?void 0:e.status)==="inProgress"}function Mb(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 Kd(r)}function Ob(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:xb(e),projectName:_b(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:Cc(e.createdAt),updatedAtIso:Cc(e.updatedAt),preview:e.preview,unread:!1,inProgress:Mb(e)}}function Nb(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 $b(e){const t=e.data.map(Ob);return Nb(t)}function Jd(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n=[];for(let r=0;r<t.length;r++){const s=t[r],o=Array.isArray(s.items)?s.items:[];for(const i of o)for(const a of Ab(i))n.push({...a,turnIndex:r})}return n}function Db(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return Kd(t.at(-1))}async function tn(e,t){try{return await vb(e,t)}catch(n){throw ms(n,`RPC ${e} failed`,e)}}function Lb(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function jb(){const e=await tn("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return $b(e)}async function Bb(e){const t=await tn("thread/read",{threadId:e,includeTurns:!0});return{messages:Jd(t),inProgress:Db(t)}}async function Fb(){try{return await jb()}catch(e){throw ms(e,"Failed to load thread groups","thread/list")}}async function Ub(e){try{return await Bb(e)}catch(t){throw ms(t,`Failed to load thread ${e}`,"thread/read")}}function Hb(e){return yb(e)}async function Vb(e,t){await wb({id:e,...t})}async function Wb(){return bb()}async function Pi(e){await tn("thread/resume",{threadId:e})}async function qb(e){await tn("thread/archive",{threadId:e})}async function zb(e,t){await tn("thread/name/set",{threadId:e,name:t})}async function Ac(e,t){const n=await tn("thread/rollback",{threadId:e,numTurns:t});return Jd(n)}function Gb(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 Rc(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 tn("thread/start",n),s=Gb(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw ms(n,"Failed to start a new thread","thread/start")}}function Kb(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
|
|
36
|
-
`;for(const r of t)n+=`
|
|
37
|
-
## ${r.label}: ${r.path}
|
|
38
|
-
`;return`${n}
|
|
39
|
-
## My request for Codex:
|
|
40
|
-
|
|
41
|
-
${e}
|
|
42
|
-
`}async function xi(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:Kb(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 tn("turn/start",c)}catch(a){throw ms(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function Jb(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 tn("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw ms(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function Yb(e){await tn("setDefaultModel",{model:e})}async function Qb(){const e=await tn("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 Xb(){const e=await tn("config/read",{}),t=e.config.model??"",n=Lb(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function Zb(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 da(){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 Zb(n.data)}async function e_(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 Pc(){const e=await fetch("/codex-api/home-directory"),t=await e.json();if(!e.ok)throw new Error("Failed to load home directory");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{};return typeof r.path=="string"?r.path.trim():""}async function t_(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 n_(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=Ja(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 r_(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=Ja(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 s_(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=Ja(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 o_(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 Ja(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 i_(){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 Mi(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 a_(e,t){var n;try{return((n=(await tn("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function l_(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await tn("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 c_(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 u_={},d_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function f_(e,t){return w(),T("svg",d_,[...t[0]||(t[0]=[m("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 h_=nt(u_,[["render",f_]]),p_={},m_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function g_(e,t){return w(),T("svg",m_,[...t[0]||(t[0]=[m("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 v_=nt(p_,[["render",g_]]),y_={},w_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function b_(e,t){return w(),T("svg",w_,[...t[0]||(t[0]=[m("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),m("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 __=nt(y_,[["render",b_]]),k_=["disabled"],T_={class:"composer-dropdown-value"},I_={class:"composer-dropdown-menu"},S_={key:0,class:"composer-dropdown-search-wrap"},E_=["placeholder","onKeydown"],C_={class:"composer-dropdown-options",role:"listbox"},A_=["onClick"],R_={key:0,class:"composer-dropdown-empty"},P_={key:1,class:"composer-dropdown-add-wrap"},x_=["placeholder","onKeydown"],M_=$t({__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=L(null),o=L(null),i=L(null),a=L(!1),l=L(""),u=L(!1),c=L(""),f=fe(()=>{var Te;const ne=n.options.find(re=>re.value===n.modelValue);return ne?ne.label:((Te=n.placeholder)==null?void 0:Te.trim())||""}),h=fe(()=>n.openDirection??"down"),b=fe(()=>n.enableSearch===!0),$=fe(()=>n.showAddAction===!0),P=fe(()=>{var ne;return((ne=n.searchPlaceholder)==null?void 0:ne.trim())||"Quick search projects"}),H=fe(()=>{var ne;return((ne=n.addActionLabel)==null?void 0:ne.trim())||"Add new project"}),Y=fe(()=>{var ne;return((ne=n.addPlaceholder)==null?void 0:ne.trim())||"Project name or absolute path"}),D=fe(()=>{const ne=l.value.trim().toLowerCase();return ne?n.options.filter(Te=>Te.label.toLowerCase().includes(ne)||Te.value.toLowerCase().includes(ne)):n.options});function W(){n.disabled||(a.value=!a.value)}function j(ne){r("update:modelValue",ne),a.value=!1,l.value=""}function ue(){var ne;u.value=!0,c.value=((ne=n.defaultAddValue)==null?void 0:ne.trim())||"",on(()=>{var Te;return(Te=i.value)==null?void 0:Te.focus()})}function ae(){if(l.value.length>0){l.value="";return}a.value=!1}function ve(){const ne=c.value.trim();ne&&(r("add",ne),u.value=!1,c.value="",a.value=!1,l.value="")}function _e(){u.value=!1,c.value="",a.value=!1,l.value=""}function ie(ne){if(!a.value)return;const Te=s.value;if(!Te)return;const re=ne.target;re instanceof Node&&(Te.contains(re)||(a.value=!1,l.value="",u.value=!1,c.value=""))}return mt(a,ne=>{if(!ne){u.value=!1,c.value="";return}b.value&&on(()=>{var Te;return(Te=o.value)==null?void 0:Te.focus()})}),nr(()=>{window.addEventListener("pointerdown",ie)}),rr(()=>{window.removeEventListener("pointerdown",ie)}),(ne,Te)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[m("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:W},[m("span",T_,de(f.value),1),Ie(oi,{class:"composer-dropdown-chevron"})],8,k_),a.value?(w(),T("div",{key:0,class:gt(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":h.value==="up","composer-dropdown-menu-wrap-down":h.value==="down"}])},[m("div",I_,[b.value?(w(),T("div",S_,[Qn(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":Te[0]||(Te[0]=re=>l.value=re),class:"composer-dropdown-search-input",type:"text",placeholder:P.value,onKeydown:Xt(tt(ae,["prevent"]),["esc"])},null,40,E_),[[Xn,l.value]])])):le("",!0),m("ul",C_,[(w(!0),T(He,null,Tt(D.value,re=>(w(),T("li",{key:re.value},[m("button",{class:gt(["composer-dropdown-option",{"is-selected":re.value===e.modelValue}]),type:"button",onClick:Le=>j(re.value)},de(re.label),11,A_)]))),128)),D.value.length===0?(w(),T("li",R_," No matching projects ")):le("",!0)]),$.value?(w(),T("div",P_,[u.value?(w(),T(He,{key:0},[Qn(m("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":Te[1]||(Te[1]=re=>c.value=re),class:"composer-dropdown-add-input",type:"text",placeholder:Y.value,onKeydown:[Xt(tt(ve,["prevent"]),["enter"]),Xt(tt(_e,["prevent"]),["esc"])]},null,40,x_),[[Xn,c.value]]),m("div",{class:"composer-dropdown-add-actions"},[m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:ve},"Open"),m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:_e},"Cancel")])],64)):(w(),T("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:ue},de(H.value),1))])):le("",!0)])],2)):le("",!0)],512))}}),fa=nt(M_,[["__scopeId","data-v-7cfa2012"]]),O_=["disabled"],N_={class:"search-dropdown-value"},$_={class:"search-dropdown-search-wrap"},D_=["placeholder","onKeydown"],L_={key:0,class:"search-dropdown-list",role:"listbox"},j_=["onClick","onPointerenter"],B_={class:"search-dropdown-option-check"},F_={class:"search-dropdown-option-label"},U_={key:0,class:"search-dropdown-option-desc"},H_={key:1,class:"search-dropdown-empty"},V_=$t({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(null),i=L(!1),a=L(""),l=L(0),u=fe(()=>n.openDirection??"down"),c=fe(()=>new Set(n.selectedValues)),f=fe(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const D=n.options.find(W=>W.value===n.selectedValues[0]);return(D==null?void 0:D.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),h=fe(()=>{const D=a.value.toLowerCase().trim();return D?n.options.filter(W=>{var j;return W.label.toLowerCase().includes(D)||(((j=W.description)==null?void 0:j.toLowerCase().includes(D))??!1)}):n.options});function b(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,on(()=>{var D;return(D=o.value)==null?void 0:D.focus()})))}function $(D){r("toggle",D.value,!c.value.has(D.value))}function P(D){h.value.length!==0&&(l.value=(l.value+D+h.value.length)%h.value.length)}function H(){const D=h.value[l.value];D&&$(D)}function Y(D){if(!i.value)return;const W=s.value;if(!W)return;const j=D.target;j instanceof Node&&(W.contains(j)||(i.value=!1))}return mt(a,()=>{l.value=0}),nr(()=>window.addEventListener("pointerdown",Y)),rr(()=>window.removeEventListener("pointerdown",Y)),(D,W)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[m("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:b},[m("span",N_,de(f.value),1),Ie(oi,{class:"search-dropdown-chevron"})],8,O_),i.value?(w(),T("div",{key:0,class:gt(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":u.value==="up","search-dropdown-menu-wrap-down":u.value==="down"}])},[m("div",$_,[Qn(m("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":W[0]||(W[0]=j=>a.value=j),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[W[1]||(W[1]=Xt(tt(j=>i.value=!1,["prevent"]),["escape"])),Xt(tt(H,["prevent"]),["enter"]),W[2]||(W[2]=Xt(tt(j=>P(1),["prevent"]),["arrow-down"])),W[3]||(W[3]=Xt(tt(j=>P(-1),["prevent"]),["arrow-up"]))]},null,40,D_),[[Xn,a.value]])]),h.value.length>0?(w(),T("ul",L_,[(w(!0),T(He,null,Tt(h.value,(j,ue)=>(w(),T("li",{key:j.value},[m("button",{class:gt(["search-dropdown-option",{"is-selected":c.value.has(j.value),"is-highlighted":ue===l.value}]),type:"button",onClick:ae=>$(j),onPointerenter:ae=>l.value=ue},[m("span",B_,de(c.value.has(j.value)?"✓":""),1),m("span",F_,de(j.label),1),j.description?(w(),T("span",U_,de(j.description),1)):le("",!0)],42,j_)]))),128))])):(w(),T("div",H_,"No results"))],2)):le("",!0)],512))}}),W_=nt(V_,[["__scopeId","data-v-a0f2edd4"]]),q_={class:"skill-picker-header"},z_=["onKeydown"],G_={key:0,class:"skill-picker-list",role:"listbox"},K_=["onClick","onPointerenter"],J_={class:"skill-picker-name"},Y_={key:0,class:"skill-picker-desc"},Q_={key:1,class:"skill-picker-empty"},X_=$t({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(null),i=L(""),a=L(0),l=fe(()=>{const h=i.value.toLowerCase().trim();return h?n.skills.filter(b=>b.name.toLowerCase().includes(h)||b.description.toLowerCase().includes(h)):n.skills}),u=fe(()=>{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 mt(()=>n.visible,h=>{h&&(i.value="",a.value=0,on(()=>{var b;return(b=o.value)==null?void 0:b.focus()}))}),mt(i,()=>{a.value=0}),(h,b)=>e.visible?(w(),T("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:Wr(u.value)},[m("div",q_,[Qn(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":b[0]||(b[0]=$=>i.value=$),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[b[1]||(b[1]=Xt(tt($=>h.$emit("close"),["prevent"]),["escape"])),Xt(tt(f,["prevent"]),["enter"]),b[2]||(b[2]=Xt(tt($=>c(1),["prevent"]),["arrow-down"])),b[3]||(b[3]=Xt(tt($=>c(-1),["prevent"]),["arrow-up"]))]},null,40,z_),[[Xn,i.value]])]),l.value.length>0?(w(),T("ul",G_,[(w(!0),T(He,null,Tt(l.value,($,P)=>(w(),T("li",{key:$.path},[m("button",{class:gt(["skill-picker-item",{"is-highlighted":P===a.value}]),type:"button",onClick:H=>h.$emit("select",$),onPointerenter:H=>a.value=P},[m("span",J_,de($.name),1),$.description?(w(),T("span",Y_,de($.description),1)):le("",!0)],42,K_)]))),128))])):(w(),T("div",Q_,"No skills found"))],4)):le("",!0)}}),Z_=nt(X_,[["__scopeId","data-v-d6a08788"]]),e0={key:0,class:"thread-composer-attachments"},t0=["src","alt"],n0=["aria-label","disabled","onClick"],r0={key:1,class:"thread-composer-file-chips"},s0=["title"],o0=["aria-label","disabled","onClick"],i0={key:2,class:"thread-composer-skill-chips"},a0={class:"thread-composer-skill-chip-name"},l0=["aria-label","onClick"],c0={class:"thread-composer-input-wrap"},u0={key:0,class:"thread-composer-file-mentions"},d0=["onMousedown"],f0={key:1,class:"thread-composer-file-mention-icon-markdown"},h0={class:"thread-composer-file-mention-text"},p0={class:"thread-composer-file-mention-name"},m0={key:0,class:"thread-composer-file-mention-dir"},g0={key:1,class:"thread-composer-file-mention-empty"},v0=["placeholder","disabled"],y0={class:"thread-composer-controls"},w0=["disabled"],b0={key:0,class:"thread-composer-attach-menu"},_0=["disabled"],k0=["disabled"],T0={class:"thread-composer-actions"},I0=["aria-label","title","disabled"],S0=["disabled"],E0=["aria-label","title","disabled"],C0=["disabled"],A0=["disabled"],R0=$t({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},models:{},selectedModel:{},selectedReasoningEffort:{},skills:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(e,{emit:t}){const n=e,r=t,s=L(""),o=L([]),i=L([]),a=L([]),{state:l,isSupported:u,startRecording:c,stopRecording:f}=gb({onTranscript:F=>{s.value=s.value?`${s.value}
|
|
43
|
-
${F}`:F}}),h=L(null),b=L(null),$=L(null),P=L(null),H=L(!1),Y=L(!1),D=L(null),W=L(""),j=L([]),ue=L(!1),ae=L(0);let ve=0,_e=null;const ie=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),ne=[{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"}],Te=fe(()=>n.models.map(F=>({value:F,label:F}))),re=fe(()=>n.skills??[]),Le=fe(()=>i.value.map(F=>F.path)),je=fe(()=>(n.skills??[]).map(F=>({value:F.path,label:F.name,description:F.description}))),Xe=fe(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),Ee=fe(()=>n.disabled||!n.activeThreadId),ke=fe(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),Ne=fe(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function ze(F="steer"){var se;const z=s.value.trim();if(Xe.value){if(r("submit",{text:z,imageUrls:o.value.map(Qe=>Qe.url),fileAttachments:[...a.value],skills:i.value.map(Qe=>({name:Qe.name,path:Qe.path})),mode:F}),s.value="",o.value=[],i.value=[],a.value=[],H.value=!1,Y.value=!1,Z(),ie){(se=P.value)==null||se.blur();return}on(()=>{var Qe;return(Qe=P.value)==null?void 0:Qe.focus()})}}function rt(){r("interrupt")}function Ze(F){r("update:selected-model",F)}function et(F){r("update:selected-reasoning-effort",F)}function ht(){Ee.value||(H.value=!H.value)}function St(){var F;(F=b.value)==null||F.click()}function Ge(){var F;(F=$.value)==null||F.click()}function Ke(F){o.value=o.value.filter(z=>z.id!==F)}function U(F){i.value=i.value.filter(z=>z.path!==F)}function he(F){a.value=a.value.filter(z=>z.fsPath!==F)}function ce(F){const z=F.replace(/\\/g,"/");if(a.value.some(lt=>lt.fsPath===z))return;const se=z.split("/").filter(Boolean),Qe=se[se.length-1]??z;a.value=[...a.value,{label:Qe,path:z,fsPath:z}]}function me(F){return F.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(F.name)}function Oe(F){if(!(!F||F.length===0))for(const z of Array.from(F))if(me(z)){const se=new FileReader;se.onload=()=>{typeof se.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:z.name,url:se.result})},se.readAsDataURL(z)}else c_(z).then(se=>{se&&ce(se)}).catch(()=>{})}function g(F){F&&(F.value="")}function v(F){const z=F.target;Oe((z==null?void 0:z.files)??null),g(z),H.value=!1}function S(F){const z=F.target;Oe((z==null?void 0:z.files)??null),g(z),H.value=!1}function B(){const z=s.value.startsWith("/");z!==Y.value&&(Y.value=z),R()}function q(F){if(ue.value){if(F.key==="Escape"){F.preventDefault(),Z();return}if(F.key==="ArrowDown"){F.preventDefault(),j.value.length>0&&(ae.value=(ae.value+1)%j.value.length);return}if(F.key==="ArrowUp"){if(F.preventDefault(),j.value.length>0){const se=j.value.length;ae.value=(ae.value+se-1)%se}return}if(F.key==="Enter"||F.key==="Tab"){F.preventDefault();const se=j.value[ae.value];se?N(se):Z();return}}if(n.sendWithEnter!==!1?F.key==="Enter"&&!F.shiftKey:F.key==="Enter"&&(F.metaKey||F.ctrlKey)){F.preventDefault(),ze(n.isTurnInProgress?ke.value:"steer");return}if(Y.value){if(F.key==="Escape"){F.preventDefault(),V();return}if(F.key==="ArrowDown"||F.key==="ArrowUp"){F.preventDefault();return}}}function V(){var F;Y.value=!1,(F=P.value)==null||F.focus()}function Z(){ue.value=!1,D.value=null,W.value="",j.value=[],ae.value=0}function R(){const F=P.value;if(!F){Z();return}const z=F.selectionStart??s.value.length,Qe=s.value.slice(0,z).match(/(^|\s)(@[^\s@]*)$/);if(!Qe){Z();return}const lt=Qe[2]??"",yt=lt.length,At=z-yt;D.value=At,W.value=lt.slice(1),ue.value=!0,x()}async function x(){if(!ue.value)return;const F=(n.cwd??"").trim();if(!F){j.value=[];return}_e&&clearTimeout(_e);const z=++ve;_e=setTimeout(async()=>{try{const se=await s_(F,W.value,20);if(!ue.value||z!==ve)return;j.value=se,ae.value=0}catch{if(!ue.value||z!==ve)return;j.value=[]}},120)}function N(F){const z=P.value,se=D.value;if(se!==null&&z){const Qe=z.selectionStart??s.value.length;s.value=`${s.value.slice(0,se)}${s.value.slice(Qe)}`.trimEnd()}ce(F.path),Z(),on(()=>z==null?void 0:z.focus())}function te(F){const z=F.lastIndexOf("/");return z<0?F:F.slice(z+1)}function X(F){const z=F.lastIndexOf("/");return z<=0?"":F.slice(0,z)}function oe(F){const z=te(F),se=z.lastIndexOf(".");return se<=0?"":z.slice(se+1).toLowerCase()}function ye(F){const z=oe(F);return z==="ts"?"TS":z==="tsx"?"TSX":z==="js"?"JS":z==="jsx"?"JSX":z==="json"?"{}":""}function Se(F){const z=oe(F);return z.startsWith("ts")?"ts":z.startsWith("js")?"js":z==="json"?"json":"default"}function Ye(F){const z=oe(F);return z==="md"||z==="mdx"}function Ce(F){var z;i.value.some(se=>se.path===F.path)||(i.value=[...i.value,F]),s.value=s.value.startsWith("/")?"":s.value,Y.value=!1,(z=P.value)==null||z.focus()}function Je(F,z){if(z){const se=(n.skills??[]).find(Qe=>Qe.path===F);se&&!i.value.some(Qe=>Qe.path===F)&&(i.value=[...i.value,se])}else i.value=i.value.filter(se=>se.path!==F)}function ot(F){if(!H.value)return;const z=h.value;if(!z)return;const se=F.target;!se||z.contains(se)||(H.value=!1)}return nr(()=>{document.addEventListener("click",ot)}),rr(()=>{document.removeEventListener("click",ot),_e&&clearTimeout(_e)}),mt(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],H.value=!1,Y.value=!1,Z()}),mt(()=>n.cwd,()=>{ue.value&&x()}),(F,z)=>(w(),T("form",{class:"thread-composer",onSubmit:z[7]||(z[7]=tt(se=>ze("steer"),["prevent"]))},[m("div",{class:gt(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(w(),T("div",e0,[(w(!0),T(He,null,Tt(o.value,se=>(w(),T("div",{key:se.id,class:"thread-composer-attachment"},[m("img",{class:"thread-composer-attachment-image",src:se.url,alt:se.name||"Selected image"},null,8,t0),m("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${se.name||"image"}`,disabled:Ee.value,onClick:Qe=>Ke(se.id)}," x ",8,n0)]))),128))])):le("",!0),a.value.length>0?(w(),T("div",r0,[(w(!0),T(He,null,Tt(a.value,se=>(w(),T("span",{key:se.fsPath,class:"thread-composer-file-chip"},[Ie(Do,{class:"thread-composer-file-chip-icon"}),m("span",{class:"thread-composer-file-chip-name",title:se.fsPath},de(se.label),9,s0),m("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${se.label}`,disabled:Ee.value,onClick:Qe=>he(se.fsPath)},"×",8,o0)]))),128))])):le("",!0),i.value.length>0?(w(),T("div",i0,[(w(!0),T(He,null,Tt(i.value,se=>(w(),T("span",{key:se.path,class:"thread-composer-skill-chip"},[m("span",a0,de(se.name),1),m("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${se.name}`,onClick:Qe=>U(se.path)},"×",8,l0)]))),128))])):le("",!0),m("div",c0,[ue.value?(w(),T("div",u0,[j.value.length>0?(w(!0),T(He,{key:0},Tt(j.value,(se,Qe)=>(w(),T("button",{key:se.path,class:gt(["thread-composer-file-mention-row",{"is-active":Qe===ae.value}]),type:"button",onMousedown:tt(lt=>N(se),["prevent"])},[ye(se.path)?(w(),T("span",{key:0,class:gt(["thread-composer-file-mention-icon-badge",`is-${Se(se.path)}`])},de(ye(se.path)),3)):Ye(se.path)?(w(),T("span",f0,"↓")):(w(),vt(Do,{key:2,class:"thread-composer-file-mention-icon-file"})),m("span",h0,[m("span",p0,de(te(se.path)),1),X(se.path)?(w(),T("span",m0,de(X(se.path)),1)):le("",!0)])],42,d0))),128)):(w(),T("div",g0,"No matching files"))])):le("",!0),Qn(m("textarea",{ref_key:"inputRef",ref:P,"onUpdate:modelValue":z[0]||(z[0]=se=>s.value=se),class:"thread-composer-input",placeholder:Ne.value,disabled:Ee.value,onInput:B,onKeydown:q},null,40,v0),[[Xn,s.value]]),Ie(Z_,{skills:re.value,visible:Y.value,"anchor-bottom":44,"anchor-left":0,onSelect:Ce,onClose:V},null,8,["skills","visible"])]),m("div",y0,[m("div",{ref_key:"attachMenuRootRef",ref:h,class:"thread-composer-attach"},[m("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:Ee.value,onClick:ht}," + ",8,w0),H.value?(w(),T("div",b0,[m("button",{class:"thread-composer-attach-item",type:"button",disabled:Ee.value,onClick:St}," Add photos & files ",8,_0),m("button",{class:"thread-composer-attach-item",type:"button",disabled:Ee.value,onClick:Ge}," Take photo ",8,k0)])):le("",!0)],512),Ie(fa,{class:"thread-composer-control","model-value":e.selectedModel,options:Te.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":Ze},null,8,["model-value","options","disabled"]),Ie(W_,{class:"thread-composer-control",options:je.value,"selected-values":Le.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:Je},null,8,["options","selected-values","disabled"]),Ie(fa,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:ne,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":et},null,8,["model-value","disabled"]),m("div",T0,[$e(u)&&!e.isTurnInProgress?(w(),T("button",{key:0,class:gt(["thread-composer-mic",{"thread-composer-mic--active":$e(l)!=="idle"}]),type:"button","aria-label":$e(l)==="recording"?"Stop dictation":"Hold to dictate",title:$e(l)==="recording"?"Release to transcribe":"Hold to dictate",disabled:Ee.value,onMousedown:z[1]||(z[1]=tt((...se)=>$e(c)&&$e(c)(...se),["prevent"])),onMouseup:z[2]||(z[2]=(...se)=>$e(f)&&$e(f)(...se)),onMouseleave:z[3]||(z[3]=se=>$e(l)==="recording"&&$e(f)()),onTouchstart:z[4]||(z[4]=tt((...se)=>$e(c)&&$e(c)(...se),["prevent"])),onTouchend:z[5]||(z[5]=(...se)=>$e(f)&&$e(f)(...se))},[Ie(v_,{class:"thread-composer-mic-icon"})],42,I0)):le("",!0),e.isTurnInProgress?(w(),T("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:rt},[Ie(__,{class:"thread-composer-stop-icon"})],8,S0)):le("",!0),m("button",{class:gt(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&ke.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&ke.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${ke.value}`:"Send",disabled:!Xe.value,onClick:z[6]||(z[6]=se=>ze(e.isTurnInProgress?ke.value:"steer"))},[Ie(h_,{class:"thread-composer-submit-icon"})],10,E0)])])],2),m("input",{ref_key:"photoLibraryInputRef",ref:b,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:Ee.value,onChange:v},null,40,C0),m("input",{ref_key:"cameraCaptureInputRef",ref:$,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:Ee.value,onChange:S},null,40,A0)],32))}}),xc=nt(R0,[["__scopeId","data-v-983e7906"]]),P0={key:0,class:"queued-messages"},x0={class:"queued-messages-inner"},M0={class:"queued-row-text"},O0={class:"queued-row-actions"},N0=["onClick"],$0=["onClick"],D0=$t({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(w(),T("div",P0,[m("div",x0,[(w(!0),T(He,null,Tt(e.messages,r=>(w(),T("div",{key:r.id,class:"queued-row"},[n[1]||(n[1]=m("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[m("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)),m("span",M0,de(r.text),1),m("div",O0,[m("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,N0),m("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]=[m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7h16M10 11v6M14 11v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"})],-1)])],8,$0)])]))),128))])])):le("",!0)}}),L0=nt(D0,[["__scopeId","data-v-ea583733"]]),j0={class:"runtime-dropdown-trigger-label"},B0={key:0,class:"runtime-dropdown-menu-wrap"},F0={class:"runtime-dropdown-menu"},U0=["onClick"],H0={class:"runtime-dropdown-option-label"},V0={key:0,class:"runtime-dropdown-option-check"},W0=$t({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=L(null),o=L(!1),i=[{value:"local",label:"Local project",icon:zd},{value:"worktree",label:"New worktree",icon:To}],a=fe(()=>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 nr(()=>{window.addEventListener("pointerdown",u)}),rr(()=>{window.removeEventListener("pointerdown",u)}),(c,f)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"runtime-dropdown"},[m("button",{class:"runtime-dropdown-trigger",type:"button",onClick:f[0]||(f[0]=h=>o.value=!o.value)},[(w(),vt(Zi(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),m("span",j0,de(a.value.label),1),Ie(oi,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(w(),T("div",B0,[m("div",F0,[f[1]||(f[1]=m("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(w(),T(He,null,Tt(i,h=>m("button",{key:h.value,class:gt(["runtime-dropdown-option",{"is-selected":e.modelValue===h.value}]),type:"button",onClick:b=>l(h.value)},[(w(),vt(Zi(h.icon),{class:"runtime-dropdown-option-icon"})),m("span",H0,de(h.label),1),e.modelValue===h.value?(w(),T("span",V0,"✓")):le("",!0)],10,U0)),64))])])):le("",!0)],512))}}),q0=nt(W0,[["__scopeId","data-v-9c9b71e5"]]),z0=()=>{};var Mc={};/**
|
|
44
|
-
* @license
|
|
45
|
-
* Copyright 2017 Google LLC
|
|
46
|
-
*
|
|
47
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
48
|
-
* you may not use this file except in compliance with the License.
|
|
49
|
-
* You may obtain a copy of the License at
|
|
50
|
-
*
|
|
51
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
52
|
-
*
|
|
53
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
54
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
55
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
56
|
-
* See the License for the specific language governing permissions and
|
|
57
|
-
* limitations under the License.
|
|
58
|
-
*/const Yd=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):(s&64512)===55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320?(s=65536+((s&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128)}return t},G0=function(e){const t=[];let n=0,r=0;for(;n<e.length;){const s=e[n++];if(s<128)t[r++]=String.fromCharCode(s);else if(s>191&&s<224){const o=e[n++];t[r++]=String.fromCharCode((s&31)<<6|o&63)}else if(s>239&&s<365){const o=e[n++],i=e[n++],a=e[n++],l=((s&7)<<18|(o&63)<<12|(i&63)<<6|a&63)-65536;t[r++]=String.fromCharCode(55296+(l>>10)),t[r++]=String.fromCharCode(56320+(l&1023))}else{const o=e[n++],i=e[n++];t[r++]=String.fromCharCode((s&15)<<12|(o&63)<<6|i&63)}}return t.join("")},Qd={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let s=0;s<e.length;s+=3){const o=e[s],i=s+1<e.length,a=i?e[s+1]:0,l=s+2<e.length,u=l?e[s+2]:0,c=o>>2,f=(o&3)<<4|a>>4;let h=(a&15)<<2|u>>6,b=u&63;l||(b=64,i||(h=64)),r.push(n[c],n[f],n[h],n[b])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(Yd(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):G0(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 K0;const h=o<<2|a>>4;if(r.push(h),u!==64){const b=a<<4&240|u>>2;if(r.push(b),f!==64){const $=u<<6&192|f;r.push($)}}}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 K0 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const J0=function(e){const t=Yd(e);return Qd.encodeByteArray(t,!0)},Xd=function(e){return J0(e).replace(/\./g,"")},Zd=function(e){try{return Qd.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
|
|
59
|
-
* @license
|
|
60
|
-
* Copyright 2022 Google LLC
|
|
61
|
-
*
|
|
62
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
63
|
-
* you may not use this file except in compliance with the License.
|
|
64
|
-
* You may obtain a copy of the License at
|
|
65
|
-
*
|
|
66
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
67
|
-
*
|
|
68
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
69
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
70
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
71
|
-
* See the License for the specific language governing permissions and
|
|
72
|
-
* limitations under the License.
|
|
73
|
-
*/function Y0(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
|
|
74
|
-
* @license
|
|
75
|
-
* Copyright 2022 Google LLC
|
|
76
|
-
*
|
|
77
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
78
|
-
* you may not use this file except in compliance with the License.
|
|
79
|
-
* You may obtain a copy of the License at
|
|
80
|
-
*
|
|
81
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
82
|
-
*
|
|
83
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
84
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
85
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
86
|
-
* See the License for the specific language governing permissions and
|
|
87
|
-
* limitations under the License.
|
|
88
|
-
*/const Q0=()=>Y0().__FIREBASE_DEFAULTS__,X0=()=>{if(typeof process>"u"||typeof Mc>"u")return;const e=Mc.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},Z0=()=>{if(typeof document>"u")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const t=e&&Zd(e[1]);return t&&JSON.parse(t)},Ya=()=>{try{return z0()||Q0()||X0()||Z0()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},ek=e=>{var t,n;return(n=(t=Ya())==null?void 0:t.emulatorHosts)==null?void 0:n[e]},ef=()=>{var e;return(e=Ya())==null?void 0:e.config},tf=e=>{var t;return(t=Ya())==null?void 0:t[`_${e}`]};/**
|
|
89
|
-
* @license
|
|
90
|
-
* Copyright 2017 Google LLC
|
|
91
|
-
*
|
|
92
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
93
|
-
* you may not use this file except in compliance with the License.
|
|
94
|
-
* You may obtain a copy of the License at
|
|
95
|
-
*
|
|
96
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
97
|
-
*
|
|
98
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
99
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
100
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
101
|
-
* See the License for the specific language governing permissions and
|
|
102
|
-
* limitations under the License.
|
|
103
|
-
*/class tk{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}wrapCallback(t){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(n):t(n,r))}}}/**
|
|
104
|
-
* @license
|
|
105
|
-
* Copyright 2025 Google LLC
|
|
106
|
-
*
|
|
107
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
108
|
-
* you may not use this file except in compliance with the License.
|
|
109
|
-
* You may obtain a copy of the License at
|
|
110
|
-
*
|
|
111
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
112
|
-
*
|
|
113
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
114
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
115
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
116
|
-
* See the License for the specific language governing permissions and
|
|
117
|
-
* limitations under the License.
|
|
118
|
-
*/function ii(e){try{return(e.startsWith("http://")||e.startsWith("https://")?new URL(e).hostname:e).endsWith(".cloudworkstations.dev")}catch{return!1}}async function nk(e){return(await fetch(e,{credentials:"include"})).ok}const js={};function rk(){const e={prod:[],emulator:[]};for(const t of Object.keys(js))js[t]?e.emulator.push(t):e.prod.push(t);return e}function sk(e){let t=document.getElementById(e),n=!1;return t||(t=document.createElement("div"),t.setAttribute("id",e),n=!0),{created:n,element:t}}let Oc=!1;function ok(e,t){if(typeof window>"u"||typeof document>"u"||!ii(window.location.host)||js[e]===t||js[e]||Oc)return;js[e]=t;function n(h){return`__firebase__banner__${h}`}const r="__firebase__banner",o=rk().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,b){h.setAttribute("width","24"),h.setAttribute("id",b),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=()=>{Oc=!0,i()},h}function c(h,b){h.setAttribute("id",b),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=sk(r),b=n("text"),$=document.getElementById(b)||document.createElement("span"),P=n("learnmore"),H=document.getElementById(P)||document.createElement("a"),Y=n("preprendIcon"),D=document.getElementById(Y)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(h.created){const W=h.element;a(W),c(H,P);const j=u();l(D,Y),W.append(D,$,H,j),document.body.appendChild(W)}o?($.innerText="Preview backend disconnected.",D.innerHTML=`<g clip-path="url(#clip0_6013_33858)">
|
|
119
|
-
<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/>
|
|
120
|
-
</g>
|
|
121
|
-
<defs>
|
|
122
|
-
<clipPath id="clip0_6013_33858">
|
|
123
|
-
<rect width="24" height="24" fill="white"/>
|
|
124
|
-
</clipPath>
|
|
125
|
-
</defs>`):(D.innerHTML=`<g clip-path="url(#clip0_6083_34804)">
|
|
126
|
-
<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444 12.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/>
|
|
127
|
-
</g>
|
|
128
|
-
<defs>
|
|
129
|
-
<clipPath id="clip0_6083_34804">
|
|
130
|
-
<rect width="24" height="24" fill="white"/>
|
|
131
|
-
</clipPath>
|
|
132
|
-
</defs>`,$.innerText="Preview backend running in this workspace."),$.setAttribute("id",b)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",f):f()}/**
|
|
133
|
-
* @license
|
|
134
|
-
* Copyright 2017 Google LLC
|
|
135
|
-
*
|
|
136
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
137
|
-
* you may not use this file except in compliance with the License.
|
|
138
|
-
* You may obtain a copy of the License at
|
|
139
|
-
*
|
|
140
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
141
|
-
*
|
|
142
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
143
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
144
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
145
|
-
* See the License for the specific language governing permissions and
|
|
146
|
-
* limitations under the License.
|
|
147
|
-
*/function Zt(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function ik(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Zt())}function ak(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function lk(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function ck(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function uk(){const e=Zt();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function dk(){try{return typeof indexedDB=="object"}catch{return!1}}function fk(){return new Promise((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(r);s.onsuccess=()=>{s.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},s.onupgradeneeded=()=>{n=!1},s.onerror=()=>{var o;t(((o=s.error)==null?void 0:o.message)||"")}}catch(n){t(n)}})}/**
|
|
148
|
-
* @license
|
|
149
|
-
* Copyright 2017 Google LLC
|
|
150
|
-
*
|
|
151
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
152
|
-
* you may not use this file except in compliance with the License.
|
|
153
|
-
* You may obtain a copy of the License at
|
|
154
|
-
*
|
|
155
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
156
|
-
*
|
|
157
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
158
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
159
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
160
|
-
* See the License for the specific language governing permissions and
|
|
161
|
-
* limitations under the License.
|
|
162
|
-
*/const hk="FirebaseError";class kr extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=hk,Object.setPrototypeOf(this,kr.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,no.prototype.create)}}class no{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?pk(o,r):"Error",a=`${this.serviceName}: ${i} (${s}).`;return new kr(s,a,r)}}function pk(e,t){return e.replace(mk,(n,r)=>{const s=t[r];return s!=null?String(s):`<${r}?>`})}const mk=/\{\$([^}]+)}/g;function gk(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function fs(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const s of n){if(!r.includes(s))return!1;const o=e[s],i=t[s];if(Nc(o)&&Nc(i)){if(!fs(o,i))return!1}else if(o!==i)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function Nc(e){return e!==null&&typeof e=="object"}/**
|
|
163
|
-
* @license
|
|
164
|
-
* Copyright 2017 Google LLC
|
|
165
|
-
*
|
|
166
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
167
|
-
* you may not use this file except in compliance with the License.
|
|
168
|
-
* You may obtain a copy of the License at
|
|
169
|
-
*
|
|
170
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
171
|
-
*
|
|
172
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
173
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
174
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
175
|
-
* See the License for the specific language governing permissions and
|
|
176
|
-
* limitations under the License.
|
|
177
|
-
*/function ro(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 vk(e,t){const n=new yk(e,t);return n.subscribe.bind(n)}class yk{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.");wk(t,["next","error","complete"])?s=t:s={next:t,error:n,complete:r},s.next===void 0&&(s.next=Oi),s.error===void 0&&(s.error=Oi),s.complete===void 0&&(s.complete=Oi);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 wk(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 Oi(){}/**
|
|
178
|
-
* @license
|
|
179
|
-
* Copyright 2021 Google LLC
|
|
180
|
-
*
|
|
181
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
-
* you may not use this file except in compliance with the License.
|
|
183
|
-
* You may obtain a copy of the License at
|
|
184
|
-
*
|
|
185
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
-
*
|
|
187
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
188
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
-
* See the License for the specific language governing permissions and
|
|
191
|
-
* limitations under the License.
|
|
192
|
-
*/function gs(e){return e&&e._delegate?e._delegate:e}class hs{constructor(t,n,r){this.name=t,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}/**
|
|
193
|
-
* @license
|
|
194
|
-
* Copyright 2019 Google LLC
|
|
195
|
-
*
|
|
196
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
197
|
-
* you may not use this file except in compliance with the License.
|
|
198
|
-
* You may obtain a copy of the License at
|
|
199
|
-
*
|
|
200
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
201
|
-
*
|
|
202
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
203
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
204
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
205
|
-
* See the License for the specific language governing permissions and
|
|
206
|
-
* limitations under the License.
|
|
207
|
-
*/const Dr="[DEFAULT]";/**
|
|
208
|
-
* @license
|
|
209
|
-
* Copyright 2019 Google LLC
|
|
210
|
-
*
|
|
211
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
212
|
-
* you may not use this file except in compliance with the License.
|
|
213
|
-
* You may obtain a copy of the License at
|
|
214
|
-
*
|
|
215
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
216
|
-
*
|
|
217
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
218
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
219
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
220
|
-
* See the License for the specific language governing permissions and
|
|
221
|
-
* limitations under the License.
|
|
222
|
-
*/class bk{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 tk;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(kk(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:_k(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 _k(e){return e===Dr?void 0:e}function kk(e){return e.instantiationMode==="EAGER"}/**
|
|
223
|
-
* @license
|
|
224
|
-
* Copyright 2019 Google LLC
|
|
225
|
-
*
|
|
226
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
227
|
-
* you may not use this file except in compliance with the License.
|
|
228
|
-
* You may obtain a copy of the License at
|
|
229
|
-
*
|
|
230
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
231
|
-
*
|
|
232
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
233
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
234
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
235
|
-
* See the License for the specific language governing permissions and
|
|
236
|
-
* limitations under the License.
|
|
237
|
-
*/class Tk{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 bk(t,this);return this.providers.set(t,n),n}getProviders(){return Array.from(this.providers.values())}}/**
|
|
238
|
-
* @license
|
|
239
|
-
* Copyright 2017 Google LLC
|
|
240
|
-
*
|
|
241
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
242
|
-
* you may not use this file except in compliance with the License.
|
|
243
|
-
* You may obtain a copy of the License at
|
|
244
|
-
*
|
|
245
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
246
|
-
*
|
|
247
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
248
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
249
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
250
|
-
* See the License for the specific language governing permissions and
|
|
251
|
-
* limitations under the License.
|
|
252
|
-
*/var wt;(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"})(wt||(wt={}));const Ik={debug:wt.DEBUG,verbose:wt.VERBOSE,info:wt.INFO,warn:wt.WARN,error:wt.ERROR,silent:wt.SILENT},Sk=wt.INFO,Ek={[wt.DEBUG]:"log",[wt.VERBOSE]:"log",[wt.INFO]:"info",[wt.WARN]:"warn",[wt.ERROR]:"error"},Ck=(e,t,...n)=>{if(t<e.logLevel)return;const r=new Date().toISOString(),s=Ek[t];if(s)console[s](`[${r}] ${e.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class nf{constructor(t){this.name=t,this._logLevel=Sk,this._logHandler=Ck,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in wt))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?Ik[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,wt.DEBUG,...t),this._logHandler(this,wt.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,wt.VERBOSE,...t),this._logHandler(this,wt.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,wt.INFO,...t),this._logHandler(this,wt.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,wt.WARN,...t),this._logHandler(this,wt.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,wt.ERROR,...t),this._logHandler(this,wt.ERROR,...t)}}const Ak=(e,t)=>t.some(n=>e instanceof n);let $c,Dc;function Rk(){return $c||($c=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Pk(){return Dc||(Dc=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const rf=new WeakMap,ha=new WeakMap,sf=new WeakMap,Ni=new WeakMap,Qa=new WeakMap;function xk(e){const t=new Promise((n,r)=>{const s=()=>{e.removeEventListener("success",o),e.removeEventListener("error",i)},o=()=>{n(yr(e.result)),s()},i=()=>{r(e.error),s()};e.addEventListener("success",o),e.addEventListener("error",i)});return t.then(n=>{n instanceof IDBCursor&&rf.set(n,e)}).catch(()=>{}),Qa.set(t,e),t}function Mk(e){if(ha.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)});ha.set(e,t)}let pa={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return ha.get(e);if(t==="objectStoreNames")return e.objectStoreNames||sf.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return yr(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 Ok(e){pa=e(pa)}function Nk(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call($i(this),t,...n);return sf.set(r,t.sort?t.sort():[t]),yr(r)}:Pk().includes(e)?function(...t){return e.apply($i(this),t),yr(rf.get(this))}:function(...t){return yr(e.apply($i(this),t))}}function $k(e){return typeof e=="function"?Nk(e):(e instanceof IDBTransaction&&Mk(e),Ak(e,Rk())?new Proxy(e,pa):e)}function yr(e){if(e instanceof IDBRequest)return xk(e);if(Ni.has(e))return Ni.get(e);const t=$k(e);return t!==e&&(Ni.set(e,t),Qa.set(t,e)),t}const $i=e=>Qa.get(e);function Dk(e,t,{blocked:n,upgrade:r,blocking:s,terminated:o}={}){const i=indexedDB.open(e,t),a=yr(i);return r&&i.addEventListener("upgradeneeded",l=>{r(yr(i.result),l.oldVersion,l.newVersion,yr(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 Lk=["get","getKey","getAll","getAllKeys","count"],jk=["put","add","delete","clear"],Di=new Map;function Lc(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(Di.get(t))return Di.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,s=jk.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||Lk.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 Di.set(t,o),o}Ok(e=>({...e,get:(t,n,r)=>Lc(t,n)||e.get(t,n,r),has:(t,n)=>!!Lc(t,n)||e.has(t,n)}));/**
|
|
253
|
-
* @license
|
|
254
|
-
* Copyright 2019 Google LLC
|
|
255
|
-
*
|
|
256
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
257
|
-
* you may not use this file except in compliance with the License.
|
|
258
|
-
* You may obtain a copy of the License at
|
|
259
|
-
*
|
|
260
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
261
|
-
*
|
|
262
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
263
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
264
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
265
|
-
* See the License for the specific language governing permissions and
|
|
266
|
-
* limitations under the License.
|
|
267
|
-
*/class Bk{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(Fk(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function Fk(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const ma="@firebase/app",jc="0.14.9";/**
|
|
268
|
-
* @license
|
|
269
|
-
* Copyright 2019 Google LLC
|
|
270
|
-
*
|
|
271
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
272
|
-
* you may not use this file except in compliance with the License.
|
|
273
|
-
* You may obtain a copy of the License at
|
|
274
|
-
*
|
|
275
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
276
|
-
*
|
|
277
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
278
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
279
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
280
|
-
* See the License for the specific language governing permissions and
|
|
281
|
-
* limitations under the License.
|
|
282
|
-
*/const Zn=new nf("@firebase/app"),Uk="@firebase/app-compat",Hk="@firebase/analytics-compat",Vk="@firebase/analytics",Wk="@firebase/app-check-compat",qk="@firebase/app-check",zk="@firebase/auth",Gk="@firebase/auth-compat",Kk="@firebase/database",Jk="@firebase/data-connect",Yk="@firebase/database-compat",Qk="@firebase/functions",Xk="@firebase/functions-compat",Zk="@firebase/installations",eT="@firebase/installations-compat",tT="@firebase/messaging",nT="@firebase/messaging-compat",rT="@firebase/performance",sT="@firebase/performance-compat",oT="@firebase/remote-config",iT="@firebase/remote-config-compat",aT="@firebase/storage",lT="@firebase/storage-compat",cT="@firebase/firestore",uT="@firebase/ai",dT="@firebase/firestore-compat",fT="firebase",hT="12.10.0";/**
|
|
283
|
-
* @license
|
|
284
|
-
* Copyright 2019 Google LLC
|
|
285
|
-
*
|
|
286
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
287
|
-
* you may not use this file except in compliance with the License.
|
|
288
|
-
* You may obtain a copy of the License at
|
|
289
|
-
*
|
|
290
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
291
|
-
*
|
|
292
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
293
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
294
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
295
|
-
* See the License for the specific language governing permissions and
|
|
296
|
-
* limitations under the License.
|
|
297
|
-
*/const ga="[DEFAULT]",pT={[ma]:"fire-core",[Uk]:"fire-core-compat",[Vk]:"fire-analytics",[Hk]:"fire-analytics-compat",[qk]:"fire-app-check",[Wk]:"fire-app-check-compat",[zk]:"fire-auth",[Gk]:"fire-auth-compat",[Kk]:"fire-rtdb",[Jk]:"fire-data-connect",[Yk]:"fire-rtdb-compat",[Qk]:"fire-fn",[Xk]:"fire-fn-compat",[Zk]:"fire-iid",[eT]:"fire-iid-compat",[tT]:"fire-fcm",[nT]:"fire-fcm-compat",[rT]:"fire-perf",[sT]:"fire-perf-compat",[oT]:"fire-rc",[iT]:"fire-rc-compat",[aT]:"fire-gcs",[lT]:"fire-gcs-compat",[cT]:"fire-fst",[dT]:"fire-fst-compat",[uT]:"fire-vertex","fire-js":"fire-js",[fT]:"fire-js-all"};/**
|
|
298
|
-
* @license
|
|
299
|
-
* Copyright 2019 Google LLC
|
|
300
|
-
*
|
|
301
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
302
|
-
* you may not use this file except in compliance with the License.
|
|
303
|
-
* You may obtain a copy of the License at
|
|
304
|
-
*
|
|
305
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
306
|
-
*
|
|
307
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
308
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
309
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
310
|
-
* See the License for the specific language governing permissions and
|
|
311
|
-
* limitations under the License.
|
|
312
|
-
*/const Js=new Map,mT=new Map,va=new Map;function Bc(e,t){try{e.container.addComponent(t)}catch(n){Zn.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function Ys(e){const t=e.name;if(va.has(t))return Zn.debug(`There were multiple attempts to register component ${t}.`),!1;va.set(t,e);for(const n of Js.values())Bc(n,e);for(const n of mT.values())Bc(n,e);return!0}function of(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function An(e){return e==null?!1:e.settings!==void 0}/**
|
|
313
|
-
* @license
|
|
314
|
-
* Copyright 2019 Google LLC
|
|
315
|
-
*
|
|
316
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
317
|
-
* you may not use this file except in compliance with the License.
|
|
318
|
-
* You may obtain a copy of the License at
|
|
319
|
-
*
|
|
320
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
321
|
-
*
|
|
322
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
323
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
324
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
325
|
-
* See the License for the specific language governing permissions and
|
|
326
|
-
* limitations under the License.
|
|
327
|
-
*/const gT={"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."},wr=new no("app","Firebase",gT);/**
|
|
328
|
-
* @license
|
|
329
|
-
* Copyright 2019 Google LLC
|
|
330
|
-
*
|
|
331
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
332
|
-
* you may not use this file except in compliance with the License.
|
|
333
|
-
* You may obtain a copy of the License at
|
|
334
|
-
*
|
|
335
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
336
|
-
*
|
|
337
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
338
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
339
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
340
|
-
* See the License for the specific language governing permissions and
|
|
341
|
-
* limitations under the License.
|
|
342
|
-
*/class vT{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 hs("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 wr.create("app-deleted",{appName:this._name})}}/**
|
|
343
|
-
* @license
|
|
344
|
-
* Copyright 2019 Google LLC
|
|
345
|
-
*
|
|
346
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
347
|
-
* you may not use this file except in compliance with the License.
|
|
348
|
-
* You may obtain a copy of the License at
|
|
349
|
-
*
|
|
350
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
351
|
-
*
|
|
352
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
353
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
354
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
355
|
-
* See the License for the specific language governing permissions and
|
|
356
|
-
* limitations under the License.
|
|
357
|
-
*/const so=hT;function af(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r={name:ga,automaticDataCollectionEnabled:!0,...t},s=r.name;if(typeof s!="string"||!s)throw wr.create("bad-app-name",{appName:String(s)});if(n||(n=ef()),!n)throw wr.create("no-options");const o=Js.get(s);if(o){if(fs(n,o.options)&&fs(r,o.config))return o;throw wr.create("duplicate-app",{appName:s})}const i=new Tk(s);for(const l of va.values())i.addComponent(l);const a=new vT(n,r,i);return Js.set(s,a),a}function lf(e=ga){const t=Js.get(e);if(!t&&e===ga&&ef())return af();if(!t)throw wr.create("no-app",{appName:e});return t}function yT(){return Array.from(Js.values())}function os(e,t,n){let r=pT[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 "/")`),Zn.warn(i.join(" "));return}Ys(new hs(`${r}-version`,()=>({library:r,version:t}),"VERSION"))}/**
|
|
358
|
-
* @license
|
|
359
|
-
* Copyright 2021 Google LLC
|
|
360
|
-
*
|
|
361
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
362
|
-
* you may not use this file except in compliance with the License.
|
|
363
|
-
* You may obtain a copy of the License at
|
|
364
|
-
*
|
|
365
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
366
|
-
*
|
|
367
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
368
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
369
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
370
|
-
* See the License for the specific language governing permissions and
|
|
371
|
-
* limitations under the License.
|
|
372
|
-
*/const wT="firebase-heartbeat-database",bT=1,Qs="firebase-heartbeat-store";let Li=null;function cf(){return Li||(Li=Dk(wT,bT,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(Qs)}catch(n){console.warn(n)}}}}).catch(e=>{throw wr.create("idb-open",{originalErrorMessage:e.message})})),Li}async function _T(e){try{const n=(await cf()).transaction(Qs),r=await n.objectStore(Qs).get(uf(e));return await n.done,r}catch(t){if(t instanceof kr)Zn.warn(t.message);else{const n=wr.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});Zn.warn(n.message)}}}async function Fc(e,t){try{const r=(await cf()).transaction(Qs,"readwrite");await r.objectStore(Qs).put(t,uf(e)),await r.done}catch(n){if(n instanceof kr)Zn.warn(n.message);else{const r=wr.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});Zn.warn(r.message)}}}function uf(e){return`${e.name}!${e.options.appId}`}/**
|
|
373
|
-
* @license
|
|
374
|
-
* Copyright 2021 Google LLC
|
|
375
|
-
*
|
|
376
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
377
|
-
* you may not use this file except in compliance with the License.
|
|
378
|
-
* You may obtain a copy of the License at
|
|
379
|
-
*
|
|
380
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
381
|
-
*
|
|
382
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
383
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
384
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
385
|
-
* See the License for the specific language governing permissions and
|
|
386
|
-
* limitations under the License.
|
|
387
|
-
*/const kT=1024,TT=30;class IT{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new ET(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var t,n;try{const s=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=Uc();if(((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)==null?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some(i=>i.date===o))return;if(this._heartbeatsCache.heartbeats.push({date:o,agent:s}),this._heartbeatsCache.heartbeats.length>TT){const i=CT(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(i,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){Zn.warn(r)}}async getHeartbeatsHeader(){var t;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=Uc(),{heartbeatsToSend:r,unsentEntries:s}=ST(this._heartbeatsCache.heartbeats),o=Xd(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,s.length>0?(this._heartbeatsCache.heartbeats=s,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),o}catch(n){return Zn.warn(n),""}}}function Uc(){return new Date().toISOString().substring(0,10)}function ST(e,t=kT){const n=[];let r=e.slice();for(const s of e){const o=n.find(i=>i.agent===s.agent);if(o){if(o.dates.push(s.date),Hc(n)>t){o.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),Hc(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class ET{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return dk()?fk().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await _T(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(t){if(await this._canUseIndexedDBPromise){const r=await this.read();return Fc(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return}async add(t){if(await this._canUseIndexedDBPromise){const r=await this.read();return Fc(this.app,{lastSentHeartbeatDate:t.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...t.heartbeats]})}else return}}function Hc(e){return Xd(JSON.stringify({version:2,heartbeats:e})).length}function CT(e){if(e.length===0)return-1;let t=0,n=e[0].date;for(let r=1;r<e.length;r++)e[r].date<n&&(n=e[r].date,t=r);return t}/**
|
|
388
|
-
* @license
|
|
389
|
-
* Copyright 2019 Google LLC
|
|
390
|
-
*
|
|
391
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
392
|
-
* you may not use this file except in compliance with the License.
|
|
393
|
-
* You may obtain a copy of the License at
|
|
394
|
-
*
|
|
395
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
396
|
-
*
|
|
397
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
398
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
399
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
400
|
-
* See the License for the specific language governing permissions and
|
|
401
|
-
* limitations under the License.
|
|
402
|
-
*/function AT(e){Ys(new hs("platform-logger",t=>new Bk(t),"PRIVATE")),Ys(new hs("heartbeat",t=>new IT(t),"PRIVATE")),os(ma,jc,e),os(ma,jc,"esm2020"),os("fire-js","")}AT("");var RT="firebase",PT="12.10.0";/**
|
|
403
|
-
* @license
|
|
404
|
-
* Copyright 2020 Google LLC
|
|
405
|
-
*
|
|
406
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
407
|
-
* you may not use this file except in compliance with the License.
|
|
408
|
-
* You may obtain a copy of the License at
|
|
409
|
-
*
|
|
410
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
411
|
-
*
|
|
412
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
413
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
414
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
415
|
-
* See the License for the specific language governing permissions and
|
|
416
|
-
* limitations under the License.
|
|
417
|
-
*/os(RT,PT,"app");function df(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const xT=df,ff=new no("auth","Firebase",df());/**
|
|
418
|
-
* @license
|
|
419
|
-
* Copyright 2020 Google LLC
|
|
420
|
-
*
|
|
421
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
422
|
-
* you may not use this file except in compliance with the License.
|
|
423
|
-
* You may obtain a copy of the License at
|
|
424
|
-
*
|
|
425
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
426
|
-
*
|
|
427
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
428
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
429
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
430
|
-
* See the License for the specific language governing permissions and
|
|
431
|
-
* limitations under the License.
|
|
432
|
-
*/const Lo=new nf("@firebase/auth");function MT(e,...t){Lo.logLevel<=wt.WARN&&Lo.warn(`Auth (${so}): ${e}`,...t)}function Io(e,...t){Lo.logLevel<=wt.ERROR&&Lo.error(`Auth (${so}): ${e}`,...t)}/**
|
|
433
|
-
* @license
|
|
434
|
-
* Copyright 2020 Google LLC
|
|
435
|
-
*
|
|
436
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
437
|
-
* you may not use this file except in compliance with the License.
|
|
438
|
-
* You may obtain a copy of the License at
|
|
439
|
-
*
|
|
440
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
441
|
-
*
|
|
442
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
443
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
444
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
445
|
-
* See the License for the specific language governing permissions and
|
|
446
|
-
* limitations under the License.
|
|
447
|
-
*/function On(e,...t){throw Za(e,...t)}function mn(e,...t){return Za(e,...t)}function Xa(e,t,n){const r={...xT(),[t]:n};return new no("auth","Firebase",r).create(t,{appName:e.name})}function Vr(e){return Xa(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function OT(e,t,n){const r=n;if(!(t instanceof r))throw r.name!==t.constructor.name&&On(e,"argument-error"),Xa(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function Za(e,...t){if(typeof e!="string"){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return ff.create(e,...t)}function Be(e,t,...n){if(!e)throw Za(t,...n)}function qn(e){const t="INTERNAL ASSERTION FAILED: "+e;throw Io(t),new Error(t)}function er(e,t){e||qn(t)}/**
|
|
448
|
-
* @license
|
|
449
|
-
* Copyright 2020 Google LLC
|
|
450
|
-
*
|
|
451
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
452
|
-
* you may not use this file except in compliance with the License.
|
|
453
|
-
* You may obtain a copy of the License at
|
|
454
|
-
*
|
|
455
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
456
|
-
*
|
|
457
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
458
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
459
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
460
|
-
* See the License for the specific language governing permissions and
|
|
461
|
-
* limitations under the License.
|
|
462
|
-
*/function ya(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.href)||""}function NT(){return Vc()==="http:"||Vc()==="https:"}function Vc(){var e;return typeof self<"u"&&((e=self.location)==null?void 0:e.protocol)||null}/**
|
|
463
|
-
* @license
|
|
464
|
-
* Copyright 2020 Google LLC
|
|
465
|
-
*
|
|
466
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
467
|
-
* you may not use this file except in compliance with the License.
|
|
468
|
-
* You may obtain a copy of the License at
|
|
469
|
-
*
|
|
470
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
471
|
-
*
|
|
472
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
473
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
474
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
475
|
-
* See the License for the specific language governing permissions and
|
|
476
|
-
* limitations under the License.
|
|
477
|
-
*/function $T(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(NT()||lk()||"connection"in navigator)?navigator.onLine:!0}function DT(){if(typeof navigator>"u")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}/**
|
|
478
|
-
* @license
|
|
479
|
-
* Copyright 2020 Google LLC
|
|
480
|
-
*
|
|
481
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
482
|
-
* you may not use this file except in compliance with the License.
|
|
483
|
-
* You may obtain a copy of the License at
|
|
484
|
-
*
|
|
485
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
486
|
-
*
|
|
487
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
488
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
489
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
490
|
-
* See the License for the specific language governing permissions and
|
|
491
|
-
* limitations under the License.
|
|
492
|
-
*/class oo{constructor(t,n){this.shortDelay=t,this.longDelay=n,er(n>t,"Short delay should be less than long delay!"),this.isMobile=ik()||ck()}get(){return $T()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
|
|
493
|
-
* @license
|
|
494
|
-
* Copyright 2020 Google LLC
|
|
495
|
-
*
|
|
496
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
497
|
-
* you may not use this file except in compliance with the License.
|
|
498
|
-
* You may obtain a copy of the License at
|
|
499
|
-
*
|
|
500
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
501
|
-
*
|
|
502
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
503
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
504
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
505
|
-
* See the License for the specific language governing permissions and
|
|
506
|
-
* limitations under the License.
|
|
507
|
-
*/function el(e,t){er(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}/**
|
|
508
|
-
* @license
|
|
509
|
-
* Copyright 2020 Google LLC
|
|
510
|
-
*
|
|
511
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
512
|
-
* you may not use this file except in compliance with the License.
|
|
513
|
-
* You may obtain a copy of the License at
|
|
514
|
-
*
|
|
515
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
516
|
-
*
|
|
517
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
518
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
519
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
520
|
-
* See the License for the specific language governing permissions and
|
|
521
|
-
* limitations under the License.
|
|
522
|
-
*/class hf{static initialize(t,n,r){this.fetchImpl=t,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;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")}}/**
|
|
523
|
-
* @license
|
|
524
|
-
* Copyright 2020 Google LLC
|
|
525
|
-
*
|
|
526
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
527
|
-
* you may not use this file except in compliance with the License.
|
|
528
|
-
* You may obtain a copy of the License at
|
|
529
|
-
*
|
|
530
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
531
|
-
*
|
|
532
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
533
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
534
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
535
|
-
* See the License for the specific language governing permissions and
|
|
536
|
-
* limitations under the License.
|
|
537
|
-
*/const LT={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
|
|
538
|
-
* @license
|
|
539
|
-
* Copyright 2020 Google LLC
|
|
540
|
-
*
|
|
541
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
542
|
-
* you may not use this file except in compliance with the License.
|
|
543
|
-
* You may obtain a copy of the License at
|
|
544
|
-
*
|
|
545
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
546
|
-
*
|
|
547
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
548
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
549
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
550
|
-
* See the License for the specific language governing permissions and
|
|
551
|
-
* limitations under the License.
|
|
552
|
-
*/const jT=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],BT=new oo(3e4,6e4);function tl(e,t){return e.tenantId&&!t.tenantId?{...t,tenantId:e.tenantId}:t}async function vs(e,t,n,r,s={}){return pf(e,s,async()=>{let o={},i={};r&&(t==="GET"?i=r:o={body:JSON.stringify(r)});const a=ro({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 ak()||(u.referrerPolicy="no-referrer"),e.emulatorConfig&&ii(e.emulatorConfig.host)&&(u.credentials="include"),hf.fetch()(await mf(e,e.config.apiHost,n,a),u)})}async function pf(e,t,n){e._canInitEmulator=!1;const r={...LT,...t};try{const s=new UT(e),o=await Promise.race([n(),s.promise]);s.clearNetworkTimeout();const i=await o.json();if("needConfirmation"in i)throw ho(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 ho(e,"credential-already-in-use",i);if(l==="EMAIL_EXISTS")throw ho(e,"email-already-in-use",i);if(l==="USER_DISABLED")throw ho(e,"user-disabled",i);const c=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw Xa(e,c,u);On(e,c)}}catch(s){if(s instanceof kr)throw s;On(e,"network-request-failed",{message:String(s)})}}async function FT(e,t,n,r,s={}){const o=await vs(e,t,n,r,s);return"mfaPendingCredential"in o&&On(e,"multi-factor-auth-required",{_serverResponse:o}),o}async function mf(e,t,n,r){const s=`${t}${n}?${r}`,o=e,i=o.config.emulator?el(e.config,s):`${e.config.apiScheme}://${s}`;return jT.includes(n)&&(await o._persistenceManagerAvailable,o._getPersistenceType()==="COOKIE")?o._getPersistence()._getFinalTarget(i).toString():i}class UT{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(mn(this.auth,"network-request-failed")),BT.get())})}}function ho(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=mn(e,t,r);return s.customData._tokenResponse=n,s}/**
|
|
553
|
-
* @license
|
|
554
|
-
* Copyright 2020 Google LLC
|
|
555
|
-
*
|
|
556
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
557
|
-
* you may not use this file except in compliance with the License.
|
|
558
|
-
* You may obtain a copy of the License at
|
|
559
|
-
*
|
|
560
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
561
|
-
*
|
|
562
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
563
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
564
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
565
|
-
* See the License for the specific language governing permissions and
|
|
566
|
-
* limitations under the License.
|
|
567
|
-
*/async function HT(e,t){return vs(e,"POST","/v1/accounts:delete",t)}async function jo(e,t){return vs(e,"POST","/v1/accounts:lookup",t)}/**
|
|
568
|
-
* @license
|
|
569
|
-
* Copyright 2020 Google LLC
|
|
570
|
-
*
|
|
571
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
572
|
-
* you may not use this file except in compliance with the License.
|
|
573
|
-
* You may obtain a copy of the License at
|
|
574
|
-
*
|
|
575
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
576
|
-
*
|
|
577
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
578
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
579
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
580
|
-
* See the License for the specific language governing permissions and
|
|
581
|
-
* limitations under the License.
|
|
582
|
-
*/function Bs(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch{}}async function VT(e,t=!1){const n=gs(e),r=await n.getIdToken(t),s=nl(r);Be(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:Bs(ji(s.auth_time)),issuedAtTime:Bs(ji(s.iat)),expirationTime:Bs(ji(s.exp)),signInProvider:i||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}}function ji(e){return Number(e)*1e3}function nl(e){const[t,n,r]=e.split(".");if(t===void 0||n===void 0||r===void 0)return Io("JWT malformed, contained fewer than 3 sections"),null;try{const s=Zd(n);return s?JSON.parse(s):(Io("Failed to decode base64 JWT payload"),null)}catch(s){return Io("Caught error parsing JWT payload as JSON",s==null?void 0:s.toString()),null}}function Wc(e){const t=nl(e);return Be(t,"internal-error"),Be(typeof t.exp<"u","internal-error"),Be(typeof t.iat<"u","internal-error"),Number(t.exp)-Number(t.iat)}/**
|
|
583
|
-
* @license
|
|
584
|
-
* Copyright 2020 Google LLC
|
|
585
|
-
*
|
|
586
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
587
|
-
* you may not use this file except in compliance with the License.
|
|
588
|
-
* You may obtain a copy of the License at
|
|
589
|
-
*
|
|
590
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
591
|
-
*
|
|
592
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
593
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
594
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
595
|
-
* See the License for the specific language governing permissions and
|
|
596
|
-
* limitations under the License.
|
|
597
|
-
*/async function Xs(e,t,n=!1){if(n)return t;try{return await t}catch(r){throw r instanceof kr&&WT(r)&&e.auth.currentUser===e&&await e.auth.signOut(),r}}function WT({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
|
|
598
|
-
* @license
|
|
599
|
-
* Copyright 2020 Google LLC
|
|
600
|
-
*
|
|
601
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
602
|
-
* you may not use this file except in compliance with the License.
|
|
603
|
-
* You may obtain a copy of the License at
|
|
604
|
-
*
|
|
605
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
606
|
-
*
|
|
607
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
608
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
609
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
610
|
-
* See the License for the specific language governing permissions and
|
|
611
|
-
* limitations under the License.
|
|
612
|
-
*/class qT{constructor(t){this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(t){if(t){const n=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),n}else{this.errorBackoff=3e4;const r=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,r)}}schedule(t=!1){if(!this.isRunning)return;const n=this.getInterval(t);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(t){(t==null?void 0:t.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
|
|
613
|
-
* @license
|
|
614
|
-
* Copyright 2020 Google LLC
|
|
615
|
-
*
|
|
616
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
617
|
-
* you may not use this file except in compliance with the License.
|
|
618
|
-
* You may obtain a copy of the License at
|
|
619
|
-
*
|
|
620
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
621
|
-
*
|
|
622
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
623
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
624
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
625
|
-
* See the License for the specific language governing permissions and
|
|
626
|
-
* limitations under the License.
|
|
627
|
-
*/class wa{constructor(t,n){this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Bs(this.lastLoginAt),this.creationTime=Bs(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
|
|
628
|
-
* @license
|
|
629
|
-
* Copyright 2019 Google LLC
|
|
630
|
-
*
|
|
631
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
632
|
-
* you may not use this file except in compliance with the License.
|
|
633
|
-
* You may obtain a copy of the License at
|
|
634
|
-
*
|
|
635
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
636
|
-
*
|
|
637
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
638
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
639
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
640
|
-
* See the License for the specific language governing permissions and
|
|
641
|
-
* limitations under the License.
|
|
642
|
-
*/async function Bo(e){var f;const t=e.auth,n=await e.getIdToken(),r=await Xs(e,jo(t,{idToken:n}));Be(r==null?void 0:r.users.length,t,"internal-error");const s=r.users[0];e._notifyReloadListener(s);const o=(f=s.providerUserInfo)!=null&&f.length?gf(s.providerUserInfo):[],i=GT(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 wa(s.createdAt,s.lastLoginAt),isAnonymous:u};Object.assign(e,c)}async function zT(e){const t=gs(e);await Bo(t),await t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)}function GT(e,t){return[...e.filter(r=>!t.some(s=>s.providerId===r.providerId)),...t]}function gf(e){return e.map(({providerId:t,...n})=>({providerId:t,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}))}/**
|
|
643
|
-
* @license
|
|
644
|
-
* Copyright 2020 Google LLC
|
|
645
|
-
*
|
|
646
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
647
|
-
* you may not use this file except in compliance with the License.
|
|
648
|
-
* You may obtain a copy of the License at
|
|
649
|
-
*
|
|
650
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
651
|
-
*
|
|
652
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
653
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
654
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
655
|
-
* See the License for the specific language governing permissions and
|
|
656
|
-
* limitations under the License.
|
|
657
|
-
*/async function KT(e,t){const n=await pf(e,{},async()=>{const r=ro({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:s,apiKey:o}=e.config,i=await mf(e,s,"/v1/token",`key=${o}`),a=await e._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const l={method:"POST",headers:a,body:r};return e.emulatorConfig&&ii(e.emulatorConfig.host)&&(l.credentials="include"),hf.fetch()(i,l)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function JT(e,t){return vs(e,"POST","/v2/accounts:revokeToken",tl(e,t))}/**
|
|
658
|
-
* @license
|
|
659
|
-
* Copyright 2020 Google LLC
|
|
660
|
-
*
|
|
661
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
662
|
-
* you may not use this file except in compliance with the License.
|
|
663
|
-
* You may obtain a copy of the License at
|
|
664
|
-
*
|
|
665
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
666
|
-
*
|
|
667
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
668
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
669
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
670
|
-
* See the License for the specific language governing permissions and
|
|
671
|
-
* limitations under the License.
|
|
672
|
-
*/class is{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){Be(t.idToken,"internal-error"),Be(typeof t.idToken<"u","internal-error"),Be(typeof t.refreshToken<"u","internal-error");const n="expiresIn"in t&&typeof t.expiresIn<"u"?Number(t.expiresIn):Wc(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,n)}updateFromIdToken(t){Be(t.length!==0,"internal-error");const n=Wc(t);this.updateTokensAndExpiration(t,null,n)}async getToken(t,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(Be(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 KT(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 is;return r&&(Be(typeof r=="string","internal-error",{appName:t}),i.refreshToken=r),s&&(Be(typeof s=="string","internal-error",{appName:t}),i.accessToken=s),o&&(Be(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 is,this.toJSON())}_performRefresh(){return qn("not implemented")}}/**
|
|
673
|
-
* @license
|
|
674
|
-
* Copyright 2020 Google LLC
|
|
675
|
-
*
|
|
676
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
677
|
-
* you may not use this file except in compliance with the License.
|
|
678
|
-
* You may obtain a copy of the License at
|
|
679
|
-
*
|
|
680
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
681
|
-
*
|
|
682
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
683
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
684
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
685
|
-
* See the License for the specific language governing permissions and
|
|
686
|
-
* limitations under the License.
|
|
687
|
-
*/function lr(e,t){Be(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class fn{constructor({uid:t,auth:n,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new qT(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 wa(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const n=await Xs(this,this.stsTokenManager.getToken(this.auth,t));return Be(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(t){return VT(this,t)}reload(){return zT(this)}_assign(t){this!==t&&(Be(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 fn({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(t){Be(!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 Bo(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(An(this.auth.app))return Promise.reject(Vr(this.auth));const t=await this.getIdToken();return await Xs(this,HT(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:b,providerData:$,stsTokenManager:P}=n;Be(f&&P,t,"internal-error");const H=is.fromJSON(this.name,P);Be(typeof f=="string",t,"internal-error"),lr(r,t.name),lr(s,t.name),Be(typeof h=="boolean",t,"internal-error"),Be(typeof b=="boolean",t,"internal-error"),lr(o,t.name),lr(i,t.name),lr(a,t.name),lr(l,t.name),lr(u,t.name),lr(c,t.name);const Y=new fn({uid:f,auth:t,email:s,emailVerified:h,displayName:r,isAnonymous:b,photoURL:i,phoneNumber:o,tenantId:a,stsTokenManager:H,createdAt:u,lastLoginAt:c});return $&&Array.isArray($)&&(Y.providerData=$.map(D=>({...D}))),l&&(Y._redirectEventId=l),Y}static async _fromIdTokenResponse(t,n,r=!1){const s=new is;s.updateFromServerResponse(n);const o=new fn({uid:n.localId,auth:t,stsTokenManager:s,isAnonymous:r});return await Bo(o),o}static async _fromGetAccountInfoResponse(t,n,r){const s=n.users[0];Be(s.localId!==void 0,"internal-error");const o=s.providerUserInfo!==void 0?gf(s.providerUserInfo):[],i=!(s.email&&s.passwordHash)&&!(o!=null&&o.length),a=new is;a.updateFromIdToken(r);const l=new fn({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 wa(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(o!=null&&o.length)};return Object.assign(l,u),l}}/**
|
|
688
|
-
* @license
|
|
689
|
-
* Copyright 2020 Google LLC
|
|
690
|
-
*
|
|
691
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
692
|
-
* you may not use this file except in compliance with the License.
|
|
693
|
-
* You may obtain a copy of the License at
|
|
694
|
-
*
|
|
695
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
696
|
-
*
|
|
697
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
698
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
699
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
700
|
-
* See the License for the specific language governing permissions and
|
|
701
|
-
* limitations under the License.
|
|
702
|
-
*/const qc=new Map;function zn(e){er(e instanceof Function,"Expected a class definition");let t=qc.get(e);return t?(er(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,qc.set(e,t),t)}/**
|
|
703
|
-
* @license
|
|
704
|
-
* Copyright 2019 Google LLC
|
|
705
|
-
*
|
|
706
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
707
|
-
* you may not use this file except in compliance with the License.
|
|
708
|
-
* You may obtain a copy of the License at
|
|
709
|
-
*
|
|
710
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
711
|
-
*
|
|
712
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
713
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
714
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
715
|
-
* See the License for the specific language governing permissions and
|
|
716
|
-
* limitations under the License.
|
|
717
|
-
*/class vf{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(t,n){this.storage[t]=n}async _get(t){const n=this.storage[t];return n===void 0?null:n}async _remove(t){delete this.storage[t]}_addListener(t,n){}_removeListener(t,n){}}vf.type="NONE";const zc=vf;/**
|
|
718
|
-
* @license
|
|
719
|
-
* Copyright 2019 Google LLC
|
|
720
|
-
*
|
|
721
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
722
|
-
* you may not use this file except in compliance with the License.
|
|
723
|
-
* You may obtain a copy of the License at
|
|
724
|
-
*
|
|
725
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
726
|
-
*
|
|
727
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
728
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
729
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
730
|
-
* See the License for the specific language governing permissions and
|
|
731
|
-
* limitations under the License.
|
|
732
|
-
*/function So(e,t,n){return`firebase:${e}:${t}:${n}`}class as{constructor(t,n,r){this.persistence=t,this.auth=n,this.userKey=r;const{config:s,name:o}=this.auth;this.fullUserKey=So(this.userKey,s.apiKey,o),this.fullPersistenceKey=So("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 jo(this.auth,{idToken:t}).catch(()=>{});return n?fn._fromGetAccountInfoResponse(this.auth,n,t):null}return fn._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 as(zn(zc),t,r);const s=(await Promise.all(n.map(async u=>{if(await u._isAvailable())return u}))).filter(u=>u);let o=s[0]||zn(zc);const i=So(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 jo(t,{idToken:c}).catch(()=>{});if(!h)break;f=await fn._fromGetAccountInfoResponse(t,h,c)}else f=fn._fromJSON(t,c);u!==o&&(a=f),o=u;break}}catch{}const l=s.filter(u=>u._shouldAllowMigration);return!o._shouldAllowMigration||!l.length?new as(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 as(o,t,r))}}/**
|
|
733
|
-
* @license
|
|
734
|
-
* Copyright 2020 Google LLC
|
|
735
|
-
*
|
|
736
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
737
|
-
* you may not use this file except in compliance with the License.
|
|
738
|
-
* You may obtain a copy of the License at
|
|
739
|
-
*
|
|
740
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
741
|
-
*
|
|
742
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
743
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
744
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
745
|
-
* See the License for the specific language governing permissions and
|
|
746
|
-
* limitations under the License.
|
|
747
|
-
*/function Gc(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(_f(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(yf(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(Tf(t))return"Blackberry";if(If(t))return"Webos";if(wf(t))return"Safari";if((t.includes("chrome/")||bf(t))&&!t.includes("edge/"))return"Chrome";if(kf(t))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=e.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function yf(e=Zt()){return/firefox\//i.test(e)}function wf(e=Zt()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function bf(e=Zt()){return/crios\//i.test(e)}function _f(e=Zt()){return/iemobile/i.test(e)}function kf(e=Zt()){return/android/i.test(e)}function Tf(e=Zt()){return/blackberry/i.test(e)}function If(e=Zt()){return/webos/i.test(e)}function rl(e=Zt()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function YT(e=Zt()){var t;return rl(e)&&!!((t=window.navigator)!=null&&t.standalone)}function QT(){return uk()&&document.documentMode===10}function Sf(e=Zt()){return rl(e)||kf(e)||If(e)||Tf(e)||/windows phone/i.test(e)||_f(e)}/**
|
|
748
|
-
* @license
|
|
749
|
-
* Copyright 2020 Google LLC
|
|
750
|
-
*
|
|
751
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
752
|
-
* you may not use this file except in compliance with the License.
|
|
753
|
-
* You may obtain a copy of the License at
|
|
754
|
-
*
|
|
755
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
756
|
-
*
|
|
757
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
758
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
759
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
760
|
-
* See the License for the specific language governing permissions and
|
|
761
|
-
* limitations under the License.
|
|
762
|
-
*/function Ef(e,t=[]){let n;switch(e){case"Browser":n=Gc(Zt());break;case"Worker":n=`${Gc(Zt())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${so}/${r}`}/**
|
|
763
|
-
* @license
|
|
764
|
-
* Copyright 2022 Google LLC
|
|
765
|
-
*
|
|
766
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
767
|
-
* you may not use this file except in compliance with the License.
|
|
768
|
-
* You may obtain a copy of the License at
|
|
769
|
-
*
|
|
770
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
771
|
-
*
|
|
772
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
773
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
774
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
775
|
-
* See the License for the specific language governing permissions and
|
|
776
|
-
* limitations under the License.
|
|
777
|
-
*/class XT{constructor(t){this.auth=t,this.queue=[]}pushCallback(t,n){const r=o=>new Promise((i,a)=>{try{const l=t(o);i(l)}catch(l){a(l)}});r.onAbort=n,this.queue.push(r);const s=this.queue.length-1;return()=>{this.queue[s]=()=>Promise.resolve()}}async runMiddleware(t){if(this.auth.currentUser===t)return;const n=[];try{for(const r of this.queue)await r(t),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const s of n)try{s()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/**
|
|
778
|
-
* @license
|
|
779
|
-
* Copyright 2023 Google LLC
|
|
780
|
-
*
|
|
781
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
782
|
-
* you may not use this file except in compliance with the License.
|
|
783
|
-
* You may obtain a copy of the License at
|
|
784
|
-
*
|
|
785
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
786
|
-
*
|
|
787
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
788
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
789
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
790
|
-
* See the License for the specific language governing permissions and
|
|
791
|
-
* limitations under the License.
|
|
792
|
-
*/async function ZT(e,t={}){return vs(e,"GET","/v2/passwordPolicy",tl(e,t))}/**
|
|
793
|
-
* @license
|
|
794
|
-
* Copyright 2023 Google LLC
|
|
795
|
-
*
|
|
796
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
797
|
-
* you may not use this file except in compliance with the License.
|
|
798
|
-
* You may obtain a copy of the License at
|
|
799
|
-
*
|
|
800
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
801
|
-
*
|
|
802
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
803
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
804
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
805
|
-
* See the License for the specific language governing permissions and
|
|
806
|
-
* limitations under the License.
|
|
807
|
-
*/const e1=6;class t1{constructor(t){var r;const n=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??e1,n.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=n.maxPasswordLength),n.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=n.containsLowercaseCharacter),n.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=n.containsUppercaseCharacter),n.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=n.containsNumericCharacter),n.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=n.containsNonAlphanumericCharacter),this.enforcementState=t.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=((r=t.allowedNonAlphanumericCharacters)==null?void 0:r.join(""))??"",this.forceUpgradeOnSignin=t.forceUpgradeOnSignin??!1,this.schemaVersion=t.schemaVersion}validatePassword(t){const n={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(t,n),this.validatePasswordCharacterOptions(t,n),n.isValid&&(n.isValid=n.meetsMinPasswordLength??!0),n.isValid&&(n.isValid=n.meetsMaxPasswordLength??!0),n.isValid&&(n.isValid=n.containsLowercaseLetter??!0),n.isValid&&(n.isValid=n.containsUppercaseLetter??!0),n.isValid&&(n.isValid=n.containsNumericCharacter??!0),n.isValid&&(n.isValid=n.containsNonAlphanumericCharacter??!0),n}validatePasswordLengthOptions(t,n){const r=this.customStrengthOptions.minPasswordLength,s=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=t.length>=r),s&&(n.meetsMaxPasswordLength=t.length<=s)}validatePasswordCharacterOptions(t,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let s=0;s<t.length;s++)r=t.charAt(s),this.updatePasswordCharacterOptionsStatuses(n,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(t,n,r,s,o){this.customStrengthOptions.containsLowercaseLetter&&(t.containsLowercaseLetter||(t.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(t.containsUppercaseLetter||(t.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(t.containsNumericCharacter||(t.containsNumericCharacter=s)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(t.containsNonAlphanumericCharacter||(t.containsNonAlphanumericCharacter=o))}}/**
|
|
808
|
-
* @license
|
|
809
|
-
* Copyright 2020 Google LLC
|
|
810
|
-
*
|
|
811
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
812
|
-
* you may not use this file except in compliance with the License.
|
|
813
|
-
* You may obtain a copy of the License at
|
|
814
|
-
*
|
|
815
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
816
|
-
*
|
|
817
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
818
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
819
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
820
|
-
* See the License for the specific language governing permissions and
|
|
821
|
-
* limitations under the License.
|
|
822
|
-
*/class n1{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 Kc(this),this.idTokenSubscription=new Kc(this),this.beforeStateQueue=new XT(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=ff,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=s.sdkClientVersion,this._persistenceManagerAvailable=new Promise(o=>this._resolvePersistenceManagerAvailable=o)}_initializeWithPersistence(t,n){return n&&(this._popupRedirectResolver=zn(n)),this._initializationPromise=this.queue(async()=>{var r,s,o;if(!this._deleted&&(this.persistenceManager=await as.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 jo(this,{idToken:t}),r=await fn._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(An(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 Be(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 Bo(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=DT()}async _delete(){this._deleted=!0}async updateCurrentUser(t){if(An(this.app))return Promise.reject(Vr(this));const n=t?gs(t):null;return n&&Be(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&&Be(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 An(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 An(this.app)?Promise.reject(Vr(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(zn(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 ZT(this),n=new t1(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 no("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 JT(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&&zn(t)||this._popupRedirectResolver;Be(n,this,"argument-error"),this.redirectPersistenceManager=await as.create(this,[zn(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(Be(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 Be(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=Ef(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var s;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const n=await((s=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:s.getHeartbeatsHeader());n&&(t["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var n;if(An(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&&MT(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function ai(e){return gs(e)}class Kc{constructor(t){this.auth=t,this.observer=null,this.addObserver=vk(n=>this.observer=n)}get next(){return Be(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
|
|
823
|
-
* @license
|
|
824
|
-
* Copyright 2020 Google LLC
|
|
825
|
-
*
|
|
826
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
827
|
-
* you may not use this file except in compliance with the License.
|
|
828
|
-
* You may obtain a copy of the License at
|
|
829
|
-
*
|
|
830
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
831
|
-
*
|
|
832
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
833
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
834
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
835
|
-
* See the License for the specific language governing permissions and
|
|
836
|
-
* limitations under the License.
|
|
837
|
-
*/let sl={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function r1(e){sl=e}function s1(e){return sl.loadJS(e)}function o1(){return sl.gapiScript}function i1(e){return`__${e}${Math.floor(Math.random()*1e6)}`}/**
|
|
838
|
-
* @license
|
|
839
|
-
* Copyright 2020 Google LLC
|
|
840
|
-
*
|
|
841
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
842
|
-
* you may not use this file except in compliance with the License.
|
|
843
|
-
* You may obtain a copy of the License at
|
|
844
|
-
*
|
|
845
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
846
|
-
*
|
|
847
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
848
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
849
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
850
|
-
* See the License for the specific language governing permissions and
|
|
851
|
-
* limitations under the License.
|
|
852
|
-
*/function a1(e,t){const n=of(e,"auth");if(n.isInitialized()){const s=n.getImmediate(),o=n.getOptions();if(fs(o,t??{}))return s;On(s,"already-initialized")}return n.initialize({options:t})}function l1(e,t){const n=(t==null?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(zn);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t==null?void 0:t.popupRedirectResolver)}function c1(e,t,n){const r=ai(e);Be(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const s=!1,o=Cf(t),{host:i,port:a}=u1(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){Be(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),Be(fs(u,r.config.emulator)&&fs(c,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=u,r.emulatorConfig=c,r.settings.appVerificationDisabledForTesting=!0,ii(i)?(nk(`${o}//${i}${l}`),ok("Auth",!0)):d1()}function Cf(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function u1(e){const t=Cf(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",s=/^(\[[^\]]+\])(:|$)/.exec(r);if(s){const o=s[1];return{host:o,port:Jc(r.substr(o.length+1))}}else{const[o,i]=r.split(":");return{host:o,port:Jc(i)}}}function Jc(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function d1(){function e(){const t=document.createElement("p"),n=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",e):e())}/**
|
|
853
|
-
* @license
|
|
854
|
-
* Copyright 2020 Google LLC
|
|
855
|
-
*
|
|
856
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
857
|
-
* you may not use this file except in compliance with the License.
|
|
858
|
-
* You may obtain a copy of the License at
|
|
859
|
-
*
|
|
860
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
861
|
-
*
|
|
862
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
863
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
864
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
865
|
-
* See the License for the specific language governing permissions and
|
|
866
|
-
* limitations under the License.
|
|
867
|
-
*/class Af{constructor(t,n){this.providerId=t,this.signInMethod=n}toJSON(){return qn("not implemented")}_getIdTokenResponse(t){return qn("not implemented")}_linkToIdToken(t,n){return qn("not implemented")}_getReauthenticationResolver(t){return qn("not implemented")}}/**
|
|
868
|
-
* @license
|
|
869
|
-
* Copyright 2020 Google LLC
|
|
870
|
-
*
|
|
871
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
872
|
-
* you may not use this file except in compliance with the License.
|
|
873
|
-
* You may obtain a copy of the License at
|
|
874
|
-
*
|
|
875
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
876
|
-
*
|
|
877
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
878
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
879
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
880
|
-
* See the License for the specific language governing permissions and
|
|
881
|
-
* limitations under the License.
|
|
882
|
-
*/async function ls(e,t){return FT(e,"POST","/v1/accounts:signInWithIdp",tl(e,t))}/**
|
|
883
|
-
* @license
|
|
884
|
-
* Copyright 2020 Google LLC
|
|
885
|
-
*
|
|
886
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
887
|
-
* you may not use this file except in compliance with the License.
|
|
888
|
-
* You may obtain a copy of the License at
|
|
889
|
-
*
|
|
890
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
891
|
-
*
|
|
892
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
893
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
894
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
895
|
-
* See the License for the specific language governing permissions and
|
|
896
|
-
* limitations under the License.
|
|
897
|
-
*/const f1="http://localhost";class qr extends Af{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const n=new qr(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):On("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 qr(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 ls(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,ls(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,ls(t,n)}buildRequest(){const t={requestUri:f1,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=ro(n)}return t}}/**
|
|
898
|
-
* @license
|
|
899
|
-
* Copyright 2020 Google LLC
|
|
900
|
-
*
|
|
901
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
902
|
-
* you may not use this file except in compliance with the License.
|
|
903
|
-
* You may obtain a copy of the License at
|
|
904
|
-
*
|
|
905
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
906
|
-
*
|
|
907
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
908
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
909
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
910
|
-
* See the License for the specific language governing permissions and
|
|
911
|
-
* limitations under the License.
|
|
912
|
-
*/class ol{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}/**
|
|
913
|
-
* @license
|
|
914
|
-
* Copyright 2019 Google LLC
|
|
915
|
-
*
|
|
916
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
917
|
-
* you may not use this file except in compliance with the License.
|
|
918
|
-
* You may obtain a copy of the License at
|
|
919
|
-
*
|
|
920
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
921
|
-
*
|
|
922
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
923
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
924
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
925
|
-
* See the License for the specific language governing permissions and
|
|
926
|
-
* limitations under the License.
|
|
927
|
-
*/class io extends ol{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}/**
|
|
928
|
-
* @license
|
|
929
|
-
* Copyright 2020 Google LLC
|
|
930
|
-
*
|
|
931
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
932
|
-
* you may not use this file except in compliance with the License.
|
|
933
|
-
* You may obtain a copy of the License at
|
|
934
|
-
*
|
|
935
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
936
|
-
*
|
|
937
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
938
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
939
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
940
|
-
* See the License for the specific language governing permissions and
|
|
941
|
-
* limitations under the License.
|
|
942
|
-
*/class pr extends io{constructor(){super("facebook.com")}static credential(t){return qr._fromParams({providerId:pr.PROVIDER_ID,signInMethod:pr.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return pr.credentialFromTaggedObject(t)}static credentialFromError(t){return pr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return pr.credential(t.oauthAccessToken)}catch{return null}}}pr.FACEBOOK_SIGN_IN_METHOD="facebook.com";pr.PROVIDER_ID="facebook.com";/**
|
|
943
|
-
* @license
|
|
944
|
-
* Copyright 2020 Google LLC
|
|
945
|
-
*
|
|
946
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
947
|
-
* you may not use this file except in compliance with the License.
|
|
948
|
-
* You may obtain a copy of the License at
|
|
949
|
-
*
|
|
950
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
951
|
-
*
|
|
952
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
953
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
954
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
955
|
-
* See the License for the specific language governing permissions and
|
|
956
|
-
* limitations under the License.
|
|
957
|
-
*/class mr extends io{constructor(){super("google.com"),this.addScope("profile")}static credential(t,n){return qr._fromParams({providerId:mr.PROVIDER_ID,signInMethod:mr.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:n})}static credentialFromResult(t){return mr.credentialFromTaggedObject(t)}static credentialFromError(t){return mr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return mr.credential(n,r)}catch{return null}}}mr.GOOGLE_SIGN_IN_METHOD="google.com";mr.PROVIDER_ID="google.com";/**
|
|
958
|
-
* @license
|
|
959
|
-
* Copyright 2020 Google LLC
|
|
960
|
-
*
|
|
961
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
962
|
-
* you may not use this file except in compliance with the License.
|
|
963
|
-
* You may obtain a copy of the License at
|
|
964
|
-
*
|
|
965
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
966
|
-
*
|
|
967
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
968
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
969
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
970
|
-
* See the License for the specific language governing permissions and
|
|
971
|
-
* limitations under the License.
|
|
972
|
-
*/class Rn extends io{constructor(){super("github.com")}static credential(t){return qr._fromParams({providerId:Rn.PROVIDER_ID,signInMethod:Rn.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return Rn.credentialFromTaggedObject(t)}static credentialFromError(t){return Rn.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return Rn.credential(t.oauthAccessToken)}catch{return null}}}Rn.GITHUB_SIGN_IN_METHOD="github.com";Rn.PROVIDER_ID="github.com";/**
|
|
973
|
-
* @license
|
|
974
|
-
* Copyright 2020 Google LLC
|
|
975
|
-
*
|
|
976
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
977
|
-
* you may not use this file except in compliance with the License.
|
|
978
|
-
* You may obtain a copy of the License at
|
|
979
|
-
*
|
|
980
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
981
|
-
*
|
|
982
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
983
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
984
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
985
|
-
* See the License for the specific language governing permissions and
|
|
986
|
-
* limitations under the License.
|
|
987
|
-
*/class gr extends io{constructor(){super("twitter.com")}static credential(t,n){return qr._fromParams({providerId:gr.PROVIDER_ID,signInMethod:gr.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:n})}static credentialFromResult(t){return gr.credentialFromTaggedObject(t)}static credentialFromError(t){return gr.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return gr.credential(n,r)}catch{return null}}}gr.TWITTER_SIGN_IN_METHOD="twitter.com";gr.PROVIDER_ID="twitter.com";/**
|
|
988
|
-
* @license
|
|
989
|
-
* Copyright 2020 Google LLC
|
|
990
|
-
*
|
|
991
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
992
|
-
* you may not use this file except in compliance with the License.
|
|
993
|
-
* You may obtain a copy of the License at
|
|
994
|
-
*
|
|
995
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
996
|
-
*
|
|
997
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
998
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
999
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1000
|
-
* See the License for the specific language governing permissions and
|
|
1001
|
-
* limitations under the License.
|
|
1002
|
-
*/class ps{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 fn._fromIdTokenResponse(t,r,s),i=Yc(r);return new ps({user:o,providerId:i,_tokenResponse:r,operationType:n})}static async _forOperation(t,n,r){await t._updateTokensIfNecessary(r,!0);const s=Yc(r);return new ps({user:t,providerId:s,_tokenResponse:r,operationType:n})}}function Yc(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
|
|
1003
|
-
* @license
|
|
1004
|
-
* Copyright 2020 Google LLC
|
|
1005
|
-
*
|
|
1006
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1007
|
-
* you may not use this file except in compliance with the License.
|
|
1008
|
-
* You may obtain a copy of the License at
|
|
1009
|
-
*
|
|
1010
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1011
|
-
*
|
|
1012
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1013
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1014
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1015
|
-
* See the License for the specific language governing permissions and
|
|
1016
|
-
* limitations under the License.
|
|
1017
|
-
*/class Fo extends kr{constructor(t,n,r,s){super(n.code,n.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,Fo.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 Fo(t,n,r,s)}}function Rf(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?Fo._fromErrorAndOperation(e,o,t,r):o})}async function h1(e,t,n=!1){const r=await Xs(e,t._linkToIdToken(e.auth,await e.getIdToken()),n);return ps._forOperation(e,"link",r)}/**
|
|
1018
|
-
* @license
|
|
1019
|
-
* Copyright 2019 Google LLC
|
|
1020
|
-
*
|
|
1021
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1022
|
-
* you may not use this file except in compliance with the License.
|
|
1023
|
-
* You may obtain a copy of the License at
|
|
1024
|
-
*
|
|
1025
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1026
|
-
*
|
|
1027
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1028
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1029
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1030
|
-
* See the License for the specific language governing permissions and
|
|
1031
|
-
* limitations under the License.
|
|
1032
|
-
*/async function p1(e,t,n=!1){const{auth:r}=e;if(An(r.app))return Promise.reject(Vr(r));const s="reauthenticate";try{const o=await Xs(e,Rf(r,s,t,e),n);Be(o.idToken,r,"internal-error");const i=nl(o.idToken);Be(i,r,"internal-error");const{sub:a}=i;return Be(e.uid===a,r,"user-mismatch"),ps._forOperation(e,s,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&On(r,"user-mismatch"),o}}/**
|
|
1033
|
-
* @license
|
|
1034
|
-
* Copyright 2020 Google LLC
|
|
1035
|
-
*
|
|
1036
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1037
|
-
* you may not use this file except in compliance with the License.
|
|
1038
|
-
* You may obtain a copy of the License at
|
|
1039
|
-
*
|
|
1040
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1041
|
-
*
|
|
1042
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1043
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1044
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1045
|
-
* See the License for the specific language governing permissions and
|
|
1046
|
-
* limitations under the License.
|
|
1047
|
-
*/async function m1(e,t,n=!1){if(An(e.app))return Promise.reject(Vr(e));const r="signIn",s=await Rf(e,r,t),o=await ps._fromIdTokenResponse(e,r,s);return n||await e._updateCurrentUser(o.user),o}function g1(e,t,n,r){return gs(e).onIdTokenChanged(t,n,r)}function v1(e,t,n){return gs(e).beforeAuthStateChanged(t,n)}const Uo="__sak";/**
|
|
1048
|
-
* @license
|
|
1049
|
-
* Copyright 2019 Google LLC
|
|
1050
|
-
*
|
|
1051
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1052
|
-
* you may not use this file except in compliance with the License.
|
|
1053
|
-
* You may obtain a copy of the License at
|
|
1054
|
-
*
|
|
1055
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1056
|
-
*
|
|
1057
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1058
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1059
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1060
|
-
* See the License for the specific language governing permissions and
|
|
1061
|
-
* limitations under the License.
|
|
1062
|
-
*/class Pf{constructor(t,n){this.storageRetriever=t,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Uo,"1"),this.storage.removeItem(Uo),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(t,n){return this.storage.setItem(t,JSON.stringify(n)),Promise.resolve()}_get(t){const n=this.storage.getItem(t);return Promise.resolve(n?JSON.parse(n):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
|
|
1063
|
-
* @license
|
|
1064
|
-
* Copyright 2020 Google LLC
|
|
1065
|
-
*
|
|
1066
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1067
|
-
* you may not use this file except in compliance with the License.
|
|
1068
|
-
* You may obtain a copy of the License at
|
|
1069
|
-
*
|
|
1070
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1071
|
-
*
|
|
1072
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1073
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1074
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1075
|
-
* See the License for the specific language governing permissions and
|
|
1076
|
-
* limitations under the License.
|
|
1077
|
-
*/const y1=1e3,w1=10;class xf extends Pf{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,n)=>this.onStorageEvent(t,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Sf(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),s=this.localCache[n];r!==s&&t(n,s,r)}}onStorageEvent(t,n=!1){if(!t.key){this.forAllChangedKeys((i,a,l)=>{this.notifyListeners(i,l)});return}const r=t.key;n?this.detachListener():this.stopPolling();const s=()=>{const i=this.storage.getItem(r);!n&&this.localCache[r]===i||this.notifyListeners(r,i)},o=this.storage.getItem(r);QT()&&o!==t.newValue&&t.newValue!==t.oldValue?setTimeout(s,w1):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)})},y1)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(t,n){await super._set(t,n),this.localCache[t]=JSON.stringify(n)}async _get(t){const n=await super._get(t);return this.localCache[t]=JSON.stringify(n),n}async _remove(t){await super._remove(t),delete this.localCache[t]}}xf.type="LOCAL";const b1=xf;/**
|
|
1078
|
-
* @license
|
|
1079
|
-
* Copyright 2020 Google LLC
|
|
1080
|
-
*
|
|
1081
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1082
|
-
* you may not use this file except in compliance with the License.
|
|
1083
|
-
* You may obtain a copy of the License at
|
|
1084
|
-
*
|
|
1085
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1086
|
-
*
|
|
1087
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1088
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1089
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1090
|
-
* See the License for the specific language governing permissions and
|
|
1091
|
-
* limitations under the License.
|
|
1092
|
-
*/class Mf extends Pf{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,n){}_removeListener(t,n){}}Mf.type="SESSION";const Of=Mf;/**
|
|
1093
|
-
* @license
|
|
1094
|
-
* Copyright 2019 Google LLC
|
|
1095
|
-
*
|
|
1096
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1097
|
-
* you may not use this file except in compliance with the License.
|
|
1098
|
-
* You may obtain a copy of the License at
|
|
1099
|
-
*
|
|
1100
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1101
|
-
*
|
|
1102
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1103
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1104
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1105
|
-
* See the License for the specific language governing permissions and
|
|
1106
|
-
* limitations under the License.
|
|
1107
|
-
*/function _1(e){return Promise.all(e.map(async t=>{try{return{fulfilled:!0,value:await t}}catch(n){return{fulfilled:!1,reason:n}}}))}/**
|
|
1108
|
-
* @license
|
|
1109
|
-
* Copyright 2019 Google LLC
|
|
1110
|
-
*
|
|
1111
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1112
|
-
* you may not use this file except in compliance with the License.
|
|
1113
|
-
* You may obtain a copy of the License at
|
|
1114
|
-
*
|
|
1115
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1116
|
-
*
|
|
1117
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1118
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1119
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1120
|
-
* See the License for the specific language governing permissions and
|
|
1121
|
-
* limitations under the License.
|
|
1122
|
-
*/class li{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 li(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 _1(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)}}li.receivers=[];/**
|
|
1123
|
-
* @license
|
|
1124
|
-
* Copyright 2020 Google LLC
|
|
1125
|
-
*
|
|
1126
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1127
|
-
* you may not use this file except in compliance with the License.
|
|
1128
|
-
* You may obtain a copy of the License at
|
|
1129
|
-
*
|
|
1130
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1131
|
-
*
|
|
1132
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1133
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1134
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1135
|
-
* See the License for the specific language governing permissions and
|
|
1136
|
-
* limitations under the License.
|
|
1137
|
-
*/function il(e="",t=10){let n="";for(let r=0;r<t;r++)n+=Math.floor(Math.random()*10);return e+n}/**
|
|
1138
|
-
* @license
|
|
1139
|
-
* Copyright 2019 Google LLC
|
|
1140
|
-
*
|
|
1141
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1142
|
-
* you may not use this file except in compliance with the License.
|
|
1143
|
-
* You may obtain a copy of the License at
|
|
1144
|
-
*
|
|
1145
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1146
|
-
*
|
|
1147
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1148
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1149
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1150
|
-
* See the License for the specific language governing permissions and
|
|
1151
|
-
* limitations under the License.
|
|
1152
|
-
*/class k1{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=il("",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)})}}/**
|
|
1153
|
-
* @license
|
|
1154
|
-
* Copyright 2020 Google LLC
|
|
1155
|
-
*
|
|
1156
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1157
|
-
* you may not use this file except in compliance with the License.
|
|
1158
|
-
* You may obtain a copy of the License at
|
|
1159
|
-
*
|
|
1160
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1161
|
-
*
|
|
1162
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1163
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1164
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1165
|
-
* See the License for the specific language governing permissions and
|
|
1166
|
-
* limitations under the License.
|
|
1167
|
-
*/function Mn(){return window}function T1(e){Mn().location.href=e}/**
|
|
1168
|
-
* @license
|
|
1169
|
-
* Copyright 2020 Google LLC.
|
|
1170
|
-
*
|
|
1171
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1172
|
-
* you may not use this file except in compliance with the License.
|
|
1173
|
-
* You may obtain a copy of the License at
|
|
1174
|
-
*
|
|
1175
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1176
|
-
*
|
|
1177
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1178
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1179
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1180
|
-
* See the License for the specific language governing permissions and
|
|
1181
|
-
* limitations under the License.
|
|
1182
|
-
*/function Nf(){return typeof Mn().WorkerGlobalScope<"u"&&typeof Mn().importScripts=="function"}async function I1(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function S1(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)==null?void 0:e.controller)||null}function E1(){return Nf()?self:null}/**
|
|
1183
|
-
* @license
|
|
1184
|
-
* Copyright 2019 Google LLC
|
|
1185
|
-
*
|
|
1186
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1187
|
-
* you may not use this file except in compliance with the License.
|
|
1188
|
-
* You may obtain a copy of the License at
|
|
1189
|
-
*
|
|
1190
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1191
|
-
*
|
|
1192
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1193
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1194
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1195
|
-
* See the License for the specific language governing permissions and
|
|
1196
|
-
* limitations under the License.
|
|
1197
|
-
*/const $f="firebaseLocalStorageDb",C1=1,Ho="firebaseLocalStorage",Df="fbase_key";class ao{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 ci(e,t){return e.transaction([Ho],t?"readwrite":"readonly").objectStore(Ho)}function A1(){const e=indexedDB.deleteDatabase($f);return new ao(e).toPromise()}function ba(){const e=indexedDB.open($f,C1);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const r=e.result;try{r.createObjectStore(Ho,{keyPath:Df})}catch(s){n(s)}}),e.addEventListener("success",async()=>{const r=e.result;r.objectStoreNames.contains(Ho)?t(r):(r.close(),await A1(),t(await ba()))})})}async function Qc(e,t,n){const r=ci(e,!0).put({[Df]:t,value:n});return new ao(r).toPromise()}async function R1(e,t){const n=ci(e,!1).get(t),r=await new ao(n).toPromise();return r===void 0?null:r.value}function Xc(e,t){const n=ci(e,!0).delete(t);return new ao(n).toPromise()}const P1=800,x1=3;class Lf{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await ba(),this.db)}async _withRetries(t){let n=0;for(;;)try{const r=await this._openDb();return await t(r)}catch(r){if(n++>x1)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return Nf()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=li._getInstance(E1()),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 I1(),!this.activeServiceWorker)return;this.sender=new k1(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||S1()!==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 ba();return await Qc(t,Uo,"1"),await Xc(t,Uo),!0}catch{}return!1}async _withPendingWrite(t){this.pendingWrites++;try{await t()}finally{this.pendingWrites--}}async _set(t,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>Qc(r,t,n)),this.localCache[t]=n,this.notifyServiceWorker(t)))}async _get(t){const n=await this._withRetries(r=>R1(r,t));return this.localCache[t]=n,n}async _remove(t){return this._withPendingWrite(async()=>(await this._withRetries(n=>Xc(n,t)),delete this.localCache[t],this.notifyServiceWorker(t)))}async _poll(){const t=await this._withRetries(s=>{const o=ci(s,!1).getAll();return new ao(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(),P1)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}Lf.type="LOCAL";const M1=Lf;new oo(3e4,6e4);/**
|
|
1198
|
-
* @license
|
|
1199
|
-
* Copyright 2021 Google LLC
|
|
1200
|
-
*
|
|
1201
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1202
|
-
* you may not use this file except in compliance with the License.
|
|
1203
|
-
* You may obtain a copy of the License at
|
|
1204
|
-
*
|
|
1205
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1206
|
-
*
|
|
1207
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1208
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1209
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1210
|
-
* See the License for the specific language governing permissions and
|
|
1211
|
-
* limitations under the License.
|
|
1212
|
-
*/function jf(e,t){return t?zn(t):(Be(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/**
|
|
1213
|
-
* @license
|
|
1214
|
-
* Copyright 2019 Google LLC
|
|
1215
|
-
*
|
|
1216
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1217
|
-
* you may not use this file except in compliance with the License.
|
|
1218
|
-
* You may obtain a copy of the License at
|
|
1219
|
-
*
|
|
1220
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1221
|
-
*
|
|
1222
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1223
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1224
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1225
|
-
* See the License for the specific language governing permissions and
|
|
1226
|
-
* limitations under the License.
|
|
1227
|
-
*/class al extends Af{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return ls(t,this._buildIdpRequest())}_linkToIdToken(t,n){return ls(t,this._buildIdpRequest(n))}_getReauthenticationResolver(t){return ls(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 O1(e){return m1(e.auth,new al(e),e.bypassAuthState)}function N1(e){const{auth:t,user:n}=e;return Be(n,t,"internal-error"),p1(n,new al(e),e.bypassAuthState)}async function $1(e){const{auth:t,user:n}=e;return Be(n,t,"internal-error"),h1(n,new al(e),e.bypassAuthState)}/**
|
|
1228
|
-
* @license
|
|
1229
|
-
* Copyright 2020 Google LLC
|
|
1230
|
-
*
|
|
1231
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1232
|
-
* you may not use this file except in compliance with the License.
|
|
1233
|
-
* You may obtain a copy of the License at
|
|
1234
|
-
*
|
|
1235
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1236
|
-
*
|
|
1237
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1238
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1239
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1240
|
-
* See the License for the specific language governing permissions and
|
|
1241
|
-
* limitations under the License.
|
|
1242
|
-
*/class Bf{constructor(t,n,r,s,o=!1){this.auth=t,this.resolver=r,this.user=s,this.bypassAuthState=o,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(t,n)=>{this.pendingPromise={resolve:t,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(t){const{urlResponse:n,sessionId:r,postBody:s,tenantId:o,error:i,type:a}=t;if(i){this.reject(i);return}const l={auth:this.auth,requestUri:n,sessionId:r,tenantId:o||void 0,postBody:s||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(l))}catch(u){this.reject(u)}}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return O1;case"linkViaPopup":case"linkViaRedirect":return $1;case"reauthViaPopup":case"reauthViaRedirect":return N1;default:On(this.auth,"internal-error")}}resolve(t){er(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){er(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
|
|
1243
|
-
* @license
|
|
1244
|
-
* Copyright 2020 Google LLC
|
|
1245
|
-
*
|
|
1246
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1247
|
-
* you may not use this file except in compliance with the License.
|
|
1248
|
-
* You may obtain a copy of the License at
|
|
1249
|
-
*
|
|
1250
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1251
|
-
*
|
|
1252
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1253
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1254
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1255
|
-
* See the License for the specific language governing permissions and
|
|
1256
|
-
* limitations under the License.
|
|
1257
|
-
*/const D1=new oo(2e3,1e4);async function L1(e,t,n){if(An(e.app))return Promise.reject(mn(e,"operation-not-supported-in-this-environment"));const r=ai(e);OT(e,t,ol);const s=jf(r,n);return new Fr(r,"signInViaPopup",t,s).executeNotNull()}class Fr extends Bf{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 Be(t,this.auth,"internal-error"),t}async onExecution(){er(this.filter.length===1,"Popup operations only handle one event");const t=il();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(mn(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var t;return((t=this.authWindow)==null?void 0:t.associatedEvent)||null}cancel(){this.reject(mn(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(mn(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,D1.get())};t()}}Fr.currentPopupAction=null;/**
|
|
1258
|
-
* @license
|
|
1259
|
-
* Copyright 2020 Google LLC
|
|
1260
|
-
*
|
|
1261
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1262
|
-
* you may not use this file except in compliance with the License.
|
|
1263
|
-
* You may obtain a copy of the License at
|
|
1264
|
-
*
|
|
1265
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1266
|
-
*
|
|
1267
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1268
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1269
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1270
|
-
* See the License for the specific language governing permissions and
|
|
1271
|
-
* limitations under the License.
|
|
1272
|
-
*/const j1="pendingRedirect",Eo=new Map;class B1 extends Bf{constructor(t,n,r=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let t=Eo.get(this.auth._key());if(!t){try{const r=await F1(this.resolver,this.auth)?await super.execute():null;t=()=>Promise.resolve(r)}catch(n){t=()=>Promise.reject(n)}Eo.set(this.auth._key(),t)}return this.bypassAuthState||Eo.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 F1(e,t){const n=V1(t),r=H1(e);if(!await r._isAvailable())return!1;const s=await r._get(n)==="true";return await r._remove(n),s}function U1(e,t){Eo.set(e._key(),t)}function H1(e){return zn(e._redirectPersistence)}function V1(e){return So(j1,e.config.apiKey,e.name)}async function W1(e,t,n=!1){if(An(e.app))return Promise.reject(Vr(e));const r=ai(e),s=jf(r,t),i=await new B1(r,s,n).execute();return i&&!n&&(delete i.user._redirectEventId,await r._persistUserIfCurrent(i.user),await r._setRedirectUser(null,t)),i}/**
|
|
1273
|
-
* @license
|
|
1274
|
-
* Copyright 2020 Google LLC
|
|
1275
|
-
*
|
|
1276
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1277
|
-
* you may not use this file except in compliance with the License.
|
|
1278
|
-
* You may obtain a copy of the License at
|
|
1279
|
-
*
|
|
1280
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1281
|
-
*
|
|
1282
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1283
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1284
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1285
|
-
* See the License for the specific language governing permissions and
|
|
1286
|
-
* limitations under the License.
|
|
1287
|
-
*/const q1=600*1e3;class z1{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||!G1(t)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=t,n=!0)),n}sendToConsumer(t,n){var r;if(t.error&&!Ff(t)){const s=((r=t.error.code)==null?void 0:r.split("auth/")[1])||"internal-error";n.onError(mn(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>=q1&&this.cachedEventUids.clear(),this.cachedEventUids.has(Zc(t))}saveEventToCache(t){this.cachedEventUids.add(Zc(t)),this.lastProcessedEventTime=Date.now()}}function Zc(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function Ff({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function G1(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Ff(e);default:return!1}}/**
|
|
1288
|
-
* @license
|
|
1289
|
-
* Copyright 2020 Google LLC
|
|
1290
|
-
*
|
|
1291
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1292
|
-
* you may not use this file except in compliance with the License.
|
|
1293
|
-
* You may obtain a copy of the License at
|
|
1294
|
-
*
|
|
1295
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1296
|
-
*
|
|
1297
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1298
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1299
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1300
|
-
* See the License for the specific language governing permissions and
|
|
1301
|
-
* limitations under the License.
|
|
1302
|
-
*/async function K1(e,t={}){return vs(e,"GET","/v1/projects",t)}/**
|
|
1303
|
-
* @license
|
|
1304
|
-
* Copyright 2020 Google LLC
|
|
1305
|
-
*
|
|
1306
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1307
|
-
* you may not use this file except in compliance with the License.
|
|
1308
|
-
* You may obtain a copy of the License at
|
|
1309
|
-
*
|
|
1310
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1311
|
-
*
|
|
1312
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1313
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1314
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1315
|
-
* See the License for the specific language governing permissions and
|
|
1316
|
-
* limitations under the License.
|
|
1317
|
-
*/const J1=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Y1=/^https?/;async function Q1(e){if(e.config.emulator)return;const{authorizedDomains:t}=await K1(e);for(const n of t)try{if(X1(n))return}catch{}On(e,"unauthorized-domain")}function X1(e){const t=ya(),{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(!Y1.test(n))return!1;if(J1.test(e))return r===e;const s=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}/**
|
|
1318
|
-
* @license
|
|
1319
|
-
* Copyright 2020 Google LLC.
|
|
1320
|
-
*
|
|
1321
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1322
|
-
* you may not use this file except in compliance with the License.
|
|
1323
|
-
* You may obtain a copy of the License at
|
|
1324
|
-
*
|
|
1325
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1326
|
-
*
|
|
1327
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1328
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1329
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1330
|
-
* See the License for the specific language governing permissions and
|
|
1331
|
-
* limitations under the License.
|
|
1332
|
-
*/const Z1=new oo(3e4,6e4);function eu(){const e=Mn().___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 eI(e){return new Promise((t,n)=>{var s,o,i;function r(){eu(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{eu(),n(mn(e,"network-request-failed"))},timeout:Z1.get()})}if((o=(s=Mn().gapi)==null?void 0:s.iframes)!=null&&o.Iframe)t(gapi.iframes.getContext());else if((i=Mn().gapi)!=null&&i.load)r();else{const a=i1("iframefcb");return Mn()[a]=()=>{gapi.load?r():n(mn(e,"network-request-failed"))},s1(`${o1()}?onload=${a}`).catch(l=>n(l))}}).catch(t=>{throw Co=null,t})}let Co=null;function tI(e){return Co=Co||eI(e),Co}/**
|
|
1333
|
-
* @license
|
|
1334
|
-
* Copyright 2020 Google LLC.
|
|
1335
|
-
*
|
|
1336
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1337
|
-
* you may not use this file except in compliance with the License.
|
|
1338
|
-
* You may obtain a copy of the License at
|
|
1339
|
-
*
|
|
1340
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1341
|
-
*
|
|
1342
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1343
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1344
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1345
|
-
* See the License for the specific language governing permissions and
|
|
1346
|
-
* limitations under the License.
|
|
1347
|
-
*/const nI=new oo(5e3,15e3),rI="__/auth/iframe",sI="emulator/auth/iframe",oI={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},iI=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function aI(e){const t=e.config;Be(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?el(t,sI):`https://${e.config.authDomain}/${rI}`,r={apiKey:t.apiKey,appName:e.name,v:so},s=iI.get(e.config.apiHost);s&&(r.eid=s);const o=e._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${ro(r).slice(1)}`}async function lI(e){const t=await tI(e),n=Mn().gapi;return Be(n,e,"internal-error"),t.open({where:document.body,url:aI(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:oI,dontclear:!0},r=>new Promise(async(s,o)=>{await r.restyle({setHideOnLeave:!1});const i=mn(e,"network-request-failed"),a=Mn().setTimeout(()=>{o(i)},nI.get());function l(){Mn().clearTimeout(a),s(r)}r.ping(l).then(l,()=>{o(i)})}))}/**
|
|
1348
|
-
* @license
|
|
1349
|
-
* Copyright 2020 Google LLC.
|
|
1350
|
-
*
|
|
1351
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1352
|
-
* you may not use this file except in compliance with the License.
|
|
1353
|
-
* You may obtain a copy of the License at
|
|
1354
|
-
*
|
|
1355
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1356
|
-
*
|
|
1357
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1358
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1359
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1360
|
-
* See the License for the specific language governing permissions and
|
|
1361
|
-
* limitations under the License.
|
|
1362
|
-
*/const cI={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},uI=500,dI=600,fI="_blank",hI="http://localhost";class tu{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function pI(e,t,n,r=uI,s=dI){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={...cI,width:r.toString(),height:s.toString(),top:o,left:i},u=Zt().toLowerCase();n&&(a=bf(u)?fI:n),yf(u)&&(t=t||hI,l.scrollbars="yes");const c=Object.entries(l).reduce((h,[b,$])=>`${h}${b}=${$},`,"");if(YT(u)&&a!=="_self")return mI(t||"",a),new tu(null);const f=window.open(t||"",a,c);Be(f,e,"popup-blocked");try{f.focus()}catch{}return new tu(f)}function mI(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/**
|
|
1363
|
-
* @license
|
|
1364
|
-
* Copyright 2021 Google LLC
|
|
1365
|
-
*
|
|
1366
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1367
|
-
* you may not use this file except in compliance with the License.
|
|
1368
|
-
* You may obtain a copy of the License at
|
|
1369
|
-
*
|
|
1370
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1371
|
-
*
|
|
1372
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1373
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1374
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1375
|
-
* See the License for the specific language governing permissions and
|
|
1376
|
-
* limitations under the License.
|
|
1377
|
-
*/const gI="__/auth/handler",vI="emulator/auth/handler",yI=encodeURIComponent("fac");async function nu(e,t,n,r,s,o){Be(e.config.authDomain,e,"auth-domain-config-required"),Be(e.config.apiKey,e,"invalid-api-key");const i={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:so,eventId:s};if(t instanceof ol){t.setDefaultLanguage(e.languageCode),i.providerId=t.providerId||"",gk(t.getCustomParameters())||(i.customParameters=JSON.stringify(t.getCustomParameters()));for(const[c,f]of Object.entries({}))i[c]=f}if(t instanceof io){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?`#${yI}=${encodeURIComponent(l)}`:"";return`${wI(e)}?${ro(a).slice(1)}${u}`}function wI({config:e}){return e.emulator?el(e,vI):`https://${e.authDomain}/${gI}`}/**
|
|
1378
|
-
* @license
|
|
1379
|
-
* Copyright 2020 Google LLC
|
|
1380
|
-
*
|
|
1381
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1382
|
-
* you may not use this file except in compliance with the License.
|
|
1383
|
-
* You may obtain a copy of the License at
|
|
1384
|
-
*
|
|
1385
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1386
|
-
*
|
|
1387
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1388
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1389
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1390
|
-
* See the License for the specific language governing permissions and
|
|
1391
|
-
* limitations under the License.
|
|
1392
|
-
*/const Bi="webStorageSupport";class bI{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Of,this._completeRedirectFn=W1,this._overrideRedirectResult=U1}async _openPopup(t,n,r,s){var i;er((i=this.eventManagers[t._key()])==null?void 0:i.manager,"_initialize() not called before _openPopup()");const o=await nu(t,n,r,ya(),s);return pI(t,o,il())}async _openRedirect(t,n,r,s){await this._originValidation(t);const o=await nu(t,n,r,ya(),s);return T1(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):(er(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 lI(t),r=new z1(t);return n.register("authEvent",s=>(Be(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(Bi,{type:Bi},s=>{var i;const o=(i=s==null?void 0:s[0])==null?void 0:i[Bi];o!==void 0&&n(!!o),On(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=Q1(t)),this.originValidationPromises[n]}get _shouldInitProactively(){return Sf()||wf()||rl()}}const _I=bI;var ru="@firebase/auth",su="1.12.1";/**
|
|
1393
|
-
* @license
|
|
1394
|
-
* Copyright 2020 Google LLC
|
|
1395
|
-
*
|
|
1396
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1397
|
-
* you may not use this file except in compliance with the License.
|
|
1398
|
-
* You may obtain a copy of the License at
|
|
1399
|
-
*
|
|
1400
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1401
|
-
*
|
|
1402
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1403
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1404
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1405
|
-
* See the License for the specific language governing permissions and
|
|
1406
|
-
* limitations under the License.
|
|
1407
|
-
*/class kI{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(){Be(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
|
|
1408
|
-
* @license
|
|
1409
|
-
* Copyright 2020 Google LLC
|
|
1410
|
-
*
|
|
1411
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1412
|
-
* you may not use this file except in compliance with the License.
|
|
1413
|
-
* You may obtain a copy of the License at
|
|
1414
|
-
*
|
|
1415
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1416
|
-
*
|
|
1417
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1418
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1419
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1420
|
-
* See the License for the specific language governing permissions and
|
|
1421
|
-
* limitations under the License.
|
|
1422
|
-
*/function TI(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 II(e){Ys(new hs("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;Be(i&&!i.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:i,authDomain:a,clientPlatform:e,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Ef(e)},u=new n1(r,s,o,l);return l1(u,n),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,n,r)=>{t.getProvider("auth-internal").initialize()})),Ys(new hs("auth-internal",t=>{const n=ai(t.getProvider("auth").getImmediate());return(r=>new kI(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),os(ru,su,TI(e)),os(ru,su,"esm2020")}/**
|
|
1423
|
-
* @license
|
|
1424
|
-
* Copyright 2021 Google LLC
|
|
1425
|
-
*
|
|
1426
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
1427
|
-
* you may not use this file except in compliance with the License.
|
|
1428
|
-
* You may obtain a copy of the License at
|
|
1429
|
-
*
|
|
1430
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
1431
|
-
*
|
|
1432
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
1433
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
1434
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1435
|
-
* See the License for the specific language governing permissions and
|
|
1436
|
-
* limitations under the License.
|
|
1437
|
-
*/const SI=300,EI=tf("authIdTokenMaxAge")||SI;let ou=null;const CI=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>EI)return;const s=n==null?void 0:n.token;ou!==s&&(ou=s,await fetch(e,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function AI(e=lf()){const t=of(e,"auth");if(t.isInitialized())return t.getImmediate();const n=a1(e,{popupRedirectResolver:_I,persistence:[M1,b1,Of]}),r=tf("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const i=CI(o.toString());v1(n,i,()=>i(n.currentUser)),g1(n,a=>i(a))}}const s=ek("auth");return s&&c1(n,`http://${s}`),n}function RI(){var e;return((e=document.getElementsByTagName("head"))==null?void 0:e[0])??document}r1({loadJS(e){return new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=s=>{const o=mn("internal-error");o.customData=s,n(o)},r.type="text/javascript",r.charset="UTF-8",RI().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="});II("Browser");const PI={},xI={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function MI(e,t){return w(),T("svg",xI,[...t[0]||(t[0]=[m("circle",{cx:"11",cy:"11",r:"8"},null,-1),m("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const _a=nt(PI,[["render",MI]]),OI={class:"skill-card-top"},NI=["src","alt"],$I={key:1,class:"skill-card-avatar-fallback"},DI={class:"skill-card-info"},LI={class:"skill-card-header"},jI={class:"skill-card-name"},BI={key:0,class:"skill-card-badge-disabled"},FI={key:1,class:"skill-card-badge"},UI={class:"skill-card-owner"},HI={key:0,class:"skill-card-desc"},VI={key:1,class:"skill-card-date"},WI=$t({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=fe(()=>{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:gt(["skill-card",{"is-disabled":e.skill.installed&&e.skill.enabled===!1}]),type:"button",onClick:o[0]||(o[0]=i=>s.$emit("select",e.skill))},[m("div",OI,[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,NI)):(w(),T("div",$I,de(e.skill.owner.charAt(0)),1)),m("div",DI,[m("div",LI,[m("span",jI,de(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(w(),T("span",BI,"Disabled")):e.skill.installed?(w(),T("span",FI,"Installed")):le("",!0)]),m("span",UI,de(e.skill.owner),1)])]),e.skill.description?(w(),T("p",HI,de(e.skill.description),1)):le("",!0),n.value?(w(),T("span",VI,de(n.value),1)):le("",!0)],2))}}),iu=nt(WI,[["__scopeId","data-v-2a1e8196"]]),qI={class:"sdm-panel"},zI={class:"sdm-header"},GI={class:"sdm-title-area"},KI=["src","alt"],JI={class:"sdm-title-col"},YI={class:"sdm-title-row"},QI={class:"sdm-title"},XI={key:0,class:"sdm-badge-disabled"},ZI={class:"sdm-owner"},eS={class:"sdm-body"},tS={key:0,class:"sdm-desc"},nS={key:1,class:"sdm-readme-loading"},rS=["innerHTML"],sS=["href"],oS={class:"sdm-footer"},iS={class:"sdm-footer-actions"},aS=["disabled"],lS=["disabled"],cS=["disabled"],uS=$t({__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=L(null),o=L(""),i=L(!1),a=fe(()=>s.value??n.skill.enabled??!0),l=fe(()=>n.isInstalling===!0||n.isUninstalling===!0),u=fe(()=>{const P=o.value;if(!P)return"";const H=P.replace(/^---[\s\S]*?---\s*/,"");return c(H)});function c(P){return P.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 P=new URLSearchParams({owner:n.skill.owner,name:n.skill.name}),H=await fetch(`/codex-api/skills-hub/readme?${P}`);if(!H.ok)return;const Y=await H.json();o.value=Y.content??""}catch{}finally{i.value=!1}}}mt(()=>n.visible,P=>{P&&(s.value=null,o.value="",f())});function h(){r("install",n.skill)}function b(){r("uninstall",n.skill)}function $(){const P=!a.value;s.value=P,r("toggle-enabled",n.skill,P)}return(P,H)=>(w(),vt(xo,{to:"body"},[e.visible?(w(),T("div",{key:0,class:"sdm-overlay",onClick:H[1]||(H[1]=tt(Y=>P.$emit("close"),["self"]))},[m("div",qI,[m("div",zI,[m("div",GI,[e.skill.avatarUrl?(w(),T("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,KI)):le("",!0),m("div",JI,[m("div",YI,[m("h3",QI,de(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(w(),T("span",XI,"Disabled")):le("",!0)]),m("span",ZI,de(e.skill.owner),1)])]),m("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:H[0]||(H[0]=Y=>P.$emit("close"))},[Ie(Ga,{class:"sdm-close-icon"})])]),m("div",eS,[e.skill.description?(w(),T("p",tS,de(e.skill.description),1)):le("",!0),i.value?(w(),T("div",nS,"Loading skill contents...")):o.value?(w(),T("div",{key:2,class:"sdm-readme",innerHTML:u.value},null,8,rS)):le("",!0),m("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,sS)]),m("div",oS,[m("div",iS,[e.skill.installed?(w(),T("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:b},de(n.isUninstalling?"Uninstalling...":"Uninstall"),9,aS)):(w(),T("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:h},de(n.isInstalling?"Installing...":"Install"),9,lS)),e.skill.installed?(w(),T("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:$},de(a.value?"Disable":"Enable"),9,cS)):le("",!0)])])])])):le("",!0)]))}}),dS=nt(uS,[["__scopeId","data-v-19a385ca"]]),fS={class:"skills-hub"},hS={class:"skills-sync-panel"},pS={class:"skills-sync-header"},mS={key:0,class:"skills-sync-badge"},gS={key:1,class:"skills-sync-badge"},vS={key:2,class:"skills-sync-badge"},yS={class:"skills-sync-meta"},wS={key:0,class:"skills-sync-error"},bS={key:1,class:"skills-sync-meta"},_S={key:2,class:"skills-sync-error"},kS={key:3,class:"skills-sync-device"},TS=["href"],IS={class:"skills-sync-actions"},SS=["disabled"],ES=["disabled"],CS=["disabled"],AS={key:1,class:"skills-hub-section"},RS={class:"skills-hub-section-title"},PS={key:0,class:"skills-hub-grid"},xS={class:"skills-hub-toolbar"},MS={class:"skills-hub-search-wrap"},OS={key:0,class:"skills-hub-count"},NS={class:"skills-hub-section"},$S={key:0,class:"skills-hub-loading"},DS={key:1,class:"skills-hub-error"},LS={key:0,class:"skills-hub-grid"},jS={key:1,class:"skills-hub-empty"},po="codex-web-local.skills-hub.cache.v1",BS=$t({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=L(null),s=L(""),o=L("date"),i=L([]),a=L([]),l=L(0),u=L(!1),c=L(""),f=L(!0),h=L(!1),b=L(n),$=L(null),P=L(""),H=L(!1),Y=L(!1),D=L(""),W=L(""),j=L(""),ue=L(null),ae=L({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}});let ve=null,_e=null;const ie=t,ne=fe(()=>o.value==="date"?"Newest":"A-Z"),Te=fe(()=>{var R;return((R=$.value)==null?void 0:R.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),re=fe(()=>`${b.value.owner}/${b.value.name}`),Le=fe(()=>H.value&&P.value===re.value),je=fe(()=>Y.value&&P.value===re.value),Xe=fe(()=>j.value==="pull"),Ee=fe(()=>j.value==="push"),ke=fe(()=>j.value!==""),Ne=fe(()=>{const R=s.value.toLowerCase().trim();return R?a.value.filter(x=>x.name.toLowerCase().includes(R)||x.owner.toLowerCase().includes(R)||(x.displayName??"").toLowerCase().includes(R)):a.value});function ze(R,x="success"){$.value={text:R,type:x},_e&&clearTimeout(_e),_e=setTimeout(()=>{$.value=null},3e3)}function rt(){o.value=o.value==="date"?"name":"date",Ke(s.value)}function Ze(R){return`${o.value}::${R.trim().toLowerCase()}`}function et(R){var x;if(typeof window>"u")return null;try{const N=window.localStorage.getItem(po);return N?((x=JSON.parse(N).byKey)==null?void 0:x[R])??null:null}catch{return null}}function ht(R,x){if(!(typeof window>"u"))try{const N=window.localStorage.getItem(po),X=(N?JSON.parse(N):{}).byKey??{};X[R]=x,window.localStorage.setItem(po,JSON.stringify({byKey:X}))}catch{}}function St(){if(!(typeof window>"u"))try{window.localStorage.removeItem(po)}catch{}}function Ge(R){const x=R.installed??[];a.value=x;const N=new Set(x.map(te=>te.name));i.value=R.data.map(te=>{if(te.installed||N.has(te.name)){const X=x.find(oe=>oe.name===te.name);return{...te,installed:!0,path:(X==null?void 0:X.path)??te.path,enabled:(X==null?void 0:X.enabled)??te.enabled}}return te}).filter(te=>!te.installed),l.value=R.total}async function Ke(R){const x=Ze(R),N=et(x);N&&Ge(N),u.value=!N,c.value="";try{const te=new URLSearchParams;R.trim()&&te.set("q",R.trim()),te.set("limit","100"),te.set("sort",o.value);const X=await fetch(`/codex-api/skills-hub?${te}`);if(!X.ok)throw new Error(`HTTP ${X.status}`);const oe=await X.json();Ge(oe),ht(x,oe)}catch(te){c.value=te instanceof Error?te.message:"Failed to load skills"}finally{u.value=!1}}function U(){ve&&clearTimeout(ve),ve=setTimeout(()=>Ke(s.value),300)}function he(R){b.value=R,h.value=!0}async function ce(R){P.value=`${R.owner}/${R.name}`,H.value=!0;try{const N=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:R.owner,name:R.name})})).json();if(!N.ok)throw new Error(N.error||"Install failed");const te={...R,installed:!0,path:N.path,enabled:!0};a.value=[...a.value,te],i.value=i.value.filter(X=>X.name!==R.name),b.value=te,ze(`${R.displayName||R.name} skill installed`),h.value=!1,St(),ie("skills-changed")}catch(x){ze(x instanceof Error?x.message:"Failed to install skill","error")}finally{H.value=!1}}async function me(R){P.value=`${R.owner}/${R.name}`,Y.value=!0;try{const N=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:R.name,path:R.path})})).json();if(!N.ok)throw new Error(N.error||"Uninstall failed");a.value=a.value.filter(te=>te.name!==R.name),R.owner!=="local"&&(i.value=[...i.value,{...R,installed:!1,path:void 0,enabled:void 0}]),ze(`${R.displayName||R.name} skill uninstalled`),h.value=!1,St(),ie("skills-changed")}catch(x){ze(x instanceof Error?x.message:"Failed to uninstall skill","error")}finally{Y.value=!1}}async function Oe(R,x){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:R.path,enabled:x}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),ze(`${R.displayName||R.name} skill ${x?"enabled":"disabled"}`),await Ke(s.value)}catch(N){ze(N instanceof Error?N.message:"Failed to update skill","error")}}async function g(){try{const R=await fetch("/codex-api/skills-sync/status");if(!R.ok)return;const x=await R.json();x.data&&(ae.value=x.data)}catch{}}async function v(){try{const R=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),x=await R.json();if(!R.ok||!x.data)throw new Error("Failed to start GitHub login");ue.value=x.data;const N=30,te=Math.max((x.data.interval??5)*1e3,3e3);let X=!1;for(let oe=0;oe<N;oe++){await new Promise(Ye=>setTimeout(Ye,te));const ye=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:x.data.device_code})}),Se=await ye.json();if(!ye.ok)throw new Error(Se.error||"Failed to complete GitHub login");if(Se.ok){X=!0;break}if(!Se.pending)throw new Error(Se.error||"Failed to complete GitHub login")}if(!X)throw new Error("GitHub login timed out. Please retry.");ue.value=null,await g(),ze("GitHub login successful")}catch(R){ze(R instanceof Error?R.message:"Failed GitHub login","error")}}const S={apiKey:"AIzaSyAf0CIHBZ-wEQJ8CCUUWo1Wl9P7typ_ZPI",authDomain:"gptcall-416910.firebaseapp.com",projectId:"gptcall-416910",storageBucket:"gptcall-416910.appspot.com",messagingSenderId:"99275526699",appId:"1:99275526699:web:3b623e1e2996108b52106e"};async function B(){try{const R=yT().length>0?lf():af(S),x=AI(R),N=new Rn;N.addScope("repo");const te=await L1(x,N),X=Rn.credentialFromResult(te),oe=(X==null?void 0:X.accessToken)??"";if(!oe)throw new Error("GitHub access token missing from Firebase login");const ye=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:oe})}),Se=await ye.json();if(!ye.ok||!Se.ok)throw new Error(Se.error||"Failed to login with GitHub token");await g(),ze("GitHub login successful")}catch(R){const x=R instanceof Error?R.message:"Failed Firebase GitHub login";ze(x,"error")}}async function q(){W.value="",D.value="pull-started",j.value="pull";try{const R=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),x=await R.json();if(!R.ok||!x.ok)throw new Error(x.error||"Failed to pull synced skills");await Ke(s.value),ie("skills-changed"),D.value="pull-success",ze(ae.value.loggedIn?"Pulled skills from private sync repo":"Pulled skills from upstream repo")}catch(R){const x=R instanceof Error?R.message:"Failed to pull sync";W.value=x,D.value="pull-failed",ze(x,"error")}finally{j.value=""}}async function V(){W.value="",D.value="push-started",j.value="push";try{const R=await fetch("/codex-api/skills-sync/push",{method:"POST"}),x=await R.json();if(!R.ok||!x.ok)throw new Error(x.error||"Failed to push synced skills");D.value="push-success",ze("Pushed skills to private sync repo")}catch(R){const x=R instanceof Error?R.message:"Failed to push sync";W.value=x,D.value="push-failed",ze(x,"error")}finally{j.value=""}}async function Z(){try{const R=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),x=await R.json();if(!R.ok||!x.ok)throw new Error(x.error||"Failed to logout GitHub");await g(),ze("Logged out from GitHub")}catch(R){ze(R instanceof Error?R.message:"Failed to logout GitHub","error")}}return nr(()=>{Ke(""),g()}),(R,x)=>(w(),T("div",fS,[x[6]||(x[6]=m("div",{class:"skills-hub-header"},[m("h2",{class:"skills-hub-title"},"Skills Hub"),m("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),m("div",hS,[m("div",pS,[x[3]||(x[3]=m("strong",null,"Skills Sync (GitHub)",-1)),ae.value.configured?(w(),T("span",mS,"Connected: "+de(ae.value.repoOwner)+"/"+de(ae.value.repoName),1)):ae.value.loggedIn?(w(),T("span",gS,"Logged in as "+de(ae.value.githubUsername),1)):(w(),T("span",vS,"Not connected"))]),m("div",yS,[m("span",null,"Startup: "+de(ae.value.startup.mode),1),m("span",null,"Branch: "+de(ae.value.startup.branch),1),m("span",null,"Action: "+de(ae.value.startup.lastAction),1)]),ae.value.startup.lastError?(w(),T("div",wS,de(ae.value.startup.lastError),1)):le("",!0),D.value?(w(),T("div",bS,[m("span",null,"Manual sync: "+de(D.value),1)])):le("",!0),W.value?(w(),T("div",_S,de(W.value),1)):le("",!0),ue.value?(w(),T("div",kS,[m("span",null,[x[4]||(x[4]=sa("Open ",-1)),m("a",{href:ue.value.verification_uri,target:"_blank",rel:"noreferrer"},"GitHub device login",8,TS),x[5]||(x[5]=sa(" and enter code:",-1))]),m("code",null,de(ue.value.user_code),1)])):le("",!0),m("div",IS,[ae.value.loggedIn?le("",!0):(w(),T("button",{key:0,class:"skills-hub-sort",type:"button",onClick:B},"Login with GitHub")),ae.value.loggedIn?le("",!0):(w(),T("button",{key:1,class:"skills-hub-sort",type:"button",onClick:v},"Device Login")),ae.value.loggedIn?(w(),T("button",{key:2,class:"skills-hub-sort",type:"button",onClick:Z,disabled:ke.value},"Logout GitHub",8,SS)):le("",!0),m("button",{class:"skills-hub-sort",type:"button",onClick:q,disabled:ke.value},de(Xe.value?"Pulling...":"Pull"),9,ES),ae.value.loggedIn?(w(),T("button",{key:3,class:"skills-hub-sort",type:"button",onClick:V,disabled:!ae.value.configured||ke.value},de(Ee.value?"Pushing...":"Push"),9,CS)):le("",!0)])]),$.value?(w(),T("div",{key:0,class:gt(["skills-hub-toast",Te.value])},de($.value.text),3)):le("",!0),Ne.value.length>0?(w(),T("div",AS,[m("button",{class:"skills-hub-section-toggle",type:"button",onClick:x[0]||(x[0]=N=>f.value=!f.value)},[m("span",RS,"Installed ("+de(Ne.value.length)+")",1),Ie(qd,{class:gt(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(w(),T("div",PS,[(w(!0),T(He,null,Tt(Ne.value,N=>(w(),vt(iu,{key:N.name,skill:N,onSelect:te=>he(te)},null,8,["skill","onSelect"]))),128))])):le("",!0)])):le("",!0),m("div",xS,[m("div",MS,[Ie(_a,{class:"skills-hub-search-icon"}),Qn(m("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":x[1]||(x[1]=N=>s.value=N),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:U},null,544),[[Xn,s.value]]),l.value>0?(w(),T("span",OS,de(l.value)+" skills",1)):le("",!0)]),m("button",{class:"skills-hub-sort",type:"button",onClick:rt},de(ne.value),1)]),m("div",NS,[u.value?(w(),T("div",$S,"Loading skills...")):c.value?(w(),T("div",DS,de(c.value),1)):(w(),T(He,{key:2},[i.value.length>0?(w(),T("div",LS,[(w(!0),T(He,null,Tt(i.value,N=>(w(),vt(iu,{key:N.url,skill:N,onSelect:te=>he(te)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(w(),T("div",jS,'No skills found for "'+de(s.value)+'"',1)):le("",!0)],64))]),Ie(dS,{skill:b.value,visible:h.value,"is-installing":Le.value,"is-uninstalling":je.value,onClose:x[2]||(x[2]=N=>h.value=!1),onInstall:ce,onUninstall:me,onToggleEnabled:Oe},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),FS=nt(BS,[["__scopeId","data-v-d21b51ec"]]),US={},HS={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 VS(e,t){return w(),T("svg",HS,[...t[0]||(t[0]=[m("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),m("path",{d:"M9 4l0 16"},null,-1)])])}const WS=nt(US,[["render",VS]]),qS={},zS={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function GS(e,t){return w(),T("svg",zS,[...t[0]||(t[0]=[m("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 KS=nt(qS,[["render",GS]]),JS={class:"sidebar-thread-controls"},YS=["aria-label","title"],QS=$t({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(w(),T("div",JS,[m("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(),vt(KS,{key:0,class:"sidebar-thread-controls-icon"})):(w(),vt(WS,{key:1,class:"sidebar-thread-controls-icon"}))],8,YS),Pn(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"))},[Ie(Do,{class:"sidebar-thread-controls-icon"})])):le("",!0)]))}}),au=nt(QS,[["__scopeId","data-v-46a10052"]]),XS={},ZS={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function eE(e,t){return w(),T("svg",ZS,[...t[0]||(t[0]=[m("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[m("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"}),m("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const tE=nt(XS,[["render",eE]]);function hr(e){return e.flatMap(t=>t.threads)}const Uf="codex-web-local.thread-read-state.v1",Hf="codex-web-local.thread-scroll-state.v1",ka="codex-web-local.selected-thread-id.v1",Vf="codex-web-local.project-order.v1",Wf="codex-web-local.project-display-name.v1",Fi=220,lu=["none","minimal","low","medium","high","xhigh"],As="__global__",ln="gpt-5.2-codex";function nE(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Uf);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function cu(e){typeof window>"u"||window.localStorage.setItem(Uf,JSON.stringify(e))}function qf(e,t,n){return Math.min(Math.max(e,t),n)}function rE(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=qf(t.scrollRatio,0,1)),n}function sE(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Hf);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t)){if(!r)continue;const o=rE(s);o&&(n[r]=o)}return n}catch{return{}}}function uu(e){typeof window>"u"||window.localStorage.setItem(Hf,JSON.stringify(e))}function oE(){return typeof window>"u"?"":window.localStorage.getItem(ka)??""}function iE(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(ka);return}window.localStorage.setItem(ka,e)}}function aE(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Vf);if(!e)return[];const t=JSON.parse(e);if(!Array.isArray(t))return[];const n=[];for(const r of t)typeof r=="string"&&r.length>0&&!n.includes(r)&&n.push(r);return n}catch{return[]}}function Yr(e){typeof window>"u"||window.localStorage.setItem(Vf,JSON.stringify(e))}function lE(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Wf);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t))typeof r=="string"&&r.length>0&&typeof s=="string"&&(n[r]=s);return n}catch{return{}}}function Ui(e){typeof window>"u"||window.localStorage.setItem(Wf,JSON.stringify(e))}function mo(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 Hi(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 cE(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 uE(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function go(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 Ta(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&&uE(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function Vo(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 dE(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&&Ta(f,c)?f:c});if(n.preserveMissing!==!0)return Vo(e,o)?e:o;const i=e.map(c=>{const f=s.get(c.id);return!f||Ta(c,f)?c:f}),a=new Set(e.map(c=>c.id)),l=o.filter(c=>!a.has(c.id)),u=[...i,...l];return Vo(e,u)?e:u}function Ia(e){return e.replace(/\s+/gu," ").trim()}function fE(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>Ia(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=Ia(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function du(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Ta(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const zf="worked";function cr(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function hE(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 pE(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function mE(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 gE(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${hE(e.durationMs)}`,messageType:zf}}function vE(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function yE(e,t){const n=gE(t),r=e.filter(i=>i.messageType!==zf),s=vE(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function Lt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function wE(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 _E(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 Ut(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function vo(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&&wE(u,l)?u:l});return o&&o.projectName===s.projectName&&bE(o.threads,a)?o:{projectName:s.projectName,threads:a}});return _E(e,r)?e:r}function kE(e,t,n){const r=new Set(hr(t).map(a=>a.id)),s=hr(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 TE(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Vi(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function IE(e){const t=e.split(`
|
|
1438
|
-
`).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function SE(){const e=L([]),t=L([]),n=L(oE()),r=L({}),s=L({}),o=L({}),i=L({}),a=L({}),l=L({}),u=L({}),c=L([]),f=L(""),h=L("medium"),b=L(nE()),$=L(sE()),P=L(aE()),H=L(lE()),Y=L({}),D=L({}),W=L({}),j=L({}),ue=L({}),ae=L({}),ve=L({}),_e=L({}),ie=L({}),ne=L({}),Te=L([]),re=L(!1),Le=L(!1),je=L(!1),Xe=L(!1),Ee=L(!1),ke=L(""),Ne=L(!1),ze=L(!1);let rt=null,Ze=null,et=!1;const ht=new Set;let St=!1,Ge=!1;const Ke=new Map,U=new Set,he=fe(()=>hr(e.value)),ce=fe(()=>he.value.find(d=>d.id===n.value)??null),me=fe(()=>$.value[n.value]??null),Oe=fe(()=>{const d=[],p=n.value;return p&&Array.isArray(_e.value[p])&&d.push(..._e.value[p]),Array.isArray(_e.value[As])&&d.push(..._e.value[As]),d.sort((y,I)=>y.receivedAtIso.localeCompare(I.receivedAtIso))}),g=fe(()=>{var Q;const d=n.value;if(!d)return null;const p=ue.value[d],y=(o.value[d]??"").trim(),I=(((Q=ae.value[d])==null?void 0:Q.message)??"").trim();return!p&&!y&&!I?null:{activityLabel:(p==null?void 0:p.label)||"Thinking",activityDetails:(p==null?void 0:p.details)??[],reasoningText:y,errorText:I}}),v=fe(()=>{const d=n.value;if(!d)return[];const p=r.value[d]??[],y=s.value[d]??[],I=i.value[d]??[],Q=[...p,...I,...y],J=j.value[d];return J?yE(Q,J):Q});function S(d){n.value!==d&&(n.value=d,iE(d),Ge=!1)}function B(d){f.value=d.trim()}async function q(){f.value=ln,c.value.includes(ln)||(c.value=[...c.value,ln]);try{await Yb(ln)}catch{}}function V(d,p){ie.value={...ie.value,[d]:p}}function Z(d){ie.value[d]&&(ie.value=Lt(ie.value,d))}async function R(d){if(U.has(d))return;const p=ie.value[d];if(!(!p||p.fallbackRetried)){U.add(d),V(d,{...p,fallbackRetried:!0});try{await q();try{const y=await Ac(d,1);lt(d,y),yt(d,[]),Dt(d),i.value[d]&&(i.value=Lt(i.value,d))}catch{}z(d,null),ke.value="",Ce(d,null),F(d,{label:"Thinking",details:N(ln,p.effort)}),Je(d,!0),W.value[d]!==!0&&await Pi(d),await xi(d,p.text,p.imageUrls,ln,p.effort||void 0,p.skills.length>0?p.skills:void 0,p.fileAttachments),W.value={...W.value,[d]:!0},ht.add(d),et=!0,await Ar()}catch(y){const I=y instanceof Error?y.message:"Unknown application error";z(d,I),ke.value=I,Je(d,!1),F(d,null)}finally{U.delete(d)}}}function x(d){d&&!lu.includes(d)||(h.value=d)}function N(d,p){const y=d.trim()||"default",I=p||"default";return[`Model: ${y}`,`Thinking: ${I}`]}async function te(){try{const[d,p]=await Promise.all([Qb(),Xb()]);c.value=d,f.value.length>0&&d.includes(f.value)||(p.model&&d.includes(p.model)?f.value=p.model:d.length>0?f.value=d[0]:f.value=""),p.reasoningEffort&&lu.includes(p.reasoningEffort)&&(h.value=p.reasoningEffort)}catch{}}function X(d){const p=ne.value;return Object.keys(p).length===0?d:d.map(y=>({projectName:y.projectName,threads:y.threads.map(I=>{const Q=p[I.id];return Q?{...I,title:Q}:I})}))}function oe(){const p=X(t.value).map(y=>({projectName:y.projectName,threads:y.threads.map(I=>{const Q=a.value[I.id]===!0,J=n.value===I.id,be=b.value[I.id],xe=u.value[I.id]===!0,we=!J&&!Q&&(xe||be!==I.updatedAtIso);return{...I,inProgress:Q,unread:we}})}));e.value=vo(e.value,p)}function ye(d,p,y){const I=new Date().toISOString(),Q=p.trim(),J=TE(Q),be={id:d,title:IE(y),projectName:J,cwd:Q,hasWorktree:Q.includes("/.codex/worktrees/")||Q.includes("/.git/worktrees/"),createdAtIso:I,updatedAtIso:I,preview:y,unread:!1,inProgress:!1},xe=t.value.findIndex(st=>st.projectName===J);if(xe>=0){const kt=t.value[xe].threads.filter(or=>or.id!==d),Kr={projectName:J,threads:[be,...kt]},Ln=[...t.value];Ln.splice(xe,1,Kr),t.value=Ln}else t.value=[{projectName:J,threads:[be]},...t.value];const we=mo(P.value,t.value);jr(P.value,we)||(P.value=we,Yr(P.value)),oe()}function Se(d){const p=new Set(d.map(J=>J.id)),y=Ut(b.value,p);y!==b.value&&(b.value=y,cu(y));const I=Ut($.value,p);I!==$.value&&($.value=I,uu(I)),D.value=Ut(D.value,p),Y.value=Ut(Y.value,p),W.value=Ut(W.value,p),r.value=Ut(r.value,p),s.value=Ut(s.value,p),o.value=Ut(o.value,p),i.value=Ut(i.value,p),j.value=Ut(j.value,p),ue.value=Ut(ue.value,p),ae.value=Ut(ae.value,p),ve.value=Ut(ve.value,p),u.value=Ut(u.value,p),a.value=Ut(a.value,p);const Q={};for(const[J,be]of Object.entries(_e.value))(J===As||p.has(J))&&(Q[J]=be);_e.value=Q}function Ye(d){const p=hr(t.value).find(y=>y.id===d);p&&(b.value={...b.value,[d]:p.updatedAtIso},cu(b.value),u.value[d]&&(u.value=Lt(u.value,d)),oe())}function Ce(d,p){if(!d)return;const y=j.value[d];if(p){if(pE(y,p))return;j.value={...j.value,[d]:p}}else y&&(j.value=Lt(j.value,d))}function Je(d,p){!d||a.value[d]===!0===p||(p?a.value={...a.value,[d]:!0}:a.value=Lt(a.value,d),oe())}function ot(d){d&&d!==n.value&&u.value[d]!==!0&&(u.value={...u.value,[d]:!0},oe())}function F(d,p){if(!d)return;const y=ue.value[d];if(!p){y&&(ue.value=Lt(ue.value,d));return}const I=ge(p.label)||"Thinking",Q=p.details.map(xe=>ge(xe)).filter(xe=>xe.length>0&&xe!==I),J=Array.from(new Set([...(y==null?void 0:y.details)??[],...Q])).slice(-3),be={label:I,details:J};mE(y,be)||(ue.value={...ue.value,[d]:be})}function z(d,p){if(!d)return;const y=ae.value[d],I=p?Ia(p):"";if(!I){y&&(ae.value=Lt(ae.value,d));return}(y==null?void 0:y.message)!==I&&(ae.value={...ae.value,[d]:{message:I}})}function se(d){const p=hr(t.value).find(y=>y.id===d);return(p==null?void 0:p.updatedAtIso)??""}function Qe(d,p){if(!d)return;const y={scrollTop:Math.max(0,p.scrollTop),isAtBottom:p.isAtBottom===!0};typeof p.scrollRatio=="number"&&Number.isFinite(p.scrollRatio)&&(y.scrollRatio=qf(p.scrollRatio,0,1));const I=$.value[d];I&&I.scrollTop===y.scrollTop&&I.isAtBottom===y.isAtBottom&&I.scrollRatio===y.scrollRatio||($.value={...$.value,[d]:y},uu($.value))}function lt(d,p){const y=r.value[d]??[];Vo(y,p)||(r.value={...r.value,[d]:p})}function yt(d,p){const y=s.value[d]??[];Vo(y,p)||(s.value={...s.value,[d]:p})}function At(d,p){const y=s.value[d]??[],I=du(y,p);yt(d,I)}function dn(d,p){if(!d)return;const y=p.trim(),I=o.value[d]??"";if(y.length===0){if(!I)return;o.value=Lt(o.value,d);return}I!==y&&(o.value={...o.value,[d]:y})}function bn(d,p){if(!d)return;const y=o.value[d]??"";dn(d,`${y}${p}`)}function Dt(d){d&&d in o.value&&(o.value=Lt(o.value,d))}function Fe(d){return d!==null&&typeof d=="object"&&!Array.isArray(d)?d:null}function Re(d){return typeof d=="string"?d:""}function _n(d){return typeof d=="number"&&Number.isFinite(d)?d:null}function Gt(d){const p=Fe(d.params);if(!p)return"";const y=Re(p.threadId);if(y)return y;const I=Re(p.thread_id);if(I)return I;const Q=Re(p.conversationId);if(Q)return Q;const J=Re(p.conversation_id);if(J)return J;const be=Fe(p.thread),xe=Re(be==null?void 0:be.id);if(xe)return xe;const we=Fe(p.turn),st=Re(we==null?void 0:we.threadId);if(st)return st;const kt=Re(we==null?void 0:we.thread_id);return kt||""}function kn(d){if(d.method!=="turn/completed")return"";const p=Fe(d.params),y=Fe(p==null?void 0:p.turn);if(!y||y.status!=="failed")return"";const I=Fe(y.error);return Re(I==null?void 0:I.message)}function Nn(d){var y;if(d.method!=="error")return"";const p=Fe(d.params);return Re(p==null?void 0:p.message)||Re((y=Fe(p==null?void 0:p.error))==null?void 0:y.message)}function _(d){const p=Fe(d);if(!p)return null;const y=p.id,I=Re(p.method),Q=p.params;if(typeof y!="number"||!Number.isInteger(y)||!I)return null;const J=Fe(Q),be=Re(J==null?void 0:J.threadId)||As,xe=Re(J==null?void 0:J.turnId),we=Re(J==null?void 0:J.itemId),st=Re(p.receivedAtIso)||new Date().toISOString();return{id:y,method:I,threadId:be,turnId:xe,itemId:we,receivedAtIso:st,params:Q??null}}function E(d){const p=d.threadId||As,y=_e.value[p]??[],I=y.findIndex(J=>J.id===d.id),Q=[...y];I>=0?Q.splice(I,1,d):Q.push(d),_e.value={..._e.value,[p]:Q.sort((J,be)=>J.receivedAtIso.localeCompare(be.receivedAtIso))}}function C(d){const p={};for(const[y,I]of Object.entries(_e.value)){const Q=I.filter(J=>J.id!==d);Q.length>0&&(p[y]=Q)}_e.value=p}function K(d){if(d.method==="server/request"){const p=_(d.params);return p&&E(p),!0}if(d.method==="server/request/resolved"){const p=Fe(d.params),y=p==null?void 0:p.id;return typeof y=="number"&&Number.isInteger(y)&&C(y),!0}return!1}function ge(d){return d.replace(/\s+/gu," ").trim()}function pe(d){const p=Gt(d);if(!p)return null;if(d.method==="turn/started")return{threadId:p,activity:{label:"Thinking",details:[]}};if(d.method==="item/started"){const y=Fe(d.params),I=Fe(y==null?void 0:y.item),Q=Re(I==null?void 0:I.type).toLowerCase();if(Q==="reasoning")return{threadId:p,activity:{label:"Thinking",details:[]}};if(Q==="agentmessage")return{threadId:p,activity:{label:"Writing response",details:[]}};if(Q==="commandexecution"){const J=Re(I==null?void 0:I.command);return{threadId:p,activity:{label:"Running command",details:J?[J]:[]}}}}return d.method==="item/commandExecution/outputDelta"?{threadId:p,activity:{label:"Running command",details:[]}}:d.method==="item/reasoning/summaryTextDelta"||d.method==="item/reasoning/summaryPartAdded"?{threadId:p,activity:{label:"Thinking",details:[]}}:d.method==="item/agentMessage/delta"?{threadId:p,activity:{label:"Writing response",details:[]}}:null}function Me(d){if(d.method!=="turn/started")return null;const p=Fe(d.params);if(!p)return null;const y=Gt(d);if(!y)return null;const I=Fe(p.turn),Q=Re(I==null?void 0:I.id)||Re(p.turnId)||`${y}:unknown`;if(!Q)return null;const J=cr(Re(I==null?void 0:I.startedAt))??cr(Re(p.startedAt))??cr(d.atIso)??Date.now();return{threadId:y,turnId:Q,startedAtMs:J}}function Pe(d){if(d.method!=="turn/completed")return null;const p=Fe(d.params);if(!p)return null;const y=Gt(d);if(!y)return null;const I=Fe(p.turn),Q=Re(I==null?void 0:I.id)||Re(p.turnId)||`${y}:unknown`;if(!Q)return null;const J=cr(Re(I==null?void 0:I.completedAt))??cr(Re(p.completedAt))??cr(d.atIso)??Date.now(),be=cr(Re(I==null?void 0:I.startedAt))??cr(Re(p.startedAt))??void 0;return{threadId:y,turnId:Q,completedAtMs:J,startedAtMs:be}}function We(d){return`${d}:live-reasoning`}function it(d){const p=Fe(d.params);if(!p)return"";if(d.method==="item/started"){const y=Fe(p.item);return!y||y.type!=="reasoning"?"":Re(y.id)}return""}function at(d){const p=Fe(d.params);if(!p)return null;if(d.method==="item/reasoning/summaryTextDelta"){const y=Re(p.itemId),I=Re(p.delta);return!y||!I?null:{messageId:We(y),delta:I}}return null}function Ot(d){const p=Fe(d.params);if(!p)return"";if(d.method==="item/reasoning/summaryPartAdded"){const y=Re(p.itemId);return y?We(y):""}return""}function Rt(d){const p=Fe(d.params);if(!p)return"";if(d.method==="item/completed"){const y=Fe(p.item);return!y||y.type!=="reasoning"?"":We(Re(y.id))}return""}function nn(d){const p=Fe(d.params);if(!p)return"";if(d.method==="item/started"){const y=Fe(p.item);return!y||y.type!=="agentMessage"?"":Re(y.id)}return""}function $n(d){const p=Fe(d.params);if(!p)return null;if(d.method==="item/agentMessage/delta"){const y=Re(p.itemId),I=Re(p.delta);return!y||!I?null:{messageId:y,delta:I}}return null}function ys(d){const p=Fe(d.params);if(!p)return null;if(d.method==="item/completed"){const y=Fe(p.item);if(!y||y.type!=="agentMessage")return null;const I=Re(y.id),Q=Re(y.text);return!I||!Q?null:{id:I,role:"assistant",text:Q,messageType:"agentMessage.live"}}return null}function Tr(d){if(d.method!=="item/started")return null;const p=Fe(d.params),y=Fe(p==null?void 0:p.item);if(!y||y.type!=="commandExecution")return null;const I=Re(y.id),Q=Re(y.command);if(!I)return null;const J=typeof y.cwd=="string"?y.cwd:null;return{id:I,role:"system",text:Q,messageType:"commandExecution",commandExecution:{command:Q,cwd:J,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function zr(d){if(d.method!=="item/commandExecution/outputDelta")return null;const p=Fe(d.params);if(!p)return null;const y=Re(p.itemId),I=Re(p.delta);return!y||!I?null:{itemId:y,delta:I}}function Ir(d){if(d.method!=="item/completed")return null;const p=Fe(d.params),y=Fe(p==null?void 0:p.item);if(!y||y.type!=="commandExecution")return null;const I=Re(y.id),Q=Re(y.command);if(!I)return null;const J=typeof y.cwd=="string"?y.cwd:null,be=Re(y.status),xe=be==="failed"?"failed":be==="declined"?"declined":be==="interrupted"?"interrupted":"completed",we=typeof y.aggregatedOutput=="string"?y.aggregatedOutput:"",st=typeof y.exitCode=="number"?y.exitCode:null;return{id:I,role:"system",text:Q,messageType:"commandExecution",commandExecution:{command:Q,cwd:J,status:xe,aggregatedOutput:we,exitCode:st}}}function sr(d,p){const y=i.value[d]??[],I=du(y,p);I!==y&&(i.value={...i.value,[d]:I})}function Gr(d,p){const y=i.value[d];if(!y||y.length===0)return;const I=new Set(p.map(J=>J.id)),Q=y.filter(J=>!I.has(J.id));Q.length!==y.length&&(Q.length===0?i.value=Lt(i.value,d):i.value={...i.value,[d]:Q})}function Dn(d){if(d.method==="item/agentMessage/delta")return!0;const p=Fe(d.params);if(!p)return!1;if(d.method==="item/completed"){const y=Fe(p.item);return(y==null?void 0:y.type)==="agentMessage"}return!1}function ws(d){var ul,dl,fl,hl;if(K(d))return;if(d.method==="thread/name/updated"){const qe=Fe(d.params),Tn=Re(qe==null?void 0:qe.threadId),Rr=Re(qe==null?void 0:qe.threadName);Tn&&Rr&&(ne.value={...ne.value,[Tn]:Rr},oe(),Mi(Tn,Rr))}const p=pe(d);p&&F(p.threadId,p.activity);const y=Me(d);y&&(Ke.set(y.turnId,y),ve.value={...ve.value,[y.threadId]:y.turnId},Ce(y.threadId,null),z(y.threadId,null),Je(y.threadId,!0),u.value[y.threadId]&&(u.value=Lt(u.value,y.threadId)));const I=Pe(d),Q=kn(d),be=!!((I==null?void 0:I.threadId)??Gt(d))&&!!Q&&f.value!==ln&&go(new Error(Q));if(I){const qe=Ke.get(I.turnId);qe&&Ke.delete(I.turnId);const Tn=_n((ul=Fe(d.params))==null?void 0:ul.durationMs)??_n((fl=Fe((dl=Fe(d.params))==null?void 0:dl.turn))==null?void 0:fl.durationMs)??(typeof I.startedAtMs=="number"?I.completedAtMs-I.startedAtMs:null)??(qe?I.completedAtMs-qe.startedAtMs:null),Rr=typeof Tn=="number"?Math.max(0,Tn):0;Ce(I.threadId,{turnId:I.turnId,durationMs:Rr}),ve.value[I.threadId]&&(ve.value=Lt(ve.value,I.threadId)),Je(I.threadId,!1),F(I.threadId,null),ot(I.threadId),be||(Z(I.threadId),M(I.threadId))}if(Q){const qe=(I==null?void 0:I.threadId)||Gt(d);qe&&z(qe,Q),ke.value=Q,qe&&be&&R(qe)}else I&&z(I.threadId,null);const xe=Nn(d);if(xe){const qe=Gt(d);qe&&z(qe,xe),ke.value=xe,f.value!==ln&&go(new Error(xe))&&(qe?R(qe):q())}const we=Gt(d);if(!we||we!==n.value)return;nn(d);const st=$n(d);if(st){const qe=(s.value[we]??[]).find(Rr=>Rr.id===st.messageId),Tn=`${(qe==null?void 0:qe.text)??""}${st.delta}`;At(we,{id:st.messageId,role:"assistant",text:Tn,messageType:"agentMessage.live"})}const kt=ys(d);kt&&At(we,kt),it(d);const Kr=at(d);if(Kr&&bn(we,Kr.delta),Ot(d)){const qe=o.value[we]??"";qe.trim().length>0&&!qe.endsWith(`
|
|
1439
|
-
|
|
1440
|
-
`)&&dn(we,`${qe}
|
|
1441
|
-
|
|
1442
|
-
`)}Rt(d);const or=Tr(d);or&&(sr(we,or),F(we,{label:"Running command",details:[((hl=or.commandExecution)==null?void 0:hl.command)??""]}));const di=zr(d);if(di){const qe=(i.value[we]??[]).find(Tn=>Tn.id===di.itemId);qe!=null&&qe.commandExecution&&sr(we,{...qe,commandExecution:{...qe.commandExecution,aggregatedOutput:`${qe.commandExecution.aggregatedOutput}${di.delta}`}})}const cl=Ir(d);if(cl&&sr(we,cl),Dn(d)&&(Ge&&n.value&&Qe(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),Dt(we)),d.method==="turn/completed"){Ge=!1,Dt(we),i.value[we]&&(i.value=Lt(i.value,we));const qe=Gt(d);qe&&(Je(qe,!1),F(qe,null),ot(qe),be||(Z(qe),M(qe)))}}function bs(d){const p=Gt(d);p&&ht.add(p);const y=d.method;(y.startsWith("thread/")||y.startsWith("turn/")||y.startsWith("item/"))&&(et=!0),!(Ze!==null||typeof window>"u")&&(Ze=window.setTimeout(()=>{Ze=null,Ar()},Fi))}async function _s(d){if(!St){St=!0;try{const p=await da(),y=[];for(const I of p.order){const Q=Vi(I);y.includes(Q)||y.push(Q)}if(y.length>0){const I=mo(y,d);jr(P.value,I)||(P.value=I,Yr(P.value))}if(Object.keys(p.labels).length>0){const I={...H.value};let Q=!1;for(const[J,be]of Object.entries(p.labels)){const xe=Vi(J);I[xe]!==be&&(I[xe]=be,Q=!0)}Q&&(H.value=I,Ui(I))}}catch{}}}async function Sr(){if(!(Object.keys(ne.value).length>0))try{const d=await i_();Object.keys(d.titles).length>0&&(ne.value=d.titles)}catch{}}async function ks(d,p,y){if(ne.value[d])return;const I=p.trim();if(!I)return;const Q=I.length>300?I.slice(0,300):I;try{const J=await a_(Q,y);if(!J||ne.value[d])return;ne.value={...ne.value,[d]:J},oe(),Mi(d,J)}catch{}}async function k(){var d;ze.value||(re.value=!0);try{const[p]=await Promise.all([Fb(),Sr()]);await _s(p);const y=mo(P.value,p);jr(P.value,y)||(P.value=y,Yr(P.value));const I=Hi(p,P.value),Q=kE(t.value,I,a.value);t.value=vo(t.value,Q),a.value=Ut(a.value,new Set(hr(t.value).map(xe=>xe.id))),oe(),ze.value=!0;const J=hr(e.value);Se(J),J.some(xe=>xe.id===n.value)||S(((d=J[0])==null?void 0:d.id)??"")}finally{re.value=!1}}async function A(d,p={}){if(!d)return;const y=D.value[d]===!0,I=p.silent!==!0&&!y;I&&(Le.value=!0);try{W.value[d]!==!0&&(await Pi(d),W.value={...W.value,[d]:!0});const{messages:Q,inProgress:J}=await Ub(d),be=r.value[d]??[],xe=dE(be,Q,{preserveMissing:p.silent===!0});lt(d,xe);const we=s.value[d]??[],st=fE(we,Q);yt(d,st),Gr(d,Q),D.value={...D.value,[d]:!0};const kt=se(d);kt&&(Y.value={...Y.value,[d]:kt}),Je(d,J),Ye(d)}finally{I&&(Le.value=!1)}}async function O(){try{const d=t.value.flatMap(p=>p.threads.map(y=>y.cwd)).filter(Boolean);Te.value=await l_(d.length>0?[...new Set(d)]:void 0)}catch{}}async function G(){ke.value="";try{await k(),await Promise.all([te(),O()]),await A(n.value)}catch(d){ke.value=d instanceof Error?d.message:"Unknown application error"}}async function Ue(d){S(d);try{await A(d)}catch(p){ke.value=p instanceof Error?p.message:"Unknown application error"}}async function Pt(d){try{await qb(d),await k(),n.value===d&&await A(n.value)}catch(p){ke.value=p instanceof Error?p.message:"Unknown application error"}}async function rn(d,p){const y=p.trim();if(!(!d||!y))try{await zb(d,y),ne.value={...ne.value,[d]:y},oe(),Mi(d,y)}catch(I){ke.value=I instanceof Error?I.message:"Unknown application error"}}async function Er(d,p=[],y=[],I="steer",Q=[]){const J=n.value,be=d.trim();if(!J||!be&&p.length===0&&Q.length===0)return;const xe=a.value[J]===!0;if(xe&&I==="queue"){const we=l.value[J]??[],st=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[J]:[...we,{id:st,text:be,imageUrls:p,skills:y,fileAttachments:Q}]};return}if(xe){Ge=!0,Kt(J,be,p,y,Q).catch(we=>{const st=we instanceof Error?we.message:"Unknown application error";z(J,st),ke.value=st});return}ke.value="",Ge=!0,Ce(J,null),F(J,{label:"Thinking",details:N(f.value,h.value)}),z(J,null),Je(J,!0);try{await Kt(J,be,p,y,Q)}catch(we){Ge=!1,Je(J,!1),F(J,null);const st=we instanceof Error?we.message:"Unknown application error";throw z(J,st),ke.value=st,we}}async function Cr(d,p,y=[],I=[],Q=[]){const J=d.trim(),be=p.trim(),xe=f.value.trim();if(!J&&y.length===0&&Q.length===0)return"";je.value=!0,ke.value="";let we="";try{try{we=await Rc(be||void 0,xe||void 0)}catch(Ln){if(xe&&xe!==ln&&go(Ln))await q(),we=await Rc(be||void 0,ln);else throw Ln}if(!we)return"";ye(we,be,J||"[Image]"),W.value={...W.value,[we]:!0},S(we),Ge=!0,Ce(we,null),F(we,{label:"Thinking",details:N(f.value,h.value)}),z(we,null),Je(we,!0);const st=we,kt=be||null,Kr=J;return Kt(we,J,y,I,Q).catch(Ln=>{Ge=!1,Je(we,!1),F(we,null);const or=Ln instanceof Error?Ln.message:"Unknown application error";z(we,or),ke.value=or}).finally(()=>{je.value=!1}),ks(st,Kr,kt),we}catch(st){Ge=!1,we&&(Je(we,!1),F(we,null));const kt=st instanceof Error?st.message:"Unknown application error";throw we&&z(we,kt),ke.value=kt,je.value=!1,st}}async function Kt(d,p,y=[],I=[],Q=[]){const J=f.value.trim(),be=h.value,xe=p.trim(),we=I.map(kt=>({name:kt.name,path:kt.path})),st=Q.map(kt=>({...kt}));V(d,{text:xe,imageUrls:[...y],skills:we,fileAttachments:st,effort:be,fallbackRetried:!1});try{W.value[d]!==!0&&await Pi(d);try{await xi(d,p,y,J||void 0,be||void 0,I.length>0?I:void 0,Q)}catch(kt){if(J&&J!==ln&&go(kt))await q(),V(d,{text:xe,imageUrls:[...y],skills:we,fileAttachments:st,effort:be,fallbackRetried:!0}),await xi(d,p,y,ln,be||void 0,I.length>0?I:void 0,Q);else throw kt}W.value={...W.value,[d]:!0},ht.add(d),et=!0,await Ar()}catch(kt){throw kt}}async function M(d){const p=l.value[d];if(!p||p.length===0)return;const[y,...I]=p;l.value=I.length>0?{...l.value,[d]:I}:Lt(l.value,d),je.value=!0,ke.value="",Ge=!0,Ce(d,null),F(d,{label:"Thinking",details:N(f.value,h.value)}),z(d,null),Je(d,!0);try{await Kt(d,y.text,y.imageUrls,y.skills,y.fileAttachments)}catch{Je(d,!1),F(d,null)}finally{je.value=!1}}async function ee(){const d=n.value;if(!d||a.value[d]!==!0)return;const p=ve.value[d];Xe.value=!0,ke.value="";try{await Jb(d,p),Je(d,!1),F(d,null),z(d,null),ve.value[d]&&(ve.value=Lt(ve.value,d)),ht.add(d),et=!0,await Ar()}catch(y){const I=y instanceof Error?y.message:"Failed to interrupt active turn";z(d,I),ke.value=I}finally{Xe.value=!1}}async function Ae(d){const p=n.value;if(!p||Ee.value)return;const I=(r.value[p]??[]).reduce((J,be)=>typeof be.turnIndex=="number"&&be.turnIndex>J?be.turnIndex:J,-1);if(I<0||d>I)return;const Q=I-d+1;if(!(Q<1)){Ee.value=!0,ke.value="";try{const J=await Ac(p,Q);lt(p,J),yt(p,[]),Dt(p),i.value[p]&&(i.value=Lt(i.value,p)),Ce(p,null),F(p,null),z(p,null),et=!0,await Ar()}catch(J){ke.value=J instanceof Error?J.message:"Failed to rollback thread"}finally{Ee.value=!1}}}function Ct(d,p){d.length===0||(H.value[d]??"")===p||(H.value={...H.value,[d]:p},Ui(H.value))}function Bt(d){var Q;if(d.length===0)return;const p=P.value.filter(J=>J!==d);if(jr(P.value,p)||(P.value=p,Yr(P.value)),t.value=t.value.filter(J=>J.projectName!==d),H.value[d]!==void 0){const J={...H.value};delete J[d],H.value=J,Ui(J)}oe();const y=hr(e.value);Se(y),y.some(J=>J.id===n.value)||S(((Q=y[0])==null?void 0:Q.id)??""),ui()}function Nt(d,p){if(d.length===0||t.value.length===0)return;const y=t.value.map(we=>we.projectName),I=y.indexOf(d);if(I===-1)return;const Q=Math.max(0,Math.min(p,y.length-1)),J=cE(y,I,Q);if(J===y)return;const be=mo(J,t.value);P.value=be,Yr(P.value);const xe=Hi(t.value,P.value);t.value=vo(t.value,xe),oe(),ui()}function Ft(d){const p=d.trim();if(!p)return;const y=[p,...P.value.filter(Q=>Q!==p)];if(jr(P.value,y))return;P.value=y,Yr(P.value);const I=Hi(t.value,P.value);t.value=vo(t.value,I),oe(),ui()}async function ui(){var d,p;try{const y=await da(),I=new Map;for(const be of y.order){const xe=Vi(be);I.has(xe)||I.set(xe,be)}for(const be of t.value){const xe=((p=(d=be.threads[0])==null?void 0:d.cwd)==null?void 0:p.trim())??"";xe&&I.set(be.projectName,xe)}const Q=[];for(const be of P.value){const xe=I.get(be);xe&&!Q.includes(xe)&&Q.push(xe)}for(const be of y.order)Q.includes(be)||Q.push(be);const J=y.active.filter(be=>Q.includes(be));J.length===0&&Q.length>0&&J.push(Q[0]),await t_({order:Q,labels:y.labels,active:J})}catch{}}async function Ar(){if(Ne.value){typeof window<"u"&&Ze===null&&(Ze=window.setTimeout(()=>{Ze=null,Ar()},Fi));return}Ne.value=!0;const d=et,p=new Set(ht);et=!1,ht.clear();try{d&&await k();const y=n.value;if(!y)return;const I=p.has(y),Q=a.value[y]===!0,J=se(y),be=Y.value[y]??"",xe=J.length>0&&J!==be;(I||Q||xe||d)&&await A(y,{silent:!0})}catch{}finally{Ne.value=!1,(et||ht.size>0)&&typeof window<"u"&&Ze===null&&(Ze=window.setTimeout(()=>{Ze=null,Ar()},Fi))}}function Gf(){typeof window>"u"||rt||(Kf(),rt=Hb(d=>{ws(d),bs(d)}))}async function Kf(){try{const d=await Wb();for(const p of d){const y=_(p);y&&E(y)}}catch{}}async function Jf(d){try{await Vb(d.id,{result:d.result,error:d.error}),C(d.id)}catch(p){ke.value=p instanceof Error?p.message:"Failed to reply to server request"}}function Yf(){rt&&(rt(),rt=null),et=!1,ht.clear(),Ke.clear(),Ze!==null&&typeof window<"u"&&(window.clearTimeout(Ze),Ze=null),Ge=!1,r.value={},s.value={},o.value={},i.value={},ue.value={},j.value={},ae.value={},ve.value={},l.value={}}const Qf=fe(()=>{const d=n.value;return d?l.value[d]??[]:[]});function ll(d){const p=n.value;if(!p)return;const y=l.value[p];if(!y)return;const I=y.filter(Q=>Q.id!==d);l.value=I.length>0?{...l.value,[p]:I}:Lt(l.value,p)}function Xf(d){const p=n.value;if(!p)return;const y=l.value[p];if(!y)return;const I=y.find(Q=>Q.id===d);I&&(ll(d),Er(I.text,I.imageUrls,I.skills,"steer",I.fileAttachments))}return{projectGroups:e,projectDisplayNameById:H,selectedThread:ce,selectedThreadScrollState:me,selectedThreadServerRequests:Oe,selectedLiveOverlay:g,selectedThreadId:n,availableModelIds:c,selectedModelId:f,selectedReasoningEffort:h,installedSkills:Te,messages:v,isLoadingThreads:re,isLoadingMessages:Le,isSendingMessage:je,isInterruptingTurn:Xe,error:ke,refreshAll:G,refreshSkills:O,selectThread:Ue,setThreadScrollState:Qe,archiveThreadById:Pt,renameThreadById:rn,sendMessageToSelectedThread:Er,sendMessageToNewThread:Cr,interruptSelectedThreadTurn:ee,rollbackSelectedThread:Ae,isRollingBack:Ee,selectedThreadQueuedMessages:Qf,removeQueuedMessage:ll,steerQueuedMessage:Xf,setSelectedModelId:B,setSelectedReasoningEffort:x,respondToPendingServerRequest:Jf,renameProject:Ct,removeProject:Bt,reorderProject:Nt,pinProjectToTop:Ft,startPolling:Gf,stopPolling:Yf}}const EE={class:"sidebar-root"},CE={class:"sidebar-scrollable"},AE=["aria-pressed"],RE={key:1,class:"sidebar-search-bar"},PE={key:0,class:"sidebar-settings-area"},xE={key:0,class:"sidebar-settings-panel"},ME={class:"sidebar-settings-value"},OE={class:"sidebar-settings-value"},NE={class:"content-root"},$E={class:"content-body"},DE={key:1,class:"content-grid"},LE={class:"new-thread-empty"},jE={class:"worktree-init-status-title"},BE={class:"worktree-init-status-message"},FE={key:2,class:"content-grid"},UE={class:"content-thread"},HE={class:"composer-with-queue"},VE={class:"build-badge","aria-label":"Worktree name and version"},fu="codex-web-local.sidebar-collapsed.v1",hu="codex-web-local.send-with-enter.v1",pu="codex-web-local.in-progress-send-mode.v1",mu="codex-web-local.dark-mode.v1",WE=$t({__name:"App",setup(e){const t="codex-web-local",n="0.1.34",{projectGroups:r,projectDisplayNameById:s,selectedThread:o,selectedThreadScrollState:i,selectedThreadServerRequests:a,selectedLiveOverlay:l,selectedThreadId:u,availableModelIds:c,selectedModelId:f,selectedReasoningEffort:h,installedSkills:b,messages:$,isLoadingThreads:P,isLoadingMessages:H,isInterruptingTurn:Y,refreshAll:D,refreshSkills:W,selectThread:j,setThreadScrollState:ue,archiveThreadById:ae,renameThreadById:ve,sendMessageToSelectedThread:_e,sendMessageToNewThread:ie,interruptSelectedThreadTurn:ne,rollbackSelectedThread:Te,isRollingBack:re,selectedThreadQueuedMessages:Le,removeQueuedMessage:je,steerQueuedMessage:Xe,setSelectedModelId:Ee,setSelectedReasoningEffort:ke,respondToPendingServerRequest:Ne,renameProject:ze,removeProject:rt,reorderProject:Ze,pinProjectToTop:et,startPolling:ht,stopPolling:St}=SE(),Ge=Ng(),Ke=Og(),{isMobile:U}=Wd(),he=L(!1),ce=L(!1),me=L(""),Oe=L("local"),g=L({order:[],labels:{}}),v=L({phase:"idle",title:"",message:""}),S=L(Ue()),B=L(""),q=L(!1),V=L(null),Z=L(null);let R=null;const x=L("New Project (1)"),N=L(""),te=L(!1),X=L(_s(hu,!0)),oe=L(ks()),ye=L(Sr()),Se=fe(()=>{const M=Ge.params.threadId;return typeof M=="string"?M:""}),Ye=fe(()=>{const M=new Set;for(const ee of r.value)for(const Ae of ee.threads)M.add(Ae.id);return M}),Ce=fe(()=>Ge.name==="home"),Je=fe(()=>Ge.name==="skills"),ot=fe(()=>{var M;return Je.value?"Skills":Ce.value?"New thread":((M=o.value)==null?void 0:M.title)??"Choose a thread"}),F=fe(()=>$.value.filter(M=>{const ee=rn(M.messageType,M.role);return ee==="worked"?!0:!(ee==="turnActivity.live"||ee==="turnError.live"||ee==="agentReasoning.live")})),z=fe(()=>l.value),se=fe(()=>Ce.value?"__new-thread__":u.value),Qe=fe(()=>{var M,ee;return Ce.value?me.value.trim():((ee=(M=o.value)==null?void 0:M.cwd)==null?void 0:ee.trim())??""}),lt=fe(()=>{var M;return!Ce.value&&((M=o.value)==null?void 0:M.inProgress)===!0}),yt=fe(()=>{var Ct,Bt;const M=[],ee=new Set;for(const Nt of g.value.order){const Ft=Nt.trim();!Ft||ee.has(Ft)||(ee.add(Ft),M.push({value:Ft,label:g.value.labels[Ft]||Ir(Ft)}))}for(const Nt of r.value){const Ft=((Bt=(Ct=Nt.threads[0])==null?void 0:Ct.cwd)==null?void 0:Bt.trim())??"";!Ft||ee.has(Ft)||(ee.add(Ft),M.push({value:Ft,label:s.value[Nt.projectName]??Nt.projectName}))}const Ae=me.value.trim();return Ae&&!ee.has(Ae)&&M.unshift({value:Ae,label:Ir(Ae)}),M}),At=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;nr(()=>{window.addEventListener("keydown",Pe),G(),At==null||At.addEventListener("change",G),Er(),ys(),Tr(),nn()}),Zo(()=>{window.removeEventListener("keydown",Pe),At==null||At.removeEventListener("change",G),R&&(clearTimeout(R),R=null),St()}),mt(B,M=>{const ee=M.trim();if(R&&(clearTimeout(R),R=null),!ee){Z.value=null;return}R=setTimeout(()=>{o_(ee,1e3).then(Ae=>{B.value.trim()===ee&&(Z.value=Ae.threadIds)}).catch(()=>{B.value.trim()===ee&&(Z.value=null)})},220)});function dn(){W()}function bn(){q.value=!q.value,q.value?on(()=>{var M;return(M=V.value)==null?void 0:M.focus()}):B.value=""}function Dt(){var M;B.value="",(M=V.value)==null||M.focus()}function Fe(M){M.key==="Escape"&&(q.value=!1,B.value="")}function Re(M){M&&(Ge.name==="thread"&&Se.value===M||(Ke.push({name:"thread",params:{threadId:M}}),U.value&&Me(!0)))}function _n(M){ae(M)}function Gt(M){var Ct,Bt;const ee=r.value.find(Nt=>Nt.projectName===M),Ae=((Bt=(Ct=ee==null?void 0:ee.threads[0])==null?void 0:Ct.cwd)==null?void 0:Bt.trim())??"";Ae&&(me.value=Ae),U.value&&Me(!0),!Ce.value&&Ke.push({name:"home"})}function kn(M){var Ct,Bt;const ee=r.value.find(Nt=>Nt.projectName===M),Ae=((Bt=(Ct=ee==null?void 0:ee.threads[0])==null?void 0:Ct.cwd)==null?void 0:Bt.trim())??"";!Ae||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(Ae)}`,"_blank","noopener,noreferrer")}function Nn(){var ee,Ae;const M=((Ae=(ee=o.value)==null?void 0:ee.cwd)==null?void 0:Ae.trim())??"";M&&(me.value=M),U.value&&Me(!0),!Ce.value&&Ke.push({name:"home"})}function _(M){ze(M.projectName,M.displayName)}function E(M){ve(M.threadId,M.title)}function C(M){rt(M)}function K(M){Ze(M.projectName,M.toIndex)}function ge(M){ue(M.threadId,M.state)}function pe(M){Ne(M)}function Me(M){S.value!==M&&(S.value=M,Pt(M))}function Pe(M){M.defaultPrevented||!M.ctrlKey&&!M.metaKey||M.shiftKey||M.altKey||M.key.toLowerCase()==="b"&&(M.preventDefault(),Me(!S.value))}function We(M){const ee=M.text;if(Ce.value){Kt(ee,M.imageUrls,M.skills,M.fileAttachments);return}_e(ee,M.imageUrls,M.skills,M.mode,M.fileAttachments)}function it(M){me.value=M.trim()}async function at(M){const ee=M.trim();if(!ee)return;const Ae=Rt(ee),Ct=await Ot(),Bt=Ae?ee:sr(Ct,ee);if(Bt)try{const Nt=await n_(Bt,{createIfMissing:!Ae,label:Ae?"":ee});Nt&&(me.value=Nt,et(Ir(Nt)),Tr(),nn())}catch{}}async function Ot(){const M=$n();if(M)return M;try{const ee=await Pc();if(ee)return N.value=ee,ee}catch{}return""}function Rt(M){return M?M.startsWith("~/")||M.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(M):!1}async function nn(){const M=$n();if(!M){x.value="New Project (1)";return}try{const ee=await r_(M);x.value=ee.name||"New Project (1)"}catch{x.value="New Project (1)"}}function $n(){var Ae,Ct;const M=me.value.trim();if(M)return zr(M);const ee=((Ct=(Ae=yt.value[0])==null?void 0:Ae.value)==null?void 0:Ct.trim())??"";return ee?zr(ee):N.value.trim()}async function ys(){try{N.value=await Pc()}catch{N.value=""}}async function Tr(){try{const M=await da();g.value={order:[...M.order],labels:{...M.labels}}}catch{g.value={order:[],labels:{}}}}function zr(M){const ee=M.trim().replace(/\/+$/,"");if(!ee)return"";const Ae=ee.lastIndexOf("/");return Ae<=0?"":ee.slice(0,Ae)}function Ir(M){const ee=M.trim().replace(/\/+$/,"");if(!ee)return"";const Ae=ee.lastIndexOf("/");return Ae<0?ee:ee.slice(Ae+1)}function sr(M,ee){const Ae=M.trim().replace(/\/+$/,""),Ct=ee.trim().replace(/^\/+/,"");return!Ae||!Ct?"":`${Ae}/${Ct}`}function Gr(M){Ee(M)}function Dn(M){ke(M)}function ws(){ne()}function bs(M){Te(M.turnIndex)}function _s(M,ee){if(typeof window>"u")return ee;const Ae=window.localStorage.getItem(M);return Ae===null?ee:Ae==="1"}function Sr(){if(typeof window>"u")return"system";const M=window.localStorage.getItem(mu);return M==="light"||M==="dark"?M:"system"}function ks(){return typeof window>"u"?"queue":window.localStorage.getItem(pu)==="steer"?"steer":"queue"}function k(){X.value=!X.value,window.localStorage.setItem(hu,X.value?"1":"0")}function A(){oe.value=oe.value==="steer"?"queue":"steer",window.localStorage.setItem(pu,oe.value)}function O(){const M=["system","light","dark"],ee=M.indexOf(ye.value);ye.value=M[(ee+1)%M.length],window.localStorage.setItem(mu,ye.value),G()}function G(){const M=document.documentElement;if(ye.value==="dark")M.classList.add("dark");else if(ye.value==="light")M.classList.remove("dark");else{const ee=window.matchMedia("(prefers-color-scheme: dark)").matches;M.classList.toggle("dark",ee)}}function Ue(){return typeof window>"u"?!1:window.localStorage.getItem(fu)==="1"}function Pt(M){typeof window>"u"||window.localStorage.setItem(fu,M?"1":"0")}function rn(M,ee){const Ae=(M??"").trim();return Ae.length>0?Ae:ee.trim()||"message"}async function Er(){await D(),ce.value=!0,await Cr(),ht()}async function Cr(){if(!he.value){he.value=!0;try{if(Ge.name==="home"||Ge.name==="skills"){u.value!==""&&await j("");return}if(Ge.name==="thread"){const M=Se.value;if(!M)return;if(!Ye.value.has(M)){await Ke.replace({name:"home"});return}u.value!==M&&await j(M);return}}finally{he.value=!1}}}mt(()=>[Ge.name,Se.value,P.value,Ye.value.has(Se.value),u.value],async()=>{ce.value&&await Cr()}),mt(()=>u.value,async M=>{if(ce.value&&!he.value&&!(Ce.value||Je.value)){if(!M){Ge.name!=="home"&&await Ke.replace({name:"home"});return}Ge.name==="thread"&&Se.value===M||await Ke.replace({name:"thread",params:{threadId:M}})}}),mt(()=>yt.value,M=>{if(M.length===0){me.value="";return}M.some(Ae=>Ae.value===me.value)||(me.value=M[0].value),nn()},{immediate:!0}),mt(()=>me.value,()=>{v.value={phase:"idle",title:"",message:""},nn()}),mt(()=>Oe.value,M=>{M==="local"&&(v.value={phase:"idle",title:"",message:""})}),mt(()=>Ge.name,M=>{M!=="home"&&(v.value={phase:"idle",title:"",message:""})}),mt(()=>u.value,()=>{v.value={phase:"idle",title:"",message:""}}),mt(U,M=>{M&&!S.value&&Me(!0)});async function Kt(M,ee=[],Ae=[],Ct=[]){try{v.value={phase:"idle",title:"",message:""};let Bt=me.value;if(Oe.value==="worktree"){v.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const Ft=await e_(me.value);Bt=Ft.cwd,me.value=Ft.cwd,v.value={phase:"idle",title:"",message:""}}catch{v.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const Nt=await ie(M,Bt,ee,Ae,Ct);if(!Nt)return;await Ke.replace({name:"thread",params:{threadId:Nt}})}catch{}}return(M,ee)=>(w(),T(He,null,[Ie(Fg,{"is-sidebar-collapsed":S.value,onCloseSidebar:ee[6]||(ee[6]=Ae=>Me(!0))},{sidebar:pt(()=>[m("section",EE,[m("div",CE,[S.value?le("",!0):(w(),vt(au,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":S.value,"show-new-thread-button":!0,onToggleSidebar:ee[0]||(ee[0]=Ae=>Me(!S.value)),onStartNewThread:Nn},{default:pt(()=>[m("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":q.value,"aria-label":"Search threads",title:"Search threads",onClick:bn},[Ie(_a,{class:"sidebar-search-toggle-icon"})],8,AE)]),_:1},8,["is-sidebar-collapsed"])),!S.value&&q.value?(w(),T("div",RE,[Ie(_a,{class:"sidebar-search-bar-icon"}),Qn(m("input",{ref_key:"sidebarSearchInputRef",ref:V,"onUpdate:modelValue":ee[1]||(ee[1]=Ae=>B.value=Ae),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:Fe},null,544),[[Xn,B.value]]),B.value.length>0?(w(),T("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:Dt},[Ie(Ga,{class:"sidebar-search-clear-icon"})])):le("",!0)])):le("",!0),S.value?le("",!0):(w(),T("button",{key:2,class:gt(["sidebar-skills-link",{"is-active":Je.value}]),type:"button",onClick:ee[2]||(ee[2]=Ae=>{$e(Ke).push({name:"skills"}),$e(U)&&Me(!0)})}," Skills Hub ",2)),S.value?le("",!0):(w(),vt(Ey,{key:3,groups:$e(r),"project-display-name-by-id":$e(s),"selected-thread-id":$e(u),"is-loading":$e(P),"search-query":B.value,"search-matched-thread-ids":Z.value,onSelect:Re,onArchive:_n,onStartNewThread:Gt,onRenameProject:_,onBrowseProjectFiles:kn,onRenameThread:E,onRemoveProject:C,onReorderProject:K},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),S.value?le("",!0):(w(),T("div",PE,[Ie(xd,{name:"settings-panel"},{default:pt(()=>[te.value?(w(),T("div",xE,[m("button",{class:"sidebar-settings-row",type:"button",onClick:k},[ee[7]||(ee[7]=m("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),m("span",{class:gt(["sidebar-settings-toggle",{"is-on":!X.value}])},null,2)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:A},[ee[8]||(ee[8]=m("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),m("span",ME,de(oe.value==="steer"?"Steer":"Queue"),1)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:O},[ee[9]||(ee[9]=m("span",{class:"sidebar-settings-label"},"Appearance",-1)),m("span",OE,de(ye.value==="system"?"System":ye.value==="dark"?"Dark":"Light"),1)])])):le("",!0)]),_:1}),m("button",{class:"sidebar-settings-button",type:"button",onClick:ee[3]||(ee[3]=Ae=>te.value=!te.value)},[Ie(tE,{class:"sidebar-settings-icon"}),ee[10]||(ee[10]=m("span",null,"Settings",-1))])]))])]),content:pt(()=>[m("section",NE,[Ie(My,{title:ot.value},{leading:pt(()=>[S.value||$e(U)?(w(),vt(au,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":S.value,"show-new-thread-button":!0,onToggleSidebar:ee[4]||(ee[4]=Ae=>Me(!S.value)),onStartNewThread:Nn},null,8,["is-sidebar-collapsed"])):le("",!0)]),_:1},8,["title"]),m("section",$E,[Je.value?(w(),vt(FS,{key:0,onSkillsChanged:dn})):Ce.value?(w(),T("div",DE,[m("div",LE,[ee[11]||(ee[11]=m("p",{class:"new-thread-hero"},"Let's build",-1)),Ie(fa,{class:"new-thread-folder-dropdown","model-value":me.value,options:yt.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":x.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":it,onAdd:at},null,8,["model-value","options","default-add-value"]),Ie(q0,{class:"new-thread-runtime-dropdown",modelValue:Oe.value,"onUpdate:modelValue":ee[5]||(ee[5]=Ae=>Oe.value=Ae)},null,8,["modelValue"]),v.value.phase!=="idle"?(w(),T("div",{key:0,class:gt(["worktree-init-status",{"is-running":v.value.phase==="running","is-error":v.value.phase==="error"}])},[m("strong",jE,de(v.value.title),1),m("span",BE,de(v.value.message),1)],2)):le("",!0)]),Ie(xc,{"active-thread-id":se.value,cwd:Qe.value,models:$e(c),"selected-model":$e(f),"selected-reasoning-effort":$e(h),skills:$e(b),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":X.value,"in-progress-submit-mode":oe.value,onSubmit:We,"onUpdate:selectedModel":Gr,"onUpdate:selectedReasoningEffort":Dn},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode"])])):(w(),T("div",FE,[m("div",UE,[Ie(mb,{messages:F.value,"is-loading":$e(H),"active-thread-id":se.value,cwd:Qe.value,"scroll-state":$e(i),"live-overlay":z.value,"pending-requests":$e(a),"is-turn-in-progress":lt.value,"is-rolling-back":$e(re),onUpdateScrollState:ge,onRespondServerRequest:pe,onRollback:bs},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),m("div",HE,[Ie(L0,{messages:$e(Le),onSteer:$e(Xe),onDelete:$e(je)},null,8,["messages","onSteer","onDelete"]),Ie(xc,{"active-thread-id":se.value,cwd:Qe.value,models:$e(c),"selected-model":$e(f),"selected-reasoning-effort":$e(h),skills:$e(b),"is-turn-in-progress":lt.value,"is-interrupting-turn":$e(Y),"has-queue-above":$e(Le).length>0,"send-with-enter":X.value,"in-progress-submit-mode":oe.value,onSubmit:We,"onUpdate:selectedModel":Gr,"onUpdate:selectedReasoningEffort":Dn,onInterrupt:ws},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","is-turn-in-progress","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),m("div",VE," WT "+de($e(t))+" · v"+de($e(n)),1)],64))}}),qE=nt(WE,[["__scopeId","data-v-1845ee9c"]]),Wi={render:()=>null},zE=Mg({history:ug(),routes:[{path:"/",name:"home",component:Wi},{path:"/thread/:threadId",name:"thread",component:Wi},{path:"/skills",name:"skills",component:Wi},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Tm(qE).use(zE).mount("#app");
|