codexui-android 0.1.102 → 0.1.104
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/DirectoryHub-DKVkrxQJ.css +1 -0
- package/dist/assets/DirectoryHub-R8Bjp_S3.js +2 -0
- package/dist/assets/{ReviewPane-BJuXPOZb.css → ReviewPane-AzgWKh85.css} +1 -1
- package/dist/assets/{ReviewPane-BwJrC8gt.js → ReviewPane-D97Q2j2l.js} +1 -1
- package/dist/assets/ThreadConversation-BptqFdFB.js +39 -0
- package/dist/assets/ThreadConversation-DEwOuZ3c.css +1 -0
- package/dist/assets/{ThreadTerminalPanel-BfzQNi0v.css → ThreadTerminalPanel-BcVTRuCH.css} +1 -1
- package/dist/assets/{ThreadTerminalPanel-CdyQTZa9.js → ThreadTerminalPanel-DMMkfF3u.js} +12 -12
- package/dist/assets/index-CEUy5PY0.css +1 -0
- package/dist/assets/index-Ck3aY8cA.js +63 -0
- package/dist/assets/{index.esm-TywpZG2x.js → index.esm--s_sgTDk.js} +2 -2
- package/dist/assets/{index.esm-BMAgl1KF.js → index.esm-D_uN0D-X.js} +1 -1
- package/dist/assets/{index.esm-O-ekzJz9.js → index.esm-DvadSfWE.js} +2 -2
- package/dist/index.html +2 -2
- package/dist-cli/index.js +1753 -275
- package/dist-cli/index.js.map +1 -1
- package/package.json +2 -2
- package/scripts/fix-pty-native-build.cjs +10 -2
- package/dist/assets/DirectoryHub-CGxQHsSZ.js +0 -2
- package/dist/assets/DirectoryHub-DMVpAtTC.css +0 -1
- package/dist/assets/ThreadConversation-B_1XpSrh.js +0 -39
- package/dist/assets/ThreadConversation-Gd3yNs76.css +0 -1
- package/dist/assets/index-CDFerptZ.css +0 -1
- package/dist/assets/index-Dpl251IF.js +0 -63
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ThreadConversation-B_1XpSrh.js","assets/ThreadConversation-Gd3yNs76.css","assets/ThreadTerminalPanel-CdyQTZa9.js","assets/ThreadTerminalPanel-BfzQNi0v.css","assets/ReviewPane-BwJrC8gt.js","assets/ReviewPane-BJuXPOZb.css","assets/DirectoryHub-CGxQHsSZ.js","assets/DirectoryHub-DMVpAtTC.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();/**
|
|
3
|
-
* @vue/shared v3.5.33
|
|
4
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
-
* @license MIT
|
|
6
|
-
**/function oc(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const jt={},Va=[],mo=()=>{},Yf=()=>!1,Xi=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Zi=e=>e.startsWith("onUpdate:"),mn=Object.assign,ac=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Bm=Object.prototype.hasOwnProperty,Mt=(e,t)=>Bm.call(e,t),Ye=Array.isArray,Wa=e=>Js(e)==="[object Map]",os=e=>Js(e)==="[object Set]",Vc=e=>Js(e)==="[object Date]",ot=e=>typeof e=="function",Vt=e=>typeof e=="string",qr=e=>typeof e=="symbol",Rt=e=>e!==null&&typeof e=="object",Qf=e=>(Rt(e)||ot(e))&&ot(e.then)&&ot(e.catch),Xf=Object.prototype.toString,Js=e=>Xf.call(e),qm=e=>Js(e).slice(8,-1),Zf=e=>Js(e)==="[object Object]",sc=e=>Vt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,$s=oc(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),el=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Hm=/-\w/g,ar=el(e=>e.replace(Hm,t=>t.slice(1).toUpperCase())),zm=/\B([A-Z])/g,Ko=el(e=>e.replace(zm,"-$1").toLowerCase()),tl=el(e=>e.charAt(0).toUpperCase()+e.slice(1)),Xl=el(e=>e?`on${tl(e)}`:""),jr=(e,t)=>!Object.is(e,t),Di=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},eh=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},nl=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Vm=e=>{const t=Vt(e)?Number(e):NaN;return isNaN(t)?e:t};let Wc;const rl=()=>Wc||(Wc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ao(e){if(Ye(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],a=Vt(r)?Jm(r):Ao(r);if(a)for(const o in a)t[o]=a[o]}return t}else if(Vt(e)||Rt(e))return e}const Wm=/;(?![^(]*\))/g,Gm=/:([^]+)/,Km=/\/\*[^]*?\*\//g;function Jm(e){const t={};return e.replace(Km,"").split(Wm).forEach(n=>{if(n){const r=n.split(Gm);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function it(e){let t="";if(Vt(e))t=e;else if(Ye(e))for(let n=0;n<e.length;n++){const r=it(e[n]);r&&(t+=r+" ")}else if(Rt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Ym="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Qm=oc(Ym);function th(e){return!!e||e===""}function Xm(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=as(e[r],t[r]);return n}function as(e,t){if(e===t)return!0;let n=Vc(e),r=Vc(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=qr(e),r=qr(t),n||r)return e===t;if(n=Ye(e),r=Ye(t),n||r)return n&&r?Xm(e,t):!1;if(n=Rt(e),r=Rt(t),n||r){if(!n||!r)return!1;const a=Object.keys(e).length,o=Object.keys(t).length;if(a!==o)return!1;for(const s in e){const l=e.hasOwnProperty(s),c=t.hasOwnProperty(s);if(l&&!c||!l&&c||!as(e[s],t[s]))return!1}}return String(e)===String(t)}function ic(e,t){return e.findIndex(n=>as(n,t))}const nh=e=>!!(e&&e.__v_isRef===!0),N=e=>Vt(e)?e:e==null?"":Ye(e)||Rt(e)&&(e.toString===Xf||!ot(e.toString))?nh(e)?N(e.value):JSON.stringify(e,rh,2):String(e),rh=(e,t)=>nh(t)?rh(e,t.value):Wa(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,a],o)=>(n[Zl(r,o)+" =>"]=a,n),{})}:os(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Zl(n))}:qr(t)?Zl(t):Rt(t)&&!Ye(t)&&!Zf(t)?String(t):t,Zl=(e,t="")=>{var n;return qr(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
|
7
|
-
* @vue/reactivity v3.5.33
|
|
8
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
9
|
-
* @license MIT
|
|
10
|
-
**/let Fn;class Zm{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=Fn,!t&&Fn&&(this.index=(Fn.scopes||(Fn.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=Fn;try{return Fn=this,t()}finally{Fn=n}}}on(){++this._on===1&&(this.prevScope=Fn,Fn=this)}off(){if(this._on>0&&--this._on===0){if(Fn===this)Fn=this.prevScope;else{let t=Fn;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.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 a=this.parent.scopes.pop();a&&a!==this&&(this.parent.scopes[this.index]=a,a.index=this.index)}this.parent=void 0}}}function eg(){return Fn}let Ut;const eu=new WeakSet;class oh{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,Fn&&Fn.active&&Fn.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,eu.has(this)&&(eu.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||sh(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Gc(this),ih(this);const t=Ut,n=Ur;Ut=this,Ur=!0;try{return this.fn()}finally{lh(this),Ut=t,Ur=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)cc(t);this.deps=this.depsTail=void 0,Gc(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?eu.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Mu(this)&&this.run()}get dirty(){return Mu(this)}}let ah=0,Ns,Os;function sh(e,t=!1){if(e.flags|=8,t){e.next=Os,Os=e;return}e.next=Ns,Ns=e}function lc(){ah++}function uc(){if(--ah>0)return;if(Os){let t=Os;for(Os=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Ns;){let t=Ns;for(Ns=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 ih(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function lh(e){let t,n=e.depsTail,r=n;for(;r;){const a=r.prevDep;r.version===-1?(r===n&&(n=a),cc(r),tg(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=a}e.deps=t,e.depsTail=n}function Mu(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(uh(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function uh(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Us)||(e.globalVersion=Us,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Mu(e))))return;e.flags|=2;const t=e.dep,n=Ut,r=Ur;Ut=e,Ur=!0;try{ih(e);const a=e.fn(e._value);(t.version===0||jr(a,e._value))&&(e.flags|=128,e._value=a,t.version++)}catch(a){throw t.version++,a}finally{Ut=n,Ur=r,lh(e),e.flags&=-3}}function cc(e,t=!1){const{dep:n,prevSub:r,nextSub:a}=e;if(r&&(r.nextSub=a,e.prevSub=void 0),a&&(a.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)cc(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function tg(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Ur=!0;const ch=[];function Io(){ch.push(Ur),Ur=!1}function Po(){const e=ch.pop();Ur=e===void 0?!0:e}function Gc(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Ut;Ut=void 0;try{t()}finally{Ut=n}}}let Us=0;class ng{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 dc{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(!Ut||!Ur||Ut===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Ut)n=this.activeLink=new ng(Ut,this),Ut.deps?(n.prevDep=Ut.depsTail,Ut.depsTail.nextDep=n,Ut.depsTail=n):Ut.deps=Ut.depsTail=n,dh(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=Ut.depsTail,n.nextDep=void 0,Ut.depsTail.nextDep=n,Ut.depsTail=n,Ut.deps===n&&(Ut.deps=r)}return n}trigger(t){this.version++,Us++,this.notify(t)}notify(t){lc();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{uc()}}}function dh(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)dh(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Ru=new WeakMap,wa=Symbol(""),$u=Symbol(""),Bs=Symbol("");function Un(e,t,n){if(Ur&&Ut){let r=Ru.get(e);r||Ru.set(e,r=new Map);let a=r.get(n);a||(r.set(n,a=new dc),a.map=r,a.key=n),a.track()}}function ko(e,t,n,r,a,o){const s=Ru.get(e);if(!s){Us++;return}const l=c=>{c&&c.trigger()};if(lc(),t==="clear")s.forEach(l);else{const c=Ye(e),f=c&&sc(n);if(c&&n==="length"){const h=Number(r);s.forEach((g,b)=>{(b==="length"||b===Bs||!qr(b)&&b>=h)&&l(g)})}else switch((n!==void 0||s.has(void 0))&&l(s.get(n)),f&&l(s.get(Bs)),t){case"add":c?f&&l(s.get("length")):(l(s.get(wa)),Wa(e)&&l(s.get($u)));break;case"delete":c||(l(s.get(wa)),Wa(e)&&l(s.get($u)));break;case"set":Wa(e)&&l(s.get(wa));break}}uc()}function Ra(e){const t=At(e);return t===e?t:(Un(t,"iterate",Bs),Mr(e)?t:t.map(Hr))}function ol(e){return Un(e=At(e),"iterate",Bs),e}function fo(e,t){return Mo(e)?Qa(ba(e)?Hr(t):t):Hr(t)}const rg={__proto__:null,[Symbol.iterator](){return tu(this,Symbol.iterator,e=>fo(this,e))},concat(...e){return Ra(this).concat(...e.map(t=>Ye(t)?Ra(t):t))},entries(){return tu(this,"entries",e=>(e[1]=fo(this,e[1]),e))},every(e,t){return wo(this,"every",e,t,void 0,arguments)},filter(e,t){return wo(this,"filter",e,t,n=>n.map(r=>fo(this,r)),arguments)},find(e,t){return wo(this,"find",e,t,n=>fo(this,n),arguments)},findIndex(e,t){return wo(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return wo(this,"findLast",e,t,n=>fo(this,n),arguments)},findLastIndex(e,t){return wo(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return wo(this,"forEach",e,t,void 0,arguments)},includes(...e){return nu(this,"includes",e)},indexOf(...e){return nu(this,"indexOf",e)},join(e){return Ra(this).join(e)},lastIndexOf(...e){return nu(this,"lastIndexOf",e)},map(e,t){return wo(this,"map",e,t,void 0,arguments)},pop(){return Ss(this,"pop")},push(...e){return Ss(this,"push",e)},reduce(e,...t){return Kc(this,"reduce",e,t)},reduceRight(e,...t){return Kc(this,"reduceRight",e,t)},shift(){return Ss(this,"shift")},some(e,t){return wo(this,"some",e,t,void 0,arguments)},splice(...e){return Ss(this,"splice",e)},toReversed(){return Ra(this).toReversed()},toSorted(e){return Ra(this).toSorted(e)},toSpliced(...e){return Ra(this).toSpliced(...e)},unshift(...e){return Ss(this,"unshift",e)},values(){return tu(this,"values",e=>fo(this,e))}};function tu(e,t,n){const r=ol(e),a=r[t]();return r!==e&&!Mr(e)&&(a._next=a.next,a.next=()=>{const o=a._next();return o.done||(o.value=n(o.value)),o}),a}const og=Array.prototype;function wo(e,t,n,r,a,o){const s=ol(e),l=s!==e&&!Mr(e),c=s[t];if(c!==og[t]){const g=c.apply(e,o);return l?Hr(g):g}let f=n;s!==e&&(l?f=function(g,b){return n.call(this,fo(e,g),b,e)}:n.length>2&&(f=function(g,b){return n.call(this,g,b,e)}));const h=c.call(s,f,r);return l&&a?a(h):h}function Kc(e,t,n,r){const a=ol(e),o=a!==e&&!Mr(e);let s=n,l=!1;a!==e&&(o?(l=r.length===0,s=function(f,h,g){return l&&(l=!1,f=fo(e,f)),n.call(this,f,fo(e,h),g,e)}):n.length>3&&(s=function(f,h,g){return n.call(this,f,h,g,e)}));const c=a[t](s,...r);return l?fo(e,c):c}function nu(e,t,n){const r=At(e);Un(r,"iterate",Bs);const a=r[t](...n);return(a===-1||a===!1)&&pc(n[0])?(n[0]=At(n[0]),r[t](...n)):a}function Ss(e,t,n=[]){Io(),lc();const r=At(e)[t].apply(e,n);return uc(),Po(),r}const ag=oc("__proto__,__v_isRef,__isVue"),fh=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(qr));function sg(e){qr(e)||(e=String(e));const t=At(this);return Un(t,"has",e),t.hasOwnProperty(e)}class hh{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const a=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!a;if(n==="__v_isReadonly")return a;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(a?o?gg:vh:o?gh:mh).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const s=Ye(t);if(!a){let c;if(s&&(c=rg[n]))return c;if(n==="hasOwnProperty")return sg}const l=Reflect.get(t,n,qn(t)?t:r);if((qr(n)?fh.has(n):ag(n))||(a||Un(t,"get",n),o))return l;if(qn(l)){const c=s&&sc(n)?l:l.value;return a&&Rt(c)?Ou(c):c}return Rt(l)?a?Ou(l):al(l):l}}class ph extends hh{constructor(t=!1){super(!1,t)}set(t,n,r,a){let o=t[n];const s=Ye(t)&&sc(n);if(!this._isShallow){const f=Mo(o);if(!Mr(r)&&!Mo(r)&&(o=At(o),r=At(r)),!s&&qn(o)&&!qn(r))return f||(o.value=r),!0}const l=s?Number(n)<t.length:Mt(t,n),c=Reflect.set(t,n,r,qn(t)?t:a);return t===At(a)&&(l?jr(r,o)&&ko(t,"set",n,r):ko(t,"add",n,r)),c}deleteProperty(t,n){const r=Mt(t,n);t[n];const a=Reflect.deleteProperty(t,n);return a&&r&&ko(t,"delete",n,void 0),a}has(t,n){const r=Reflect.has(t,n);return(!qr(n)||!fh.has(n))&&Un(t,"has",n),r}ownKeys(t){return Un(t,"iterate",Ye(t)?"length":wa),Reflect.ownKeys(t)}}class ig extends hh{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const lg=new ph,ug=new ig,cg=new ph(!0);const Nu=e=>e,Ti=e=>Reflect.getPrototypeOf(e);function dg(e,t,n){return function(...r){const a=this.__v_raw,o=At(a),s=Wa(o),l=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,f=a[e](...r),h=n?Nu:t?Qa:Hr;return!t&&Un(o,"iterate",c?$u:wa),mn(Object.create(f),{next(){const{value:g,done:b}=f.next();return b?{value:g,done:b}:{value:l?[h(g[0]),h(g[1])]:h(g),done:b}}})}}function Si(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function fg(e,t){const n={get(a){const o=this.__v_raw,s=At(o),l=At(a);e||(jr(a,l)&&Un(s,"get",a),Un(s,"get",l));const{has:c}=Ti(s),f=t?Nu:e?Qa:Hr;if(c.call(s,a))return f(o.get(a));if(c.call(s,l))return f(o.get(l));o!==s&&o.get(a)},get size(){const a=this.__v_raw;return!e&&Un(At(a),"iterate",wa),a.size},has(a){const o=this.__v_raw,s=At(o),l=At(a);return e||(jr(a,l)&&Un(s,"has",a),Un(s,"has",l)),a===l?o.has(a):o.has(a)||o.has(l)},forEach(a,o){const s=this,l=s.__v_raw,c=At(l),f=t?Nu:e?Qa:Hr;return!e&&Un(c,"iterate",wa),l.forEach((h,g)=>a.call(o,f(h),f(g),s))}};return mn(n,e?{add:Si("add"),set:Si("set"),delete:Si("delete"),clear:Si("clear")}:{add(a){const o=At(this),s=Ti(o),l=At(a),c=!t&&!Mr(a)&&!Mo(a)?l:a;return s.has.call(o,c)||jr(a,c)&&s.has.call(o,a)||jr(l,c)&&s.has.call(o,l)||(o.add(c),ko(o,"add",c,c)),this},set(a,o){!t&&!Mr(o)&&!Mo(o)&&(o=At(o));const s=At(this),{has:l,get:c}=Ti(s);let f=l.call(s,a);f||(a=At(a),f=l.call(s,a));const h=c.call(s,a);return s.set(a,o),f?jr(o,h)&&ko(s,"set",a,o):ko(s,"add",a,o),this},delete(a){const o=At(this),{has:s,get:l}=Ti(o);let c=s.call(o,a);c||(a=At(a),c=s.call(o,a)),l&&l.call(o,a);const f=o.delete(a);return c&&ko(o,"delete",a,void 0),f},clear(){const a=At(this),o=a.size!==0,s=a.clear();return o&&ko(a,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(a=>{n[a]=dg(a,e,t)}),n}function fc(e,t){const n=fg(e,t);return(r,a,o)=>a==="__v_isReactive"?!e:a==="__v_isReadonly"?e:a==="__v_raw"?r:Reflect.get(Mt(n,a)&&a in r?n:r,a,o)}const hg={get:fc(!1,!1)},pg={get:fc(!1,!0)},mg={get:fc(!0,!1)};const mh=new WeakMap,gh=new WeakMap,vh=new WeakMap,gg=new WeakMap;function vg(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function yg(e){return e.__v_skip||!Object.isExtensible(e)?0:vg(qm(e))}function al(e){return Mo(e)?e:hc(e,!1,lg,hg,mh)}function yh(e){return hc(e,!1,cg,pg,gh)}function Ou(e){return hc(e,!0,ug,mg,vh)}function hc(e,t,n,r,a){if(!Rt(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=yg(e);if(o===0)return e;const s=a.get(e);if(s)return s;const l=new Proxy(e,o===2?r:n);return a.set(e,l),l}function ba(e){return Mo(e)?ba(e.__v_raw):!!(e&&e.__v_isReactive)}function Mo(e){return!!(e&&e.__v_isReadonly)}function Mr(e){return!!(e&&e.__v_isShallow)}function pc(e){return e?!!e.__v_raw:!1}function At(e){const t=e&&e.__v_raw;return t?At(t):e}function wg(e){return!Mt(e,"__v_skip")&&Object.isExtensible(e)&&eh(e,"__v_skip",!0),e}const Hr=e=>Rt(e)?al(e):e,Qa=e=>Rt(e)?Ou(e):e;function qn(e){return e?e.__v_isRef===!0:!1}function P(e){return wh(e,!1)}function bg(e){return wh(e,!0)}function wh(e,t){return qn(e)?e:new _g(e,t)}class _g{constructor(t,n){this.dep=new dc,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:At(t),this._value=n?t:Hr(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Mr(t)||Mo(t);t=r?t:At(t),jr(t,n)&&(this._rawValue=t,this._value=r?t:Hr(t),this.dep.trigger())}}function S(e){return qn(e)?e.value:e}const Tg={get:(e,t,n)=>t==="__v_raw"?e:S(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const a=e[t];return qn(a)&&!qn(n)?(a.value=n,!0):Reflect.set(e,t,n,r)}};function bh(e){return ba(e)?e:new Proxy(e,Tg)}class Sg{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new dc(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Us-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Ut!==this)return sh(this,!0),!0}get value(){const t=this.dep.track();return uh(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function kg(e,t,n=!1){let r,a;return ot(e)?r=e:(r=e.get,a=e.set),new Sg(r,a,n)}const ki={},qi=new WeakMap;let ha;function Cg(e,t=!1,n=ha){if(n){let r=qi.get(n);r||qi.set(n,r=[]),r.push(e)}}function xg(e,t,n=jt){const{immediate:r,deep:a,once:o,scheduler:s,augmentJob:l,call:c}=n,f=Z=>a?Z:Mr(Z)||a===!1||a===0?Co(Z,1):Co(Z);let h,g,b,x,j=!1,q=!1;if(qn(e)?(g=()=>e.value,j=Mr(e)):ba(e)?(g=()=>f(e),j=!0):Ye(e)?(q=!0,j=e.some(Z=>ba(Z)||Mr(Z)),g=()=>e.map(Z=>{if(qn(Z))return Z.value;if(ba(Z))return f(Z);if(ot(Z))return c?c(Z,2):Z()})):ot(e)?t?g=c?()=>c(e,2):e:g=()=>{if(b){Io();try{b()}finally{Po()}}const Z=ha;ha=h;try{return c?c(e,3,[x]):e(x)}finally{ha=Z}}:g=mo,t&&a){const Z=g,Ae=a===!0?1/0:a;g=()=>Co(Z(),Ae)}const te=eg(),z=()=>{h.stop(),te&&te.active&&ac(te.effects,h)};if(o&&t){const Z=t;t=(...Ae)=>{Z(...Ae),z()}}let O=q?new Array(e.length).fill(ki):ki;const V=Z=>{if(!(!(h.flags&1)||!h.dirty&&!Z))if(t){const Ae=h.run();if(a||j||(q?Ae.some((Ue,ne)=>jr(Ue,O[ne])):jr(Ae,O))){b&&b();const Ue=ha;ha=h;try{const ne=[Ae,O===ki?void 0:q&&O[0]===ki?[]:O,x];O=Ae,c?c(t,3,ne):t(...ne)}finally{ha=Ue}}}else h.run()};return l&&l(V),h=new oh(g),h.scheduler=s?()=>s(V,!1):V,x=Z=>Cg(Z,!1,h),b=h.onStop=()=>{const Z=qi.get(h);if(Z){if(c)c(Z,4);else for(const Ae of Z)Ae();qi.delete(h)}},t?r?V(!0):O=h.run():s?s(V.bind(null,!0),!0):h.run(),z.pause=h.pause.bind(h),z.resume=h.resume.bind(h),z.stop=z,z}function Co(e,t=1/0,n){if(t<=0||!Rt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,qn(e))Co(e.value,t,n);else if(Ye(e))for(let r=0;r<e.length;r++)Co(e[r],t,n);else if(os(e)||Wa(e))e.forEach(r=>{Co(r,t,n)});else if(Zf(e)){for(const r in e)Co(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Co(e[r],t,n)}return e}/**
|
|
11
|
-
* @vue/runtime-core v3.5.33
|
|
12
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
|
-
* @license MIT
|
|
14
|
-
**/function Ys(e,t,n,r){try{return r?e(...r):e()}catch(a){Qs(a,t,n)}}function zr(e,t,n,r){if(ot(e)){const a=Ys(e,t,n,r);return a&&Qf(a)&&a.catch(o=>{Qs(o,t,n)}),a}if(Ye(e)){const a=[];for(let o=0;o<e.length;o++)a.push(zr(e[o],t,n,r));return a}}function Qs(e,t,n,r=!0){const a=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||jt;if(t){let l=t.parent;const c=t.proxy,f=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const h=l.ec;if(h){for(let g=0;g<h.length;g++)if(h[g](e,c,f)===!1)return}l=l.parent}if(o){Io(),Ys(o,null,10,[e,c,f]),Po();return}}Ag(e,n,a,r,s)}function Ag(e,t,n,r=!0,a=!1){if(a)throw e;console.error(e)}const rr=[];let uo=-1;const Ga=[];let Ho=null,La=0;const _h=Promise.resolve();let Hi=null;function an(e){const t=Hi||_h;return e?t.then(this?e.bind(this):e):t}function Eg(e){let t=uo+1,n=rr.length;for(;t<n;){const r=t+n>>>1,a=rr[r],o=qs(a);o<e||o===e&&a.flags&2?t=r+1:n=r}return t}function mc(e){if(!(e.flags&1)){const t=qs(e),n=rr[rr.length-1];!n||!(e.flags&2)&&t>=qs(n)?rr.push(e):rr.splice(Eg(t),0,e),e.flags|=1,Th()}}function Th(){Hi||(Hi=_h.then(kh))}function Ig(e){Ye(e)?Ga.push(...e):Ho&&e.id===-1?Ho.splice(La+1,0,e):e.flags&1||(Ga.push(e),e.flags|=1),Th()}function Jc(e,t,n=uo+1){for(;n<rr.length;n++){const r=rr[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;rr.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Sh(e){if(Ga.length){const t=[...new Set(Ga)].sort((n,r)=>qs(n)-qs(r));if(Ga.length=0,Ho){Ho.push(...t);return}for(Ho=t,La=0;La<Ho.length;La++){const n=Ho[La];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Ho=null,La=0}}const qs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function kh(e){try{for(uo=0;uo<rr.length;uo++){const t=rr[uo];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Ys(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;uo<rr.length;uo++){const t=rr[uo];t&&(t.flags&=-2)}uo=-1,rr.length=0,Sh(),Hi=null,(rr.length||Ga.length)&&kh()}}let En=null,Ch=null;function zi(e){const t=En;return En=e,Ch=e&&e.type.__scopeId||null,t}function ct(e,t=En,n){if(!t||e._n)return e;const r=(...a)=>{r._d&&Gi(-1);const o=zi(t);let s;try{s=e(...a)}finally{zi(o),r._d&&Gi(1)}return s};return r._n=!0,r._c=!0,r._d=!0,r}function cn(e,t){if(En===null)return e;const n=cl(En),r=e.dirs||(e.dirs=[]);for(let a=0;a<t.length;a++){let[o,s,l,c=jt]=t[a];o&&(ot(o)&&(o={mounted:o,updated:o}),o.deep&&Co(s),r.push({dir:o,instance:n,value:s,oldValue:void 0,arg:l,modifiers:c}))}return e}function ua(e,t,n,r){const a=e.dirs,o=t&&t.dirs;for(let s=0;s<a.length;s++){const l=a[s];o&&(l.oldValue=o[s].value);let c=l.dir[r];c&&(Io(),zr(c,n,8,[e.el,l,e,t]),Po())}}function Li(e,t){if(An){let n=An.provides;const r=An.parent&&An.parent.provides;r===n&&(n=An.provides=Object.create(r)),n[e]=t}}function Br(e,t,n=!1){const r=Tc();if(r||Ja){let a=Ja?Ja._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(a&&e in a)return a[e];if(arguments.length>1)return n&&ot(t)?t.call(r&&r.proxy):t}}const Pg=Symbol.for("v-scx"),Mg=()=>Br(Pg);function gt(e,t,n){return xh(e,t,n)}function xh(e,t,n=jt){const{immediate:r,deep:a,flush:o,once:s}=n,l=mn({},n),c=t&&r||!t&&o!=="post";let f;if(Za){if(o==="sync"){const x=Mg();f=x.__watcherHandles||(x.__watcherHandles=[])}else if(!c){const x=()=>{};return x.stop=mo,x.resume=mo,x.pause=mo,x}}const h=An;l.call=(x,j,q)=>zr(x,h,j,q);let g=!1;o==="post"?l.scheduler=x=>{tr(x,h&&h.suspense)}:o!=="sync"&&(g=!0,l.scheduler=(x,j)=>{j?x():mc(x)}),l.augmentJob=x=>{t&&(x.flags|=4),g&&(x.flags|=2,h&&(x.id=h.uid,x.i=h))};const b=xg(e,t,l);return Za&&(f?f.push(b):c&&b()),b}function Rg(e,t,n){const r=this.proxy,a=Vt(e)?e.includes(".")?Ah(r,e):()=>r[e]:e.bind(r,r);let o;ot(t)?o=t:(o=t.handler,n=t);const s=Zs(this),l=xh(a,o.bind(r),n);return s(),l}function Ah(e,t){const n=t.split(".");return()=>{let r=e;for(let a=0;a<n.length&&r;a++)r=r[n[a]];return r}}const qo=new WeakMap,Eh=Symbol("_vte"),Ih=e=>e.__isTeleport,ma=e=>e&&(e.disabled||e.disabled===""),$g=e=>e&&(e.defer||e.defer===""),Yc=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Qc=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Du=(e,t)=>{const n=e&&e.to;return Vt(n)?t?t(n):null:n},Ng={name:"Teleport",__isTeleport:!0,process(e,t,n,r,a,o,s,l,c,f){const{mc:h,pc:g,pbc:b,o:{insert:x,querySelector:j,createText:q,createComment:te,parentNode:z}}=f,O=ma(t.props);let{dynamicChildren:V}=t;const Z=(ne,Se,Y)=>{ne.shapeFlag&16&&h(ne.children,Se,Y,a,o,s,l,c)},Ae=(ne=t)=>{const Se=ma(ne.props),Y=ne.target=Du(ne.props,j),Ee=Lu(Y,ne,q,x);Y&&(s!=="svg"&&Yc(Y)?s="svg":s!=="mathml"&&Qc(Y)&&(s="mathml"),a&&a.isCE&&(a.ce._teleportTargets||(a.ce._teleportTargets=new Set)).add(Y),Se||(Z(ne,Y,Ee),Es(ne,!1)))},Ue=ne=>{const Se=()=>{if(qo.get(ne)===Se){if(qo.delete(ne),ma(ne.props)){const Y=z(ne.el)||n;Z(ne,Y,ne.anchor),Es(ne,!0)}Ae(ne)}};qo.set(ne,Se),tr(Se,o)};if(e==null){const ne=t.el=q(""),Se=t.anchor=q("");if(x(ne,n,r),x(Se,n,r),$g(t.props)||o&&o.pendingBranch){Ue(t);return}O&&(Z(t,n,Se),Es(t,!0)),Ae()}else{t.el=e.el;const ne=t.anchor=e.anchor,Se=qo.get(e);if(Se){Se.flags|=8,qo.delete(e),Ue(t);return}t.targetStart=e.targetStart;const Y=t.target=e.target,Ee=t.targetAnchor=e.targetAnchor,He=ma(e.props),ee=He?n:Y,we=He?ne:Ee;if(s==="svg"||Yc(Y)?s="svg":(s==="mathml"||Qc(Y))&&(s="mathml"),V?(b(e.dynamicChildren,V,ee,a,o,s,l),bc(e,t,!0)):c||g(e,t,ee,we,a,o,s,l,!1),O)He?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Ci(t,n,ne,f,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Re=t.target=Du(t.props,j);Re&&Ci(t,Re,null,f,0)}else He&&Ci(t,Y,Ee,f,1);Es(t,O)}},remove(e,t,n,{um:r,o:{remove:a}},o){const{shapeFlag:s,children:l,anchor:c,targetStart:f,targetAnchor:h,target:g,props:b}=e;let x=o||!ma(b);const j=qo.get(e);if(j&&(j.flags|=8,qo.delete(e),x=!1),g&&(a(f),a(h)),o&&a(c),s&16)for(let q=0;q<l.length;q++){const te=l[q];r(te,t,n,x,!!te.dynamicChildren)}},move:Ci,hydrate:Og};function Ci(e,t,n,{o:{insert:r},m:a},o=2){o===0&&r(e.targetAnchor,t,n);const{el:s,anchor:l,shapeFlag:c,children:f,props:h}=e,g=o===2;if(g&&r(s,t,n),!qo.has(e)&&(!g||ma(h))&&c&16)for(let b=0;b<f.length;b++)a(f[b],t,n,2);g&&r(l,t,n)}function Og(e,t,n,r,a,o,{o:{nextSibling:s,parentNode:l,querySelector:c,insert:f,createText:h}},g){function b(te,z){let O=z;for(;O;){if(O&&O.nodeType===8){if(O.data==="teleport start anchor")t.targetStart=O;else if(O.data==="teleport anchor"){t.targetAnchor=O,te._lpa=t.targetAnchor&&s(t.targetAnchor);break}}O=s(O)}}function x(te,z){z.anchor=g(s(te),z,l(te),n,r,a,o)}const j=t.target=Du(t.props,c),q=ma(t.props);if(j){const te=j._lpa||j.firstChild;t.shapeFlag&16&&(q?(x(e,t),b(j,te),t.targetAnchor||Lu(j,t,h,f,l(e)===j?e:null)):(t.anchor=s(e),b(j,te),t.targetAnchor||Lu(j,t,h,f),g(te&&s(te),t,j,n,r,a,o))),Es(t,q)}else q&&t.shapeFlag&16&&(x(e,t),t.targetStart=e,t.targetAnchor=s(e));return t.anchor&&s(t.anchor)}const va=Ng;function Es(e,t){const n=e.ctx;if(n&&n.ut){let r,a;for(t?(r=e.el,a=e.anchor):(r=e.targetStart,a=e.targetAnchor);r&&r!==a;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function Lu(e,t,n,r,a=null){const o=t.targetStart=n(""),s=t.targetAnchor=n("");return o[Eh]=s,e&&(r(o,e,a),r(s,e,a)),s}const co=Symbol("_leaveCb"),ks=Symbol("_enterCb");function Dg(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Jo(()=>{e.isMounted=!0}),Ta(()=>{e.isUnmounting=!0}),e}const Pr=[Function,Array],Ph={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Pr,onEnter:Pr,onAfterEnter:Pr,onEnterCancelled:Pr,onBeforeLeave:Pr,onLeave:Pr,onAfterLeave:Pr,onLeaveCancelled:Pr,onBeforeAppear:Pr,onAppear:Pr,onAfterAppear:Pr,onAppearCancelled:Pr},Mh=e=>{const t=e.subTree;return t.component?Mh(t.component):t},Lg={name:"BaseTransition",props:Ph,setup(e,{slots:t}){const n=Tc(),r=Dg();return()=>{const a=t.default&&Nh(t.default(),!0),o=a&&a.length?Rh(a):n.subTree?ie():void 0;if(!o)return;const s=At(e),{mode:l}=s;if(r.isLeaving)return ru(o);const c=Xc(o);if(!c)return ru(o);let f=ju(c,s,r,n,g=>f=g);c.type!==Bn&&Hs(c,f);let h=n.subTree&&Xc(n.subTree);if(h&&h.type!==Bn&&!ga(h,c)&&Mh(n).type!==Bn){let g=ju(h,s,r,n);if(Hs(h,g),l==="out-in"&&c.type!==Bn)return r.isLeaving=!0,g.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete g.afterLeave,h=void 0},ru(o);l==="in-out"&&c.type!==Bn?g.delayLeave=(b,x,j)=>{const q=$h(r,h);q[String(h.key)]=h,b[co]=()=>{x(),b[co]=void 0,delete f.delayedLeave,h=void 0},f.delayedLeave=()=>{j(),delete f.delayedLeave,h=void 0}}:h=void 0}else h&&(h=void 0);return o}}};function Rh(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Bn){t=n;break}}return t}const jg=Lg;function $h(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 ju(e,t,n,r,a){const{appear:o,mode:s,persisted:l=!1,onBeforeEnter:c,onEnter:f,onAfterEnter:h,onEnterCancelled:g,onBeforeLeave:b,onLeave:x,onAfterLeave:j,onLeaveCancelled:q,onBeforeAppear:te,onAppear:z,onAfterAppear:O,onAppearCancelled:V}=t,Z=String(e.key),Ae=$h(n,e),Ue=(Y,Ee)=>{Y&&zr(Y,r,9,Ee)},ne=(Y,Ee)=>{const He=Ee[1];Ue(Y,Ee),Ye(Y)?Y.every(ee=>ee.length<=1)&&He():Y.length<=1&&He()},Se={mode:s,persisted:l,beforeEnter(Y){let Ee=c;if(!n.isMounted)if(o)Ee=te||c;else return;Y[co]&&Y[co](!0);const He=Ae[Z];He&&ga(e,He)&&He.el[co]&&He.el[co](),Ue(Ee,[Y])},enter(Y){if(Ae[Z]===e)return;let Ee=f,He=h,ee=g;if(!n.isMounted)if(o)Ee=z||f,He=O||h,ee=V||g;else return;let we=!1;Y[ks]=Ke=>{we||(we=!0,Ke?Ue(ee,[Y]):Ue(He,[Y]),Se.delayedLeave&&Se.delayedLeave(),Y[ks]=void 0)};const Re=Y[ks].bind(null,!1);Ee?ne(Ee,[Y,Re]):Re()},leave(Y,Ee){const He=String(e.key);if(Y[ks]&&Y[ks](!0),n.isUnmounting)return Ee();Ue(b,[Y]);let ee=!1;Y[co]=Re=>{ee||(ee=!0,Ee(),Re?Ue(q,[Y]):Ue(j,[Y]),Y[co]=void 0,Ae[He]===e&&delete Ae[He])};const we=Y[co].bind(null,!1);Ae[He]=e,x?ne(x,[Y,we]):we()},clone(Y){const Ee=ju(Y,t,n,r,a);return a&&a(Ee),Ee}};return Se}function ru(e){if(Xs(e))return e=Go(e),e.children=null,e}function Xc(e){if(!Xs(e))return Ih(e.type)&&e.children?Rh(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&&ot(n.default))return n.default()}}function Hs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Hs(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 Nh(e,t=!1,n){let r=[],a=0;for(let o=0;o<e.length;o++){let s=e[o];const l=n==null?s.key:String(n)+String(s.key!=null?s.key:o);s.type===Ge?(s.patchFlag&128&&a++,r=r.concat(Nh(s.children,t,l))):(t||s.type!==Bn)&&r.push(l!=null?Go(s,{key:l}):s)}if(a>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function Hn(e,t){return ot(e)?mn({name:e.name},t,{setup:e}):e}function gc(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Zc(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Vi=new WeakMap;function Ds(e,t,n,r,a=!1){if(Ye(e)){e.forEach((q,te)=>Ds(q,t&&(Ye(t)?t[te]:t),n,r,a));return}if(Ka(r)&&!a){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Ds(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?cl(r.component):r.el,s=a?null:o,{i:l,r:c}=e,f=t&&t.r,h=l.refs===jt?l.refs={}:l.refs,g=l.setupState,b=At(g),x=g===jt?Yf:q=>Zc(h,q)?!1:Mt(b,q),j=(q,te)=>!(te&&Zc(h,te));if(f!=null&&f!==c){if(ed(t),Vt(f))h[f]=null,x(f)&&(g[f]=null);else if(qn(f)){const q=t;j(f,q.k)&&(f.value=null),q.k&&(h[q.k]=null)}}if(ot(c))Ys(c,l,12,[s,h]);else{const q=Vt(c),te=qn(c);if(q||te){const z=()=>{if(e.f){const O=q?x(c)?g[c]:h[c]:j()||!e.k?c.value:h[e.k];if(a)Ye(O)&&ac(O,o);else if(Ye(O))O.includes(o)||O.push(o);else if(q)h[c]=[o],x(c)&&(g[c]=h[c]);else{const V=[o];j(c,e.k)&&(c.value=V),e.k&&(h[e.k]=V)}}else q?(h[c]=s,x(c)&&(g[c]=s)):te&&(j(c,e.k)&&(c.value=s),e.k&&(h[e.k]=s))};if(s){const O=()=>{z(),Vi.delete(e)};O.id=-1,Vi.set(e,O),tr(O,n)}else ed(e),z()}}}function ed(e){const t=Vi.get(e);t&&(t.flags|=8,Vi.delete(e))}const td=e=>e.nodeType===8;rl().requestIdleCallback;rl().cancelIdleCallback;function Fg(e,t){if(td(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(td(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const Ka=e=>!!e.type.__asyncLoader;function xi(e){ot(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:a=200,hydrate:o,timeout:s,suspensible:l=!0,onError:c}=e;let f=null,h,g=0;const b=()=>(g++,f=null,x()),x=()=>{let j;return f||(j=f=t().catch(q=>{if(q=q instanceof Error?q:new Error(String(q)),c)return new Promise((te,z)=>{c(q,()=>te(b()),()=>z(q),g+1)});throw q}).then(q=>j!==f&&f?f:(q&&(q.__esModule||q[Symbol.toStringTag]==="Module")&&(q=q.default),h=q,q)))};return Hn({name:"AsyncComponentWrapper",__asyncLoader:x,__asyncHydrate(j,q,te){let z=!1;(q.bu||(q.bu=[])).push(()=>z=!0);const O=()=>{z||te()},V=o?()=>{const Z=o(O,Ae=>Fg(j,Ae));Z&&(q.bum||(q.bum=[])).push(Z)}:O;h?V():x().then(()=>!q.isUnmounted&&V())},get __asyncResolved(){return h},setup(){const j=An;if(gc(j),h)return()=>Ai(h,j);const q=V=>{f=null,Qs(V,j,13,!r)};if(l&&j.suspense||Za)return x().then(V=>()=>Ai(V,j)).catch(V=>(q(V),()=>r?Ne(r,{error:V}):null));const te=P(!1),z=P(),O=P(!!a);return a&&setTimeout(()=>{O.value=!1},a),s!=null&&setTimeout(()=>{if(!te.value&&!z.value){const V=new Error(`Async component timed out after ${s}ms.`);q(V),z.value=V}},s),x().then(()=>{te.value=!0,j.parent&&Xs(j.parent.vnode)&&j.parent.update()}).catch(V=>{q(V),z.value=V}),()=>{if(te.value&&h)return Ai(h,j);if(z.value&&r)return Ne(r,{error:z.value});if(n&&!O.value)return Ai(n,j)}}})}function Ai(e,t){const{ref:n,props:r,children:a,ce:o}=t.vnode,s=Ne(e,r,a);return s.ref=n,s.ce=o,delete t.vnode.ce,s}const Xs=e=>e.type.__isKeepAlive;function Ug(e,t){Oh(e,"a",t)}function Bg(e,t){Oh(e,"da",t)}function Oh(e,t,n=An){const r=e.__wdc||(e.__wdc=()=>{let a=n;for(;a;){if(a.isDeactivated)return;a=a.parent}return e()});if(sl(t,r,n),n){let a=n.parent;for(;a&&a.parent;)Xs(a.parent.vnode)&&qg(r,t,n,a),a=a.parent}}function qg(e,t,n,r){const a=sl(t,e,r,!0);il(()=>{ac(r[t],a)},n)}function sl(e,t,n=An,r=!1){if(n){const a=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...s)=>{Io();const l=Zs(n),c=zr(t,n,e,s);return l(),Po(),c});return r?a.unshift(o):a.push(o),o}}const $o=e=>(t,n=An)=>{(!Za||e==="sp")&&sl(e,(...r)=>t(...r),n)},Hg=$o("bm"),Jo=$o("m"),zg=$o("bu"),Vg=$o("u"),Ta=$o("bum"),il=$o("um"),Wg=$o("sp"),Gg=$o("rtg"),Kg=$o("rtc");function Jg(e,t=An){sl("ec",e,t)}const Yg="components",Dh=Symbol.for("v-ndc");function vc(e){return Vt(e)?Qg(Yg,e,!1)||e:e||Dh}function Qg(e,t,n=!0,r=!1){const a=En||An;if(a){const o=a.type;{const l=Dv(o,!1);if(l&&(l===t||l===ar(t)||l===tl(ar(t))))return o}const s=nd(a[e]||o[e],t)||nd(a.appContext[e],t);return!s&&r?o:s}}function nd(e,t){return e&&(e[t]||e[ar(t)]||e[tl(ar(t))])}function zt(e,t,n,r){let a;const o=n,s=Ye(e);if(s||Vt(e)){const l=s&&ba(e);let c=!1,f=!1;l&&(c=!Mr(e),f=Mo(e),e=ol(e)),a=new Array(e.length);for(let h=0,g=e.length;h<g;h++)a[h]=t(c?f?Qa(Hr(e[h])):Hr(e[h]):e[h],h,void 0,o)}else if(typeof e=="number"){a=new Array(e);for(let l=0;l<e;l++)a[l]=t(l+1,l,void 0,o)}else if(Rt(e))if(e[Symbol.iterator])a=Array.from(e,(l,c)=>t(l,c,void 0,o));else{const l=Object.keys(e);a=new Array(l.length);for(let c=0,f=l.length;c<f;c++){const h=l[c];a[c]=t(e[h],h,c,o)}}else a=[];return a}function po(e,t,n={},r,a){if(En.ce||En.parent&&Ka(En.parent)&&En.parent.ce){const f=Object.keys(n).length>0;return t!=="default"&&(n.name=t),C(),rt(Ge,null,[Ne("slot",n,r)],f?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),C();const s=o&&Lh(o(n)),l=n.key||s&&s.key,c=rt(Ge,{key:(l&&!qr(l)?l:`_${t}`)+(!s&&r?"_fb":"")},s||[],s&&e._===1?64:-2);return o&&o._c&&(o._d=!0),c}function Lh(e){return e.some(t=>zs(t)?!(t.type===Bn||t.type===Ge&&!Lh(t.children)):!0)?e:null}const Fu=e=>e?rp(e)?cl(e):Fu(e.parent):null,Ls=mn(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=>Fu(e.parent),$root:e=>Fu(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Fh(e),$forceUpdate:e=>e.f||(e.f=()=>{mc(e.update)}),$nextTick:e=>e.n||(e.n=an.bind(e.proxy)),$watch:e=>Rg.bind(e)}),ou=(e,t)=>e!==jt&&!e.__isScriptSetup&&Mt(e,t),Xg={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:a,props:o,accessCache:s,type:l,appContext:c}=e;if(t[0]!=="$"){const b=s[t];if(b!==void 0)switch(b){case 1:return r[t];case 2:return a[t];case 4:return n[t];case 3:return o[t]}else{if(ou(r,t))return s[t]=1,r[t];if(a!==jt&&Mt(a,t))return s[t]=2,a[t];if(Mt(o,t))return s[t]=3,o[t];if(n!==jt&&Mt(n,t))return s[t]=4,n[t];Uu&&(s[t]=0)}}const f=Ls[t];let h,g;if(f)return t==="$attrs"&&Un(e.attrs,"get",""),f(e);if((h=l.__cssModules)&&(h=h[t]))return h;if(n!==jt&&Mt(n,t))return s[t]=4,n[t];if(g=c.config.globalProperties,Mt(g,t))return g[t]},set({_:e},t,n){const{data:r,setupState:a,ctx:o}=e;return ou(a,t)?(a[t]=n,!0):r!==jt&&Mt(r,t)?(r[t]=n,!0):Mt(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:a,props:o,type:s}},l){let c;return!!(n[l]||e!==jt&&l[0]!=="$"&&Mt(e,l)||ou(t,l)||Mt(o,l)||Mt(r,l)||Mt(Ls,l)||Mt(a.config.globalProperties,l)||(c=s.__cssModules)&&c[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Mt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function Zg(){return ev().slots}function ev(e){const t=Tc();return t.setupContext||(t.setupContext=ap(t))}function rd(e){return Ye(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Uu=!0;function tv(e){const t=Fh(e),n=e.proxy,r=e.ctx;Uu=!1,t.beforeCreate&&od(t.beforeCreate,e,"bc");const{data:a,computed:o,methods:s,watch:l,provide:c,inject:f,created:h,beforeMount:g,mounted:b,beforeUpdate:x,updated:j,activated:q,deactivated:te,beforeDestroy:z,beforeUnmount:O,destroyed:V,unmounted:Z,render:Ae,renderTracked:Ue,renderTriggered:ne,errorCaptured:Se,serverPrefetch:Y,expose:Ee,inheritAttrs:He,components:ee,directives:we,filters:Re}=t;if(f&&nv(f,r,null),s)for(const xe in s){const me=s[xe];ot(me)&&(r[xe]=me.bind(n))}if(a){const xe=a.call(n,n);Rt(xe)&&(e.data=al(xe))}if(Uu=!0,o)for(const xe in o){const me=o[xe],We=ot(me)?me.bind(n,n):ot(me.get)?me.get.bind(n,n):mo,nt=!ot(me)&&ot(me.set)?me.set.bind(n):mo,Ve=le({get:We,set:nt});Object.defineProperty(r,xe,{enumerable:!0,configurable:!0,get:()=>Ve.value,set:Le=>Ve.value=Le})}if(l)for(const xe in l)jh(l[xe],r,n,xe);if(c){const xe=ot(c)?c.call(n):c;Reflect.ownKeys(xe).forEach(me=>{Li(me,xe[me])})}h&&od(h,e,"c");function Be(xe,me){Ye(me)?me.forEach(We=>xe(We.bind(n))):me&&xe(me.bind(n))}if(Be(Hg,g),Be(Jo,b),Be(zg,x),Be(Vg,j),Be(Ug,q),Be(Bg,te),Be(Jg,Se),Be(Kg,Ue),Be(Gg,ne),Be(Ta,O),Be(il,Z),Be(Wg,Y),Ye(Ee))if(Ee.length){const xe=e.exposed||(e.exposed={});Ee.forEach(me=>{Object.defineProperty(xe,me,{get:()=>n[me],set:We=>n[me]=We,enumerable:!0})})}else e.exposed||(e.exposed={});Ae&&e.render===mo&&(e.render=Ae),He!=null&&(e.inheritAttrs=He),ee&&(e.components=ee),we&&(e.directives=we),Y&&gc(e)}function nv(e,t,n=mo){Ye(e)&&(e=Bu(e));for(const r in e){const a=e[r];let o;Rt(a)?"default"in a?o=Br(a.from||r,a.default,!0):o=Br(a.from||r):o=Br(a),qn(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:s=>o.value=s}):t[r]=o}}function od(e,t,n){zr(Ye(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function jh(e,t,n,r){let a=r.includes(".")?Ah(n,r):()=>n[r];if(Vt(e)){const o=t[e];ot(o)&>(a,o)}else if(ot(e))gt(a,e.bind(n));else if(Rt(e))if(Ye(e))e.forEach(o=>jh(o,t,n,r));else{const o=ot(e.handler)?e.handler.bind(n):t[e.handler];ot(o)&>(a,o,e)}}function Fh(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:a,optionsCache:o,config:{optionMergeStrategies:s}}=e.appContext,l=o.get(t);let c;return l?c=l:!a.length&&!n&&!r?c=t:(c={},a.length&&a.forEach(f=>Wi(c,f,s,!0)),Wi(c,t,s)),Rt(t)&&o.set(t,c),c}function Wi(e,t,n,r=!1){const{mixins:a,extends:o}=t;o&&Wi(e,o,n,!0),a&&a.forEach(s=>Wi(e,s,n,!0));for(const s in t)if(!(r&&s==="expose")){const l=rv[s]||n&&n[s];e[s]=l?l(e[s],t[s]):t[s]}return e}const rv={data:ad,props:sd,emits:sd,methods:Is,computed:Is,beforeCreate:er,created:er,beforeMount:er,mounted:er,beforeUpdate:er,updated:er,beforeDestroy:er,beforeUnmount:er,destroyed:er,unmounted:er,activated:er,deactivated:er,errorCaptured:er,serverPrefetch:er,components:Is,directives:Is,watch:av,provide:ad,inject:ov};function ad(e,t){return t?e?function(){return mn(ot(e)?e.call(this,this):e,ot(t)?t.call(this,this):t)}:t:e}function ov(e,t){return Is(Bu(e),Bu(t))}function Bu(e){if(Ye(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function er(e,t){return e?[...new Set([].concat(e,t))]:t}function Is(e,t){return e?mn(Object.create(null),e,t):t}function sd(e,t){return e?Ye(e)&&Ye(t)?[...new Set([...e,...t])]:mn(Object.create(null),rd(e),rd(t??{})):t}function av(e,t){if(!e)return t;if(!t)return e;const n=mn(Object.create(null),e);for(const r in t)n[r]=er(e[r],t[r]);return n}function Uh(){return{app:null,config:{isNativeTag:Yf,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 sv=0;function iv(e,t){return function(r,a=null){ot(r)||(r=mn({},r)),a!=null&&!Rt(a)&&(a=null);const o=Uh(),s=new WeakSet,l=[];let c=!1;const f=o.app={_uid:sv++,_component:r,_props:a,_container:null,_context:o,_instance:null,version:Fv,get config(){return o.config},set config(h){},use(h,...g){return s.has(h)||(h&&ot(h.install)?(s.add(h),h.install(f,...g)):ot(h)&&(s.add(h),h(f,...g))),f},mixin(h){return o.mixins.includes(h)||o.mixins.push(h),f},component(h,g){return g?(o.components[h]=g,f):o.components[h]},directive(h,g){return g?(o.directives[h]=g,f):o.directives[h]},mount(h,g,b){if(!c){const x=f._ceVNode||Ne(r,a);return x.appContext=o,b===!0?b="svg":b===!1&&(b=void 0),e(x,h,b),c=!0,f._container=h,h.__vue_app__=f,cl(x.component)}},onUnmount(h){l.push(h)},unmount(){c&&(zr(l,f._instance,16),e(null,f._container),delete f._container.__vue_app__)},provide(h,g){return o.provides[h]=g,f},runWithContext(h){const g=Ja;Ja=f;try{return h()}finally{Ja=g}}};return f}}let Ja=null;const lv=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${ar(t)}Modifiers`]||e[`${Ko(t)}Modifiers`];function uv(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||jt;let a=n;const o=t.startsWith("update:"),s=o&&lv(r,t.slice(7));s&&(s.trim&&(a=n.map(h=>Vt(h)?h.trim():h)),s.number&&(a=n.map(nl)));let l,c=r[l=Xl(t)]||r[l=Xl(ar(t))];!c&&o&&(c=r[l=Xl(Ko(t))]),c&&zr(c,e,6,a);const f=r[l+"Once"];if(f){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,zr(f,e,6,a)}}const cv=new WeakMap;function Bh(e,t,n=!1){const r=n?cv:t.emitsCache,a=r.get(e);if(a!==void 0)return a;const o=e.emits;let s={},l=!1;if(!ot(e)){const c=f=>{const h=Bh(f,t,!0);h&&(l=!0,mn(s,h))};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}return!o&&!l?(Rt(e)&&r.set(e,null),null):(Ye(o)?o.forEach(c=>s[c]=null):mn(s,o),Rt(e)&&r.set(e,s),s)}function ll(e,t){return!e||!Xi(t)?!1:(t=t.slice(2).replace(/Once$/,""),Mt(e,t[0].toLowerCase()+t.slice(1))||Mt(e,Ko(t))||Mt(e,t))}function id(e){const{type:t,vnode:n,proxy:r,withProxy:a,propsOptions:[o],slots:s,attrs:l,emit:c,render:f,renderCache:h,props:g,data:b,setupState:x,ctx:j,inheritAttrs:q}=e,te=zi(e);let z,O;try{if(n.shapeFlag&4){const Z=a||r,Ae=Z;z=ho(f.call(Ae,Z,h,g,x,b,j)),O=l}else{const Z=t;z=ho(Z.length>1?Z(g,{attrs:l,slots:s,emit:c}):Z(g,null)),O=t.props?l:dv(l)}}catch(Z){js.length=0,Qs(Z,e,1),z=Ne(Bn)}let V=z;if(O&&q!==!1){const Z=Object.keys(O),{shapeFlag:Ae}=V;Z.length&&Ae&7&&(o&&Z.some(Zi)&&(O=fv(O,o)),V=Go(V,O,!1,!0))}return n.dirs&&(V=Go(V,null,!1,!0),V.dirs=V.dirs?V.dirs.concat(n.dirs):n.dirs),n.transition&&Hs(V,n.transition),z=V,zi(te),z}const dv=e=>{let t;for(const n in e)(n==="class"||n==="style"||Xi(n))&&((t||(t={}))[n]=e[n]);return t},fv=(e,t)=>{const n={};for(const r in e)(!Zi(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function hv(e,t,n){const{props:r,children:a,component:o}=e,{props:s,children:l,patchFlag:c}=t,f=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?ld(r,s,f):!!s;if(c&8){const h=t.dynamicProps;for(let g=0;g<h.length;g++){const b=h[g];if(qh(s,r,b)&&!ll(f,b))return!0}}}else return(a||l)&&(!l||!l.$stable)?!0:r===s?!1:r?s?ld(r,s,f):!0:!!s;return!1}function ld(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let a=0;a<r.length;a++){const o=r[a];if(qh(t,e,o)&&!ll(n,o))return!0}return!1}function qh(e,t,n){const r=e[n],a=t[n];return n==="style"&&Rt(r)&&Rt(a)?!as(r,a):r!==a}function pv({vnode:e,parent:t,suspense:n},r){for(;t;){const a=t.subTree;if(a.suspense&&a.suspense.activeBranch===e&&(a.suspense.vnode.el=a.el=r,e=a),a===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}const Hh={},zh=()=>Object.create(Hh),Vh=e=>Object.getPrototypeOf(e)===Hh;function mv(e,t,n,r=!1){const a={},o=zh();e.propsDefaults=Object.create(null),Wh(e,t,a,o);for(const s in e.propsOptions[0])s in a||(a[s]=void 0);n?e.props=r?a:yh(a):e.type.props?e.props=a:e.props=o,e.attrs=o}function gv(e,t,n,r){const{props:a,attrs:o,vnode:{patchFlag:s}}=e,l=At(a),[c]=e.propsOptions;let f=!1;if((r||s>0)&&!(s&16)){if(s&8){const h=e.vnode.dynamicProps;for(let g=0;g<h.length;g++){let b=h[g];if(ll(e.emitsOptions,b))continue;const x=t[b];if(c)if(Mt(o,b))x!==o[b]&&(o[b]=x,f=!0);else{const j=ar(b);a[j]=qu(c,l,j,x,e,!1)}else x!==o[b]&&(o[b]=x,f=!0)}}}else{Wh(e,t,a,o)&&(f=!0);let h;for(const g in l)(!t||!Mt(t,g)&&((h=Ko(g))===g||!Mt(t,h)))&&(c?n&&(n[g]!==void 0||n[h]!==void 0)&&(a[g]=qu(c,l,g,void 0,e,!0)):delete a[g]);if(o!==l)for(const g in o)(!t||!Mt(t,g))&&(delete o[g],f=!0)}f&&ko(e.attrs,"set","")}function Wh(e,t,n,r){const[a,o]=e.propsOptions;let s=!1,l;if(t)for(let c in t){if($s(c))continue;const f=t[c];let h;a&&Mt(a,h=ar(c))?!o||!o.includes(h)?n[h]=f:(l||(l={}))[h]=f:ll(e.emitsOptions,c)||(!(c in r)||f!==r[c])&&(r[c]=f,s=!0)}if(o){const c=At(n),f=l||jt;for(let h=0;h<o.length;h++){const g=o[h];n[g]=qu(a,c,g,f[g],e,!Mt(f,g))}}return s}function qu(e,t,n,r,a,o){const s=e[n];if(s!=null){const l=Mt(s,"default");if(l&&r===void 0){const c=s.default;if(s.type!==Function&&!s.skipFactory&&ot(c)){const{propsDefaults:f}=a;if(n in f)r=f[n];else{const h=Zs(a);r=f[n]=c.call(null,t),h()}}else r=c;a.ce&&a.ce._setProp(n,r)}s[0]&&(o&&!l?r=!1:s[1]&&(r===""||r===Ko(n))&&(r=!0))}return r}const vv=new WeakMap;function Gh(e,t,n=!1){const r=n?vv:t.propsCache,a=r.get(e);if(a)return a;const o=e.props,s={},l=[];let c=!1;if(!ot(e)){const h=g=>{c=!0;const[b,x]=Gh(g,t,!0);mn(s,b),x&&l.push(...x)};!n&&t.mixins.length&&t.mixins.forEach(h),e.extends&&h(e.extends),e.mixins&&e.mixins.forEach(h)}if(!o&&!c)return Rt(e)&&r.set(e,Va),Va;if(Ye(o))for(let h=0;h<o.length;h++){const g=ar(o[h]);ud(g)&&(s[g]=jt)}else if(o)for(const h in o){const g=ar(h);if(ud(g)){const b=o[h],x=s[g]=Ye(b)||ot(b)?{type:b}:mn({},b),j=x.type;let q=!1,te=!0;if(Ye(j))for(let z=0;z<j.length;++z){const O=j[z],V=ot(O)&&O.name;if(V==="Boolean"){q=!0;break}else V==="String"&&(te=!1)}else q=ot(j)&&j.name==="Boolean";x[0]=q,x[1]=te,(q||Mt(x,"default"))&&l.push(g)}}const f=[s,l];return Rt(e)&&r.set(e,f),f}function ud(e){return e[0]!=="$"&&!$s(e)}const yc=e=>e==="_"||e==="_ctx"||e==="$stable",wc=e=>Ye(e)?e.map(ho):[ho(e)],yv=(e,t,n)=>{if(t._n)return t;const r=ct((...a)=>wc(t(...a)),n);return r._c=!1,r},Kh=(e,t,n)=>{const r=e._ctx;for(const a in e){if(yc(a))continue;const o=e[a];if(ot(o))t[a]=yv(a,o,r);else if(o!=null){const s=wc(o);t[a]=()=>s}}},Jh=(e,t)=>{const n=wc(t);e.slots.default=()=>n},Yh=(e,t,n)=>{for(const r in t)(n||!yc(r))&&(e[r]=t[r])},wv=(e,t,n)=>{const r=e.slots=zh();if(e.vnode.shapeFlag&32){const a=t._;a?(Yh(r,t,n),n&&eh(r,"_",a,!0)):Kh(t,r)}else t&&Jh(e,t)},bv=(e,t,n)=>{const{vnode:r,slots:a}=e;let o=!0,s=jt;if(r.shapeFlag&32){const l=t._;l?n&&l===1?o=!1:Yh(a,t,n):(o=!t.$stable,Kh(t,a)),s=t}else t&&(Jh(e,t),s={default:1});if(o)for(const l in a)!yc(l)&&s[l]==null&&delete a[l]},tr=Cv;function _v(e){return Tv(e)}function Tv(e,t){const n=rl();n.__VUE__=!0;const{insert:r,remove:a,patchProp:o,createElement:s,createText:l,createComment:c,setText:f,setElementText:h,parentNode:g,nextSibling:b,setScopeId:x=mo,insertStaticContent:j}=e,q=(k,I,H,re=null,J=null,ae=null,fe=void 0,ye=null,pe=!!I.dynamicChildren)=>{if(k===I)return;k&&!ga(k,I)&&(re=K(k),Le(k,J,ae,!0),k=null),I.patchFlag===-2&&(pe=!1,I.dynamicChildren=null);const{type:ce,ref:$e,shapeFlag:ge}=I;switch(ce){case ul:te(k,I,H,re);break;case Bn:z(k,I,H,re);break;case ji:k==null&&O(I,H,re,fe);break;case Ge:ee(k,I,H,re,J,ae,fe,ye,pe);break;default:ge&1?Ae(k,I,H,re,J,ae,fe,ye,pe):ge&6?we(k,I,H,re,J,ae,fe,ye,pe):(ge&64||ge&128)&&ce.process(k,I,H,re,J,ae,fe,ye,pe,Oe)}$e!=null&&J?Ds($e,k&&k.ref,ae,I||k,!I):$e==null&&k&&k.ref!=null&&Ds(k.ref,null,ae,k,!0)},te=(k,I,H,re)=>{if(k==null)r(I.el=l(I.children),H,re);else{const J=I.el=k.el;I.children!==k.children&&f(J,I.children)}},z=(k,I,H,re)=>{k==null?r(I.el=c(I.children||""),H,re):I.el=k.el},O=(k,I,H,re)=>{[k.el,k.anchor]=j(k.children,I,H,re,k.el,k.anchor)},V=({el:k,anchor:I},H,re)=>{let J;for(;k&&k!==I;)J=b(k),r(k,H,re),k=J;r(I,H,re)},Z=({el:k,anchor:I})=>{let H;for(;k&&k!==I;)H=b(k),a(k),k=H;a(I)},Ae=(k,I,H,re,J,ae,fe,ye,pe)=>{if(I.type==="svg"?fe="svg":I.type==="math"&&(fe="mathml"),k==null)Ue(I,H,re,J,ae,fe,ye,pe);else{const ce=k.el&&k.el._isVueCE?k.el:null;try{ce&&ce._beginPatch(),Y(k,I,J,ae,fe,ye,pe)}finally{ce&&ce._endPatch()}}},Ue=(k,I,H,re,J,ae,fe,ye)=>{let pe,ce;const{props:$e,shapeFlag:ge,transition:ke,dirs:De}=k;if(pe=k.el=s(k.type,ae,$e&&$e.is,$e),ge&8?h(pe,k.children):ge&16&&Se(k.children,pe,null,re,J,au(k,ae),fe,ye),De&&ua(k,null,re,"created"),ne(pe,k,k.scopeId,fe,re),$e){for(const D in $e)D!=="value"&&!$s(D)&&o(pe,D,null,$e[D],ae,re);"value"in $e&&o(pe,"value",null,$e.value,ae),(ce=$e.onVnodeBeforeMount)&&io(ce,re,k)}De&&ua(k,null,re,"beforeMount");const Ze=Sv(J,ke);Ze&&ke.beforeEnter(pe),r(pe,I,H),((ce=$e&&$e.onVnodeMounted)||Ze||De)&&tr(()=>{try{ce&&io(ce,re,k),Ze&&ke.enter(pe),De&&ua(k,null,re,"mounted")}finally{}},J)},ne=(k,I,H,re,J)=>{if(H&&x(k,H),re)for(let ae=0;ae<re.length;ae++)x(k,re[ae]);if(J){let ae=J.subTree;if(I===ae||Zh(ae.type)&&(ae.ssContent===I||ae.ssFallback===I)){const fe=J.vnode;ne(k,fe,fe.scopeId,fe.slotScopeIds,J.parent)}}},Se=(k,I,H,re,J,ae,fe,ye,pe=0)=>{for(let ce=pe;ce<k.length;ce++){const $e=k[ce]=ye?So(k[ce]):ho(k[ce]);q(null,$e,I,H,re,J,ae,fe,ye)}},Y=(k,I,H,re,J,ae,fe)=>{const ye=I.el=k.el;let{patchFlag:pe,dynamicChildren:ce,dirs:$e}=I;pe|=k.patchFlag&16;const ge=k.props||jt,ke=I.props||jt;let De;if(H&&ca(H,!1),(De=ke.onVnodeBeforeUpdate)&&io(De,H,I,k),$e&&ua(I,k,H,"beforeUpdate"),H&&ca(H,!0),(ge.innerHTML&&ke.innerHTML==null||ge.textContent&&ke.textContent==null)&&h(ye,""),ce?Ee(k.dynamicChildren,ce,ye,H,re,au(I,J),ae):fe||me(k,I,ye,null,H,re,au(I,J),ae,!1),pe>0){if(pe&16)He(ye,ge,ke,H,J);else if(pe&2&&ge.class!==ke.class&&o(ye,"class",null,ke.class,J),pe&4&&o(ye,"style",ge.style,ke.style,J),pe&8){const Ze=I.dynamicProps;for(let D=0;D<Ze.length;D++){const U=Ze[D],B=ge[U],Q=ke[U];(Q!==B||U==="value")&&o(ye,U,B,Q,J,H)}}pe&1&&k.children!==I.children&&h(ye,I.children)}else!fe&&ce==null&&He(ye,ge,ke,H,J);((De=ke.onVnodeUpdated)||$e)&&tr(()=>{De&&io(De,H,I,k),$e&&ua(I,k,H,"updated")},re)},Ee=(k,I,H,re,J,ae,fe)=>{for(let ye=0;ye<I.length;ye++){const pe=k[ye],ce=I[ye],$e=pe.el&&(pe.type===Ge||!ga(pe,ce)||pe.shapeFlag&198)?g(pe.el):H;q(pe,ce,$e,null,re,J,ae,fe,!0)}},He=(k,I,H,re,J)=>{if(I!==H){if(I!==jt)for(const ae in I)!$s(ae)&&!(ae in H)&&o(k,ae,I[ae],null,J,re);for(const ae in H){if($s(ae))continue;const fe=H[ae],ye=I[ae];fe!==ye&&ae!=="value"&&o(k,ae,ye,fe,J,re)}"value"in H&&o(k,"value",I.value,H.value,J)}},ee=(k,I,H,re,J,ae,fe,ye,pe)=>{const ce=I.el=k?k.el:l(""),$e=I.anchor=k?k.anchor:l("");let{patchFlag:ge,dynamicChildren:ke,slotScopeIds:De}=I;De&&(ye=ye?ye.concat(De):De),k==null?(r(ce,H,re),r($e,H,re),Se(I.children||[],H,$e,J,ae,fe,ye,pe)):ge>0&&ge&64&&ke&&k.dynamicChildren&&k.dynamicChildren.length===ke.length?(Ee(k.dynamicChildren,ke,H,J,ae,fe,ye),(I.key!=null||J&&I===J.subTree)&&bc(k,I,!0)):me(k,I,H,$e,J,ae,fe,ye,pe)},we=(k,I,H,re,J,ae,fe,ye,pe)=>{I.slotScopeIds=ye,k==null?I.shapeFlag&512?J.ctx.activate(I,H,re,fe,pe):Re(I,H,re,J,ae,fe,pe):Ke(k,I,pe)},Re=(k,I,H,re,J,ae,fe)=>{const ye=k.component=Rv(k,re,J);if(Xs(k)&&(ye.ctx.renderer=Oe),$v(ye,!1,fe),ye.asyncDep){if(J&&J.registerDep(ye,Be,fe),!k.el){const pe=ye.subTree=Ne(Bn);z(null,pe,I,H),k.placeholder=pe.el}}else Be(ye,k,I,H,J,ae,fe)},Ke=(k,I,H)=>{const re=I.component=k.component;if(hv(k,I,H))if(re.asyncDep&&!re.asyncResolved){xe(re,I,H);return}else re.next=I,re.update();else I.el=k.el,re.vnode=I},Be=(k,I,H,re,J,ae,fe)=>{const ye=()=>{if(k.isMounted){let{next:ge,bu:ke,u:De,parent:Ze,vnode:D}=k;{const Pe=Qh(k);if(Pe){ge&&(ge.el=D.el,xe(k,ge,fe)),Pe.asyncDep.then(()=>{tr(()=>{k.isUnmounted||ce()},J)});return}}let U=ge,B;ca(k,!1),ge?(ge.el=D.el,xe(k,ge,fe)):ge=D,ke&&Di(ke),(B=ge.props&&ge.props.onVnodeBeforeUpdate)&&io(B,Ze,ge,D),ca(k,!0);const Q=id(k),de=k.subTree;k.subTree=Q,q(de,Q,g(de.el),K(de),k,J,ae),ge.el=Q.el,U===null&&pv(k,Q.el),De&&tr(De,J),(B=ge.props&&ge.props.onVnodeUpdated)&&tr(()=>io(B,Ze,ge,D),J)}else{let ge;const{el:ke,props:De}=I,{bm:Ze,m:D,parent:U,root:B,type:Q}=k,de=Ka(I);ca(k,!1),Ze&&Di(Ze),!de&&(ge=De&&De.onVnodeBeforeMount)&&io(ge,U,I),ca(k,!0);{B.ce&&B.ce._hasShadowRoot()&&B.ce._injectChildStyle(Q,k.parent?k.parent.type:void 0);const Pe=k.subTree=id(k);q(null,Pe,H,re,k,J,ae),I.el=Pe.el}if(D&&tr(D,J),!de&&(ge=De&&De.onVnodeMounted)){const Pe=I;tr(()=>io(ge,U,Pe),J)}(I.shapeFlag&256||U&&Ka(U.vnode)&&U.vnode.shapeFlag&256)&&k.a&&tr(k.a,J),k.isMounted=!0,I=H=re=null}};k.scope.on();const pe=k.effect=new oh(ye);k.scope.off();const ce=k.update=pe.run.bind(pe),$e=k.job=pe.runIfDirty.bind(pe);$e.i=k,$e.id=k.uid,pe.scheduler=()=>mc($e),ca(k,!0),ce()},xe=(k,I,H)=>{I.component=k;const re=k.vnode.props;k.vnode=I,k.next=null,gv(k,I.props,re,H),bv(k,I.children,H),Io(),Jc(k),Po()},me=(k,I,H,re,J,ae,fe,ye,pe=!1)=>{const ce=k&&k.children,$e=k?k.shapeFlag:0,ge=I.children,{patchFlag:ke,shapeFlag:De}=I;if(ke>0){if(ke&128){nt(ce,ge,H,re,J,ae,fe,ye,pe);return}else if(ke&256){We(ce,ge,H,re,J,ae,fe,ye,pe);return}}De&8?($e&16&&dt(ce,J,ae),ge!==ce&&h(H,ge)):$e&16?De&16?nt(ce,ge,H,re,J,ae,fe,ye,pe):dt(ce,J,ae,!0):($e&8&&h(H,""),De&16&&Se(ge,H,re,J,ae,fe,ye,pe))},We=(k,I,H,re,J,ae,fe,ye,pe)=>{k=k||Va,I=I||Va;const ce=k.length,$e=I.length,ge=Math.min(ce,$e);let ke;for(ke=0;ke<ge;ke++){const De=I[ke]=pe?So(I[ke]):ho(I[ke]);q(k[ke],De,H,null,J,ae,fe,ye,pe)}ce>$e?dt(k,J,ae,!0,!1,ge):Se(I,H,re,J,ae,fe,ye,pe,ge)},nt=(k,I,H,re,J,ae,fe,ye,pe)=>{let ce=0;const $e=I.length;let ge=k.length-1,ke=$e-1;for(;ce<=ge&&ce<=ke;){const De=k[ce],Ze=I[ce]=pe?So(I[ce]):ho(I[ce]);if(ga(De,Ze))q(De,Ze,H,null,J,ae,fe,ye,pe);else break;ce++}for(;ce<=ge&&ce<=ke;){const De=k[ge],Ze=I[ke]=pe?So(I[ke]):ho(I[ke]);if(ga(De,Ze))q(De,Ze,H,null,J,ae,fe,ye,pe);else break;ge--,ke--}if(ce>ge){if(ce<=ke){const De=ke+1,Ze=De<$e?I[De].el:re;for(;ce<=ke;)q(null,I[ce]=pe?So(I[ce]):ho(I[ce]),H,Ze,J,ae,fe,ye,pe),ce++}}else if(ce>ke)for(;ce<=ge;)Le(k[ce],J,ae,!0),ce++;else{const De=ce,Ze=ce,D=new Map;for(ce=Ze;ce<=ke;ce++){const Me=I[ce]=pe?So(I[ce]):ho(I[ce]);Me.key!=null&&D.set(Me.key,ce)}let U,B=0;const Q=ke-Ze+1;let de=!1,Pe=0;const je=new Array(Q);for(ce=0;ce<Q;ce++)je[ce]=0;for(ce=De;ce<=ge;ce++){const Me=k[ce];if(B>=Q){Le(Me,J,ae,!0);continue}let bt;if(Me.key!=null)bt=D.get(Me.key);else for(U=Ze;U<=ke;U++)if(je[U-Ze]===0&&ga(Me,I[U])){bt=U;break}bt===void 0?Le(Me,J,ae,!0):(je[bt-Ze]=ce+1,bt>=Pe?Pe=bt:de=!0,q(Me,I[bt],H,null,J,ae,fe,ye,pe),B++)}const Qe=de?kv(je):Va;for(U=Qe.length-1,ce=Q-1;ce>=0;ce--){const Me=Ze+ce,bt=I[Me],Sn=I[Me+1],In=Me+1<$e?Sn.el||Xh(Sn):re;je[ce]===0?q(null,bt,H,In,J,ae,fe,ye,pe):de&&(U<0||ce!==Qe[U]?Ve(bt,H,In,2):U--)}}},Ve=(k,I,H,re,J=null)=>{const{el:ae,type:fe,transition:ye,children:pe,shapeFlag:ce}=k;if(ce&6){Ve(k.component.subTree,I,H,re);return}if(ce&128){k.suspense.move(I,H,re);return}if(ce&64){fe.move(k,I,H,Oe);return}if(fe===Ge){r(ae,I,H);for(let ge=0;ge<pe.length;ge++)Ve(pe[ge],I,H,re);r(k.anchor,I,H);return}if(fe===ji){V(k,I,H);return}if(re!==2&&ce&1&&ye)if(re===0)ye.beforeEnter(ae),r(ae,I,H),tr(()=>ye.enter(ae),J);else{const{leave:ge,delayLeave:ke,afterLeave:De}=ye,Ze=()=>{k.ctx.isUnmounted?a(ae):r(ae,I,H)},D=()=>{ae._isLeaving&&ae[co](!0),ge(ae,()=>{Ze(),De&&De()})};ke?ke(ae,Ze,D):D()}else r(ae,I,H)},Le=(k,I,H,re=!1,J=!1)=>{const{type:ae,props:fe,ref:ye,children:pe,dynamicChildren:ce,shapeFlag:$e,patchFlag:ge,dirs:ke,cacheIndex:De,memo:Ze}=k;if(ge===-2&&(J=!1),ye!=null&&(Io(),Ds(ye,null,H,k,!0),Po()),De!=null&&(I.renderCache[De]=void 0),$e&256){I.ctx.deactivate(k);return}const D=$e&1&&ke,U=!Ka(k);let B;if(U&&(B=fe&&fe.onVnodeBeforeUnmount)&&io(B,I,k),$e&6)Xe(k.component,H,re);else{if($e&128){k.suspense.unmount(H,re);return}D&&ua(k,null,I,"beforeUnmount"),$e&64?k.type.remove(k,I,H,Oe,re):ce&&!ce.hasOnce&&(ae!==Ge||ge>0&&ge&64)?dt(ce,I,H,!1,!0):(ae===Ge&&ge&384||!J&&$e&16)&&dt(pe,I,H),re&&ft(k)}const Q=Ze!=null&&De==null;(U&&(B=fe&&fe.onVnodeUnmounted)||D||Q)&&tr(()=>{B&&io(B,I,k),D&&ua(k,null,I,"unmounted"),Q&&(k.el=null)},H)},ft=k=>{const{type:I,el:H,anchor:re,transition:J}=k;if(I===Ge){ht(H,re);return}if(I===ji){Z(k);return}const ae=()=>{a(H),J&&!J.persisted&&J.afterLeave&&J.afterLeave()};if(k.shapeFlag&1&&J&&!J.persisted){const{leave:fe,delayLeave:ye}=J,pe=()=>fe(H,ae);ye?ye(k.el,ae,pe):pe()}else ae()},ht=(k,I)=>{let H;for(;k!==I;)H=b(k),a(k),k=H;a(I)},Xe=(k,I,H)=>{const{bum:re,scope:J,job:ae,subTree:fe,um:ye,m:pe,a:ce}=k;cd(pe),cd(ce),re&&Di(re),J.stop(),ae&&(ae.flags|=8,Le(fe,k,I,H)),ye&&tr(ye,I),tr(()=>{k.isUnmounted=!0},I)},dt=(k,I,H,re=!1,J=!1,ae=0)=>{for(let fe=ae;fe<k.length;fe++)Le(k[fe],I,H,re,J)},K=k=>{if(k.shapeFlag&6)return K(k.component.subTree);if(k.shapeFlag&128)return k.suspense.next();const I=b(k.anchor||k.el),H=I&&I[Eh];return H?b(H):I};let _e=!1;const be=(k,I,H)=>{let re;k==null?I._vnode&&(Le(I._vnode,null,null,!0),re=I._vnode.component):q(I._vnode||null,k,I,null,null,null,H),I._vnode=k,_e||(_e=!0,Jc(re),Sh(),_e=!1)},Oe={p:q,um:Le,m:Ve,r:ft,mt:Re,mc:Se,pc:me,pbc:Ee,n:K,o:e};return{render:be,hydrate:void 0,createApp:iv(be)}}function au({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 ca({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Sv(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function bc(e,t,n=!1){const r=e.children,a=t.children;if(Ye(r)&&Ye(a))for(let o=0;o<r.length;o++){const s=r[o];let l=a[o];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=a[o]=So(a[o]),l.el=s.el),!n&&l.patchFlag!==-2&&bc(s,l)),l.type===ul&&(l.patchFlag===-1&&(l=a[o]=So(l)),l.el=s.el),l.type===Bn&&!l.el&&(l.el=s.el)}}function kv(e){const t=e.slice(),n=[0];let r,a,o,s,l;const c=e.length;for(r=0;r<c;r++){const f=e[r];if(f!==0){if(a=n[n.length-1],e[a]<f){t[r]=a,n.push(r);continue}for(o=0,s=n.length-1;o<s;)l=o+s>>1,e[n[l]]<f?o=l+1:s=l;f<e[n[o]]&&(o>0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,s=n[o-1];o-- >0;)n[o]=s,s=t[s];return n}function Qh(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Qh(t)}function cd(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Xh(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Xh(t.subTree):null}const Zh=e=>e.__isSuspense;function Cv(e,t){t&&t.pendingBranch?Ye(e)?t.effects.push(...e):t.effects.push(e):Ig(e)}const Ge=Symbol.for("v-fgt"),ul=Symbol.for("v-txt"),Bn=Symbol.for("v-cmt"),ji=Symbol.for("v-stc"),js=[];let or=null;function C(e=!1){js.push(or=e?null:[])}function xv(){js.pop(),or=js[js.length-1]||null}let Xa=1;function Gi(e,t=!1){Xa+=e,e<0&&or&&t&&(or.hasOnce=!0)}function ep(e){return e.dynamicChildren=Xa>0?or||Va:null,xv(),Xa>0&&or&&or.push(e),e}function R(e,t,n,r,a,o){return ep(m(e,t,n,r,a,o,!0))}function rt(e,t,n,r,a){return ep(Ne(e,t,n,r,a,!0))}function zs(e){return e?e.__v_isVNode===!0:!1}function ga(e,t){return e.type===t.type&&e.key===t.key}const tp=({key:e})=>e??null,Fi=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Vt(e)||qn(e)||ot(e)?{i:En,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,r=0,a=null,o=e===Ge?0:1,s=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&tp(t),ref:t&&Fi(t),scopeId:Ch,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:a,dynamicChildren:null,appContext:null,ctx:En};return l?(_c(c,n),o&128&&e.normalize(c)):n&&(c.shapeFlag|=Vt(n)?8:16),Xa>0&&!s&&or&&(c.patchFlag>0||o&6)&&c.patchFlag!==32&&or.push(c),c}const Ne=Av;function Av(e,t=null,n=null,r=0,a=null,o=!1){if((!e||e===Dh)&&(e=Bn),zs(e)){const l=Go(e,t,!0);return n&&_c(l,n),Xa>0&&!o&&or&&(l.shapeFlag&6?or[or.indexOf(e)]=l:or.push(l)),l.patchFlag=-2,l}if(Lv(e)&&(e=e.__vccOpts),t){t=Ev(t);let{class:l,style:c}=t;l&&!Vt(l)&&(t.class=it(l)),Rt(c)&&(pc(c)&&!Ye(c)&&(c=mn({},c)),t.style=Ao(c))}const s=Vt(e)?1:Zh(e)?128:Ih(e)?64:Rt(e)?4:ot(e)?2:0;return m(e,t,n,r,a,s,o,!0)}function Ev(e){return e?pc(e)||Vh(e)?mn({},e):e:null}function Go(e,t,n=!1,r=!1){const{props:a,ref:o,patchFlag:s,children:l,transition:c}=e,f=t?np(a||{},t):a,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&tp(f),ref:t&&t.ref?n&&o?Ye(o)?o.concat(Fi(t)):[o,Fi(t)]:Fi(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ge?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Go(e.ssContent),ssFallback:e.ssFallback&&Go(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&Hs(h,c.clone(h)),h}function _a(e=" ",t=0){return Ne(ul,null,e,t)}function Iv(e,t){const n=Ne(ji,null,e);return n.staticCount=t,n}function ie(e="",t=!1){return t?(C(),rt(Bn,null,e)):Ne(Bn,null,e)}function ho(e){return e==null||typeof e=="boolean"?Ne(Bn):Ye(e)?Ne(Ge,null,e.slice()):zs(e)?So(e):Ne(ul,null,String(e))}function So(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Go(e)}function _c(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Ye(t))n=16;else if(typeof t=="object")if(r&65){const a=t.default;a&&(a._c&&(a._d=!1),_c(e,a()),a._c&&(a._d=!0));return}else{n=32;const a=t._;!a&&!Vh(t)?t._ctx=En:a===3&&En&&(En.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ot(t)?(t={default:t,_ctx:En},n=32):(t=String(t),r&64?(n=16,t=[_a(t)]):n=8);e.children=t,e.shapeFlag|=n}function np(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const a in r)if(a==="class")t.class!==r.class&&(t.class=it([t.class,r.class]));else if(a==="style")t.style=Ao([t.style,r.style]);else if(Xi(a)){const o=t[a],s=r[a];s&&o!==s&&!(Ye(o)&&o.includes(s))?t[a]=o?[].concat(o,s):s:s==null&&o==null&&!Zi(a)&&(t[a]=s)}else a!==""&&(t[a]=r[a])}return t}function io(e,t,n,r=null){zr(e,t,7,[n,r])}const Pv=Uh();let Mv=0;function Rv(e,t,n){const r=e.type,a=(t?t.appContext:e.appContext)||Pv,o={uid:Mv++,vnode:e,type:r,parent:t,appContext:a,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Zm(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(a.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Gh(r,a),emitsOptions:Bh(r,a),emit:null,emitted:null,propsDefaults:jt,inheritAttrs:r.inheritAttrs,ctx:jt,data:jt,props:jt,attrs:jt,slots:jt,refs:jt,setupState:jt,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=uv.bind(null,o),e.ce&&e.ce(o),o}let An=null;const Tc=()=>An||En;let Ki,Hu;{const e=rl(),t=(n,r)=>{let a;return(a=e[n])||(a=e[n]=[]),a.push(r),o=>{a.length>1?a.forEach(s=>s(o)):a[0](o)}};Ki=t("__VUE_INSTANCE_SETTERS__",n=>An=n),Hu=t("__VUE_SSR_SETTERS__",n=>Za=n)}const Zs=e=>{const t=An;return Ki(e),e.scope.on(),()=>{e.scope.off(),Ki(t)}},dd=()=>{An&&An.scope.off(),Ki(null)};function rp(e){return e.vnode.shapeFlag&4}let Za=!1;function $v(e,t=!1,n=!1){t&&Hu(t);const{props:r,children:a}=e.vnode,o=rp(e);mv(e,r,o,t),wv(e,a,n||t);const s=o?Nv(e,t):void 0;return t&&Hu(!1),s}function Nv(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Xg);const{setup:r}=n;if(r){Io();const a=e.setupContext=r.length>1?ap(e):null,o=Zs(e),s=Ys(r,e,0,[e.props,a]),l=Qf(s);if(Po(),o(),(l||e.sp)&&!Ka(e)&&gc(e),l){if(s.then(dd,dd),t)return s.then(c=>{fd(e,c)}).catch(c=>{Qs(c,e,0)});e.asyncDep=s}else fd(e,s)}else op(e)}function fd(e,t,n){ot(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Rt(t)&&(e.setupState=bh(t)),op(e)}function op(e,t,n){const r=e.type;e.render||(e.render=r.render||mo);{const a=Zs(e);Io();try{tv(e)}finally{Po(),a()}}}const Ov={get(e,t){return Un(e,"get",""),e[t]}};function ap(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Ov),slots:e.slots,emit:e.emit,expose:t}}function cl(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(bh(wg(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Ls)return Ls[n](e)},has(t,n){return n in t||n in Ls}})):e.proxy}function Dv(e,t=!0){return ot(e)?e.displayName||e.name:e.name||t&&e.__name}function Lv(e){return ot(e)&&"__vccOpts"in e}const le=(e,t)=>kg(e,t,Za);function Sc(e,t,n){try{Gi(-1);const r=arguments.length;return r===2?Rt(t)&&!Ye(t)?zs(t)?Ne(e,null,[t]):Ne(e,t):Ne(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&zs(n)&&(n=[n]),Ne(e,t,n))}finally{Gi(1)}}function iP(e,t,n,r){const a=n[r];if(a&&jv(a,e))return a;const o=t();return o.memo=e.slice(),o.cacheIndex=r,n[r]=o}function jv(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let r=0;r<n.length;r++)if(jr(n[r],t[r]))return!1;return Xa>0&&or&&or.push(e),!0}const Fv="3.5.33";/**
|
|
15
|
-
* @vue/runtime-dom v3.5.33
|
|
16
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
17
|
-
* @license MIT
|
|
18
|
-
**/let zu;const hd=typeof window<"u"&&window.trustedTypes;if(hd)try{zu=hd.createPolicy("vue",{createHTML:e=>e})}catch{}const sp=zu?e=>zu.createHTML(e):e=>e,Uv="http://www.w3.org/2000/svg",Bv="http://www.w3.org/1998/Math/MathML",To=typeof document<"u"?document:null,pd=To&&To.createElement("template"),qv={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 a=t==="svg"?To.createElementNS(Uv,e):t==="mathml"?To.createElementNS(Bv,e):n?To.createElement(e,{is:n}):To.createElement(e);return e==="select"&&r&&r.multiple!=null&&a.setAttribute("multiple",r.multiple),a},createText:e=>To.createTextNode(e),createComment:e=>To.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>To.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,a,o){const s=n?n.previousSibling:t.lastChild;if(a&&(a===o||a.nextSibling))for(;t.insertBefore(a.cloneNode(!0),n),!(a===o||!(a=a.nextSibling)););else{pd.innerHTML=sp(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const l=pd.content;if(r==="svg"||r==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},jo="transition",Cs="animation",Vs=Symbol("_vtc"),ip={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},Hv=mn({},Ph,ip),zv=e=>(e.displayName="Transition",e.props=Hv,e),lp=zv((e,{slots:t})=>Sc(jg,Vv(e),t)),da=(e,t=[])=>{Ye(e)?e.forEach(n=>n(...t)):e&&e(...t)},md=e=>e?Ye(e)?e.some(t=>t.length>1):e.length>1:!1;function Vv(e){const t={};for(const ee in e)ee in ip||(t[ee]=e[ee]);if(e.css===!1)return t;const{name:n="v",type:r,duration:a,enterFromClass:o=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:c=o,appearActiveClass:f=s,appearToClass:h=l,leaveFromClass:g=`${n}-leave-from`,leaveActiveClass:b=`${n}-leave-active`,leaveToClass:x=`${n}-leave-to`}=e,j=Wv(a),q=j&&j[0],te=j&&j[1],{onBeforeEnter:z,onEnter:O,onEnterCancelled:V,onLeave:Z,onLeaveCancelled:Ae,onBeforeAppear:Ue=z,onAppear:ne=O,onAppearCancelled:Se=V}=t,Y=(ee,we,Re,Ke)=>{ee._enterCancelled=Ke,fa(ee,we?h:l),fa(ee,we?f:s),Re&&Re()},Ee=(ee,we)=>{ee._isLeaving=!1,fa(ee,g),fa(ee,x),fa(ee,b),we&&we()},He=ee=>(we,Re)=>{const Ke=ee?ne:O,Be=()=>Y(we,ee,Re);da(Ke,[we,Be]),gd(()=>{fa(we,ee?c:o),bo(we,ee?h:l),md(Ke)||vd(we,r,q,Be)})};return mn(t,{onBeforeEnter(ee){da(z,[ee]),bo(ee,o),bo(ee,s)},onBeforeAppear(ee){da(Ue,[ee]),bo(ee,c),bo(ee,f)},onEnter:He(!1),onAppear:He(!0),onLeave(ee,we){ee._isLeaving=!0;const Re=()=>Ee(ee,we);bo(ee,g),ee._enterCancelled?(bo(ee,b),bd(ee)):(bd(ee),bo(ee,b)),gd(()=>{ee._isLeaving&&(fa(ee,g),bo(ee,x),md(Z)||vd(ee,r,te,Re))}),da(Z,[ee,Re])},onEnterCancelled(ee){Y(ee,!1,void 0,!0),da(V,[ee])},onAppearCancelled(ee){Y(ee,!0,void 0,!0),da(Se,[ee])},onLeaveCancelled(ee){Ee(ee),da(Ae,[ee])}})}function Wv(e){if(e==null)return null;if(Rt(e))return[su(e.enter),su(e.leave)];{const t=su(e);return[t,t]}}function su(e){return Vm(e)}function bo(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Vs]||(e[Vs]=new Set)).add(t)}function fa(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Vs];n&&(n.delete(t),n.size||(e[Vs]=void 0))}function gd(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Gv=0;function vd(e,t,n,r){const a=e._endId=++Gv,o=()=>{a===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:s,timeout:l,propCount:c}=Kv(e,t);if(!s)return r();const f=s+"end";let h=0;const g=()=>{e.removeEventListener(f,b),o()},b=x=>{x.target===e&&++h>=c&&g()};setTimeout(()=>{h<c&&g()},l+1),e.addEventListener(f,b)}function Kv(e,t){const n=window.getComputedStyle(e),r=j=>(n[j]||"").split(", "),a=r(`${jo}Delay`),o=r(`${jo}Duration`),s=yd(a,o),l=r(`${Cs}Delay`),c=r(`${Cs}Duration`),f=yd(l,c);let h=null,g=0,b=0;t===jo?s>0&&(h=jo,g=s,b=o.length):t===Cs?f>0&&(h=Cs,g=f,b=c.length):(g=Math.max(s,f),h=g>0?s>f?jo:Cs:null,b=h?h===jo?o.length:c.length:0);const x=h===jo&&/\b(?:transform|all)(?:,|$)/.test(r(`${jo}Property`).toString());return{type:h,timeout:g,propCount:b,hasTransform:x}}function yd(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>wd(n)+wd(e[r])))}function wd(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function bd(e){return(e?e.ownerDocument:document).body.offsetHeight}function Jv(e,t,n){const r=e[Vs];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const _d=Symbol("_vod"),Yv=Symbol("_vsh"),Qv=Symbol(""),Xv=/(?:^|;)\s*display\s*:/;function Zv(e,t,n){const r=e.style,a=Vt(n);let o=!1;if(n&&!a){if(t)if(Vt(t))for(const s of t.split(";")){const l=s.slice(0,s.indexOf(":")).trim();n[l]==null&&Ps(r,l,"")}else for(const s in t)n[s]==null&&Ps(r,s,"");for(const s in n){s==="display"&&(o=!0);const l=n[s];l!=null?ty(e,s,!Vt(t)&&t?t[s]:void 0,l)||Ps(r,s,l):Ps(r,s,"")}}else if(a){if(t!==n){const s=r[Qv];s&&(n+=";"+s),r.cssText=n,o=Xv.test(n)}}else t&&e.removeAttribute("style");_d in e&&(e[_d]=o?r.display:"",e[Yv]&&(r.display="none"))}const Td=/\s*!important$/;function Ps(e,t,n){if(Ye(n))n.forEach(r=>Ps(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=ey(e,t);Td.test(n)?e.setProperty(Ko(r),n.replace(Td,""),"important"):e[r]=n}}const Sd=["Webkit","Moz","ms"],iu={};function ey(e,t){const n=iu[t];if(n)return n;let r=ar(t);if(r!=="filter"&&r in e)return iu[t]=r;r=tl(r);for(let a=0;a<Sd.length;a++){const o=Sd[a]+r;if(o in e)return iu[t]=o}return t}function ty(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Vt(r)&&n===r}const kd="http://www.w3.org/1999/xlink";function Cd(e,t,n,r,a,o=Qm(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(kd,t.slice(6,t.length)):e.setAttributeNS(kd,t,n):n==null||o&&!th(n)?e.removeAttribute(t):e.setAttribute(t,o?"":qr(n)?String(n):n)}function xd(e,t,n,r,a){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?sp(n):n);return}const o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){const l=o==="OPTION"?e.getAttribute("value")||"":e.value,c=n==null?e.type==="checkbox"?"on":"":String(n);(l!==c||!("_value"in e))&&(e.value=c),n==null&&e.removeAttribute(t),e._value=n;return}let s=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=th(n):n==null&&l==="string"?(n="",s=!0):l==="number"&&(n=0,s=!0)}try{e[t]=n}catch{}s&&e.removeAttribute(a||t)}function Wo(e,t,n,r){e.addEventListener(t,n,r)}function ny(e,t,n,r){e.removeEventListener(t,n,r)}const Ad=Symbol("_vei");function ry(e,t,n,r,a=null){const o=e[Ad]||(e[Ad]={}),s=o[t];if(r&&s)s.value=r;else{const[l,c]=oy(t);if(r){const f=o[t]=iy(r,a);Wo(e,l,f,c)}else s&&(ny(e,l,s,c),o[t]=void 0)}}const Ed=/(?:Once|Passive|Capture)$/;function oy(e){let t;if(Ed.test(e)){t={};let r;for(;r=e.match(Ed);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Ko(e.slice(2)),t]}let lu=0;const ay=Promise.resolve(),sy=()=>lu||(ay.then(()=>lu=0),lu=Date.now());function iy(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;zr(ly(r,n.value),t,5,[r])};return n.value=e,n.attached=sy(),n}function ly(e,t){if(Ye(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>a=>!a._stopped&&r&&r(a))}else return t}const Id=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,uy=(e,t,n,r,a,o)=>{const s=a==="svg";t==="class"?Jv(e,r,s):t==="style"?Zv(e,n,r):Xi(t)?Zi(t)||ry(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):cy(e,t,r,s))?(xd(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Cd(e,t,r,s,o,t!=="value")):e._isVueCE&&(dy(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Vt(r)))?xd(e,ar(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Cd(e,t,r,s))};function cy(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Id(t)&&ot(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 a=e.tagName;if(a==="IMG"||a==="VIDEO"||a==="CANVAS"||a==="SOURCE")return!1}return Id(t)&&Vt(n)?!1:t in e}function dy(e,t){const n=e._def.props;if(!n)return!1;const r=ar(t);return Array.isArray(n)?n.some(a=>ar(a)===r):Object.keys(n).some(a=>ar(a)===r)}const es=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Ye(t)?n=>Di(t,n):t};function fy(e){e.target.composing=!0}function Pd(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Eo=Symbol("_assign");function Md(e,t,n){return t&&(e=e.trim()),n&&(e=nl(e)),e}const Tn={created(e,{modifiers:{lazy:t,trim:n,number:r}},a){e[Eo]=es(a);const o=r||a.props&&a.props.type==="number";Wo(e,t?"change":"input",s=>{s.target.composing||e[Eo](Md(e.value,n,o))}),(n||o)&&Wo(e,"change",()=>{e.value=Md(e.value,n,o)}),t||(Wo(e,"compositionstart",fy),Wo(e,"compositionend",Pd),Wo(e,"change",Pd))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:a,number:o}},s){if(e[Eo]=es(s),e.composing)return;const l=(o||e.type==="number")&&!/^0\d/.test(e.value)?nl(e.value):e.value,c=t??"";if(l===c)return;const f=e.getRootNode();(f instanceof Document||f instanceof ShadowRoot)&&f.activeElement===e&&e.type!=="range"&&(r&&t===n||a&&e.value.trim()===c)||(e.value=c)}},hy={deep:!0,created(e,t,n){e[Eo]=es(n),Wo(e,"change",()=>{const r=e._modelValue,a=Ws(e),o=e.checked,s=e[Eo];if(Ye(r)){const l=ic(r,a),c=l!==-1;if(o&&!c)s(r.concat(a));else if(!o&&c){const f=[...r];f.splice(l,1),s(f)}}else if(os(r)){const l=new Set(r);o?l.add(a):l.delete(a),s(l)}else s(up(e,o))})},mounted:Rd,beforeUpdate(e,t,n){e[Eo]=es(n),Rd(e,t,n)}};function Rd(e,{value:t,oldValue:n},r){e._modelValue=t;let a;if(Ye(t))a=ic(t,r.props.value)>-1;else if(os(t))a=t.has(r.props.value);else{if(t===n)return;a=as(t,up(e,!0))}e.checked!==a&&(e.checked=a)}const py={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const a=os(t);Wo(e,"change",()=>{const o=Array.prototype.filter.call(e.options,s=>s.selected).map(s=>n?nl(Ws(s)):Ws(s));e[Eo](e.multiple?a?new Set(o):o:o[0]),e._assigning=!0,an(()=>{e._assigning=!1})}),e[Eo]=es(r)},mounted(e,{value:t}){$d(e,t)},beforeUpdate(e,t,n){e[Eo]=es(n)},updated(e,{value:t}){e._assigning||$d(e,t)}};function $d(e,t){const n=e.multiple,r=Ye(t);if(!(n&&!r&&!os(t))){for(let a=0,o=e.options.length;a<o;a++){const s=e.options[a],l=Ws(s);if(n)if(r){const c=typeof l;c==="string"||c==="number"?s.selected=t.some(f=>String(f)===String(l)):s.selected=ic(t,l)>-1}else s.selected=t.has(l);else if(as(Ws(s),t)){e.selectedIndex!==a&&(e.selectedIndex=a);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ws(e){return"_value"in e?e._value:e.value}function up(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const my=["ctrl","shift","alt","meta"],gy={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)=>my.some(n=>e[`${n}Key`]&&!t.includes(n))},et=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((a,...o)=>{for(let s=0;s<t.length;s++){const l=gy[t[s]];if(l&&l(a,t))return}return e(a,...o)}))},vy={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},dn=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(a=>{if(!("key"in a))return;const o=Ko(a.key);if(t.some(s=>s===o||vy[s]===o))return e(a)}))},yy=mn({patchProp:uy},qv);let Nd;function wy(){return Nd||(Nd=_v(yy))}const by=((...e)=>{const t=wy().createApp(...e),{mount:n}=t;return t.mount=r=>{const a=Ty(r);if(!a)return;const o=t._component;!ot(o)&&!o.render&&!o.template&&(o.template=a.innerHTML),a.nodeType===1&&(a.textContent="");const s=n(a,!1,_y(a));return a instanceof Element&&(a.removeAttribute("v-cloak"),a.setAttribute("data-v-app","")),s},t});function _y(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ty(e){return Vt(e)?document.querySelector(e):e}const Sy="modulepreload",ky=function(e){return"/"+e},Od={},Ei=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let s=function(f){return Promise.all(f.map(h=>Promise.resolve(h).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));a=s(n.map(f=>{if(f=ky(f),f in Od)return;Od[f]=!0;const h=f.endsWith(".css"),g=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const b=document.createElement("link");if(b.rel=h?"stylesheet":Sy,h||(b.as="script"),b.crossOrigin="",b.href=f,c&&b.setAttribute("nonce",c),document.head.appendChild(b),h)return new Promise((x,j)=>{b.addEventListener("load",x),b.addEventListener("error",()=>j(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return a.then(s=>{for(const l of s||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})};/*!
|
|
19
|
-
* vue-router v4.6.4
|
|
20
|
-
* (c) 2025 Eduardo San Martin Morote
|
|
21
|
-
* @license MIT
|
|
22
|
-
*/const ja=typeof document<"u";function cp(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Cy(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&cp(e.default)}const Pt=Object.assign;function uu(e,t){const n={};for(const r in t){const a=t[r];n[r]=Vr(a)?a.map(e):e(a)}return n}const Fs=()=>{},Vr=Array.isArray;function Dd(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const dp=/#/g,xy=/&/g,Ay=/\//g,Ey=/=/g,Iy=/\?/g,fp=/\+/g,Py=/%5B/g,My=/%5D/g,hp=/%5E/g,Ry=/%60/g,pp=/%7B/g,$y=/%7C/g,mp=/%7D/g,Ny=/%20/g;function kc(e){return e==null?"":encodeURI(""+e).replace($y,"|").replace(Py,"[").replace(My,"]")}function Oy(e){return kc(e).replace(pp,"{").replace(mp,"}").replace(hp,"^")}function Vu(e){return kc(e).replace(fp,"%2B").replace(Ny,"+").replace(dp,"%23").replace(xy,"%26").replace(Ry,"`").replace(pp,"{").replace(mp,"}").replace(hp,"^")}function Dy(e){return Vu(e).replace(Ey,"%3D")}function Ly(e){return kc(e).replace(dp,"%23").replace(Iy,"%3F")}function jy(e){return Ly(e).replace(Ay,"%2F")}function Gs(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Fy=/\/$/,Uy=e=>e.replace(Fy,"");function cu(e,t,n="/"){let r,a={},o="",s="";const l=t.indexOf("#");let c=t.indexOf("?");return c=l>=0&&c>l?-1:c,c>=0&&(r=t.slice(0,c),o=t.slice(c,l>0?l:t.length),a=e(o.slice(1))),l>=0&&(r=r||t.slice(0,l),s=t.slice(l,t.length)),r=zy(r??t,n),{fullPath:r+o+s,path:r,query:a,hash:Gs(s)}}function By(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Ld(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function qy(e,t,n){const r=t.matched.length-1,a=n.matched.length-1;return r>-1&&r===a&&ts(t.matched[r],n.matched[a])&&gp(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function ts(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function gp(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Hy(e[n],t[n]))return!1;return!0}function Hy(e,t){return Vr(e)?jd(e,t):Vr(t)?jd(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function jd(e,t){return Vr(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function zy(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),a=r[r.length-1];(a===".."||a===".")&&r.push("");let o=n.length-1,s,l;for(s=0;s<r.length;s++)if(l=r[s],l!==".")if(l==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(s).join("/")}const Fo={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Wu=(function(e){return e.pop="pop",e.push="push",e})({}),du=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Vy(e){if(!e)if(ja){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Uy(e)}const Wy=/^[^#]+#/;function Gy(e,t){return e.replace(Wy,"#")+t}function Ky(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 dl=()=>({left:window.scrollX,top:window.scrollY});function Jy(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),a=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!a)return;t=Ky(a,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 Fd(e,t){return(history.state?history.state.position-t:-1)+e}const Gu=new Map;function Yy(e,t){Gu.set(e,t)}function Qy(e){const t=Gu.get(e);return Gu.delete(e),t}function Xy(e){return typeof e=="string"||e&&typeof e=="object"}function vp(e){return typeof e=="string"||typeof e=="symbol"}let en=(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 yp=Symbol("");en.MATCHER_NOT_FOUND+"",en.NAVIGATION_GUARD_REDIRECT+"",en.NAVIGATION_ABORTED+"",en.NAVIGATION_CANCELLED+"",en.NAVIGATION_DUPLICATED+"";function ns(e,t){return Pt(new Error,{type:e,[yp]:!0},t)}function _o(e,t){return e instanceof Error&&yp in e&&(t==null||!!(e.type&t))}const Zy=["params","query","hash"];function ew(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Zy)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function tw(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 a=n[r].replace(fp," "),o=a.indexOf("="),s=Gs(o<0?a:a.slice(0,o)),l=o<0?null:Gs(a.slice(o+1));if(s in t){let c=t[s];Vr(c)||(c=t[s]=[c]),c.push(l)}else t[s]=l}return t}function Ud(e){let t="";for(let n in e){const r=e[n];if(n=Dy(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(Vr(r)?r.map(a=>a&&Vu(a)):[r&&Vu(r)]).forEach(a=>{a!==void 0&&(t+=(t.length?"&":"")+n,a!=null&&(t+="="+a))})}return t}function nw(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=Vr(r)?r.map(a=>a==null?null:""+a):r==null?r:""+r)}return t}const rw=Symbol(""),Bd=Symbol(""),fl=Symbol(""),Cc=Symbol(""),Ku=Symbol("");function xs(){let e=[];function t(r){return e.push(r),()=>{const a=e.indexOf(r);a>-1&&e.splice(a,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function zo(e,t,n,r,a,o=s=>s()){const s=r&&(r.enterCallbacks[a]=r.enterCallbacks[a]||[]);return()=>new Promise((l,c)=>{const f=b=>{b===!1?c(ns(en.NAVIGATION_ABORTED,{from:n,to:t})):b instanceof Error?c(b):Xy(b)?c(ns(en.NAVIGATION_GUARD_REDIRECT,{from:t,to:b})):(s&&r.enterCallbacks[a]===s&&typeof b=="function"&&s.push(b),l())},h=o(()=>e.call(r&&r.instances[a],t,n,f));let g=Promise.resolve(h);e.length<3&&(g=g.then(f)),g.catch(b=>c(b))})}function fu(e,t,n,r,a=o=>o()){const o=[];for(const s of e)for(const l in s.components){let c=s.components[l];if(!(t!=="beforeRouteEnter"&&!s.instances[l]))if(cp(c)){const f=(c.__vccOpts||c)[t];f&&o.push(zo(f,n,r,s,l,a))}else{let f=c();o.push(()=>f.then(h=>{if(!h)throw new Error(`Couldn't resolve component "${l}" at "${s.path}"`);const g=Cy(h)?h.default:h;s.mods[l]=h,s.components[l]=g;const b=(g.__vccOpts||g)[t];return b&&zo(b,n,r,s,l,a)()}))}}return o}function ow(e,t){const n=[],r=[],a=[],o=Math.max(t.matched.length,e.matched.length);for(let s=0;s<o;s++){const l=t.matched[s];l&&(e.matched.find(f=>ts(f,l))?r.push(l):n.push(l));const c=e.matched[s];c&&(t.matched.find(f=>ts(f,c))||a.push(c))}return[n,r,a]}/*!
|
|
23
|
-
* vue-router v4.6.4
|
|
24
|
-
* (c) 2025 Eduardo San Martin Morote
|
|
25
|
-
* @license MIT
|
|
26
|
-
*/let aw=()=>location.protocol+"//"+location.host;function wp(e,t){const{pathname:n,search:r,hash:a}=t,o=e.indexOf("#");if(o>-1){let s=a.includes(e.slice(o))?e.slice(o).length:1,l=a.slice(s);return l[0]!=="/"&&(l="/"+l),Ld(l,"")}return Ld(n,e)+r+a}function sw(e,t,n,r){let a=[],o=[],s=null;const l=({state:b})=>{const x=wp(e,location),j=n.value,q=t.value;let te=0;if(b){if(n.value=x,t.value=b,s&&s===j){s=null;return}te=q?b.position-q.position:0}else r(x);a.forEach(z=>{z(n.value,j,{delta:te,type:Wu.pop,direction:te?te>0?du.forward:du.back:du.unknown})})};function c(){s=n.value}function f(b){a.push(b);const x=()=>{const j=a.indexOf(b);j>-1&&a.splice(j,1)};return o.push(x),x}function h(){if(document.visibilityState==="hidden"){const{history:b}=window;if(!b.state)return;b.replaceState(Pt({},b.state,{scroll:dl()}),"")}}function g(){for(const b of o)b();o=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",h),document.removeEventListener("visibilitychange",h)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",h),document.addEventListener("visibilitychange",h),{pauseListeners:c,listen:f,destroy:g}}function qd(e,t,n,r=!1,a=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:a?dl():null}}function iw(e){const{history:t,location:n}=window,r={value:wp(e,n)},a={value:t.state};a.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(c,f,h){const g=e.indexOf("#"),b=g>-1?(n.host&&document.querySelector("base")?e:e.slice(g))+c:aw()+e+c;try{t[h?"replaceState":"pushState"](f,"",b),a.value=f}catch(x){console.error(x),n[h?"replace":"assign"](b)}}function s(c,f){o(c,Pt({},t.state,qd(a.value.back,c,a.value.forward,!0),f,{position:a.value.position}),!0),r.value=c}function l(c,f){const h=Pt({},a.value,t.state,{forward:c,scroll:dl()});o(h.current,h,!0),o(c,Pt({},qd(r.value,c,null),{position:h.position+1},f),!1),r.value=c}return{location:r,state:a,push:l,replace:s}}function lw(e){e=Vy(e);const t=iw(e),n=sw(e,t.state,t.location,t.replace);function r(o,s=!0){s||n.pauseListeners(),history.go(o)}const a=Pt({location:"",base:e,go:r,createHref:Gy.bind(null,e)},t,n);return Object.defineProperty(a,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(a,"state",{enumerable:!0,get:()=>t.state.value}),a}function uw(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),lw(e)}let ya=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var hn=(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})(hn||{});const cw={type:ya.Static,value:""},dw=/[a-zA-Z0-9_]/;function fw(e){if(!e)return[[]];if(e==="/")return[[cw]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(x){throw new Error(`ERR (${n})/"${f}": ${x}`)}let n=hn.Static,r=n;const a=[];let o;function s(){o&&a.push(o),o=[]}let l=0,c,f="",h="";function g(){f&&(n===hn.Static?o.push({type:ya.Static,value:f}):n===hn.Param||n===hn.ParamRegExp||n===hn.ParamRegExpEnd?(o.length>1&&(c==="*"||c==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),o.push({type:ya.Param,value:f,regexp:h,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):t("Invalid state to consume buffer"),f="")}function b(){f+=c}for(;l<e.length;){if(c=e[l++],c==="\\"&&n!==hn.ParamRegExp){r=n,n=hn.EscapeNext;continue}switch(n){case hn.Static:c==="/"?(f&&g(),s()):c===":"?(g(),n=hn.Param):b();break;case hn.EscapeNext:b(),n=r;break;case hn.Param:c==="("?n=hn.ParamRegExp:dw.test(c)?b():(g(),n=hn.Static,c!=="*"&&c!=="?"&&c!=="+"&&l--);break;case hn.ParamRegExp:c===")"?h[h.length-1]=="\\"?h=h.slice(0,-1)+c:n=hn.ParamRegExpEnd:h+=c;break;case hn.ParamRegExpEnd:g(),n=hn.Static,c!=="*"&&c!=="?"&&c!=="+"&&l--,h="";break;default:t("Unknown state");break}}return n===hn.ParamRegExp&&t(`Unfinished custom RegExp for param "${f}"`),g(),s(),a}const Hd="[^/]+?",hw={sensitive:!1,strict:!1,start:!0,end:!0};var nr=(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})(nr||{});const pw=/[.+*?^${}()[\]/\\]/g;function mw(e,t){const n=Pt({},hw,t),r=[];let a=n.start?"^":"";const o=[];for(const f of e){const h=f.length?[]:[nr.Root];n.strict&&!f.length&&(a+="/");for(let g=0;g<f.length;g++){const b=f[g];let x=nr.Segment+(n.sensitive?nr.BonusCaseSensitive:0);if(b.type===ya.Static)g||(a+="/"),a+=b.value.replace(pw,"\\$&"),x+=nr.Static;else if(b.type===ya.Param){const{value:j,repeatable:q,optional:te,regexp:z}=b;o.push({name:j,repeatable:q,optional:te});const O=z||Hd;if(O!==Hd){x+=nr.BonusCustomRegExp;try{`${O}`}catch(Z){throw new Error(`Invalid custom RegExp for param "${j}" (${O}): `+Z.message)}}let V=q?`((?:${O})(?:/(?:${O}))*)`:`(${O})`;g||(V=te&&f.length<2?`(?:/${V})`:"/"+V),te&&(V+="?"),a+=V,x+=nr.Dynamic,te&&(x+=nr.BonusOptional),q&&(x+=nr.BonusRepeatable),O===".*"&&(x+=nr.BonusWildcard)}h.push(x)}r.push(h)}if(n.strict&&n.end){const f=r.length-1;r[f][r[f].length-1]+=nr.BonusStrict}n.strict||(a+="/?"),n.end?a+="$":n.strict&&!a.endsWith("/")&&(a+="(?:/|$)");const s=new RegExp(a,n.sensitive?"":"i");function l(f){const h=f.match(s),g={};if(!h)return null;for(let b=1;b<h.length;b++){const x=h[b]||"",j=o[b-1];g[j.name]=x&&j.repeatable?x.split("/"):x}return g}function c(f){let h="",g=!1;for(const b of e){(!g||!h.endsWith("/"))&&(h+="/"),g=!1;for(const x of b)if(x.type===ya.Static)h+=x.value;else if(x.type===ya.Param){const{value:j,repeatable:q,optional:te}=x,z=j in f?f[j]:"";if(Vr(z)&&!q)throw new Error(`Provided param "${j}" is an array but it is not repeatable (* or + modifiers)`);const O=Vr(z)?z.join("/"):z;if(!O)if(te)b.length<2&&(h.endsWith("/")?h=h.slice(0,-1):g=!0);else throw new Error(`Missing required param "${j}"`);h+=O}}return h||"/"}return{re:s,score:r,keys:o,parse:l,stringify:c}}function gw(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]===nr.Static+nr.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===nr.Static+nr.Segment?1:-1:0}function bp(e,t){let n=0;const r=e.score,a=t.score;for(;n<r.length&&n<a.length;){const o=gw(r[n],a[n]);if(o)return o;n++}if(Math.abs(a.length-r.length)===1){if(zd(r))return 1;if(zd(a))return-1}return a.length-r.length}function zd(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const vw={strict:!1,end:!0,sensitive:!1};function yw(e,t,n){const r=mw(fw(e.path),n),a=Pt(r,{record:e,parent:t,children:[],alias:[]});return t&&!a.record.aliasOf==!t.record.aliasOf&&t.children.push(a),a}function ww(e,t){const n=[],r=new Map;t=Dd(vw,t);function a(g){return r.get(g)}function o(g,b,x){const j=!x,q=Wd(g);q.aliasOf=x&&x.record;const te=Dd(t,g),z=[q];if("alias"in g){const Z=typeof g.alias=="string"?[g.alias]:g.alias;for(const Ae of Z)z.push(Wd(Pt({},q,{components:x?x.record.components:q.components,path:Ae,aliasOf:x?x.record:q})))}let O,V;for(const Z of z){const{path:Ae}=Z;if(b&&Ae[0]!=="/"){const Ue=b.record.path,ne=Ue[Ue.length-1]==="/"?"":"/";Z.path=b.record.path+(Ae&&ne+Ae)}if(O=yw(Z,b,te),x?x.alias.push(O):(V=V||O,V!==O&&V.alias.push(O),j&&g.name&&!Gd(O)&&s(g.name)),_p(O)&&c(O),q.children){const Ue=q.children;for(let ne=0;ne<Ue.length;ne++)o(Ue[ne],O,x&&x.children[ne])}x=x||O}return V?()=>{s(V)}:Fs}function s(g){if(vp(g)){const b=r.get(g);b&&(r.delete(g),n.splice(n.indexOf(b),1),b.children.forEach(s),b.alias.forEach(s))}else{const b=n.indexOf(g);b>-1&&(n.splice(b,1),g.record.name&&r.delete(g.record.name),g.children.forEach(s),g.alias.forEach(s))}}function l(){return n}function c(g){const b=Tw(g,n);n.splice(b,0,g),g.record.name&&!Gd(g)&&r.set(g.record.name,g)}function f(g,b){let x,j={},q,te;if("name"in g&&g.name){if(x=r.get(g.name),!x)throw ns(en.MATCHER_NOT_FOUND,{location:g});te=x.record.name,j=Pt(Vd(b.params,x.keys.filter(V=>!V.optional).concat(x.parent?x.parent.keys.filter(V=>V.optional):[]).map(V=>V.name)),g.params&&Vd(g.params,x.keys.map(V=>V.name))),q=x.stringify(j)}else if(g.path!=null)q=g.path,x=n.find(V=>V.re.test(q)),x&&(j=x.parse(q),te=x.record.name);else{if(x=b.name?r.get(b.name):n.find(V=>V.re.test(b.path)),!x)throw ns(en.MATCHER_NOT_FOUND,{location:g,currentLocation:b});te=x.record.name,j=Pt({},b.params,g.params),q=x.stringify(j)}const z=[];let O=x;for(;O;)z.unshift(O.record),O=O.parent;return{name:te,path:q,params:j,matched:z,meta:_w(z)}}e.forEach(g=>o(g));function h(){n.length=0,r.clear()}return{addRoute:o,resolve:f,removeRoute:s,clearRoutes:h,getRoutes:l,getRecordMatcher:a}}function Vd(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Wd(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:bw(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 bw(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 Gd(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function _w(e){return e.reduce((t,n)=>Pt(t,n.meta),{})}function Tw(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;bp(e,t[o])<0?r=o:n=o+1}const a=Sw(e);return a&&(r=t.lastIndexOf(a,r-1)),r}function Sw(e){let t=e;for(;t=t.parent;)if(_p(t)&&bp(e,t)===0)return t}function _p({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Kd(e){const t=Br(fl),n=Br(Cc),r=le(()=>{const c=S(e.to);return t.resolve(c)}),a=le(()=>{const{matched:c}=r.value,{length:f}=c,h=c[f-1],g=n.matched;if(!h||!g.length)return-1;const b=g.findIndex(ts.bind(null,h));if(b>-1)return b;const x=Jd(c[f-2]);return f>1&&Jd(h)===x&&g[g.length-1].path!==x?g.findIndex(ts.bind(null,c[f-2])):b}),o=le(()=>a.value>-1&&Ew(n.params,r.value.params)),s=le(()=>a.value>-1&&a.value===n.matched.length-1&&gp(n.params,r.value.params));function l(c={}){if(Aw(c)){const f=t[S(e.replace)?"replace":"push"](S(e.to)).catch(Fs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>f),f}return Promise.resolve()}return{route:r,href:le(()=>r.value.href),isActive:o,isExactActive:s,navigate:l}}function kw(e){return e.length===1?e[0]:e}const Cw=Hn({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:Kd,setup(e,{slots:t}){const n=al(Kd(e)),{options:r}=Br(fl),a=le(()=>({[Yd(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Yd(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&kw(t.default(n));return e.custom?o:Sc("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:a.value},o)}}}),xw=Cw;function Aw(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 Ew(e,t){for(const n in t){const r=t[n],a=e[n];if(typeof r=="string"){if(r!==a)return!1}else if(!Vr(a)||a.length!==r.length||r.some((o,s)=>o.valueOf()!==a[s].valueOf()))return!1}return!0}function Jd(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Yd=(e,t,n)=>e??t??n,Iw=Hn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Br(Ku),a=le(()=>e.route||r.value),o=Br(Bd,0),s=le(()=>{let f=S(o);const{matched:h}=a.value;let g;for(;(g=h[f])&&!g.components;)f++;return f}),l=le(()=>a.value.matched[s.value]);Li(Bd,le(()=>s.value+1)),Li(rw,l),Li(Ku,a);const c=P();return gt(()=>[c.value,l.value,e.name],([f,h,g],[b,x,j])=>{h&&(h.instances[g]=f,x&&x!==h&&f&&f===b&&(h.leaveGuards.size||(h.leaveGuards=x.leaveGuards),h.updateGuards.size||(h.updateGuards=x.updateGuards))),f&&h&&(!x||!ts(h,x)||!b)&&(h.enterCallbacks[g]||[]).forEach(q=>q(f))},{flush:"post"}),()=>{const f=a.value,h=e.name,g=l.value,b=g&&g.components[h];if(!b)return Qd(n.default,{Component:b,route:f});const x=g.props[h],j=x?x===!0?f.params:typeof x=="function"?x(f):x:null,te=Sc(b,Pt({},j,t,{onVnodeUnmounted:z=>{z.component.isUnmounted&&(g.instances[h]=null)},ref:c}));return Qd(n.default,{Component:te,route:f})||te}}});function Qd(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Pw=Iw;function Mw(e){const t=ww(e.routes,e),n=e.parseQuery||tw,r=e.stringifyQuery||Ud,a=e.history,o=xs(),s=xs(),l=xs(),c=bg(Fo);let f=Fo;ja&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const h=uu.bind(null,K=>""+K),g=uu.bind(null,jy),b=uu.bind(null,Gs);function x(K,_e){let be,Oe;return vp(K)?(be=t.getRecordMatcher(K),Oe=_e):Oe=K,t.addRoute(Oe,be)}function j(K){const _e=t.getRecordMatcher(K);_e&&t.removeRoute(_e)}function q(){return t.getRoutes().map(K=>K.record)}function te(K){return!!t.getRecordMatcher(K)}function z(K,_e){if(_e=Pt({},_e||c.value),typeof K=="string"){const H=cu(n,K,_e.path),re=t.resolve({path:H.path},_e),J=a.createHref(H.fullPath);return Pt(H,re,{params:b(re.params),hash:Gs(H.hash),redirectedFrom:void 0,href:J})}let be;if(K.path!=null)be=Pt({},K,{path:cu(n,K.path,_e.path).path});else{const H=Pt({},K.params);for(const re in H)H[re]==null&&delete H[re];be=Pt({},K,{params:g(H)}),_e.params=g(_e.params)}const Oe=t.resolve(be,_e),Je=K.hash||"";Oe.params=h(b(Oe.params));const k=By(r,Pt({},K,{hash:Oy(Je),path:Oe.path})),I=a.createHref(k);return Pt({fullPath:k,hash:Je,query:r===Ud?nw(K.query):K.query||{}},Oe,{redirectedFrom:void 0,href:I})}function O(K){return typeof K=="string"?cu(n,K,c.value.path):Pt({},K)}function V(K,_e){if(f!==K)return ns(en.NAVIGATION_CANCELLED,{from:_e,to:K})}function Z(K){return ne(K)}function Ae(K){return Z(Pt(O(K),{replace:!0}))}function Ue(K,_e){const be=K.matched[K.matched.length-1];if(be&&be.redirect){const{redirect:Oe}=be;let Je=typeof Oe=="function"?Oe(K,_e):Oe;return typeof Je=="string"&&(Je=Je.includes("?")||Je.includes("#")?Je=O(Je):{path:Je},Je.params={}),Pt({query:K.query,hash:K.hash,params:Je.path!=null?{}:K.params},Je)}}function ne(K,_e){const be=f=z(K),Oe=c.value,Je=K.state,k=K.force,I=K.replace===!0,H=Ue(be,Oe);if(H)return ne(Pt(O(H),{state:typeof H=="object"?Pt({},Je,H.state):Je,force:k,replace:I}),_e||be);const re=be;re.redirectedFrom=_e;let J;return!k&&qy(r,Oe,be)&&(J=ns(en.NAVIGATION_DUPLICATED,{to:re,from:Oe}),Ve(Oe,Oe,!0,!1)),(J?Promise.resolve(J):Ee(re,Oe)).catch(ae=>_o(ae)?_o(ae,en.NAVIGATION_GUARD_REDIRECT)?ae:nt(ae):me(ae,re,Oe)).then(ae=>{if(ae){if(_o(ae,en.NAVIGATION_GUARD_REDIRECT))return ne(Pt({replace:I},O(ae.to),{state:typeof ae.to=="object"?Pt({},Je,ae.to.state):Je,force:k}),_e||re)}else ae=ee(re,Oe,!0,I,Je);return He(re,Oe,ae),ae})}function Se(K,_e){const be=V(K,_e);return be?Promise.reject(be):Promise.resolve()}function Y(K){const _e=ht.values().next().value;return _e&&typeof _e.runWithContext=="function"?_e.runWithContext(K):K()}function Ee(K,_e){let be;const[Oe,Je,k]=ow(K,_e);be=fu(Oe.reverse(),"beforeRouteLeave",K,_e);for(const H of Oe)H.leaveGuards.forEach(re=>{be.push(zo(re,K,_e))});const I=Se.bind(null,K,_e);return be.push(I),dt(be).then(()=>{be=[];for(const H of o.list())be.push(zo(H,K,_e));return be.push(I),dt(be)}).then(()=>{be=fu(Je,"beforeRouteUpdate",K,_e);for(const H of Je)H.updateGuards.forEach(re=>{be.push(zo(re,K,_e))});return be.push(I),dt(be)}).then(()=>{be=[];for(const H of k)if(H.beforeEnter)if(Vr(H.beforeEnter))for(const re of H.beforeEnter)be.push(zo(re,K,_e));else be.push(zo(H.beforeEnter,K,_e));return be.push(I),dt(be)}).then(()=>(K.matched.forEach(H=>H.enterCallbacks={}),be=fu(k,"beforeRouteEnter",K,_e,Y),be.push(I),dt(be))).then(()=>{be=[];for(const H of s.list())be.push(zo(H,K,_e));return be.push(I),dt(be)}).catch(H=>_o(H,en.NAVIGATION_CANCELLED)?H:Promise.reject(H))}function He(K,_e,be){l.list().forEach(Oe=>Y(()=>Oe(K,_e,be)))}function ee(K,_e,be,Oe,Je){const k=V(K,_e);if(k)return k;const I=_e===Fo,H=ja?history.state:{};be&&(Oe||I?a.replace(K.fullPath,Pt({scroll:I&&H&&H.scroll},Je)):a.push(K.fullPath,Je)),c.value=K,Ve(K,_e,be,I),nt()}let we;function Re(){we||(we=a.listen((K,_e,be)=>{if(!Xe.listening)return;const Oe=z(K),Je=Ue(Oe,Xe.currentRoute.value);if(Je){ne(Pt(Je,{replace:!0,force:!0}),Oe).catch(Fs);return}f=Oe;const k=c.value;ja&&Yy(Fd(k.fullPath,be.delta),dl()),Ee(Oe,k).catch(I=>_o(I,en.NAVIGATION_ABORTED|en.NAVIGATION_CANCELLED)?I:_o(I,en.NAVIGATION_GUARD_REDIRECT)?(ne(Pt(O(I.to),{force:!0}),Oe).then(H=>{_o(H,en.NAVIGATION_ABORTED|en.NAVIGATION_DUPLICATED)&&!be.delta&&be.type===Wu.pop&&a.go(-1,!1)}).catch(Fs),Promise.reject()):(be.delta&&a.go(-be.delta,!1),me(I,Oe,k))).then(I=>{I=I||ee(Oe,k,!1),I&&(be.delta&&!_o(I,en.NAVIGATION_CANCELLED)?a.go(-be.delta,!1):be.type===Wu.pop&&_o(I,en.NAVIGATION_ABORTED|en.NAVIGATION_DUPLICATED)&&a.go(-1,!1)),He(Oe,k,I)}).catch(Fs)}))}let Ke=xs(),Be=xs(),xe;function me(K,_e,be){nt(K);const Oe=Be.list();return Oe.length?Oe.forEach(Je=>Je(K,_e,be)):console.error(K),Promise.reject(K)}function We(){return xe&&c.value!==Fo?Promise.resolve():new Promise((K,_e)=>{Ke.add([K,_e])})}function nt(K){return xe||(xe=!K,Re(),Ke.list().forEach(([_e,be])=>K?be(K):_e()),Ke.reset()),K}function Ve(K,_e,be,Oe){const{scrollBehavior:Je}=e;if(!ja||!Je)return Promise.resolve();const k=!be&&Qy(Fd(K.fullPath,0))||(Oe||!be)&&history.state&&history.state.scroll||null;return an().then(()=>Je(K,_e,k)).then(I=>I&&Jy(I)).catch(I=>me(I,K,_e))}const Le=K=>a.go(K);let ft;const ht=new Set,Xe={currentRoute:c,listening:!0,addRoute:x,removeRoute:j,clearRoutes:t.clearRoutes,hasRoute:te,getRoutes:q,resolve:z,options:e,push:Z,replace:Ae,go:Le,back:()=>Le(-1),forward:()=>Le(1),beforeEach:o.add,beforeResolve:s.add,afterEach:l.add,onError:Be.add,isReady:We,install(K){K.component("RouterLink",xw),K.component("RouterView",Pw),K.config.globalProperties.$router=Xe,Object.defineProperty(K.config.globalProperties,"$route",{enumerable:!0,get:()=>S(c)}),ja&&!ft&&c.value===Fo&&(ft=!0,Z(a.location).catch(Oe=>{}));const _e={};for(const Oe in Fo)Object.defineProperty(_e,Oe,{get:()=>c.value[Oe],enumerable:!0});K.provide(fl,Xe),K.provide(Cc,yh(_e)),K.provide(Ku,c);const be=K.unmount;ht.add(K),K.unmount=function(){ht.delete(K),ht.size<1&&(f=Fo,we&&we(),we=null,c.value=Fo,ft=!1,xe=!1),be()}}};function dt(K){return K.reduce((_e,be)=>_e.then(()=>Y(be)),Promise.resolve())}return Xe}function Rw(){return Br(fl)}function $w(e){return Br(Cc)}const Xd=768;function xc(){const e=P(typeof window<"u"?window.innerWidth<Xd:!1);let t=null;function n(r){e.value=r.matches}return Jo(()=>{t=window.matchMedia(`(max-width: ${Xd-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),il(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Nw={key:0,class:"desktop-sidebar"},Ow={class:"desktop-main"},Zd="codex-web-local.sidebar-width.v1",Dw=260,Lw=620,ef=320,jw=Hn({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=xc();function r(f){return Math.min(Lw,Math.max(Dw,f))}function a(){if(typeof window>"u")return ef;const f=window.localStorage.getItem(Zd),h=Number(f);return Number.isFinite(h)?r(h):ef}const o=P(a()),s=le(()=>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 l(f){typeof window>"u"||window.localStorage.setItem(Zd,String(f))}function c(f){f.preventDefault();const h=f.clientX,g=o.value,b=j=>{const q=j.clientX-h;o.value=r(g+q)},x=()=>{l(o.value),window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",x)};window.addEventListener("mousemove",b),window.addEventListener("mouseup",x)}return(f,h)=>(C(),R("div",{class:it(["desktop-layout",{"is-mobile":S(n)}]),style:Ao(s.value)},[S(n)?(C(),rt(va,{key:0,to:"body"},[Ne(lp,{name:"drawer"},{default:ct(()=>[e.isSidebarCollapsed?ie("",!0):(C(),R("div",{key:0,class:"mobile-drawer-backdrop",onClick:h[1]||(h[1]=g=>f.$emit("close-sidebar"))},[m("aside",{class:"mobile-drawer",onClick:h[0]||(h[0]=et(()=>{},["stop"]))},[po(f.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):ie("",!0),S(n)?ie("",!0):(C(),R(Ge,{key:1},[e.isSidebarCollapsed?ie("",!0):(C(),R("aside",Nw,[po(f.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?ie("",!0):(C(),R("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:c},null,32))],64)),m("section",Ow,[po(f.$slots,"content",{},void 0)])],6))}}),kt=(e,t)=>{const n=e.__vccOpts||e;for(const[r,a]of t)n[r]=a;return n},Fw=kt(jw,[["__scopeId","data-v-4c6dbcd7"]]);function tf(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class go extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function Yo(e,t){if(typeof e=="string"&&e.length>0)return e;const n=tf(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const a=tf(r);return a&&typeof a.message=="string"&&a.message.length>0?a.message:typeof n.message=="string"&&n.message.length>0?n.message:typeof n.detail=="string"&&n.detail.length>0?n.detail:t}function Ro(e,t,n){return e instanceof go?e:e instanceof Error?new go(e.message||t,{code:"unknown_error",method:n}):new go(t,{code:"unknown_error",method:n})}function Tp(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function Uw(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(l){throw new go(l instanceof Error?l.message:`RPC ${e} failed before request was sent`,{code:"network_error",method:e})}let a=null,o=null;try{o=await r.text(),a=JSON.parse(o)}catch{a=null}if(!r.ok){const l=Yo(a,"")||(o==null?void 0:o.slice(0,500))||"",c=`RPC ${e} failed with HTTP ${r.status}`;throw new go(l?`${c}: ${l}`:c,{code:"http_error",method:e,status:r.status})}const s=a;if(!s||typeof s!="object"||!("result"in s))throw new go(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return s.result}async function Bw(){const e=await fetch("/codex-api/meta/methods");let t=null;try{t=await e.json()}catch{t=null}if(!e.ok)throw new go(Yo(t,`Method catalog failed with HTTP ${e.status}`),{code:"http_error",method:"meta/methods",status:e.status});const n=t;return Array.isArray(n.data)?n.data:[]}function qw(e){const t=Tp(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 nf(e,t={ok:!0}){e({method:"ready",params:t,atIso:new Date().toISOString()})}function Hw(e){if(typeof window>"u")return()=>{};let t=null,n=!1,r=null;const a=()=>{r!==null&&(window.clearTimeout(r),r=null)},o=(f,h)=>{if(n||r!==null)return;const g=Math.min(1e3*2**h,1e4);r=window.setTimeout(()=>{r=null,!n&&f()},g)},s=f=>{const h=qw(f);h&&e(h)},l=(f=0)=>{if(typeof EventSource>"u"||n)return;t==null||t();const h=new EventSource("/codex-api/events");let g=!1;h.onmessage=b=>{try{s(JSON.parse(b.data))}catch{}},h.addEventListener("ready",b=>{try{const x=b.data?JSON.parse(b.data):{ok:!0};nf(e,x)}catch{nf(e)}}),h.onerror=()=>{n||g||h.readyState===EventSource.CLOSED&&(g=!0,h.close(),o(()=>l(f+1),f))},t=()=>{g=!0,h.close()}},c=(f=0)=>{if(typeof WebSocket>"u"||n){l();return}t==null||t();const h=window.location.protocol==="https:"?"wss:":"ws:",g=new WebSocket(`${h}//${window.location.host}/codex-api/ws`);let b=!1,x=!1,j=window.setTimeout(()=>{b||n||x||(x=!0,g.close(),l())},2500);g.onopen=()=>{b=!0,a(),j!==null&&(window.clearTimeout(j),j=null)},g.onmessage=q=>{try{s(JSON.parse(String(q.data)))}catch{}},g.onerror=()=>{},g.onclose=()=>{if(j!==null&&(window.clearTimeout(j),j=null),!(n||x)){if(!b){l();return}o(()=>c(f+1),f)}},t=()=>{x=!0,j!==null&&(window.clearTimeout(j),j=null),g.close()}};return typeof WebSocket<"u"?c():l(),()=>{n=!0,a(),t==null||t()}}async function zw(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 go(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 go(Yo(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function Vw(){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 go(Yo(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Tp(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function Ww(e){const t=e.trim();return t?t.startsWith("\\\\?\\UNC\\")?`\\\\${t.slice(8)}`:t.startsWith("\\\\?\\")?t.slice(4):t:""}function Ft(e){return Ww(e)}function Gw(e){return/^[a-z]:[\\/]/iu.test(e)||e.startsWith("\\\\")}function Kw(e){const t=Ft(e).replace(/[\\/]+/gu,"/");return Gw(t)?t.toLowerCase():t}function pa(e){const t=Ft(e).replace(/[\\/]+$/u,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<0?t:t.slice(n+1)}function hu(e){const t=Ft(e).replace(/[\\/]+$/u,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<=0?"":t.slice(0,n)}function ei(e){return pa(e)||Ft(e)||"Projectless"}function Ji(e){const t=Ft(e).replace(/[\\/]+/gu,"/");return t?/(?:^|\/)Documents\/Codex\/\d{4}-\d{2}-\d{2}\/[^/]+$/u.test(t):!1}function rf(e){return new Date(e*1e3).toISOString()}function Jw(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Yw=/^##\s+(.+?):\s+(.+?)\s*$/,Qw=/^#\s*files mentioned by the user\s*:?\s*$/i;function Xw(e){var a,o;const t=e.split(`
|
|
27
|
-
`).findIndex(s=>Qw.test(s.trim()));if(t<0)return[];const n=e.split(`
|
|
28
|
-
`).slice(t+1),r=[];for(const s of n){const l=s.trim();if(!l)continue;const c=l.match(Yw);if(!c)break;const f=(a=c[1])==null?void 0:a.trim(),h=(o=c[2])==null?void 0:o.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");f&&h&&r.push({label:f,path:h})}return r}function Zw(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 a=r.index+r[0].length;return e.slice(a).trim()}function Sp(e){return`/codex-local-image?path=${encodeURIComponent(e)}`}function eb(e){const t=e.trim();if(!t)return"";if(t.startsWith("data:")||t.startsWith("http://")||t.startsWith("https://")||t.startsWith("/codex-local-image?"))return t;const n=t.replace(/\s+/gu,"");return/^[A-Za-z0-9+/]+={0,2}$/u.test(n)?`data:image/png;base64,${n}`:""}function of(e,t){var r;const n=new RegExp(`<${t}>\\s*([\\s\\S]*?)\\s*</${t}>`,"iu").exec(e);return((r=n==null?void 0:n[1])==null?void 0:r.trim())??""}function tb(e){const t=e.trim();if(!t.startsWith("<heartbeat>")||!t.endsWith("</heartbeat>"))return null;const n=of(t,"instructions");return n?{automationId:of(t,"automation_id"),instructions:n}:null}function nb(e,t){if(!Array.isArray(t))return{text:"",images:[],fileAttachments:[],rawBlocks:[],isAutomationRun:!1,automationDisplayName:null};const n=[],r=[],a=[];for(const[c,f]of t.entries())f.type==="text"&&typeof f.text=="string"&&f.text.length>0&&n.push(f.text),f.type==="image"&&typeof f.url=="string"&&f.url.trim().length>0&&r.push(f.url.trim()),f.type==="localImage"&&typeof f.path=="string"&&f.path.trim().length>0&&r.push(Sp(f.path.trim())),f.type!=="text"&&f.type!=="image"&&f.type!=="localImage"&&a.push({id:`${e}:user-content:${c}`,role:"user",text:"",messageType:`userContent.${f.type}`,rawPayload:Jw(f),isUnhandled:!0});const o=n.join(`
|
|
29
|
-
`),s=Xw(o),l=tb(o);return{text:(l==null?void 0:l.instructions)??Zw(o),images:r,fileAttachments:s,rawBlocks:a,isAutomationRun:l!==null,automationDisplayName:(l==null?void 0:l.automationId)||null}}function rb(e){var o;const t=e.replace(/\r\n/g,`
|
|
30
|
-
`).trim();if(!t)return null;const n=t.split(`
|
|
31
|
-
`),r=[],a=[];for(const s of n){const l=s.trim();if(!l){r.length===0&&a.push("");continue}const c=l.match(/^[-*]\s+\[([ xX~>|-])\]\s+(.+)$/);if(c){const f=(c[1]??" ").toLowerCase(),h=(o=c[2])==null?void 0:o.trim();if(!h)continue;let g="pending";f==="x"&&(g="completed"),(f==="~"||f===">"||f==="-")&&(g="inProgress"),r.push({step:h,status:g});continue}a.push(l)}return r.length===0?null:{explanation:a.join(`
|
|
32
|
-
`).trim()||void 0,steps:r}}function af(e){if(!e)return 0;const t=e.replace(/\r\n/g,`
|
|
33
|
-
`),n=t.endsWith(`
|
|
34
|
-
`)?t.slice(0,-1):t;return n?n.split(`
|
|
35
|
-
`).length:0}function ob(e){let t=0,n=0;for(const r of e.replace(/\r\n/g,`
|
|
36
|
-
`).split(`
|
|
37
|
-
`))if(r&&!(r.startsWith("+++")||r.startsWith("---")||r.startsWith("@@"))){if(r.startsWith("+")){t+=1;continue}r.startsWith("-")&&(n+=1)}return{addedLineCount:t,removedLineCount:n}}function kp(e){return e==="failed"||e==="declined"||e==="completed"?e:"inProgress"}function Cp(e){const t=Array.isArray(e)?e:[],n=[];for(const r of t){const a=r,o=typeof a.path=="string"?a.path:"",s=typeof a.diff=="string"?a.diff:"",l=a.kind,c=l==null?void 0:l.type;if(!o||c!=="add"&&c!=="delete"&&c!=="update")continue;const f=c==="update"&&typeof(l==null?void 0:l.move_path)=="string"?l.move_path:null,h=c==="update"?ob(s):c==="add"?{addedLineCount:af(s),removedLineCount:0}:{addedLineCount:0,removedLineCount:af(s)};n.push({path:o,operation:c,movedToPath:f,diff:s,...h})}return n}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=nb(e.id,e.content),n=[];return(t.text.length>0||t.images.length>0||t.fileAttachments.length>0)&&n.push({id:e.id,role:t.isAutomationRun?"system":"user",text:t.text,images:t.images,fileAttachments:t.fileAttachments.length>0?t.fileAttachments:void 0,messageType:e.type,isAutomationRun:t.isAutomationRun,automationDisplayName:t.automationDisplayName}),n.push(...t.rawBlocks),n.length===0?[]:n}if(e.type==="imageView"){const t=typeof e.path=="string"?e.path.trim():"";return t?[{id:e.id,role:"assistant",text:"",images:[Sp(t)],messageType:"imageView"}]:[]}{const t=e;if(t.type==="imageGeneration"||t.type==="image_generation"){const n=typeof t.result=="string"?eb(t.result):"";return n?[{id:e.id,role:"assistant",text:"",images:[n],messageType:"imageView"}]:[]}}if(e.type==="reasoning")return[];if(e.type==="plan"){const t=typeof e.text=="string"?e.text:"";return[{id:e.id,role:"assistant",text:t,messageType:"plan",plan:rb(t)??void 0}]}if(e.type==="commandExecution"){const t=e,n=sb(t.status),r=typeof t.command=="string"?t.command:"",a=typeof t.cwd=="string"?t.cwd:null,o=typeof t.aggregatedOutput=="string"?t.aggregatedOutput:"",s=typeof t.exitCode=="number"?t.exitCode:null;return[{id:e.id,role:"system",text:r,messageType:"commandExecution",commandExecution:{command:r,cwd:a,status:n,aggregatedOutput:o,exitCode:s}}]}if(e.type==="fileChange"){const t=Cp(e.changes),n=kp(e.status);return t.length===0||n!=="completed"?[]:[{id:e.id,role:"system",text:"",messageType:"fileChange",fileChangeStatus:n,fileChanges:t}]}return[]}function sb(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function ib(e){const t=e,n=[t.name,t.title,e.preview];for(const r of n)if(typeof r=="string"&&r.trim().length>0)return r.trim();return""}function lb(e){const t=ib(e);return t.length>0?t:"Untitled thread"}function Ac(e){return(e==null?void 0:e.status)==="inProgress"}function ub(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 Ac(r)}function cb(e){const t=e,n=Ft(typeof t.cwd=="string"?t.cwd:e.cwd),r=Kw(n),a=t.isWorktree===!0||t.worktree===!0||t.worktreeId!==void 0||t.worktreePath!==void 0||r.includes("/.codex/worktrees/")||r.includes("/.git/worktrees/");return{id:e.id,title:lb(e),projectName:ei(n),cwd:n,hasWorktree:a,createdAtIso:rf(e.createdAt),updatedAtIso:rf(e.updatedAt),preview:e.preview,unread:!1,inProgress:ub(e)}}function db(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((a,o)=>new Date(o.updatedAtIso).getTime()-new Date(a.updatedAtIso).getTime())})).sort((n,r)=>{var s,l;const a=new Date(((s=n.threads[0])==null?void 0:s.updatedAtIso)??0).getTime();return new Date(((l=r.threads[0])==null?void 0:l.updatedAtIso)??0).getTime()-a})}function fb(e){const t=e.data.map(cb);return db(t)}function hl(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n=[];for(let r=0;r<t.length;r++){const a=t[r],o=typeof(a==null?void 0:a.id)=="string"?a.id:void 0,s=Array.isArray(a.items)?a.items:[];for(const l of s)for(const c of ab(l))n.push({...c,turnId:o,turnIndex:r})}return n}function xp(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return Ac(t.at(-1))}function Ap(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];for(let n=t.length-1;n>=0;n-=1){const r=t[n];if(Ac(r)&&typeof r.id=="string"&&r.id.trim().length>0)return r.id.trim()}return""}const hb=5e3;function pu(e){return e&&e.length>0?e:null}function mu(e){return e&&e.length>0?e:null}const sf=[{value:"default",label:"Default"},{value:"plan",label:"Plan"}];function at(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function ue(e){return typeof e=="string"&&e.length>0?e:null}function pn(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function Rr(e){return typeof e=="boolean"?e:null}function Ba(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}function pb(e){return e==="payment_required"?e:null}function mb(e){if(!e)return!1;const t=e.toLowerCase();return t.includes("payment required")||/\b402\b/.test(t)}function lf(e){const t=at(e);if(!t)return null;const n=pn(t.usedPercent??t.used_percent);if(n===null)return null;const r=pn(t.windowDurationMins??t.window_minutes);return{usedPercent:n,windowDurationMins:r,windowMinutes:r,resetsAt:pn(t.resetsAt??t.resets_at)}}function gb(e){const t=at(e);if(!t)return null;const n=Rr(t.hasCredits??t.has_credits),r=Rr(t.unlimited);return n===null||r===null?null:{hasCredits:n,unlimited:r,balance:ue(t.balance)}}function Ju(e){const t=at(e);if(!t)return null;const n=lf(t.primary),r=lf(t.secondary),a=gb(t.credits);return!n&&!r&&!a?null:{limitId:ue(t.limitId??t.limit_id),limitName:ue(t.limitName??t.limit_name),primary:n,secondary:r,credits:a,planType:ue(t.planType??t.plan_type)}}function Ep(e,t=null){const n=at(e);if(!n)return null;const r=ue(n.accountId),a=ue(n.quotaStatus),o=a==="loading"||a==="ready"||a==="error"?a:"idle";return r?{accountId:r,authMode:ue(n.authMode),email:ue(n.email),planType:ue(n.planType),lastRefreshedAtIso:ue(n.lastRefreshedAtIso)??"",lastActivatedAtIso:ue(n.lastActivatedAtIso),quotaSnapshot:Ju(n.quotaSnapshot),quotaUpdatedAtIso:ue(n.quotaUpdatedAtIso),quotaStatus:o,quotaError:ue(n.quotaError),unavailableReason:pb(n.unavailableReason)??(mb(ue(n.quotaError))?"payment_required":null),isActive:Rr(n.isActive)??r===t}:null}function Ip(e){const t=at(e);if(!t)return null;const n=at(t.rateLimitsByLimitId??t.rate_limits_by_limit_id),r=Ju(n==null?void 0:n.codex);return r||Ju(t.rateLimits??t.rate_limits)}async function $t(e,t){try{return await Uw(e,t)}catch(n){throw Ro(n,`RPC ${e} failed`,e)}}function Pp(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n={};for(let r=0;r<t.length;r+=1){const a=t[r];typeof(a==null?void 0:a.id)!="string"||a.id.length===0||(n[a.id]=r)}return n}function vb(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}function yb(e){return typeof e=="string"&&e.trim().toLowerCase()==="fast"?"fast":"standard"}const wb=50,bb=100;async function _b(e,t){const n=await $t("thread/list",{archived:!1,limit:t,sortKey:"updated_at",modelProviders:[],cursor:e});return{groups:fb(n),nextCursor:typeof n.nextCursor=="string"&&n.nextCursor.length>0?n.nextCursor:null}}async function Tb(e){const t=await $t("thread/read",{threadId:e,includeTurns:!0});return{messages:hl(t),inProgress:xp(t),activeTurnId:Ap(t),turnIndexByTurnId:Pp(t)}}async function uf(e=null,t=wb){try{return await _b(e,t)}catch(n){throw Ro(n,"Failed to load thread groups","thread/list")}}function Sb(){return bb}async function cf(e){try{return await Tb(e)}catch(t){throw Ro(t,`Failed to load thread ${e}`,"thread/read")}}function kb(e){const t=at(e);if(!t)return null;const n=ue(t.key),r=typeof t.text=="string"?t.text:"",a=ue(t.kind);return!n||!a||a!=="meta"&&a!=="hunk"&&a!=="add"&&a!=="remove"&&a!=="context"?null:{key:n,kind:a,text:r,oldLine:pn(t.oldLine),newLine:pn(t.newLine)}}function Cb(e){const t=at(e);if(!t)return null;const n=ue(t.id),r=typeof t.header=="string"?t.header:"",a=typeof t.patch=="string"?t.patch:"";return n?{id:n,header:r,patch:a,addedLineCount:pn(t.addedLineCount)??0,removedLineCount:pn(t.removedLineCount)??0,oldStart:pn(t.oldStart),oldLineCount:pn(t.oldLineCount)??0,newStart:pn(t.newStart),newLineCount:pn(t.newLineCount)??0,lines:Array.isArray(t.lines)?t.lines.map(o=>kb(o)).filter(o=>o!==null):[]}:null}function xb(e){const t=at(e);if(!t)return null;const n=ue(t.id),r=ue(t.path),a=ue(t.absolutePath),o=ue(t.operation);return!n||!r||!a||!o||o!=="add"&&o!=="delete"&&o!=="update"&&o!=="rename"?null:{id:n,path:r,absolutePath:a,previousPath:ue(t.previousPath),previousAbsolutePath:ue(t.previousAbsolutePath),operation:o,addedLineCount:pn(t.addedLineCount)??0,removedLineCount:pn(t.removedLineCount)??0,diff:typeof t.diff=="string"?t.diff:"",hunks:Array.isArray(t.hunks)?t.hunks.map(s=>Cb(s)).filter(s=>s!==null):[]}}function Mp(e){const t=at(e),n=at(t==null?void 0:t.data),r=at(n==null?void 0:n.summary),a=ue(n==null?void 0:n.scope)==="baseBranch"?"baseBranch":"workspace",o=ue(n==null?void 0:n.workspaceView)==="staged"?"staged":"unstaged";return{cwd:ue(n==null?void 0:n.cwd)??"",gitRoot:ue(n==null?void 0:n.gitRoot),isGitRepo:Rr(n==null?void 0:n.isGitRepo)??!1,scope:a,workspaceView:o,baseBranch:ue(n==null?void 0:n.baseBranch),baseBranchOptions:Array.isArray(n==null?void 0:n.baseBranchOptions)?n.baseBranchOptions.map(s=>ue(s)).filter(s=>typeof s=="string"&&s.length>0):[],headBranch:ue(n==null?void 0:n.headBranch),mergeBaseSha:ue(n==null?void 0:n.mergeBaseSha),generatedAtIso:ue(n==null?void 0:n.generatedAtIso)??"",summary:{fileCount:pn(r==null?void 0:r.fileCount)??0,addedLineCount:pn(r==null?void 0:r.addedLineCount)??0,removedLineCount:pn(r==null?void 0:r.removedLineCount)??0},files:Array.isArray(n==null?void 0:n.files)?n.files.map(s=>xb(s)).filter(s=>s!==null):[]}}function Ab(e){var r;const t=e.trim();if(!t)return{absolutePath:null,startLine:null,endLine:null};const n=t.match(/^(.*?):(\d+)-(\d+)$/u);return n?{absolutePath:((r=n[1])==null?void 0:r.trim())||null,startLine:Number(n[2]),endLine:Number(n[3])}:{absolutePath:t||null,startLine:null,endLine:null}}function Eb(e){var s;const t=e.replace(/\r\n/g,`
|
|
38
|
-
`).trim();if(!t)return{reviewText:"",summary:"",findings:[]};const n=t.search(/\n(?:Full review comments|Review comment):\n/iu),r=n>=0?t.slice(0,n).trim():t,a=n>=0?t.slice(n).trim():"",o=[];if(a){const c=a.replace(/^(?:Full review comments|Review comment):\n*/iu,"").trim().matchAll(/^- (.+?) — (.+)\n?((?: .*(?:\n|$))*)/gmu);let f=0;for(const h of c){const g=((s=h[1])==null?void 0:s.trim())??"",b=Ab(h[2]??""),x=(h[0]??"").trim(),j=(h[3]??"").split(`
|
|
39
|
-
`).map(q=>q.replace(/^ /u,"")).join(`
|
|
40
|
-
`).trim();o.push({id:`finding:${f}`,title:g||`Finding ${f+1}`,body:j,path:b.absolutePath?b.absolutePath.split("/").filter(Boolean).slice(-1)[0]??b.absolutePath:null,absolutePath:b.absolutePath,startLine:b.startLine,endLine:b.endLine,rawText:x}),f+=1}}return{reviewText:t,summary:r,findings:o}}function df(e,t){const n=Array.isArray(e.thread.turns)?e.thread.turns:[];for(let r=n.length-1;r>=0;r-=1){const a=n[r],o=Array.isArray(a==null?void 0:a.items)?a.items:[];for(let s=o.length-1;s>=0;s-=1){const l=o[s];if((l==null?void 0:l.type)!==t)continue;const c=typeof l.review=="string"?l.review.trim():"";if(c)return c}}return null}async function lP(e){const t=await $t("thread/read",{threadId:e,includeTurns:!0}),n=df(t,"exitedReviewMode");return{enteredReviewLabel:df(t,"enteredReviewMode"),result:n?Eb(n):null}}async function uP(){return Bw()}function Rp(e){const t=at(e);if(!t)return null;const n=ue(t.id),r=ue(t.kind),a=ue(t.name),o=ue(t.prompt),s=ue(t.rrule),l=ue(t.status);return!n||!a||!o||!s||r!=="heartbeat"&&r!=="cron"||l!=="ACTIVE"&&l!=="PAUSED"?null:{id:n,kind:r,name:a,prompt:o,rrule:s,status:l,targetThreadId:ue(t.targetThreadId),createdAtMs:pn(t.createdAtMs),updatedAtMs:pn(t.updatedAtMs),nextRunAtMs:pn(t.nextRunAtMs)}}async function Ib(){var a;const e=await fetch("/codex-api/thread-automations"),t=await e.json().catch(()=>null);if(!e.ok)throw new Error(Yo(t,"Failed to load thread automations"));const n=at((a=at(t))==null?void 0:a.data),r={};if(!n)return r;for(const[o,s]of Object.entries(n)){const l=Rp(s);l&&(r[o]=l)}return r}async function Pb(e){var a;const t=await fetch("/codex-api/thread-automation",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error(Yo(n,"Failed to save thread automation"));const r=Rp((a=at(n))==null?void 0:a.data);if(!r)throw new Error("Thread automation response was malformed");return r}async function ff(e){const t=await fetch(`/codex-api/thread-automation?threadId=${encodeURIComponent(e)}`,{method:"DELETE"}),n=await t.json().catch(()=>null);if(!t.ok)throw new Error(Yo(n,"Failed to delete thread automation"))}function Mb(e){return Hw(e)}function Rb(e){const t=at(e);if(!t)return null;const n=ue(t.id),r=ue(t.threadId),a=ue(t.cwd),o=ue(t.shell);return!n||!r||!a||!o?null:{id:n,threadId:r,cwd:a,shell:o,buffer:typeof t.buffer=="string"?t.buffer:"",truncated:Rr(t.truncated)??!1}}async function ss(e,t){const n=await fetch(e,t),r=await n.json().catch(()=>null);if(!n.ok)throw new Error(Yo(r,`Terminal request failed with HTTP ${n.status}`));return r}async function cP(e){var r;const t=await ss("/codex-api/thread-terminal/attach",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=Rb((r=at(t))==null?void 0:r.session);if(!n)throw new Error("Terminal attach response was malformed");return n}async function $b(){const e=await ss("/codex-api/thread-terminal/status"),t=at(e);return{available:Rr(t==null?void 0:t.available)??!1,reason:ue(t==null?void 0:t.reason)||null}}async function dP(e){const t=await ss(`/codex-api/thread-terminal/quick-commands?cwd=${encodeURIComponent(e)}`),n=at(t);return(Array.isArray(n==null?void 0:n.commands)?n.commands:[]).flatMap(a=>{const o=at(a),s=ue(o==null?void 0:o.label),l=ue(o==null?void 0:o.value),c=ue(o==null?void 0:o.source);return!s||!l||c!=="package"&&c!=="script"&&c!=="make"?[]:[{label:s,value:l,source:c}]})}async function fP(e,t){await ss("/codex-api/thread-terminal/input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e,data:t})})}async function hP(e,t,n){await ss("/codex-api/thread-terminal/resize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e,cols:t,rows:n})})}async function pP(e){await ss("/codex-api/thread-terminal/close",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e})})}async function Nb(e,t){await zw({id:e,...t})}async function Ob(){return Vw()}async function Db(){try{const e=await $t("account/rateLimits/read");return Ip(e)}catch(e){throw Ro(e,"Failed to load account rate limits","account/rateLimits/read")}}function Ec(e){const t=at(e),n=ue(t==null?void 0:t.activeAccountId),r=Array.isArray(t==null?void 0:t.accounts)?t==null?void 0:t.accounts:[];return{activeAccountId:n,importedAccountId:ue(t==null?void 0:t.importedAccountId)??void 0,accounts:r.map(a=>Ep(a,n)).filter(a=>a!==null)}}async function Lb(){const e=await fetch("/codex-api/accounts"),t=await e.json();if(!e.ok)throw new Error(zn(t,"Failed to load accounts"));const n=at(t);return Ec(n==null?void 0:n.data)}async function jb(){const e=await fetch("/codex-api/accounts/refresh",{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(zn(t,"Failed to refresh accounts"));const n=at(t);return Ec(n==null?void 0:n.data)}async function Fb(e){const t=await fetch("/codex-api/accounts/switch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:e})}),n=await t.json();if(!t.ok)throw new Error(zn(n,"Failed to switch account"));const r=at(n),a=at(r==null?void 0:r.data),o=Ep(a==null?void 0:a.account,ue(a==null?void 0:a.activeAccountId));if(!o)throw new Error("Failed to switch account");return o}async function Ub(e){const t=await fetch("/codex-api/accounts/remove",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accountId:e})}),n=await t.json();if(!t.ok)throw new Error(zn(n,"Failed to remove account"));const r=at(n);return Ec(r==null?void 0:r.data)}async function gu(e){const t=await $t("thread/resume",{threadId:e});return{model:Yi(t),messages:hl(t),inProgress:xp(t),activeTurnId:Ap(t),turnIndexByTurnId:Pp(t)}}async function Bb(e){await $t("thread/archive",{threadId:e})}async function qb(e,t){await $t("thread/name/set",{threadId:e,name:t})}async function vu(e,t){const n=await $t("thread/rollback",{threadId:e,numTurns:t});return hl(n)}async function Hb(e,t,n){try{const r=await fetch("/codex-api/thread/rollback-files",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({threadId:e,turnId:t,cwd:n})});return r.ok?await r.json():{reverted:0,errors:["Server error"]}}catch{return{reverted:0,errors:["Network error"]}}}function Yu(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""}function zb(e){if(!e||typeof e!="object")return"";const n=e.thread;if(n&&typeof n=="object"){const r=n.cwd;if(typeof r=="string"&&r.length>0)return r}return""}function Yi(e){if(!e||typeof e!="object")return"";const t=e.model;return typeof t=="string"?t.trim():""}async function hf(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 $t("thread/start",n),a=Yu(r);if(!a)throw new Error("thread/start did not return a thread id");return{threadId:a,model:Yi(r)}}catch(n){throw Ro(n,"Failed to start a new thread","thread/start")}}async function pf(e,t,n){if(arguments.length<=1)try{const r=await $t("thread/fork",{threadId:e,persistExtendedHistory:!0}),a=Yu(r);if(!a)throw new Error("thread/fork did not return a thread id");return{threadId:a,cwd:zb(r),model:Yi(r),messages:hl(r)}}catch(r){throw Ro(r,`Failed to fork thread ${e}`,"thread/fork")}try{const r=e.trim();if(!r)throw new Error("thread/fork requires threadId");const a={threadId:r};typeof t=="string"&&t.trim().length>0&&(a.cwd=t.trim()),typeof n=="string"&&n.trim().length>0&&(a.model=n.trim());const o=await $t("thread/fork",a),s=Yu(o);if(!s)throw new Error("thread/fork did not return a thread id");return{threadId:s,model:Yi(o)}}catch(r){throw Ro(r,`Failed to fork thread ${e}`,"thread/fork")}}function mf(e){var t;if(!e)return null;try{const n=new URL(e,"http://localhost");if(n.pathname!=="/codex-local-image")return null;const r=((t=n.searchParams.get("path"))==null?void 0:t.trim())??"";return r.length>0?r:null}catch{return null}}function Vb(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
|
|
41
|
-
`;for(const r of t)n+=`
|
|
42
|
-
## ${r.label}: ${r.path}
|
|
43
|
-
`;return`${n}
|
|
44
|
-
## My request for Codex:
|
|
45
|
-
|
|
46
|
-
${e}
|
|
47
|
-
`}function Wb(e){const t=e.replace(/\\/g,"/");return t.split("/").filter(Boolean).at(-1)??t}async function Gb(e,t,n){var c;const r=(t==null?void 0:t.trim())??"";if(r)return{model:r,reasoningEffort:e==="plan"?pu(n):mu(n)};let a=null;try{a=await Np()}catch{a=null}const o=(a==null?void 0:a.model.trim())??"";if(o)return{model:o,reasoningEffort:e==="plan"?pu(n??(a==null?void 0:a.reasoningEffort)):mu(n??(a==null?void 0:a.reasoningEffort))};let s=[];try{s=await $p()}catch{s=[]}const l=((c=s.find(f=>f.trim().length>0))==null?void 0:c.trim())??"";if(l)return{model:l,reasoningEffort:e==="plan"?pu(n??(a==null?void 0:a.reasoningEffort)):mu(n??(a==null?void 0:a.reasoningEffort))};throw new Error(`${e==="plan"?"Plan":"Default"} mode requires an available model. Wait for models to load and try again.`)}async function yu(e,t,n=[],r,a,o,s=[],l){var c;try{const f=(r==null?void 0:r.trim())??"",h=[];for(const O of n){const V=mf(O.trim());V&&h.push({label:Wb(V),path:V,fsPath:V})}const g=[...s,...h],b=g.filter((O,V)=>g.findIndex(Z=>Z.fsPath===O.fsPath)===V),j=[{type:"text",text:Vb(t,b)}];for(const O of n){const V=O.trim();if(!V)continue;const Z=mf(V);if(Z){j.push({type:"localImage",path:Z});continue}j.push({type:"image",url:V,image_url:V})}if(o)for(const O of o)j.push({type:"skill",name:O.name,path:O.path});const q=b.map(O=>({label:O.label,path:O.path,fsPath:O.fsPath})),te={threadId:e,input:j};if(q.length>0&&(te.attachments=q),f&&(te.model=f),typeof a=="string"&&a.length>0&&(te.effort=a),l){const O=await Gb(l,f,a);te.collaborationMode={mode:l,settings:{model:O.model,reasoning_effort:O.reasoningEffort,developer_instructions:null}}}const z=await $t("turn/start",te);return typeof((c=z==null?void 0:z.turn)==null?void 0:c.id)=="string"?z.turn.id.trim():""}catch(f){throw Ro(f,`Failed to start turn for thread ${e}`,"turn/start")}}async function Kb(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 $t("turn/interrupt",{threadId:n,turnId:r})}catch(a){throw Ro(a,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function Jb(e){const t=e==="fast"?"fast":"standard";await $t("config/batchWrite",{edits:[{keyPath:"features.fast_mode",value:!0,mergeStrategy:"upsert"},{keyPath:"service_tier",value:t==="fast"?"fast":null,mergeStrategy:t==="fast"?"upsert":"replace"}],filePath:null,expectedVersion:null})}async function Yb(){return await(await fetch("/codex-api/free-mode/status")).json()}async function gf(e){return await(await fetch("/codex-api/free-mode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enable:e})})).json()}async function vf(e){return await(await fetch("/codex-api/free-mode/custom-key",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({key:e})})).json()}async function $a(e,t,n){return await(await fetch("/codex-api/free-mode/custom-provider",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:e,apiKey:t,wireApi:n==null?void 0:n.wireApi,provider:n==null?void 0:n.provider})})).json()}async function $p(e={}){const t=await $t("model/list",{}),n=[];for(const r of t.data){const a=r.id||r.model;!a||n.includes(a)||n.push(a)}if(e.includeProviderModels===!1)return n;try{const r=await fetch("/codex-api/provider-models",{signal:AbortSignal.timeout(hb)});let a=null;try{a=await r.json()}catch{a=null}if(r.ok&&Array.isArray(a==null?void 0:a.data)){if(a.exclusive)return a.data.filter(o=>typeof o=="string"&&o.trim().length>0);for(const o of a.data){if(typeof o!="string")continue;const s=o.trim();!s||n.includes(s)||n.push(s)}}}catch{}return n}async function Np(){const e=await $t("config/read",{}),t=e.config.model??"",n=typeof e.config.model_provider=="string"?e.config.model_provider:"",r=vb(e.config.model_reasoning_effort),a=yb(e.config.service_tier);return{model:t,providerId:n,reasoningEffort:r,speedMode:a}}function Op(e){const t=at(e);if(!t)return null;const n=ue(t.id),r=ue(t.name);return!n||!r?null:{id:n,name:r,description:ue(t.description)??"",installUrl:ue(t.installUrl??t.install_url)??"",needsAuth:Rr(t.needsAuth??t.needs_auth)??!1}}function Qb(e){const t=at(e);if(!t)return null;const n=ue(t.name),r=ue(t.path);if(!n||!r)return null;const a=at(t.interface);return{name:n,path:r,description:ue(t.description)??"",enabled:Rr(t.enabled)??!0,displayName:ue((a==null?void 0:a.displayName)??(a==null?void 0:a.display_name))??n,shortDescription:ue(t.shortDescription??t.short_description)??""}}function Dp(e,t={}){const n=at(e);if(!n)return null;const r=ue(n.id),a=ue(n.name);if(!r||!a)return null;const o=at(n.interface),s=at(n.source),l=ue(s==null?void 0:s.type)??"",c=ue(s==null?void 0:s.path),f=ue(s==null?void 0:s.url)??"",h=l==="remote"?t.name??null:null,g=t.path??(l==="local"?c:null),b=ue((o==null?void 0:o.displayName)??(o==null?void 0:o.display_name))??a,x=ue((o==null?void 0:o.shortDescription)??(o==null?void 0:o.short_description)),j=ue((o==null?void 0:o.longDescription)??(o==null?void 0:o.long_description))??"";return{id:r,name:a,displayName:b,description:x??j,longDescription:j,developerName:ue((o==null?void 0:o.developerName)??(o==null?void 0:o.developer_name))??"",category:ue(o==null?void 0:o.category)??"",marketplaceName:t.name??"",marketplaceDisplayName:t.displayName??t.name??"",marketplacePath:g,remoteMarketplaceName:h,sourceType:l,sourceUrl:f,installed:Rr(n.installed)??!1,enabled:Rr(n.enabled)??!0,installPolicy:ue(n.installPolicy??n.install_policy)??"",authPolicy:ue(n.authPolicy??n.auth_policy)??"",logoUrl:ue((o==null?void 0:o.logoUrl)??(o==null?void 0:o.logo_url))??"",logoPath:ue(o==null?void 0:o.logo)??"",composerIconUrl:ue((o==null?void 0:o.composerIconUrl)??(o==null?void 0:o.composer_icon_url))??"",composerIconPath:ue((o==null?void 0:o.composerIcon)??(o==null?void 0:o.composer_icon))??"",brandColor:ue((o==null?void 0:o.brandColor)??(o==null?void 0:o.brand_color))??"",capabilities:Ba(o==null?void 0:o.capabilities),defaultPrompt:Ba((o==null?void 0:o.defaultPrompt)??(o==null?void 0:o.default_prompt)),screenshotUrls:Ba((o==null?void 0:o.screenshotUrls)??(o==null?void 0:o.screenshot_urls)),screenshots:Ba(o==null?void 0:o.screenshots),websiteUrl:ue((o==null?void 0:o.websiteUrl)??(o==null?void 0:o.website_url))??"",privacyPolicyUrl:ue((o==null?void 0:o.privacyPolicyUrl)??(o==null?void 0:o.privacy_policy_url))??"",termsOfServiceUrl:ue((o==null?void 0:o.termsOfServiceUrl)??(o==null?void 0:o.terms_of_service_url))??""}}function Xb(e,t=0){const n=at(e);if(!n)return null;const r=ue(n.id),a=ue(n.name);if(!r||!a)return null;const o=at(n.branding),s=at(n.appMetadata??n.app_metadata);return{id:r,name:a,description:ue(n.description)??ue((s==null?void 0:s.seoDescription)??(s==null?void 0:s.seo_description))??"",logoUrl:ue(n.logoUrl??n.logo_url)??"",logoUrlDark:ue(n.logoUrlDark??n.logo_url_dark)??"",distributionChannel:ue(n.distributionChannel??n.distribution_channel)??"",installUrl:ue(n.installUrl??n.install_url)??"",isAccessible:Rr(n.isAccessible??n.is_accessible)??!1,isEnabled:Rr(n.isEnabled??n.is_enabled)??!0,pluginDisplayNames:Ba(n.pluginDisplayNames??n.plugin_display_names),category:ue(o==null?void 0:o.category)??"",developer:ue(o==null?void 0:o.developer)??ue(s==null?void 0:s.developer)??"",website:ue(o==null?void 0:o.website)??"",privacyPolicy:ue((o==null?void 0:o.privacyPolicy)??(o==null?void 0:o.privacy_policy))??"",termsOfService:ue((o==null?void 0:o.termsOfService)??(o==null?void 0:o.terms_of_service))??"",catalogRank:t}}function Zb(e){const t=at(e);if(!t)return null;const n=ue(t.name);if(!n)return null;const r=at(t.tools)??{},a=Object.entries(r).map(([c,f])=>{const h=at(f);return{name:ue(h==null?void 0:h.name)??c,title:ue(h==null?void 0:h.title)??"",description:ue(h==null?void 0:h.description)??""}}),o=Array.isArray(t.resources)?t.resources.map(c=>{const f=at(c);return{name:ue(f==null?void 0:f.name)??"",title:ue(f==null?void 0:f.title)??"",uri:ue(f==null?void 0:f.uri)??"",description:ue(f==null?void 0:f.description)??""}}).filter(c=>c.name||c.uri):[],s=t.resourceTemplates??t.resource_templates,l=Array.isArray(s)?s.map(c=>{const f=at(c);return{name:ue(f==null?void 0:f.name)??"",title:ue(f==null?void 0:f.title)??"",uriTemplate:ue((f==null?void 0:f.uriTemplate)??(f==null?void 0:f.uri_template))??"",description:ue(f==null?void 0:f.description)??""}}).filter(c=>c.name||c.uriTemplate):[];return{name:n,authStatus:ue(t.authStatus??t.auth_status)??"unsupported",tools:a,resources:o,resourceTemplates:l}}async function mP(e){const t={};e&&e.length>0&&(t.cwds=e);const n=await $t("plugin/list",t),r=[];for(const a of n.marketplaces??[]){const o=at(a);if(!o)continue;const s=at(o.interface),l={name:ue(o.name)??"",displayName:ue((s==null?void 0:s.displayName)??(s==null?void 0:s.display_name))??"",path:ue(o.path)},c=Array.isArray(o.plugins)?o.plugins:[];for(const f of c){const h=Dp(f,l);h&&r.push(h)}}return r}async function gP(e){const t={pluginName:e.name};e.marketplacePath&&(t.marketplacePath=e.marketplacePath),e.remoteMarketplaceName&&(t.remoteMarketplaceName=e.remoteMarketplaceName);const n=await $t("plugin/read",t),r=at(n.plugin);if(!r)throw new Error("Plugin detail response is empty");const a=Dp(r.summary,{name:ue(r.marketplaceName)??e.marketplaceName,displayName:e.marketplaceDisplayName,path:ue(r.marketplacePath)??e.marketplacePath})??e;return{summary:a,description:ue(r.description)??a.longDescription,apps:Array.isArray(r.apps)?r.apps.map(Op).filter(o=>o!==null):[],skills:Array.isArray(r.skills)?r.skills.map(Qb).filter(o=>o!==null):[],mcpServers:Ba(r.mcpServers??r.mcp_servers)}}async function vP(e){const t={pluginName:e.name};e.marketplacePath&&(t.marketplacePath=e.marketplacePath),e.remoteMarketplaceName&&(t.remoteMarketplaceName=e.remoteMarketplaceName);const n=await $t("plugin/install",t),r=n.appsNeedingAuth??n.apps_needing_auth??[];return{authPolicy:ue(n.authPolicy??n.auth_policy)??"",appsNeedingAuth:r.map(Op).filter(a=>a!==null)}}async function yP(e){await $t("plugin/uninstall",{pluginId:e})}async function wP(e,t){await $t("config/batchWrite",{edits:[{keyPath:`plugins.${e}.enabled`,value:t,mergeStrategy:"upsert"}],filePath:null,expectedVersion:null,reloadUserConfig:!0})}async function bP(e){const t=[];let n=null,r=0;do{const a={limit:100};n&&(a.cursor=n),e&&(a.threadId=e);const o=await $t("app/list",a);for(const s of o.data??[]){const l=Xb(s,r);l&&t.push(l),r+=1}n=ue(o.nextCursor??o.next_cursor)}while(n);return t}async function _P(e,t){await $t("config/batchWrite",{edits:[{keyPath:`apps.${e}.enabled`,value:t,mergeStrategy:"upsert"}],filePath:null,expectedVersion:null,reloadUserConfig:!0})}async function TP(){const e=[];let t=null;do{const n={};t&&(n.cursor=t);const r=await $t("mcpServerStatus/list",n);for(const a of r.data??[]){const o=Zb(a);o&&e.push(o)}t=ue(r.nextCursor??r.next_cursor)}while(t);return e}async function SP(){await $t("config/mcpServer/reload",{})}async function kP(e){const t=await $t("mcpServer/oauth/login",{name:e});return{authorizationUrl:ue(t.authorizationUrl??t.authorization_url)??""}}async function CP(){const e=await fetch("/codex-api/composio/status");if(!e.ok)throw new Error(`Failed to load Composio status (${e.status})`);return await e.json()}async function xP(e="",t=null,n=50){const r=new URLSearchParams;e.trim()&&r.set("query",e.trim()),t&&r.set("cursor",t),n&&Number.isFinite(n)&&r.set("limit",String(Math.max(1,Math.floor(n))));const a=r.toString(),o=await fetch(`/codex-api/composio/connectors${a?`?${a}`:""}`);if(!o.ok)throw new Error(`Failed to list Composio connectors (${o.status})`);const s=await o.json();return{data:Array.isArray(s.data)?s.data:[],nextCursor:typeof s.nextCursor=="string"&&s.nextCursor.length>0?s.nextCursor:null,total:typeof s.total=="number"&&Number.isFinite(s.total)?Math.max(0,Math.floor(s.total)):0}}async function AP(e){const t=await fetch(`/codex-api/composio/connector?slug=${encodeURIComponent(e)}`);if(!t.ok)throw new Error(`Failed to load Composio connector (${t.status})`);return await t.json()}async function EP(e){const t=await fetch("/codex-api/composio/link",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:e})});if(!t.ok)throw new Error(`Failed to start Composio login (${t.status})`);return await t.json()}async function IP(){const e=await fetch("/codex-api/composio/login",{method:"POST"});if(!e.ok)throw new Error(`Failed to start Composio CLI login (${e.status})`);return await e.json()}async function PP(){const e=await fetch("/codex-api/composio/install",{method:"POST"});if(!e.ok)throw new Error(`Failed to install Composio CLI (${e.status})`);return await e.json()}function e0(e){const t=e.trim();return t?t.replace(/[_-]+/g," ").replace(/\b\w/g,n=>n.toUpperCase()):""}async function t0(){try{const e=await $t("collaborationMode/list",{}),t=new Set,n=[];for(const r of e.data){const a=r.mode;a!=="default"&&a!=="plan"||t.has(a)||(t.add(a),n.push({value:a,label:e0(r.name||a)||(a==="plan"?"Plan":"Default")}))}if(n.length>0){for(const r of sf)t.has(r.value)||n.push(r);return n.sort((r,a)=>r.value===a.value?0:r.value==="default"?-1:1)}}catch{}return sf}function n0(e){const t=e&&typeof e=="object"&&!Array.isArray(e)?e:{},n=o=>{if(!Array.isArray(o))return[];const s=[];for(const l of o)typeof l=="string"&&l.length>0&&!s.includes(l)&&s.push(l);return s},r=t.labels,a={};if(r&&typeof r=="object"&&!Array.isArray(r))for(const[o,s]of Object.entries(r)){const l=typeof o=="string"?Ft(o):"";l.length>0&&typeof s=="string"&&(a[l]=s)}return{order:n(t.order).map(o=>Ft(o)),labels:a,active:n(t.active).map(o=>Ft(o))}}function r0(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=typeof t.id=="string"?t.id.trim():"";if(!n)return null;const r=Array.isArray(t.imageUrls)?t.imageUrls.filter(s=>typeof s=="string"&&s.trim().length>0):[],a=Array.isArray(t.skills)?t.skills.flatMap(s=>{if(!s||typeof s!="object"||Array.isArray(s))return[];const l=s,c=typeof l.name=="string"?l.name.trim():"",f=typeof l.path=="string"?l.path.trim():"";return c&&f?[{name:c,path:f}]:[]}):[],o=Array.isArray(t.fileAttachments)?t.fileAttachments.flatMap(s=>{if(!s||typeof s!="object"||Array.isArray(s))return[];const l=s,c=typeof l.label=="string"?l.label.trim():"",f=typeof l.path=="string"?l.path.trim():"",h=typeof l.fsPath=="string"?l.fsPath.trim():"";return c&&f&&h?[{label:c,path:f,fsPath:h}]:[]}):[];return{id:n,text:typeof t.text=="string"?t.text:"",imageUrls:r,skills:a,fileAttachments:o,collaborationMode:t.collaborationMode==="plan"?"plan":"default"}}function Lp(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const t={};for(const[n,r]of Object.entries(e)){const a=n.trim();if(!a||!Array.isArray(r))continue;const o=r.flatMap(s=>{const l=r0(s);return l?[l]:[]});o.length>0&&(t[a]=o)}return t}async function Fa(){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 n0(n.data)}async function yf(){const e=await fetch("/codex-api/thread-queue-state"),t=await e.json();if(!e.ok)throw new Error("Failed to load thread queue state");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{};return Lp(n.data)}async function o0(e){if(!(await fetch("/codex-api/thread-queue-state",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(Lp(e))})).ok)throw new Error("Failed to save thread queue state")}async function a0(e,t){const n=(t??"").trim(),r=await fetch("/codex-api/worktree/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceCwd:e,baseBranch:n||void 0})}),a=await r.json();if(!r.ok||!a.data)throw new Error(a.error||"Failed to create worktree");return{...a.data,cwd:Ft(a.data.cwd),gitRoot:Ft(a.data.gitRoot)}}async function s0(e){const t=e.trim();if(!t)return[];const n=new URLSearchParams({sourceCwd:t}),r=await fetch(`/codex-api/worktree/branches?${n.toString()}`),a=await r.json();if(!r.ok)throw new Error(a.error||"Failed to load branches");const o=Array.isArray(a.data)?a.data:[],s=[],l=new Set;for(const c of o){if(!c||typeof c!="object"||Array.isArray(c))continue;const f=c,h=typeof f.value=="string"?f.value.trim():"",g=typeof f.label=="string"?f.label.trim():"";!h||l.has(h)||(l.add(h),s.push({value:h,label:g||h}))}return s}async function i0(e){const t=e.trim();if(!t)return{currentBranch:null,options:[]};const n=new URLSearchParams({cwd:t}),r=await fetch(`/codex-api/git/branches?${n.toString()}`),a=await r.json();if(!r.ok)throw new Error(a.error||"Failed to load Git branch state");const o=a.data&&typeof a.data=="object"&&!Array.isArray(a.data)?a.data:{},s=o.currentBranch,l=typeof s=="string"&&s.trim()?s.trim():null,c=Array.isArray(o.options)?o.options:[],f=[],h=new Set;for(const g of c){if(!g||typeof g!="object"||Array.isArray(g))continue;const b=g,x=typeof b.value=="string"?b.value.trim():"",j=typeof b.label=="string"?b.label.trim():"";!x||h.has(x)||(h.add(x),f.push({value:x,label:j||x}))}return l&&!h.has(l)&&f.unshift({value:l,label:l}),{currentBranch:l,options:f}}async function l0(e,t){var o;const n=await fetch("/codex-api/git/checkout",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e.trim(),branch:t.trim()})}),r=await n.json();if(!n.ok)throw new Error(r.error||"Failed to switch branch");const a=(o=r.data)==null?void 0:o.currentBranch;return typeof a=="string"&&a.trim()?a.trim():null}async function MP(e,t,n,r){const a=new URLSearchParams({cwd:e,scope:t,workspaceView:n});r&&r.trim()&&a.set("baseBranch",r.trim());const o=await fetch(`/codex-api/review/snapshot?${a.toString()}`),s=await o.json();if(!o.ok)throw new Error(zn(s,"Failed to load review snapshot"));return Mp(s)}async function RP(e){const t=await fetch("/codex-api/review/action",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await t.json();if(!t.ok)throw new Error(zn(n,"Failed to apply review action"));return Mp(n)}async function $P(e){const t=await fetch("/codex-api/review/git/init",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e})}),n=await t.json();if(!t.ok)throw new Error(zn(n,"Failed to initialize Git"))}async function NP(e,t,n,r){const a=t==="baseBranch"?{type:"baseBranch",branch:(r??"").trim()}:{type:"uncommittedChanges"};if(a.type==="baseBranch"&&!a.branch)throw new Error("Base branch is unavailable");await $t("review/start",{threadId:e,target:a,delivery:"inline"})}async function wf(){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 u0(e,t){const n=new URLSearchParams({path:e});(t==null?void 0:t.showHidden)===!0&&n.set("showHidden","1");const r=await fetch(`/codex-local-directories?${n.toString()}`),a=await Ic(r);if(!r.ok){const c=zn(a,"Failed to load local directories");throw new Error(c)}const o=a&&typeof a=="object"&&!Array.isArray(a)?a:{},s=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:{},l=Array.isArray(s.entries)?s.entries:[];return{path:typeof s.path=="string"?Ft(s.path):"",parentPath:typeof s.parentPath=="string"?Ft(s.parentPath):"",entries:l.flatMap(c=>{if(!c||typeof c!="object"||Array.isArray(c))return[];const f=c,h=typeof f.name=="string"?f.name.trim():"",g=typeof f.path=="string"?Ft(f.path):"";return h&&g?[{name:h,path:g}]:[]})}}async function Ic(e){const t=await e.text();if(!t)return{};try{return JSON.parse(t)}catch{throw new Error(`Expected JSON response from ${e.url||"request"}`)}}async function wu(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 bu(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 l=zn(r,"Failed to open project root");throw new Error(l)}const a=r&&typeof r=="object"&&!Array.isArray(r)?r:{},o=a.data&&typeof a.data=="object"&&!Array.isArray(a.data)?a.data:{};return typeof o.path=="string"?Ft(o.path):""}async function c0(e){const t=await fetch("/codex-api/local-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),n=await Ic(t);if(!t.ok){const o=zn(n,"Failed to create local directory");throw new Error(o)}const r=n&&typeof n=="object"&&!Array.isArray(n)?n:{},a=r.data&&typeof r.data=="object"&&!Array.isArray(r.data)?r.data:{};return typeof a.path=="string"?Ft(a.path):""}async function d0(e){const t=await fetch("/codex-api/projectless-thread-cwd",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:e??null})}),n=await Ic(t);if(!t.ok){const s=zn(n,"Failed to create new chat folder");throw new Error(s)}const r=n&&typeof n=="object"&&!Array.isArray(n)?n:{},a=r.data&&typeof r.data=="object"&&!Array.isArray(r.data)?r.data:{},o=typeof a.cwd=="string"?Ft(a.cwd):"";if(!o)throw new Error("Failed to create new chat folder");return{cwd:o,outputDirectory:typeof a.outputDirectory=="string"?Ft(a.outputDirectory):o,workspaceRoot:typeof a.workspaceRoot=="string"?Ft(a.workspaceRoot):""}}async function f0(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 s=zn(r,"Failed to suggest project name");throw new Error(s)}const a=r&&typeof r=="object"&&!Array.isArray(r)?r:{},o=a.data&&typeof a.data=="object"&&!Array.isArray(a.data)?a.data:{};return{name:typeof o.name=="string"?o.name.trim():"",path:typeof o.path=="string"?Ft(o.path):""}}async function h0(e,t,n=20){const r=e.trim();if(!r)return[];const a=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 a.json();if(!a.ok){const f=zn(o,"Failed to search files");throw new Error(f)}const s=o&&typeof o=="object"&&!Array.isArray(o)?o:{},l=Array.isArray(s.data)?s.data:[],c=[];for(const f of l){if(!f||typeof f!="object"||Array.isArray(f))continue;const g=f.path,b=typeof g=="string"?g.trim():"";b&&c.push({path:b})}return c}async function p0(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}}async function m0(e,t){const n=await fetch("/codex-api/telegram/configure-bot",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({botToken:e,allowedUserIds:t})}),r=await n.json();if(!n.ok){const a=zn(r,"Failed to connect Telegram bot");throw new Error(a)}}async function g0(){const e=await fetch("/codex-api/telegram/config"),t=await e.json();if(!e.ok){const s=zn(t,"Failed to load Telegram configuration");throw new Error(s)}const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{},a=Array.isArray(r.allowedUserIds)?r.allowedUserIds:[],o=[];for(const s of a){if(s==="*"){o.push("*");continue}typeof s=="number"&&Number.isFinite(s)&&o.push(Math.trunc(s))}return{botToken:typeof r.botToken=="string"?r.botToken:"",allowedUserIds:o}}async function v0(){const e=await fetch("/codex-api/telegram/status"),t=await e.json();if(!e.ok){const a=zn(t,"Failed to load Telegram status");throw new Error(a)}const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{};return{configured:r.configured===!0,active:r.active===!0,mappedChats:typeof r.mappedChats=="number"?r.mappedChats:0,mappedThreads:typeof r.mappedThreads=="number"?r.mappedThreads:0,allowedUsers:typeof r.allowedUsers=="number"?r.allowedUsers:0,allowAllUsers:r.allowAllUsers===!0,lastError:typeof r.lastError=="string"?r.lastError:""}}function zn(e,t){const n=e&&typeof e=="object"&&!Array.isArray(e)?e:{},r=n.message;if(typeof r=="string"&&r.trim().length>0)return r;const a=n.error;return typeof a=="string"&&a.trim().length>0?a:t}async function y0(){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 _u(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 w0(){try{const e=await fetch("/codex-api/thread-pins");return e.ok?(await e.json()).data??{threadIds:[]}:{threadIds:[]}}catch{return{threadIds:[]}}}async function b0(e){try{await fetch("/codex-api/thread-pins",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({threadIds:e})})}catch{}}async function _0(){var e;try{const t=await fetch("/codex-api/preferences/first-launch-plugins-card");return t.ok?{dismissed:((e=(await t.json()).data)==null?void 0:e.dismissed)===!0}:{dismissed:!1}}catch{return{dismissed:!1}}}async function T0(e){try{await fetch("/codex-api/preferences/first-launch-plugins-card",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({dismissed:e})})}catch{}}async function S0(e,t){var n;try{return((n=(await $t("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}function Qu(e){return e?e.endsWith("/SKILL.md")?e:`${e}/SKILL.md`:""}function k0(e,t){const n=Qu(e),r=n.split("/").filter(Boolean);if(r.length<2)return null;const a=r.lastIndexOf("skills");if(a>=2){const c=r[a-2]??"";if(c){const f=`/${[...r.slice(0,a+1),c,"SKILL.md"].join("/")}`;if(t.has(f))return{rootPath:f,rootName:c,isNested:f!==n}}}const o=r.indexOf("skills");if(o<0||o+1>=r.length-1)return null;const s=r[o+1]??"";if(!s)return null;const l=`/${[...r.slice(0,o+2),"SKILL.md"].join("/")}`;return t.has(l)?{rootPath:l,rootName:s,isNested:l!==n}:{rootPath:l,rootName:s,isNested:l!==n}}async function C0(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await $t("skills/list",t),r=n.data.flatMap(s=>s.skills),a=new Set(r.map(s=>Qu(s.path)).filter(Boolean)),o=new Map;for(const s of n.data)for(const l of s.skills){if(!l.name)continue;const c=k0(l.path,a),f=Qu(l.path),g=!!(c!=null&&c.isNested&&a.has(c.rootPath))?c.rootPath:f,b=f===g,x=o.get(g),j={name:l.name,displayName:c&&g===c.rootPath?c.rootName:void 0,description:l.shortDescription||l.description||"",path:g,scope:l.scope,enabled:l.enabled,__hasRoot:b};if(!x){o.set(g,j);continue}if(x.enabled=x.enabled||l.enabled,!x.__hasRoot&&b){o.set(g,j);continue}!x.displayName&&j.displayName&&(x.displayName=j.displayName),!x.description&&j.description&&(x.description=j.description)}return Array.from(o.values()).map(({__hasRoot:s,...l})=>l)}catch{return[]}}async function x0(){try{const e=await fetch("/codex-api/prompts");if(!e.ok)return[];const t=await e.json();return Array.isArray(t.data)?t.data:[]}catch{return[]}}async function A0(e,t){try{const n=await fetch("/codex-api/prompts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,content:t})});return n.ok?(await n.json()).data??null:null}catch{return null}}async function E0(e){try{const t=new URLSearchParams({path:e});return(await fetch(`/codex-api/prompts?${t.toString()}`,{method:"DELETE"})).ok}catch{return!1}}const I0=6e4;async function Tu(e){const t=new AbortController,n=setTimeout(()=>t.abort(),I0);try{const r=new FormData;r.append("file",e);const a=await fetch("/codex-api/upload-file",{method:"POST",body:r,signal:t.signal});return a.ok?(await a.json()).path??null:null}catch{return null}finally{clearTimeout(n)}}const P0={},M0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function R0(e,t){return C(),R("svg",M0,[...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 qa=kt(P0,[["render",R0]]),$0={},N0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function O0(e,t){return C(),R("svg",N0,[...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 Ii=kt($0,[["render",O0]]),D0={},L0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function j0(e,t){return C(),R("svg",L0,[...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 Na=kt(D0,[["render",j0]]),F0={},U0={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function B0(e,t){return C(),R("svg",U0,[...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 Ks=kt(F0,[["render",B0]]),q0={},H0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function z0(e,t){return C(),R("svg",H0,[...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 Pc=kt(q0,[["render",z0]]),V0={},W0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function G0(e,t){return C(),R("svg",W0,[...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 K0=kt(V0,[["render",G0]]),J0={},Y0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Q0(e,t){return C(),R("svg",Y0,[...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 Ms=kt(J0,[["render",Q0]]),X0={},Z0={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function e_(e,t){return C(),R("svg",Z0,[...t[0]||(t[0]=[Iv('<path d="M4 7h10"></path><path d="M18 7h2"></path><path d="M16 5v4"></path><path d="M4 17h2"></path><path d="M10 17h10"></path><path d="M8 15v4"></path>',6)])])}const t_=kt(X0,[["render",e_]]),n_={},r_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function o_(e,t){return C(),R("svg",r_,[...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 Pi=kt(n_,[["render",o_]]),jp="codex-web-local.ui-language.v1",a_={English:"English","Simplified Chinese":"简体中文","Search threads":"搜索线程","Filter threads...":"筛选线程...","Clear search":"清除搜索",Chats:"聊天",Projects:"项目",Pinned:"已固定","Chats first":"聊天优先","Sort by":"排序",Created:"创建时间",Updated:"更新时间","Filter chats":"筛选聊天","Hide chat filters":"隐藏聊天筛选","New chat":"新聊天","No chats":"没有聊天","Skills Hub":"技能中心","Expand accounts":"展开账户","Collapse accounts":"折叠账户",Accounts:"账户","Reloading…":"重新加载中…",Reload:"重新加载","Run `codex login`, then click reload.":"先运行 `codex login`,然后点击重新加载。",Account:"账户",Workspace:"工作区","Require ⌘ + enter to send":"需要 ⌘ + Enter 才发送","When busy, send as":"忙碌时发送方式",Steer:"引导",Queue:"排队",Appearance:"外观",System:"跟随系统",Dark:"深色",Light:"浅色","Chat width":"聊天宽度","Click to toggle dictation":"点击切换语音输入","Auto send dictation":"语音输入后自动发送",Provider:"提供方","Choose the API provider for the Codex backend":"选择 Codex 后端使用的 API 提供方","OpenRouter API key":"OpenRouter API Key","Get API key":"获取 API Key","Remove custom key, use community keys":"移除自定义 key,改用社区 key",Set:"设置",Save:"保存","API format":"API 格式","OpenRouter API format":"OpenRouter API 格式",Responses:"Responses",Completions:"Completions","OpenCode Zen API key":"OpenCode Zen API Key","Custom endpoint URL":"自定义端点 URL","API key":"API Key","Custom endpoint API format":"自定义端点 API 格式","UI language":"界面语言","Choose the interface language for the app.":"选择应用界面语言。","Dictation language":"听写语言","Auto-detect":"自动检测","Search language...":"搜索语言...",Telegram:"Telegram","Bot token":"Bot Token","Allowed Telegram user IDs":"允许的 Telegram 用户 ID","Put one Telegram user ID per line or separate them with commas. Use `*` to allow all Telegram users. Unauthorized users will see their own ID in the rejection message so they can copy it here.":"每行填写一个 Telegram 用户 ID,或用逗号分隔。使用 `*` 可允许所有 Telegram 用户。未授权用户会在拒绝消息中看到自己的 ID,方便复制到这里。","Saving…":"保存中…","Save Telegram config":"保存 Telegram 配置",Context:"上下文","Worktree name and version":"工作树名称和版本",Settings:"设置","Toggle terminal":"切换终端","Search branches...":"搜索分支...","Let's build":"开始构建","Choose folder":"选择文件夹","Quick search project":"快速搜索项目","Selected folder":"已选文件夹","Select folder":"选择文件夹","Create Project":"创建项目","Current folder":"当前文件夹",Unavailable:"不可用","Opening…":"打开中…",Open:"打开","Show hidden folders":"显示隐藏文件夹","New folder":"新建文件夹","Folder name":"文件夹名称","Filter folders...":"筛选文件夹...",Retry:"重试","Loading folders…":"加载文件夹中…","No folders match this filter.":"没有匹配此筛选条件的文件夹。","No subfolders found here.":"这里没有子文件夹。","Base branch":"基础分支","Select branch":"选择分支","Loading branches…":"加载分支中…","No Git branches found for this folder.":"此文件夹未找到 Git 分支。","Local project":"本地项目","New worktree":"新工作树","Service worker registration failed.":"Service Worker 注册失败。","No matching files":"没有匹配的文件","Add photos & files":"添加图片和文件","Add folder":"添加文件夹","Take photo":"拍照","In-progress send":"执行中发送","Fast mode":"快速模式","Plan mode":"规划模式","Agent proposes a plan before acting":"代理在执行前先提出计划",Model:"模型","Search models...":"搜索模型...",Skills:"技能","Search skills...":"搜索技能...","Search skills and prompts...":"搜索技能和提示词...",Thinking:"思考强度","Saving thread before stop is available":"线程保存后才能停止",Stop:"停止","Queue message":"加入队列","Send message":"发送消息",Send:"发送","Drop images or files":"拖放图片或文件","Selected image":"已选图片","Loading messages...":"加载消息中...",Plan:"计划",Updating:"更新中","Edit this message":"编辑此消息","Edit message":"编辑消息","Fork thread from this response":"从此回复分叉线程",Fork:"分叉","Response copied":"回复已复制","Copy response":"复制回复","Jump to latest":"跳转到最新","Jump to latest output":"跳转到最新输出","Close image preview":"关闭图片预览","Expanded message image":"放大消息图片","Changed files":"已更改文件","Close diff viewer":"关闭 diff 查看器","No diff available":"没有可用 diff","This summary was restored from the final answer text, but the thread history does not include patch diff content for this file.":"此摘要是从最终回答文本恢复的,但线程历史中不包含该文件的补丁 diff 内容。",Review:"审查","Close review pane":"关闭审查面板",Compare:"比较",Branch:"分支",Changes:"更改","Reviewing…":"审查中…","Run review":"运行审查","Loading review state":"加载审查状态中","This folder is not a Git repository":"此文件夹不是 Git 仓库","Initialize Git to review local changes and run Codex review.":"初始化 Git 后即可审查本地更改并运行 Codex review。","Initializing…":"初始化中…","Initialize Git":"初始化 Git","Base branch unavailable":"基础分支不可用","Could not resolve `origin/HEAD`, `main`, or `master` for this repository.":"无法为此仓库解析 `origin/HEAD`、`main` 或 `master`。","No changes in this scope":"此范围内没有更改","Your current workspace is clean.":"当前工作区很干净。","No merge diff found against the base branch.":"未找到相对基础分支的合并 diff。","No unified diff available.":"没有可用的统一 diff。",Summary:"摘要","No structured findings yet":"暂时没有结构化发现","The latest review only returned summary text.":"最近一次审查仅返回了摘要文本。","Run review to populate this pane.":"运行审查后会填充此面板。",Findings:"发现",Added:"新增",Deleted:"删除",Renamed:"重命名",Modified:"修改","Repository review":"仓库审查","Staged changes":"已暂存更改","Workspace changes":"工作区更改","Unstage all":"全部取消暂存","Stage all":"全部暂存","Revert all":"全部还原","Unstage file":"取消暂存文件","Stage file":"暂存文件","Revert file":"还原文件","Unstage hunk":"取消暂存代码块","Stage hunk":"暂存代码块","Revert hunk":"还原代码块","Failed to load review snapshot":"加载审查快照失败","Failed to apply review action":"应用审查操作失败","Failed to initialize Git":"初始化 Git 失败","Reviewing current changes":"正在审查当前更改","Failed to start review":"启动审查失败","Review in progress":"审查进行中","Failed to load review result":"加载审查结果失败",pin:"固定","Worktree thread":"工作树线程",Threads:"线程","Organize threads":"整理线程",Organize:"整理","By project":"按项目","Chronological list":"按时间顺序","No matching threads":"没有匹配的线程","Loading threads...":"加载线程中...","Edit name":"编辑名称",Remove:"移除","Project name":"项目名称","No threads":"没有线程","Thread title":"线程标题","Rename thread":"重命名线程","Make it short and recognizable.":"尽量简短且易识别。","Add title...":"输入标题...",Cancel:"取消","Delete thread":"删除线程","Thread automation":"线程自动化","This creates a heartbeat automation attached to the selected thread.":"这会创建一个附加到所选线程的心跳自动化。",Name:"名称","Automation name":"自动化名称",Prompt:"提示词","Search prompt...":"搜索提示词...","Describe what the automation should do":"描述自动化需要执行的内容","Schedule (RRULE)":"计划(RRULE)",Status:"状态",Active:"启用",Paused:"暂停","Expand sidebar":"展开侧边栏","Collapse sidebar":"折叠侧边栏","Start new thread":"新建线程","No skills found":"未找到技能","No results":"没有结果","Approval choices":"审批选项","No, and tell Codex what to do differently":"不允许,并告诉 Codex 应如何调整",Skip:"跳过",Server:"服务器","Open authorization link":"打开授权链接",Value:"值",Choice:"选项","Select true or false":"选择 true 或 false",True:"True",False:"False","Select an option":"选择一个选项",Decline:"拒绝",Continue:"继续","Other answer":"其他答案","Fail Tool Call":"使工具调用失败","Success (Empty)":"成功(空结果)","Return Empty Result":"返回空结果","New terminal":"新终端","Hide terminal":"隐藏终端",Close:"关闭","Edit queued message":"编辑排队消息","Send now without interrupting work":"立即发送且不中断当前工作","Delete queued message":"删除排队消息","AppServer API":"AppServer API","Loading method catalog...":"加载方法目录中...",Disabled:"已禁用",Installed:"已安装","Browse files":"浏览文件","Loading skill contents...":"加载技能内容中...","View on GitHub":"在 GitHub 查看","Show all":"显示全部","Hide all":"隐藏全部","No types yet":"还没有类型","Manage installed skills on this machine":"管理此机器上已安装的技能","Skills Sync (GitHub)":"技能同步(GitHub)",Connected:"已连接","Logged in as":"已登录为","Not connected":"未连接",Startup:"启动",Action:"动作","Manual sync":"手动同步","GitHub device login":"GitHub 设备登录","and enter code:":"并输入代码:","Login with GitHub":"使用 GitHub 登录","Device Login":"设备登录","Logout GitHub":"退出 GitHub","Syncing...":"同步中...","Startup Sync":"启动同步","Pulling...":"拉取中...",Pull:"拉取","Pushing...":"推送中...",Push:"推送","Installed ({count})":"已安装({count})","No installed skills found.":"未找到已安装的技能。","Continue in":"运行方式","Search daily":"搜索(日)","Search weekly":"搜索(周)","Search monthly":"搜索(月)","Trending daily":"热门(日)","Trending weekly":"热门(周)","Trending monthly":"热门(月)",Newest:"最新","A-Z":"A-Z","Loading skills...":"加载技能中...","Choose a thread":"选择一个线程","New worktree branch will start from {branch}.":"新工作树分支将从 {branch} 开始。","Local project uses the selected folder directly. New worktree creates an isolated Git worktree before the first prompt.":"本地项目会直接使用所选文件夹。新工作树会在第一次提问前创建一个隔离的 Git worktree。","Not configured":"未配置",Online:"在线","Configured (offline)":"已配置(离线)","allow all users":"允许所有用户","allowed user(s)":"个允许用户","chat(s)":"个聊天","thread(s)":"个线程",error:"错误",unknown:"未知","Switching…":"切换中…",Switch:"切换","Removing…":"移除中…","Click again to remove":"再次点击以移除","402 Payment Required":"402 需要付费","weekly remaining":"周剩余额度","Unlimited credits":"无限额度",credits:"额度","Loading quota…":"加载额度中…","Quota unavailable":"额度不可用","Fetching account details…":"获取账户详情中…","Unavailable account":"不可用账户","Waiting for Codex thread/tokenUsage/updated events for this thread.":"等待此线程的 Codex tokenUsage 更新事件。","Current context usage":"当前上下文使用量","Cumulative thread usage":"累计线程使用量","Model context window":"模型上下文窗口","Remaining context":"剩余上下文",tokens:"tokens","Model context window is unavailable in the latest usage event.":"最新使用事件中未提供模型上下文窗口。","Awaiting data":"等待数据中",left:"剩余",used:"已用","Updates after the next token usage event":"下次 token 使用事件后更新","Window size unavailable":"窗口大小不可用","Telegram bot token is required.":"需要填写 Telegram Bot Token。","At least one allowed Telegram user ID or * is required.":"至少需要一个允许的 Telegram 用户 ID 或 `*`。","Telegram bot configured. Only allowlisted Telegram users can use the bridge.":"Telegram 机器人已配置。只有白名单中的 Telegram 用户可以使用桥接。","Failed to connect Telegram bot":"连接 Telegram 机器人失败","Failed to load accounts":"加载账户失败","Failed to refresh accounts":"刷新账户失败","Finish the current turn and pending requests before switching accounts.":"请先完成当前轮次并处理待处理请求后再切换账户。","Failed to switch account":"切换账户失败","Finish the current turn and pending requests before removing the active account.":"请先完成当前轮次并处理待处理请求后再移除当前活动账户。","Failed to remove account":"移除账户失败",enabled:"已启用",disabled:"已禁用","Saving speed setting...":"保存速度设置中...","About 1.5x faster, with credits used at 2x":"速度约提升 1.5 倍,额度消耗为 2 倍","Default speed with normal credit usage":"默认速度,按正常额度消耗","Stop dictation":"停止听写","Click to dictate":"点击开始听写","Hold to dictate":"按住听写",failed:"失败",attaching:"正在附加",Attaching:"正在附加","Attaching file...":"正在附加文件...","files...":"个文件...",attached:"已附加","Could not attach file.":"无法附加文件。","Could not attach":"无法附加","files.":"个文件。","Select a thread to send a message":"选择一个线程后才能发送消息","Loading models for plan mode...":"正在为规划模式加载模型...","Type a message... (@ for files)":"输入消息...(@ 选择文件)",Hide:"隐藏",Terminal:"终端","Terminal input failed":"终端输入失败","Terminal attach failed":"终端附加失败","Creating worktree":"创建工作树","Creating a worktree and running setup.":"正在创建工作树并执行初始化。","Worktree setup failed":"工作树初始化失败","Unable to create worktree. Try again or switch to Local project.":"无法创建工作树。请重试,或切换到本地项目。",Edit:"编辑",image:"图片",images:"图片",file:"文件",files:"文件",skill:"技能",skills:"技能","(empty queued message)":"(空的排队消息)",Files:"文件",Unstaged:"未暂存",Staged:"已暂存",Refresh:"刷新",Against:"对比",selected:"已选","Reject Request":"拒绝请求","Uninstalling...":"卸载中...",Uninstall:"卸载","Installing...":"安装中...",Install:"安装",Disable:"禁用",Enable:"启用","When enabled, press Enter to send. When disabled, use Command+Enter to send.":"启用时按 Enter 发送;禁用时使用 Command+Enter 发送。","If a turn is still running, choose whether a new prompt should steer the current turn or be queued.":"如果当前轮次仍在运行,选择新提示是引导当前轮次还是加入队列。","Switch between system theme, light mode, and dark mode.":"在跟随系统、浅色和深色主题之间切换。","Choose how wide the conversation column and composer can grow on desktop screens.":"选择桌面端会话列和输入框的最大宽度。","Use click-to-start and click-to-stop dictation instead of hold-to-talk.":"使用点击开始/停止听写,而不是按住说话。","Automatically send transcribed dictation when recording stops.":"录音停止后自动发送转写结果。","Show or hide GitHub trending project cards on the new thread screen.":"显示或隐藏新线程页面上的 GitHub 热门项目卡片。","Choose transcription language or keep auto-detect.":"选择转写语言,或保持自动检测。",Standard:"标准",Wide:"宽","Extra wide":"超宽"},bf={en:"English","zh-CN":"简体中文"};function s_(){var t;return typeof window>"u"?"en":((t=window.localStorage.getItem(jp))==null?void 0:t.trim())==="zh-CN"?"zh-CN":"en"}const pl=P(s_());function Fp(e){typeof document>"u"||(document.documentElement.lang=e==="zh-CN"?"zh-CN":"en",document.documentElement.dataset.uiLanguage=e)}Fp(pl.value);function i_(e,t){return t?e.replace(/\{(\w+)\}/g,(n,r)=>String(t[r]??"")):e}function l_(e){pl.value=e,Fp(e),typeof window<"u"&&window.localStorage.setItem(jp,e)}function Up(e,t){const n=pl.value==="zh-CN"?a_[e]??e:e;return i_(n,t)}function Qo(){return{uiLanguage:pl,uiLanguageOptions:[{value:"en",label:bf.en},{value:"zh-CN",label:bf["zh-CN"]}],t:Up,setUiLanguage:l_}}const u_={key:0,class:"sidebar-menu-row-left"},c_={class:"sidebar-menu-row-main"},d_={key:1,class:"sidebar-menu-row-right"},f_={key:0,class:"sidebar-menu-row-right-default"},h_={key:1,class:"sidebar-menu-row-right-hover"},p_=Hn({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=Zg(),r=le(()=>!!n.left),a=le(()=>!!n.right),o=le(()=>!!n["right-hover"]),s=le(()=>a.value||o.value);return(l,c)=>(C(),rt(vc(t.as),np({class:"sidebar-menu-row","data-has-left":r.value,"data-has-right":s.value,"data-has-right-hover":o.value,"data-force-right-hover":t.forceRightHover},l.$attrs),{default:ct(()=>[r.value?(C(),R("span",u_,[po(l.$slots,"left",{},void 0,!0)])):ie("",!0),m("span",c_,[po(l.$slots,"default",{},void 0,!0)]),s.value?(C(),R("span",d_,[a.value?(C(),R("span",f_,[po(l.$slots,"right",{},void 0,!0)])):ie("",!0),o.value?(C(),R("span",h_,[po(l.$slots,"right-hover",{},void 0,!0)])):ie("",!0)])):ie("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),lo=kt(p_,[["__scopeId","data-v-36239f39"]]),m_={key:0,class:"pinned-section"},g_={class:"thread-tree-header"},v_={key:0,class:"thread-list"},y_=["data-menu-open"],w_={class:"thread-left-stack"},b_=["data-state"],__=["onClick"],T_=["onClick"],S_={class:"thread-row-title-wrap"},k_={class:"thread-row-title-line"},C_={class:"thread-row-title"},x_=["title"],A_=["data-state"],E_={class:"thread-row-time"},I_=["onClick"],P_={class:"projects-section"},M_={class:"thread-tree-header"},R_=["aria-expanded","aria-label","title"],$_={class:"organize-menu-title"},N_=["data-active"],O_={key:0},D_=["data-active"],L_={key:0},j_=["data-active"],F_={key:0},U_={class:"organize-menu-title"},B_=["data-active"],q_={key:0},H_=["data-active"],z_={key:0},V_={key:0,class:"thread-tree-no-results"},W_={key:1,class:"thread-tree-loading"},G_={key:2,class:"thread-list thread-list-global"},K_=["data-menu-open"],J_={class:"thread-left-stack"},Y_=["data-state"],Q_=["onClick"],X_=["onClick"],Z_={class:"thread-row-title-wrap"},eT={class:"thread-row-title-line"},tT={class:"thread-row-title"},nT=["title"],rT=["data-state"],oT={class:"thread-row-time"},aT=["onClick"],sT=["data-project-name","data-expanded","data-dragging"],iT={class:"project-icon-stack"},lT={class:"project-icon-folder"},uT={class:"project-icon-chevron"},cT=["data-dragging-handle","onMousedown"],dT={class:"project-title"},fT={class:"project-hover-controls"},hT=["onClick"],pT=["data-open-direction"],mT=["onClick"],gT=["onClick"],vT={class:"project-menu-label"},yT=["onInput"],wT=["aria-label","title","onClick"],bT={key:0,class:"thread-list"},_T=["data-menu-open"],TT={class:"thread-left-stack"},ST=["data-state"],kT=["onClick"],CT=["onClick"],xT={class:"thread-row-title-wrap"},AT={class:"thread-row-title-line"},ET={class:"thread-row-title"},IT=["title"],PT=["data-state"],MT={class:"thread-row-time"},RT=["onClick"],$T={class:"project-empty"},NT=["onClick"],OT={class:"chats-section"},DT={class:"thread-tree-header"},LT={class:"chats-section-actions"},jT=["aria-pressed","aria-label","title"],FT=["aria-label","title"],UT={key:0,class:"thread-tree-no-results"},BT={key:1,class:"thread-list thread-list-global"},qT=["data-menu-open"],HT={class:"thread-left-stack"},zT=["data-state"],VT=["onClick"],WT=["onClick"],GT={class:"thread-row-title-wrap"},KT={class:"thread-row-title-line"},JT={class:"thread-row-title"},YT=["title"],QT=["data-state"],XT={class:"thread-row-time"},ZT=["onClick"],eS=["data-open-direction"],tS={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},nS={class:"rename-thread-title"},rS=["onKeydown"],oS={class:"rename-thread-actions"},aS={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},sS={class:"rename-thread-title"},iS={class:"rename-thread-subtitle"},lS={class:"rename-thread-actions"},uS={class:"rename-thread-panel automation-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread automation"},cS={class:"rename-thread-title"},dS={class:"automation-thread-field"},fS={class:"automation-thread-field"},hS={class:"automation-thread-field"},pS={class:"automation-thread-field"},mS={value:"ACTIVE"},gS={value:"PAUSED"},vS={key:0,class:"rename-thread-subtitle automation-thread-error"},yS={class:"rename-thread-actions"},wS=["disabled"],bS=["disabled"],_S=["disabled"],TS=4,_f=6,Tf="codex-web-local.sidebar-section-expansion.v1",Sf="codex-web-local.sidebar-chats-first.v1",kf="codex-web-local.sidebar-chat-sort-mode.v1",Cf="codex-web-local.thread-view-mode.v1",xf="codex-web-local.collapsed-projects.v1",SS=Hn({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{},filterActive:{type:Boolean}},emits:["select","archive","start-new-thread","browse-thread-files","rename-project","rename-thread","remove-project","reorder-project","export-thread","fork-thread","start-new-chat","toggle-filter"],setup(e,{emit:t}){const n=e,{t:r}=Qo(),a=t,o=P({}),s=P({}),l=P(!0),c=P(!0),f=P(!0),h=P(ae(Sf,!1)),g=P(fe());let b=!1;const x=P([]),j=P(""),q=P(""),te=P({}),z=P({}),O=P({}),V=P("actions"),Z=P(""),Ae=P(!1),Ue=P(""),ne=P(""),Se=P(null),Y=P(!1),Ee=P(""),He=P(""),ee=P({}),we=P(!1),Re=P(""),Ke=P("create"),Be=P(""),xe=P(!1),me=P({name:"",prompt:"",rrule:"FREQ=DAILY;BYHOUR=9;BYMINUTE=0",status:"ACTIVE"}),We=P(null),nt=P(null),Ve=P(null);let Le=null,ft=null;const ht=P(""),Xe=P({}),dt=new Map,K=new Map,_e=new Map,be=new WeakMap,Oe=P(null),Je=P(null),k=P(!1),I=P(J()),H=typeof window<"u"?new ResizeObserver(w=>{for(const _ of w){const T=_.target,W=be.get(T);W&&F(W,T)}}):null;function re(){if(typeof window>"u")return{};try{const w=window.localStorage.getItem(xf);if(!w)return{};const _=JSON.parse(w);return!_||typeof _!="object"||Array.isArray(_)?{}:_}catch{return{}}}function J(){return typeof window>"u"?"project":window.localStorage.getItem(Cf)==="chronological"?"chronological":"project"}function ae(w,_){if(typeof window>"u")return _;const T=window.localStorage.getItem(w);return T==="true"?!0:T==="false"?!1:_}function fe(){return typeof window>"u"?"updated":window.localStorage.getItem(kf)==="created"?"created":"updated"}s.value=re();function ye(){if(!(typeof window>"u"))try{const w=JSON.parse(window.localStorage.getItem(Tf)||"{}");typeof w.pinned=="boolean"&&(l.value=w.pinned),typeof w.projects=="boolean"&&(c.value=w.projects),typeof w.chats=="boolean"&&(f.value=w.chats)}catch{}}function pe(){typeof window>"u"||window.localStorage.setItem(Tf,JSON.stringify({pinned:l.value,projects:c.value,chats:f.value}))}ye(),gt(s,w=>{typeof window>"u"||window.localStorage.setItem(xf,JSON.stringify(w))},{deep:!0}),gt(I,w=>{typeof window>"u"||window.localStorage.setItem(Cf,w)}),gt(h,w=>{typeof window>"u"||window.localStorage.setItem(Sf,String(w))}),gt(g,w=>{typeof window>"u"||window.localStorage.setItem(kf,w)}),gt([l,c,f],pe);const ce=le(()=>n.searchQuery.trim().toLowerCase()),$e=le(()=>ce.value.length>0),ge=le(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null),ke=le(()=>new Set(x.value));function De(w){if(!$e.value)return!0;if(ge.value)return ge.value.has(w.id);const _=ce.value;return w.title.toLowerCase().includes(_)||w.preview.toLowerCase().includes(_)}const Ze=le(()=>n.groups.map(w=>({...w,threads:w.threads.filter(_=>!Ji(_.cwd)&&De(_))})).filter(w=>w.threads.length>0)),D=le(()=>I.value==="chronological"),U=le(()=>{const w=[];for(const _ of n.groups)for(const T of _.threads)ke.value.has(T.id)||De(T)&&w.push(T);return w.sort((_,T)=>{const W=new Date(_.updatedAtIso||_.createdAtIso).getTime();return new Date(T.updatedAtIso||T.createdAtIso).getTime()-W})}),B=le(()=>{const w=U.value.filter(T=>Ji(T.cwd)),_=g.value==="created"?"createdAtIso":"updatedAtIso";return w.sort((T,W)=>{const Fe=new Date(T[_]||T.updatedAtIso||T.createdAtIso).getTime();return new Date(W[_]||W.updatedAtIso||W.createdAtIso).getTime()-Fe}).slice(0,4)}),Q=le(()=>{const w=new Map;for(const _ of n.groups)for(const T of _.threads)w.set(T.id,T);return w});gt(x,w=>{b&&b0(w)}),gt(Q,w=>{const _=x.value.filter(T=>w.has(T));_.length!==x.value.length&&(x.value=_)}),Jo(async()=>{const{threadIds:w}=await w0(),_=Array.isArray(w)?w.filter(T=>typeof T=="string").map(T=>T.trim()).filter((T,W,Fe)=>T.length>0&&Fe.indexOf(T)===W):[];_.length>0&&(x.value=_);try{ee.value=await Ib()}catch{ee.value={}}b=!0});const de=le(()=>ut(Ee.value)),Pe=le(()=>{const w=new Map;for(const _ of n.groups)for(const T of _.threads)w.set(T.id,_.projectName);return w}),je=le(()=>{const w=new Map;for(const _ of n.groups){const T=_.threads.filter(W=>!ke.value.has(W.id));w.set(_.projectName,T)}return w}),Qe=le(()=>{const w=new Map;for(const _ of n.groups)for(const T of _.threads){const W=new Date(T.updatedAtIso||T.createdAtIso).getTime();w.set(T.id,W)}return w}),Me=le(()=>{const w=q.value;return w?Q.value.get(w)??null:null}),bt=le(()=>x.value.map(w=>Q.value.get(w)??null).filter(w=>w!==null).filter(De));function Sn(){l.value=!l.value}function In(){c.value=!c.value}function Wr(){f.value=!f.value}const Bt=le(()=>{const w=Ve.value;if(!w||w.dropTargetIndexFull===null||n.groups.length===0)return null;const _=Math.max(0,Math.min(w.dropTargetIndexFull,n.groups.length)),T=_>w.fromIndex?_-1:_,W=Math.max(0,Math.min(T,n.groups.length-1));return W===w.fromIndex?null:W}),pr=le(()=>{const _=($e.value?Ze.value:n.groups).map(vt=>vt.projectName),T=Ve.value,W=Bt.value;if(!T||W===null)return _;const Fe=[..._],[yt]=Fe.splice(T.fromIndex,1);return yt?(Fe.splice(W,0,yt),Fe):_}),sr=le(()=>{const w={};let _=0;for(const T of pr.value)w[T]=_,_+=On(T);return w}),Gr=le(()=>{let w=0;for(const _ of pr.value)w+=On(_);return{height:`${Math.max(0,w)}px`}});function kr(w){if(Number.isNaN(w))return"n/a";const _=Math.abs(Date.now()-w);if(_<6e4)return"now";const T=Math.floor(_/6e4);if(T<60)return`${T}m`;const W=Math.floor(T/60);return W<24?`${W}h`:`${Math.floor(W/24)}d`}function mr(w){const _=Qe.value.get(w.id);return kr(typeof _=="number"?_:new Date(w.updatedAtIso||w.createdAtIso).getTime())}function Vn(w){return ke.value.has(w)}function Qt(w){if(Vn(w)){x.value=x.value.filter(_=>_!==w);return}x.value=[w,...x.value]}function Pn(w){a("select",w)}function ut(w){return!!ee.value[w]}function Mn(w){const _=ee.value[w];if(!_)return"";const T=_.status==="PAUSED"?"-":_.nextRunAtMs?new Date(_.nextRunAtMs).toLocaleString():"Not scheduled";return`${_.name} • Next run: ${T}`}function Wn(w){a("export-thread",w),Gt()}function Kr(w){a("fork-thread",w),Gt()}function Wt(w){return`start new thread ${nn(w)}`}function Gn(w){a("start-new-thread",w)}function qt(w){a("browse-thread-files",w),Gt()}async function Xt(w){var T,W;const _=((W=(T=Q.value.get(w))==null?void 0:T.cwd)==null?void 0:W.trim())??"";if(Gt(),!(!_||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(_)}catch{}}function Ot(w,_){if(q.value===w){if(_){const T=_.relatedTarget,W=Je.value;if(T instanceof Node&&W&&W.contains(T))return}Gt()}}function Et(w){return q.value===w}function Gt(){q.value="",O.value={}}function gr(w){if(q.value===w){Gt();return}fn(),k.value=!1,q.value=w,an(()=>{_t(w)})}function ir(w,_){w.preventDefault(),q.value=_}function Jr(w,_){Ue.value=w,ne.value=_,Ae.value=!0,Gt(),an(()=>{var T,W;(T=Se.value)==null||T.focus(),(W=Se.value)==null||W.select()})}function tn(){Ae.value=!1,Ue.value="",ne.value=""}function Rn(){const w=Ue.value,_=ne.value.trim();!w||!_||(a("rename-thread",{threadId:w,title:_}),tn())}function vr(w,_){Ee.value=w,He.value=_,Y.value=!0,Gt()}function lr(){Y.value=!1,Ee.value="",He.value=""}async function Yr(){const w=Ee.value;if(w){if(ut(w)){try{await ff(w)}catch{}ee.value=Object.fromEntries(Object.entries(ee.value).filter(([_])=>_!==w))}x.value=x.value.filter(_=>_!==w),a("archive",w),lr()}}function Kn(w){const _=ee.value[w];Re.value=w,Ke.value=_?"edit":"create",Be.value="",me.value={name:(_==null?void 0:_.name)??"Thread automation",prompt:(_==null?void 0:_.prompt)??"",rrule:(_==null?void 0:_.rrule)??"FREQ=DAILY;BYHOUR=9;BYMINUTE=0",status:(_==null?void 0:_.status)??"ACTIVE"},we.value=!0,Gt()}function $n(){we.value=!1,Re.value="",Be.value="",xe.value=!1}async function sn(){const w=Re.value;if(w){xe.value=!0,Be.value="";try{const _=await Pb({threadId:w,name:me.value.name,prompt:me.value.prompt,rrule:me.value.rrule,status:me.value.status});ee.value={...ee.value,[w]:_},$n()}catch(_){Be.value=_ instanceof Error?_.message:"Failed to save automation",xe.value=!1}}}async function yr(){const w=Re.value;if(w){xe.value=!0,Be.value="";try{await ff(w),ee.value=Object.fromEntries(Object.entries(ee.value).filter(([_])=>_!==w)),$n()}catch(_){Be.value=_ instanceof Error?_.message:"Failed to remove automation",xe.value=!1}}}function nn(w){return n.projectDisplayNameById[w]??w}function Qr(w){return j.value===w}function fn(){j.value="",V.value="actions",Z.value=""}function No(){const w=!k.value;w&&(fn(),Gt()),k.value=w}function gn(w){I.value=w,k.value=!1}function ur(){h.value=!h.value}function Jn(w){g.value=w}function wr(w){if(j.value===w){fn();return}Gt(),k.value=!1,j.value=w,V.value="actions",Z.value=nn(w),an(()=>{vo(w)})}function Dt(w){Gt(),j.value=w,V.value="rename",Z.value=nn(w),an(()=>{vo(w)})}function Nn(w){a("rename-project",{projectName:w,displayName:Z.value})}function Kt(w){a("remove-project",w),fn()}function br(w,_){if(!w.altKey||w.key!=="ArrowUp"&&w.key!=="ArrowDown")return;const T=n.groups.findIndex(yt=>yt.projectName===_);if(T<0)return;const W=w.key==="ArrowUp"?-1:1,Fe=Math.max(0,Math.min(T+W,n.groups.length-1));Fe!==T&&(w.preventDefault(),a("reorder-project",{projectName:_,toIndex:Fe}))}function rn(w){return o.value[w]===!0}function Tt(w){return s.value[w]===!0}function ln(w){o.value={...o.value,[w]:!rn(w)}}function cr(w){if(ht.value===w){ht.value="";return}s.value={...s.value,[w]:!Tt(w)}}function On(w){const _=Xe.value[w]??0,T=Ve.value,Fe=((T==null?void 0:T.projectName)===w?T.groupHeight:null)??_,yt=Tt(w)?0:_f;return Math.max(0,Fe+yt)}function _r(w,_){const T=_ instanceof HTMLElement?_:_&&"$el"in _&&_.$el instanceof HTMLElement?_.$el:null;if(T){K.set(w,T);return}K.delete(w)}function Xr(w,_){const T=_ instanceof HTMLElement?_:_&&"$el"in _&&_.$el instanceof HTMLElement?_.$el:null;if(T){_e.set(w,T);return}_e.delete(w)}function Cr(w){let _=w.parentElement;for(;_;){const T=window.getComputedStyle(_),W=T.overflowY||T.overflow;if(W==="auto"||W==="scroll"||W==="hidden"||W==="clip")return _.getBoundingClientRect();_=_.parentElement}return new DOMRect(0,0,window.innerWidth,window.innerHeight)}function vn(w,_){const T=w.getBoundingClientRect(),W=Cr(w),Fe=6,yt=W.bottom-T.bottom,vt=T.top-W.top;return yt>=_+Fe?"down":vt>yt?"up":"down"}function Nt(w,_){const T=_e.get(w);if(!T)return"down";const W=vn(T,_);return z.value={...z.value,[w]:W},W}function It(w){return z.value[w]??"down"}function vo(w){const _=K.get(w);_&&(te.value={...te.value,[w]:vn(_,112)})}function Zr(w,_,T){return Math.min(Math.max(w,_),T)}function _t(w){const _=_e.get(w);if(!_)return;const T=Je.value,W=T==null?void 0:T.getBoundingClientRect(),Fe=(W==null?void 0:W.height)||(T==null?void 0:T.offsetHeight)||112,yt=(W==null?void 0:W.width)||(T==null?void 0:T.offsetWidth)||160,vt=Nt(w,Fe),_n=_.getBoundingClientRect(),Ln=8,Zn=4,Or=Math.max(Ln,window.innerWidth-yt-Ln),Dr=Zr(_n.right-yt,Ln,Or),Zo=Zr(vt==="up"?_n.top-Fe-Zn:_n.bottom+Zn,Ln,Math.max(Ln,window.innerHeight-Fe-Ln));O.value={left:`${Math.round(Dr)}px`,top:`${Math.round(Zo)}px`}}function on(){const w=q.value;w&&_t(w)}function un(){window.addEventListener("resize",on),document.addEventListener("scroll",on,!0)}function Dn(){window.removeEventListener("resize",on),document.removeEventListener("scroll",on,!0)}function kn(w){const _=j.value;if(!_)return!1;const T=K.get(_);if(!T)return!1;if((typeof w.composedPath=="function"?w.composedPath():[]).includes(T))return!0;const Fe=w.target;return Fe instanceof Node?T.contains(Fe):!1}function yn(w){const _=q.value;if(!_)return!1;const T=_e.get(_);if(!T)return!1;const W=typeof w.composedPath=="function"?w.composedPath():[];if(W.includes(T))return!0;const Fe=Je.value;if(Fe&&W.includes(Fe))return!0;const yt=w.target;return yt instanceof Node?!!(T.contains(yt)||Fe&&Fe.contains(yt)):!1}function Yn(w){if(k.value){const _=Oe.value,T=typeof w.composedPath=="function"?w.composedPath():[];!!_&&(T.includes(_)||w.target instanceof Node&&_.contains(w.target))||(k.value=!1)}j.value&&(kn(w)||fn(),q.value&&(yn(w)||Gt()))}function xr(w){j.value&&!kn(w)&&fn(),q.value&&!yn(w)&&Gt()}function eo(){k.value&&(k.value=!1),j.value&&fn(),q.value&&Gt()}function Ar(){window.addEventListener("pointerdown",Yn,{capture:!0}),window.addEventListener("focusin",xr,{capture:!0}),window.addEventListener("blur",eo)}function A(){window.removeEventListener("pointerdown",Yn,{capture:!0}),window.removeEventListener("focusin",xr,{capture:!0}),window.removeEventListener("blur",eo)}function F(w,_){const T=_.getBoundingClientRect().height;if(!Number.isFinite(T)||T<=0)return;const W=Xe.value[w];W!==void 0&&Math.abs(W-T)<.5||(Xe.value={...Xe.value,[w]:T})}function X(w,_){const T=dt.get(w);T&&T!==_&&H&&H.unobserve(T);const W=_ instanceof HTMLElement?_:_&&"$el"in _&&_.$el instanceof HTMLElement?_.$el:null;if(W){dt.set(w,W),be.set(W,w),F(w,W),H==null||H.observe(W);return}T&&(H==null||H.unobserve(T)),dt.delete(w)}function Ie(w,_){if(w.button!==0||nt.value||Ve.value)return;const T=n.groups.findIndex(vt=>vt.projectName===_),W=dt.get(_);if(T<0||!W)return;const Fe=W.getBoundingClientRect(),yt=Tt(_)?0:_f;nt.value={projectName:_,fromIndex:T,startClientX:w.clientX,startClientY:w.clientY,pointerOffsetY:w.clientY-Fe.top,groupLeft:Fe.left,groupWidth:Fe.width,groupHeight:Fe.height,groupOuterHeight:Fe.height+yt},w.preventDefault(),lt()}function lt(){window.addEventListener("mousemove",Zt),window.addEventListener("mouseup",xt),window.addEventListener("keydown",wn)}function Ct(){window.removeEventListener("mousemove",Zt),window.removeEventListener("mouseup",xt),window.removeEventListener("keydown",wn)}function Zt(w){Le={clientX:w.clientX,clientY:w.clientY},Qn()}function xt(w){Xn({clientX:w.clientX,clientY:w.clientY});const _=Ve.value;if(_&&Bt.value!==null){const T=n.groups.findIndex(W=>W.projectName===_.projectName);if(T>=0){const W=Bt.value;W!==T&&a("reorder-project",{projectName:_.projectName,toIndex:W})}}Tr()}function wn(w){w.key==="Escape"&&(!nt.value&&!Ve.value||(w.preventDefault(),Tr()))}function Tr(){ft!==null&&(window.cancelAnimationFrame(ft),ft=null),Le=null,nt.value=null,Ve.value=null,ht.value="",Ct()}function Qn(){ft===null&&(ft=window.requestAnimationFrame(()=>{if(ft=null,!Le)return;const w=Le;Le=null,Xn(w)}))}function Xn(w){const _=nt.value;if(!Ve.value&&_){const T=w.clientX-_.startClientX,W=w.clientY-_.startClientY;if(Math.hypot(T,W)<TS)return;fn(),ht.value=_.projectName,Ve.value={projectName:_.projectName,fromIndex:_.fromIndex,pointerOffsetY:_.pointerOffsetY,groupLeft:_.groupLeft,groupWidth:_.groupWidth,groupHeight:_.groupHeight,groupOuterHeight:_.groupOuterHeight,ghostTop:w.clientY-_.pointerOffsetY,dropTargetIndexFull:null}}Ve.value&&qe(w)}function qe(w){const _=Ve.value;if(!_)return;if(_.ghostTop=w.clientY-_.pointerOffsetY,!Ce(w)){_.dropTargetIndexFull=null;return}const T=w.clientY,W=We.value;if(!W){_.dropTargetIndexFull=null;return}const Fe=W.getBoundingClientRect(),yt=new Map(n.groups.map((Zn,Or)=>[Zn.projectName,Or])),vt=n.groups.map(Zn=>Zn.projectName).filter(Zn=>Zn!==_.projectName);let _n=0,Ln=n.groups.length;for(const Zn of vt){const Or=yt.get(Zn);if(Or===void 0)continue;const Dr=On(Zn),Zo=Fe.top+_n+Dr/2;if(T<Zo){Ln=Or;break}_n+=Dr}_.dropTargetIndexFull=Ln}function Ce(w){const _=We.value;if(!_)return!1;const T=_.getBoundingClientRect(),W=w.clientX>=T.left&&w.clientX<=T.right,Fe=w.clientY>=T.top-32&&w.clientY<=T.bottom+32;return W&&Fe}function Lt(w){var _;return((_=Ve.value)==null?void 0:_.projectName)===w}function bn(w){const _=Ve.value,T=sr.value[w]??0,W=q.value?Pe.value.get(q.value)??"":"",Fe=j.value===w||W===w;return!_||_.projectName!==w?{position:"absolute",top:"0",left:"0",right:"0",zIndex:Fe?"40":"1",transform:`translate3d(0, ${T}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${_.groupLeft}px`,width:`${_.groupWidth}px`,height:`${_.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${_.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function Cn(w){return je.value.get(w.projectName)??[]}function Xo(w){if($e.value)return Cn(w);if(Tt(w.projectName))return[];const _=Cn(w);return rn(w.projectName)?_:_.slice(0,10)}function Ht(w){return $e.value?!1:!Tt(w.projectName)&&Cn(w).length>10}function dr(w){return Cn(w).length>0}function $r(w){return!!w.pendingRequestState||w.inProgress||w.unread}function Nr(w){return w.pendingRequestState==="approval"?"Awaiting approval":"Awaiting response"}function to(w){return w.pendingRequestState==="approval"?"awaiting-approval":w.pendingRequestState==="response"?"awaiting-response":w.inProgress?"working":w.unread?"unread":"idle"}gt(()=>n.groups.map(w=>w.projectName),w=>{var Fe,yt;const _=((Fe=Ve.value)==null?void 0:Fe.projectName)??((yt=nt.value)==null?void 0:yt.projectName)??"";_&&!n.groups.some(vt=>vt.projectName===_)&&Tr();const T=new Set(w),W=Object.fromEntries(Object.entries(Xe.value).filter(([vt])=>T.has(vt)));Object.keys(W).length!==Object.keys(Xe.value).length&&(Xe.value=W)});const no=le(()=>k.value||j.value!==""||q.value!=="");return gt(no,w=>{if(w){Ar();return}A()}),gt(q,w=>{if(!w){Dn();return}un(),an(()=>{_t(w)})}),Ta(()=>{for(const w of dt.values())H==null||H.unobserve(w);dt.clear(),K.clear(),Dn(),A(),Tr()}),(w,_)=>(C(),R("section",{class:it(["thread-tree-root",{"chats-first":h.value}])},[bt.value.length>0?(C(),R("section",m_,[Ne(lo,{as:"button",class:"section-toggle-row",type:"button","aria-expanded":l.value,onClick:Sn},{left:ct(()=>[l.value?(C(),rt(qa,{key:1,class:"thread-icon"})):(C(),rt(Ii,{key:0,class:"thread-icon"}))]),default:ct(()=>[m("span",g_,N(S(r)("Pinned")),1)]),_:1},8,["aria-expanded"]),l.value?(C(),R("ul",v_,[(C(!0),R(Ge,null,zt(bt.value,T=>(C(),R("li",{key:T.id,class:"thread-row-item","data-menu-open":Et(T.id)?"true":"false"},[Ne(lo,{class:"thread-row","data-active":T.id===e.selectedThreadId,"data-pinned":Vn(T.id),"data-menu-open":Et(T.id)?"true":"false","force-right-hover":Et(T.id),onClick:W=>Pn(T.id),onMouseleave:W=>Ot(T.id,W),onContextmenu:W=>ir(W,T.id)},{left:ct(()=>[m("span",w_,[$r(T)?(C(),R("span",{key:0,class:"thread-status-indicator","data-state":to(T)},null,8,b_)):ie("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:et(W=>Qt(T.id),["stop"])},[Ne(Pi,{class:"thread-icon"})],8,__)])]),right:ct(()=>[m("span",E_,N(mr(T)),1)]),"right-hover":ct(()=>[m("div",{ref_for:!0,ref:W=>Xr(T.id,W),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:et(W=>gr(T.id),["stop"])},[Ne(Na,{class:"thread-icon"})],8,I_)],512)]),default:ct(()=>[m("button",{class:"thread-main-button",type:"button",onClick:et(W=>Pn(T.id),["stop"])},[m("span",S_,[m("span",k_,[m("span",C_,N(T.title),1),T.hasWorktree?(C(),rt(Ms,{key:0,class:"thread-row-worktree-icon",title:S(r)("Worktree thread")},null,8,["title"])):ie("",!0),ut(T.id)?(C(),R("span",{key:1,class:"thread-row-automation-chip",title:Mn(T.id)}," Auto ",8,x_)):ie("",!0),T.pendingRequestState?(C(),R("span",{key:2,class:"thread-row-request-chip","data-state":T.pendingRequestState},N(Nr(T)),9,A_)):ie("",!0)])])],8,T_)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onClick","onMouseleave","onContextmenu"])],8,y_))),128))])):ie("",!0)])):ie("",!0),m("section",P_,[Ne(lo,{as:"button",class:"thread-tree-header-row section-toggle-row",type:"button","aria-expanded":c.value,onClick:In},{left:ct(()=>[c.value?(C(),rt(qa,{key:1,class:"thread-icon"})):(C(),rt(Ii,{key:0,class:"thread-icon"}))]),right:ct(()=>[m("div",{ref_key:"organizeMenuWrapRef",ref:Oe,class:"organize-menu-wrap"},[m("button",{class:"organize-menu-trigger",type:"button","aria-expanded":k.value,"aria-label":S(r)("Organize threads"),title:S(r)("Organize threads"),onClick:et(No,["stop"])},[Ne(Na,{class:"thread-icon"})],8,R_),k.value?(C(),R("div",{key:0,class:"organize-menu-panel",onClick:_[4]||(_[4]=et(()=>{},["stop"]))},[m("p",$_,N(S(r)("Organize")),1),m("button",{class:"organize-menu-item","data-active":I.value==="project",type:"button",onClick:_[0]||(_[0]=T=>gn("project"))},[m("span",null,N(S(r)("By project")),1),I.value==="project"?(C(),R("span",O_,"✓")):ie("",!0)],8,N_),m("button",{class:"organize-menu-item","data-active":I.value==="chronological",type:"button",onClick:_[1]||(_[1]=T=>gn("chronological"))},[m("span",null,N(S(r)("Chronological list")),1),I.value==="chronological"?(C(),R("span",L_,"✓")):ie("",!0)],8,D_),m("button",{class:"organize-menu-item","data-active":h.value,type:"button",onClick:ur},[m("span",null,N(S(r)("Chats first")),1),h.value?(C(),R("span",F_,"✓")):ie("",!0)],8,j_),_[22]||(_[22]=m("div",{class:"organize-menu-separator"},null,-1)),m("p",U_,N(S(r)("Sort by")),1),m("button",{class:"organize-menu-item","data-active":g.value==="created",type:"button",onClick:_[2]||(_[2]=T=>Jn("created"))},[m("span",null,N(S(r)("Created")),1),g.value==="created"?(C(),R("span",q_,"✓")):ie("",!0)],8,B_),m("button",{class:"organize-menu-item","data-active":g.value==="updated",type:"button",onClick:_[3]||(_[3]=T=>Jn("updated"))},[m("span",null,N(S(r)("Updated")),1),g.value==="updated"?(C(),R("span",z_,"✓")):ie("",!0)],8,H_)])):ie("",!0)],512)]),default:ct(()=>[m("span",M_,N(S(r)("Projects")),1)]),_:1},8,["aria-expanded"]),c.value?(C(),R(Ge,{key:0},[$e.value&&Ze.value.length===0?(C(),R("p",V_,N(S(r)("No matching threads")),1)):e.isLoading&&e.groups.length===0?(C(),R("p",W_,N(S(r)("Loading threads...")),1)):D.value?(C(),R("ul",G_,[(C(!0),R(Ge,null,zt(U.value,T=>(C(),R("li",{key:T.id,class:"thread-row-item","data-menu-open":Et(T.id)?"true":"false"},[Ne(lo,{class:"thread-row","data-active":T.id===e.selectedThreadId,"data-pinned":Vn(T.id),"data-menu-open":Et(T.id)?"true":"false","force-right-hover":Et(T.id),onClick:W=>Pn(T.id),onMouseleave:W=>Ot(T.id,W),onContextmenu:W=>ir(W,T.id)},{left:ct(()=>[m("span",J_,[$r(T)?(C(),R("span",{key:0,class:"thread-status-indicator","data-state":to(T)},null,8,Y_)):ie("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:et(W=>Qt(T.id),["stop"])},[Ne(Pi,{class:"thread-icon"})],8,Q_)])]),right:ct(()=>[m("span",oT,N(mr(T)),1)]),"right-hover":ct(()=>[m("div",{ref_for:!0,ref:W=>Xr(T.id,W),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:et(W=>gr(T.id),["stop"])},[Ne(Na,{class:"thread-icon"})],8,aT)],512)]),default:ct(()=>[m("button",{class:"thread-main-button",type:"button",onClick:et(W=>Pn(T.id),["stop"])},[m("span",Z_,[m("span",eT,[m("span",tT,N(T.title),1),T.hasWorktree?(C(),rt(Ms,{key:0,class:"thread-row-worktree-icon",title:S(r)("Worktree thread")},null,8,["title"])):ie("",!0),ut(T.id)?(C(),R("span",{key:1,class:"thread-row-automation-chip",title:Mn(T.id)}," Auto ",8,nT)):ie("",!0),T.pendingRequestState?(C(),R("span",{key:2,class:"thread-row-request-chip","data-state":T.pendingRequestState},N(Nr(T)),9,rT)):ie("",!0)])])],8,X_)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onClick","onMouseleave","onContextmenu"])],8,K_))),128))])):(C(),R("div",{key:3,ref_key:"groupsContainerRef",ref:We,class:"thread-tree-groups",style:Ao(Gr.value)},[(C(!0),R(Ge,null,zt(Ze.value,T=>(C(),R("article",{key:T.projectName,ref_for:!0,ref:W=>X(T.projectName,W),class:"project-group","data-project-name":T.projectName,"data-expanded":!Tt(T.projectName),"data-dragging":Lt(T.projectName),style:Ao(bn(T.projectName))},[Ne(lo,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:W=>cr(T.projectName),onKeydown:[W=>br(W,T.projectName),dn(et(W=>cr(T.projectName),["prevent"]),["enter"]),dn(et(W=>cr(T.projectName),["prevent"]),["space"])]},{left:ct(()=>[m("span",iT,[m("span",lT,[Tt(T.projectName)?(C(),rt(Pc,{key:0,class:"thread-icon"})):(C(),rt(K0,{key:1,class:"thread-icon"}))]),m("span",uT,[Tt(T.projectName)?(C(),rt(Ii,{key:0,class:"thread-icon"})):(C(),rt(qa,{key:1,class:"thread-icon"}))])])]),right:ct(()=>[m("div",fT,[m("div",{ref_for:!0,ref:W=>_r(T.projectName,W),class:"project-menu-wrap"},[m("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:et(W=>wr(T.projectName),["stop"])},[Ne(Na,{class:"thread-icon"})],8,hT),Qr(T.projectName)?(C(),R("div",{key:0,class:"project-menu-panel","data-open-direction":te.value[T.projectName]??"down",onClick:_[6]||(_[6]=et(()=>{},["stop"]))},[V.value==="actions"?(C(),R(Ge,{key:0},[m("button",{class:"project-menu-item",type:"button",onClick:W=>Dt(T.projectName)}," Edit name ",8,mT),m("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:W=>Kt(T.projectName)}," Remove ",8,gT)],64)):(C(),R(Ge,{key:1},[m("label",vT,N(S(r)("Project name")),1),cn(m("input",{"onUpdate:modelValue":_[5]||(_[5]=W=>Z.value=W),class:"project-menu-input",type:"text",onInput:W=>Nn(T.projectName)},null,40,yT),[[Tn,Z.value]])],64))],8,pT)):ie("",!0)],512),m("button",{class:"thread-start-button",type:"button","aria-label":Wt(T.projectName),title:Wt(T.projectName),onClick:et(W=>Gn(T.projectName),["stop"])},[Ne(Ks,{class:"thread-icon"})],8,wT)])]),default:ct(()=>[m("span",{class:"project-main-button","data-dragging-handle":Lt(T.projectName),onMousedown:et(W=>Ie(W,T.projectName),["left"])},[m("span",dT,N(nn(T.projectName)),1)],40,cT)]),_:2},1032,["onClick","onKeydown"]),dr(T)?(C(),R("ul",bT,[(C(!0),R(Ge,null,zt(Xo(T),W=>(C(),R("li",{key:W.id,class:"thread-row-item","data-menu-open":Et(W.id)?"true":"false"},[Ne(lo,{class:"thread-row","data-active":W.id===e.selectedThreadId,"data-pinned":Vn(W.id),"data-menu-open":Et(W.id)?"true":"false","force-right-hover":Et(W.id),onClick:Fe=>Pn(W.id),onMouseleave:Fe=>Ot(W.id,Fe),onContextmenu:Fe=>ir(Fe,W.id)},{left:ct(()=>[m("span",TT,[$r(W)?(C(),R("span",{key:0,class:"thread-status-indicator","data-state":to(W)},null,8,ST)):ie("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:et(Fe=>Qt(W.id),["stop"])},[Ne(Pi,{class:"thread-icon"})],8,kT)])]),right:ct(()=>[m("span",MT,N(mr(W)),1)]),"right-hover":ct(()=>[m("div",{ref_for:!0,ref:Fe=>Xr(W.id,Fe),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:et(Fe=>gr(W.id),["stop"])},[Ne(Na,{class:"thread-icon"})],8,RT)],512)]),default:ct(()=>[m("button",{class:"thread-main-button",type:"button",onClick:et(Fe=>Pn(W.id),["stop"])},[m("span",xT,[m("span",AT,[m("span",ET,N(W.title),1),W.hasWorktree?(C(),rt(Ms,{key:0,class:"thread-row-worktree-icon",title:S(r)("Worktree thread")},null,8,["title"])):ie("",!0),ut(W.id)?(C(),R("span",{key:1,class:"thread-row-automation-chip",title:Mn(W.id)}," Auto ",8,IT)):ie("",!0),W.pendingRequestState?(C(),R("span",{key:2,class:"thread-row-request-chip","data-state":W.pendingRequestState},N(Nr(W)),9,PT)):ie("",!0)])])],8,CT)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onClick","onMouseleave","onContextmenu"])],8,_T))),128))])):(C(),rt(lo,{key:1,as:"p",class:"project-empty-row"},{left:ct(()=>[..._[23]||(_[23]=[m("span",{class:"project-empty-spacer"},null,-1)])]),default:ct(()=>[m("span",$T,N(S(r)("No threads")),1)]),_:1})),Ht(T)?(C(),rt(lo,{key:2,class:"thread-show-more-row"},{left:ct(()=>[..._[24]||(_[24]=[m("span",{class:"thread-show-more-spacer"},null,-1)])]),default:ct(()=>[m("button",{class:"thread-show-more-button",type:"button",onClick:W=>ln(T.projectName)},N(rn(T.projectName)?"Show less":"Show more"),9,NT)]),_:2},1024)):ie("",!0)],12,sT))),128))],4))],64)):ie("",!0)]),m("section",OT,[Ne(lo,{as:"button",class:"section-toggle-row",type:"button","aria-expanded":f.value,onClick:Wr},{left:ct(()=>[f.value?(C(),rt(qa,{key:1,class:"thread-icon"})):(C(),rt(Ii,{key:0,class:"thread-icon"}))]),right:ct(()=>[m("div",LT,[m("button",{class:"chats-section-action",type:"button","aria-pressed":e.filterActive,"aria-label":e.filterActive?S(r)("Hide chat filters"):S(r)("Filter chats"),title:e.filterActive?S(r)("Hide chat filters"):S(r)("Filter chats"),onClick:_[7]||(_[7]=et(T=>w.$emit("toggle-filter"),["stop"]))},[Ne(t_,{class:"thread-icon"})],8,jT),m("button",{class:"chats-section-action",type:"button","aria-label":S(r)("New chat"),title:S(r)("New chat"),onClick:_[8]||(_[8]=et(T=>w.$emit("start-new-chat"),["stop"]))},[Ne(Ks,{class:"thread-icon"})],8,FT)])]),default:ct(()=>[m("span",DT,N(S(r)("Chats")),1)]),_:1},8,["aria-expanded"]),f.value&&B.value.length===0?(C(),R("p",UT,N(S(r)("No chats")),1)):f.value?(C(),R("ul",BT,[(C(!0),R(Ge,null,zt(B.value,T=>(C(),R("li",{key:T.id,class:"thread-row-item","data-menu-open":Et(T.id)?"true":"false"},[Ne(lo,{class:"thread-row","data-active":T.id===e.selectedThreadId,"data-pinned":Vn(T.id),"data-menu-open":Et(T.id)?"true":"false","force-right-hover":Et(T.id),onClick:W=>Pn(T.id),onMouseleave:W=>Ot(T.id,W),onContextmenu:W=>ir(W,T.id)},{left:ct(()=>[m("span",HT,[$r(T)?(C(),R("span",{key:0,class:"thread-status-indicator","data-state":to(T)},null,8,zT)):ie("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:et(W=>Qt(T.id),["stop"])},[Ne(Pi,{class:"thread-icon"})],8,VT)])]),right:ct(()=>[m("span",XT,N(mr(T)),1)]),"right-hover":ct(()=>[m("div",{ref_for:!0,ref:W=>Xr(T.id,W),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:et(W=>gr(T.id),["stop"])},[Ne(Na,{class:"thread-icon"})],8,ZT)],512)]),default:ct(()=>[m("button",{class:"thread-main-button",type:"button",onClick:et(W=>Pn(T.id),["stop"])},[m("span",GT,[m("span",KT,[m("span",JT,N(T.title),1),T.hasWorktree?(C(),rt(Ms,{key:0,class:"thread-row-worktree-icon",title:S(r)("Worktree thread")},null,8,["title"])):ie("",!0),ut(T.id)?(C(),R("span",{key:1,class:"thread-row-automation-chip",title:Mn(T.id)}," Auto ",8,YT)):ie("",!0),T.pendingRequestState?(C(),R("span",{key:2,class:"thread-row-request-chip","data-state":T.pendingRequestState},N(Nr(T)),9,QT)):ie("",!0)])])],8,WT)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onClick","onMouseleave","onContextmenu"])],8,qT))),128))])):ie("",!0)]),(C(),rt(va,{to:"body"},[Me.value?(C(),R("div",{key:0,ref_key:"openThreadMenuPanelRef",ref:Je,class:"thread-menu-panel thread-menu-panel-fixed",style:Ao(O.value),"data-open-direction":It(Me.value.id),onClick:_[16]||(_[16]=et(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:_[9]||(_[9]=T=>Kn(Me.value.id))},N(ut(Me.value.id)?"Edit automation…":"Add automation…"),1),m("button",{class:"thread-menu-item",type:"button",onClick:_[10]||(_[10]=T=>qt(Me.value.id))}," Browse files "),m("button",{class:"thread-menu-item",type:"button",onClick:_[11]||(_[11]=T=>Xt(Me.value.id))}," Copy path "),m("button",{class:"thread-menu-item",type:"button",onClick:_[12]||(_[12]=T=>Wn(Me.value.id))}," Export chat "),m("button",{class:"thread-menu-item",type:"button",onClick:_[13]||(_[13]=T=>Kr(Me.value.id))}," Create chat fork "),m("button",{class:"thread-menu-item",type:"button",onClick:_[14]||(_[14]=T=>Jr(Me.value.id,Me.value.title))},N(S(r)("Rename thread")),1),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:_[15]||(_[15]=T=>vr(Me.value.id,Me.value.title))},N(S(r)("Delete thread")),1)],12,eS)):ie("",!0)])),(C(),rt(va,{to:"body"},[Ae.value?(C(),R("div",{key:0,class:"rename-thread-overlay",onClick:et(tn,["self"])},[m("div",tS,[m("h3",nS,N(S(r)("Rename thread")),1),_[25]||(_[25]=m("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),cn(m("input",{ref_key:"renameThreadInputRef",ref:Se,"onUpdate:modelValue":_[17]||(_[17]=T=>ne.value=T),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[dn(et(Rn,["prevent"]),["enter"]),dn(et(tn,["prevent"]),["esc"])]},null,40,rS),[[Tn,ne.value]]),m("div",oS,[m("button",{class:"rename-thread-button",type:"button",onClick:tn},N(S(r)("Cancel")),1),m("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:Rn},N(S(r)("Save")),1)])])])):ie("",!0)])),(C(),rt(va,{to:"body"},[Y.value?(C(),R("div",{key:0,class:"rename-thread-overlay",onClick:et(lr,["self"])},[m("div",aS,[m("h3",sS,N(de.value?"Archive chat and remove automation?":"Delete thread?"),1),m("p",iS,[de.value?(C(),R(Ge,{key:0},[_a(' This will archive the thread "'+N(He.value)+'" and remove the attached heartbeat automation. ',1)],64)):(C(),R(Ge,{key:1},[_a(' This will archive the thread "'+N(He.value)+'". You can find it later in archived threads. ',1)],64))]),m("div",lS,[m("button",{class:"rename-thread-button",type:"button",onClick:lr},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:Yr},N(de.value?"Archive and remove":"Delete"),1)])])])):ie("",!0)])),(C(),rt(va,{to:"body"},[we.value?(C(),R("div",{key:0,class:"rename-thread-overlay",onClick:et($n,["self"])},[m("div",uS,[m("h3",cS,N(Ke.value==="edit"?"Edit automation":"Add automation"),1),_[30]||(_[30]=m("p",{class:"rename-thread-subtitle"},"This creates a heartbeat automation attached to the selected thread.",-1)),m("label",dS,[_[26]||(_[26]=m("span",{class:"automation-thread-label"},"Name",-1)),cn(m("input",{"onUpdate:modelValue":_[18]||(_[18]=T=>me.value.name=T),class:"rename-thread-input",type:"text",placeholder:"Automation name"},null,512),[[Tn,me.value.name]])]),m("label",fS,[_[27]||(_[27]=m("span",{class:"automation-thread-label"},"Prompt",-1)),cn(m("textarea",{"onUpdate:modelValue":_[19]||(_[19]=T=>me.value.prompt=T),class:"automation-thread-textarea",rows:"6",placeholder:"Describe what the automation should do"},null,512),[[Tn,me.value.prompt]])]),m("label",hS,[_[28]||(_[28]=m("span",{class:"automation-thread-label"},"Schedule (RRULE)",-1)),cn(m("input",{"onUpdate:modelValue":_[20]||(_[20]=T=>me.value.rrule=T),class:"rename-thread-input",type:"text",placeholder:"FREQ=DAILY;BYHOUR=9;BYMINUTE=0"},null,512),[[Tn,me.value.rrule]])]),m("label",pS,[_[29]||(_[29]=m("span",{class:"automation-thread-label"},"Status",-1)),cn(m("select",{"onUpdate:modelValue":_[21]||(_[21]=T=>me.value.status=T),class:"automation-thread-select"},[m("option",mS,N(S(r)("Active")),1),m("option",gS,N(S(r)("Paused")),1)],512),[[py,me.value.status]])]),Be.value?(C(),R("p",vS,N(Be.value),1)):ie("",!0),m("div",yS,[Ke.value==="edit"?(C(),R("button",{key:0,class:"rename-thread-button rename-thread-button-danger",type:"button",disabled:xe.value,onClick:yr}," Remove ",8,wS)):ie("",!0),m("button",{class:"rename-thread-button",type:"button",disabled:xe.value,onClick:$n},N(S(r)("Cancel")),9,bS),m("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",disabled:xe.value,onClick:sn},N(xe.value?"Saving…":"Save"),9,_S)])])])):ie("",!0)]))],2))}}),kS=kt(SS,[["__scopeId","data-v-e424516d"]]),CS={class:"content-header"},xS=["title"],AS={class:"content-actions"},ES=Hn({__name:"ContentHeader",props:{title:{},accent:{type:Boolean}},setup(e){return(t,n)=>(C(),R("header",CS,[m("div",{class:it(["content-leading",{"is-accent":e.accent}])},[po(t.$slots,"leading",{},void 0)],2),m("h1",{class:it(["content-title",{"is-accent":e.accent}]),title:e.title},N(e.title),11,xS),m("div",AS,[po(t.$slots,"actions",{},void 0)])]))}}),IS=kt(ES,[["__scopeId","data-v-f96f7210"]]),Af=.0025,Su=3,Ef=2,PS=256;function MS(e){var He;const t=P("idle"),n=P(typeof navigator<"u"&&!!((He=navigator.mediaDevices)!=null&&He.getUserMedia)),r=P(0),a=P(null);let o=null,s=null,l=[],c=null,f=null,h=null,g=null,b=[],x=!1,j=!1,q=null;function te(){q&&(q.abort(),q=null),t.value==="transcribing"&&(t.value="idle")}function z(){const ee=a.value;if(!ee||typeof window>"u")return;const we=ee.getContext("2d");if(!we)return;const Re=Math.max(1,Math.floor(ee.clientWidth)),Ke=Math.max(1,Math.floor(ee.clientHeight||36)),Be=window.devicePixelRatio||1,xe=Math.max(1,Math.floor(Re*Be)),me=Math.max(1,Math.floor(Ke*Be));(ee.width!==xe||ee.height!==me)&&(ee.width=xe,ee.height=me),we.setTransform(Be,0,0,Be,0,0),we.clearRect(0,0,Re,Ke);const We=Math.max(12,Math.floor(Re/(Su+Ef))),nt=b.slice(-We),Ve=Math.max(0,We-nt.length),Le=Ke/2,ft=getComputedStyle(ee).color||"#000000";for(let ht=0;ht<We;ht+=1){const Xe=nt[ht-Ve]??0,K=Math.max(.08,Math.min(1,Xe*18))*Le,_e=ht*(Su+Ef);we.globalAlpha=Xe<=Af?.35:1,we.fillStyle=ft,we.fillRect(_e,Le-K,Su,K*2)}we.globalAlpha=1}function O(){b=[],r.value=0,z()}function V(){h&&(h.disconnect(),h.onaudioprocess=null,h=null),f&&(f.disconnect(),f=null),c&&(c.close(),c=null),g=null}function Z(ee){if(typeof window>"u")return;const we=window.webkitAudioContext,Re=window.AudioContext??we;Re&&(V(),O(),c=new Re,f=c.createMediaStreamSource(ee),h=c.createScriptProcessor(2048,1,1),g=performance.now(),h.onaudioprocess=Ke=>{const Be=Ke.inputBuffer.getChannelData(0);let xe=0;for(let me=0;me<Be.length;me+=1){const We=Math.abs(Be[me]??0);xe+=We<Af?0:We}b.push(xe/Be.length),b.length>PS&&b.shift(),g!==null&&(r.value=Math.max(0,performance.now()-g)),z()},f.connect(h),h.connect(c.destination),z())}async function Ae(){var ee;if(t.value==="transcribing"&&te(),!(t.value!=="idle"||!n.value||x)){x=!0,j=!1;try{s=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),l=[],o=new MediaRecorder(s),o.ondataavailable=we=>{we.data.size>0&&l.push(we.data)},o.onstop=()=>{var Ke;const we=l,Re=(o==null?void 0:o.mimeType)||((Ke=we[0])==null?void 0:Ke.type)||"audio/webm";Y(),Se(we,Re)},Z(s),o.start(250),t.value="recording",j&&Ue()}catch(we){Y(),t.value="idle",(ee=e.onError)==null||ee.call(e,we)}finally{x=!1}}}function Ue(){if(x&&t.value==="idle"){j=!0;return}if(!(t.value!=="recording"||!o)&&o.state!=="inactive"){t.value="transcribing";try{o.requestData()}catch{}o.stop()}}function ne(){j=!1,te(),Y(),t.value="idle"}async function Se(ee,we){var Be,xe,me,We,nt;if(ee.length===0){(Be=e.onEmpty)==null||Be.call(e),t.value="idle";return}const Re=new Blob(ee,{type:we});t.value="transcribing";let Ke=null;try{const Ve=we.split(/[/;]/)[1]??"webm",Le=new FormData;Le.append("file",Re,`codex.${Ve}`);const ft=((xe=e.getLanguage)==null?void 0:xe.call(e).trim())??"";ft&&ft.toLowerCase()!=="auto"&&Le.append("language",ft),Ke=new AbortController,q=Ke;const ht=await fetch("/codex-api/transcribe",{method:"POST",body:Le,signal:Ke.signal}),Xe=await ht.text();let dt=null;try{dt=Xe.trim()?JSON.parse(Xe):null}catch{dt=null}if(!ht.ok){const _e=(me=dt==null?void 0:dt.error)==null?void 0:me.trim(),be=Xe.trim();throw new Error(_e||be||`Transcription failed: ${ht.status}`)}const K=((dt==null?void 0:dt.text)??"").trim();K.length>0?e.onTranscript(K):(We=e.onEmpty)==null||We.call(e)}catch(Ve){if(Ve instanceof DOMException&&Ve.name==="AbortError")return;(nt=e.onError)==null||nt.call(e,Ve)}finally{Ke&&q===Ke&&(q=null),t.value==="transcribing"&&(t.value="idle")}}function Y(){V(),O(),o&&(o.ondataavailable=null,o.onstop=null,o=null),s&&(s.getTracks().forEach(ee=>ee.stop()),s=null),l=[]}Ta(()=>{ne()});function Ee(){if(t.value==="recording"){Ue();return}(t.value==="idle"||t.value==="transcribing")&&Ae()}return{state:t,isSupported:n,recordingDurationMs:r,waveformCanvasRef:a,startRecording:Ae,stopRecording:Ue,toggleRecording:Ee,cancel:ne}}const RS={},$S={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function NS(e,t){return C(),R("svg",$S,[...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 OS=kt(RS,[["render",NS]]),DS={},LS={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function jS(e,t){return C(),R("svg",LS,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M13 3L4 14h6l-1 7l9-11h-6z"},null,-1)])])}const Ui=kt(DS,[["render",jS]]),FS={},US={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function BS(e,t){return C(),R("svg",US,[...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 qS=kt(FS,[["render",BS]]),HS={},zS={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function VS(e,t){return C(),R("svg",zS,[...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 If=kt(HS,[["render",VS]]),WS=["disabled"],GS={class:"composer-dropdown-value"},KS={class:"composer-dropdown-menu"},JS={key:0,class:"composer-dropdown-search-wrap"},YS=["placeholder","onKeydown"],QS={class:"composer-dropdown-options",role:"listbox"},XS=["onClick"],ZS={key:0,class:"composer-dropdown-empty"},ek=Hn({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},selectedPrefixIcon:{},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},emptyLabel:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,a=P(null),o=P(null),s=P(!1),l=P(""),c=le(()=>{var V;const O=n.options.find(Z=>Z.value===n.modelValue);return O?O.label:((V=n.placeholder)==null?void 0:V.trim())||""}),f=le(()=>n.openDirection??"down"),h=le(()=>n.enableSearch===!0),g=le(()=>{var O;return((O=n.searchPlaceholder)==null?void 0:O.trim())||"Quick search projects"}),b=le(()=>{var O;return((O=n.emptyLabel)==null?void 0:O.trim())||"No results"}),x=le(()=>{const O=l.value.trim().toLowerCase();return O?n.options.filter(V=>V.label.toLowerCase().includes(O)||V.value.toLowerCase().includes(O)):n.options});function j(){n.disabled||(s.value=!s.value)}function q(O){r("update:modelValue",O),s.value=!1,l.value=""}function te(){if(l.value.length>0){l.value="";return}s.value=!1}function z(O){if(!s.value)return;const V=a.value;if(!V)return;const Z=O.target;Z instanceof Node&&(V.contains(Z)||(s.value=!1,l.value=""))}return gt(s,O=>{O&&h.value&&an(()=>{var V;return(V=o.value)==null?void 0:V.focus()})}),Jo(()=>{window.addEventListener("pointerdown",z)}),Ta(()=>{window.removeEventListener("pointerdown",z)}),(O,V)=>(C(),R("div",{ref_key:"rootRef",ref:a,class:"composer-dropdown"},[m("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:j},[e.selectedPrefixIcon?(C(),rt(vc(e.selectedPrefixIcon),{key:0,class:"composer-dropdown-prefix-icon"})):ie("",!0),m("span",GS,N(c.value),1),Ne(qa,{class:"composer-dropdown-chevron"})],8,WS),s.value?(C(),R("div",{key:0,class:it(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":f.value==="up","composer-dropdown-menu-wrap-down":f.value==="down"}])},[m("div",KS,[h.value?(C(),R("div",JS,[cn(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":V[0]||(V[0]=Z=>l.value=Z),class:"composer-dropdown-search-input",type:"text",placeholder:g.value,onKeydown:dn(et(te,["prevent"]),["esc"])},null,40,YS),[[Tn,l.value]])])):ie("",!0),m("ul",QS,[(C(!0),R(Ge,null,zt(x.value,Z=>(C(),R("li",{key:Z.value},[m("button",{class:it(["composer-dropdown-option",{"is-selected":Z.value===e.modelValue}]),type:"button",onClick:Ae=>q(Z.value)},N(Z.label),11,XS)]))),128)),x.value.length===0?(C(),R("li",ZS,N(b.value),1)):ie("",!0)])])],2)):ie("",!0)],512))}}),Ha=kt(ek,[["__scopeId","data-v-2527acc2"]]),tk=["disabled"],nk={class:"search-dropdown-value"},rk={class:"search-dropdown-search-wrap"},ok={class:"search-dropdown-search-row"},ak=["placeholder","onKeydown"],sk=["aria-label","title"],ik={key:0,class:"search-dropdown-list",role:"listbox"},lk=["onPointerenter"],uk=["onClick"],ck={class:"search-dropdown-option-check"},dk=["title"],fk={class:"search-dropdown-option-copy"},hk={class:"search-dropdown-option-label-row"},pk={class:"search-dropdown-option-label"},mk={key:0,class:"search-dropdown-option-type"},gk={key:0,class:"search-dropdown-option-desc"},vk=["aria-label","title","onClick"],yk={key:1,class:"search-dropdown-empty"},wk=Hn({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{},createLabel:{},allowRemove:{type:Boolean},removeLabel:{},displayLabelOverride:{}},emits:["toggle","create","remove"],setup(e,{emit:t}){const n=e,r=t,a=P(null),o=P(null),s=P(null),l=P(!1),c=P(""),f=P(0),h=P({}),{t:g}=Qo(),b=le(()=>n.openDirection??"down"),x=le(()=>new Set(n.selectedValues)),j=le(()=>{var ne;if((ne=n.displayLabelOverride)!=null&&ne.trim())return n.displayLabelOverride.trim();if(n.selectedValues.length===0)return n.placeholder||g("Select...");if(n.selectedValues.length===1){const Se=n.options.find(Y=>Y.value===n.selectedValues[0]);return(Se==null?void 0:Se.label)||n.placeholder||g("Select...")}return`${n.selectedValues.length} ${g("selected")}`}),q=le(()=>{const ne=c.value.toLowerCase().trim();return ne?n.options.filter(Se=>{var Y;return Se.label.toLowerCase().includes(ne)||(((Y=Se.description)==null?void 0:Y.toLowerCase().includes(ne))??!1)}):n.options});function te(){const ne=o.value,Se=a.value;if(!ne||!Se)return;const Y=Se.getBoundingClientRect(),Ee=window.innerWidth,He=window.innerHeight,ee=Math.min(384,Ee-16),we=Math.max(8,Math.min(Y.right-ee,Ee-ee-8));if(Ee<640){h.value={position:"fixed",left:"0.5rem",right:"0.5rem",width:"auto",top:b.value==="up"?"auto":`${Y.bottom+8}px`,bottom:b.value==="up"?`${He-Y.top+8}px`:"auto",zIndex:"120"};return}h.value={position:"fixed",width:`${ee}px`,left:`${we}px`,top:b.value==="up"?"auto":`${Y.bottom+8}px`,bottom:b.value==="up"?`${He-Y.top+8}px`:"auto",zIndex:"120"}}function z(){n.disabled||(l.value=!l.value,l.value&&(c.value="",f.value=0,an(()=>{var ne;an(()=>{te()}),(ne=s.value)==null||ne.focus()})))}function O(ne){r("toggle",ne.value,!x.value.has(ne.value)),l.value=!1}function V(ne){q.value.length!==0&&(f.value=(f.value+ne+q.value.length)%q.value.length)}function Z(){const ne=q.value[f.value];ne&&O(ne)}function Ae(ne){if(!l.value)return;const Se=a.value,Y=o.value;if(!Se)return;const Ee=ne.target;Ee instanceof Node&&(Se.contains(Ee)||Y!=null&&Y.contains(Ee)||(l.value=!1))}gt(c,()=>{f.value=0});function Ue(){l.value&&te()}return Jo(()=>{window.addEventListener("pointerdown",Ae),window.addEventListener("resize",Ue),window.addEventListener("scroll",Ue,!0)}),Ta(()=>{window.removeEventListener("pointerdown",Ae),window.removeEventListener("resize",Ue),window.removeEventListener("scroll",Ue,!0)}),(ne,Se)=>(C(),R("div",{ref_key:"rootRef",ref:a,class:"search-dropdown"},[m("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:z},[m("span",nk,N(j.value),1),Ne(qa,{class:"search-dropdown-chevron"})],8,tk),(C(),rt(va,{to:"body"},[l.value?(C(),R("div",{key:0,ref_key:"menuRef",ref:o,class:it(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":b.value==="up","search-dropdown-menu-wrap-down":b.value==="down"}]),style:Ao(h.value)},[m("div",rk,[m("div",ok,[cn(m("input",{ref_key:"searchRef",ref:s,"onUpdate:modelValue":Se[0]||(Se[0]=Y=>c.value=Y),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[Se[1]||(Se[1]=dn(et(Y=>l.value=!1,["prevent"]),["escape"])),dn(et(Z,["prevent"]),["enter"]),Se[2]||(Se[2]=dn(et(Y=>V(1),["prevent"]),["arrow-down"])),Se[3]||(Se[3]=dn(et(Y=>V(-1),["prevent"]),["arrow-up"]))]},null,40,ak),[[Tn,c.value]]),e.createLabel?(C(),R("button",{key:0,class:"search-dropdown-create-icon",type:"button","aria-label":e.createLabel,title:e.createLabel,onClick:Se[4]||(Se[4]=Y=>r("create"))}," + ",8,sk)):ie("",!0)]),e.createLabel?(C(),R("button",{key:0,class:"search-dropdown-create",type:"button",onClick:Se[5]||(Se[5]=Y=>r("create"))},N(e.createLabel),1)):ie("",!0)]),q.value.length>0?(C(),R("ul",ik,[(C(!0),R(Ge,null,zt(q.value,(Y,Ee)=>(C(),R("li",{key:Y.value},[m("div",{class:it(["search-dropdown-option",{"is-selected":x.value.has(Y.value),"is-highlighted":Ee===f.value}]),onPointerenter:He=>f.value=Ee},[m("button",{class:"search-dropdown-option-main",type:"button",onClick:He=>O(Y)},[m("span",ck,N(x.value.has(Y.value)?"✓":""),1),Y.badge?(C(),R("span",{key:0,class:it(["search-dropdown-option-badge",Y.badgeTone?`is-${Y.badgeTone}`:""]),title:Y.badgeLabel||Y.badge,"aria-hidden":"true"},N(Y.badge),11,dk)):ie("",!0),m("span",fk,[m("span",hk,[m("span",pk,N(Y.label),1),Y.badgeLabel?(C(),R("span",mk,N(Y.badgeLabel),1)):ie("",!0)]),Y.description?(C(),R("span",gk,N(Y.description),1)):ie("",!0)])],8,uk),e.allowRemove&&Y.removable?(C(),R("button",{key:0,class:"search-dropdown-option-remove",type:"button","aria-label":`${e.removeLabel} ${Y.label}`,title:`${e.removeLabel} ${Y.label}`,onClick:et(He=>r("remove",Y.value),["stop"])}," × ",8,vk)):ie("",!0)],42,lk)]))),128))])):(C(),R("div",yk,N(S(g)("No results")),1))],6)):ie("",!0)]))],512))}}),bk=kt(wk,[["__scopeId","data-v-65ed7fdf"]]),_k={key:0,class:"thread-composer-dictation-error"},Tk={key:0,class:"thread-composer-attachments"},Sk=["src","alt"],kk=["aria-label","disabled","onClick"],Ck={key:1,class:"thread-composer-folder-chips"},xk=["title"],Ak={class:"thread-composer-folder-chip-meta"},Ek=["aria-label","disabled","onClick"],Ik={key:2,class:"thread-composer-file-chips"},Pk=["title"],Mk=["aria-label","disabled","onClick"],Rk={key:3,class:"thread-composer-skill-chips"},$k={class:"thread-composer-skill-chip-name"},Nk=["aria-label","onClick"],Ok={key:0,class:"thread-composer-drop-overlay","aria-hidden":"true"},Dk={key:1,class:"thread-composer-file-mentions"},Lk=["onMousedown"],jk={key:1,class:"thread-composer-file-mention-icon-markdown"},Fk={class:"thread-composer-file-mention-text"},Uk={class:"thread-composer-file-mention-name"},Bk={key:0,class:"thread-composer-file-mention-dir"},qk={key:1,class:"thread-composer-file-mention-empty"},Hk=["placeholder","disabled"],zk=["aria-label","disabled"],Vk={key:0,class:"thread-composer-attach-menu"},Wk=["disabled"],Gk=["disabled"],Kk=["disabled"],Jk={class:"thread-composer-attach-mode"},Yk={class:"thread-composer-attach-mode-label"},Qk={class:"thread-composer-attach-mode-buttons"},Xk=["disabled"],Zk=["disabled"],e1=["aria-checked","aria-label","disabled"],t1={class:"thread-composer-attach-setting-copy"},n1={class:"thread-composer-attach-setting-label"},r1={class:"thread-composer-attach-setting-description"},o1=["aria-checked","aria-label","disabled"],a1={class:"thread-composer-attach-setting-copy"},s1={class:"thread-composer-attach-setting-label"},i1={class:"thread-composer-attach-setting-description"},l1={key:0,class:"thread-composer-dictation-waveform-wrap","aria-hidden":"true"},u1={key:1,class:"thread-composer-dictation-timer"},c1=["aria-label","title","disabled"],d1=["aria-label","title","disabled"],f1={key:0,class:"thread-composer-stop-spinner","aria-hidden":"true"},h1=["aria-label","title","disabled"],p1=["disabled"],m1=["disabled"],g1=["disabled"],v1=2e3,ku="prompt:",y1="codex-web-local.thread-draft.v1.",w1=Hn({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},collaborationModes:{},selectedCollaborationMode:{},models:{},selectedModel:{},selectedReasoningEffort:{},selectedSpeedMode:{},skills:{},threadTokenUsage:{},codexQuota:{},isTurnInProgress:{type:Boolean},isStopPending:{type:Boolean},isInterruptingTurn:{type:Boolean},isUpdatingSpeedMode:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{},dictationClickToToggle:{type:Boolean},dictationAutoSend:{type:Boolean},dictationLanguage:{}},emits:["submit","interrupt","update:selected-collaboration-mode","update:selected-model","update:selected-reasoning-effort","update:selected-speed-mode"],setup(e,{expose:t,emit:n}){const r=e,a=n,{t:o}=Qo(),s=P(""),l=P([]),c=P([]),f=P([]),h=P([]),g=P([]),b=P(""),x=P(0),j=P(null),q=P(!1),{state:te,isSupported:z,recordingDurationMs:O,waveformCanvasRef:V,startRecording:Z,stopRecording:Ae,toggleRecording:Ue,cancel:ne}=MS({getLanguage:()=>r.dictationLanguage??"auto",onTranscript:A=>{if(s.value=s.value?`${s.value}
|
|
48
|
-
${A}`:A,b.value="",r.dictationAutoSend!==!1){const F=r.isTurnInProgress?ke.value:"steer";de(F);return}an(()=>{var F;return(F=ee.value)==null?void 0:F.focus()})},onEmpty:()=>{b.value=r.dictationClickToToggle?"No speech detected. Click again after speaking.":"No speech detected. Hold the mic and speak."},onError:A=>{if(A instanceof DOMException&&A.name==="NotAllowedError"){b.value="Microphone access was denied.";return}b.value=A instanceof Error?A.message:"Dictation failed."}}),Se=P(null),Y=P(null),Ee=P(null),He=P(null),ee=P(null),{isMobile:we}=xc(),Re=P(!1),Ke=P(null),Be=P(""),xe=P([]),me=P(!1),We=P(0),nt=P(0);let Ve=0,Le=null,ft=!1,ht=0,Xe=0;const dt=typeof navigator<"u"&&/Android/i.test(navigator.userAgent);let K="";const _e=[{value:"none",label:"None"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}];function be(A){return A.trim().replace(/^gpt/i,"GPT")}const Oe=le(()=>r.models.map(A=>({value:A,label:be(A)}))),Je=le(()=>r.selectedCollaborationMode==="plan"),k=le(()=>r.selectedCollaborationMode==="plan"&&r.selectedModel.trim().length===0),I=le(()=>c.value.map(A=>A.path)),H=le(()=>[...(r.skills??[]).map(A=>{const F=xr(A);return{value:A.path,label:A.name,description:A.description,badge:F.badge,badgeLabel:F.badgeLabel,badgeTone:F.badgeTone,removable:!1}}),...f.value.map(A=>({value:Nt(A.path),label:A.name,description:A.description,badge:"T",badgeLabel:"Prompt",badgeTone:"prompt",removable:!0}))]),re=le(()=>r.disabled||r.isUpdatingSpeedMode||!r.activeThreadId||k.value||x.value>0?!1:s.value.trim().length>0||l.value.length>0||h.value.length>0),J=le(()=>s.value.trim().length>0||l.value.length>0||c.value.length>0||h.value.length>0||g.value.length>0),ae=le(()=>{const A=new Set;for(const F of g.value)for(const X of F.filePaths)A.add(X);return h.value.filter(F=>!A.has(F.fsPath))}),fe=le(()=>r.disabled||!r.activeThreadId),ye=le(()=>r.selectedModel.trim()==="gpt-5.4"),pe=le(()=>r.selectedSpeedMode==="fast"&&ye.value),ce=le(()=>fe.value||r.isUpdatingSpeedMode===!0),$e=le(()=>r.isUpdatingSpeedMode?o("Saving speed setting..."):r.selectedSpeedMode==="fast"?o("About 1.5x faster, with credits used at 2x"):o("Default speed with normal credit usage")),ge=le(()=>r.inProgressSubmitMode==="steer"?"steer":"queue"),ke=P(ge.value),De=le(()=>te.value==="recording"),Ze=le(()=>te.value==="recording"?o("Stop dictation"):r.dictationClickToToggle?o("Click to dictate"):o("Hold to dictate")),D=le(()=>te.value==="idle"?b.value.trim():""),U=le(()=>{const A=Math.max(0,Math.floor(O.value/1e3)),F=Math.floor(A/60),X=A%60;return`${F}:${String(X).padStart(2,"0")}`}),B=le(()=>r.activeThreadId?k.value?o("Loading models for plan mode..."):o("Type a message... (@ for files)"):o("Select a thread to send a message")),Q=le(()=>s.value.trim().length>0||l.value.length>0||h.value.length>0);function de(A="steer"){var X;const F=s.value.trim();if(re.value){if(a("submit",{text:F,imageUrls:l.value.map(Ie=>Ie.url),fileAttachments:[...h.value],skills:c.value.map(Ie=>({name:Ie.name,path:Ie.path})),mode:A}),In(r.activeThreadId),Qe(),g.value=[],Re.value=!1,ln(),dt||we.value){(X=ee.value)==null||X.blur();return}an(()=>{var Ie;return(Ie=ee.value)==null?void 0:Ie.focus()})}}function Pe(A){ke.value=A}function je(A){nt.value+=1,s.value=A.text,l.value=A.imageUrls.map((F,X)=>({id:`queued-${Date.now()}-${X}-${Math.random().toString(36).slice(2,8)}`,name:`Image ${X+1}`,url:F})),c.value=A.skills.map(F=>(r.skills??[]).find(X=>X.path===F.path)??{name:F.name,displayName:void 0,description:"",path:F.path}),h.value=A.fileAttachments.map(F=>({...F})),g.value=[],b.value="",j.value=null,x.value=0,Re.value=!1,ln(),Xe+=1}function Qe(){je({text:"",imageUrls:[],fileAttachments:[],skills:[]})}function Me(A){return`${y1}${A}`}function bt(A){if(typeof window>"u")return null;const F=A.trim();if(!F)return null;try{const X=window.localStorage.getItem(Me(F));if(!X)return null;const Ie=JSON.parse(X);return typeof Ie=="string"?{text:Ie,imageUrls:[],fileAttachments:[],skills:[]}:{text:typeof Ie.text=="string"?Ie.text:"",imageUrls:Array.isArray(Ie.imageUrls)?Ie.imageUrls.filter(lt=>typeof lt=="string"):[],fileAttachments:Array.isArray(Ie.fileAttachments)?Ie.fileAttachments.filter(lt=>!!lt&&typeof lt.label=="string"&&typeof lt.path=="string"&&typeof lt.fsPath=="string"):[],skills:Array.isArray(Ie.skills)?Ie.skills.filter(lt=>!!lt&&typeof lt.name=="string"&&typeof lt.path=="string"):[]}}catch{return null}}function Sn(A,F){if(typeof window>"u")return;const X=A.trim();if(X)try{if(F.text.trim().length>0||F.imageUrls.length>0||F.fileAttachments.length>0||F.skills.length>0){window.localStorage.setItem(Me(X),JSON.stringify(F));return}window.localStorage.removeItem(Me(X))}catch{}}function In(A){Sn(A,{text:"",imageUrls:[],fileAttachments:[],skills:[]})}function Wr(){return{text:s.value,imageUrls:l.value.map(A=>A.url),fileAttachments:h.value.map(A=>({...A})),skills:c.value.map(A=>({name:A.name,path:A.path}))}}function Bt(){a("interrupt")}function pr(A){a("update:selected-model",A)}function sr(){a("update:selected-collaboration-mode",Je.value?"default":"plan")}function Gr(A){a("update:selected-reasoning-effort",A)}function kr(){ce.value||a("update:selected-speed-mode",r.selectedSpeedMode==="fast"?"standard":"fast")}function mr(){r.dictationClickToToggle&&(b.value&&(b.value=""),Ue())}function Vn(A){if(r.dictationClickToToggle||(A.preventDefault(),ft))return;ft=!0;const F=A.currentTarget;if(F)try{F.setPointerCapture(A.pointerId)}catch{}b.value&&(b.value=""),window.addEventListener("pointerup",Qt),window.addEventListener("pointercancel",Qt),window.addEventListener("blur",Qt),Z()}function Qt(){r.dictationClickToToggle||ft&&(ft=!1,window.removeEventListener("pointerup",Qt),window.removeEventListener("pointercancel",Qt),window.removeEventListener("blur",Qt),Ae())}function Pn(){fe.value||(Re.value=!Re.value)}function ut(){var A;(A=Y.value)==null||A.click()}function Mn(){var A;(A=Ee.value)==null||A.click()}function Wn(){var A;(A=He.value)==null||A.click()}function Kr(A){l.value=l.value.filter(F=>F.id!==A)}function Wt(A){c.value=c.value.filter(F=>F.path!==A)}function Gn(A){h.value=h.value.filter(F=>F.fsPath!==A)}function qt(A){const F=g.value.find(Ie=>Ie.id===A);if(!F)return;const X=new Set(F.filePaths);h.value=h.value.filter(Ie=>!X.has(Ie.fsPath)),g.value=g.value.filter(Ie=>Ie.id!==A)}function Xt(A){return A.total<=0?0:Math.round(A.processed/A.total*100)}function Ot(A,F){const X=A.replace(/\\/g,"/");if(h.value.some(Ct=>Ct.fsPath===X))return;const Ie=X.split("/").filter(Boolean),lt=(F==null?void 0:F.trim())||Ie[Ie.length-1]||X;h.value=[...h.value,{label:lt,path:X,fsPath:X}]}function Et(A){return A.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(A.name)}function Gt(A){return A?Array.from(A):[]}function gr(A){return A!==Xe?!1:(x.value+=1,!0)}function ir(A){A===Xe&&(x.value=Math.max(0,x.value-1))}function Jr(A){if(A<=0)return;const F=j.value,X=F?F.succeeded+F.failed:0;if(!F||X>=F.total){j.value={total:A,succeeded:0,failed:0};return}j.value={...F,total:F.total+A}}function tn(A){const F=j.value;F&&(j.value={...F,succeeded:F.succeeded+(A==="success"?1:0),failed:F.failed+(A==="failure"?1:0)})}function Rn(){return`${Date.now()}-${Math.random().toString(36).slice(2)}`}function vr(A){const F=new Date,X=[F.getFullYear(),String(F.getMonth()+1).padStart(2,"0"),String(F.getDate()).padStart(2,"0"),String(F.getHours()).padStart(2,"0"),String(F.getMinutes()).padStart(2,"0"),String(F.getSeconds()).padStart(2,"0")].join("-"),Ie=A.type.startsWith("image/")&&A.type.slice(6).replace(/[^a-z0-9]+/gi,"")||"png";return`pasted-image-${X}.${Ie}`}function lr(){const A=new Date;return`pasted-text-${[A.getFullYear(),String(A.getMonth()+1).padStart(2,"0"),String(A.getDate()).padStart(2,"0"),String(A.getHours()).padStart(2,"0"),String(A.getMinutes()).padStart(2,"0"),String(A.getSeconds()).padStart(2,"0")].join("-")}.txt`}function Yr(A){return A.name.trim()?A:new File([A],vr(A),{type:A.type||"image/png",lastModified:Date.now()})}async function Kn(A,F){if(gr(F))try{const X=Yr(A),Ie=await Tu(X);if(F!==Xe)return;if(!Ie){tn("failure");return}l.value=[...l.value,{id:Rn(),name:X.name,url:`/codex-local-image?path=${encodeURIComponent(Ie)}`}],tn("success")}catch{F===Xe&&tn("failure")}finally{ir(F)}}async function $n(A,F){if(gr(F))try{const X=await Tu(A);if(F!==Xe)return;if(!X){tn("failure");return}Ot(X),tn("success")}catch{F===Xe&&tn("failure")}finally{ir(F)}}function sn(A){const F=Gt(A);if(F.length===0)return;Jr(F.length),Re.value=!1,ln();const X=Xe;for(const Ie of F)Et(Ie)?Kn(Ie,X):$n(Ie,X)}function yr(){ht=0,q.value=!1}function nn(A){return A?Array.from(A.types??[]).includes("Files"):!1}async function Qr(A){if(!A||A.length===0)return;const F=nt.value,X=Array.from(A),lt=(X[0].webkitRelativePath||X[0].name).split("/").filter(Boolean)[0]||"Folder",Ct=`${Date.now()}-${Math.random().toString(36).slice(2)}`;g.value=[...g.value,{id:Ct,name:lt,total:X.length,processed:0,filePaths:[],isUploading:!0}];const Zt=xt=>{F===nt.value&&(g.value=g.value.map(wn=>wn.id===Ct?xt(wn):wn))};for(const xt of X)try{const wn=await Tu(xt);if(F!==nt.value)return;if(wn){const Tr=xt.webkitRelativePath||xt.name;Ot(wn,Tr),Zt(Qn=>({...Qn,processed:Qn.processed+1,filePaths:[...Qn.filePaths,wn]}));continue}Zt(Tr=>({...Tr,processed:Tr.processed+1}))}catch{Zt(wn=>({...wn,processed:wn.processed+1}))}Zt(xt=>({...xt,isUploading:!1}))}function fn(A){A&&(A.value="")}function No(A){const F=A.target;sn((F==null?void 0:F.files)??null),fn(F),Re.value=!1}function gn(A){const F=A.target;sn((F==null?void 0:F.files)??null),fn(F),Re.value=!1}function ur(A){const F=A.target;Qr((F==null?void 0:F.files)??null),fn(F),Re.value=!1}function Jn(A){fe.value||!nn(A.dataTransfer)||(A.preventDefault(),ht+=1,q.value=!0)}function wr(A){fe.value||!nn(A.dataTransfer)||(A.preventDefault(),A.dataTransfer&&(A.dataTransfer.dropEffect="copy"),q.value=!0)}function Dt(A){q.value&&(A.preventDefault(),ht=Math.max(0,ht-1),ht===0&&yr())}function Nn(A){var F;fe.value||!nn(A.dataTransfer)||(A.preventDefault(),yr(),sn(((F=A.dataTransfer)==null?void 0:F.files)??null))}function Kt(){!q.value&&ht===0||yr()}function br(A){var Ct,Zt;if(fe.value)return;const F=((Ct=A.clipboardData)==null?void 0:Ct.getData("text/plain"))??"";if(F.length>=v1){A.preventDefault();const xt=new File([F],lr(),{type:"text/plain",lastModified:Date.now()});sn([xt]);return}const X=Array.from(((Zt=A.clipboardData)==null?void 0:Zt.items)??[]);if(X.length===0)return;const Ie=F.length>0,lt=X.filter(xt=>xt.kind==="file"&&xt.type.startsWith("image/")).map(xt=>xt.getAsFile()).filter(xt=>xt instanceof File);lt.length!==0&&(Ie||A.preventDefault(),sn(lt))}function rn(){b.value&&(b.value=""),cr()}function Tt(A){if(me.value){if(A.key==="Escape"){A.preventDefault(),ln();return}if(A.key==="ArrowDown"){A.preventDefault(),xe.value.length>0&&(We.value=(We.value+1)%xe.value.length);return}if(A.key==="ArrowUp"){if(A.preventDefault(),xe.value.length>0){const X=xe.value.length;We.value=(We.value+X-1)%X}return}if(A.key==="Enter"||A.key==="Tab"){A.preventDefault();const X=xe.value[We.value];X?_r(X):ln();return}}if(r.sendWithEnter!==!1?A.key==="Enter"&&!A.shiftKey:A.key==="Enter"&&(A.metaKey||A.ctrlKey)){A.preventDefault(),de(r.isTurnInProgress?ke.value:"steer");return}}function ln(){me.value=!1,Ke.value=null,Be.value="",xe.value=[],We.value=0}function cr(){const A=ee.value;if(!A){ln();return}const F=A.selectionStart??s.value.length,Ie=s.value.slice(0,F).match(/(^|\s)(@[^\s@]*)$/);if(!Ie){ln();return}const lt=Ie[2]??"",Ct=lt.length,Zt=F-Ct;Ke.value=Zt,Be.value=lt.slice(1),me.value=!0,On()}async function On(){if(!me.value)return;const A=(r.cwd??"").trim();if(!A){xe.value=[];return}Le&&clearTimeout(Le);const F=++Ve;Le=setTimeout(async()=>{try{const X=await h0(A,Be.value,20);if(!me.value||F!==Ve)return;xe.value=X,We.value=0}catch{if(!me.value||F!==Ve)return;xe.value=[]}},120)}function _r(A){const F=ee.value,X=Ke.value;if(X!==null&&F){const Ie=F.selectionStart??s.value.length;s.value=`${s.value.slice(0,X)}${s.value.slice(Ie)}`.trimEnd()}Ot(A.path),ln(),an(()=>F==null?void 0:F.focus())}function Xr(A){ne(),je(A),an(()=>{var F;return(F=ee.value)==null?void 0:F.focus()})}function Cr(A){const F=A.trim();F&&(ne(),s.value.trim().length>0?s.value=`${s.value.trimEnd()}
|
|
49
|
-
${F}`:s.value=F,an(()=>{var X;return(X=ee.value)==null?void 0:X.focus()}))}async function vn(){f.value=await x0()}function Nt(A){return`${ku}${A}`}function It(A){return A.startsWith(ku)?A.slice(ku.length):null}async function vo(){var Ie;const A=((Ie=window.prompt(o("Prompt name")))==null?void 0:Ie.trim())??"";if(!A)return;const F=window.prompt(o("Prompt content"))??"";if(!F.trim())return;const X=await A0(A,F);X&&(await vn(),Cr(X.content))}async function Zr(A){const F=It(A)??A,X=f.value.find(Ct=>Ct.path===F);!window.confirm(X?`${o("Remove prompt")} "${X.name}"?`:o("Remove prompt"))||!await E0(F)||await vn()}function _t(A){const F=f.value.find(X=>X.path===A);F&&Cr(F.content)}function on(A){const F=A.lastIndexOf("/");return F<0?A:A.slice(F+1)}function un(A){const F=A.lastIndexOf("/");return F<=0?"":A.slice(0,F)}function Dn(A){const F=on(A),X=F.lastIndexOf(".");return X<=0?"":F.slice(X+1).toLowerCase()}function kn(A){const F=Dn(A);return F==="ts"?"TS":F==="tsx"?"TSX":F==="js"?"JS":F==="jsx"?"JSX":F==="json"?"{}":""}function yn(A){const F=Dn(A);return F.startsWith("ts")?"ts":F.startsWith("js")?"js":F==="json"?"json":"default"}function Yn(A){const F=Dn(A);return F==="md"||F==="mdx"}function xr(A){return A.path.toLowerCase().includes("/plugins/cache/")?{badge:"P",badgeLabel:"Plugin",badgeTone:"plugin"}:A.scope==="repo"?{badge:"R",badgeLabel:"Repo",badgeTone:"repo"}:A.scope==="system"?{badge:"S",badgeLabel:"System",badgeTone:"system"}:{badge:"U",badgeLabel:"User",badgeTone:"user"}}function eo(A,F){const X=It(A);if(X){_t(X);return}if(F){const Ie=(r.skills??[]).find(lt=>lt.path===A);Ie&&!c.value.some(lt=>lt.path===A)&&(c.value=[...c.value,Ie])}else c.value=c.value.filter(Ie=>Ie.path!==A)}function Ar(A){if(!Re.value)return;const F=Se.value;if(!F)return;const X=A.target;!X||F.contains(X)||(Re.value=!1)}return Jo(()=>{document.addEventListener("click",Ar),window.addEventListener("drop",Kt),window.addEventListener("dragend",Kt),window.addEventListener("blur",Kt),vn()}),t({hydrateDraft:Xr,appendTextToDraft:Cr,hasUnsavedDraft:()=>J.value}),Ta(()=>{document.removeEventListener("click",Ar),window.removeEventListener("drop",Kt),window.removeEventListener("dragend",Kt),window.removeEventListener("blur",Kt),window.removeEventListener("pointerup",Qt),window.removeEventListener("pointercancel",Qt),window.removeEventListener("blur",Qt),Le&&clearTimeout(Le)}),gt(()=>r.activeThreadId,A=>{ne(),K&&Sn(K,Wr()),Qe();const F=bt(A);F&&(je(F),rn()),K=A.trim()},{immediate:!0}),gt([s,l,h,c],()=>{K&&Sn(K,Wr())},{deep:!0}),gt(()=>r.cwd,()=>{me.value&&On()}),gt(ge,A=>{ke.value=A}),(A,F)=>(C(),R("form",{class:"thread-composer",onSubmit:F[4]||(F[4]=et(X=>de(e.isTurnInProgress?ke.value:"steer"),["prevent"]))},[D.value?(C(),R("p",_k,N(D.value),1)):ie("",!0),m("div",{class:it(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove,"thread-composer-shell--drag-active":q.value}])},[l.value.length>0?(C(),R("div",Tk,[(C(!0),R(Ge,null,zt(l.value,X=>(C(),R("div",{key:X.id,class:"thread-composer-attachment"},[m("img",{class:"thread-composer-attachment-image",src:X.url,alt:X.name||"Selected image"},null,8,Sk),m("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${X.name||"image"}`,disabled:fe.value,onClick:Ie=>Kr(X.id)}," x ",8,kk)]))),128))])):ie("",!0),g.value.length>0?(C(),R("div",Ck,[(C(!0),R(Ge,null,zt(g.value,X=>(C(),R("span",{key:X.id,class:"thread-composer-folder-chip"},[Ne(Pc,{class:"thread-composer-folder-chip-icon"}),m("span",{class:"thread-composer-folder-chip-name",title:X.name},N(X.name),9,xk),m("span",Ak,[X.isUploading?(C(),R(Ge,{key:0},[_a(N(Xt(X))+"% uploading ("+N(X.processed)+"/"+N(X.total)+") ",1)],64)):(C(),R(Ge,{key:1},[_a(N(X.filePaths.length)+" file"+N(X.filePaths.length===1?"":"s"),1)],64))]),m("button",{class:"thread-composer-folder-chip-remove",type:"button","aria-label":`Remove folder ${X.name}`,disabled:fe.value,onClick:Ie=>qt(X.id)},"×",8,Ek)]))),128))])):ie("",!0),ae.value.length>0?(C(),R("div",Ik,[(C(!0),R(Ge,null,zt(ae.value,X=>(C(),R("span",{key:X.fsPath,class:"thread-composer-file-chip"},[Ne(Ks,{class:"thread-composer-file-chip-icon"}),m("span",{class:"thread-composer-file-chip-name",title:X.fsPath},N(X.label),9,Pk),m("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${X.label}`,disabled:fe.value,onClick:Ie=>Gn(X.fsPath)},"×",8,Mk)]))),128))])):ie("",!0),c.value.length>0?(C(),R("div",Rk,[(C(!0),R(Ge,null,zt(c.value,X=>(C(),R("span",{key:X.path,class:"thread-composer-skill-chip"},[m("span",$k,N(X.displayName||X.name),1),m("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${X.displayName||X.name}`,onClick:Ie=>Wt(X.path)},"×",8,Nk)]))),128))])):ie("",!0),m("div",{class:it(["thread-composer-input-wrap",{"thread-composer-input-wrap--drag-active":q.value}]),onDragenter:Jn,onDragover:wr,onDragleave:Dt,onDrop:Nn},[q.value?(C(),R("div",Ok,[...F[5]||(F[5]=[m("span",{class:"thread-composer-drop-overlay-copy"},"Drop images or files",-1)])])):ie("",!0),me.value?(C(),R("div",Dk,[xe.value.length>0?(C(!0),R(Ge,{key:0},zt(xe.value,(X,Ie)=>(C(),R("button",{key:X.path,class:it(["thread-composer-file-mention-row",{"is-active":Ie===We.value}]),type:"button",onMousedown:et(lt=>_r(X),["prevent"])},[kn(X.path)?(C(),R("span",{key:0,class:it(["thread-composer-file-mention-icon-badge",`is-${yn(X.path)}`])},N(kn(X.path)),3)):Yn(X.path)?(C(),R("span",jk,"↓")):(C(),rt(Ks,{key:2,class:"thread-composer-file-mention-icon-file"})),m("span",Fk,[m("span",Uk,N(on(X.path)),1),un(X.path)?(C(),R("span",Bk,N(un(X.path)),1)):ie("",!0)])],42,Lk))),128)):(C(),R("div",qk,N(S(o)("No matching files")),1))])):ie("",!0),cn(m("textarea",{ref_key:"inputRef",ref:ee,"onUpdate:modelValue":F[0]||(F[0]=X=>s.value=X),class:"thread-composer-input",placeholder:B.value,disabled:fe.value,onInput:rn,onKeydown:Tt,onPaste:br},null,40,Hk),[[Tn,s.value]])],34),m("div",{class:it(["thread-composer-controls",{"thread-composer-controls--recording":De.value}])},[m("div",{ref_key:"attachMenuRootRef",ref:Se,class:"thread-composer-attach"},[m("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":S(o)("Add photos & files"),disabled:fe.value,onClick:Pn}," + ",8,zk),Re.value?(C(),R("div",Vk,[m("button",{class:"thread-composer-attach-item",type:"button",disabled:fe.value,onClick:ut},N(S(o)("Add photos & files")),9,Wk),m("button",{class:"thread-composer-attach-item",type:"button",disabled:fe.value,onClick:Wn},N(S(o)("Add folder")),9,Gk),m("button",{class:"thread-composer-attach-item",type:"button",disabled:fe.value,onClick:Mn},N(S(o)("Take photo")),9,Kk),F[6]||(F[6]=m("div",{class:"thread-composer-attach-separator"},null,-1)),m("div",Jk,[m("span",Yk,N(S(o)("In-progress send")),1),m("div",Qk,[m("button",{class:it(["thread-composer-attach-mode-button",{"is-active":ke.value==="steer"}]),type:"button",disabled:fe.value,onClick:F[1]||(F[1]=X=>Pe("steer"))},N(S(o)("Steer")),11,Xk),m("button",{class:it(["thread-composer-attach-mode-button",{"is-active":ke.value==="queue"}]),type:"button",disabled:fe.value,onClick:F[2]||(F[2]=X=>Pe("queue"))},N(S(o)("Queue")),11,Zk)])]),F[7]||(F[7]=m("div",{class:"thread-composer-attach-separator"},null,-1)),ye.value?(C(),R("button",{key:0,class:"thread-composer-attach-setting",type:"button",role:"switch","aria-checked":e.selectedSpeedMode==="fast","aria-label":`${S(o)("Fast mode")} ${e.selectedSpeedMode==="fast"?S(o)("enabled"):S(o)("disabled")}`,disabled:ce.value,onClick:kr},[m("span",t1,[m("span",n1,N(S(o)("Fast mode")),1),m("span",r1,N($e.value),1)]),m("span",{class:it(["thread-composer-attach-switch",{"is-on":e.selectedSpeedMode==="fast","is-busy":e.isUpdatingSpeedMode,"is-disabled":ce.value}])},null,2)],8,e1)):ie("",!0),m("button",{class:"thread-composer-attach-setting",type:"button",role:"switch","aria-checked":Je.value,"aria-label":Je.value?S(o)("Disable plan mode"):S(o)("Enable plan mode"),disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onClick:sr},[m("span",a1,[m("span",s1,N(S(o)("Plan mode")),1),m("span",i1,N(S(o)("Agent proposes a plan before acting")),1)]),m("span",{class:it(["thread-composer-attach-switch",{"is-on":Je.value}])},null,2)],8,o1)])):ie("",!0)],512),De.value?ie("",!0):(C(),R(Ge,{key:0},[Ne(Ha,{class:"thread-composer-control","model-value":e.selectedModel,options:Oe.value,"selected-prefix-icon":pe.value?Ui:null,placeholder:S(o)("Model"),"open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"enable-search":"","search-placeholder":S(o)("Search models..."),"onUpdate:modelValue":pr},null,8,["model-value","options","selected-prefix-icon","placeholder","disabled","search-placeholder"]),Ne(bk,{class:"thread-composer-control",options:H.value,"selected-values":I.value,placeholder:S(o)("Skills"),"search-placeholder":S(o)("Search skills and prompts..."),"create-label":S(o)("Add new prompt"),"allow-remove":!0,"remove-label":S(o)("Remove prompt"),"open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:eo,onCreate:vo,onRemove:Zr},null,8,["options","selected-values","placeholder","search-placeholder","create-label","remove-label","disabled"]),Ne(Ha,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:_e,placeholder:S(o)("Thinking"),"open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":Gr},null,8,["model-value","placeholder","disabled"])],64)),m("div",{class:it(["thread-composer-actions",{"thread-composer-actions--recording":De.value}])},[S(te)==="recording"?(C(),R("div",l1,[m("canvas",{ref_key:"dictationWaveformCanvasRef",ref:V,class:"thread-composer-dictation-waveform"},null,512)])):ie("",!0),S(te)==="recording"?(C(),R("span",u1,N(U.value),1)):ie("",!0),S(z)?(C(),R("button",{key:2,class:it(["thread-composer-mic",{"thread-composer-mic--active":S(te)==="recording"}]),type:"button","aria-label":Ze.value,title:Ze.value,disabled:fe.value,onClick:mr,onPointerdown:Vn,onPointerup:Qt,onPointercancel:Qt},[S(te)==="recording"?(C(),rt(If,{key:0,class:"thread-composer-mic-icon thread-composer-mic-icon--stop"})):(C(),rt(qS,{key:1,class:"thread-composer-mic-icon"}))],42,c1)):ie("",!0),e.isTurnInProgress&&!Q.value?(C(),R("button",{key:3,class:"thread-composer-stop",type:"button","aria-label":e.isStopPending?S(o)("Saving thread before stop is available"):S(o)("Stop"),title:e.isStopPending?S(o)("Saving thread before stop is available"):S(o)("Stop"),disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn||e.isStopPending,onClick:Bt},[e.isStopPending?(C(),R("span",f1)):(C(),rt(If,{key:1,class:"thread-composer-stop-icon"}))],8,d1)):(C(),R("button",{key:4,class:it(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&ke.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&ke.value==="queue"?S(o)("Queue message"):S(o)("Send message"),title:e.isTurnInProgress?`${S(o)("Send")} ${ke.value==="queue"?S(o)("Queue"):S(o)("Steer")}`:S(o)("Send"),disabled:!re.value,onClick:F[3]||(F[3]=X=>de(e.isTurnInProgress?ke.value:"steer"))},[Ne(OS,{class:"thread-composer-submit-icon"})],10,h1))],2)],2)],2),m("input",{ref_key:"photoLibraryInputRef",ref:Y,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:fe.value,onChange:No},null,40,p1),m("input",{ref_key:"cameraCaptureInputRef",ref:Ee,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:fe.value,onChange:gn},null,40,m1),m("input",{ref_key:"folderPickerInputRef",ref:He,class:"thread-composer-hidden-input",type:"file",multiple:"",webkitdirectory:"",directory:"",disabled:fe.value,onChange:ur},null,40,g1)],32))}}),Pf=kt(w1,[["__scopeId","data-v-0c0a6e86"]]),b1={key:0,class:"thread-pending-request"},_1={class:"thread-pending-request-title"},T1=["title"],S1={class:"thread-pending-request-approval"},k1=["aria-label"],C1=["aria-pressed","onClick"],x1={class:"thread-pending-request-option-index"},A1={class:"thread-pending-request-option-label"},E1={class:"thread-pending-request-footer thread-pending-request-footer--approval"},I1=["value","placeholder"],P1={class:"thread-pending-request-header"},M1={class:"thread-pending-request-heading"},R1={class:"thread-pending-request-eyebrow"},$1={class:"thread-pending-request-title"},N1={key:0,class:"thread-pending-request-counter"},O1={key:0,class:"thread-pending-request-preview"},D1={class:"thread-pending-request-preview-code"},L1={key:1,class:"thread-pending-request-user-input"},j1={key:0,class:"thread-pending-request-question-description"},F1=["href"],U1={class:"thread-pending-request-question-title"},B1={key:0},q1={key:0,class:"thread-pending-request-question-text"},H1={key:1,class:"thread-pending-request-input-wrap"},z1={class:"thread-pending-request-select-label"},V1=["type","value","onInput"],W1={key:2,class:"thread-pending-request-select-wrap"},G1={class:"thread-pending-request-select-label"},K1=["value","onChange"],J1={key:0,value:""},Y1={value:"true"},Q1={value:"false"},X1={key:3,class:"thread-pending-request-select-wrap"},Z1={class:"thread-pending-request-select-label"},eC=["value","onChange"],tC={key:0,value:""},nC=["value"],rC={key:4,class:"thread-pending-request-question-options"},oC=["checked","onChange"],aC={class:"thread-pending-request-checkbox-label"},sC={key:2,class:"thread-pending-request-validation-error"},iC={class:"thread-pending-request-footer"},lC={key:2,class:"thread-pending-request-user-input"},uC={class:"thread-pending-request-question-title"},cC={key:0,class:"thread-pending-request-question-text"},dC={key:1,class:"thread-pending-request-question-options"},fC={class:"thread-pending-request-select-wrap"},hC={class:"thread-pending-request-select-label"},pC=["value","onChange"],mC=["value"],gC={key:0,class:"thread-pending-request-question-description"},vC={key:2,class:"thread-pending-request-input-wrap"},yC={class:"thread-pending-request-select-label"},wC=["value","placeholder","onInput"],bC={class:"thread-pending-request-footer"},_C={key:3,class:"thread-pending-request-actions"},TC={key:4,class:"thread-pending-request-actions"},SC=Hn({__name:"ThreadPendingRequestPanel",props:{request:{},requestCount:{},hasQueueAbove:{type:Boolean}},emits:["respondServerRequest"],setup(e,{emit:t}){const n=e,r=t,a=P("accept"),o=P(""),s=P({}),l=P({}),c=P({}),f=P(""),{t:h}=Qo();function g(D){return D!==null&&typeof D=="object"&&!Array.isArray(D)?D:null}function b(D){return typeof D=="string"?D.trim():""}function x(D){return typeof D=="string"?D:null}function j(D){return/^[A-Za-z0-9_./:@%+=,-]+$/.test(D)?D:JSON.stringify(D)}function q(D){const B=(Array.isArray(D.commandActions)?D.commandActions:[]).map(Q=>g(Q)).map(Q=>b(Q==null?void 0:Q.command)).find(Q=>Q.length>0);if(B)return B.replace(/\s+/g," ").trim();if(Array.isArray(D.command)){const Q=D.command.filter(de=>typeof de=="string").map(de=>de.trim()).filter(de=>de.length>0);if(Q.length>0)return Q.map(de=>j(de)).join(" ")}return Se(b(D.command))}function te(D){return D.method==="item/commandExecution/requestApproval"||D.method==="execCommandApproval"}function z(D){return D.method==="item/fileChange/requestApproval"||D.method==="applyPatchApproval"}function O(D){return D.method==="item/permissions/requestApproval"}function V(D){return te(D)||z(D)||O(D)}function Z(D){return D.method==="mcpServer/elicitation/request"}function Ae(D){const U=g(D.params);return b(U==null?void 0:U.reason)||b(U==null?void 0:U.prompt)||b(U==null?void 0:U.message)}function Ue(D){return V(D)?"Awaiting approval":Z(D)?"MCP server input required":D.method==="item/tool/requestUserInput"?"Awaiting response":D.method==="item/tool/call"?"Tool call waiting for response":D.method}function ne(D){const U=Ae(D);return U||(te(D)?"Do you want to run this command?":z(D)?"Do you want to make these changes?":O(D)?"Do you want to grant these permissions?":Z(D)?"An MCP server needs your input before Codex can continue.":D.method==="item/tool/requestUserInput"?"Codex needs your answer before it can continue.":"Codex is waiting for a response before it can continue.")}function Se(D){var Pe;const U=D.trim();if(!U)return"";const B=U.match(/-Command\s+(.+)$/i),Q=((Pe=B==null?void 0:B[1])==null?void 0:Pe.trim())??U;return(Q.startsWith('"')&&Q.endsWith('"')?Q.slice(1,-1):Q).replace(/\\"/g,'"').replace(/`"/g,'"').replace(/""/g,'"').replace(/\s+/g," ").trim()}function Y(D){const U=g(D.params);if(!U)return"";if(te(D))return q(U);if(z(D)){const B=b(U.grantRoot)||b(U.grant_root);if(B)return B.replace(/\s+/g," ").trim();const Q=g(U.fileChanges)??g(U.changes);if(!Q)return"";const de=Object.keys(Q).map(Pe=>Pe.trim()).filter(Pe=>Pe.length>0);return de.length===0?"":de.slice(0,3).join(", ")}return O(D)?Ee(U.permissions):Z(D)?b(U.serverName)||b(U.url):""}function Ee(D){const U=g(D);if(!U)return"";const B=[],Q=g(U.fileSystem),de=g(U.network),Pe=Array.isArray(Q==null?void 0:Q.read)?Q.read.filter(Qe=>typeof Qe=="string"):[],je=Array.isArray(Q==null?void 0:Q.write)?Q.write.filter(Qe=>typeof Qe=="string"):[];return Pe.length>0&&B.push(`Read: ${Pe.join(", ")}`),je.length>0&&B.push(`Write: ${je.join(", ")}`),(de==null?void 0:de.enabled)===!0&&B.push("Network access"),B.join(" • ")}function He(D){return!D||!V(D)?[]:[{id:"accept",label:"Yes"},{id:"acceptForSession",label:"Yes for Session"}]}const ee=le(()=>He(n.request));gt(()=>{var D;return((D=n.request)==null?void 0:D.id)??0},()=>{var D;o.value="",s.value={},l.value={},c.value={},f.value="",a.value=((D=ee.value[0])==null?void 0:D.id)??"accept"},{immediate:!0}),gt(ee,D=>{var U;a.value!=="decline"&&(D.some(B=>B.id===a.value)||(a.value=((U=D[0])==null?void 0:U.id)??"accept"))},{immediate:!0});function we(D,U){return`${String(D)}:${U}`}function Re(D){const U=g(D.params),B=Array.isArray(U==null?void 0:U.questions)?U.questions:[],Q=[];for(const de of B){const Pe=g(de);if(!Pe)continue;const je=b(Pe.id);if(!je)continue;const Qe=Array.isArray(Pe.options)?Pe.options.map(Me=>g(Me)).map(Me=>({label:b(Me==null?void 0:Me.label),description:b(Me==null?void 0:Me.description)})).filter(Me=>Me.label.length>0):[];Q.push({id:je,header:b(Pe.header),question:b(Pe.question),isOther:Pe.isOther===!0,options:Qe})}return Q}function Ke(D,U,B){const Q=we(D,U),de=s.value[Q];return typeof de=="string"&&de.length>0?de:B}function Be(D,U){return l.value[we(D,U)]??""}function xe(D,U,B){const Q=B.target;if(!(Q instanceof HTMLSelectElement))return;const de=we(D,U);s.value={...s.value,[de]:Q.value}}function me(D,U,B){const Q=B.target;if(!(Q instanceof HTMLInputElement))return;const de=we(D,U);l.value={...l.value,[de]:Q.value}}function We(D,U,B){var de,Pe;const Q=Ke(D,U,((de=B[0])==null?void 0:de.label)||"");return((Pe=B.find(je=>je.label===Q))==null?void 0:Pe.description)??""}function nt(D,U){return`${String(D)}:${U}`}function Ve(D){var U;return b((U=g(D.params))==null?void 0:U.serverName)}function Le(D){var B;const U=b((B=g(D.params))==null?void 0:B.url);if(!U)return"";try{const Q=new URL(U),de=Q.protocol.toLowerCase();return de==="https:"||de==="http:"?Q.toString():""}catch{return""}}function ft(D){const U=g(D.params),B=g(U==null?void 0:U.requestedSchema),Q=g(B==null?void 0:B.properties);if(!Q)return[];const de=new Set(Array.isArray(B==null?void 0:B.required)?B.required.filter(Pe=>typeof Pe=="string"):[]);return Object.entries(Q).map(([Pe,je])=>ht(Pe,g(je),de.has(Pe))).filter(Pe=>Pe!==null)}function ht(D,U,B){if(!U)return null;const Q=b(U.title)||D,de=b(U.description),Pe=b(U.type);if(Pe==="boolean")return{key:D,label:Q,description:de,required:B,kind:"boolean",inputType:"checkbox",options:[],defaultValue:typeof U.default=="boolean"?U.default:null,hasExplicitDefault:typeof U.default=="boolean"};if(Pe==="number"||Pe==="integer")return{key:D,label:Q,description:de,required:B,kind:"number",inputType:"number",options:[],defaultValue:typeof U.default=="number"?U.default:null,hasExplicitDefault:typeof U.default=="number"};const je=Xe(U);if(Pe==="array")return{key:D,label:Q,description:de,required:B,kind:"multiEnum",inputType:"checkbox",options:je,defaultValue:Array.isArray(U.default)?U.default.filter(Me=>typeof Me=="string"):[],hasExplicitDefault:Array.isArray(U.default)};const Qe=x(U.default);return je.length>0?{key:D,label:Q,description:de,required:B,kind:"singleEnum",inputType:"select",options:je,defaultValue:Qe,hasExplicitDefault:Qe!==null}:{key:D,label:Q,description:de,required:B,kind:"string",inputType:dt(U),options:[],defaultValue:Qe,hasExplicitDefault:Qe!==null}}function Xe(D){const B=(Array.isArray(D.oneOf)?D.oneOf:Array.isArray(D.anyOf)?D.anyOf:[]).map(je=>g(je)).map(je=>({value:b(je==null?void 0:je.const),label:b(je==null?void 0:je.title)||b(je==null?void 0:je.const)})).filter(je=>je.value.length>0);if(B.length>0)return B;const Q=g(D.items);if(Q){const je=Xe(Q);if(je.length>0)return je}const de=Array.isArray(D.enum)?D.enum.filter(je=>typeof je=="string"):[],Pe=Array.isArray(D.enumNames)?D.enumNames.filter(je=>typeof je=="string"):[];return de.map((je,Qe)=>({value:je,label:Pe[Qe]||je}))}function dt(D){const U=b(D.format);return U==="email"?"email":U==="uri"?"url":U==="date"?"date":U==="date-time"?"datetime-local":"text"}function K(D,U){const B=c.value[nt(D,U.key)];return B!==void 0?B:U.defaultValue}function _e(D,U){const B=K(D,U);return Array.isArray(B)?B.filter(Q=>typeof Q=="string"):[]}function be(D,U,B){const Q=B.target;if(!(Q instanceof HTMLInputElement)&&!(Q instanceof HTMLSelectElement))return;const de=Q.value,Pe=(U.kind==="number",de);c.value={...c.value,[nt(D,U.key)]:de.length>0?Pe:null},f.value=""}function Oe(D,U,B){const Q=B.target;if(!(Q instanceof HTMLSelectElement))return;let de=null;Q.value==="true"?de=!0:Q.value==="false"&&(de=!1),c.value={...c.value,[nt(D,U.key)]:de},f.value=""}function Je(D,U,B,Q){const de=Q.target;if(!(de instanceof HTMLInputElement))return;const Pe=new Set(_e(D,U));de.checked?Pe.add(B):Pe.delete(B),c.value={...c.value,[nt(D,U.key)]:Array.from(Pe)},f.value=""}function k(D){return D===!0?"true":D===!1?"false":""}function I(D,U){const B=K(D,U);return U.kind==="multiEnum"?Array.isArray(B)&&B.length>0:U.kind==="boolean"?typeof B=="boolean":U.kind==="number"&&typeof B=="number"?!0:typeof B=="string"&&B.trim().length>0}function H(D){const U=ft(D).filter(B=>B.required&&!I(D.id,B)).map(B=>B.label);return U.length===0?"":U.length===1?`Answer the required field: ${U[0]}.`:`Answer the required fields: ${U.join(", ")}.`}function re(D){const U={};for(const B of ft(D)){const Q=K(D.id,B);if(B.kind==="multiEnum"){const Pe=Array.isArray(Q)?Q:[];(Pe.length>0||B.required)&&(U[B.key]=Pe);continue}if(B.kind==="boolean"){typeof Q=="boolean"&&(U[B.key]=Q);continue}if(B.kind==="number"){const Pe=typeof Q=="number"?Q:Number(String(Q).trim());Number.isNaN(Pe)||(U[B.key]=Pe);continue}const de=String(Q??"").trim();(de.length>0||B.required)&&(U[B.key]=de)}return U}function J(D){a.value=D}function ae(){a.value="decline"}function fe(D){const U=D.target;U instanceof HTMLInputElement&&(o.value=U.value,a.value="decline")}function ye(D,U){var B;if(O(D)){if(U==="decline"||U==="cancel"){r("respondServerRequest",{id:D.id,error:{code:-32e3,message:U==="cancel"?"Cancelled from CodexUI.":"Declined from CodexUI."}});return}const Q=g((B=g(D.params))==null?void 0:B.permissions)??{};r("respondServerRequest",{id:D.id,result:{permissions:Q,scope:U==="acceptForSession"?"session":"turn"}});return}r("respondServerRequest",{id:D.id,result:{decision:U}})}function pe(D){const U=o.value.trim(),B=U.length>0?"decline":a.value;if(O(D)){ye(D,B);return}r("respondServerRequest",{id:D.id,result:{decision:B},followUpMessageText:U||void 0})}function ce(D,U){const B=g(D.params),Q={action:U};if(U==="accept"&&b(B==null?void 0:B.mode)==="form"){const de=H(D);if(de){f.value=de;return}Q.content=re(D)}r("respondServerRequest",{id:D.id,result:Q})}function $e(D){var Q;const U=Re(D),B={};for(const de of U){const Pe=Ke(D.id,de.id,((Q=de.options[0])==null?void 0:Q.label)||""),je=Be(D.id,de.id).trim(),Qe=[Pe,je].map(Me=>Me.trim()).filter(Me=>Me.length>0);B[de.id]={answers:Qe}}r("respondServerRequest",{id:D.id,result:{answers:B}})}function ge(D){r("respondServerRequest",{id:D.id,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from CodexUI."}]}})}function ke(D){r("respondServerRequest",{id:D.id,result:{success:!0,contentItems:[]}})}function De(D){r("respondServerRequest",{id:D.id,result:{}})}function Ze(D){r("respondServerRequest",{id:D.id,error:{code:-32e3,message:"Rejected from CodexUI."}})}return(D,U)=>e.request?(C(),R("section",b1,[m("article",{class:it(["thread-pending-request-shell",{"thread-pending-request-shell--no-top-radius":e.hasQueueAbove}])},[V(e.request)?(C(),R(Ge,{key:0},[m("p",_1,N(ne(e.request)),1),Y(e.request)?(C(),R("p",{key:0,class:"thread-pending-request-command-line",title:Y(e.request)},N(Y(e.request)),9,T1)):ie("",!0),m("section",S1,[m("div",{class:"thread-pending-request-options",role:"radiogroup","aria-label":S(h)("Approval choices")},[(C(!0),R(Ge,null,zt(ee.value,(B,Q)=>(C(),R("button",{key:B.id,type:"button",class:it(["thread-pending-request-option",{"is-selected":a.value===B.id}]),"aria-pressed":a.value===B.id,onClick:de=>J(B.id)},[m("span",x1,N(Q+1)+".",1),m("span",A1,N(B.label),1)],10,C1))),128))],8,k1),m("footer",E1,[m("label",{class:it(["thread-pending-request-inline-input",{"is-active":a.value==="decline"||o.value.length>0}])},[U[11]||(U[11]=m("span",{class:"thread-pending-request-option-index"},"3.",-1)),m("input",{class:"thread-pending-request-inline-control",type:"text",value:o.value,placeholder:S(h)("No, and tell Codex what to do differently"),onFocus:ae,onInput:fe,onKeydown:U[0]||(U[0]=dn(et(B=>pe(e.request),["prevent"]),["enter"]))},null,40,I1)],2),m("button",{type:"button",class:"thread-pending-request-secondary",onClick:U[1]||(U[1]=B=>ye(e.request,"cancel"))},N(S(h)("Skip")),1),m("button",{type:"button",class:"thread-pending-request-primary",onClick:U[2]||(U[2]=B=>pe(e.request))},N(S(h)("Send")),1)])])],64)):(C(),R(Ge,{key:1},[m("header",P1,[m("div",M1,[m("p",R1,N(Ue(e.request)),1),m("p",$1,N(ne(e.request)),1)]),(e.requestCount??0)>1?(C(),R("span",N1,N(e.requestCount??0)+" pending",1)):ie("",!0)]),Y(e.request)?(C(),R("div",O1,[m("code",D1,N(Y(e.request)),1)])):ie("",!0),e.request.method==="mcpServer/elicitation/request"?(C(),R("section",L1,[Ve(e.request)?(C(),R("p",j1,N(S(h)("Server"))+": "+N(Ve(e.request)),1)):ie("",!0),Le(e.request)?(C(),R("a",{key:1,class:"thread-pending-request-link",href:Le(e.request),target:"_blank",rel:"noopener noreferrer"},N(S(h)("Open authorization link")),9,F1)):ie("",!0),(C(!0),R(Ge,null,zt(ft(e.request),B=>(C(),R("div",{key:`${e.request.id}:${B.key}`,class:"thread-pending-request-question"},[m("p",U1,[_a(N(B.label),1),B.required?(C(),R("span",B1," *")):ie("",!0)]),B.description?(C(),R("p",q1,N(B.description),1)):ie("",!0),B.kind==="string"||B.kind==="number"?(C(),R("label",H1,[m("span",z1,N(S(h)("Value")),1),m("input",{class:"thread-pending-request-input",type:B.inputType,value:String(K(e.request.id,B)??""),onInput:Q=>be(e.request.id,B,Q)},null,40,V1)])):B.kind==="boolean"?(C(),R("label",W1,[m("span",G1,N(S(h)("Choice")),1),m("select",{class:"thread-pending-request-select",value:k(K(e.request.id,B)),onChange:Q=>Oe(e.request.id,B,Q)},[B.hasExplicitDefault?ie("",!0):(C(),R("option",J1,N(S(h)("Select true or false")),1)),m("option",Y1,N(S(h)("True")),1),m("option",Q1,N(S(h)("False")),1)],40,K1)])):B.kind==="singleEnum"?(C(),R("label",X1,[m("span",Z1,N(S(h)("Choice")),1),m("select",{class:"thread-pending-request-select",value:String(K(e.request.id,B)??""),onChange:Q=>be(e.request.id,B,Q)},[B.hasExplicitDefault?ie("",!0):(C(),R("option",tC,N(S(h)("Select an option")),1)),(C(!0),R(Ge,null,zt(B.options,Q=>(C(),R("option",{key:`${e.request.id}:${B.key}:${Q.value}`,value:Q.value},N(Q.label),9,nC))),128))],40,eC)])):(C(),R("div",rC,[(C(!0),R(Ge,null,zt(B.options,Q=>(C(),R("label",{key:`${e.request.id}:${B.key}:${Q.value}`,class:"thread-pending-request-checkbox-row"},[m("input",{class:"thread-pending-request-checkbox",type:"checkbox",checked:_e(e.request.id,B).includes(Q.value),onChange:de=>Je(e.request.id,B,Q.value,de)},null,40,oC),m("span",aC,N(Q.label),1)]))),128))]))]))),128)),f.value?(C(),R("p",sC,N(f.value),1)):ie("",!0),m("footer",iC,[m("button",{type:"button",class:"thread-pending-request-secondary",onClick:U[3]||(U[3]=B=>ce(e.request,"cancel"))},N(S(h)("Cancel")),1),m("button",{type:"button",class:"thread-pending-request-secondary",onClick:U[4]||(U[4]=B=>ce(e.request,"decline"))},N(S(h)("Decline")),1),m("button",{type:"button",class:"thread-pending-request-primary",onClick:U[5]||(U[5]=B=>ce(e.request,"accept"))},N(S(h)("Continue")),1)])])):e.request.method==="item/tool/requestUserInput"?(C(),R("section",lC,[(C(!0),R(Ge,null,zt(Re(e.request),B=>{var Q;return C(),R("div",{key:`${e.request.id}:${B.id}`,class:"thread-pending-request-question"},[m("p",uC,N(B.header||B.question),1),B.question?(C(),R("p",cC,N(B.question),1)):ie("",!0),B.options.length>0?(C(),R("div",dC,[m("label",fC,[m("span",hC,N(S(h)("Choice")),1),m("select",{class:"thread-pending-request-select",value:Ke(e.request.id,B.id,((Q=B.options[0])==null?void 0:Q.label)||""),onChange:de=>xe(e.request.id,B.id,de)},[(C(!0),R(Ge,null,zt(B.options,de=>(C(),R("option",{key:`${e.request.id}:${B.id}:${de.label}`,value:de.label},N(de.label),9,mC))),128))],40,pC)]),We(e.request.id,B.id,B.options)?(C(),R("p",gC,N(We(e.request.id,B.id,B.options)),1)):ie("",!0)])):ie("",!0),B.isOther?(C(),R("label",vC,[m("span",yC,N(S(h)("Other answer")),1),m("input",{class:"thread-pending-request-input",type:"text",value:Be(e.request.id,B.id),placeholder:S(h)("Other answer"),onInput:de=>me(e.request.id,B.id,de)},null,40,wC)])):ie("",!0)])}),128)),m("footer",bC,[m("button",{type:"button",class:"thread-pending-request-primary",onClick:U[6]||(U[6]=B=>$e(e.request))},N(S(h)("Send")),1)])])):e.request.method==="item/tool/call"?(C(),R("section",_C,[m("button",{type:"button",class:"thread-pending-request-primary",onClick:U[7]||(U[7]=B=>ge(e.request))},N(S(h)("Fail Tool Call")),1),m("button",{type:"button",class:"thread-pending-request-secondary",onClick:U[8]||(U[8]=B=>ke(e.request))},N(S(h)("Success (Empty)")),1)])):(C(),R("section",TC,[m("button",{type:"button",class:"thread-pending-request-primary",onClick:U[9]||(U[9]=B=>De(e.request))},N(S(h)("Return Empty Result")),1),m("button",{type:"button",class:"thread-pending-request-secondary",onClick:U[10]||(U[10]=B=>Ze(e.request))},N(S(h)("Reject Request")),1)]))],64))],2)])):ie("",!0)}}),kC=kt(SC,[["__scopeId","data-v-72a9d2d9"]]),CC={key:0,class:"queued-messages"},xC={class:"queued-messages-inner"},AC=["onDragstart","onDragover","onDragleave","onDrop"],EC=["aria-label","title"],IC={class:"queued-row-text"},PC={class:"queued-row-actions"},MC=["title","onClick"],RC=["title","onClick"],$C=["aria-label","title","onClick"],NC=Hn({__name:"QueuedMessages",props:{messages:{}},emits:["edit","steer","delete","reorder"],setup(e,{emit:t}){const n=t,{t:r}=Qo(),a=P(""),o=P("");function s(b,x){var j;a.value=x,o.value="",(j=b.dataTransfer)==null||j.setData("text/plain",x),b.dataTransfer&&(b.dataTransfer.effectAllowed="move")}function l(b){!a.value||a.value===b||(o.value=b)}function c(b){o.value===b&&(o.value="")}function f(b){const x=a.value;h(),!(!x||x===b)&&n("reorder",{draggedId:x,targetId:b})}function h(){a.value="",o.value=""}function g(b){var O,V,Z;const x=b.text.trim();if(x)return x;const j=[],q=((O=b.imageUrls)==null?void 0:O.length)??0,te=((V=b.fileAttachments)==null?void 0:V.length)??0,z=((Z=b.skills)==null?void 0:Z.length)??0;return q>0&&j.push(`${q} ${r(q===1?"image":"images")}`),te>0&&j.push(`${te} ${r(te===1?"file":"files")}`),z>0&&j.push(`${z} ${r(z===1?"skill":"skills")}`),j.join(", ")||r("(empty queued message)")}return(b,x)=>e.messages.length>0?(C(),R("div",CC,[m("div",xC,[(C(!0),R(Ge,null,zt(e.messages,j=>(C(),R("div",{key:j.id,class:it(["queued-row",{"is-dragging":a.value===j.id,"is-drop-target":o.value===j.id&&a.value!==j.id}]),draggable:"true",onDragstart:q=>s(q,j.id),onDragover:et(q=>l(j.id),["prevent"]),onDragleave:q=>c(j.id),onDrop:et(q=>f(j.id),["prevent"]),onDragend:h},[m("button",{class:"queued-row-drag",type:"button","aria-label":S(r)("Drag to reorder queued message"),title:S(r)("Drag to reorder queued message")},[...x[0]||(x[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:"currentColor",d:"M9 5.5A1.5 1.5 0 1 1 6 5.5a1.5 1.5 0 0 1 3 0m0 6.5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8A1.5 1.5 0 1 0 7.5 17a1.5 1.5 0 0 0 0 3m10-13A1.5 1.5 0 1 0 17.5 4a1.5 1.5 0 0 0 0 3m1.5 5a1.5 1.5 0 1 1-3 0a1.5 1.5 0 0 1 3 0m-1.5 8a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3"})],-1)])],8,EC),x[2]||(x[2]=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",IC,N(g(j)),1),m("div",PC,[m("button",{class:"queued-row-edit",type:"button",title:S(r)("Edit queued message"),onClick:q=>b.$emit("edit",j.id)},N(S(r)("Edit")),9,MC),m("button",{class:"queued-row-steer",type:"button",title:S(r)("Send now without interrupting work"),onClick:q=>b.$emit("steer",j.id)},N(S(r)("Steer")),9,RC),m("button",{class:"queued-row-delete",type:"button","aria-label":S(r)("Delete queued message"),title:S(r)("Delete queued message"),onClick:q=>b.$emit("delete",j.id)},[...x[1]||(x[1]=[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,$C)])],42,AC))),128))])])):ie("",!0)}}),OC=kt(NC,[["__scopeId","data-v-b7a3edb8"]]),DC={key:0,class:"rate-limit-status","aria-live":"polite"},LC=["title"],jC={class:"rate-limit-card-header"},FC={class:"rate-limit-card-title"},UC={key:0,class:"rate-limit-card-plan"},BC={class:"rate-limit-card-metrics"},qC={key:0,class:"rate-limit-card-footer"},HC=Hn({__name:"RateLimitStatus",props:{snapshots:{}},setup(e){function t(z){var O,V;return((O=z.limitId)==null?void 0:O.trim())||((V=z.limitName)==null?void 0:V.trim())||"__default__"}function n(z){var O,V;return((O=z.limitName)==null?void 0:O.trim())||((V=z.limitId)==null?void 0:V.trim())||"Rate limits"}function r(z){const O=z.trim();return O?O.replace(/[_-]+/g," ").replace(/\b\w/g,V=>V.toUpperCase()):""}function a(z){return!z||z<=0?"Window":z%1440===0?`${z/1440}d`:z%60===0?`${z/60}h`:z<60?`${z}m`:`${Math.round(z/60*10)/10}h`}function o(z){const O=Math.max(0,Math.min(100,100-z));return`${Math.round(O)}% left`}function s(z){return`${Math.round(z)}%`}function l(z,O){return{key:O,label:`${a(z.windowDurationMins)} ${o(z.usedPercent)}`}}function c(z){const O=[];return z.primary&&O.push(l(z.primary,"primary")),z.secondary&&O.push(l(z.secondary,"secondary")),O}function f(z){if(!z)return"";const O=new Date(z*1e3),V=O.getMonth()+1,Z=String(O.getDate()).padStart(2,"0"),Ae=String(O.getHours()).padStart(2,"0"),Ue=String(O.getMinutes()).padStart(2,"0");return`${V}.${Z} ${Ae}:${Ue}`}function h(z){if(!(z!=null&&z.resetsAt))return"";const O=z.resetsAt*1e3-Date.now();if(O<=0)return"Resetting now";const V=Math.round(O/6e4);if(V<60)return`Resets in ${V}m`;const Z=Math.round(V/60);return Z<24?`Resets in ${Z}h`:`Resets in ${Math.round(Z/24)}d`}function g(z){return[z.primary,z.secondary].filter(O=>O!==null)}function b(z){const O=g(z);return O.length===0?null:[...O].sort((V,Z)=>{const Ae=V.windowDurationMins??Number.MAX_SAFE_INTEGER,Ue=Z.windowDurationMins??Number.MAX_SAFE_INTEGER;return Ae!==Ue?Ae-Ue:(V.resetsAt??Number.MAX_SAFE_INTEGER)-(Z.resetsAt??Number.MAX_SAFE_INTEGER)})[0]}function x(z){const O=g(z);if(O.length===0)return"";const V=[...O].sort((Ae,Ue)=>{const ne=Ae.windowDurationMins??-1,Se=Ue.windowDurationMins??-1;return ne!==Se?Se-ne:(Ue.resetsAt??-1)-(Ae.resetsAt??-1)})[0],Z=f(V.resetsAt);return Z||""}function j(z){const O=z.credits;return O?O.unlimited?"Unlimited credits":O.balance?`Credits ${O.balance}`:O.hasCredits?"Credits available":"":""}function q(z){return[h(b(z)),x(z),j(z)].filter(O=>O.length>0)}function te(z){const O=[n(z)];for(const V of c(z))O.push(V.label);for(const V of g(z))O.push(`${a(V.windowDurationMins)} used ${s(V.usedPercent)}`);for(const V of q(z))O.push(V);return O.join(`
|
|
50
|
-
`)}return(z,O)=>e.snapshots.length>0?(C(),R("aside",DC,[(C(!0),R(Ge,null,zt(e.snapshots,V=>(C(),R("div",{key:t(V),class:"rate-limit-card",title:te(V)},[m("div",jC,[m("span",FC,N(n(V)),1),V.planType?(C(),R("span",UC,N(r(V.planType)),1)):ie("",!0)]),m("div",BC,[(C(!0),R(Ge,null,zt(c(V),Z=>(C(),R("span",{key:Z.key,class:"rate-limit-card-metric"},N(Z.label),1))),128))]),q(V).length>0?(C(),R("div",qC,N(q(V).join(" | ")),1)):ie("",!0)],8,LC))),128))])):ie("",!0)}}),zC=kt(HC,[["__scopeId","data-v-df88906b"]]),VC=["aria-label"],WC=["aria-checked","onClick"],GC={class:"runtime-toggle-option-label"},KC=Hn({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,{t:r}=Qo(),a=[{value:"local",label:r("Local project"),icon:Pc},{value:"worktree",label:r("New worktree"),icon:Ms}];function o(s){n("update:modelValue",s)}return(s,l)=>(C(),R("div",{class:"runtime-toggle",role:"radiogroup","aria-label":S(r)("Continue in")},[(C(),R(Ge,null,zt(a,c=>m("button",{key:c.value,class:it(["runtime-toggle-option",{"is-selected":e.modelValue===c.value}]),type:"button",role:"radio","aria-checked":e.modelValue===c.value,onClick:f=>o(c.value)},[(C(),rt(vc(c.icon),{class:"runtime-toggle-option-icon"})),m("span",GC,N(c.label),1)],10,WC)),64))],8,VC))}}),JC=kt(KC,[["__scopeId","data-v-0f175c28"]]),YC={},QC={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 XC(e,t){return C(),R("svg",QC,[...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 ZC=kt(YC,[["render",XC]]),ex={},tx={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function nx(e,t){return C(),R("svg",tx,[...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 rx=kt(ex,[["render",nx]]),ox={class:"sidebar-thread-controls"},ax=["aria-label","title"],sx=["aria-label","title"],ix=Hn({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){const{t}=Qo();return(n,r)=>(C(),R("div",ox,[m("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?S(t)("Expand sidebar"):S(t)("Collapse sidebar"),title:e.isSidebarCollapsed?S(t)("Expand sidebar"):S(t)("Collapse sidebar"),onClick:r[0]||(r[0]=a=>n.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(C(),rt(rx,{key:0,class:"sidebar-thread-controls-icon"})):(C(),rt(ZC,{key:1,class:"sidebar-thread-controls-icon"}))],8,ax),po(n.$slots,"default",{},void 0),e.showNewThreadButton?(C(),R("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":S(t)("Start new thread"),title:S(t)("Start new thread"),onClick:r[1]||(r[1]=a=>n.$emit("start-new-thread"))},[Ne(Ks,{class:"sidebar-thread-controls-icon"})],8,sx)):ie("",!0)]))}}),Mf=kt(ix,[["__scopeId","data-v-2369affb"]]),lx={},ux={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function cx(e,t){return C(),R("svg",ux,[...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 Rf=kt(lx,[["render",cx]]),dx={},fx={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function hx(e,t){return C(),R("svg",fx,[...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 px=kt(dx,[["render",hx]]),mx={},gx={viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"};function vx(e,t){return C(),R("svg",gx,[...t[0]||(t[0]=[m("path",{d:"M5 7l5 5-5 5",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),m("path",{d:"M12 17h7",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"},null,-1)])])}const yx=kt(mx,[["render",vx]]),wx={},bx={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function _x(e,t){return C(),R("svg",bx,[...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 Tx=kt(wx,[["render",_x]]);function Sr(e){return e.flatMap(t=>t.threads)}const Bp="codex-web-local.thread-read-state.v1",qp="codex-web-local.thread-scroll-state.v1",Hp="codex-web-local.thread-token-usage.v1",zp="codex-web-local.thread-terminal-open.v1",Xu="codex-web-local.selected-thread-id.v1",Zu="codex-web-local.selected-model-by-context.v1",Vp="codex-web-local.selected-model-id.v1",Wp="codex-web-local.project-order.v1",Gp="codex-web-local.project-display-name.v1",ec="codex-web-local.collaboration-mode-by-context.v1",Kp="codex-web-local.collaboration-mode.v1",xo="__new-thread__",Jp="__new-thread-provider__::",Cu=220,Sx=1e4,kx=500,Cx=3e3,xx=2e3,$f=["none","minimal","low","medium","high","xhigh"],Oa="__global__",Lr="gpt-5.4-mini";function Ax(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Bp);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function Nf(e){typeof window>"u"||window.localStorage.setItem(Bp,JSON.stringify(e))}function tc(e){return e==="plan"?"plan":"default"}function rs(e){return typeof e=="string"?e.trim():""}function Fr(){return Object.create(null)}function Rs(e){const t=Fr();for(const[n,r]of Object.entries(e))t[n]=r;return t}function Bi(e,t){if(!(t in e))return e;const n=Fr();for(const[r,a]of Object.entries(e))r!==t&&(n[r]=a);return n}function Of(e,t){let n=!1;const r=Fr();for(const[a,o]of Object.entries(e)){if(a===xo||a.startsWith(Jp)||t.has(a)){r[a]=o;continue}n=!0}return n?r:e}function Yp(e){return e.trim().toLowerCase()||"codex"}function xu(e){const t=Yp(e);return`${Jp}${t}`}function Ya(e){return e.trim()||xo}function Ex(){if(typeof window>"u")return Fr();try{const n=window.localStorage.getItem(Zu);if(n){const r=JSON.parse(n);if(!r||typeof r!="object"||Array.isArray(r))return Fr();const a=Fr();for(const[o,s]of Object.entries(r)){if(typeof o!="string"||o.length===0)continue;const l=rs(s);l&&(a[o]=l)}return a}}catch{}const e=rs(window.localStorage.getItem(Vp)),t=Fr();return e&&(t[xo]=e),t}function Df(e,t){const n=Ya(t),r=rs(e[n]);return r||rs(e[xo])}function Mi(e){if(!(typeof window>"u"))try{Object.keys(e).length===0?window.localStorage.removeItem(Zu):window.localStorage.setItem(Zu,JSON.stringify(e)),window.localStorage.removeItem(Vp)}catch{}}function Ix(){if(typeof window>"u")return Fr();try{const n=window.localStorage.getItem(ec);if(n){const r=JSON.parse(n);if(!r||typeof r!="object"||Array.isArray(r))return Fr();const a=Fr();for(const[o,s]of Object.entries(r)){if(typeof o!="string"||o.length===0)continue;const l=tc(s);l==="plan"&&(a[o]=l)}return a}}catch{}const e=tc(window.localStorage.getItem(Kp)),t=Fr();return e==="plan"&&(t[xo]="plan"),t}function As(e,t){const n=Ya(t);return tc(e[n])}function Lf(e,t,n){const r=Ya(t);if(n==="plan"){const a=Rs(e);return a[r]="plan",a}return Bi(e,r)}function Au(e){if(!(typeof window>"u"))try{Object.keys(e).length===0?window.localStorage.removeItem(ec):window.localStorage.setItem(ec,JSON.stringify(e)),window.localStorage.removeItem(Kp)}catch{}}function Qi(e,t,n){return Math.min(Math.max(e,t),n)}function Px(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=Qi(t.scrollRatio,0,1)),n}function Mx(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(qp);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,a]of Object.entries(t)){if(!r)continue;const o=Px(a);o&&(n[r]=o)}return n}catch{return{}}}function jf(e){typeof window>"u"||window.localStorage.setItem(qp,JSON.stringify(e))}function Ua(e){if(typeof e=="number"&&Number.isFinite(e))return Math.max(0,Math.trunc(e));if(typeof e=="string"&&e.trim().length>0){const t=Number(e);if(Number.isFinite(t))return Math.max(0,Math.trunc(t))}return null}function Ff(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;return{totalTokens:Ua(t.totalTokens)??0,inputTokens:Ua(t.inputTokens)??0,cachedInputTokens:Ua(t.cachedInputTokens)??0,outputTokens:Ua(t.outputTokens)??0,reasoningOutputTokens:Ua(t.reasoningOutputTokens)??0}}function Rx(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=Ff(t.total),r=Ff(t.last);if(!n||!r)return null;const a=Ua(t.modelContextWindow),o=r.totalTokens,s=typeof a=="number"?Math.max(a-o,0):null,l=typeof a=="number"&&a>0?Qi(Math.round((s??0)/a*100),0,100):null;return{total:n,last:r,modelContextWindow:a,currentContextTokens:o,remainingContextTokens:s,remainingContextPercent:l}}function $x(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Hp);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,a]of Object.entries(t)){if(!r)continue;const o=Rx(a);o&&(n[r]=o)}return n}catch{return{}}}function Uf(e){typeof window>"u"||window.localStorage.setItem(Hp,JSON.stringify(e))}function Nx(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(zp);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,a]of Object.entries(t))r&&typeof a=="boolean"&&(n[r]=a);return n}catch{return{}}}function Ox(e){typeof window>"u"||window.localStorage.setItem(zp,JSON.stringify(e))}function Dx(){return typeof window>"u"?"":window.localStorage.getItem(Xu)??""}function Lx(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Xu);return}window.localStorage.setItem(Xu,e)}}function jx(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Wp);if(!e)return[];const t=JSON.parse(e);if(!Array.isArray(t))return[];const n=[];for(const r of t){if(typeof r!="string"||r.length===0)continue;const a=ei(r);a.length>0&&!n.includes(a)&&n.push(a)}return n}catch{return[]}}function Da(e){typeof window>"u"||window.localStorage.setItem(Wp,JSON.stringify(e))}function Fx(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Gp);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,a]of Object.entries(t)){const o=typeof r=="string"?ei(r):"";o.length>0&&typeof a=="string"&&(n[o]=a)}return n}catch{return{}}}function Eu(e){typeof window>"u"||window.localStorage.setItem(Gp,JSON.stringify(e))}function Ri(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 Vo(e,n)?e:n}function Iu(e,t){const n=new Map(e.map(a=>[a.projectName,a])),r=t.map(a=>n.get(a)??null).filter(a=>a!==null&&a.threads.length>0);for(const a of e)t.includes(a.projectName)||r.push(a);return r}function Vo(e,t){const n=Array.isArray(e)?e:[],r=Array.isArray(t)?t:[];if(n.length!==r.length)return!1;for(let a=0;a<n.length;a+=1)if(n[a]!==r[a])return!1;return!0}function Ux(e,t,n){if(t<0||t>=e.length||n<0||n>=e.length||t===n)return e;const r=[...e],[a]=r.splice(t,1);return r.splice(n,0,a),r}function Bx(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function qx(e=[],t=[]){var n,r,a,o;if(e.length!==t.length)return!1;for(let s=0;s<e.length;s+=1)if(((n=e[s])==null?void 0:n.step)!==((r=t[s])==null?void 0:r.step)||((a=e[s])==null?void 0:a.status)!==((o=t[s])==null?void 0:o.status))return!1;return!0}function Hx(e,t){return!e&&!t?!0:!e||!t?!1:e.explanation===t.explanation&&e.isStreaming===t.isStreaming&&qx(e.steps,t.steps)}function $i(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")||t.includes("requires a newer version of codex")}function nc(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Vo(e.images,t.images)&&Vx(e.fileChanges,t.fileChanges)&&e.fileChangeStatus===t.fileChangeStatus&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&Bx(e.commandExecution,t.commandExecution)&&Hx(e.plan,t.plan)&&e.turnId===t.turnId&&e.turnIndex===t.turnIndex&&e.isAutomationRun===t.isAutomationRun&&e.automationDisplayName===t.automationDisplayName}function za(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 zx(e,t,n={}){const r=new Map(e.map(h=>[h.id,h])),a=new Map(t.map(h=>[h.id,h])),o=t.map(h=>{const g=r.get(h.id);return g&&nc(g,h)?g:h});if(n.preserveMissing!==!0)return za(e,o)?e:o;const s=e.map(h=>{const g=a.get(h.id);return!g||nc(h,g)?h:g}),l=new Set(e.map(h=>h.id)),c=o.filter(h=>!l.has(h.id)),f=[...s,...c];return za(e,f)?e:f}function Vx(e,t){if(!e&&!t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1){const r=e[n],a=t[n];if(r.path!==a.path||r.operation!==a.operation||r.movedToPath!==a.movedToPath||r.diff!==a.diff||r.addedLineCount!==a.addedLineCount||r.removedLineCount!==a.removedLineCount)return!1}return!0}function rc(e){return e.replace(/\s+/gu," ").trim()}function Wx(e,t){const n=new Set(t.map(o=>o.id)),r=new Set(t.filter(o=>o.role==="assistant").map(o=>rc(o.text)).filter(o=>o.length>0));if(r.size===0)return e;const a=e.filter(o=>{if(o.messageType!=="agentMessage.live")return!0;if(n.has(o.id))return!1;const s=rc(o.text);return s.length===0?!1:!r.has(s)});return a.length===e.length?e:a}function Ni(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(nc(r,t))return e;const a=[...e];return a.splice(n,1,t),a}const Qp="worked";function Uo(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function Gx(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),a=t%60,o=[];n>0&&o.push(`${n}h`),(r>0||n>0)&&o.push(`${r}m`);const s=a>0||o.length===0?a:0;return o.push(`${s}s`),o.join(" ")}function Kx(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function Jx(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 Yx(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${Gx(e.durationMs)}`,messageType:Qp,turnId:e.turnId}}function Qx(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function Xx(e,t){const n=Yx(t),r=e.filter(s=>s.messageType!==Qp),a=Qx(r);if(a<0)return[...r,n];const o=[...r];return o.splice(a,0,n),o}function St(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function Zx(e,t){if(t.size===0)return e;let n=!1;const r={};for(const[a,o]of Object.entries(e)){if(t.has(a)){n=!0;continue}r[a]=o}return n?r:e}function eA(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&&e.pendingRequestState===t.pendingRequestState}function tA(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 nA(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 Yt(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function Oi(e,t){const n=new Map(e.map(a=>[a.projectName,a])),r=t.map(a=>{const o=n.get(a.projectName),s=new Map((o==null?void 0:o.threads.map(c=>[c.id,c]))??[]),l=a.threads.map(c=>{const f=s.get(c.id);return f&&eA(f,c)?f:c});return o&&o.projectName===a.projectName&&tA(o.threads,l)?o:{projectName:a.projectName,threads:l}});return nA(e,r)?e:r}function rA(e,t,n){const r=new Set(Sr(t).map(l=>l.id)),a=Sr(e).filter(l=>n[l.id]===!0&&!r.has(l.id));if(a.length===0)return t;const o=new Map(t.map(l=>[l.projectName,l])),s=t.map(l=>({projectName:l.projectName,threads:[...l.threads]}));for(const l of a){if(o.get(l.projectName)){const f=s.findIndex(h=>h.projectName===l.projectName);f>=0&&(s[f]={projectName:s[f].projectName,threads:[l,...s[f].threads]});continue}s.push({projectName:l.projectName,threads:[l]})}return s}function Bo(e){return ei(e)}function oA(e){const t=e.split(`
|
|
51
|
-
`).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function aA(e){const t=e.trim()||"Untitled thread";return/^fork:\s+/iu.test(t)?t:`Fork: ${t}`}function sA(){const e=P([]),t=P([]),n=P(Dx()),r=P({}),a=P({}),o=P({}),s=P({}),l=P({}),c=P({}),f=P({}),h=P({}),g=P({});let b=!1;const x=P({}),j=P([]),q=P([{value:"default",label:"Default"},{value:"plan",label:"Plan"}]),te=P(Ix()),z=P(Ex()),O=P(As(te.value,n.value)),V=P(Df(z.value,n.value)),Z=P("medium"),Ae=P("standard"),Ue=P(""),ne=P(Ax()),Se=P(Mx()),Y=P(jx()),Ee=P(Fx()),He=P({}),ee=P({}),we=P({}),Re=P({}),Ke=P({}),Be=P({}),xe=P({}),me=P({}),We=P({}),nt=P({}),Ve=P({}),Le=P({}),ft=P({}),ht=P(null),Xe=P($x()),dt=P(Nx()),K=P({}),_e=P([]),be=P([]),Oe=P(!1),Je=P(!1),k=P(!1),I=P(!1),H=P(!1),re=P(!1),J=P(""),ae=P(!1),fe=P(!1);function ye(i){var u;try{const p=new URL(i,"http://localhost");return p.pathname!=="/codex-local-image"?"":((u=p.searchParams.get("path"))==null?void 0:u.trim())??""}catch{return""}}function pe(i){const u=i.trim().toLowerCase();return u?/\b(attached image|attached screenshot|save the attached|copy (the )?screenshot|save screenshot)\b/i.test(u):!1}function ce(i){var p;const u=r.value[i]??[];for(let y=u.length-1;y>=0;y-=1){const E=u[y];if(!(E.role!=="user"||!Array.isArray(E.images)||E.images.length===0))for(let $=E.images.length-1;$>=0;$-=1){const L=((p=E.images[$])==null?void 0:p.trim())??"";if(L&&ye(L))return L}}return""}let $e=null,ge=null,ke=null;const De=new Map;let Ze=null;const D=new Map;let U=null,B=null,Q=!1;const de=new Set,Pe=new Map;let je=null,Qe=null,Me=!1,bt=!1,Sn=[],In=null,Wr=!1,Bt=!1;const pr=new Map,sr=new Set,Gr=le(()=>Sr(e.value)),kr=le(()=>Gr.value.find(i=>i.id===n.value)??null),mr=le(()=>Se.value[n.value]??null),Vn=le(()=>{const i=n.value;return!!(i&&dt.value[i]===!0)}),Qt=le(()=>{const i=n.value;return i?We.value[i]===!0:!1}),Pn=le(()=>{const i=[],u=n.value;return u&&Array.isArray(Le.value[u])&&i.push(...Le.value[u]),Array.isArray(Le.value[Oa])&&i.push(...Le.value[Oa]),i.sort((p,y)=>p.receivedAtIso.localeCompare(y.receivedAtIso))}),ut=le(()=>{var $;const i=n.value;if(!i)return null;const u=f.value[i]===!0,p=u?Be.value[i]:void 0,y=u?(s.value[i]??"").trim():"",E=((($=xe.value[i])==null?void 0:$.message)??"").trim();return!p&&!y&&!E?null:{activityLabel:(p==null?void 0:p.label)||"Thinking",activityDetails:(p==null?void 0:p.details)??[],reasoningText:y,errorText:E}}),Mn=le(()=>ht.value),Wn=le(()=>{const i=n.value;return i?Xe.value[i]??null:null}),Kr=le(()=>{const i=n.value;if(!i)return[];const u=r.value[i]??[],p=a.value[i]??[],y=o.value[i]??[],E=l.value[i]??[],$=c.value[i]??[],L=[...u,...p,...E,...$,...y],G=Ke.value[i];return G?Xx(L,G):L});function Wt(i){if(Ya(i)===xo){const p=xu(Ue.value),y=p?rs(z.value[p]):"";if(y)return y}return Df(z.value,i).trim()}function Gn(...i){const u=[...j.value];for(const p of i){const y=p.trim();y&&!u.includes(y)&&u.push(y)}Vo(j.value,u)||(j.value=u)}function qt(i){n.value!==i&&(n.value=i,Lx(i),V.value=Wt(i),Gn(V.value),O.value=As(te.value,i),Bt=!1)}function Xt(i,u){const p=u.trim(),y=Ya(i);if(p){const E=Rs(z.value);E[y]=p,z.value=E}else z.value=Bi(z.value,y);if(i.trim()===n.value?(V.value=Wt(n.value),Gn(V.value)):Gn(p),y===xo){const E=xu(Ue.value);if(E)if(p){const $=Rs(z.value);$[E]=p,z.value=$}else z.value=Bi(z.value,E)}Mi(z.value)}function Ot(i){Xt(n.value,i)}function Et(i,u){const p=i.trim();if(!p)return;const y=u.trim();if(y){const E=Rs(z.value);E[p]=y,z.value=E}else z.value=Bi(z.value,p);Gn(y),n.value===p&&(V.value=Wt(n.value)),Mi(z.value)}function Gt(i,u){const p=i.trim();if(!p)return;if(!u){if(!(p in Xe.value))return;Xe.value=St(Xe.value,p),Uf(Xe.value);return}const y=Xe.value[p];y&&JSON.stringify(y)===JSON.stringify(u)||(Xe.value={...Xe.value,[p]:u},Uf(Xe.value))}function gr(i){const u=i==="plan"?"plan":"default",p=Ya(n.value);As(te.value,n.value)===u&&O.value===u||(O.value=u,te.value=Lf(te.value,p,u),Au(te.value))}function ir(i,u){const p=u==="plan"?"plan":"default";te.value=Lf(te.value,i,p),i.trim()===n.value&&(O.value=p),Au(te.value)}function Jr(i){ht.value=i}async function tn(i=n.value){i.trim()?Et(i,Lr):Ot(Lr),Gn(Lr)}function Rn(i,u){ft.value={...ft.value,[i]:u}}function vr(i){ft.value[i]&&(ft.value=St(ft.value,i))}async function lr(i){if(sr.has(i))return;const u=ft.value[i];if(!(!u||u.fallbackRetried)){sr.add(i),Rn(i,{...u,fallbackRetried:!0});try{await tn(i);try{const p=await vu(i,1);kn(i,p),Ct(i),yn(i,[]),lt(i),l.value[i]&&(l.value=St(l.value,i))}catch{}It(i,null),J.value="",rn(i,null),Nt(i,{label:"Thinking",details:sn(Lr,u.effort,u.collaborationMode)}),Tt(i,!0),we.value[i]!==!0&&await gu(i),await yu(i,u.text,u.imageUrls,Lr,u.effort||void 0,u.skills.length>0?u.skills:void 0,u.fileAttachments,u.collaborationMode),we.value={...we.value,[i]:!0},Qr(),de.add(i),await fr()}catch(p){const y=p instanceof Error?p.message:"Unknown application error";It(i,y),J.value=y,Tt(i,!1),Nt(i,null)}finally{sr.delete(i)}}}function Yr(i){i&&!$f.includes(i)||(Z.value=i)}async function Kn(i){const u=i==="fast"?"fast":"standard";if(H.value||Ae.value===u)return;const p=Ae.value;Ae.value=u,H.value=!0,J.value="";try{await Jb(u)}catch(y){Ae.value=p,J.value=y instanceof Error?y.message:"Failed to update Fast mode"}finally{H.value=!1}}async function $n(){try{const i=await t0();q.value=i,i.some(u=>u.value===O.value)||gr("default")}catch{}}function sn(i,u,p=O.value){const y=i.trim()||"default",E=u||"default",$=p==="plan"?"Plan":"Default",L=Ae.value==="fast"?"Fast":"Standard";return[`Mode: ${$}`,`Model: ${y}`,`Thinking: ${E}`,`Speed: ${L}`]}async function yr(i){try{const[u,p]=await Promise.all([$p({includeProviderModels:(i==null?void 0:i.includeProviderModels)!==!1}),Np()]),y=Wt(n.value),E=p.model.trim(),$=Yp(p.providerId);Ue.value=$;const L=xu($),G=L?rs(z.value[L]):"",oe=[...u];if(!(i!=null&&i.providerChanged))for(const ze of[y,E])ze&&!oe.includes(ze)&&oe.push(ze);j.value=oe;const he=y&&u.includes(y);if((!y||!he||i!=null&&i.providerChanged)&&(i!=null&&i.providerChanged&&oe.length>0?G&&oe.includes(G)?Ot(G):E&&oe.includes(E)?Ot(E):Ot(oe[0]):E&&oe.includes(E)?Ot(p.model):oe.length>0?Ot(oe[0]):Ot("")),L&&V.value.trim().length>0){const ze=Rs(z.value);ze[L]=V.value.trim(),z.value=ze,Mi(z.value)}p.reasoningEffort&&$f.includes(p.reasoningEffort)&&(Z.value=p.reasoningEffort),Ae.value=p.speedMode}catch{}}async function nn(){if(B){await B;return}B=(async()=>{try{const i=await Db();Jr(i),be.value=i?[i]:[]}catch{}finally{B=null}})(),await B}function Qr(){if(typeof window>"u"){nn();return}ke!==null&&window.clearTimeout(ke),ke=window.setTimeout(()=>{ke=null,nn()},kx)}function fn(i){if(!i||typeof window>"u")return;const u=De.get(i);u!==void 0&&(window.clearTimeout(u),De.delete(i))}function No(i){if(!i||typeof window>"u")return;fn(i);const u=window.setTimeout(()=>{De.delete(i),de.add(i),fr()},Cx);De.set(i,u)}function gn(i){const u=K.value;return Object.keys(u).length===0?i:i.map(p=>({projectName:p.projectName,threads:p.threads.map(y=>{const E=u[y.id];return E?{...y,title:E}:y})}))}function ur(i){return i?Array.isArray(Le.value[i])?Le.value[i]:[]:[]}function Jn(i){return i==="item/commandExecution/requestApproval"||i==="item/fileChange/requestApproval"||i==="item/permissions/requestApproval"||i==="execCommandApproval"||i==="applyPatchApproval"}function wr(i){return i.some(u=>Jn(u.method))?"approval":i.length>0?"response":null}function Dt(){const u=gn(t.value).map(p=>({projectName:p.projectName,threads:p.threads.map(y=>{const E=f.value[y.id]===!0,$=wr(ur(y.id)),L=n.value===y.id,G=ne.value[y.id],oe=x.value[y.id]===!0,he=!L&&!E&&(oe||G!==y.updatedAtIso);return{...y,inProgress:E,unread:he,pendingRequestState:$}})}));e.value=Oi(e.value,u)}function Nn(i,u,p){const y=new Date().toISOString(),E=Ft(u),$=ei(E),L={id:i,title:oA(p),projectName:$,cwd:E,hasWorktree:E.includes("/.codex/worktrees/")||E.includes("/.git/worktrees/"),createdAtIso:y,updatedAtIso:y,preview:p,unread:!1,inProgress:!1},G=t.value.findIndex(he=>he.projectName===$);if(G>=0){const ze=t.value[G].threads.filter(wt=>wt.id!==i),pt={projectName:$,threads:[L,...ze]},mt=[...t.value];mt.splice(G,1,pt),t.value=mt}else t.value=[{projectName:$,threads:[L]},...t.value];const oe=Ri(Y.value,t.value);Vo(Y.value,oe)||(Y.value=oe,Da(Y.value)),Dt()}function Kt(i){const u=new Set(i.map(he=>he.id)),p=n.value.trim();p&&u.add(p);const y=Of(z.value,u);y!==z.value&&(z.value=y,V.value=Wt(n.value),Gn(V.value),Mi(y));const E=Of(te.value,u);E!==te.value&&(te.value=E,O.value=As(E,n.value),Au(E));const $=Yt(ne.value,u);$!==ne.value&&(ne.value=$,Nf($));const L=Yt(Se.value,u);L!==Se.value&&(Se.value=L,jf(L)),ee.value=Yt(ee.value,u),He.value=Yt(He.value,u),we.value=Yt(we.value,u),Re.value=Yt(Re.value,u),r.value=Yt(r.value,u),o.value=Yt(o.value,u),s.value=Yt(s.value,u),l.value=Yt(l.value,u),c.value=Yt(c.value,u),Ke.value=Yt(Ke.value,u),Be.value=Yt(Be.value,u),xe.value=Yt(xe.value,u),me.value=Yt(me.value,u),We.value=Yt(We.value,u),nt.value=Yt(nt.value,u),Ve.value=Yt(Ve.value,u);const G=Yt(h.value,u);G!==h.value&&(h.value=G,Er()),Xe.value=Yt(Xe.value,u),x.value=Yt(x.value,u),f.value=Yt(f.value,u);const oe={};for(const[he,ze]of Object.entries(Le.value))(he===Oa||u.has(he))&&(oe[he]=ze);Le.value=oe}function br(i){const u=Sr(t.value).find(p=>p.id===i);u&&(ne.value={...ne.value,[i]:u.updatedAtIso},Nf(ne.value),x.value[i]&&(x.value=St(x.value,i)),Dt())}function rn(i,u){if(!i)return;const p=Ke.value[i];if(u){if(Kx(p,u))return;Ke.value={...Ke.value,[i]:u}}else p&&(Ke.value=St(Ke.value,i))}function Tt(i,u){!i||f.value[i]===!0===u||(u?f.value={...f.value,[i]:!0}:(f.value=St(f.value,i),xt(i),ln(i)),Dt(),!u&&!na()&&je&&ps())}function ln(i){i&&(We.value[i]&&(We.value=St(We.value,i)),nt.value[i]&&(nt.value=St(nt.value,i)),Ve.value[i]&&(Ve.value=St(Ve.value,i)))}function cr(i){i&&(We.value={...We.value,[i]:!0},nt.value[i]&&(nt.value=St(nt.value,i)),Ve.value[i]&&(Ve.value=St(Ve.value,i)))}function On(i){i&&We.value[i]===!0&&nt.value[i]===!0&&Ve.value[i]===!0&&ln(i)}function _r(i,u){!i||!u||We.value[i]===!0&&ln(i)}function Xr(i){const u=Object.keys(We.value);if(u.length===0)return;let p=nt.value,y=!1;for(const E of u)!i.has(E)||p[E]===!0||(p={...p,[E]:!0},y=!0);if(y){nt.value=p;for(const E of u)On(E)}}function Cr(i,u){i&&We.value[i]===!0&&u.some(p=>p.role==="user")&&(Ve.value[i]!==!0&&(Ve.value={...Ve.value,[i]:!0}),On(i))}function vn(i){i&&i!==n.value&&x.value[i]!==!0&&(x.value={...x.value,[i]:!0},Dt())}function Nt(i,u){if(!i)return;const p=Be.value[i];if(!u){p&&(Be.value=St(Be.value,i));return}const y=Or(u.label)||"Thinking",E=u.details.map(G=>Or(G)).filter(G=>G.length>0&&G!==y),$=Array.from(new Set([...(p==null?void 0:p.details)??[],...E])).slice(-3),L={label:y,details:$};Jx(p,L)||(Be.value={...Be.value,[i]:L})}function It(i,u,p={}){if(!i)return;const y=xe.value[i],E=u?rc(u):"";if(!E){y&&(xe.value=St(xe.value,i));return}const $=p.transient===!0;(y==null?void 0:y.message)===E&&y.transient===$||(xe.value={...xe.value,[i]:{message:E,transient:$}})}function vo(i){var u;i&&(u=xe.value[i])!=null&&u.transient&&It(i,null)}function Zr(){const i=Object.entries(xe.value).filter(([,p])=>p==null?void 0:p.transient).map(([p])=>p);if(i.length===0)return;let u=xe.value;for(const p of i)u=St(u,p);xe.value=u}function _t(i){const u=Sr(t.value).find(p=>p.id===i);return(u==null?void 0:u.updatedAtIso)??""}function on(i,u){if(!i)return;const p={scrollTop:Math.max(0,u.scrollTop),isAtBottom:u.isAtBottom===!0};typeof u.scrollRatio=="number"&&Number.isFinite(u.scrollRatio)&&(p.scrollRatio=Qi(u.scrollRatio,0,1));const y=Se.value[i];y&&y.scrollTop===p.scrollTop&&y.isAtBottom===p.isAtBottom&&y.scrollRatio===p.scrollRatio||(Se.value={...Se.value,[i]:p},jf(Se.value))}function un(i,u){if(!i)return;const p={...dt.value};u?p[i]=!0:delete p[i],dt.value=p,Ox(p)}function Dn(){const i=n.value;i&&un(i,!Vn.value)}function kn(i,u){const p=r.value[i]??[];za(p,u)||(r.value={...r.value,[i]:u})}function yn(i,u){const p=o.value[i]??[];za(p,u)||(o.value={...o.value,[i]:u})}function Yn(i){i&&i in o.value&&(o.value=St(o.value,i))}function xr(i,u){const p=c.value[i]??[];za(p,u)||(c.value={...c.value,[i]:u})}function eo(i,u){const p=a.value[i]??[];za(p,u)||(a.value={...a.value,[i]:u})}function Ar(i,u){const p=a.value[i]??[],y=Ni(p,u);eo(i,y)}function A(i,u){const p=o.value[i]??[],y=Ni(p,u);yn(i,y)}function F(i,u){const p=c.value[i]??[],y=Ni(p,u);xr(i,y)}function X(i,u){if(!i)return;const p=u.trim(),y=s.value[i]??"";if(p.length===0){if(!y)return;s.value=St(s.value,i);return}y!==p&&(s.value={...s.value,[i]:p})}function Ie(i,u){if(!i)return;const p=s.value[i]??"";X(i,`${p}${u}`)}function lt(i){i&&i in s.value&&(s.value=St(s.value,i))}function Ct(i){i&&i in a.value&&(a.value=St(a.value,i))}function Zt(i){i&&i in c.value&&(c.value=St(c.value,i))}function xt(i){i&&(Ct(i),lt(i),Nt(i,null),n.value,l.value[i]&&(l.value=St(l.value,i)),me.value[i]&&(me.value=St(me.value,i)),vr(i))}function wn(i){return i==="completed"?"completed":i==="inProgress"||i==="in_progress"?"inProgress":"pending"}function Tr(i){var p;const u=[];(p=i.explanation)!=null&&p.trim()&&u.push(i.explanation.trim());for(const y of i.steps){const E=y.status==="completed"?"x":y.status==="inProgress"?"~":" ";u.push(`- [${E}] ${y.step}`)}return u.join(`
|
|
52
|
-
`).trim()}function Qn(i){if(i.method!=="turn/plan/updated")return null;const u=qe(i.params),p=Ht(i),y=Ce(u==null?void 0:u.turnId)||Ce(u==null?void 0:u.turn_id),$=(Array.isArray(u==null?void 0:u.plan)?u==null?void 0:u.plan:[]).map(oe=>qe(oe)).map(oe=>({step:Ce(oe==null?void 0:oe.step),status:wn(oe==null?void 0:oe.status)})).filter(oe=>oe.step.length>0);if(!p||!y)return null;const G={explanation:Ce(u==null?void 0:u.explanation).trim()||void 0,steps:$,isStreaming:!0};return{threadId:p,message:{id:`${y}:plan`,role:"assistant",text:Tr(G),messageType:"plan.live",plan:G}}}function Xn(i){if(i.method!=="item/plan/delta")return null;const u=qe(i.params),p=Ht(i),y=Ce(u==null?void 0:u.turnId)||Ce(u==null?void 0:u.turn_id),E=Ce(u==null?void 0:u.delta);if(!p||!y||!E)return null;const $=`${y}:plan`,L=(a.value[p]??[]).find(he=>he.id===$),G=`${(L==null?void 0:L.text)??""}${E}`,oe=L!=null&&L.plan?{...L.plan,isStreaming:!0}:void 0;return{threadId:p,message:{id:$,role:"assistant",text:G,messageType:"plan.live",plan:oe}}}function qe(i){return i!==null&&typeof i=="object"&&!Array.isArray(i)?i:null}function Ce(i){return typeof i=="string"?i:""}function Lt(i){return typeof i=="number"&&Number.isFinite(i)?i:null}function bn(i){const u=qe(i);if(!u)return null;const p=Lt(u.totalTokens??u.total_tokens),y=Lt(u.inputTokens??u.input_tokens),E=Lt(u.cachedInputTokens??u.cached_input_tokens),$=Lt(u.outputTokens??u.output_tokens),L=Lt(u.reasoningOutputTokens??u.reasoning_output_tokens);return p===null||y===null||E===null||$===null||L===null?null:{totalTokens:p,inputTokens:y,cachedInputTokens:E,outputTokens:$,reasoningOutputTokens:L}}function Cn(i){const u=qe(i);if(!u)return null;const p=bn(u.total),y=bn(u.last);if(!p||!y)return null;const E=Lt(u.modelContextWindow??u.model_context_window),$=y.totalTokens,L=typeof E=="number"?Math.max(E-$,0):null,G=typeof E=="number"&&E>0?Qi(Math.round((L??0)/E*100),0,100):null;return{total:p,last:y,modelContextWindow:E,currentContextTokens:$,remainingContextTokens:L,remainingContextPercent:G}}function Xo(i){if(i.method!=="thread/tokenUsage/updated")return null;const u=qe(i.params),p=Ht(i),y=Cn((u==null?void 0:u.tokenUsage)??(u==null?void 0:u.token_usage));return!p||!y?null:{threadId:p,usage:y}}function Ht(i){const u=qe(i.params);if(!u)return"";const p=Ce(u.threadId);if(p)return p;const y=Ce(u.thread_id);if(y)return y;const E=Ce(u.conversationId);if(E)return E;const $=Ce(u.conversation_id);if($)return $;const L=qe(u.thread),G=Ce(L==null?void 0:L.id);if(G)return G;const oe=qe(u.turn),he=Ce(oe==null?void 0:oe.threadId);if(he)return he;const ze=Ce(oe==null?void 0:oe.thread_id);return ze||""}function dr(i){if(i.method!=="turn/completed")return"";const u=qe(i.params),p=qe(u==null?void 0:u.turn);if(!p||p.status!=="failed")return"";const y=qe(p.error);return Ce(y==null?void 0:y.message)}function $r(i){var y;if(i.method!=="error")return null;const u=qe(i.params),p=Ce(u==null?void 0:u.message)||Ce((y=qe(u==null?void 0:u.error))==null?void 0:y.message);return p?{message:p,transient:(u==null?void 0:u.willRetry)===!0}:null}function Nr(i){const u=qe(i);if(!u)return null;const p=u.id,y=Ce(u.method),E=u.params;if(typeof p!="number"||!Number.isInteger(p)||!y)return null;const $=qe(E),L=to(y,$),G=Ce($==null?void 0:$.threadId)||Ce($==null?void 0:$.thread_id)||Ce($==null?void 0:$.conversationId)||Ce($==null?void 0:$.conversation_id)||Oa,oe=Ce($==null?void 0:$.turnId)||Ce($==null?void 0:$.turn_id),he=Ce($==null?void 0:$.itemId)||Ce($==null?void 0:$.item_id)||Ce($==null?void 0:$.callId)||Ce($==null?void 0:$.call_id),ze=Ce(u.receivedAtIso)||new Date().toISOString();return{id:p,method:L,threadId:G,turnId:oe,itemId:he,receivedAtIso:ze,params:E??null}}function to(i,u){const p=i.trim();return p&&(p==="item/commandExecution/requestApproval"||p==="execCommandApproval"||p==="exec_approval_request"||no(u)?"item/commandExecution/requestApproval":p==="item/fileChange/requestApproval"||p==="applyPatchApproval"||p==="apply_patch_approval_request"||w(u)?"item/fileChange/requestApproval":p==="item/tool/requestUserInput"||p==="request_user_input"||_(u)?"item/tool/requestUserInput":p==="mcpServer/elicitation/request"||p==="elicitation_request"||W(u)?"mcpServer/elicitation/request":p==="item/permissions/requestApproval"||Fe(u)?"item/permissions/requestApproval":p==="item/tool/call"||p==="dynamic_tool_call_request"||T(u)?"item/tool/call":p)}function no(i){if(!i)return!1;const u=i.command;return Array.isArray(u)&&u.some(p=>typeof p=="string"&&p.trim().length>0)||typeof u=="string"&&u.trim().length>0?!0:Array.isArray(i.commandActions)}function w(i){return i?typeof i.grantRoot=="string"&&i.grantRoot.trim().length>0||typeof i.grant_root=="string"&&i.grant_root.trim().length>0||qe(i.fileChanges)?!0:qe(i.changes)!==null:!1}function _(i){return!!(i&&Array.isArray(i.questions))}function T(i){return i?typeof i.toolName=="string"||typeof i.tool_name=="string"||typeof i.name=="string"||Array.isArray(i.arguments):!1}function W(i){if(!i)return!1;const u=Ce(i.mode);return typeof i.serverName=="string"&&typeof i.threadId=="string"&&typeof i.message=="string"&&(u==="form"||u==="url")}function Fe(i){return i?typeof i.threadId=="string"&&typeof i.turnId=="string"&&typeof i.itemId=="string"&&qe(i.permissions)!==null:!1}function yt(i){if(i.method!=="item/tool/requestUserInput")return[];const u=qe(i.params),p=Array.isArray(u==null?void 0:u.questions)?u.questions:[],y=[];for(const E of p){const $=qe(E),L=Ce($==null?void 0:$.id).trim();L&&y.push(L)}return y}function vt(i){const u=i.threadId||Oa,p=Le.value[u]??[],y=p.findIndex($=>$.id===i.id),E=[...p];y>=0?E.splice(y,1,i):E.push(i),Le.value={...Le.value,[u]:E.sort(($,L)=>$.receivedAtIso.localeCompare(L.receivedAtIso))},Dt()}function _n(i){const u={};for(const[p,y]of Object.entries(Le.value)){const E=y.filter($=>$.id!==i);E.length>0&&(u[p]=E)}Le.value=u,Dt()}function Ln(i){const u={};for(const p of i){const y=p.threadId||Oa,E=u[y]??[];E.push(p),u[y]=E}for(const p of Object.values(u))p.sort((y,E)=>y.receivedAtIso.localeCompare(E.receivedAtIso));Le.value=u}function Zn(i){if(i.method==="server/request"){const u=Nr(i.params);return u&&vt(u),!0}if(i.method==="server/request/resolved"){const u=qe(i.params),p=u==null?void 0:u.id;return typeof p=="number"&&Number.isInteger(p)&&_n(p),!0}return!1}function Or(i){return i.replace(/\s+/gu," ").trim()}function Dr(i){const u=Ht(i);if(!u)return null;if(i.method==="turn/started")return{threadId:u,activity:{label:"Thinking",details:[]}};if(i.method==="item/started"){const p=qe(i.params),y=qe(p==null?void 0:p.item),E=Ce(y==null?void 0:y.type).toLowerCase();if(E==="reasoning")return{threadId:u,activity:{label:"Thinking",details:[]}};if(E==="agentmessage")return{threadId:u,activity:{label:"Writing response",details:[]}};if(E==="commandexecution"){const $=Ce(y==null?void 0:y.command);return{threadId:u,activity:{label:"Running command",details:$?[$]:[]}}}if(E==="filechange"){const L=(Array.isArray(y==null?void 0:y.changes)?y.changes:[])[0],G=Ce(L==null?void 0:L.path);return{threadId:u,activity:{label:"Applying changes",details:G?[G]:[]}}}}return i.method==="item/commandExecution/outputDelta"?{threadId:u,activity:{label:"Running command",details:[]}}:i.method==="item/fileChange/outputDelta"?{threadId:u,activity:{label:"Applying changes",details:[]}}:i.method==="item/reasoning/summaryTextDelta"||i.method==="item/reasoning/summaryPartAdded"?{threadId:u,activity:{label:"Thinking",details:[]}}:i.method==="item/agentMessage/delta"?{threadId:u,activity:{label:"Writing response",details:[]}}:null}function Zo(i){if(i.method!=="turn/started")return null;const u=qe(i.params);if(!u)return null;const p=Ht(i);if(!p)return null;const y=qe(u.turn),E=Ce(y==null?void 0:y.id)||Ce(u.turnId)||`${p}:unknown`;if(!E)return null;const $=Uo(Ce(y==null?void 0:y.startedAt))??Uo(Ce(u.startedAt))??Uo(i.atIso)??Date.now();return{threadId:p,turnId:E,startedAtMs:$}}function Oo(i){if(i.method!=="turn/completed")return null;const u=qe(i.params);if(!u)return null;const p=Ht(i);if(!p)return null;const y=qe(u.turn),E=Ce(y==null?void 0:y.id)||Ce(u.turnId)||`${p}:unknown`;if(!E)return null;const $=Uo(Ce(y==null?void 0:y.completedAt))??Uo(Ce(u.completedAt))??Uo(i.atIso)??Date.now(),L=Uo(Ce(y==null?void 0:y.startedAt))??Uo(Ce(u.startedAt))??void 0;return{threadId:p,turnId:E,completedAtMs:$,startedAtMs:L}}function Sa(i){return`${i}:live-reasoning`}function ti(i){const u=r.value[i]??[];let p=-1;for(const y of u)typeof y.turnIndex=="number"&&Number.isFinite(y.turnIndex)&&(p=Math.max(p,y.turnIndex));return p+1}function xn(i,u,p){if(!i||!u||!Number.isInteger(p)||p<0)return;const y=Re.value[i]??{};y[u]!==p&&(Re.value={...Re.value,[i]:{...y,[u]:p}})}function ml(i,u){const p=Re.value[i]??{},y=Object.entries(p),E=Object.entries(u);y.length===E.length&&y.every(([$,L])=>u[$]===L)||(Re.value={...Re.value,[i]:{...u}})}function is(i){const u=c.value[i];if(!u||u.length===0)return;const p=Re.value[i]??{};let y=!1;const E=u.map($=>{if(typeof $.turnIndex=="number"||!$.turnId)return $;const L=p[$.turnId];return typeof L!="number"?$:(y=!0,{...$,turnIndex:L})});y&&(c.value={...c.value,[i]:E})}function ka(i){const u=qe(i.params);if(!u)return"";if(i.method==="item/started"){const p=qe(u.item);return!p||p.type!=="reasoning"?"":Ce(p.id)}return""}function gl(i){const u=qe(i.params);if(!u)return null;if(i.method==="item/reasoning/summaryTextDelta"){const p=Ce(u.itemId),y=Ce(u.delta);return!p||!y?null:{messageId:Sa(p),delta:y}}return null}function ni(i){const u=qe(i.params);if(!u)return"";if(i.method==="item/reasoning/summaryPartAdded"){const p=Ce(u.itemId);return p?Sa(p):""}return""}function ls(i){const u=qe(i.params);if(!u)return"";if(i.method==="item/completed"){const p=qe(u.item);return!p||p.type!=="reasoning"?"":Sa(Ce(p.id))}return""}function vl(i){const u=qe(i.params);if(!u)return"";if(i.method==="item/started"){const p=qe(u.item);return!p||p.type!=="agentMessage"?"":Ce(p.id)}return""}function us(i){const u=qe(i.params);if(!u)return null;if(i.method==="item/agentMessage/delta"){const p=Ce(u.itemId),y=Ce(u.delta);return!p||!y?null:{messageId:p,delta:y}}return null}function Ca(i){const u=qe(i.params);if(!u)return null;if(i.method==="item/completed"){const p=qe(u.item);if(!p||p.type!=="agentMessage")return null;const y=Ce(p.id),E=Ce(p.text);return!y||!E?null:{id:y,role:"assistant",text:E,messageType:"agentMessage.live"}}return null}function yl(i){return`/codex-local-image?path=${encodeURIComponent(i)}`}function ri(i){const u=i.trim();if(!u)return"";if(u.startsWith("data:")||u.startsWith("http://")||u.startsWith("https://")||u.startsWith("/codex-local-image?"))return u;const p=u.replace(/\s+/gu,"");return/^[A-Za-z0-9+/]+={0,2}$/u.test(p)?`data:image/png;base64,${p}`:""}function wl(i){if(i.method!=="item/completed")return null;const u=qe(i.params),p=qe(u==null?void 0:u.item);if(!p)return null;const y=Ce(p.id);if(!y)return null;if(p.type==="imageView"){const L=Ce(p.path);return L?{id:y,role:"assistant",text:"",images:[yl(L)],messageType:"imageView"}:null}if(p.type!=="imageGeneration"&&p.type!=="image_generation")return null;const E=Ce(p.result),$=E?ri(E):"";return $?{id:y,role:"assistant",text:"",images:[$],messageType:"imageView"}:null}function oi(i){var he;if(i.method!=="item/started")return null;const u=qe(i.params),p=qe(u==null?void 0:u.item);if(!p||p.type!=="commandExecution")return null;const y=Ce(p.id),E=Ce(p.command);if(!y)return null;const $=typeof p.cwd=="string"?p.cwd:null,L=Ht(i),G=Ce(u==null?void 0:u.turnId)||Ce(u==null?void 0:u.turn_id),oe=L&&G?(he=Re.value[L])==null?void 0:he[G]:void 0;return{id:y,role:"system",text:E,messageType:"commandExecution",commandExecution:{command:E,cwd:$,status:"inProgress",aggregatedOutput:"",exitCode:null},turnId:G||void 0,turnIndex:typeof oe=="number"?oe:void 0}}function bl(i){if(i.method!=="item/commandExecution/outputDelta")return null;const u=qe(i.params);if(!u)return null;const p=Ce(u.itemId),y=Ce(u.delta);return!p||!y?null:{itemId:p,delta:y}}function _l(i){var wt;if(i.method!=="item/completed")return null;const u=qe(i.params),p=qe(u==null?void 0:u.item);if(!p||p.type!=="commandExecution")return null;const y=Ce(p.id),E=Ce(p.command);if(!y)return null;const $=typeof p.cwd=="string"?p.cwd:null,L=Ce(p.status),G=L==="failed"?"failed":L==="declined"?"declined":L==="interrupted"?"interrupted":"completed",oe=typeof p.aggregatedOutput=="string"?p.aggregatedOutput:"",he=typeof p.exitCode=="number"?p.exitCode:null,ze=Ht(i),pt=Ce(u==null?void 0:u.turnId)||Ce(u==null?void 0:u.turn_id),mt=ze&&pt?(wt=Re.value[ze])==null?void 0:wt[pt]:void 0;return{id:y,role:"system",text:E,messageType:"commandExecution",commandExecution:{command:E,cwd:$,status:G,aggregatedOutput:oe,exitCode:he},turnId:pt||void 0,turnIndex:typeof mt=="number"?mt:void 0}}function Tl(i){var he;if(i.method!=="item/completed")return null;const u=qe(i.params),p=qe(u==null?void 0:u.item);if(!p||p.type!=="fileChange")return null;const y=Ce(p.id);if(!y)return null;const E=Ce(u==null?void 0:u.threadId),$=Ce(u==null?void 0:u.turnId),L=E&&$?(he=Re.value[E])==null?void 0:he[$]:void 0,G=Cp(p.changes),oe=kp(p.status);return G.length===0||oe!=="completed"?null:{id:y,role:"system",text:"",messageType:"fileChange",fileChangeStatus:oe,fileChanges:G,turnId:$||void 0,turnIndex:typeof L=="number"?L:void 0}}function ea(i,u){const p=l.value[i]??[],y=Ni(p,u);y!==p&&(l.value={...l.value,[i]:y})}function cs(i,u){const p=l.value[i];if(!p||p.length===0)return;const y=new Set(u.map($=>$.id)),E=p.filter($=>!y.has($.id));E.length!==p.length&&(E.length===0?l.value=St(l.value,i):l.value={...l.value,[i]:E})}function ai(i,u){const p=c.value[i];if(!p||p.length===0)return;const y=new Set(u.map(G=>G.id)),E=new Set(u.filter(G=>G.messageType==="fileChange"&&typeof G.turnId=="string"&&G.turnId.length>0).map(G=>G.turnId)),$=new Set(u.filter(G=>G.messageType==="fileChange"&&typeof G.turnIndex=="number").map(G=>G.turnIndex)),L=p.filter(G=>!y.has(G.id)&&!(G.turnId&&E.has(G.turnId))&&!(typeof G.turnIndex=="number"&&$.has(G.turnIndex)));L.length!==p.length&&(L.length===0?c.value=St(c.value,i):c.value={...c.value,[i]:L})}function Sl(i){if(i.method==="item/agentMessage/delta")return!0;const u=qe(i.params);if(!u)return!1;if(i.method==="item/completed"){const p=qe(u.item);return(p==null?void 0:p.type)==="agentMessage"}return!1}function kl(i){var Ia,wi,_s,bi,la;if(Zn(i))return;if(i.method==="account/rateLimits/updated"&&Qr(),i.method==="thread/name/updated"){const tt=qe(i.params),hr=Ce(tt==null?void 0:tt.threadId),ao=Ce(tt==null?void 0:tt.threadName);hr&&ao&&(K.value={...K.value,[hr]:ao},Dt(),_u(hr,ao))}if(i.method==="account/rateLimits/updated"){Jr(Ip(i.params));return}const u=Xo(i);if(u){Gt(u.threadId,u.usage);return}const p=Dr(i);p&&Nt(p.threadId,p.activity);const y=Ht(i),E=$r(i);!E&&y&&vo(y);const $=Zo(i);$&&(pr.set($.turnId,$),xn($.threadId,$.turnId,ti($.threadId)),me.value={...me.value,[$.threadId]:$.turnId},_r($.threadId,$.turnId),Ct($.threadId),Zt($.threadId),rn($.threadId,null),It($.threadId,null),Tt($.threadId,!0),x.value[$.threadId]&&(x.value=St(x.value,$.threadId)));const L=Oo(i),G=dr(i),oe=(L==null?void 0:L.threadId)??Ht(i),he=oe?Wt(oe):"",ze=!!oe&&!!G&&he!==Lr&&$i(new Error(G));if(L){ft.value[L.threadId];const tt=pr.get(L.turnId);tt&&pr.delete(L.turnId);const hr=Lt((Ia=qe(i.params))==null?void 0:Ia.durationMs)??Lt((_s=qe((wi=qe(i.params))==null?void 0:wi.turn))==null?void 0:_s.durationMs)??(typeof L.startedAtMs=="number"?L.completedAtMs-L.startedAtMs:null)??(tt?L.completedAtMs-tt.startedAtMs:null),ao=typeof hr=="number"?Math.max(0,hr):0;rn(L.threadId,{turnId:L.turnId,durationMs:ao}),me.value[L.threadId]&&(me.value=St(me.value,L.threadId)),Tt(L.threadId,!1),Nt(L.threadId,null),vn(L.threadId),ze||(vr(L.threadId),aa(L.threadId))}if(G){const tt=(L==null?void 0:L.threadId)||Ht(i);tt&&It(tt,G),J.value=G,tt&&ze&&lr(tt)}else L&&It(L.threadId,null);if(E){const tt=y,hr=tt?Wt(tt):V.value.trim();tt&&It(tt,E.message,{transient:E.transient}),J.value=E.message,hr!==Lr&&$i(new Error(E.message))&&(tt?lr(tt):tn())}const pt=Qn(i);pt&&(Ar(pt.threadId,pt.message),Nt(pt.threadId,{label:"Planning",details:((bi=pt.message.plan)==null?void 0:bi.steps.map(tt=>tt.step).slice(0,2))??[]}));const mt=Xn(i);if(mt&&(Ar(mt.threadId,mt.message),Nt(mt.threadId,{label:"Planning",details:[]})),!y||y!==n.value)return;vl(i);const wt=us(i);if(wt){const tt=(o.value[y]??[]).find(ao=>ao.id===wt.messageId),hr=`${(tt==null?void 0:tt.text)??""}${wt.delta}`;A(y,{id:wt.messageId,role:"assistant",text:hr,messageType:"agentMessage.live"})}const Jt=Ca(i);Jt&&A(y,Jt);const oo=wl(i);oo&&A(y,oo),ka(i);const Ea=gl(i);if(Ea&&Ie(y,Ea.delta),ni(i)){const tt=s.value[y]??"";tt.trim().length>0&&!tt.endsWith(`
|
|
53
|
-
|
|
54
|
-
`)&&X(y,`${tt}
|
|
55
|
-
|
|
56
|
-
`)}ls(i);const sa=oi(i);sa&&(ea(y,sa),Nt(y,{label:"Running command",details:[((la=sa.commandExecution)==null?void 0:la.command)??""]}));const Do=bl(i);if(Do){const tt=(l.value[y]??[]).find(hr=>hr.id===Do.itemId);tt!=null&&tt.commandExecution&&ea(y,{...tt,commandExecution:{...tt.commandExecution,aggregatedOutput:`${tt.commandExecution.aggregatedOutput}${Do.delta}`}})}const ia=_l(i);ia&&ea(y,ia);const bs=Tl(i);if(bs&&F(y,bs),Sl(i)&&(Bt&&n.value&&on(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),lt(y)),i.method==="turn/completed"){Bt=!1,lt(y),l.value[y]&&(l.value=St(l.value,y));const tt=Ht(i);tt&&(Tt(tt,!1),Nt(tt,null),vn(tt),ze||(vr(tt),aa(tt)))}}function si(i){if(i.method==="thread/tokenUsage/updated")return;const u=i.method,p=u==="turn/started"||u==="turn/completed"||u==="error",y=u.startsWith("thread/")||u==="turn/completed";if(!p&&!y)return;const E=Ht(i);E&&p&&de.add(E),y&&(Q=!0),!(ge!==null||typeof window>"u")&&(ge=window.setTimeout(()=>{ge=null,fr()},Cu))}async function ii(i,u){if(!Wr){Wr=!0;try{if(!u)return;const p=[];for(const y of u.order){const E=Bo(y);p.includes(E)||p.push(E)}if(p.length>0){const y=Ri(p,i);Vo(Y.value,y)||(Y.value=y,Da(Y.value))}if(Object.keys(u.labels).length>0){const y={...Ee.value};let E=!1;for(const[$,L]of Object.entries(u.labels)){const G=Bo($);y[G]!==L&&(y[G]=L,E=!0)}E&&(Ee.value=y,Eu(y))}}catch{}}}async function Cl(){if(!(Object.keys(K.value).length>0))try{const i=await y0();Object.keys(i.titles).length>0&&(K.value=i.titles)}catch{}}async function ta(){try{return await Fa()}catch{return null}}async function xl(i,u,p){if(K.value[i])return;const y=u.trim();if(!y)return;const E=y.length>300?y.slice(0,300):y;try{const $=await S0(E,p);if(!$||K.value[i])return;K.value={...K.value,[i]:$},Dt(),_u(i,$)}catch{}}function Al(i,u){if(!u||u.order.length===0)return i;const p=new Set(u.order.map(y=>Bo(y)));return i.filter(y=>p.has(y.projectName)?!0:y.threads.some(E=>Ji(E.cwd)))}function ds(i,u){const p=Al(i,u),y=Ri(Y.value,p);Vo(Y.value,y)||(Y.value=y,Da(Y.value));const E=Iu(p,Y.value);Xr(new Set(Sr(E).map(L=>L.id)));const $=rA(t.value,E,f.value);t.value=Oi(t.value,$),f.value=Yt(f.value,new Set(Sr(t.value).map(L=>L.id))),Dt()}function fs(i){const u={};for(const[p,y]of Object.entries(i)){const E=p.trim();!E||y.length===0||(u[E]=y.map($=>({id:$.id,text:$.text,imageUrls:[...$.imageUrls],skills:$.skills.map(L=>({name:L.name,path:L.path})),fileAttachments:$.fileAttachments.map(L=>({label:L.label,path:L.path,fsPath:L.fsPath})),collaborationMode:$.collaborationMode})))}return u}function Er(){o0(fs(h.value)).catch(()=>{})}async function El(){if(!b){b=!0;try{h.value=await yf()}catch{}}}function hs(i,u){if(i.length===0)return u;if(u.length===0)return i;const p=new Map;for(const E of Sr(i))p.set(E.id,E);for(const E of Sr(u))p.set(E.id,E);const y=new Map;for(const E of p.values()){const $=y.get(E.projectName);$?$.push(E):y.set(E.projectName,[E])}return Array.from(y.entries()).map(([E,$])=>({projectName:E,threads:$.sort((L,G)=>new Date(G.updatedAtIso).getTime()-new Date(L.updatedAtIso).getTime())})).sort((E,$)=>{var oe,he;const L=new Date(((oe=E.threads[0])==null?void 0:oe.updatedAtIso)??0).getTime();return new Date(((he=$.threads[0])==null?void 0:he.updatedAtIso)??0).getTime()-L})}function na(){return Object.values(f.value).some(i=>i===!0)}function ps(i=In){if(!(!je||Me||na())){if(In=i,typeof window>"u"){ro(i);return}Qe!==null&&window.clearTimeout(Qe),Qe=window.setTimeout(()=>{Qe=null,!(!je||na())&&ro(In)},Sx)}}async function ro(i){if(!(Me||!je||na())){Me=!0;try{const u=await uf(je,Sb());je=u.nextCursor,bt=u.nextCursor===null,Sn=hs(Sn,u.groups),ds(Sn,i)}catch{}finally{Me=!1,je&&!na()&&ps(i)}}}async function ra(){if(Ze){await Ze;return}Ze=(async()=>{var i;fe.value||(Oe.value=!0);try{const[u,p]=await Promise.all([uf(),ta(),Cl()]);In=p;const y=u.groups;Sn=fe.value?hs(Sn,y):y,je=fe.value&&!bt?je:u.nextCursor,bt=u.nextCursor===null,await ii(y,p),ds(Sn,p),fe.value=!0,bt||ps(p);const E=Sr(e.value);Kt(E),!E.some(L=>L.id===n.value)&&!n.value&&qt(((i=E[0])==null?void 0:i.id)??"")}finally{Oe.value=!1}})().finally(()=>{Ze=null}),await Ze}async function Ir(i,u={}){if(!i)return;const p=D.get(i);if(p){await p;return}const y=ee.value[i]===!0,E=u.silent!==!0&&!y;E&&(Je.value=!0);const $=(async()=>{try{const L=_t(i),G=He.value[i]??"",oe=Date.now()-(Pe.get(i)??0)<xx;if(y&&(oe||(L.length===0||G===L)&&f.value[i]!==!0)){br(i);return}const pt=we.value[i]!==!0?await gu(i):null,mt=pt??await cf(i);pt&&(Et(i,pt.model),we.value={...we.value,[i]:!0});const{messages:wt,inProgress:Jt,activeTurnId:oo,turnIndexByTurnId:Ea}=mt;Cr(i,wt),ml(i,Ea),is(i);const ws=r.value[i]??[],sa=zx(ws,wt,{preserveMissing:u.silent===!0});kn(i,sa);const Do=o.value[i]??[];if(Jt){const ia=Wx(Do,wt);yn(i,ia)}else Yn(i);cs(i,wt),ai(i,wt),ee.value={...ee.value,[i]:!0},Pe.set(i,Date.now()),L&&(He.value={...He.value,[i]:L}),Tt(i,Jt),oo?me.value={...me.value,[i]:oo}:me.value[i]&&(me.value=St(me.value,i)),Jt||xt(i),br(i)}finally{E&&(Je.value=!1)}})().finally(()=>{D.delete(i)});D.set(i,$),await $}async function li(i,u={}){i&&ee.value[i]!==!0&&await Ir(i,u)}async function ms(){if(U){await U;return}U=(async()=>{var i,u;try{const p=((u=(i=kr.value)==null?void 0:i.cwd)==null?void 0:u.trim())??"";_e.value=await C0(p?[p]:void 0)}catch{}finally{U=null}})(),await U}async function ui(i={}){await Promise.allSettled([yr({providerChanged:i.providerChanged,includeProviderModels:i.includeProviderModels}),nn(),$n(),ms()])}function Il(i={}){const u=()=>{ui(i)};if(typeof window>"u"){u();return}window.setTimeout(u,0)}async function ci(i={}){J.value="";const u=i.includeSelectedThreadMessages!==!1,p=i.awaitAncillaryRefreshes===!0;try{await El(),await ra(),u&&await Ir(n.value),p?await ui({providerChanged:i.providerChanged,includeProviderModels:i.providerChanged===!0||p}):Il({providerChanged:i.providerChanged,includeProviderModels:!1})}catch(y){J.value=y instanceof Error?y.message:"Unknown application error"}}async function Pl(i){qt(i);try{await Ir(i),ms()}catch(u){J.value=u instanceof Error?u.message:"Unknown application error"}}async function Ml(i){try{await Bb(i),await ra(),n.value===i&&await Ir(n.value)}catch(u){J.value=u instanceof Error?u.message:"Unknown application error"}}async function di(i,u){const p=u.trim();if(!(!i||!p))try{await qb(i,p),K.value={...K.value,[i]:p},Dt(),_u(i,p)}catch(y){J.value=y instanceof Error?y.message:"Unknown application error"}}async function Rl(i){var L,G;const u=i.trim();if(!u)return"";const p=Sr(t.value).find(oe=>oe.id===u),y=((L=p==null?void 0:p.cwd)==null?void 0:L.trim())??"",E=((G=p==null?void 0:p.title)==null?void 0:G.trim())??"Forked chat",$=Wt(u);J.value="";try{const oe=await pf(u,y||void 0,$||void 0),he=oe.threadId.trim();return he?(Nn(he,y,E),Et(he,oe.model),we.value={...we.value,[he]:!0},qt(he),await ra(),await Ir(he),he):""}catch(oe){return J.value=oe instanceof Error?oe.message:"Unknown application error",""}}async function $l(i,u){var L;const p=i.trim();if(!p||!Number.isInteger(u)||u<0)return"";if(f.value[p]===!0)return J.value="Finish the current turn before forking from a response.","";if(ee.value[p]!==!0)try{await Ir(p)}catch(G){return J.value=G instanceof Error?G.message:"Unknown application error",""}const y=r.value[p]??[];let E=-1;for(const G of y)typeof G.turnIndex=="number"&&Number.isFinite(G.turnIndex)&&(E=Math.max(E,G.turnIndex));if(E>=0&&u>E)return"";const $=Sr(t.value).find(G=>G.id===p)??null;try{J.value="";const G=await pf(p),oe=G.threadId.trim();if(!oe)return"";const he=G.cwd.trim()||((L=$==null?void 0:$.cwd)==null?void 0:L.trim())||"",ze=aA(($==null?void 0:$.title)||($==null?void 0:$.preview)||"Untitled thread");Nn(oe,he,ze),Et(oe,G.model),kn(oe,G.messages),ee.value={...ee.value,[oe]:!0},we.value={...we.value,[oe]:!0},Ct(oe),yn(oe,[]),lt(oe),l.value[oe]&&(l.value=St(l.value,oe)),rn(oe,null),Nt(oe,null),It(oe,null),Tt(oe,!1);const pt=E-u;if(pt>0){const mt=await vu(oe,pt);kn(oe,mt)}return await di(oe,ze),qt(oe),ra().catch(()=>{}),oe}catch(G){return J.value=G instanceof Error?G.message:"Unknown application error",""}}async function fi(i,u,p=[],y=[],E=[]){if(!i||!u.trim()||p.length>0||y.length>0||E.length>0)return!1;const L=(Le.value[i]??[]).filter(he=>he.method==="item/tool/requestUserInput");if(L.length!==1)return!1;const[G]=L,oe=yt(G);return oe.length!==1?!1:vi({id:G.id,result:{answers:{[oe[0]]:{answers:[u.trim()]}}}})}async function hi(i,u=[],p=[],y="steer",E=[],$,L){if(H.value)return;const G=n.value,oe=i.trim();if(!G||!oe&&u.length===0&&E.length===0||await fi(G,oe,u,p,E))return;const he=f.value[G]===!0;if(he&&y==="queue"){const ze=h.value[G]??[],pt=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,mt=[...ze],wt=typeof $=="number"?Math.max(0,Math.min($,mt.length)):mt.length;mt.splice(wt,0,{id:pt,text:oe,imageUrls:u,skills:p,fileAttachments:E,collaborationMode:L==="plan"?"plan":L==="default"?"default":O.value}),h.value={...h.value,[G]:mt},Er();return}if(he){Bt=!0,xa(G,oe,u,p,E,L).catch(ze=>{const pt=ze instanceof Error?ze.message:"Unknown application error";It(G,pt),J.value=pt});return}J.value="",Bt=!0,rn(G,null),Nt(G,{label:"Thinking",details:sn(Wt(G),Z.value,L==="plan"?"plan":L==="default"?"default":O.value)}),It(G,null),Tt(G,!0);try{await xa(G,oe,u,p,E,L)}catch(ze){Bt=!1,Tt(G,!1),Nt(G,null);const pt=ze instanceof Error?ze.message:"Unknown application error";throw It(G,pt),J.value=pt,ze}}async function oa(i,u,p=[],y=[],E=[]){if(H.value)return"";const $=i.trim(),L=u.trim(),G=Wt(xo).trim(),oe=As(te.value,xo);if(!$&&p.length===0&&E.length===0)return"";k.value=!0,J.value="";let he="";try{try{const wt=await hf(L||void 0,G||void 0);he=wt.threadId,Et(he,wt.model),ir(he,oe)}catch(wt){if(G&&G!==Lr&&$i(wt)){await tn();const Jt=await hf(L||void 0,Lr);he=Jt.threadId,Et(he,Jt.model),ir(he,oe)}else throw wt}if(!he)return"";Nn(he,L,$||"[Image]"),cr(he),we.value={...we.value,[he]:!0},qt(he),Bt=!0,rn(he,null),Nt(he,{label:"Thinking",details:sn(Wt(he),Z.value,oe)}),It(he,null),Tt(he,!0);const ze=he,pt=L||null,mt=$;return xa(he,$,p,y,E,oe).catch(wt=>{Bt=!1,Tt(he,!1),Nt(he,null);const Jt=wt instanceof Error?wt.message:"Unknown application error";It(he,Jt),J.value=Jt}).finally(()=>{k.value=!1}),xl(ze,mt,pt),he}catch(ze){Bt=!1,he&&(Tt(he,!1),Nt(he,null));const pt=ze instanceof Error?ze.message:"Unknown application error";throw he&&It(he,pt),J.value=pt,k.value=!1,ze}}async function xa(i,u,p=[],y=[],E=[],$){const L=Z.value,G=$==="plan"?"plan":$==="default"?"default":O.value,oe=u.trim(),he=[...p];if(he.length===0&&pe(oe)){const mt=ce(i);mt&&he.push(mt)}const ze=y.map(mt=>({name:mt.name,path:mt.path})),pt=E.map(mt=>({...mt}));Rn(i,{text:oe,imageUrls:[...he],skills:ze,fileAttachments:pt,effort:L,collaborationMode:G,fallbackRetried:!1});try{if(we.value[i]!==!0){const Jt=await gu(i);Et(i,Jt.model)}const mt=Wt(i);let wt="";try{wt=await yu(i,u,he,mt||void 0,L||void 0,y.length>0?y:void 0,E,G)}catch(Jt){if(mt&&mt!==Lr&&$i(Jt))await tn(i),Rn(i,{text:oe,imageUrls:[...he],skills:ze,fileAttachments:pt,effort:L,collaborationMode:G,fallbackRetried:!0}),wt=await yu(i,u,he,Lr,L||void 0,y.length>0?y:void 0,E,G);else throw Jt}wt&&(me.value={...me.value,[i]:wt},_r(i,wt)),we.value={...we.value,[i]:!0},de.add(i),await fr(),No(i)}catch(mt){throw mt}}async function aa(i){if(g.value[i]!==!0){g.value={...g.value,[i]:!0};try{h.value=await yf()}catch{}finally{g.value=St(g.value,i)}}}async function pi(){const i=n.value;if(!i||f.value[i]!==!0||We.value[i]===!0)return;let u=me.value[i];if(!u){const{activeTurnId:p}=await cf(i);u=p,u&&(me.value={...me.value,[i]:u})}if(!u)throw new Error("Could not determine active turn id for interrupt");I.value=!0,J.value="";try{await Kb(i,u),Tt(i,!1),Nt(i,null),It(i,null),me.value[i]&&(me.value=St(me.value,i)),de.add(i),Q=!0,await fr()}catch(p){const y=p instanceof Error?p.message:"Failed to interrupt active turn";It(i,y),J.value=y}finally{I.value=!1}}async function Nl(i){var G,oe;const u=n.value;if(!u||re.value||!i.trim())return;const p=r.value[u]??[],y=p.find(he=>he.turnId===i),E=typeof(y==null?void 0:y.turnIndex)=="number"?y.turnIndex:-1;if(E<0)return;const $=p.reduce((he,ze)=>typeof ze.turnIndex=="number"&&ze.turnIndex>he?ze.turnIndex:he,-1);if($<0||E>$)return;const L=$-E+1;if(!(L<1)){re.value=!0,J.value="";try{const he=((oe=(G=kr.value)==null?void 0:G.cwd)==null?void 0:oe.trim())??"";he&&await Hb(u,i,he);const ze=await vu(u,L);kn(u,ze),yn(u,[]),lt(u),l.value[u]&&(l.value=St(l.value,u)),rn(u,null),Nt(u,null),It(u,null),Q=!0,await fr()}catch(he){J.value=he instanceof Error?he.message:"Failed to rollback thread"}finally{re.value=!1}}}let Aa=null;async function Ol(i,u){try{const p=await Fa(),y={...p.labels};let E=!1;for(const $ of p.order){if(Bo($)!==i)continue;const L=u.trim();L.length===0?y[$]!==void 0&&(delete y[$],E=!0):y[$]!==L&&(y[$]=L,E=!0)}E&&await wu({order:p.order,labels:y,active:p.active})}catch{}}function Dl(i,u){i.length===0||(Ee.value[i]??"")===u||(Ee.value={...Ee.value,[i]:u},Eu(Ee.value),Aa!==null&&clearTimeout(Aa),Aa=setTimeout(()=>{Aa=null,Ol(i,u)},500))}async function Ll(i){var $;if(i.length===0)return;const u=Y.value.filter(L=>L!==i);if(Vo(Y.value,u)||(Y.value=u,Da(Y.value)),t.value=t.value.filter(L=>L.projectName!==i),Ee.value[i]!==void 0){const L={...Ee.value};delete L[i],Ee.value=L,Eu(L)}Dt();const p=Sr(e.value);Kt(p),p.some(L=>L.id===n.value)||qt((($=p[0])==null?void 0:$.id)??"");const E=new Set;try{const L=await Fa();for(const G of L.order)Bo(G)===i&&E.add(G);for(const G of L.active)Bo(G)===i&&E.add(G);for(const G of Object.keys(L.labels))Bo(G)===i&&E.add(G)}catch{}if(E.size>0)try{const L=await Fa(),G=L.order.filter(ze=>!E.has(ze)),oe=L.active.filter(ze=>!E.has(ze)),he=oe.length===0&&G.length>0?[G[0]]:oe;await wu({order:G,labels:Zx(L.labels,E),active:he});return}catch{}await gs()}function jl(i,u){if(i.length===0||t.value.length===0)return;const p=t.value.map(oe=>oe.projectName),y=p.indexOf(i);if(y===-1)return;const E=Math.max(0,Math.min(u,p.length-1)),$=Ux(p,y,E);if($===p)return;const L=Ri($,t.value);Y.value=L,Da(Y.value);const G=Iu(t.value,Y.value);t.value=Oi(t.value,G),Dt(),gs()}function mi(i){const u=i.trim();if(!u)return;const p=[u,...Y.value.filter(E=>E!==u)];if(Vo(Y.value,p))return;Y.value=p,Da(Y.value);const y=Iu(t.value,Y.value);t.value=Oi(t.value,y),Dt(),gs()}async function gs(){var i,u;try{const p=await Fa(),y=new Map;for(const L of p.order){const G=Bo(L);y.has(G)||y.set(G,L)}for(const L of t.value){const G=((u=(i=L.threads[0])==null?void 0:i.cwd)==null?void 0:u.trim())??"";G&&y.set(L.projectName,G)}const E=[];for(const L of Y.value){const G=y.get(L);G&&!E.includes(G)&&E.push(G)}for(const L of p.order)E.includes(L)||E.push(L);const $=p.active.filter(L=>E.includes(L));$.length===0&&E.length>0&&$.push(E[0]),await wu({order:E,labels:p.labels,active:$})}catch{}}async function fr(){if(ae.value){typeof window<"u"&&ge===null&&(ge=window.setTimeout(()=>{ge=null,fr()},Cu));return}ae.value=!0;const i=Q,u=new Set(de);Q=!1,de.clear();try{i&&await ra();const p=n.value;if(!p)return;const y=u.has(p),E=f.value[p]===!0,$=_t(p),L=He.value[p]??"";($.length>0&&$!==L||E&&ee.value[p]!==!0||y&&ee.value[p]!==!0||i&&ee.value[p]!==!0)&&await Ir(p,{silent:!0})}catch{}finally{ae.value=!1,(Q||de.size>0)&&typeof window<"u"&&ge===null&&(ge=window.setTimeout(()=>{ge=null,fr()},Cu))}}async function Fl(){await gi(),Q=!fe.value,n.value&&ee.value[n.value]!==!0&&de.add(n.value),await fr()}function Ul(){typeof window>"u"||$e||(gi(),$e=Mb(i=>{if(i.method==="ready"){Zr(),Fl();return}kl(i),si(i)}))}async function gi(){try{const u=(await Ob()).map(p=>Nr(p)).filter(p=>p!==null);Ln(u)}catch{}}async function vi(i){try{return await Nb(i.id,{result:i.result,error:i.error}),_n(i.id),!0}catch(u){return J.value=u instanceof Error?u.message:"Failed to reply to server request",!1}}function Bl(){if($e&&($e(),$e=null),Q=!1,de.clear(),pr.clear(),ge!==null&&typeof window<"u"&&(window.clearTimeout(ge),ge=null),ke!==null&&typeof window<"u"&&(window.clearTimeout(ke),ke=null),Qe!==null&&typeof window<"u"&&(window.clearTimeout(Qe),Qe=null),typeof window<"u")for(const i of De.values())window.clearTimeout(i);De.clear(),Bt=!1,r.value={},a.value={},o.value={},s.value={},l.value={},c.value={},Re.value={},Be.value={},Ke.value={},xe.value={},me.value={},We.value={},nt.value={},Ve.value={},h.value={},g.value={},Er(),ht.value=null,Xe.value={}}const yi=le(()=>{const i=n.value;return i?h.value[i]??[]:[]});function vs(i){const u=n.value;if(!u)return;const p=h.value[u];if(!p)return;const y=p.filter(E=>E.id!==i);h.value=y.length>0?{...h.value,[u]:y}:St(h.value,u),Er()}function ql(i,u){const p=n.value;if(!p)return;const y=h.value[p];if(!y)return;const E=y.findIndex(oe=>oe.id===i),$=y.findIndex(oe=>oe.id===u);if(E<0||$<0||E===$)return;const L=[...y],[G]=L.splice(E,1);L.splice($,0,G),h.value={...h.value,[p]:L},Er()}function Hl(i){const u=n.value;if(!u)return;const p=h.value[u];if(!p)return;const y=p.find(E=>E.id===i);y&&(vs(i),gr(y.collaborationMode),hi(y.text,y.imageUrls,y.skills,"steer",y.fileAttachments))}function ys(i){qt(i)}return{projectGroups:e,projectDisplayNameById:Ee,selectedThread:kr,selectedThreadTokenUsage:Wn,selectedThreadScrollState:mr,selectedThreadTerminalOpen:Vn,isSelectedThreadInterruptPending:Qt,selectedThreadServerRequests:Pn,selectedLiveOverlay:ut,codexQuota:Mn,selectedThreadId:n,availableCollaborationModes:q,availableModelIds:j,selectedCollaborationMode:O,selectedModelId:V,selectedReasoningEffort:Z,selectedSpeedMode:Ae,installedSkills:_e,accountRateLimitSnapshots:be,messages:Kr,isLoadingThreads:Oe,isLoadingMessages:Je,isSendingMessage:k,isInterruptingTurn:I,isUpdatingSpeedMode:H,isRollingBack:re,error:J,refreshAll:ci,refreshSkills:ms,selectThread:Pl,loadMessages:Ir,ensureThreadMessagesLoaded:li,setThreadScrollState:on,setThreadTerminalOpen:un,toggleSelectedThreadTerminal:Dn,archiveThreadById:Ml,renameThreadById:di,forkThreadById:Rl,forkThreadFromTurn:$l,rollbackSelectedThread:Nl,sendMessageToSelectedThread:hi,sendMessageToNewThread:oa,interruptSelectedThreadTurn:pi,selectedThreadQueuedMessages:yi,removeQueuedMessage:vs,reorderQueuedMessage:ql,steerQueuedMessage:Hl,setSelectedCollaborationMode:gr,readModelIdForThread:Wt,setSelectedModelIdForThread:Xt,setSelectedModelId:Ot,setSelectedReasoningEffort:Yr,updateSelectedSpeedMode:Kn,respondToPendingServerRequest:vi,renameProject:Dl,removeProject:Ll,reorderProject:jl,pinProjectToTop:mi,startPolling:Ul,stopPolling:Bl,primeSelectedThread:ys}}const iA={class:"sidebar-root"},lA={class:"sidebar-scrollable"},uA=["aria-pressed","aria-label","title"],cA={key:1,class:"sidebar-search-bar"},dA=["placeholder"],fA=["aria-label"],hA={class:"sidebar-skills-link-icon","aria-hidden":"true"},pA={class:"sidebar-skills-link-copy"},mA={class:"sidebar-skills-link-title"},gA={class:"sidebar-skills-link-subtitle"},vA={class:"sidebar-settings-account-section"},yA={class:"sidebar-settings-account-header"},wA={class:"sidebar-settings-account-header-main"},bA=["aria-expanded","title"],_A={class:"sidebar-settings-account-collapse-icon"},TA={class:"sidebar-settings-account-title"},SA={class:"sidebar-settings-account-count"},kA=["disabled"],CA={key:0,class:"sidebar-settings-account-error"},xA={key:1,class:"sidebar-settings-account-empty"},AA={key:2,class:"sidebar-settings-account-list"},EA=["title","onMouseenter","onMouseleave"],IA={class:"sidebar-settings-account-main"},PA={class:"sidebar-settings-account-email"},MA={class:"sidebar-settings-account-meta"},RA={class:"sidebar-settings-account-quota"},$A={class:"sidebar-settings-account-id"},NA={class:"sidebar-settings-account-actions"},OA=["disabled","onClick"],DA=["disabled","onClick"],LA=["title"],jA={class:"sidebar-settings-label"},FA=["title"],UA={class:"sidebar-settings-label"},BA={class:"sidebar-settings-value"},qA=["title"],HA={class:"sidebar-settings-label"},zA={class:"sidebar-settings-value"},VA=["title"],WA={class:"sidebar-settings-label"},GA=["value"],KA=["value"],JA=["title"],YA={class:"sidebar-settings-label"},QA={class:"sidebar-settings-value"},XA=["title"],ZA={class:"sidebar-settings-label"},eE=["title"],tE={class:"sidebar-settings-label"},nE=["title"],rE={class:"sidebar-settings-label"},oE=["value","disabled"],aE={key:0,class:"sidebar-settings-row sidebar-settings-error"},sE={key:1,class:"sidebar-settings-row sidebar-settings-row--input"},iE={class:"sidebar-settings-provider-info"},lE={class:"sidebar-settings-label"},uE={class:"sidebar-settings-provider-link",href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer"},cE={class:"sidebar-settings-key-group"},dE={class:"sidebar-settings-key-masked"},fE=["disabled","title"],hE=["placeholder"],pE=["disabled"],mE={class:"sidebar-settings-row sidebar-settings-row--select",style:{"margin-top":"4px",padding:"0"}},gE={class:"sidebar-settings-label"},vE=["aria-label"],yE=["disabled"],wE=["disabled"],bE={key:2,class:"sidebar-settings-row sidebar-settings-row--input"},_E={class:"sidebar-settings-provider-info"},TE={class:"sidebar-settings-label"},SE={class:"sidebar-settings-provider-link",href:"https://opencode.ai/auth",target:"_blank",rel:"noopener noreferrer"},kE={class:"sidebar-settings-key-group"},CE=["placeholder"],xE=["disabled"],AE={key:3,class:"sidebar-settings-row sidebar-settings-row--input"},EE={class:"sidebar-settings-label"},IE={class:"sidebar-settings-key-group"},PE=["placeholder"],ME={class:"sidebar-settings-label",style:{"margin-top":"4px"}},RE={class:"sidebar-settings-key-group"},$E=["placeholder"],NE=["disabled"],OE={class:"sidebar-settings-row sidebar-settings-row--select",style:{"margin-top":"4px",padding:"0"}},DE={class:"sidebar-settings-label"},LE=["aria-label"],jE=["title"],FE={class:"sidebar-settings-label"},UE={class:"sidebar-settings-label"},BE={class:"sidebar-settings-value"},qE={key:4,class:"sidebar-settings-telegram-panel"},HE={class:"sidebar-settings-field"},zE={class:"sidebar-settings-field-label"},VE={class:"sidebar-settings-field"},WE={class:"sidebar-settings-field-label"},GE={class:"sidebar-settings-field-help"},KE={key:0,class:"sidebar-settings-telegram-error"},JE={class:"sidebar-settings-telegram-actions"},YE=["disabled"],QE=["data-state","title"],XE={class:"sidebar-settings-label"},ZE=["data-state"],eI={class:"sidebar-settings-context-meta"},tI={class:"sidebar-settings-rate-limits"},nI=["aria-label"],rI={class:"sidebar-settings-button-version"},oI={key:0,class:"content-keyboard-spacer","aria-hidden":"true"},aI={key:1,class:"skills-route-header-icon","aria-hidden":"true"},sI=["aria-pressed","title","aria-label"],iI={class:"content-header-terminal-shortcut"},lI={class:"content-body"},uI={key:1,class:"content-grid content-grid-home"},cI={class:"new-thread-empty"},dI={class:"new-thread-hero"},fI=["title"],hI={class:"new-thread-folder-actions"},pI={key:1,class:"new-thread-launch-card","aria-label":"Plugins and Apps announcement"},mI={class:"new-thread-launch-card-copy"},gI={class:"new-thread-launch-card-topline"},vI={class:"new-thread-launch-card-badge","aria-hidden":"true"},yI={class:"new-thread-launch-card-eyebrow"},wI={class:"new-thread-launch-card-title"},bI={class:"new-thread-launch-card-text"},_I={class:"new-thread-launch-card-actions"},TI=["aria-label","onKeydown"],SI={class:"new-thread-open-folder-header"},kI={class:"new-thread-open-folder-title"},CI={class:"new-thread-open-folder-label"},xI={class:"new-thread-open-folder-current"},AI=["placeholder","title","disabled","onKeydown"],EI=["disabled"],II={class:"new-thread-open-folder-actions"},PI={class:"new-thread-open-folder-toggle"},MI=["aria-pressed","disabled"],RI={key:0,class:"new-thread-open-folder-create"},$I={class:"new-thread-open-folder-create-composer"},NI=["placeholder","onKeydown"],OI=["disabled"],DI={key:0,class:"new-thread-open-folder-error"},LI=["placeholder","onKeydown"],jI={key:1,class:"new-thread-open-folder-error-actions"},FI={class:"new-thread-open-folder-error"},UI=["disabled"],BI={key:2,class:"new-thread-open-folder-status"},qI={key:3,class:"new-thread-open-folder-status"},HI={key:4,class:"new-thread-open-folder-list"},zI=["title","disabled","onClick"],VI={class:"new-thread-open-folder-item-name"},WI=["disabled","onClick"],GI={key:2,class:"new-thread-branch-select"},KI={class:"new-thread-branch-select-label"},JI={class:"new-thread-branch-select-help"},YI={class:"new-thread-runtime-help"},QI={class:"worktree-init-status-title"},XI={class:"worktree-init-status-message"},ZI={class:"composer-with-queue"},eP={key:2,class:"content-grid"},tP={class:"content-thread"},nP={class:"composer-with-queue"},Bf="codex-web-local.sidebar-collapsed.v1",qf="codex-web-local.accounts-section-collapsed.v1",Hf="codex-web-local.send-with-enter.v1",zf="codex-web-local.in-progress-send-mode.v1",Vf="codex-web-local.dark-mode.v1",Wf="codex-web-local.dictation-click-to-toggle.v1",Gf="codex-web-local.dictation-auto-send.v1",Kf="codex-web-local.dictation-language.v1",Jf="codex-web-local.chat-width.v1",rP=400,oP=Hn({__name:"App",setup(e){var Hc,zc;const t=xi(()=>Ei(()=>import("./ThreadConversation-B_1XpSrh.js"),__vite__mapDeps([0,1]))),n=xi(()=>Ei(()=>import("./ThreadTerminalPanel-CdyQTZa9.js"),__vite__mapDeps([2,3]))),r=xi(()=>Ei(()=>import("./ReviewPane-BwJrC8gt.js"),__vite__mapDeps([4,5]))),a=xi(()=>Ei(()=>import("./DirectoryHub-CGxQHsSZ.js"),__vite__mapDeps([6,7]))),{t:o,uiLanguage:s,uiLanguageOptions:l,setUiLanguage:c}=Qo(),f="b59d",h="0.1.86",g={sendWithEnter:o("When enabled, press Enter to send. When disabled, use Command+Enter to send."),inProgressSendMode:o("If a turn is still running, choose whether a new prompt should steer the current turn or be queued."),appearance:o("Switch between system theme, light mode, and dark mode."),chatWidth:o("Choose how wide the conversation column and composer can grow on desktop screens."),dictationClickToToggle:o("Use click-to-start and click-to-stop dictation instead of hold-to-talk."),dictationAutoSend:o("Automatically send transcribed dictation when recording stops."),dictationLanguage:o("Choose transcription language or keep auto-detect.")},b={standard:{label:"Standard",columnMax:"45rem",cardMax:"76ch"},wide:{label:"Wide",columnMax:"72rem",cardMax:"88ch"},"extra-wide":{label:"Extra wide",columnMax:"96rem",cardMax:"96ch"}},x={en:"english",zh:"chinese",de:"german",es:"spanish",ru:"russian",ko:"korean",fr:"french",ja:"japanese",pt:"portuguese",tr:"turkish",pl:"polish",ca:"catalan",nl:"dutch",ar:"arabic",sv:"swedish",it:"italian",id:"indonesian",hi:"hindi",fi:"finnish",vi:"vietnamese",he:"hebrew",uk:"ukrainian",el:"greek",ms:"malay",cs:"czech",ro:"romanian",da:"danish",hu:"hungarian",ta:"tamil",no:"norwegian",th:"thai",ur:"urdu",hr:"croatian",bg:"bulgarian",lt:"lithuanian",la:"latin",mi:"maori",ml:"malayalam",cy:"welsh",sk:"slovak",te:"telugu",fa:"persian",lv:"latvian",bn:"bengali",sr:"serbian",az:"azerbaijani",sl:"slovenian",kn:"kannada",et:"estonian",mk:"macedonian",br:"breton",eu:"basque",is:"icelandic",hy:"armenian",ne:"nepali",mn:"mongolian",bs:"bosnian",kk:"kazakh",sq:"albanian",sw:"swahili",gl:"galician",mr:"marathi",pa:"punjabi",si:"sinhala",km:"khmer",sn:"shona",yo:"yoruba",so:"somali",af:"afrikaans",oc:"occitan",ka:"georgian",be:"belarusian",tg:"tajik",sd:"sindhi",gu:"gujarati",am:"amharic",yi:"yiddish",lo:"lao",uz:"uzbek",fo:"faroese",ht:"haitian creole",ps:"pashto",tk:"turkmen",nn:"nynorsk",mt:"maltese",sa:"sanskrit",lb:"luxembourgish",my:"myanmar",bo:"tibetan",tl:"tagalog",mg:"malagasy",as:"assamese",tt:"tatar",haw:"hawaiian",ln:"lingala",ha:"hausa",ba:"bashkir",jw:"javanese",su:"sundanese",yue:"cantonese"},{projectGroups:j,projectDisplayNameById:q,selectedThread:te,selectedThreadTokenUsage:z,selectedThreadScrollState:O,selectedThreadTerminalOpen:V,selectedThreadServerRequests:Z,selectedLiveOverlay:Ae,codexQuota:Ue,selectedThreadId:ne,availableCollaborationModes:Se,availableModelIds:Y,selectedCollaborationMode:Ee,selectedReasoningEffort:He,selectedSpeedMode:ee,installedSkills:we,accountRateLimitSnapshots:Re,messages:Ke,isLoadingThreads:Be,isLoadingMessages:xe,isSendingMessage:me,isInterruptingTurn:We,isSelectedThreadInterruptPending:nt,isUpdatingSpeedMode:Ve,refreshAll:Le,refreshSkills:ft,selectThread:ht,ensureThreadMessagesLoaded:Xe,setThreadScrollState:dt,setThreadTerminalOpen:K,toggleSelectedThreadTerminal:_e,archiveThreadById:be,forkThreadById:Oe,renameThreadById:Je,forkThreadFromTurn:k,sendMessageToSelectedThread:I,sendMessageToNewThread:H,interruptSelectedThreadTurn:re,selectedThreadQueuedMessages:J,removeQueuedMessage:ae,reorderQueuedMessage:fe,steerQueuedMessage:ye,setSelectedCollaborationMode:pe,readModelIdForThread:ce,setSelectedModelIdForThread:$e,setSelectedReasoningEffort:ge,updateSelectedSpeedMode:ke,respondToPendingServerRequest:De,renameProject:Ze,removeProject:D,reorderProject:U,pinProjectToTop:B,startPolling:Q,stopPolling:de,primeSelectedThread:Pe,rollbackSelectedThread:je}=sA(),Qe=$w(),Me=Rw(),{isMobile:bt}=xc(),Sn=P(null),In=P(null),Wr=P(null),Bt=P(!1),pr=P(!1),sr=P(!1),Gr=P(!0),kr=P(null),mr=P(!1),Vn=P("");let Qt=!1;const Pn=P(!1),ut=P(""),Mn=P("local"),Wn=P(""),Kr=P([]),Wt=P(!1),Gn=P({order:[],labels:{}}),qt=P({phase:"idle",title:"",message:""}),Xt=P(Mm()),Ot=P(""),Et=P(!1),Gt=P(null),gr=P(null),ir=P(null),Jr=P(null),tn=P(null);let Rn=null,vr=null;const lr=P("New Project (1)"),Yr=P(""),Kn=P(!1),$n=P($m()),sn=P(!1),yr=P([]),nn=P(null),Qr=P(!1),fn=P(!1),No=P(null),gn=P([]),ur=P(!1),Jn=P(!1),wr=P(""),Dt=P(""),Nn=P(""),Kt=P(""),br=P(Gl(Hf,!0)),rn=P(ym()),Tt=P(vm()),ln=P(wm()),cr=P(Gl(Wf,!1)),On=P(Gl(Gf,!0)),_r=P(Im()),Xr=le(()=>Pm()),Cr=P(!1),vn=P(!1),Nt=P(!1),It=P(""),vo=P(!1),Zr=P(null),_t=P(!1),on=P(""),un=P("codex"),Dn=P(""),kn=P(""),yn=P("responses"),Yn=P("responses"),xr=P(""),eo=P(!1),Ar=P(""),A=P(""),F=P(""),X=P(!1),Ie=P(!1),lt=P(""),Ct=P(""),Zt=P(!1),xt=P(!1),wn=P(null),Tr=P(null),Qn=P(""),Xn=P(""),qe=P(""),Ce=P([]),Lt=P(""),bn=P(!1),Cn=P(!1),Xo=P(!1),Ht=P(""),dr=P({configured:!1,active:!1,mappedChats:0,mappedThreads:0,allowedUsers:0,allowAllUsers:!1,lastError:""}),$r=P(null),Nr=P(!1),to=P(!1),no=P(typeof window<"u"?((Hc=window.visualViewport)==null?void 0:Hc.height)??window.innerHeight:0),w=P(typeof window<"u"?((zc=window.visualViewport)==null?void 0:zc.offsetTop)??0:0),_=P(typeof window<"u"?window.innerHeight:0);let T=null,W=!1,Fe=0;const yt=le(()=>{const d=Qe.params.threadId;return typeof d=="string"?d:""}),vt=le(()=>Qe.name==="home"),_n=le(()=>Qe.name==="skills"),Ln=le(()=>{var d;return _n.value?o("Skills"):vt.value?o("Start new thread"):((d=te.value)==null?void 0:d.title)??o("Choose a thread")}),Zn=typeof window<"u"&&(window.location.hostname||window.location.host)||"codexui",Or=le(()=>{var v,M;return(((M=(v=te.value)==null?void 0:v.title)==null?void 0:M.trim())??"")||Zn}),Dr=le(()=>Ke.value.filter(d=>{const v=Om(d.messageType,d.role);return v==="worked"?!0:!(v==="turnActivity.live"||v==="turnError.live"||v==="agentReasoning.live")})),Zo=le(()=>Ae.value),Oo=le(()=>vt.value?"__new-thread__":ne.value),Sa=le(()=>ce(Oo.value)),ti=le(()=>{const d=Z.value;return d.length>0?d[d.length-1]:null}),xn=le(()=>{var d,v;return vt.value?ut.value.trim():((v=(d=te.value)==null?void 0:d.cwd)==null?void 0:v.trim())??""}),ml=le(()=>Gr.value&&(vt.value&&xn.value.length>0||Qe.name==="thread"&&ne.value.length>0)),is=le(()=>vt.value?Bt.value:V.value),ka=le(()=>!bt.value||no.value<=0||_.value<=0?!1:_.value-no.value>120),gl=le(()=>ka.value||is.value&&sr.value),ni=le(()=>{var d,v;return((v=(d=te.value)==null?void 0:d.cwd)==null?void 0:v.trim())??ut.value.trim()}),ls=le(()=>{var d;return!vt.value&&((d=te.value)==null?void 0:d.inProgress)===!0}),vl=le(()=>!vt.value&&!_n.value&&ne.value.trim().length>0),us=le(()=>me.value||We.value||ls.value||Z.value.length>0);function Ca(d){return Number.isFinite(d)?new Intl.NumberFormat("en-US",{notation:d>=1e3?"compact":"standard",maximumFractionDigits:d>=1e5?0:1}).format(Math.max(0,Math.trunc(d))):"0"}function yl(d){if(!d)return o("Waiting for Codex thread/tokenUsage/updated events for this thread.");const v=[`${o("Current context usage")}: ${d.currentContextTokens.toLocaleString()} ${o("tokens")}`,`${o("Cumulative thread usage")}: ${d.total.totalTokens.toLocaleString()} ${o("tokens")}`];return typeof d.modelContextWindow=="number"?(v.unshift(`${o("Model context window")}: ${d.modelContextWindow.toLocaleString()} ${o("tokens")}`),v.push(`${o("Remaining context")}: ${(d.remainingContextTokens??0).toLocaleString()} ${o("tokens")}`)):v.push(o("Model context window is unavailable in the latest usage event.")),v.join(`
|
|
57
|
-
`)}function ri(){Cr.value&&(Cr.value=!1,T0(!0))}function wl(){ri(),Me.push({name:"skills"})}const oi=le(()=>{var v;const d=(v=z.value)==null?void 0:v.remainingContextPercent;return d===null||typeof d!="number"?"pending":d<=10?"danger":d<=25?"warning":"ok"}),bl=le(()=>{const d=z.value;return d?typeof d.remainingContextTokens=="number"?`${Ca(d.remainingContextTokens)} ${o("left")}`:`${Ca(d.currentContextTokens)} ${o("used")}`:o("Awaiting data")}),_l=le(()=>{const d=z.value;return d?typeof d.modelContextWindow=="number"?`${Ca(d.currentContextTokens)} ${o("used")} / ${Ca(d.modelContextWindow)}`:o("Window size unavailable"):o("Updates after the next token usage event")}),Tl=le(()=>yl(z.value)),ea=le(()=>{var se,ve;const d=[],v=new Set;for(const Te of Gn.value.order){const st=Te.trim();!st||v.has(st)||(v.add(st),d.push({value:st,label:Gn.value.labels[st]||pa(st)}))}for(const Te of j.value){const st=((ve=(se=Te.threads[0])==null?void 0:se.cwd)==null?void 0:ve.trim())??"";!st||v.has(st)||Ji(st)||(v.add(st),d.push({value:st,label:q.value[Te.projectName]??Te.projectName}))}const M=ut.value.trim();return M&&!v.has(M)&&d.unshift({value:M,label:pa(M)}),d}),cs=le(()=>{const d=Wn.value.trim(),v=[...Kr.value];return d&&!v.some(M=>M.value===d)&&v.unshift({value:d,label:d}),v}),ai=le(()=>{const d=Wn.value.trim();if(!d)return"";const v=cs.value.find(M=>M.value===d);return(v==null?void 0:v.label)??d}),Sl=le(()=>nn.value??"__detached_head__"),kl=le(()=>{var se;const d=[{value:"__review__",label:sn.value?"Review (Open)":"Review"}],v=new Set,M=((se=nn.value)==null?void 0:se.trim())??"";M?(d.push({value:M,label:M}),v.add(M)):(d.push({value:"__detached_head__",label:"Detached HEAD"}),v.add("__detached_head__"));for(const ve of yr.value)!ve.value||v.has(ve.value)||(v.add(ve.value),d.push(ve));return d}),si=le(()=>Xn.value.trim()),ii=le(()=>{const d=lt.value.trim();return!d||d==="."||d===".."?!1:!/[\\/]/u.test(d)}),Cl=le(()=>ii.value&&si.value.trim().length>0&&!Lt.value),ta=le(()=>{const d=Ft(Qn.value).trim();return d||Xn.value.trim()}),xl=le(()=>Zt.value?"Creating…":"Create"),Al=le(()=>{const d=Xn.value.trim(),v=qe.value.trim();return!!(d&&v&&d!==v)}),ds=le(()=>{const d=[];Al.value&&d.push({key:`parent:${qe.value}`,name:"..",path:qe.value,kind:"parent"});for(const v of Ce.value)d.push({key:`directory:${v.path}`,name:v.name,path:v.path,kind:"directory"});return d}),fs=le(()=>{const d=Ht.value.trim().toLowerCase();return d?ds.value.filter(v=>v.kind==="parent"||v.name.toLowerCase().includes(d)):ds.value}),Er=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null,El=le(()=>o(b[ln.value].label)),hs=le(()=>typeof navigator<"u"&&/mac|iphone|ipad|ipod/i.test(navigator.platform)?"⌘J":"Ctrl+J"),na=le(()=>{const d=b[ln.value],v=Math.max(0,_.value-no.value-w.value);return{"--chat-column-max":d.columnMax,"--chat-card-max":d.cardMax,"--visual-viewport-height":no.value>0?`${no.value}px`:"100dvh","--visual-viewport-offset-top":`${Math.max(0,w.value)}px`,"--virtual-keyboard-inset":`${v}px`}}),ps=le(()=>{if(!dr.value.configured)return o("Not configured");const d=dr.value.active?o("Online"):o("Configured (offline)"),v=dr.value.allowAllUsers?o("allow all users"):`${dr.value.allowedUsers} ${o("allowed user(s)")}`,M=`${dr.value.mappedChats} ${o("chat(s)")}, ${dr.value.mappedThreads} ${o("thread(s)")}, ${v}`,se=dr.value.lastError?`, ${o("error")}: ${dr.value.lastError}`:"";return`${d}, ${M}${se}`});Jo(()=>{var d,v;document.addEventListener("pointerdown",ws),window.addEventListener("keydown",he),document.addEventListener("visibilitychange",Do),window.addEventListener("pageshow",ia),window.addEventListener("focus",bs),window.addEventListener("resize",ro),(d=window.visualViewport)==null||d.addEventListener("resize",ro),(v=window.visualViewport)==null||v.addEventListener("scroll",ro),ro(),_i(),Er==null||Er.addEventListener("change",_i),Dm(),lm(),ms(),Ma(),yo(),li(),Ir(),Jl(),Ea()}),il(()=>{var d,v;document.removeEventListener("pointerdown",ws),window.removeEventListener("keydown",he),document.removeEventListener("visibilitychange",Do),window.removeEventListener("pageshow",ia),window.removeEventListener("focus",bs),window.removeEventListener("resize",ro),(d=window.visualViewport)==null||d.removeEventListener("resize",ro),(v=window.visualViewport)==null||v.removeEventListener("scroll",ro),Er==null||Er.removeEventListener("change",_i),T!==null&&(window.clearInterval(T),T=null),Rn&&(clearTimeout(Rn),Rn=null),oo(),de()});function ro(){var d,v;typeof window>"u"||(_.value=Math.max(_.value,window.innerHeight),no.value=((d=window.visualViewport)==null?void 0:d.height)??window.innerHeight,w.value=((v=window.visualViewport)==null?void 0:v.offsetTop)??0)}gt(Ot,d=>{const v=d.trim();if(Rn&&(clearTimeout(Rn),Rn=null),!v){tn.value=null;return}Rn=setTimeout(()=>{p0(v,1e3).then(M=>{Ot.value.trim()===v&&(tn.value=M.threadIds)}).catch(()=>{Ot.value.trim()===v&&(tn.value=null)})},220)}),gt(ka,d=>{d||(sr.value=!1)}),gt(gn,()=>{if(typeof window>"u")return;if(!gn.value.some(v=>v.quotaStatus==="loading")){T!==null&&(window.clearInterval(T),T=null);return}T===null&&(T=window.setInterval(()=>{W||(W=!0,fr({silent:!0}).finally(()=>{W=!1}))},1500))},{deep:!0});function ra(){ft()}async function Ir(){try{dr.value=await v0()}catch(d){const v=d instanceof Error?d.message:"Failed to load Telegram status";dr.value={configured:!1,active:!1,mappedChats:0,mappedThreads:0,allowedUsers:0,allowAllUsers:!1,lastError:v}}}async function li(){try{const d=await g0();Ar.value=d.botToken,A.value=d.allowedUserIds.map(v=>String(v)).join(`
|
|
58
|
-
`),F.value=""}catch(d){F.value=d instanceof Error?d.message:"Failed to load Telegram configuration"}}async function ms(){const d=await _0();Cr.value=d.dismissed!==!0}function ui(d){const v=d.split(/[\n,]/).map(ve=>ve.trim().replace(/^(telegram|tg):/i,"").trim()).filter(Boolean),M=v.includes("*"),se=Array.from(new Set(v.filter(ve=>/^-?\d+$/.test(ve)).map(ve=>Number.parseInt(ve,10))));return M?["*",...se]:se}async function Il(){const d=Ar.value.trim(),v=ui(A.value);if(!d){F.value=o("Telegram bot token is required.");return}if(v.length===0){F.value=o("At least one allowed Telegram user ID or * is required.");return}X.value=!0,F.value="";try{await m0(d,v),A.value=v.map(M=>String(M)).join(`
|
|
59
|
-
`),await Promise.all([li(),Ir()]),window.alert(o("Telegram bot configured. Only allowlisted Telegram users can use the bridge."))}catch(M){F.value=M instanceof Error?M.message:o("Failed to connect Telegram bot"),Ir()}finally{X.value=!1}}function ci(){Et.value=!Et.value,Et.value?an(()=>{var d;return(d=Gt.value)==null?void 0:d.focus()}):Ot.value=""}function Pl(){var d;Ot.value="",(d=Gt.value)==null||d.focus()}function Ml(d){d.key==="Escape"&&(Et.value=!1,Ot.value="")}function di(d){d&&(Qe.name==="thread"&&yt.value===d||(Me.push({name:"thread",params:{threadId:d}}),bt.value&&oe(!0)))}async function Rl(d){d&&(ne.value!==d&&(await ht(d),await Me.push({name:"thread",params:{threadId:d}})),await an(),hm())}function $l(d){return d.length>8?d.slice(-8):d}function fi(d){const v=[d.planType||o("unknown")];return d.authMode&&v.unshift(d.authMode),v.join(" · ")}function hi(d){if(!d)return!1;const v=d.toLowerCase();return v.includes("payment required")||/\b402\b/.test(v)}function oa(d){return d.unavailableReason==="payment_required"||hi(d.quotaError)}function xa(d){return ur.value||Jn.value||wr.value.length>0||d.isActive&&wr.value!==d.accountId&&us.value}function aa(d){return Dt.value===d.accountId}function pi(d){return Nn.value===d.accountId||aa(d)}function Nl(d){return oa(d)?o("Unavailable"):d.isActive?o("Active"):Jn.value?o("Switching…"):o("Switch")}function Aa(d){return wr.value===d.accountId?o("Removing…"):aa(d)?o("Click again to remove"):o("Remove")}function Ol(d){Nn.value=d}function Dl(d){Nn.value===d&&(Nn.value=""),wr.value!==d&&Dt.value===d&&(Dt.value="")}function Ll(d){const v=d.quotaSnapshot;if(!v)return null;const M=[v==null?void 0:v.primary,v==null?void 0:v.secondary].filter(Te=>Te!==null),se=M.find(Te=>Te.windowMinutes===10080);if(se)return se;const ve=M.filter(Te=>typeof Te.windowMinutes=="number"&&Te.windowMinutes>=10080).sort((Te,st)=>(Te.windowMinutes??0)-(st.windowMinutes??0))[0]??null;return ve||(v.secondary??null)}function jl(d){if(typeof d!="number"||!Number.isFinite(d))return"";const v=new Date(d*1e3);return`${v.getMonth()+1}月${v.getDate()}日`}function mi(d){var Te,st;if(oa(d))return d.quotaError||o("402 Payment Required");const v=d.quotaSnapshot,M=Ll(d),se=(v==null?void 0:v.primary)??(v==null?void 0:v.secondary)??null,ve=M??se;if(ve){const jn=Math.max(0,Math.min(100,100-Math.round(ve.usedPercent))),so=jl(ve.resetsAt);return so?`${jn}% ${o("weekly remaining")} · ${so}`:`${jn}% ${o("weekly remaining")}`}return(Te=v==null?void 0:v.credits)!=null&&Te.unlimited?o("Unlimited credits"):(st=v==null?void 0:v.credits)!=null&&st.hasCredits&&v.credits.balance?`${v.credits.balance} ${o("credits")}`:d.quotaStatus==="loading"?o("Loading quota…"):d.quotaStatus==="error"?d.quotaError||o("Quota unavailable"):d.quotaStatus==="ready"||d.quotaStatus==="idle"?o("Quota unavailable"):o("Fetching account details…")}function gs(d){return[d.email||o("Account"),fi(d),oa(d)?o("Unavailable account"):null,mi(d),`${o("Workspace")} ${d.accountId}`].filter(Boolean).join(`
|
|
60
|
-
`)}async function fr(d={}){try{const v=await Lb();gn.value=v.accounts,v.accounts.some(M=>M.accountId===Nn.value)||(Nn.value=""),v.accounts.some(M=>M.accountId===Dt.value)||(Dt.value="")}catch(v){if(d.silent===!0)return;Kt.value=v instanceof Error?v.message:o("Failed to load accounts")}}async function Fl(){if(!(ur.value||Jn.value)){Kt.value="",Nn.value="",Dt.value="",ur.value=!0;try{const d=await jb();gn.value=d.accounts,de(),Q(),Le({includeSelectedThreadMessages:!0})}catch(d){Kt.value=d instanceof Error?d.message:o("Failed to refresh accounts")}finally{ur.value=!1}}}async function Ul(d){if(!(Jn.value||ur.value)){if(us.value){Kt.value=o("Finish the current turn and pending requests before switching accounts.");return}Kt.value="",Nn.value="",Dt.value="",Jn.value=!0;try{const v=await Fb(d);gn.value=gn.value.map(M=>M.accountId===d?v:{...M,isActive:!1}),de(),Q(),Le({includeSelectedThreadMessages:!0}),fr({silent:!0})}catch(v){Kt.value=v instanceof Error?v.message:o("Failed to switch account")}finally{Jn.value=!1}}}async function gi(d){if(ur.value||Jn.value||wr.value.length>0)return;const v=gn.value.find(se=>se.accountId===d)??null;if(!v)return;if(Dt.value!==d){Dt.value=d;return}if(v.isActive&&us.value){Kt.value=o("Finish the current turn and pending requests before removing the active account.");return}const M=v.isActive;Kt.value="",Dt.value="",wr.value=d;try{const se=await Ub(d);gn.value=se.accounts,de(),Q(),M&&Le({includeSelectedThreadMessages:!0}),fr({silent:!0})}catch(se){Kt.value=se instanceof Error?se.message:o("Failed to remove account")}finally{wr.value=""}}function vi(d){be(d)}async function Bl(d){const v=await Oe(d);v&&(vt.value?await Me.replace({name:"thread",params:{threadId:v}}):await Me.push({name:"thread",params:{threadId:v}}),bt.value&&oe(!0))}function yi(d){const v=d.trim().replace(/\\/gu,"/");return v?v.includes("/.codex/worktrees/")||v.includes("/.git/worktrees/"):!1}function vs(d,v=""){var Te,st,jn;const M=j.value.find(so=>so.projectName===d);if(!M)return v.trim();const se=M.threads.find(so=>!yi(so.cwd));return(((Te=se==null?void 0:se.cwd)==null?void 0:Te.trim())??((jn=(st=M.threads[0])==null?void 0:st.cwd)==null?void 0:jn.trim())??"")||v.trim()}function ql(d){var se,ve;const v=j.value.find(Te=>Te.projectName===d),M=vs(d,((ve=(se=v==null?void 0:v.threads[0])==null?void 0:se.cwd)==null?void 0:ve.trim())??"");M&&(ut.value=M),bt.value&&oe(!0),!vt.value&&Me.push({name:"home"})}function Hl(d){var M;let v="";for(const se of j.value){const ve=se.threads.find(Te=>Te.id===d);if((M=ve==null?void 0:ve.cwd)!=null&&M.trim()){v=ve.cwd.trim();break}}!v||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(v)}`,"_blank","noopener,noreferrer")}function ys(){ut.value="",Mn.value="local",bt.value&&oe(!0),!vt.value&&Me.push({name:"home"})}function i(d){Ze(d.projectName,d.displayName)}function u(d){Je(d.threadId,d.title)}async function p(d){await D(d),await Ma(),yo()}function y(d){U(d.projectName,d.toIndex)}function E(d){dt(d.threadId,d.state)}function $(d){L(d)}async function L(d){var se;const v=await De(d),M=((se=d.followUpMessageText)==null?void 0:se.trim())??"";if(!(!v||!M||vt.value))try{await I(M,[],[],"steer",[])}catch{}}async function G(d){const v=await k(d.threadId,d.turnIndex);v&&(await Me.push({name:"thread",params:{threadId:v}}),ne.value!==v&&await ht(v),bt.value&&oe(!0))}function oe(d){Xt.value!==d&&(Xt.value=d,Rm(d))}function he(d){if(d.defaultPrevented)return;if(d.key==="Escape"&&Kn.value){Kn.value=!1;return}if(!d.ctrlKey&&!d.metaKey||d.shiftKey||d.altKey)return;const v=d.key.toLowerCase();if(v==="b"){d.preventDefault(),oe(!Xt.value);return}if(v==="j"&&Qe.name==="thread"&&ne.value){d.preventDefault(),ze();return}v==="j"&&vt.value&&xn.value&&(d.preventDefault(),ze())}function ze(){if(Gr.value){if(vt.value){if(!xn.value)return;Bt.value=!Bt.value,Bt.value||Jt();return}_e(),V.value||Jt()}}function pt(d){if(pr.value=d,!d){sr.value=!1,oo();return}sr.value=!0,oo(),vr=setTimeout(()=>{vr=null,ka.value||(sr.value=!1)},1500)}function mt(){Bt.value=!1,Jt()}function wt(){ne.value&&K(ne.value,!1),Jt()}function Jt(){pr.value=!1,sr.value=!1,oo()}function oo(){vr&&(clearTimeout(vr),vr=null)}async function Ea(){try{const d=await $b();Gr.value=d.available,d.available||(Bt.value=!1,ne.value&&K(ne.value,!1))}catch{Gr.value=!1,Bt.value=!1}}function ws(d){var M,se;const v=d.target;if(v instanceof Node){if(pr.value){const ve=v instanceof Element?v:v.parentElement;ve!=null&&ve.closest(".thread-terminal-panel")||Jt()}Kn.value&&((M=ir.value)!=null&&M.contains(v)||(se=Jr.value)!=null&&se.contains(v)||(Kn.value=!1))}}function sa(d){var M,se;if(!Kn.value)return;const v=d.target;v instanceof Node&&((M=ir.value)!=null&&M.contains(v)||(se=Jr.value)!=null&&se.contains(v)||(Kn.value=!1))}function Do(){if(!(typeof document>"u")&&bt.value){if(document.visibilityState==="hidden"){$r.value=Date.now(),Nr.value=!1;return}Ia()}}function ia(d){d.persisted&&Ia()}function bs(){Qe.name==="home"&&(Ma(),yo()),Ia()}function Ia(){typeof window>"u"||typeof document>"u"||!bt.value||document.visibilityState!=="visible"||Nr.value||$r.value===null||Date.now()-$r.value<rP||(Nr.value=!0,$r.value=null,wi())}async function wi(){if(!to.value){to.value=!0;try{await Le({includeSelectedThreadMessages:!0,awaitAncillaryRefreshes:!0}),await Ql()}finally{to.value=!1}}}function _s(d){const v=d.text;la();const M=kr.value,se=d.mode==="queue"&&M&&M.threadId===ne.value?M.queueIndex:void 0;if(kr.value=null,vt.value){Lm(v,d.imageUrls,d.skills,d.fileAttachments);return}I(v,d.imageUrls,d.skills,d.mode,d.fileAttachments,se)}function bi(d){const v=J.value.findIndex(Te=>Te.id===d),M=v>=0?J.value[v]:void 0,se=In.value;if(!M||!se||se.hasUnsavedDraft()&&!window.confirm("Replace the current draft with this queued message for editing?"))return;kr.value=ne.value?{threadId:ne.value,queueIndex:v}:null;const ve={text:M.text,imageUrls:[...M.imageUrls],fileAttachments:M.fileAttachments.map(Te=>({...Te})),skills:M.skills.map(Te=>({...Te}))};se.hydrateDraft(ve),ae(d)}function la(){if(!bt.value||vt.value)return;const d=()=>{var v;(v=Wr.value)==null||v.jumpToLatest()};d(),an(()=>{d(),!(typeof window>"u")&&window.requestAnimationFrame(()=>{d(),window.requestAnimationFrame(d)})})}function tt(d){ut.value=d.trim(),Ct.value=""}function hr(d){Wn.value=d.trim()}async function ao(d){const v=d.trim();if(!v||Qe.name!=="thread"){yr.value=[],nn.value=null;return}Qr.value=!0;try{const M=await i0(v);yr.value=M.options,nn.value=M.currentBranch}catch{yr.value=[],nn.value=null}finally{Qr.value=!1}}function Xp(d){if(d==="__review__"){sn.value=!sn.value;return}if(d==="__detached_head__"||fn.value)return;const v=d.trim();if(!v||v===(nn.value??""))return;const M=xn.value.trim();M&&(fn.value=!0,l0(M,v).then(se=>(nn.value=se||v,sn.value=!1,ao(M))).catch(se=>{const ve=se instanceof Error?se.message:"Failed to switch branch";window.alert(ve)}).finally(()=>{fn.value=!1}))}async function Zp(){const d=await Vl();if(!d)return;await yo();const v=lr.value.trim()||"New Project (1)",M=window.prompt(`Create project in ${d}`,v);if(M===null)return;const se=M.trim();if(!se)return;const ve=Nc($c(d,se));if(ve)try{const Te=await bu(ve,{createIfMissing:!0,label:""});if(!Te)return;ut.value=Te,B(pa(Te)),await Ma(),await yo()}catch(Te){const st=Te instanceof Error?Te.message:"Failed to create the project.";window.alert(st)}}async function em(){const d=ut.value.trim()||await Vl();d&&(Ie.value=!1,xt.value=!0,Ht.value="",await Lo(d),Lt.value||an(()=>{var v;return(v=wn.value)==null?void 0:v.focus()}))}function Pa(){Fe+=1,xt.value=!1,bn.value=!1,Lt.value="",Ht.value="",Qn.value="",Ts()}async function tm(d){!d||bn.value||(Ht.value="",await Lo(d))}function nm(){const d=Xn.value.trim();!xt.value||!d||Lo(d)}function rm(){const d=ta.value;!xt.value||!d||bn.value||Lo(d)}function om(){if(!xt.value||bn.value||Cn.value)return;const d=ta.value,v=Xn.value.trim();!d||d===v||Lo(d)}function am(){const d=ta.value,v=Xn.value.trim();if(d){if(d!==v){Lo(d);return}zl(d)}}async function zl(d=ta.value){const v=Ft(d).trim();if(v){Lt.value="",Cn.value=!0;try{const M=await bu(v,{createIfMissing:!1,label:""});if(!M){Lt.value="Failed to open the selected folder.";return}ut.value=M,B(pa(M)),await Ma(),await yo(),Pa()}catch(M){Lt.value=M instanceof Error?M.message:"Failed to open the selected folder."}finally{Cn.value=!1}}}async function sm(){if(Ct.value="",Ie.value){Ts();return}if(!xt.value){const d=ut.value.trim()||await Vl();if(!d||(xt.value=!0,Ht.value="",await Lo(d),Lt.value))return}Lt.value||(lt.value=lr.value,Ie.value=!0,an(()=>{var d;return(d=No.value)==null?void 0:d.focus()}))}function Ts(){Ct.value="",lt.value="",Ie.value=!1}async function Mc(){const d=lt.value.trim();if(!d)return;if(Ct.value="",Lt.value){Ct.value="Reload the current folder before creating a new one.";return}Zt.value=!0;const v=si.value.trim(),M=Nc($c(v,d));if(!M){Ct.value="Unable to determine where the new folder should be created.",Zt.value=!1;return}if(!ii.value){Ct.value="Enter a single folder name.",Zt.value=!1;return}try{const se=await c0(M);if(!se){Ct.value="Failed to create the folder.";return}Ct.value="",Ht.value="",await Lo(se),Ts()}catch(se){Ct.value=se instanceof Error?se.message:"Failed to create folder."}finally{Zt.value=!1}}async function im(){var v;if(typeof window>"u")return!1;const d=((v=new URLSearchParams(window.location.search).get("openProjectPath"))==null?void 0:v.trim())??"";if(!d)return!1;try{const M=await bu(d,{createIfMissing:!1,label:""});if(!M)return!1;ut.value=M,B(pa(M)),await Me.replace({name:"home"}),await Ma();const se=new URL(window.location.href);return se.searchParams.delete("openProjectPath"),window.history.replaceState({},"",se.toString()),!0}catch{return!1}}async function Vl(){const d=Rc();if(d)return d;try{const v=await wf();if(v)return Yr.value=v,v}catch{}return""}async function yo(){const d=Rc();if(!d){lr.value="New Project (1)";return}try{const v=await f0(d);lr.value=v.name||"New Project (1)"}catch{lr.value="New Project (1)"}}function Rc(){var M,se;const d=ut.value.trim();if(d)return hu(d);const v=((se=(M=ea.value[0])==null?void 0:M.value)==null?void 0:se.trim())??"";return v?hu(v):Yr.value.trim()}async function lm(){try{Yr.value=await wf()}catch{Yr.value=""}}async function Ma(){try{const d=await Fa();Gn.value={order:[...d.order],labels:{...d.labels}}}catch{Gn.value={order:[],labels:{}}}}async function Lo(d){const v=++Fe,M=Ft(d).trim();Qn.value=M,Xn.value=M,Lt.value="",bn.value=!0;try{const se=await u0(d,{showHidden:Xo.value});if(v!==Fe)return;Qn.value=se.path,Xn.value=se.path,qe.value=se.parentPath,Ce.value=se.entries}catch(se){if(v!==Fe)return;Lt.value=se instanceof Error?se.message:"Failed to load local folders.",qe.value=hu(Xn.value),Ce.value=[],Ts()}finally{v===Fe&&(bn.value=!1)}}function $c(d,v){const M=Ft(d).trim(),se=Ft(v).trim().replace(/^[\\/]+/u,"");if(!M||!se)return"";const ve=M.includes("\\")&&!M.includes("/")?"\\":"/";if(/^[a-zA-Z]:[\\/]?$/u.test(M))return`${M.slice(0,2)}${ve}${se}`;if(/^\/+$/u.test(M))return`/${se}`;const Te=M.replace(/[\\/]+$/u,"");return Te?`${Te}${ve}${se}`:""}function Nc(d){const v=Ft(d).trim();if(!v)return"";const M=v.match(/^\\\\([^\\/]+)[\\/]+([^\\/]+)([\\/].*)?$/u);if(M){const[,ve,Te,st=""]=M,jn=Wl(st.split(/[\\/]+/u));return jn.length>0?`\\\\${ve}\\${Te}\\${jn.join("\\")}`:`\\\\${ve}\\${Te}`}const se=v.match(/^([a-zA-Z]:)([\\/].*)?$/u);if(se){const[,ve,Te=""]=se,st=v.includes("\\")&&!v.includes("/")?"\\":"/",jn=Wl(Te.split(/[\\/]+/u));return jn.length>0?`${ve}${st}${jn.join(st)}`:`${ve}${st}`}if(v.startsWith("/")){const ve=Wl(v.split("/"));return ve.length>0?`/${ve.join("/")}`:"/"}return v}function Wl(d){const v=[];for(const M of d){const se=M.trim();if(!(!se||se===".")){if(se===".."){v.length>0&&v.pop();continue}v.push(se)}}return v}function um(d){fe(d.draggedId,d.targetId)}function Oc(d){$e(Oo.value,d)}function Dc(d){ge(d)}function Lc(d){ke(d)}function cm(){re()}function dm(d){const v=d.turnId.trim();if(v.length>0){const M=[...Dr.value].reverse().find(se=>{var ve;return se.role==="user"&&(((ve=se.turnId)==null?void 0:ve.trim())??"")===v&&se.text.trim().length>0});M!=null&&M.text&&In.value&&In.value.appendTextToDraft(M.text)}je(d.turnId)}function fm(d){vt.value||!ne.value||(pe("default"),la(),I("Implement",[],[],"steer",[],void 0,"default"))}function hm(){if(vt.value||_n.value||typeof document>"u"||!te.value||Dr.value.length===0)return;const d=pm(),v=mm(),M=new Blob([d],{type:"text/markdown;charset=utf-8"}),se=URL.createObjectURL(M),ve=document.createElement("a");ve.href=se,ve.download=v,document.body.appendChild(ve),ve.click(),document.body.removeChild(ve),window.setTimeout(()=>URL.revokeObjectURL(se),0)}function pm(){var M,se,ve;const d=[],v=((se=(M=te.value)==null?void 0:M.title)==null?void 0:se.trim())||"Untitled thread";d.push(`# ${gm(v)}`),d.push(""),d.push(`- Exported: ${new Date().toISOString()}`),d.push(`- Thread ID: ${((ve=te.value)==null?void 0:ve.id)??""}`),d.push(""),d.push("---"),d.push("");for(const Te of Dr.value){const st=Te.role?Te.role.toUpperCase():"MESSAGE";d.push(`## ${st}`),d.push("");const jn=Te.text.trim();if(jn&&(d.push(jn),d.push("")),Te.commandExecution&&(d.push("```text"),d.push(`command: ${Te.commandExecution.command}`),d.push(`status: ${Te.commandExecution.status}`),Te.commandExecution.cwd&&d.push(`cwd: ${Te.commandExecution.cwd}`),Te.commandExecution.exitCode!==null&&d.push(`exitCode: ${Te.commandExecution.exitCode}`),d.push(Te.commandExecution.aggregatedOutput||"(no output)"),d.push("```"),d.push("")),Te.fileAttachments&&Te.fileAttachments.length>0){d.push("Attachments:");for(const so of Te.fileAttachments)d.push(`- ${so.path}`);d.push("")}if(Te.images&&Te.images.length>0){d.push("Images:");for(const so of Te.images)d.push(`- ${so}`);d.push("")}}return`${d.join(`
|
|
61
|
-
`).trimEnd()}
|
|
62
|
-
`}function mm(){var ve,Te;const M=(((Te=(ve=te.value)==null?void 0:ve.title)==null?void 0:Te.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",se=new Date().toISOString().replace(/[:.]/g,"-");return`${M}-${se}.md`}function gm(d){return d.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function Gl(d,v){if(typeof window>"u")return v;const M=window.localStorage.getItem(d);return M===null?v:M==="1"}function vm(){if(typeof window>"u")return"system";const d=window.localStorage.getItem(Vf);return d==="light"||d==="dark"?d:"system"}function ym(){if(typeof window>"u")return"steer";const d=window.localStorage.getItem(zf);return d==="steer"||d==="queue"?d:"queue"}function wm(){if(typeof window>"u")return"standard";const d=window.localStorage.getItem(Jf);return d==="standard"||d==="wide"||d==="extra-wide"?d:"standard"}function bm(){br.value=!br.value,window.localStorage.setItem(Hf,br.value?"1":"0")}function _m(){rn.value=rn.value==="steer"?"queue":"steer",window.localStorage.setItem(zf,rn.value)}function Tm(){const d=["system","light","dark"],v=d.indexOf(Tt.value);Tt.value=d[(v+1)%d.length],window.localStorage.setItem(Vf,Tt.value),_i()}function Sm(){const d=["standard","wide","extra-wide"],v=d.indexOf(ln.value);ln.value=d[(v+1)%d.length],window.localStorage.setItem(Jf,ln.value)}function km(){cr.value=!cr.value,window.localStorage.setItem(Wf,cr.value?"1":"0")}function Cm(){On.value=!On.value,window.localStorage.setItem(Gf,On.value?"1":"0")}async function xm(d){if(!Nt.value){Nt.value=!0;try{if(d==="codex"){un.value="codex";const v=await gf(!1);vn.value=v.enabled}else if(d==="openrouter"){un.value="openrouter";const v=await gf(!0);vn.value=v.enabled,await $a("","",{wireApi:Yn.value,provider:"openrouter"})}else d==="opencode-zen"?(un.value="opencode-zen",await $a("",xr.value.trim(),{wireApi:"chat",provider:"opencode-zen"}),vn.value=!0):d==="custom"&&(un.value="custom",Dn.value.trim()&&kn.value.trim()&&(await $a(Dn.value.trim(),kn.value.trim(),{wireApi:yn.value}),vn.value=!0));on.value="",await Le({includeSelectedThreadMessages:!1,providerChanged:!0,awaitAncillaryRefreshes:!0}),Qe.name==="thread"&&Me.push({name:"home"})}catch(v){on.value=v instanceof Error?v.message:"Failed to switch provider"}finally{Nt.value=!1}}}async function Kl(){if(_t.value)return;const d=Dn.value.trim();if(d){_t.value=!0;try{on.value="",await $a(d,kn.value.trim(),{wireApi:yn.value}),vn.value=!0,await Le({includeSelectedThreadMessages:!1,providerChanged:!0,awaitAncillaryRefreshes:!0})}catch(v){on.value=v instanceof Error?v.message:"Failed to save custom endpoint"}finally{_t.value=!1}}}async function jc(d){if(_t.value||Nt.value||Yn.value===d)return;const v=Yn.value;Yn.value=d,_t.value=!0;try{on.value="",await $a("","",{wireApi:d,provider:"openrouter"}),vn.value=!0,await Le({includeSelectedThreadMessages:!1,providerChanged:!0,awaitAncillaryRefreshes:!0})}catch(M){Yn.value=v,on.value=M instanceof Error?M.message:"Failed to save OpenRouter API format"}finally{_t.value=!1}}async function Fc(){if(_t.value)return;const d=xr.value.trim();if(d){_t.value=!0;try{on.value="",await $a("",d,{wireApi:"chat",provider:"opencode-zen"}),vn.value=!0,await Le({includeSelectedThreadMessages:!1,providerChanged:!0,awaitAncillaryRefreshes:!0})}catch(v){on.value=v instanceof Error?v.message:"Failed to save OpenCode Zen config"}finally{_t.value=!1}}}async function Uc(){if(!_t.value){_t.value=!0;try{const d=It.value.trim();await vf(d),It.value="",await Jl(),await Le({includeSelectedThreadMessages:!1})}catch{}finally{_t.value=!1}}}async function Am(){if(!_t.value){_t.value=!0;try{await vf(""),It.value="",await Jl(),await Le({includeSelectedThreadMessages:!1})}catch{}finally{_t.value=!1}}}async function Jl(){try{const d=await Yb();vn.value=d.enabled,vo.value=d.customKey??!1,Zr.value=d.maskedKey??null,d.enabled?d.provider==="opencode-zen"?un.value="opencode-zen":d.provider==="custom"?(un.value="custom",Dn.value=d.customBaseUrl??"",yn.value=d.wireApi==="chat"?"chat":"responses"):(un.value="openrouter",Yn.value=d.wireApi==="chat"?"chat":"responses"):un.value="codex"}catch{}}function Em(d){const M=Yl(d.trim())||"auto";_r.value=M,window.localStorage.setItem(Kf,M)}function Im(){var M;if(typeof window>"u")return"auto";const d=((M=window.localStorage.getItem(Kf))==null?void 0:M.trim())||"auto";return Yl(d)||"auto"}function Pm(){const d=[{value:"auto",label:o("Auto-detect")}],v=new Set(["auto"]);function M(ve){const Te=x[ve]||ve;return`${Te.charAt(0).toUpperCase()+Te.slice(1)} (${ve})`}for(const ve of typeof navigator<"u"?navigator.languages??[]:[]){const Te=Yl(ve);!Te||v.has(Te)||(v.add(Te),d.push({value:Te,label:`Preferred: ${M(Te)}`}))}for(const ve of Object.keys(x))v.has(ve)||(v.add(ve),d.push({value:ve,label:M(ve)}));const se=_r.value.trim();return se&&!v.has(se)&&d.push({value:se,label:M(se)}),d}function Yl(d){const v=d.trim().toLowerCase();if(!v||v==="auto")return"";if(v in x)return v;const M=v.split("-")[0]??v;return M in x?M:""}function _i(){const d=document.documentElement;if(Tt.value==="dark")d.classList.add("dark");else if(Tt.value==="light")d.classList.remove("dark");else{const v=window.matchMedia("(prefers-color-scheme: dark)").matches;d.classList.toggle("dark",v)}}function Mm(){return typeof window>"u"?!1:window.localStorage.getItem(Bf)==="1"}function Rm(d){typeof window>"u"||window.localStorage.setItem(Bf,d?"1":"0")}function $m(){if(typeof window>"u")return!0;const d=window.localStorage.getItem(qf);return d===null?!0:d==="1"}function Nm(){$n.value=!$n.value,!(typeof window>"u")&&window.localStorage.setItem(qf,$n.value?"1":"0")}function Om(d,v){const M=(d??"").trim();return M.length>0?M:v.trim()||"message"}function Bc(d){pe(d)}async function Dm(){await Me.isReady(),Qe.name==="thread"&&yt.value&&Pe(yt.value),await Le({includeSelectedThreadMessages:Qe.name==="thread"}),fr({silent:!0}),await im(),Pn.value=!0,await Ql(),Q()}async function Ql(){if(mr.value){Qt=!0;return}mr.value=!0;try{do{if(Qt=!1,Qe.name==="home"||Qe.name==="skills"){ne.value!==""&&await ht("");continue}if(Qe.name==="thread"){const d=yt.value;if(!d)continue;ne.value!==d?await ht(d):Xe(d,{silent:!0})}}while(Qt)}finally{mr.value=!1}}gt(()=>[Qe.name,yt.value,Be.value,ne.value],async()=>{Pn.value&&await Ql()}),gt(()=>ne.value,async d=>{if(Pn.value&&!mr.value&&!(vt.value||_n.value)){if(!d){Qe.name!=="home"&&await Me.replace({name:"home"});return}Qe.name==="thread"&&yt.value===d||await Me.replace({name:"thread",params:{threadId:d}})}}),gt(()=>ea.value,d=>{if(d.length===0){ut.value="",yo();return}const v=ut.value.trim();v&&(d.some(se=>se.value===v)||(ut.value="")),yo()},{immediate:!0}),gt(()=>ut.value,()=>{qt.value={phase:"idle",title:"",message:""},yo()}),gt(()=>[Mn.value,ut.value],([d,v])=>{d==="worktree"&&qc(v)},{immediate:!0}),gt(()=>Mn.value,d=>{var v;if(d==="local"){qt.value={phase:"idle",title:"",message:""};const M=ut.value.trim();if(M&&yi(M)){const se=((v=te.value)==null?void 0:v.projectName)??pa(M),ve=vs(se,"");ve&&(ut.value=ve)}return}qc(ut.value)}),gt(()=>Qe.name,d=>{d!=="home"&&(qt.value={phase:"idle",title:"",message:""}),d!=="thread"&&(sn.value=!1)}),gt(()=>ne.value,()=>{qt.value={phase:"idle",title:"",message:""}}),gt(()=>[Qe.name,xn.value],([d,v])=>{if(d!=="thread"){yr.value=[],nn.value=null;return}ao(v)},{immediate:!0}),gt(Or,d=>{typeof document>"u"||(document.title=d)},{immediate:!0}),gt(bt,d=>{d&&!Xt.value&&oe(!0)},{immediate:!0});async function Lm(d,v=[],M=[],se=[]){try{qt.value={phase:"idle",title:"",message:""};let ve=ut.value;if(Mn.value==="worktree"){qt.value={phase:"running",title:o("Creating worktree"),message:o("Creating a worktree and running setup.")};try{const st=await a0(ut.value,Wn.value);ve=st.cwd,ut.value=st.cwd,qt.value={phase:"idle",title:"",message:""}}catch{qt.value={phase:"error",title:o("Worktree setup failed"),message:o("Unable to create worktree. Try again or switch to Local project.")};return}}else if(!ve.trim()){const st=await d0(d);ve=st.cwd,ut.value=st.cwd}const Te=await H(d,ve,v,M,se);if(!Te)return;await Me.replace({name:"thread",params:{threadId:Te}}),la()}catch{}}function jm(d){var se;if((se=d.prompt)!=null&&se.trim())return d.prompt.trim();const v=d.displayName.trim()||d.name.trim(),M=d.kind==="skill"?"skill":d.kind==="plugin"?"plugin":d.kind==="composio"?"Composio connector":"app";return`Test ${v} ${M}. Give me a list of what it can do and one useful example.`}function Fm(d){return`${d.kind}:${d.name}:${d.skillPath??""}`}async function Um(d){var se;if(Vn.value)return;Vn.value=Fm(d);const v=jm(d),M=(se=d.attachedSkills)!=null&&se.length?d.attachedSkills:d.kind==="skill"&&d.skillPath?[{name:d.name,path:d.skillPath}]:[];try{const ve=ni.value.trim()||xn.value.trim(),Te=await H(v,ve,[],M,[]);if(!Te)return;await Me.replace({name:"thread",params:{threadId:Te}}),la()}catch{}finally{Vn.value=""}}async function qc(d){var M;const v=d.trim();if(!v){Kr.value=[],Wn.value="";return}Wt.value=!0;try{const se=await s0(v);Kr.value=se;const ve=Wn.value.trim();if(!(ve.length>0&&se.some(st=>st.value===ve))){const st=se.find(jn=>jn.value.trim()==="main");Wn.value=(st==null?void 0:st.value)??((M=se[0])==null?void 0:M.value)??""}}catch{Kr.value=[],Wn.value=""}finally{Wt.value=!1}}return(d,v)=>(C(),rt(Fw,{"is-sidebar-collapsed":Xt.value,onCloseSidebar:v[26]||(v[26]=M=>oe(!0))},{sidebar:ct(()=>[m("section",iA,[m("div",lA,[Xt.value?ie("",!0):(C(),rt(Mf,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":Xt.value,"show-new-thread-button":!0,onToggleSidebar:v[0]||(v[0]=M=>oe(!Xt.value)),onStartNewThread:ys},{default:ct(()=>[m("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":Et.value,"aria-label":S(o)("Search threads"),title:S(o)("Search threads"),onClick:ci},[Ne(Rf,{class:"sidebar-search-toggle-icon"})],8,uA)]),_:1},8,["is-sidebar-collapsed"])),!Xt.value&&Et.value?(C(),R("div",cA,[Ne(Rf,{class:"sidebar-search-bar-icon"}),cn(m("input",{ref_key:"sidebarSearchInputRef",ref:Gt,"onUpdate:modelValue":v[1]||(v[1]=M=>Ot.value=M),class:"sidebar-search-input",type:"text",placeholder:S(o)("Filter threads..."),onKeydown:Ml},null,40,dA),[[Tn,Ot.value]]),Ot.value.length>0?(C(),R("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":S(o)("Clear search"),onClick:Pl},[Ne(Tx,{class:"sidebar-search-clear-icon"})],8,fA)):ie("",!0)])):ie("",!0),Xt.value?ie("",!0):(C(),R("button",{key:2,class:it(["sidebar-skills-link",{"is-active":_n.value}]),type:"button",onClick:v[2]||(v[2]=M=>{S(Me).push({name:"skills"}),S(bt)&&oe(!0)})},[m("span",hA,[Ne(Ui)]),m("span",pA,[m("span",mA,N(S(o)("Skills")),1),m("span",gA,N(S(o)("Plugins, apps, MCPs")),1)])],2)),Xt.value?ie("",!0):(C(),rt(kS,{key:3,groups:S(j),"project-display-name-by-id":S(q),"selected-thread-id":S(ne),"is-loading":S(Be),"search-query":Ot.value,"search-matched-thread-ids":tn.value,"filter-active":Et.value,onSelect:di,onArchive:vi,onStartNewThread:ql,onRenameProject:i,onBrowseThreadFiles:Hl,onRenameThread:u,onForkThread:Bl,onRemoveProject:p,onReorderProject:y,onExportThread:Rl,onStartNewChat:ys,onToggleFilter:ci},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids","filter-active"]))]),Xt.value?ie("",!0):(C(),R("div",{key:0,ref_key:"settingsAreaRef",ref:gr,class:"sidebar-settings-area",onClick:sa},[Ne(lp,{name:"settings-panel"},{default:ct(()=>[Kn.value?(C(),R("div",{key:0,ref_key:"settingsPanelRef",ref:ir,class:"sidebar-settings-panel",onClick:v[16]||(v[16]=et(()=>{},["stop"]))},[m("div",vA,[m("div",yA,[m("div",wA,[m("button",{class:"sidebar-settings-account-collapse",type:"button","aria-expanded":!$n.value,title:$n.value?S(o)("Expand accounts"):S(o)("Collapse accounts"),onClick:Nm},[m("span",_A,N($n.value?"▸":"▾"),1)],8,bA),m("span",TA,N(S(o)("Accounts")),1),m("span",SA,N(gn.value.length),1)]),m("button",{class:"sidebar-settings-account-refresh",type:"button",disabled:ur.value||Jn.value,onClick:Fl},N(ur.value?S(o)("Reloading…"):S(o)("Reload")),9,kA)]),$n.value?ie("",!0):(C(),R(Ge,{key:0},[Kt.value?(C(),R("p",CA,N(Kt.value),1)):ie("",!0),gn.value.length===0?(C(),R("p",xA,N(S(o)("Run `codex login`, then click reload.")),1)):(C(),R("div",AA,[(C(!0),R(Ge,null,zt(gn.value,M=>(C(),R("article",{key:M.accountId,class:it(["sidebar-settings-account-item",{"is-active":M.isActive,"is-unavailable":oa(M),"is-confirming-remove":aa(M),"is-remove-visible":pi(M)}]),title:gs(M),onMouseenter:se=>Ol(M.accountId),onMouseleave:se=>Dl(M.accountId)},[m("div",IA,[m("p",PA,N(M.email||S(o)("Account")),1),m("p",MA,N(fi(M)),1),m("p",RA,N(mi(M)),1),m("p",$A," Workspace "+N($l(M.accountId)),1)]),m("div",NA,[m("button",{class:"sidebar-settings-account-switch",type:"button",disabled:xa(M)||M.isActive||oa(M),onClick:se=>Ul(M.accountId)},N(Nl(M)),9,OA),m("button",{class:it(["sidebar-settings-account-remove",{"is-visible":pi(M),"is-confirming":aa(M)}]),type:"button",disabled:xa(M),onClick:se=>gi(M.accountId)},N(Aa(M)),11,DA)])],42,EA))),128))]))],64))]),m("button",{class:"sidebar-settings-row",type:"button",title:g.sendWithEnter,onClick:bm},[m("span",jA,N(S(o)("Require ⌘ + enter to send")),1),m("span",{class:it(["sidebar-settings-toggle",{"is-on":!br.value}])},null,2)],8,LA),m("button",{class:"sidebar-settings-row",type:"button",title:g.inProgressSendMode,onClick:_m},[m("span",UA,N(S(o)("When busy, send as")),1),m("span",BA,N(rn.value==="steer"?S(o)("Steer"):S(o)("Queue")),1)],8,FA),m("button",{class:"sidebar-settings-row",type:"button",title:g.appearance,onClick:Tm},[m("span",HA,N(S(o)("Appearance")),1),m("span",zA,N(Tt.value==="system"?S(o)("System"):Tt.value==="dark"?S(o)("Dark"):S(o)("Light")),1)],8,qA),m("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:S(o)("Choose the interface language for the app.")},[m("span",WA,N(S(o)("UI language")),1),m("select",{class:"sidebar-settings-provider-select",value:S(s),onChange:v[3]||(v[3]=M=>S(c)(M.target.value))},[(C(!0),R(Ge,null,zt(S(l),M=>(C(),R("option",{key:M.value,value:M.value},N(M.label),9,KA))),128))],40,GA)],8,VA),m("button",{class:"sidebar-settings-row",type:"button",title:g.chatWidth,onClick:Sm},[m("span",YA,N(S(o)("Chat width")),1),m("span",QA,N(El.value),1)],8,JA),m("button",{class:"sidebar-settings-row",type:"button",title:g.dictationClickToToggle,onClick:km},[m("span",ZA,N(S(o)("Click to toggle dictation")),1),m("span",{class:it(["sidebar-settings-toggle",{"is-on":cr.value}])},null,2)],8,XA),m("button",{class:"sidebar-settings-row",type:"button",title:g.dictationAutoSend,onClick:Cm},[m("span",tE,N(S(o)("Auto send dictation")),1),m("span",{class:it(["sidebar-settings-toggle",{"is-on":On.value}])},null,2)],8,eE),m("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:S(o)("Choose the API provider for the Codex backend")},[m("span",rE,N(S(o)("Provider")),1),m("select",{class:"sidebar-settings-provider-select",value:un.value,disabled:Nt.value,onChange:v[4]||(v[4]=M=>xm(M.target.value))},[...v[27]||(v[27]=[m("option",{value:"codex"},"Codex",-1),m("option",{value:"openrouter"},"OpenRouter",-1),m("option",{value:"opencode-zen"},"OpenCode Zen",-1),m("option",{value:"custom"},"Custom endpoint",-1)])],40,oE)],8,nE),on.value?(C(),R("div",aE,N(on.value),1)):ie("",!0),un.value==="openrouter"?(C(),R("div",sE,[m("div",iE,[m("span",lE,N(S(o)("OpenRouter API key")),1),m("a",uE,N(S(o)("Get API key")),1)]),m("div",cE,[vo.value&&!It.value?(C(),R(Ge,{key:0},[m("span",dE,N(Zr.value),1),m("button",{class:"sidebar-settings-key-clear",type:"button",disabled:_t.value,title:S(o)("Remove custom key, use community keys"),onClick:Am},"✕",8,fE)],64)):(C(),R(Ge,{key:1},[cn(m("input",{"onUpdate:modelValue":v[5]||(v[5]=M=>It.value=M),class:"sidebar-settings-key-input",type:"password",placeholder:S(o)("sk-or-v1-... (optional, uses free keys if empty)"),onKeydown:dn(Uc,["enter"])},null,40,hE),[[Tn,It.value]]),m("button",{class:"sidebar-settings-key-save",type:"button",disabled:_t.value||!It.value.trim(),onClick:Uc},N(_t.value?"...":S(o)("Set")),9,pE)],64))]),m("div",mE,[m("span",gE,N(S(o)("API format")),1),m("div",{class:"sidebar-settings-segmented",role:"group","aria-label":S(o)("OpenRouter API format")},[m("button",{type:"button",class:it(["sidebar-settings-segmented-option",{"is-active":Yn.value==="responses"}]),disabled:_t.value||Nt.value,onClick:v[6]||(v[6]=M=>jc("responses"))}," Responses ",10,yE),m("button",{type:"button",class:it(["sidebar-settings-segmented-option",{"is-active":Yn.value==="chat"}]),disabled:_t.value||Nt.value,onClick:v[7]||(v[7]=M=>jc("chat"))}," Completions ",10,wE)],8,vE)])])):ie("",!0),un.value==="opencode-zen"?(C(),R("div",bE,[m("div",_E,[m("span",TE,N(S(o)("OpenCode Zen API key")),1),m("a",SE,N(S(o)("Get API key")),1)]),m("div",kE,[cn(m("input",{"onUpdate:modelValue":v[8]||(v[8]=M=>xr.value=M),class:"sidebar-settings-key-input",type:"password",placeholder:S(o)("sk-..."),onKeydown:dn(Fc,["enter"])},null,40,CE),[[Tn,xr.value]]),m("button",{class:"sidebar-settings-key-save",type:"button",disabled:_t.value||!xr.value.trim(),onClick:Fc},N(_t.value?"...":S(o)("Save")),9,xE)])])):ie("",!0),un.value==="custom"?(C(),R("div",AE,[m("span",EE,N(S(o)("Custom endpoint URL")),1),m("div",IE,[cn(m("input",{"onUpdate:modelValue":v[9]||(v[9]=M=>Dn.value=M),class:"sidebar-settings-key-input",type:"url",placeholder:S(o)("https://api.example.com/v1"),onKeydown:dn(Kl,["enter"])},null,40,PE),[[Tn,Dn.value]])]),m("span",ME,N(S(o)("API key")),1),m("div",RE,[cn(m("input",{"onUpdate:modelValue":v[10]||(v[10]=M=>kn.value=M),class:"sidebar-settings-key-input",type:"password",placeholder:S(o)("Bearer token (optional)"),onKeydown:dn(Kl,["enter"])},null,40,$E),[[Tn,kn.value]]),m("button",{class:"sidebar-settings-key-save",type:"button",disabled:_t.value||!Dn.value.trim(),onClick:Kl},N(_t.value?"...":S(o)("Save")),9,NE)]),m("div",OE,[m("span",DE,N(S(o)("API format")),1),m("div",{class:"sidebar-settings-segmented",role:"group","aria-label":S(o)("Custom endpoint API format")},[m("button",{type:"button",class:it(["sidebar-settings-segmented-option",{"is-active":yn.value==="responses"}]),onClick:v[11]||(v[11]=M=>yn.value="responses")}," Responses ",2),m("button",{type:"button",class:it(["sidebar-settings-segmented-option",{"is-active":yn.value==="chat"}]),onClick:v[12]||(v[12]=M=>yn.value="chat")}," Completions ",2)],8,LE)])])):ie("",!0),m("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:g.dictationLanguage},[m("span",FE,N(S(o)("Dictation language")),1),Ne(Ha,{class:"sidebar-settings-language-dropdown","model-value":_r.value,options:Xr.value,placeholder:S(o)("Auto-detect"),"open-direction":"up","enable-search":!0,"search-placeholder":S(o)("Search language..."),"onUpdate:modelValue":Em},null,8,["model-value","options","placeholder","search-placeholder"])],8,jE),m("button",{class:"sidebar-settings-row",type:"button","aria-live":"polite",onClick:v[13]||(v[13]=M=>eo.value=!eo.value)},[m("span",UE,N(S(o)("Telegram")),1),m("span",BE,N(ps.value),1)]),eo.value?(C(),R("div",qE,[m("label",HE,[m("span",zE,N(S(o)("Bot token")),1),cn(m("input",{"onUpdate:modelValue":v[14]||(v[14]=M=>Ar.value=M),class:"sidebar-settings-input",type:"password",placeholder:"123456:ABCDEF",autocomplete:"off",spellcheck:"false"},null,512),[[Tn,Ar.value]])]),m("label",VE,[m("span",WE,N(S(o)("Allowed Telegram user IDs")),1),cn(m("textarea",{"onUpdate:modelValue":v[15]||(v[15]=M=>A.value=M),class:"sidebar-settings-textarea",rows:"3",placeholder:`123456789
|
|
63
|
-
987654321`,spellcheck:"false"},null,512),[[Tn,A.value]])]),m("div",GE,N(S(o)("Put one Telegram user ID per line or separate them with commas. Use `*` to allow all Telegram users. Unauthorized users will see their own ID in the rejection message so they can copy it here.")),1),F.value?(C(),R("div",KE,N(F.value),1)):ie("",!0),m("div",JE,[m("button",{class:"sidebar-settings-telegram-save",type:"button",disabled:X.value,onClick:Il},N(X.value?S(o)("Saving…"):S(o)("Save Telegram config")),9,YE)])])):ie("",!0),vl.value?(C(),R("div",{key:5,class:"sidebar-settings-row sidebar-settings-context-row","data-state":oi.value,title:Tl.value},[m("span",XE,N(S(o)("Context")),1),m("span",{class:"sidebar-settings-context-value","data-state":oi.value},[_a(N(bl.value)+" ",1),m("span",eI,N(_l.value),1)],8,ZE)],8,QE)):ie("",!0),m("div",tI,[Ne(zC,{snapshots:S(Re)},null,8,["snapshots"])]),m("div",{class:"sidebar-settings-build-label","aria-label":S(o)("Worktree name and version")}," WT "+N(S(f))+" · v"+N(S(h)),9,nI)],512)):ie("",!0)]),_:1}),m("button",{ref_key:"settingsButtonRef",ref:Jr,class:"sidebar-settings-button",type:"button",onClick:v[17]||(v[17]=et(M=>Kn.value=!Kn.value,["stop"]))},[Ne(px,{class:"sidebar-settings-icon"}),m("span",null,N(S(o)("Settings")),1),m("span",rI,N(S(f))+" · v"+N(S(h)),1)],512)],512))])]),content:ct(()=>[m("section",{class:it(["content-root",{"is-virtual-keyboard-open":gl.value,"is-terminal-open":is.value}]),style:Ao(na.value)},[ka.value?(C(),R("span",oI)):ie("",!0),Ne(IS,{title:Ln.value,accent:_n.value},{leading:ct(()=>[Xt.value||S(bt)?(C(),rt(Mf,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":Xt.value,"show-new-thread-button":!0,onToggleSidebar:v[18]||(v[18]=M=>oe(!Xt.value)),onStartNewThread:ys},null,8,["is-sidebar-collapsed"])):ie("",!0),_n.value?(C(),R("span",aI,[Ne(Ui)])):ie("",!0)]),actions:ct(()=>[ml.value?(C(),R("button",{key:0,class:"content-header-terminal-toggle",type:"button","aria-pressed":is.value,title:`${S(o)("Toggle terminal")} (${hs.value})`,"aria-label":S(o)("Toggle terminal"),onClick:ze},[Ne(yx,{class:"content-header-terminal-toggle-icon"}),m("span",iI,N(hs.value),1)],8,sI)):ie("",!0),S(Qe).name==="thread"&&S(ne)?(C(),rt(Ha,{key:1,class:it(["content-header-branch-dropdown",{"is-review-open":sn.value}]),"model-value":Sl.value,options:kl.value,disabled:Qr.value||fn.value,"enable-search":!0,"search-placeholder":S(o)("Search branches..."),"onUpdate:modelValue":Xp},null,8,["class","model-value","options","disabled","search-placeholder"])):ie("",!0)]),_:1},8,["title","accent"]),m("section",lI,[_n.value?(C(),rt(S(a),{key:0,cwd:ni.value,"thread-id":yt.value,"try-in-flight-key":Vn.value,onSkillsChanged:ra,onTryItem:Um},null,8,["cwd","thread-id","try-in-flight-key"])):vt.value?(C(),R("div",uI,[m("div",cI,[m("p",dI,N(S(o)("Let's build")),1),Ne(Ha,{class:"new-thread-folder-dropdown","model-value":ut.value,options:ea.value,placeholder:S(o)("Choose folder"),"enable-search":!0,"search-placeholder":S(o)("Quick search project"),disabled:!1,"onUpdate:modelValue":tt},null,8,["model-value","options","placeholder","search-placeholder"]),ut.value?(C(),R("p",{key:0,class:"new-thread-folder-selected",title:ut.value},N(S(o)("Selected folder"))+": "+N(ut.value),9,fI)):ie("",!0),m("div",hI,[m("button",{class:"new-thread-folder-action new-thread-folder-action-primary",type:"button",onClick:em},N(S(o)("Select folder")),1),m("button",{class:"new-thread-folder-action",type:"button",onClick:Zp},N(S(o)("Create Project")),1)]),Cr.value?(C(),R("section",pI,[m("div",mI,[m("div",gI,[m("span",vI,[Ne(Ui)]),m("p",yI,N(S(o)("New in Codex")),1)]),m("h2",wI,N(S(o)("Plugins are here")),1),m("p",bI,N(S(o)("Hook Codex up to Gmail, Calendar, GitHub, Slack, Browser Use, and more so it can actually help with real work right away.")),1),v[28]||(v[28]=m("div",{class:"new-thread-launch-card-pills","aria-label":"Example integrations"},[m("span",{class:"new-thread-launch-card-pill"},"Gmail"),m("span",{class:"new-thread-launch-card-pill"},"Calendar"),m("span",{class:"new-thread-launch-card-pill"},"GitHub"),m("span",{class:"new-thread-launch-card-pill"},"Slack"),m("span",{class:"new-thread-launch-card-pill"},"Browser Use")],-1))]),m("div",_I,[m("button",{class:"new-thread-launch-card-button new-thread-launch-card-button-primary",type:"button",onClick:wl},N(S(o)("Explore Plugins & Apps")),1),m("button",{class:"new-thread-launch-card-button",type:"button",onClick:ri},N(S(o)("Dismiss")),1)])])):ie("",!0),(C(),rt(va,{to:"body"},[xt.value?(C(),R("div",{key:0,class:"new-thread-open-folder-overlay",onClick:et(Pa,["self"])},[m("div",{class:"new-thread-open-folder",role:"dialog","aria-modal":"true","aria-label":S(o)("Select folder"),onKeydown:dn(et(Pa,["prevent"]),["esc"])},[m("div",SI,[m("p",kI,N(S(o)("Select folder")),1),m("button",{class:"new-thread-open-folder-close",type:"button",onClick:Pa},N(S(o)("Cancel")),1)]),m("p",CI,N(S(o)("Current folder")),1),m("div",xI,[cn(m("input",{ref_key:"existingFolderPathInputRef",ref:wn,"onUpdate:modelValue":v[19]||(v[19]=M=>Qn.value=M),class:"new-thread-open-folder-path",type:"text",placeholder:S(o)("Current folder"),title:Qn.value||S(o)("Unavailable"),disabled:bn.value||Cn.value,onBlur:om,onKeydown:[dn(et(am,["prevent"]),["enter"]),dn(et(Pa,["prevent"]),["esc"])]},null,40,AI),[[Tn,Qn.value]]),m("button",{class:"new-thread-folder-action new-thread-folder-action-primary",type:"button",disabled:!ta.value||bn.value||Cn.value,onClick:v[20]||(v[20]=M=>zl())},N(Cn.value?S(o)("Opening…"):S(o)("Open")),9,EI)]),m("div",II,[m("label",PI,[cn(m("input",{"onUpdate:modelValue":v[21]||(v[21]=M=>Xo.value=M),class:"new-thread-open-folder-toggle-input",type:"checkbox",onChange:nm},null,544),[[hy,Xo.value]]),m("span",null,N(S(o)("Show hidden folders")),1)]),m("button",{class:it(["new-thread-folder-action",{"new-thread-folder-action-primary":Ie.value}]),type:"button","aria-pressed":Ie.value,disabled:!Xn.value||bn.value||Cn.value||Zt.value||!!Lt.value&&!Ie.value,onClick:sm},N(S(o)("New folder")),11,MI)]),Ie.value?(C(),R("div",RI,[m("div",$I,[cn(m("input",{ref_key:"createFolderInputRef",ref:No,"onUpdate:modelValue":v[22]||(v[22]=M=>lt.value=M),class:"new-thread-open-folder-create-input",type:"text",placeholder:S(o)("Folder name"),onKeydown:[dn(et(Mc,["prevent"]),["enter"]),dn(et(Ts,["prevent"]),["esc"])]},null,40,NI),[[Tn,lt.value]]),m("button",{class:"new-thread-folder-action new-thread-folder-action-primary new-thread-open-folder-create-submit",type:"button",disabled:!Cl.value||Zt.value,onClick:Mc},N(xl.value),9,OI)]),Ct.value?(C(),R("p",DI,N(Ct.value),1)):ie("",!0)])):ie("",!0),cn(m("input",{ref_key:"existingFolderFilterInputRef",ref:Tr,"onUpdate:modelValue":v[23]||(v[23]=M=>Ht.value=M),class:"new-thread-open-folder-filter",type:"text",placeholder:S(o)("Filter folders..."),onKeydown:dn(et(Pa,["prevent"]),["esc"])},null,40,LI),[[Tn,Ht.value]]),Lt.value?(C(),R("div",jI,[m("p",FI,N(Lt.value),1),m("button",{class:"new-thread-folder-action",type:"button",disabled:bn.value||Cn.value,onClick:rm},N(S(o)("Retry")),9,UI)])):ie("",!0),bn.value?(C(),R("p",BI,N(S(o)("Loading folders…")),1)):!Lt.value&&fs.value.length===0?(C(),R("p",qI,N(Ht.value.trim()?S(o)("No folders match this filter."):S(o)("No subfolders found here.")),1)):fs.value.length>0?(C(),R("ul",HI,[(C(!0),R(Ge,null,zt(fs.value,M=>(C(),R("li",{key:M.key,class:"new-thread-open-folder-item"},[m("button",{class:"new-thread-open-folder-item-main",type:"button",title:M.path,disabled:bn.value||Cn.value,onClick:se=>tm(M.path)},[m("span",VI,N(M.name),1)],8,zI),M.kind==="directory"?(C(),R("button",{key:0,class:"new-thread-open-folder-item-open",type:"button",disabled:bn.value||Cn.value,onClick:se=>zl(M.path)},N(S(o)("Open")),9,WI)):ie("",!0)]))),128))])):ie("",!0)],40,TI)])):ie("",!0)])),Ne(JC,{class:"new-thread-runtime-dropdown",modelValue:Mn.value,"onUpdate:modelValue":v[24]||(v[24]=M=>Mn.value=M)},null,8,["modelValue"]),Mn.value==="worktree"?(C(),R("div",GI,[m("p",KI,N(S(o)("Base branch")),1),Ne(Ha,{class:"new-thread-branch-dropdown","model-value":Wn.value,options:cs.value,placeholder:S(o)("Select branch"),"enable-search":!0,"search-placeholder":S(o)("Search branches..."),disabled:Wt.value||cs.value.length===0,"onUpdate:modelValue":hr},null,8,["model-value","options","placeholder","search-placeholder","disabled"]),m("p",JI,N(Wt.value?S(o)("Loading branches…"):ai.value?S(o)("New worktree branch will start from {branch}.",{branch:ai.value}):S(o)("No Git branches found for this folder.")),1)])):ie("",!0),m("p",YI,N(S(o)("Local project uses the selected folder directly. New worktree creates an isolated Git worktree before the first prompt.")),1),qt.value.phase!=="idle"?(C(),R("div",{key:3,class:it(["worktree-init-status",{"is-running":qt.value.phase==="running","is-error":qt.value.phase==="error"}])},[m("strong",QI,N(qt.value.title),1),m("span",XI,N(qt.value.message),1)],2)):ie("",!0)]),m("div",ZI,[Bt.value&&xn.value?(C(),rt(S(n),{key:0,class:"content-thread-terminal-panel","thread-id":Oo.value,cwd:xn.value,onHide:mt,onTerminalFocusChange:pt},null,8,["thread-id","cwd"])):ie("",!0),Ne(Pf,{ref_key:"homeThreadComposerRef",ref:Sn,"active-thread-id":Oo.value,cwd:xn.value,"collaboration-modes":S(Se),"selected-collaboration-mode":S(Ee),models:S(Y),"selected-model":Sa.value,"selected-reasoning-effort":S(He),"selected-speed-mode":S(ee),"is-updating-speed-mode":S(Ve),skills:S(we),"thread-token-usage":S(z),"codex-quota":S(Ue),"is-turn-in-progress":!1,"is-stop-pending":!1,"is-interrupting-turn":!1,"send-with-enter":br.value,"in-progress-submit-mode":rn.value,"dictation-click-to-toggle":cr.value,"dictation-auto-send":On.value,"dictation-language":_r.value,onSubmit:_s,"onUpdate:selectedCollaborationMode":Bc,"onUpdate:selectedModel":Oc,"onUpdate:selectedReasoningEffort":Dc,"onUpdate:selectedSpeedMode":Lc},null,8,["active-thread-id","cwd","collaboration-modes","selected-collaboration-mode","models","selected-model","selected-reasoning-effort","selected-speed-mode","is-updating-speed-mode","skills","thread-token-usage","codex-quota","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","dictation-language"])])])):(C(),R("div",eP,[sn.value&&S(ne)&&xn.value?(C(),rt(S(r),{key:0,"thread-id":S(ne),cwd:xn.value,"is-thread-in-progress":ls.value,onClose:v[25]||(v[25]=M=>sn.value=!1)},null,8,["thread-id","cwd","is-thread-in-progress"])):(C(),R(Ge,{key:1},[m("div",tP,[Ne(S(t),{ref_key:"threadConversationRef",ref:Wr,messages:Dr.value,"is-loading":S(xe),"active-thread-id":Oo.value,cwd:xn.value,"scroll-state":S(O),"live-overlay":Zo.value,"pending-requests":S(Z),onUpdateScrollState:E,onForkThread:G,onRollback:dm,onImplementPlan:fm,onRespondServerRequest:$},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests"])]),m("div",nP,[Ne(OC,{messages:S(J),onEdit:bi,onSteer:S(ye),onDelete:S(ae),onReorder:um},null,8,["messages","onSteer","onDelete"]),S(V)&&S(ne)&&xn.value?(C(),rt(S(n),{key:0,class:"content-thread-terminal-panel","thread-id":S(ne),cwd:xn.value,onHide:wt,onTerminalFocusChange:pt},null,8,["thread-id","cwd"])):ie("",!0),ti.value?(C(),rt(kC,{key:1,request:ti.value,"request-count":S(Z).length,"has-queue-above":S(J).length>0,onRespondServerRequest:$},null,8,["request","request-count","has-queue-above"])):(C(),rt(Pf,{key:2,ref_key:"threadComposerRef",ref:In,"active-thread-id":Oo.value,cwd:xn.value,"collaboration-modes":S(Se),"selected-collaboration-mode":S(Ee),models:S(Y),"selected-model":Sa.value,"selected-reasoning-effort":S(He),"selected-speed-mode":S(ee),"is-updating-speed-mode":S(Ve),skills:S(we),"thread-token-usage":S(z),"codex-quota":S(Ue),"is-turn-in-progress":ls.value,"is-stop-pending":S(nt),"is-interrupting-turn":S(We),"has-queue-above":S(J).length>0,"send-with-enter":br.value,"in-progress-submit-mode":rn.value,"dictation-click-to-toggle":cr.value,"dictation-auto-send":On.value,"dictation-language":_r.value,"onUpdate:selectedCollaborationMode":Bc,onSubmit:_s,"onUpdate:selectedModel":Oc,"onUpdate:selectedReasoningEffort":Dc,"onUpdate:selectedSpeedMode":Lc,onInterrupt:cm},null,8,["active-thread-id","cwd","collaboration-modes","selected-collaboration-mode","models","selected-model","selected-reasoning-effort","selected-speed-mode","is-updating-speed-mode","skills","thread-token-usage","codex-quota","is-turn-in-progress","is-stop-pending","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","dictation-language"]))])],64))]))])],6)]),_:1},8,["is-sidebar-collapsed"]))}}),aP=kt(oP,[["__scopeId","data-v-c404b4b8"]]),Pu={render:()=>null},sP=Mw({history:uw(),routes:[{path:"/",name:"home",component:Pu},{path:"/thread/:threadId",name:"thread",component:Pu},{path:"/skills",name:"skills",component:Pu},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexui. github: https://github.com/friuns2/codexUI");by(aP).use(sP).mount("#app");"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(e=>{console.error(Up("Service worker registration failed."),e)})});export{bP as $,rt as A,vc as B,Mb as C,fP as D,cP as E,Ge as F,hP as G,dP as H,Ks as I,Qo as J,pP as K,cn as L,py as M,MP as N,$P as O,NP as P,lP as Q,RP as R,Pc as S,lp as T,va as U,po as V,Ii as W,Tn as X,uP as Y,mP as Z,kt as _,m as a,CP as a0,xP as a1,gP as a2,kP as a3,AP as a4,IP as a5,PP as a6,vP as a7,yP as a8,wP as a9,_P as aa,SP as ab,TP as ac,EP as ad,Jo as b,R as c,Hn as d,Ta as e,ie as f,zt as g,it as h,iP as i,Ne as j,Ms as k,OS as l,Tx as m,an as n,C as o,et as p,Ao as q,P as r,S as s,N as t,xc as u,_a as v,gt as w,ct as x,le as y,Ei as z};
|