codexui-android 0.1.99 → 0.1.101
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-DEzhdxiz.css → DirectoryHub-B_wdXTQL.css} +1 -1
- package/dist/assets/DirectoryHub-Bm5sZZRJ.js +2 -0
- package/dist/assets/{ReviewPane-AzgWKh85.css → ReviewPane-BJuXPOZb.css} +1 -1
- package/dist/assets/{ReviewPane-BkNGxMQY.js → ReviewPane-Ce6QI-Sf.js} +1 -1
- package/dist/assets/{ThreadConversation-08orN8b4.js → ThreadConversation-BQnEV6OL.js} +1 -1
- package/dist/assets/{ThreadConversation-CJqnXrJL.css → ThreadConversation-DdzQ_R3z.css} +1 -1
- package/dist/assets/{ThreadTerminalPanel-Bik-IBVJ.css → ThreadTerminalPanel-BfzQNi0v.css} +1 -1
- package/dist/assets/{ThreadTerminalPanel-Dw7SInGu.js → ThreadTerminalPanel-DuEjX4F5.js} +1 -1
- package/dist/assets/{index-BpQcV8Wg.css → index-B6Gx9sFJ.css} +1 -1
- package/dist/assets/index-DzzwK-KG.js +63 -0
- package/dist/assets/{index.esm-D_uN0D-X.js → index.esm-BMAgl1KF.js} +1 -1
- package/dist/assets/{index.esm-DvadSfWE.js → index.esm-O-ekzJz9.js} +2 -2
- package/dist/assets/{index.esm--s_sgTDk.js → index.esm-TywpZG2x.js} +2 -2
- package/dist/index.html +2 -2
- package/dist-cli/index.js +43 -11
- package/dist-cli/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/assets/DirectoryHub-BsQI3jt6.js +0 -2
- package/dist/assets/index-Ce2BNria.js +0 -63
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ThreadConversation-08orN8b4.js","assets/ThreadConversation-CJqnXrJL.css","assets/ThreadTerminalPanel-Dw7SInGu.js","assets/ThreadTerminalPanel-Bik-IBVJ.css","assets/ReviewPane-BkNGxMQY.js","assets/ReviewPane-AzgWKh85.css","assets/DirectoryHub-BsQI3jt6.js","assets/DirectoryHub-DEzhdxiz.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 i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).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.31
|
|
4
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
5
|
-
* @license MIT
|
|
6
|
-
**/function ec(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Lt={},za=[],po=()=>{},Gf=()=>!1,Ji=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Yi=e=>e.startsWith("onUpdate:"),pn=Object.assign,tc=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Um=Object.prototype.hasOwnProperty,Mt=(e,t)=>Um.call(e,t),Qe=Array.isArray,Va=e=>zs(e)==="[object Map]",rs=e=>zs(e)==="[object Set]",qc=e=>zs(e)==="[object Date]",ot=e=>typeof e=="function",Yt=e=>typeof e=="string",zr=e=>typeof e=="symbol",Rt=e=>e!==null&&typeof e=="object",Kf=e=>(Rt(e)||ot(e))&&ot(e.then)&&ot(e.catch),Jf=Object.prototype.toString,zs=e=>Jf.call(e),Bm=e=>zs(e).slice(8,-1),Yf=e=>zs(e)==="[object Object]",nc=e=>Yt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,As=ec(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Qi=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},qm=/-\w/g,ar=Qi(e=>e.replace(qm,t=>t.slice(1).toUpperCase())),Hm=/\B([A-Z])/g,Qo=Qi(e=>e.replace(Hm,"-$1").toLowerCase()),Xi=Qi(e=>e.charAt(0).toUpperCase()+e.slice(1)),Jl=Qi(e=>e?`on${Xi(e)}`:""),Ur=(e,t)=>!Object.is(e,t),Ri=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Qf=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Zi=e=>{const t=parseFloat(e);return isNaN(t)?e:t},zm=e=>{const t=Yt(e)?Number(e):NaN;return isNaN(t)?e:t};let Hc;const el=()=>Hc||(Hc=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Io(e){if(Qe(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],a=Yt(r)?Km(r):Io(r);if(a)for(const o in a)t[o]=a[o]}return t}else if(Yt(e)||Rt(e))return e}const Vm=/;(?![^(]*\))/g,Wm=/:([^]+)/,Gm=/\/\*[^]*?\*\//g;function Km(e){const t={};return e.replace(Gm,"").split(Vm).forEach(n=>{if(n){const r=n.split(Wm);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function it(e){let t="";if(Yt(e))t=e;else if(Qe(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 Jm="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Ym=ec(Jm);function Xf(e){return!!e||e===""}function Qm(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=os(e[r],t[r]);return n}function os(e,t){if(e===t)return!0;let n=qc(e),r=qc(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=zr(e),r=zr(t),n||r)return e===t;if(n=Qe(e),r=Qe(t),n||r)return n&&r?Qm(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 i in e){const l=e.hasOwnProperty(i),c=t.hasOwnProperty(i);if(l&&!c||!l&&c||!os(e[i],t[i]))return!1}}return String(e)===String(t)}function rc(e,t){return e.findIndex(n=>os(n,t))}const Zf=e=>!!(e&&e.__v_isRef===!0),N=e=>Yt(e)?e:e==null?"":Qe(e)||Rt(e)&&(e.toString===Jf||!ot(e.toString))?Zf(e)?N(e.value):JSON.stringify(e,eh,2):String(e),eh=(e,t)=>Zf(t)?eh(e,t.value):Va(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,a],o)=>(n[Yl(r,o)+" =>"]=a,n),{})}:rs(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Yl(n))}:zr(t)?Yl(t):Rt(t)&&!Qe(t)&&!Yf(t)?String(t):t,Yl=(e,t="")=>{var n;return zr(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
|
7
|
-
* @vue/reactivity v3.5.31
|
|
8
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
9
|
-
* @license MIT
|
|
10
|
-
**/let fr;class Xm{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=fr,!t&&fr&&(this.index=(fr.scopes||(fr.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=fr;try{return fr=this,t()}finally{fr=n}}}on(){++this._on===1&&(this.prevScope=fr,fr=this)}off(){this._on>0&&--this._on===0&&(fr=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const a=this.parent.scopes.pop();a&&a!==this&&(this.parent.scopes[this.index]=a,a.index=this.index)}this.parent=void 0}}}function Zm(){return fr}let Bt;const Ql=new WeakSet;class th{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,fr&&fr.active&&fr.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ql.has(this)&&(Ql.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||rh(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,zc(this),oh(this);const t=Bt,n=qr;Bt=this,qr=!0;try{return this.fn()}finally{ah(this),Bt=t,qr=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)sc(t);this.deps=this.depsTail=void 0,zc(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ql.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Au(this)&&this.run()}get dirty(){return Au(this)}}let nh=0,Es,Is;function rh(e,t=!1){if(e.flags|=8,t){e.next=Is,Is=e;return}e.next=Es,Es=e}function oc(){nh++}function ac(){if(--nh>0)return;if(Is){let t=Is;for(Is=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Es;){let t=Es;for(Es=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 oh(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function ah(e){let t,n=e.depsTail,r=n;for(;r;){const a=r.prevDep;r.version===-1?(r===n&&(n=a),sc(r),ev(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=a}e.deps=t,e.depsTail=n}function Au(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(sh(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function sh(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Os)||(e.globalVersion=Os,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Au(e))))return;e.flags|=2;const t=e.dep,n=Bt,r=qr;Bt=e,qr=!0;try{oh(e);const a=e.fn(e._value);(t.version===0||Ur(a,e._value))&&(e.flags|=128,e._value=a,t.version++)}catch(a){throw t.version++,a}finally{Bt=n,qr=r,ah(e),e.flags&=-3}}function sc(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)sc(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function ev(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let qr=!0;const ih=[];function Mo(){ih.push(qr),qr=!1}function Ro(){const e=ih.pop();qr=e===void 0?!0:e}function zc(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Bt;Bt=void 0;try{t()}finally{Bt=n}}}let Os=0;class tv{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 ic{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(!Bt||!qr||Bt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Bt)n=this.activeLink=new tv(Bt,this),Bt.deps?(n.prevDep=Bt.depsTail,Bt.depsTail.nextDep=n,Bt.depsTail=n):Bt.deps=Bt.depsTail=n,lh(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=Bt.depsTail,n.nextDep=void 0,Bt.depsTail.nextDep=n,Bt.depsTail=n,Bt.deps===n&&(Bt.deps=r)}return n}trigger(t){this.version++,Os++,this.notify(t)}notify(t){oc();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ac()}}}function lh(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)lh(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Eu=new WeakMap,va=Symbol(""),Iu=Symbol(""),Ds=Symbol("");function jn(e,t,n){if(qr&&Bt){let r=Eu.get(e);r||Eu.set(e,r=new Map);let a=r.get(n);a||(r.set(n,a=new ic),a.map=r,a.key=n),a.track()}}function xo(e,t,n,r,a,o){const i=Eu.get(e);if(!i){Os++;return}const l=c=>{c&&c.trigger()};if(oc(),t==="clear")i.forEach(l);else{const c=Qe(e),f=c&&nc(n);if(c&&n==="length"){const h=Number(r);i.forEach((v,b)=>{(b==="length"||b===Ds||!zr(b)&&b>=h)&&l(v)})}else switch((n!==void 0||i.has(void 0))&&l(i.get(n)),f&&l(i.get(Ds)),t){case"add":c?f&&l(i.get("length")):(l(i.get(va)),Va(e)&&l(i.get(Iu)));break;case"delete":c||(l(i.get(va)),Va(e)&&l(i.get(Iu)));break;case"set":Va(e)&&l(i.get(va));break}}ac()}function Ma(e){const t=Et(e);return t===e?t:(jn(t,"iterate",Ds),Ar(e)?t:t.map(Vr))}function tl(e){return jn(e=Et(e),"iterate",Ds),e}function co(e,t){return $o(e)?Ya(ga(e)?Vr(t):t):Vr(t)}const nv={__proto__:null,[Symbol.iterator](){return Xl(this,Symbol.iterator,e=>co(this,e))},concat(...e){return Ma(this).concat(...e.map(t=>Qe(t)?Ma(t):t))},entries(){return Xl(this,"entries",e=>(e[1]=co(this,e[1]),e))},every(e,t){return _o(this,"every",e,t,void 0,arguments)},filter(e,t){return _o(this,"filter",e,t,n=>n.map(r=>co(this,r)),arguments)},find(e,t){return _o(this,"find",e,t,n=>co(this,n),arguments)},findIndex(e,t){return _o(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return _o(this,"findLast",e,t,n=>co(this,n),arguments)},findLastIndex(e,t){return _o(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return _o(this,"forEach",e,t,void 0,arguments)},includes(...e){return Zl(this,"includes",e)},indexOf(...e){return Zl(this,"indexOf",e)},join(e){return Ma(this).join(e)},lastIndexOf(...e){return Zl(this,"lastIndexOf",e)},map(e,t){return _o(this,"map",e,t,void 0,arguments)},pop(){return ws(this,"pop")},push(...e){return ws(this,"push",e)},reduce(e,...t){return Vc(this,"reduce",e,t)},reduceRight(e,...t){return Vc(this,"reduceRight",e,t)},shift(){return ws(this,"shift")},some(e,t){return _o(this,"some",e,t,void 0,arguments)},splice(...e){return ws(this,"splice",e)},toReversed(){return Ma(this).toReversed()},toSorted(e){return Ma(this).toSorted(e)},toSpliced(...e){return Ma(this).toSpliced(...e)},unshift(...e){return ws(this,"unshift",e)},values(){return Xl(this,"values",e=>co(this,e))}};function Xl(e,t,n){const r=tl(e),a=r[t]();return r!==e&&!Ar(e)&&(a._next=a.next,a.next=()=>{const o=a._next();return o.done||(o.value=n(o.value)),o}),a}const rv=Array.prototype;function _o(e,t,n,r,a,o){const i=tl(e),l=i!==e&&!Ar(e),c=i[t];if(c!==rv[t]){const v=c.apply(e,o);return l?Vr(v):v}let f=n;i!==e&&(l?f=function(v,b){return n.call(this,co(e,v),b,e)}:n.length>2&&(f=function(v,b){return n.call(this,v,b,e)}));const h=c.call(i,f,r);return l&&a?a(h):h}function Vc(e,t,n,r){const a=tl(e),o=a!==e&&!Ar(e);let i=n,l=!1;a!==e&&(o?(l=r.length===0,i=function(f,h,v){return l&&(l=!1,f=co(e,f)),n.call(this,f,co(e,h),v,e)}):n.length>3&&(i=function(f,h,v){return n.call(this,f,h,v,e)}));const c=a[t](i,...r);return l?co(e,c):c}function Zl(e,t,n){const r=Et(e);jn(r,"iterate",Ds);const a=r[t](...n);return(a===-1||a===!1)&&cc(n[0])?(n[0]=Et(n[0]),r[t](...n)):a}function ws(e,t,n=[]){Mo(),oc();const r=Et(e)[t].apply(e,n);return ac(),Ro(),r}const ov=ec("__proto__,__v_isRef,__isVue"),uh=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(zr));function av(e){zr(e)||(e=String(e));const t=Et(this);return jn(t,"has",e),t.hasOwnProperty(e)}class ch{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?mv:ph:o?hh:fh).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Qe(t);if(!a){let c;if(i&&(c=nv[n]))return c;if(n==="hasOwnProperty")return av}const l=Reflect.get(t,n,Un(t)?t:r);if((zr(n)?uh.has(n):ov(n))||(a||jn(t,"get",n),o))return l;if(Un(l)){const c=i&&nc(n)?l:l.value;return a&&Rt(c)?Mu(c):c}return Rt(l)?a?Mu(l):nl(l):l}}class dh extends ch{constructor(t=!1){super(!1,t)}set(t,n,r,a){let o=t[n];const i=Qe(t)&&nc(n);if(!this._isShallow){const f=$o(o);if(!Ar(r)&&!$o(r)&&(o=Et(o),r=Et(r)),!i&&Un(o)&&!Un(r))return f||(o.value=r),!0}const l=i?Number(n)<t.length:Mt(t,n),c=Reflect.set(t,n,r,Un(t)?t:a);return t===Et(a)&&(l?Ur(r,o)&&xo(t,"set",n,r):xo(t,"add",n,r)),c}deleteProperty(t,n){const r=Mt(t,n);t[n];const a=Reflect.deleteProperty(t,n);return a&&r&&xo(t,"delete",n,void 0),a}has(t,n){const r=Reflect.has(t,n);return(!zr(n)||!uh.has(n))&&jn(t,"has",n),r}ownKeys(t){return jn(t,"iterate",Qe(t)?"length":va),Reflect.ownKeys(t)}}class sv extends ch{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const iv=new dh,lv=new sv,uv=new dh(!0);const Pu=e=>e,yi=e=>Reflect.getPrototypeOf(e);function cv(e,t,n){return function(...r){const a=this.__v_raw,o=Et(a),i=Va(o),l=e==="entries"||e===Symbol.iterator&&i,c=e==="keys"&&i,f=a[e](...r),h=n?Pu:t?Ya:Vr;return!t&&jn(o,"iterate",c?Iu:va),pn(Object.create(f),{next(){const{value:v,done:b}=f.next();return b?{value:v,done:b}:{value:l?[h(v[0]),h(v[1])]:h(v),done:b}}})}}function wi(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function dv(e,t){const n={get(a){const o=this.__v_raw,i=Et(o),l=Et(a);e||(Ur(a,l)&&jn(i,"get",a),jn(i,"get",l));const{has:c}=yi(i),f=t?Pu:e?Ya:Vr;if(c.call(i,a))return f(o.get(a));if(c.call(i,l))return f(o.get(l));o!==i&&o.get(a)},get size(){const a=this.__v_raw;return!e&&jn(Et(a),"iterate",va),a.size},has(a){const o=this.__v_raw,i=Et(o),l=Et(a);return e||(Ur(a,l)&&jn(i,"has",a),jn(i,"has",l)),a===l?o.has(a):o.has(a)||o.has(l)},forEach(a,o){const i=this,l=i.__v_raw,c=Et(l),f=t?Pu:e?Ya:Vr;return!e&&jn(c,"iterate",va),l.forEach((h,v)=>a.call(o,f(h),f(v),i))}};return pn(n,e?{add:wi("add"),set:wi("set"),delete:wi("delete"),clear:wi("clear")}:{add(a){const o=Et(this),i=yi(o),l=Et(a),c=!t&&!Ar(a)&&!$o(a)?l:a;return i.has.call(o,c)||Ur(a,c)&&i.has.call(o,a)||Ur(l,c)&&i.has.call(o,l)||(o.add(c),xo(o,"add",c,c)),this},set(a,o){!t&&!Ar(o)&&!$o(o)&&(o=Et(o));const i=Et(this),{has:l,get:c}=yi(i);let f=l.call(i,a);f||(a=Et(a),f=l.call(i,a));const h=c.call(i,a);return i.set(a,o),f?Ur(o,h)&&xo(i,"set",a,o):xo(i,"add",a,o),this},delete(a){const o=Et(this),{has:i,get:l}=yi(o);let c=i.call(o,a);c||(a=Et(a),c=i.call(o,a)),l&&l.call(o,a);const f=o.delete(a);return c&&xo(o,"delete",a,void 0),f},clear(){const a=Et(this),o=a.size!==0,i=a.clear();return o&&xo(a,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(a=>{n[a]=cv(a,e,t)}),n}function lc(e,t){const n=dv(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 fv={get:lc(!1,!1)},hv={get:lc(!1,!0)},pv={get:lc(!0,!1)};const fh=new WeakMap,hh=new WeakMap,ph=new WeakMap,mv=new WeakMap;function vv(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function gv(e){return e.__v_skip||!Object.isExtensible(e)?0:vv(Bm(e))}function nl(e){return $o(e)?e:uc(e,!1,iv,fv,fh)}function mh(e){return uc(e,!1,uv,hv,hh)}function Mu(e){return uc(e,!0,lv,pv,ph)}function uc(e,t,n,r,a){if(!Rt(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=gv(e);if(o===0)return e;const i=a.get(e);if(i)return i;const l=new Proxy(e,o===2?r:n);return a.set(e,l),l}function ga(e){return $o(e)?ga(e.__v_raw):!!(e&&e.__v_isReactive)}function $o(e){return!!(e&&e.__v_isReadonly)}function Ar(e){return!!(e&&e.__v_isShallow)}function cc(e){return e?!!e.__v_raw:!1}function Et(e){const t=e&&e.__v_raw;return t?Et(t):e}function yv(e){return!Mt(e,"__v_skip")&&Object.isExtensible(e)&&Qf(e,"__v_skip",!0),e}const Vr=e=>Rt(e)?nl(e):e,Ya=e=>Rt(e)?Mu(e):e;function Un(e){return e?e.__v_isRef===!0:!1}function I(e){return vh(e,!1)}function wv(e){return vh(e,!0)}function vh(e,t){return Un(e)?e:new bv(e,t)}class bv{constructor(t,n){this.dep=new ic,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Et(t),this._value=n?t:Vr(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Ar(t)||$o(t);t=r?t:Et(t),Ur(t,n)&&(this._rawValue=t,this._value=r?t:Vr(t),this.dep.trigger())}}function T(e){return Un(e)?e.value:e}const _v={get:(e,t,n)=>t==="__v_raw"?e:T(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const a=e[t];return Un(a)&&!Un(n)?(a.value=n,!0):Reflect.set(e,t,n,r)}};function gh(e){return ga(e)?e:new Proxy(e,_v)}class Tv{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ic(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Os-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Bt!==this)return rh(this,!0),!0}get value(){const t=this.dep.track();return sh(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function kv(e,t,n=!1){let r,a;return ot(e)?r=e:(r=e.get,a=e.set),new Tv(r,a,n)}const bi={},Ui=new WeakMap;let da;function Sv(e,t=!1,n=da){if(n){let r=Ui.get(n);r||Ui.set(n,r=[]),r.push(e)}}function Cv(e,t,n=Lt){const{immediate:r,deep:a,once:o,scheduler:i,augmentJob:l,call:c}=n,f=X=>a?X:Ar(X)||a===!1||a===0?Ao(X,1):Ao(X);let h,v,b,x,j=!1,q=!1;if(Un(e)?(v=()=>e.value,j=Ar(e)):ga(e)?(v=()=>f(e),j=!0):Qe(e)?(q=!0,j=e.some(X=>ga(X)||Ar(X)),v=()=>e.map(X=>{if(Un(X))return X.value;if(ga(X))return f(X);if(ot(X))return c?c(X,2):X()})):ot(e)?t?v=c?()=>c(e,2):e:v=()=>{if(b){Mo();try{b()}finally{Ro()}}const X=da;da=h;try{return c?c(e,3,[x]):e(x)}finally{da=X}}:v=po,t&&a){const X=v,Ce=a===!0?1/0:a;v=()=>Ao(X(),Ce)}const te=Zm(),H=()=>{h.stop(),te&&te.active&&tc(te.effects,h)};if(o&&t){const X=t;t=(...Ce)=>{X(...Ce),H()}}let O=q?new Array(e.length).fill(bi):bi;const V=X=>{if(!(!(h.flags&1)||!h.dirty&&!X))if(t){const Ce=h.run();if(a||j||(q?Ce.some((Oe,ce)=>Ur(Oe,O[ce])):Ur(Ce,O))){b&&b();const Oe=da;da=h;try{const ce=[Ce,O===bi?void 0:q&&O[0]===bi?[]:O,x];O=Ce,c?c(t,3,ce):t(...ce)}finally{da=Oe}}}else h.run()};return l&&l(V),h=new th(v),h.scheduler=i?()=>i(V,!1):V,x=X=>Sv(X,!1,h),b=h.onStop=()=>{const X=Ui.get(h);if(X){if(c)c(X,4);else for(const Ce of X)Ce();Ui.delete(h)}},t?r?V(!0):O=h.run():i?i(V.bind(null,!0),!0):h.run(),H.pause=h.pause.bind(h),H.resume=h.resume.bind(h),H.stop=H,H}function Ao(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--,Un(e))Ao(e.value,t,n);else if(Qe(e))for(let r=0;r<e.length;r++)Ao(e[r],t,n);else if(rs(e)||Va(e))e.forEach(r=>{Ao(r,t,n)});else if(Yf(e)){for(const r in e)Ao(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Ao(e[r],t,n)}return e}/**
|
|
11
|
-
* @vue/runtime-core v3.5.31
|
|
12
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
13
|
-
* @license MIT
|
|
14
|
-
**/function Vs(e,t,n,r){try{return r?e(...r):e()}catch(a){Ws(a,t,n)}}function Wr(e,t,n,r){if(ot(e)){const a=Vs(e,t,n,r);return a&&Kf(a)&&a.catch(o=>{Ws(o,t,n)}),a}if(Qe(e)){const a=[];for(let o=0;o<e.length;o++)a.push(Wr(e[o],t,n,r));return a}}function Ws(e,t,n,r=!0){const a=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||Lt;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 v=0;v<h.length;v++)if(h[v](e,c,f)===!1)return}l=l.parent}if(o){Mo(),Vs(o,null,10,[e,c,f]),Ro();return}}xv(e,n,a,r,i)}function xv(e,t,n,r=!0,a=!1){if(a)throw e;console.error(e)}const rr=[];let lo=-1;const Wa=[];let Wo=null,Da=0;const yh=Promise.resolve();let Bi=null;function sn(e){const t=Bi||yh;return e?t.then(this?e.bind(this):e):t}function Av(e){let t=lo+1,n=rr.length;for(;t<n;){const r=t+n>>>1,a=rr[r],o=Ls(a);o<e||o===e&&a.flags&2?t=r+1:n=r}return t}function dc(e){if(!(e.flags&1)){const t=Ls(e),n=rr[rr.length-1];!n||!(e.flags&2)&&t>=Ls(n)?rr.push(e):rr.splice(Av(t),0,e),e.flags|=1,wh()}}function wh(){Bi||(Bi=yh.then(_h))}function Ev(e){Qe(e)?Wa.push(...e):Wo&&e.id===-1?Wo.splice(Da+1,0,e):e.flags&1||(Wa.push(e),e.flags|=1),wh()}function Wc(e,t,n=lo+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 bh(e){if(Wa.length){const t=[...new Set(Wa)].sort((n,r)=>Ls(n)-Ls(r));if(Wa.length=0,Wo){Wo.push(...t);return}for(Wo=t,Da=0;Da<Wo.length;Da++){const n=Wo[Da];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Wo=null,Da=0}}const Ls=e=>e.id==null?e.flags&2?-1:1/0:e.id;function _h(e){try{for(lo=0;lo<rr.length;lo++){const t=rr[lo];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Vs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;lo<rr.length;lo++){const t=rr[lo];t&&(t.flags&=-2)}lo=-1,rr.length=0,bh(),Bi=null,(rr.length||Wa.length)&&_h()}}let In=null,Th=null;function qi(e){const t=In;return In=e,Th=e&&e.type.__scopeId||null,t}function ut(e,t=In,n){if(!t||e._n)return e;const r=(...a)=>{r._d&&Vi(-1);const o=qi(t);let i;try{i=e(...a)}finally{qi(o),r._d&&Vi(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function ln(e,t){if(In===null)return e;const n=il(In),r=e.dirs||(e.dirs=[]);for(let a=0;a<t.length;a++){let[o,i,l,c=Lt]=t[a];o&&(ot(o)&&(o={mounted:o,updated:o}),o.deep&&Ao(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:l,modifiers:c}))}return e}function ia(e,t,n,r){const a=e.dirs,o=t&&t.dirs;for(let i=0;i<a.length;i++){const l=a[i];o&&(l.oldValue=o[i].value);let c=l.dir[r];c&&(Mo(),Wr(c,n,8,[e.el,l,e,t]),Ro())}}function $i(e,t){if(En){let n=En.provides;const r=En.parent&&En.parent.provides;r===n&&(n=En.provides=Object.create(r)),n[e]=t}}function Hr(e,t,n=!1){const r=yc();if(r||Ka){let a=Ka?Ka._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 Iv=Symbol.for("v-scx"),Pv=()=>Hr(Iv);function vt(e,t,n){return kh(e,t,n)}function kh(e,t,n=Lt){const{immediate:r,deep:a,flush:o,once:i}=n,l=pn({},n),c=t&&r||!t&&o!=="post";let f;if(Xa){if(o==="sync"){const x=Pv();f=x.__watcherHandles||(x.__watcherHandles=[])}else if(!c){const x=()=>{};return x.stop=po,x.resume=po,x.pause=po,x}}const h=En;l.call=(x,j,q)=>Wr(x,h,j,q);let v=!1;o==="post"?l.scheduler=x=>{Ln(x,h&&h.suspense)}:o!=="sync"&&(v=!0,l.scheduler=(x,j)=>{j?x():dc(x)}),l.augmentJob=x=>{t&&(x.flags|=4),v&&(x.flags|=2,h&&(x.id=h.uid,x.i=h))};const b=Cv(e,t,l);return Xa&&(f?f.push(b):c&&b()),b}function Mv(e,t,n){const r=this.proxy,a=Yt(e)?e.includes(".")?Sh(r,e):()=>r[e]:e.bind(r,r);let o;ot(t)?o=t:(o=t.handler,n=t);const i=Ks(this),l=kh(a,o.bind(r),n);return i(),l}function Sh(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 Ch=Symbol("_vte"),xh=e=>e.__isTeleport,Ps=e=>e&&(e.disabled||e.disabled===""),Rv=e=>e&&(e.defer||e.defer===""),Gc=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Kc=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ru=(e,t)=>{const n=e&&e.to;return Yt(n)?t?t(n):null:n},Ah={name:"Teleport",__isTeleport:!0,process(e,t,n,r,a,o,i,l,c,f){const{mc:h,pc:v,pbc:b,o:{insert:x,querySelector:j,createText:q,createComment:te}}=f,H=Ps(t.props);let{shapeFlag:O,children:V,dynamicChildren:X}=t;if(e==null){const Ce=t.el=q(""),Oe=t.anchor=q("");x(Ce,n,r),x(Oe,n,r);const ce=(Z,Ae)=>{O&16&&h(V,Z,Ae,a,o,i,l,c)},xe=()=>{const Z=t.target=Ru(t.props,j),Ae=$u(Z,t,q,x);Z&&(i!=="svg"&&Gc(Z)?i="svg":i!=="mathml"&&Kc(Z)&&(i="mathml"),a&&a.isCE&&(a.ce._teleportTargets||(a.ce._teleportTargets=new Set)).add(Z),H||(ce(Z,Ae),Ni(t,!1)))};H&&(ce(n,Oe),Ni(t,!0)),Rv(t.props)||o&&o.pendingBranch?(t.el.__isMounted=!1,Ln(()=>{t.el.__isMounted===!1&&(xe(),delete t.el.__isMounted)},o)):xe()}else{t.el=e.el,t.targetStart=e.targetStart;const Ce=t.anchor=e.anchor,Oe=t.target=e.target,ce=t.targetAnchor=e.targetAnchor;if(e.el.__isMounted===!1){Ln(()=>{Ah.process(e,t,n,r,a,o,i,l,c,f)},o);return}const xe=Ps(e.props),Z=xe?n:Oe,Ae=xe?Ce:ce;if(i==="svg"||Gc(Oe)?i="svg":(i==="mathml"||Kc(Oe))&&(i="mathml"),X?(b(e.dynamicChildren,X,Z,a,o,i,l),vc(e,t,!0)):c||v(e,t,Z,Ae,a,o,i,l,!1),H)xe?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):_i(t,n,Ce,f,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const He=t.target=Ru(t.props,j);He&&_i(t,He,null,f,0)}else xe&&_i(t,Oe,ce,f,1);Ni(t,H)}},remove(e,t,n,{um:r,o:{remove:a}},o){const{shapeFlag:i,children:l,anchor:c,targetStart:f,targetAnchor:h,target:v,props:b}=e;if(v&&(a(f),a(h)),o&&a(c),i&16){const x=o||!Ps(b);for(let j=0;j<l.length;j++){const q=l[j];r(q,t,n,x,!!q.dynamicChildren)}}},move:_i,hydrate:$v};function _i(e,t,n,{o:{insert:r},m:a},o=2){o===0&&r(e.targetAnchor,t,n);const{el:i,anchor:l,shapeFlag:c,children:f,props:h}=e,v=o===2;if(v&&r(i,t,n),(!v||Ps(h))&&c&16)for(let b=0;b<f.length;b++)a(f[b],t,n,2);v&&r(l,t,n)}function $v(e,t,n,r,a,o,{o:{nextSibling:i,parentNode:l,querySelector:c,insert:f,createText:h}},v){function b(te,H){let O=H;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&&i(t.targetAnchor);break}}O=i(O)}}function x(te,H){H.anchor=v(i(te),H,l(te),n,r,a,o)}const j=t.target=Ru(t.props,c),q=Ps(t.props);if(j){const te=j._lpa||j.firstChild;t.shapeFlag&16&&(q?(x(e,t),b(j,te),t.targetAnchor||$u(j,t,h,f,l(e)===j?e:null)):(t.anchor=i(e),b(j,te),t.targetAnchor||$u(j,t,h,f),v(te&&i(te),t,j,n,r,a,o))),Ni(t,q)}else q&&t.shapeFlag&16&&(x(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const pa=Ah;function Ni(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 $u(e,t,n,r,a=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Ch]=i,e&&(r(o,e,a),r(i,e,a)),i}const uo=Symbol("_leaveCb"),bs=Symbol("_enterCb");function Nv(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Xo(()=>{e.isMounted=!0}),wa(()=>{e.isUnmounting=!0}),e}const xr=[Function,Array],Eh={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:xr,onEnter:xr,onAfterEnter:xr,onEnterCancelled:xr,onBeforeLeave:xr,onLeave:xr,onAfterLeave:xr,onLeaveCancelled:xr,onBeforeAppear:xr,onAppear:xr,onAfterAppear:xr,onAppearCancelled:xr},Ih=e=>{const t=e.subTree;return t.component?Ih(t.component):t},Ov={name:"BaseTransition",props:Eh,setup(e,{slots:t}){const n=yc(),r=Nv();return()=>{const a=t.default&&Rh(t.default(),!0);if(!a||!a.length)return;const o=Ph(a),i=Et(e),{mode:l}=i;if(r.isLeaving)return eu(o);const c=Jc(o);if(!c)return eu(o);let f=Nu(c,i,r,n,v=>f=v);c.type!==Fn&&js(c,f);let h=n.subTree&&Jc(n.subTree);if(h&&h.type!==Fn&&!ha(h,c)&&Ih(n).type!==Fn){let v=Nu(h,i,r,n);if(js(h,v),l==="out-in"&&c.type!==Fn)return r.isLeaving=!0,v.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete v.afterLeave,h=void 0},eu(o);l==="in-out"&&c.type!==Fn?v.delayLeave=(b,x,j)=>{const q=Mh(r,h);q[String(h.key)]=h,b[uo]=()=>{x(),b[uo]=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 Ph(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Fn){t=n;break}}return t}const Dv=Ov;function Mh(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 Nu(e,t,n,r,a){const{appear:o,mode:i,persisted:l=!1,onBeforeEnter:c,onEnter:f,onAfterEnter:h,onEnterCancelled:v,onBeforeLeave:b,onLeave:x,onAfterLeave:j,onLeaveCancelled:q,onBeforeAppear:te,onAppear:H,onAfterAppear:O,onAppearCancelled:V}=t,X=String(e.key),Ce=Mh(n,e),Oe=(Z,Ae)=>{Z&&Wr(Z,r,9,Ae)},ce=(Z,Ae)=>{const He=Ae[1];Oe(Z,Ae),Qe(Z)?Z.every(ee=>ee.length<=1)&&He():Z.length<=1&&He()},xe={mode:i,persisted:l,beforeEnter(Z){let Ae=c;if(!n.isMounted)if(o)Ae=te||c;else return;Z[uo]&&Z[uo](!0);const He=Ce[X];He&&ha(e,He)&&He.el[uo]&&He.el[uo](),Oe(Ae,[Z])},enter(Z){if(Ce[X]===e)return;let Ae=f,He=h,ee=v;if(!n.isMounted)if(o)Ae=H||f,He=O||h,ee=V||v;else return;let be=!1;Z[bs]=Ke=>{be||(be=!0,Ke?Oe(ee,[Z]):Oe(He,[Z]),xe.delayedLeave&&xe.delayedLeave(),Z[bs]=void 0)};const Le=Z[bs].bind(null,!1);Ae?ce(Ae,[Z,Le]):Le()},leave(Z,Ae){const He=String(e.key);if(Z[bs]&&Z[bs](!0),n.isUnmounting)return Ae();Oe(b,[Z]);let ee=!1;Z[uo]=Le=>{ee||(ee=!0,Ae(),Le?Oe(q,[Z]):Oe(j,[Z]),Z[uo]=void 0,Ce[He]===e&&delete Ce[He])};const be=Z[uo].bind(null,!1);Ce[He]=e,x?ce(x,[Z,be]):be()},clone(Z){const Ae=Nu(Z,t,n,r,a);return a&&a(Ae),Ae}};return xe}function eu(e){if(Gs(e))return e=Yo(e),e.children=null,e}function Jc(e){if(!Gs(e))return xh(e.type)&&e.children?Ph(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 js(e,t){e.shapeFlag&6&&e.component?(e.transition=t,js(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 Rh(e,t=!1,n){let r=[],a=0;for(let o=0;o<e.length;o++){let i=e[o];const l=n==null?i.key:String(n)+String(i.key!=null?i.key:o);i.type===Ge?(i.patchFlag&128&&a++,r=r.concat(Rh(i.children,t,l))):(t||i.type!==Fn)&&r.push(l!=null?Yo(i,{key:l}):i)}if(a>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function Bn(e,t){return ot(e)?pn({name:e.name},t,{setup:e}):e}function fc(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Yc(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Hi=new WeakMap;function Ms(e,t,n,r,a=!1){if(Qe(e)){e.forEach((q,te)=>Ms(q,t&&(Qe(t)?t[te]:t),n,r,a));return}if(Ga(r)&&!a){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Ms(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?il(r.component):r.el,i=a?null:o,{i:l,r:c}=e,f=t&&t.r,h=l.refs===Lt?l.refs={}:l.refs,v=l.setupState,b=Et(v),x=v===Lt?Gf:q=>Yc(h,q)?!1:Mt(b,q),j=(q,te)=>!(te&&Yc(h,te));if(f!=null&&f!==c){if(Qc(t),Yt(f))h[f]=null,x(f)&&(v[f]=null);else if(Un(f)){const q=t;j(f,q.k)&&(f.value=null),q.k&&(h[q.k]=null)}}if(ot(c))Vs(c,l,12,[i,h]);else{const q=Yt(c),te=Un(c);if(q||te){const H=()=>{if(e.f){const O=q?x(c)?v[c]:h[c]:j()||!e.k?c.value:h[e.k];if(a)Qe(O)&&tc(O,o);else if(Qe(O))O.includes(o)||O.push(o);else if(q)h[c]=[o],x(c)&&(v[c]=h[c]);else{const V=[o];j(c,e.k)&&(c.value=V),e.k&&(h[e.k]=V)}}else q?(h[c]=i,x(c)&&(v[c]=i)):te&&(j(c,e.k)&&(c.value=i),e.k&&(h[e.k]=i))};if(i){const O=()=>{H(),Hi.delete(e)};O.id=-1,Hi.set(e,O),Ln(O,n)}else Qc(e),H()}}}function Qc(e){const t=Hi.get(e);t&&(t.flags|=8,Hi.delete(e))}const Xc=e=>e.nodeType===8;el().requestIdleCallback;el().cancelIdleCallback;function Lv(e,t){if(Xc(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(Xc(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const Ga=e=>!!e.type.__asyncLoader;function Ti(e){ot(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:a=200,hydrate:o,timeout:i,suspensible:l=!0,onError:c}=e;let f=null,h,v=0;const b=()=>(v++,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,H)=>{c(q,()=>te(b()),()=>H(q),v+1)});throw q}).then(q=>j!==f&&f?f:(q&&(q.__esModule||q[Symbol.toStringTag]==="Module")&&(q=q.default),h=q,q)))};return Bn({name:"AsyncComponentWrapper",__asyncLoader:x,__asyncHydrate(j,q,te){let H=!1;(q.bu||(q.bu=[])).push(()=>H=!0);const O=()=>{H||te()},V=o?()=>{const X=o(O,Ce=>Lv(j,Ce));X&&(q.bum||(q.bum=[])).push(X)}:O;h?V():x().then(()=>!q.isUnmounted&&V())},get __asyncResolved(){return h},setup(){const j=En;if(fc(j),h)return()=>ki(h,j);const q=V=>{f=null,Ws(V,j,13,!r)};if(l&&j.suspense||Xa)return x().then(V=>()=>ki(V,j)).catch(V=>(q(V),()=>r?Ne(r,{error:V}):null));const te=I(!1),H=I(),O=I(!!a);return a&&setTimeout(()=>{O.value=!1},a),i!=null&&setTimeout(()=>{if(!te.value&&!H.value){const V=new Error(`Async component timed out after ${i}ms.`);q(V),H.value=V}},i),x().then(()=>{te.value=!0,j.parent&&Gs(j.parent.vnode)&&j.parent.update()}).catch(V=>{q(V),H.value=V}),()=>{if(te.value&&h)return ki(h,j);if(H.value&&r)return Ne(r,{error:H.value});if(n&&!O.value)return ki(n,j)}}})}function ki(e,t){const{ref:n,props:r,children:a,ce:o}=t.vnode,i=Ne(e,r,a);return i.ref=n,i.ce=o,delete t.vnode.ce,i}const Gs=e=>e.type.__isKeepAlive;function jv(e,t){$h(e,"a",t)}function Fv(e,t){$h(e,"da",t)}function $h(e,t,n=En){const r=e.__wdc||(e.__wdc=()=>{let a=n;for(;a;){if(a.isDeactivated)return;a=a.parent}return e()});if(rl(t,r,n),n){let a=n.parent;for(;a&&a.parent;)Gs(a.parent.vnode)&&Uv(r,t,n,a),a=a.parent}}function Uv(e,t,n,r){const a=rl(t,e,r,!0);ol(()=>{tc(r[t],a)},n)}function rl(e,t,n=En,r=!1){if(n){const a=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Mo();const l=Ks(n),c=Wr(t,n,e,i);return l(),Ro(),c});return r?a.unshift(o):a.push(o),o}}const Oo=e=>(t,n=En)=>{(!Xa||e==="sp")&&rl(e,(...r)=>t(...r),n)},Bv=Oo("bm"),Xo=Oo("m"),qv=Oo("bu"),Hv=Oo("u"),wa=Oo("bum"),ol=Oo("um"),zv=Oo("sp"),Vv=Oo("rtg"),Wv=Oo("rtc");function Gv(e,t=En){rl("ec",e,t)}const Kv="components",Nh=Symbol.for("v-ndc");function hc(e){return Yt(e)?Jv(Kv,e,!1)||e:e||Nh}function Jv(e,t,n=!0,r=!1){const a=In||En;if(a){const o=a.type;{const l=Ng(o,!1);if(l&&(l===t||l===ar(t)||l===Xi(ar(t))))return o}const i=Zc(a[e]||o[e],t)||Zc(a.appContext[e],t);return!i&&r?o:i}}function Zc(e,t){return e&&(e[t]||e[ar(t)]||e[Xi(ar(t))])}function Vt(e,t,n,r){let a;const o=n,i=Qe(e);if(i||Yt(e)){const l=i&&ga(e);let c=!1,f=!1;l&&(c=!Ar(e),f=$o(e),e=tl(e)),a=new Array(e.length);for(let h=0,v=e.length;h<v;h++)a[h]=t(c?f?Ya(Vr(e[h])):Vr(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 ho(e,t,n={},r,a){if(In.ce||In.parent&&Ga(In.parent)&&In.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 i=o&&Oh(o(n)),l=n.key||i&&i.key,c=rt(Ge,{key:(l&&!zr(l)?l:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),c}function Oh(e){return e.some(t=>Fs(t)?!(t.type===Fn||t.type===Ge&&!Oh(t.children)):!0)?e:null}const Ou=e=>e?tp(e)?il(e):Ou(e.parent):null,Rs=pn(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=>Ou(e.parent),$root:e=>Ou(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Lh(e),$forceUpdate:e=>e.f||(e.f=()=>{dc(e.update)}),$nextTick:e=>e.n||(e.n=sn.bind(e.proxy)),$watch:e=>Mv.bind(e)}),tu=(e,t)=>e!==Lt&&!e.__isScriptSetup&&Mt(e,t),Yv={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:a,props:o,accessCache:i,type:l,appContext:c}=e;if(t[0]!=="$"){const b=i[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(tu(r,t))return i[t]=1,r[t];if(a!==Lt&&Mt(a,t))return i[t]=2,a[t];if(Mt(o,t))return i[t]=3,o[t];if(n!==Lt&&Mt(n,t))return i[t]=4,n[t];Du&&(i[t]=0)}}const f=Rs[t];let h,v;if(f)return t==="$attrs"&&jn(e.attrs,"get",""),f(e);if((h=l.__cssModules)&&(h=h[t]))return h;if(n!==Lt&&Mt(n,t))return i[t]=4,n[t];if(v=c.config.globalProperties,Mt(v,t))return v[t]},set({_:e},t,n){const{data:r,setupState:a,ctx:o}=e;return tu(a,t)?(a[t]=n,!0):r!==Lt&&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:i}},l){let c;return!!(n[l]||e!==Lt&&l[0]!=="$"&&Mt(e,l)||tu(t,l)||Mt(o,l)||Mt(r,l)||Mt(Rs,l)||Mt(a.config.globalProperties,l)||(c=i.__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 Qv(){return Xv().slots}function Xv(e){const t=yc();return t.setupContext||(t.setupContext=rp(t))}function ed(e){return Qe(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Du=!0;function Zv(e){const t=Lh(e),n=e.proxy,r=e.ctx;Du=!1,t.beforeCreate&&td(t.beforeCreate,e,"bc");const{data:a,computed:o,methods:i,watch:l,provide:c,inject:f,created:h,beforeMount:v,mounted:b,beforeUpdate:x,updated:j,activated:q,deactivated:te,beforeDestroy:H,beforeUnmount:O,destroyed:V,unmounted:X,render:Ce,renderTracked:Oe,renderTriggered:ce,errorCaptured:xe,serverPrefetch:Z,expose:Ae,inheritAttrs:He,components:ee,directives:be,filters:Le}=t;if(f&&eg(f,r,null),i)for(const Se in i){const me=i[Se];ot(me)&&(r[Se]=me.bind(n))}if(a){const Se=a.call(n,n);Rt(Se)&&(e.data=nl(Se))}if(Du=!0,o)for(const Se in o){const me=o[Se],We=ot(me)?me.bind(n,n):ot(me.get)?me.get.bind(n,n):po,nt=!ot(me)&&ot(me.set)?me.set.bind(n):po,ze=ae({get:We,set:nt});Object.defineProperty(r,Se,{enumerable:!0,configurable:!0,get:()=>ze.value,set:je=>ze.value=je})}if(l)for(const Se in l)Dh(l[Se],r,n,Se);if(c){const Se=ot(c)?c.call(n):c;Reflect.ownKeys(Se).forEach(me=>{$i(me,Se[me])})}h&&td(h,e,"c");function Ue(Se,me){Qe(me)?me.forEach(We=>Se(We.bind(n))):me&&Se(me.bind(n))}if(Ue(Bv,v),Ue(Xo,b),Ue(qv,x),Ue(Hv,j),Ue(jv,q),Ue(Fv,te),Ue(Gv,xe),Ue(Wv,Oe),Ue(Vv,ce),Ue(wa,O),Ue(ol,X),Ue(zv,Z),Qe(Ae))if(Ae.length){const Se=e.exposed||(e.exposed={});Ae.forEach(me=>{Object.defineProperty(Se,me,{get:()=>n[me],set:We=>n[me]=We,enumerable:!0})})}else e.exposed||(e.exposed={});Ce&&e.render===po&&(e.render=Ce),He!=null&&(e.inheritAttrs=He),ee&&(e.components=ee),be&&(e.directives=be),Z&&fc(e)}function eg(e,t,n=po){Qe(e)&&(e=Lu(e));for(const r in e){const a=e[r];let o;Rt(a)?"default"in a?o=Hr(a.from||r,a.default,!0):o=Hr(a.from||r):o=Hr(a),Un(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function td(e,t,n){Wr(Qe(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Dh(e,t,n,r){let a=r.includes(".")?Sh(n,r):()=>n[r];if(Yt(e)){const o=t[e];ot(o)&&vt(a,o)}else if(ot(e))vt(a,e.bind(n));else if(Rt(e))if(Qe(e))e.forEach(o=>Dh(o,t,n,r));else{const o=ot(e.handler)?e.handler.bind(n):t[e.handler];ot(o)&&vt(a,o,e)}}function Lh(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:a,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,l=o.get(t);let c;return l?c=l:!a.length&&!n&&!r?c=t:(c={},a.length&&a.forEach(f=>zi(c,f,i,!0)),zi(c,t,i)),Rt(t)&&o.set(t,c),c}function zi(e,t,n,r=!1){const{mixins:a,extends:o}=t;o&&zi(e,o,n,!0),a&&a.forEach(i=>zi(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const l=tg[i]||n&&n[i];e[i]=l?l(e[i],t[i]):t[i]}return e}const tg={data:nd,props:rd,emits:rd,methods:Ss,computed:Ss,beforeCreate:tr,created:tr,beforeMount:tr,mounted:tr,beforeUpdate:tr,updated:tr,beforeDestroy:tr,beforeUnmount:tr,destroyed:tr,unmounted:tr,activated:tr,deactivated:tr,errorCaptured:tr,serverPrefetch:tr,components:Ss,directives:Ss,watch:rg,provide:nd,inject:ng};function nd(e,t){return t?e?function(){return pn(ot(e)?e.call(this,this):e,ot(t)?t.call(this,this):t)}:t:e}function ng(e,t){return Ss(Lu(e),Lu(t))}function Lu(e){if(Qe(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function tr(e,t){return e?[...new Set([].concat(e,t))]:t}function Ss(e,t){return e?pn(Object.create(null),e,t):t}function rd(e,t){return e?Qe(e)&&Qe(t)?[...new Set([...e,...t])]:pn(Object.create(null),ed(e),ed(t??{})):t}function rg(e,t){if(!e)return t;if(!t)return e;const n=pn(Object.create(null),e);for(const r in t)n[r]=tr(e[r],t[r]);return n}function jh(){return{app:null,config:{isNativeTag:Gf,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 og=0;function ag(e,t){return function(r,a=null){ot(r)||(r=pn({},r)),a!=null&&!Rt(a)&&(a=null);const o=jh(),i=new WeakSet,l=[];let c=!1;const f=o.app={_uid:og++,_component:r,_props:a,_container:null,_context:o,_instance:null,version:Lg,get config(){return o.config},set config(h){},use(h,...v){return i.has(h)||(h&&ot(h.install)?(i.add(h),h.install(f,...v)):ot(h)&&(i.add(h),h(f,...v))),f},mixin(h){return o.mixins.includes(h)||o.mixins.push(h),f},component(h,v){return v?(o.components[h]=v,f):o.components[h]},directive(h,v){return v?(o.directives[h]=v,f):o.directives[h]},mount(h,v,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,il(x.component)}},onUnmount(h){l.push(h)},unmount(){c&&(Wr(l,f._instance,16),e(null,f._container),delete f._container.__vue_app__)},provide(h,v){return o.provides[h]=v,f},runWithContext(h){const v=Ka;Ka=f;try{return h()}finally{Ka=v}}};return f}}let Ka=null;const sg=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${ar(t)}Modifiers`]||e[`${Qo(t)}Modifiers`];function ig(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||Lt;let a=n;const o=t.startsWith("update:"),i=o&&sg(r,t.slice(7));i&&(i.trim&&(a=n.map(h=>Yt(h)?h.trim():h)),i.number&&(a=n.map(Zi)));let l,c=r[l=Jl(t)]||r[l=Jl(ar(t))];!c&&o&&(c=r[l=Jl(Qo(t))]),c&&Wr(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,Wr(f,e,6,a)}}const lg=new WeakMap;function Fh(e,t,n=!1){const r=n?lg:t.emitsCache,a=r.get(e);if(a!==void 0)return a;const o=e.emits;let i={},l=!1;if(!ot(e)){const c=f=>{const h=Fh(f,t,!0);h&&(l=!0,pn(i,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):(Qe(o)?o.forEach(c=>i[c]=null):pn(i,o),Rt(e)&&r.set(e,i),i)}function al(e,t){return!e||!Ji(t)?!1:(t=t.slice(2).replace(/Once$/,""),Mt(e,t[0].toLowerCase()+t.slice(1))||Mt(e,Qo(t))||Mt(e,t))}function od(e){const{type:t,vnode:n,proxy:r,withProxy:a,propsOptions:[o],slots:i,attrs:l,emit:c,render:f,renderCache:h,props:v,data:b,setupState:x,ctx:j,inheritAttrs:q}=e,te=qi(e);let H,O;try{if(n.shapeFlag&4){const X=a||r,Ce=X;H=fo(f.call(Ce,X,h,v,x,b,j)),O=l}else{const X=t;H=fo(X.length>1?X(v,{attrs:l,slots:i,emit:c}):X(v,null)),O=t.props?l:ug(l)}}catch(X){$s.length=0,Ws(X,e,1),H=Ne(Fn)}let V=H;if(O&&q!==!1){const X=Object.keys(O),{shapeFlag:Ce}=V;X.length&&Ce&7&&(o&&X.some(Yi)&&(O=cg(O,o)),V=Yo(V,O,!1,!0))}return n.dirs&&(V=Yo(V,null,!1,!0),V.dirs=V.dirs?V.dirs.concat(n.dirs):n.dirs),n.transition&&js(V,n.transition),H=V,qi(te),H}const ug=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ji(n))&&((t||(t={}))[n]=e[n]);return t},cg=(e,t)=>{const n={};for(const r in e)(!Yi(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function dg(e,t,n){const{props:r,children:a,component:o}=e,{props:i,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?ad(r,i,f):!!i;if(c&8){const h=t.dynamicProps;for(let v=0;v<h.length;v++){const b=h[v];if(Uh(i,r,b)&&!al(f,b))return!0}}}else return(a||l)&&(!l||!l.$stable)?!0:r===i?!1:r?i?ad(r,i,f):!0:!!i;return!1}function ad(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(Uh(t,e,o)&&!al(n,o))return!0}return!1}function Uh(e,t,n){const r=e[n],a=t[n];return n==="style"&&Rt(r)&&Rt(a)?!os(r,a):r!==a}function fg({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 Bh={},qh=()=>Object.create(Bh),Hh=e=>Object.getPrototypeOf(e)===Bh;function hg(e,t,n,r=!1){const a={},o=qh();e.propsDefaults=Object.create(null),zh(e,t,a,o);for(const i in e.propsOptions[0])i in a||(a[i]=void 0);n?e.props=r?a:mh(a):e.type.props?e.props=a:e.props=o,e.attrs=o}function pg(e,t,n,r){const{props:a,attrs:o,vnode:{patchFlag:i}}=e,l=Et(a),[c]=e.propsOptions;let f=!1;if((r||i>0)&&!(i&16)){if(i&8){const h=e.vnode.dynamicProps;for(let v=0;v<h.length;v++){let b=h[v];if(al(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]=ju(c,l,j,x,e,!1)}else x!==o[b]&&(o[b]=x,f=!0)}}}else{zh(e,t,a,o)&&(f=!0);let h;for(const v in l)(!t||!Mt(t,v)&&((h=Qo(v))===v||!Mt(t,h)))&&(c?n&&(n[v]!==void 0||n[h]!==void 0)&&(a[v]=ju(c,l,v,void 0,e,!0)):delete a[v]);if(o!==l)for(const v in o)(!t||!Mt(t,v))&&(delete o[v],f=!0)}f&&xo(e.attrs,"set","")}function zh(e,t,n,r){const[a,o]=e.propsOptions;let i=!1,l;if(t)for(let c in t){if(As(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:al(e.emitsOptions,c)||(!(c in r)||f!==r[c])&&(r[c]=f,i=!0)}if(o){const c=Et(n),f=l||Lt;for(let h=0;h<o.length;h++){const v=o[h];n[v]=ju(a,c,v,f[v],e,!Mt(f,v))}}return i}function ju(e,t,n,r,a,o){const i=e[n];if(i!=null){const l=Mt(i,"default");if(l&&r===void 0){const c=i.default;if(i.type!==Function&&!i.skipFactory&&ot(c)){const{propsDefaults:f}=a;if(n in f)r=f[n];else{const h=Ks(a);r=f[n]=c.call(null,t),h()}}else r=c;a.ce&&a.ce._setProp(n,r)}i[0]&&(o&&!l?r=!1:i[1]&&(r===""||r===Qo(n))&&(r=!0))}return r}const mg=new WeakMap;function Vh(e,t,n=!1){const r=n?mg:t.propsCache,a=r.get(e);if(a)return a;const o=e.props,i={},l=[];let c=!1;if(!ot(e)){const h=v=>{c=!0;const[b,x]=Vh(v,t,!0);pn(i,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,za),za;if(Qe(o))for(let h=0;h<o.length;h++){const v=ar(o[h]);sd(v)&&(i[v]=Lt)}else if(o)for(const h in o){const v=ar(h);if(sd(v)){const b=o[h],x=i[v]=Qe(b)||ot(b)?{type:b}:pn({},b),j=x.type;let q=!1,te=!0;if(Qe(j))for(let H=0;H<j.length;++H){const O=j[H],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(v)}}const f=[i,l];return Rt(e)&&r.set(e,f),f}function sd(e){return e[0]!=="$"&&!As(e)}const pc=e=>e==="_"||e==="_ctx"||e==="$stable",mc=e=>Qe(e)?e.map(fo):[fo(e)],vg=(e,t,n)=>{if(t._n)return t;const r=ut((...a)=>mc(t(...a)),n);return r._c=!1,r},Wh=(e,t,n)=>{const r=e._ctx;for(const a in e){if(pc(a))continue;const o=e[a];if(ot(o))t[a]=vg(a,o,r);else if(o!=null){const i=mc(o);t[a]=()=>i}}},Gh=(e,t)=>{const n=mc(t);e.slots.default=()=>n},Kh=(e,t,n)=>{for(const r in t)(n||!pc(r))&&(e[r]=t[r])},gg=(e,t,n)=>{const r=e.slots=qh();if(e.vnode.shapeFlag&32){const a=t._;a?(Kh(r,t,n),n&&Qf(r,"_",a,!0)):Wh(t,r)}else t&&Gh(e,t)},yg=(e,t,n)=>{const{vnode:r,slots:a}=e;let o=!0,i=Lt;if(r.shapeFlag&32){const l=t._;l?n&&l===1?o=!1:Kh(a,t,n):(o=!t.$stable,Wh(t,a)),i=t}else t&&(Gh(e,t),i={default:1});if(o)for(const l in a)!pc(l)&&i[l]==null&&delete a[l]},Ln=kg;function wg(e){return bg(e)}function bg(e,t){const n=el();n.__VUE__=!0;const{insert:r,remove:a,patchProp:o,createElement:i,createText:l,createComment:c,setText:f,setElementText:h,parentNode:v,nextSibling:b,setScopeId:x=po,insertStaticContent:j}=e,q=(k,E,z,ne=null,J=null,oe=null,ye=void 0,fe=null,pe=!!E.dynamicChildren)=>{if(k===E)return;k&&!ha(k,E)&&(ne=K(k),je(k,J,oe,!0),k=null),E.patchFlag===-2&&(pe=!1,E.dynamicChildren=null);const{type:ue,ref:Re,shapeFlag:ve}=E;switch(ue){case sl:te(k,E,z,ne);break;case Fn:H(k,E,z,ne);break;case Oi:k==null&&O(E,z,ne,ye);break;case Ge:ee(k,E,z,ne,J,oe,ye,fe,pe);break;default:ve&1?Ce(k,E,z,ne,J,oe,ye,fe,pe):ve&6?be(k,E,z,ne,J,oe,ye,fe,pe):(ve&64||ve&128)&&ue.process(k,E,z,ne,J,oe,ye,fe,pe,De)}Re!=null&&J?Ms(Re,k&&k.ref,oe,E||k,!E):Re==null&&k&&k.ref!=null&&Ms(k.ref,null,oe,k,!0)},te=(k,E,z,ne)=>{if(k==null)r(E.el=l(E.children),z,ne);else{const J=E.el=k.el;E.children!==k.children&&f(J,E.children)}},H=(k,E,z,ne)=>{k==null?r(E.el=c(E.children||""),z,ne):E.el=k.el},O=(k,E,z,ne)=>{[k.el,k.anchor]=j(k.children,E,z,ne,k.el,k.anchor)},V=({el:k,anchor:E},z,ne)=>{let J;for(;k&&k!==E;)J=b(k),r(k,z,ne),k=J;r(E,z,ne)},X=({el:k,anchor:E})=>{let z;for(;k&&k!==E;)z=b(k),a(k),k=z;a(E)},Ce=(k,E,z,ne,J,oe,ye,fe,pe)=>{if(E.type==="svg"?ye="svg":E.type==="math"&&(ye="mathml"),k==null)Oe(E,z,ne,J,oe,ye,fe,pe);else{const ue=k.el&&k.el._isVueCE?k.el:null;try{ue&&ue._beginPatch(),Z(k,E,J,oe,ye,fe,pe)}finally{ue&&ue._endPatch()}}},Oe=(k,E,z,ne,J,oe,ye,fe)=>{let pe,ue;const{props:Re,shapeFlag:ve,transition:Pe,dirs:Ee}=k;if(pe=k.el=i(k.type,oe,Re&&Re.is,Re),ve&8?h(pe,k.children):ve&16&&xe(k.children,pe,null,ne,J,nu(k,oe),ye,fe),Ee&&ia(k,null,ne,"created"),ce(pe,k,k.scopeId,ye,ne),Re){for(const D in Re)D!=="value"&&!As(D)&&o(pe,D,null,Re[D],oe,ne);"value"in Re&&o(pe,"value",null,Re.value,oe),(ue=Re.onVnodeBeforeMount)&&so(ue,ne,k)}Ee&&ia(k,null,ne,"beforeMount");const Ze=_g(J,Pe);Ze&&Pe.beforeEnter(pe),r(pe,E,z),((ue=Re&&Re.onVnodeMounted)||Ze||Ee)&&Ln(()=>{try{ue&&so(ue,ne,k),Ze&&Pe.enter(pe),Ee&&ia(k,null,ne,"mounted")}finally{}},J)},ce=(k,E,z,ne,J)=>{if(z&&x(k,z),ne)for(let oe=0;oe<ne.length;oe++)x(k,ne[oe]);if(J){let oe=J.subTree;if(E===oe||Qh(oe.type)&&(oe.ssContent===E||oe.ssFallback===E)){const ye=J.vnode;ce(k,ye,ye.scopeId,ye.slotScopeIds,J.parent)}}},xe=(k,E,z,ne,J,oe,ye,fe,pe=0)=>{for(let ue=pe;ue<k.length;ue++){const Re=k[ue]=fe?Co(k[ue]):fo(k[ue]);q(null,Re,E,z,ne,J,oe,ye,fe)}},Z=(k,E,z,ne,J,oe,ye)=>{const fe=E.el=k.el;let{patchFlag:pe,dynamicChildren:ue,dirs:Re}=E;pe|=k.patchFlag&16;const ve=k.props||Lt,Pe=E.props||Lt;let Ee;if(z&&la(z,!1),(Ee=Pe.onVnodeBeforeUpdate)&&so(Ee,z,E,k),Re&&ia(E,k,z,"beforeUpdate"),z&&la(z,!0),(ve.innerHTML&&Pe.innerHTML==null||ve.textContent&&Pe.textContent==null)&&h(fe,""),ue?Ae(k.dynamicChildren,ue,fe,z,ne,nu(E,J),oe):ye||me(k,E,fe,null,z,ne,nu(E,J),oe,!1),pe>0){if(pe&16)He(fe,ve,Pe,z,J);else if(pe&2&&ve.class!==Pe.class&&o(fe,"class",null,Pe.class,J),pe&4&&o(fe,"style",ve.style,Pe.style,J),pe&8){const Ze=E.dynamicProps;for(let D=0;D<Ze.length;D++){const F=Ze[D],U=ve[F],Y=Pe[F];(Y!==U||F==="value")&&o(fe,F,U,Y,J,z)}}pe&1&&k.children!==E.children&&h(fe,E.children)}else!ye&&ue==null&&He(fe,ve,Pe,z,J);((Ee=Pe.onVnodeUpdated)||Re)&&Ln(()=>{Ee&&so(Ee,z,E,k),Re&&ia(E,k,z,"updated")},ne)},Ae=(k,E,z,ne,J,oe,ye)=>{for(let fe=0;fe<E.length;fe++){const pe=k[fe],ue=E[fe],Re=pe.el&&(pe.type===Ge||!ha(pe,ue)||pe.shapeFlag&198)?v(pe.el):z;q(pe,ue,Re,null,ne,J,oe,ye,!0)}},He=(k,E,z,ne,J)=>{if(E!==z){if(E!==Lt)for(const oe in E)!As(oe)&&!(oe in z)&&o(k,oe,E[oe],null,J,ne);for(const oe in z){if(As(oe))continue;const ye=z[oe],fe=E[oe];ye!==fe&&oe!=="value"&&o(k,oe,fe,ye,J,ne)}"value"in z&&o(k,"value",E.value,z.value,J)}},ee=(k,E,z,ne,J,oe,ye,fe,pe)=>{const ue=E.el=k?k.el:l(""),Re=E.anchor=k?k.anchor:l("");let{patchFlag:ve,dynamicChildren:Pe,slotScopeIds:Ee}=E;Ee&&(fe=fe?fe.concat(Ee):Ee),k==null?(r(ue,z,ne),r(Re,z,ne),xe(E.children||[],z,Re,J,oe,ye,fe,pe)):ve>0&&ve&64&&Pe&&k.dynamicChildren&&k.dynamicChildren.length===Pe.length?(Ae(k.dynamicChildren,Pe,z,J,oe,ye,fe),(E.key!=null||J&&E===J.subTree)&&vc(k,E,!0)):me(k,E,z,Re,J,oe,ye,fe,pe)},be=(k,E,z,ne,J,oe,ye,fe,pe)=>{E.slotScopeIds=fe,k==null?E.shapeFlag&512?J.ctx.activate(E,z,ne,ye,pe):Le(E,z,ne,J,oe,ye,pe):Ke(k,E,pe)},Le=(k,E,z,ne,J,oe,ye)=>{const fe=k.component=Pg(k,ne,J);if(Gs(k)&&(fe.ctx.renderer=De),Mg(fe,!1,ye),fe.asyncDep){if(J&&J.registerDep(fe,Ue,ye),!k.el){const pe=fe.subTree=Ne(Fn);H(null,pe,E,z),k.placeholder=pe.el}}else Ue(fe,k,E,z,J,oe,ye)},Ke=(k,E,z)=>{const ne=E.component=k.component;if(dg(k,E,z))if(ne.asyncDep&&!ne.asyncResolved){Se(ne,E,z);return}else ne.next=E,ne.update();else E.el=k.el,ne.vnode=E},Ue=(k,E,z,ne,J,oe,ye)=>{const fe=()=>{if(k.isMounted){let{next:ve,bu:Pe,u:Ee,parent:Ze,vnode:D}=k;{const Me=Jh(k);if(Me){ve&&(ve.el=D.el,Se(k,ve,ye)),Me.asyncDep.then(()=>{Ln(()=>{k.isUnmounted||ue()},J)});return}}let F=ve,U;la(k,!1),ve?(ve.el=D.el,Se(k,ve,ye)):ve=D,Pe&&Ri(Pe),(U=ve.props&&ve.props.onVnodeBeforeUpdate)&&so(U,Ze,ve,D),la(k,!0);const Y=od(k),he=k.subTree;k.subTree=Y,q(he,Y,v(he.el),K(he),k,J,oe),ve.el=Y.el,F===null&&fg(k,Y.el),Ee&&Ln(Ee,J),(U=ve.props&&ve.props.onVnodeUpdated)&&Ln(()=>so(U,Ze,ve,D),J)}else{let ve;const{el:Pe,props:Ee}=E,{bm:Ze,m:D,parent:F,root:U,type:Y}=k,he=Ga(E);la(k,!1),Ze&&Ri(Ze),!he&&(ve=Ee&&Ee.onVnodeBeforeMount)&&so(ve,F,E),la(k,!0);{U.ce&&U.ce._hasShadowRoot()&&U.ce._injectChildStyle(Y,k.parent?k.parent.type:void 0);const Me=k.subTree=od(k);q(null,Me,z,ne,k,J,oe),E.el=Me.el}if(D&&Ln(D,J),!he&&(ve=Ee&&Ee.onVnodeMounted)){const Me=E;Ln(()=>so(ve,F,Me),J)}(E.shapeFlag&256||F&&Ga(F.vnode)&&F.vnode.shapeFlag&256)&&k.a&&Ln(k.a,J),k.isMounted=!0,E=z=ne=null}};k.scope.on();const pe=k.effect=new th(fe);k.scope.off();const ue=k.update=pe.run.bind(pe),Re=k.job=pe.runIfDirty.bind(pe);Re.i=k,Re.id=k.uid,pe.scheduler=()=>dc(Re),la(k,!0),ue()},Se=(k,E,z)=>{E.component=k;const ne=k.vnode.props;k.vnode=E,k.next=null,pg(k,E.props,ne,z),yg(k,E.children,z),Mo(),Wc(k),Ro()},me=(k,E,z,ne,J,oe,ye,fe,pe=!1)=>{const ue=k&&k.children,Re=k?k.shapeFlag:0,ve=E.children,{patchFlag:Pe,shapeFlag:Ee}=E;if(Pe>0){if(Pe&128){nt(ue,ve,z,ne,J,oe,ye,fe,pe);return}else if(Pe&256){We(ue,ve,z,ne,J,oe,ye,fe,pe);return}}Ee&8?(Re&16&&ct(ue,J,oe),ve!==ue&&h(z,ve)):Re&16?Ee&16?nt(ue,ve,z,ne,J,oe,ye,fe,pe):ct(ue,J,oe,!0):(Re&8&&h(z,""),Ee&16&&xe(ve,z,ne,J,oe,ye,fe,pe))},We=(k,E,z,ne,J,oe,ye,fe,pe)=>{k=k||za,E=E||za;const ue=k.length,Re=E.length,ve=Math.min(ue,Re);let Pe;for(Pe=0;Pe<ve;Pe++){const Ee=E[Pe]=pe?Co(E[Pe]):fo(E[Pe]);q(k[Pe],Ee,z,null,J,oe,ye,fe,pe)}ue>Re?ct(k,J,oe,!0,!1,ve):xe(E,z,ne,J,oe,ye,fe,pe,ve)},nt=(k,E,z,ne,J,oe,ye,fe,pe)=>{let ue=0;const Re=E.length;let ve=k.length-1,Pe=Re-1;for(;ue<=ve&&ue<=Pe;){const Ee=k[ue],Ze=E[ue]=pe?Co(E[ue]):fo(E[ue]);if(ha(Ee,Ze))q(Ee,Ze,z,null,J,oe,ye,fe,pe);else break;ue++}for(;ue<=ve&&ue<=Pe;){const Ee=k[ve],Ze=E[Pe]=pe?Co(E[Pe]):fo(E[Pe]);if(ha(Ee,Ze))q(Ee,Ze,z,null,J,oe,ye,fe,pe);else break;ve--,Pe--}if(ue>ve){if(ue<=Pe){const Ee=Pe+1,Ze=Ee<Re?E[Ee].el:ne;for(;ue<=Pe;)q(null,E[ue]=pe?Co(E[ue]):fo(E[ue]),z,Ze,J,oe,ye,fe,pe),ue++}}else if(ue>Pe)for(;ue<=ve;)je(k[ue],J,oe,!0),ue++;else{const Ee=ue,Ze=ue,D=new Map;for(ue=Ze;ue<=Pe;ue++){const $e=E[ue]=pe?Co(E[ue]):fo(E[ue]);$e.key!=null&&D.set($e.key,ue)}let F,U=0;const Y=Pe-Ze+1;let he=!1,Me=0;const Be=new Array(Y);for(ue=0;ue<Y;ue++)Be[ue]=0;for(ue=Ee;ue<=ve;ue++){const $e=k[ue];if(U>=Y){je($e,J,oe,!0);continue}let gt;if($e.key!=null)gt=D.get($e.key);else for(F=Ze;F<=Pe;F++)if(Be[F-Ze]===0&&ha($e,E[F])){gt=F;break}gt===void 0?je($e,J,oe,!0):(Be[gt-Ze]=ue+1,gt>=Me?Me=gt:he=!0,q($e,E[gt],z,null,J,oe,ye,fe,pe),U++)}const Ye=he?Tg(Be):za;for(F=Ye.length-1,ue=Y-1;ue>=0;ue--){const $e=Ze+ue,gt=E[$e],Hn=E[$e+1],mn=$e+1<Re?Hn.el||Yh(Hn):ne;Be[ue]===0?q(null,gt,z,mn,J,oe,ye,fe,pe):he&&(F<0||ue!==Ye[F]?ze(gt,z,mn,2):F--)}}},ze=(k,E,z,ne,J=null)=>{const{el:oe,type:ye,transition:fe,children:pe,shapeFlag:ue}=k;if(ue&6){ze(k.component.subTree,E,z,ne);return}if(ue&128){k.suspense.move(E,z,ne);return}if(ue&64){ye.move(k,E,z,De);return}if(ye===Ge){r(oe,E,z);for(let ve=0;ve<pe.length;ve++)ze(pe[ve],E,z,ne);r(k.anchor,E,z);return}if(ye===Oi){V(k,E,z);return}if(ne!==2&&ue&1&&fe)if(ne===0)fe.beforeEnter(oe),r(oe,E,z),Ln(()=>fe.enter(oe),J);else{const{leave:ve,delayLeave:Pe,afterLeave:Ee}=fe,Ze=()=>{k.ctx.isUnmounted?a(oe):r(oe,E,z)},D=()=>{oe._isLeaving&&oe[uo](!0),ve(oe,()=>{Ze(),Ee&&Ee()})};Pe?Pe(oe,Ze,D):D()}else r(oe,E,z)},je=(k,E,z,ne=!1,J=!1)=>{const{type:oe,props:ye,ref:fe,children:pe,dynamicChildren:ue,shapeFlag:Re,patchFlag:ve,dirs:Pe,cacheIndex:Ee,memo:Ze}=k;if(ve===-2&&(J=!1),fe!=null&&(Mo(),Ms(fe,null,z,k,!0),Ro()),Ee!=null&&(E.renderCache[Ee]=void 0),Re&256){E.ctx.deactivate(k);return}const D=Re&1&&Pe,F=!Ga(k);let U;if(F&&(U=ye&&ye.onVnodeBeforeUnmount)&&so(U,E,k),Re&6)et(k.component,z,ne);else{if(Re&128){k.suspense.unmount(z,ne);return}D&&ia(k,null,E,"beforeUnmount"),Re&64?k.type.remove(k,E,z,De,ne):ue&&!ue.hasOnce&&(oe!==Ge||ve>0&&ve&64)?ct(ue,E,z,!1,!0):(oe===Ge&&ve&384||!J&&Re&16)&&ct(pe,E,z),ne&&dt(k)}const Y=Ze!=null&&Ee==null;(F&&(U=ye&&ye.onVnodeUnmounted)||D||Y)&&Ln(()=>{U&&so(U,E,k),D&&ia(k,null,E,"unmounted"),Y&&(k.el=null)},z)},dt=k=>{const{type:E,el:z,anchor:ne,transition:J}=k;if(E===Ge){ft(z,ne);return}if(E===Oi){X(k);return}const oe=()=>{a(z),J&&!J.persisted&&J.afterLeave&&J.afterLeave()};if(k.shapeFlag&1&&J&&!J.persisted){const{leave:ye,delayLeave:fe}=J,pe=()=>ye(z,oe);fe?fe(k.el,oe,pe):pe()}else oe()},ft=(k,E)=>{let z;for(;k!==E;)z=b(k),a(k),k=z;a(E)},et=(k,E,z)=>{const{bum:ne,scope:J,job:oe,subTree:ye,um:fe,m:pe,a:ue}=k;id(pe),id(ue),ne&&Ri(ne),J.stop(),oe&&(oe.flags|=8,je(ye,k,E,z)),fe&&Ln(fe,E),Ln(()=>{k.isUnmounted=!0},E)},ct=(k,E,z,ne=!1,J=!1,oe=0)=>{for(let ye=oe;ye<k.length;ye++)je(k[ye],E,z,ne,J)},K=k=>{if(k.shapeFlag&6)return K(k.component.subTree);if(k.shapeFlag&128)return k.suspense.next();const E=b(k.anchor||k.el),z=E&&E[Ch];return z?b(z):E};let _e=!1;const we=(k,E,z)=>{let ne;k==null?E._vnode&&(je(E._vnode,null,null,!0),ne=E._vnode.component):q(E._vnode||null,k,E,null,null,null,z),E._vnode=k,_e||(_e=!0,Wc(ne),bh(),_e=!1)},De={p:q,um:je,m:ze,r:dt,mt:Le,mc:xe,pc:me,pbc:Ae,n:K,o:e};return{render:we,hydrate:void 0,createApp:ag(we)}}function nu({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 la({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function _g(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function vc(e,t,n=!1){const r=e.children,a=t.children;if(Qe(r)&&Qe(a))for(let o=0;o<r.length;o++){const i=r[o];let l=a[o];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=a[o]=Co(a[o]),l.el=i.el),!n&&l.patchFlag!==-2&&vc(i,l)),l.type===sl&&(l.patchFlag===-1&&(l=a[o]=Co(l)),l.el=i.el),l.type===Fn&&!l.el&&(l.el=i.el)}}function Tg(e){const t=e.slice(),n=[0];let r,a,o,i,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,i=n.length-1;o<i;)l=o+i>>1,e[n[l]]<f?o=l+1:i=l;f<e[n[o]]&&(o>0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function Jh(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Jh(t)}function id(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Yh(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Yh(t.subTree):null}const Qh=e=>e.__isSuspense;function kg(e,t){t&&t.pendingBranch?Qe(e)?t.effects.push(...e):t.effects.push(e):Ev(e)}const Ge=Symbol.for("v-fgt"),sl=Symbol.for("v-txt"),Fn=Symbol.for("v-cmt"),Oi=Symbol.for("v-stc"),$s=[];let or=null;function C(e=!1){$s.push(or=e?null:[])}function Sg(){$s.pop(),or=$s[$s.length-1]||null}let Qa=1;function Vi(e,t=!1){Qa+=e,e<0&&or&&t&&(or.hasOnce=!0)}function Xh(e){return e.dynamicChildren=Qa>0?or||za:null,Sg(),Qa>0&&or&&or.push(e),e}function R(e,t,n,r,a,o){return Xh(m(e,t,n,r,a,o,!0))}function rt(e,t,n,r,a){return Xh(Ne(e,t,n,r,a,!0))}function Fs(e){return e?e.__v_isVNode===!0:!1}function ha(e,t){return e.type===t.type&&e.key===t.key}const Zh=({key:e})=>e??null,Di=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Yt(e)||Un(e)||ot(e)?{i:In,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,r=0,a=null,o=e===Ge?0:1,i=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Zh(t),ref:t&&Di(t),scopeId:Th,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:In};return l?(gc(c,n),o&128&&e.normalize(c)):n&&(c.shapeFlag|=Yt(n)?8:16),Qa>0&&!i&&or&&(c.patchFlag>0||o&6)&&c.patchFlag!==32&&or.push(c),c}const Ne=Cg;function Cg(e,t=null,n=null,r=0,a=null,o=!1){if((!e||e===Nh)&&(e=Fn),Fs(e)){const l=Yo(e,t,!0);return n&&gc(l,n),Qa>0&&!o&&or&&(l.shapeFlag&6?or[or.indexOf(e)]=l:or.push(l)),l.patchFlag=-2,l}if(Og(e)&&(e=e.__vccOpts),t){t=xg(t);let{class:l,style:c}=t;l&&!Yt(l)&&(t.class=it(l)),Rt(c)&&(cc(c)&&!Qe(c)&&(c=pn({},c)),t.style=Io(c))}const i=Yt(e)?1:Qh(e)?128:xh(e)?64:Rt(e)?4:ot(e)?2:0;return m(e,t,n,r,a,i,o,!0)}function xg(e){return e?cc(e)||Hh(e)?pn({},e):e:null}function Yo(e,t,n=!1,r=!1){const{props:a,ref:o,patchFlag:i,children:l,transition:c}=e,f=t?ep(a||{},t):a,h={__v_isVNode:!0,__v_skip:!0,type:e.type,props:f,key:f&&Zh(f),ref:t&&t.ref?n&&o?Qe(o)?o.concat(Di(t)):[o,Di(t)]:Di(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?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Yo(e.ssContent),ssFallback:e.ssFallback&&Yo(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&js(h,c.clone(h)),h}function ya(e=" ",t=0){return Ne(sl,null,e,t)}function Ag(e,t){const n=Ne(Oi,null,e);return n.staticCount=t,n}function ie(e="",t=!1){return t?(C(),rt(Fn,null,e)):Ne(Fn,null,e)}function fo(e){return e==null||typeof e=="boolean"?Ne(Fn):Qe(e)?Ne(Ge,null,e.slice()):Fs(e)?Co(e):Ne(sl,null,String(e))}function Co(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Yo(e)}function gc(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Qe(t))n=16;else if(typeof t=="object")if(r&65){const a=t.default;a&&(a._c&&(a._d=!1),gc(e,a()),a._c&&(a._d=!0));return}else{n=32;const a=t._;!a&&!Hh(t)?t._ctx=In:a===3&&In&&(In.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ot(t)?(t={default:t,_ctx:In},n=32):(t=String(t),r&64?(n=16,t=[ya(t)]):n=8);e.children=t,e.shapeFlag|=n}function ep(...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=Io([t.style,r.style]);else if(Ji(a)){const o=t[a],i=r[a];i&&o!==i&&!(Qe(o)&&o.includes(i))?t[a]=o?[].concat(o,i):i:i==null&&o==null&&!Yi(a)&&(t[a]=i)}else a!==""&&(t[a]=r[a])}return t}function so(e,t,n,r=null){Wr(e,t,7,[n,r])}const Eg=jh();let Ig=0;function Pg(e,t,n){const r=e.type,a=(t?t.appContext:e.appContext)||Eg,o={uid:Ig++,vnode:e,type:r,parent:t,appContext:a,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Xm(!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:Vh(r,a),emitsOptions:Fh(r,a),emit:null,emitted:null,propsDefaults:Lt,inheritAttrs:r.inheritAttrs,ctx:Lt,data:Lt,props:Lt,attrs:Lt,slots:Lt,refs:Lt,setupState:Lt,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=ig.bind(null,o),e.ce&&e.ce(o),o}let En=null;const yc=()=>En||In;let Wi,Fu;{const e=el(),t=(n,r)=>{let a;return(a=e[n])||(a=e[n]=[]),a.push(r),o=>{a.length>1?a.forEach(i=>i(o)):a[0](o)}};Wi=t("__VUE_INSTANCE_SETTERS__",n=>En=n),Fu=t("__VUE_SSR_SETTERS__",n=>Xa=n)}const Ks=e=>{const t=En;return Wi(e),e.scope.on(),()=>{e.scope.off(),Wi(t)}},ld=()=>{En&&En.scope.off(),Wi(null)};function tp(e){return e.vnode.shapeFlag&4}let Xa=!1;function Mg(e,t=!1,n=!1){t&&Fu(t);const{props:r,children:a}=e.vnode,o=tp(e);hg(e,r,o,t),gg(e,a,n||t);const i=o?Rg(e,t):void 0;return t&&Fu(!1),i}function Rg(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Yv);const{setup:r}=n;if(r){Mo();const a=e.setupContext=r.length>1?rp(e):null,o=Ks(e),i=Vs(r,e,0,[e.props,a]),l=Kf(i);if(Ro(),o(),(l||e.sp)&&!Ga(e)&&fc(e),l){if(i.then(ld,ld),t)return i.then(c=>{ud(e,c)}).catch(c=>{Ws(c,e,0)});e.asyncDep=i}else ud(e,i)}else np(e)}function ud(e,t,n){ot(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Rt(t)&&(e.setupState=gh(t)),np(e)}function np(e,t,n){const r=e.type;e.render||(e.render=r.render||po);{const a=Ks(e);Mo();try{Zv(e)}finally{Ro(),a()}}}const $g={get(e,t){return jn(e,"get",""),e[t]}};function rp(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,$g),slots:e.slots,emit:e.emit,expose:t}}function il(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(gh(yv(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Rs)return Rs[n](e)},has(t,n){return n in t||n in Rs}})):e.proxy}function Ng(e,t=!0){return ot(e)?e.displayName||e.name:e.name||t&&e.__name}function Og(e){return ot(e)&&"__vccOpts"in e}const ae=(e,t)=>kv(e,t,Xa);function wc(e,t,n){try{Vi(-1);const r=arguments.length;return r===2?Rt(t)&&!Qe(t)?Fs(t)?Ne(e,null,[t]):Ne(e,t):Ne(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Fs(n)&&(n=[n]),Ne(e,t,n))}finally{Vi(1)}}function rP(e,t,n,r){const a=n[r];if(a&&Dg(a,e))return a;const o=t();return o.memo=e.slice(),o.cacheIndex=r,n[r]=o}function Dg(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let r=0;r<n.length;r++)if(Ur(n[r],t[r]))return!1;return Qa>0&&or&&or.push(e),!0}const Lg="3.5.31";/**
|
|
15
|
-
* @vue/runtime-dom v3.5.31
|
|
16
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
17
|
-
* @license MIT
|
|
18
|
-
**/let Uu;const cd=typeof window<"u"&&window.trustedTypes;if(cd)try{Uu=cd.createPolicy("vue",{createHTML:e=>e})}catch{}const op=Uu?e=>Uu.createHTML(e):e=>e,jg="http://www.w3.org/2000/svg",Fg="http://www.w3.org/1998/Math/MathML",So=typeof document<"u"?document:null,dd=So&&So.createElement("template"),Ug={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"?So.createElementNS(jg,e):t==="mathml"?So.createElementNS(Fg,e):n?So.createElement(e,{is:n}):So.createElement(e);return e==="select"&&r&&r.multiple!=null&&a.setAttribute("multiple",r.multiple),a},createText:e=>So.createTextNode(e),createComment:e=>So.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>So.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,a,o){const i=n?n.previousSibling:t.lastChild;if(a&&(a===o||a.nextSibling))for(;t.insertBefore(a.cloneNode(!0),n),!(a===o||!(a=a.nextSibling)););else{dd.innerHTML=op(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const l=dd.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[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},qo="transition",_s="animation",Us=Symbol("_vtc"),ap={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},Bg=pn({},Eh,ap),qg=e=>(e.displayName="Transition",e.props=Bg,e),sp=qg((e,{slots:t})=>wc(Dv,Hg(e),t)),ua=(e,t=[])=>{Qe(e)?e.forEach(n=>n(...t)):e&&e(...t)},fd=e=>e?Qe(e)?e.some(t=>t.length>1):e.length>1:!1;function Hg(e){const t={};for(const ee in e)ee in ap||(t[ee]=e[ee]);if(e.css===!1)return t;const{name:n="v",type:r,duration:a,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:c=o,appearActiveClass:f=i,appearToClass:h=l,leaveFromClass:v=`${n}-leave-from`,leaveActiveClass:b=`${n}-leave-active`,leaveToClass:x=`${n}-leave-to`}=e,j=zg(a),q=j&&j[0],te=j&&j[1],{onBeforeEnter:H,onEnter:O,onEnterCancelled:V,onLeave:X,onLeaveCancelled:Ce,onBeforeAppear:Oe=H,onAppear:ce=O,onAppearCancelled:xe=V}=t,Z=(ee,be,Le,Ke)=>{ee._enterCancelled=Ke,ca(ee,be?h:l),ca(ee,be?f:i),Le&&Le()},Ae=(ee,be)=>{ee._isLeaving=!1,ca(ee,v),ca(ee,x),ca(ee,b),be&&be()},He=ee=>(be,Le)=>{const Ke=ee?ce:O,Ue=()=>Z(be,ee,Le);ua(Ke,[be,Ue]),hd(()=>{ca(be,ee?c:o),To(be,ee?h:l),fd(Ke)||pd(be,r,q,Ue)})};return pn(t,{onBeforeEnter(ee){ua(H,[ee]),To(ee,o),To(ee,i)},onBeforeAppear(ee){ua(Oe,[ee]),To(ee,c),To(ee,f)},onEnter:He(!1),onAppear:He(!0),onLeave(ee,be){ee._isLeaving=!0;const Le=()=>Ae(ee,be);To(ee,v),ee._enterCancelled?(To(ee,b),gd(ee)):(gd(ee),To(ee,b)),hd(()=>{ee._isLeaving&&(ca(ee,v),To(ee,x),fd(X)||pd(ee,r,te,Le))}),ua(X,[ee,Le])},onEnterCancelled(ee){Z(ee,!1,void 0,!0),ua(V,[ee])},onAppearCancelled(ee){Z(ee,!0,void 0,!0),ua(xe,[ee])},onLeaveCancelled(ee){Ae(ee),ua(Ce,[ee])}})}function zg(e){if(e==null)return null;if(Rt(e))return[ru(e.enter),ru(e.leave)];{const t=ru(e);return[t,t]}}function ru(e){return zm(e)}function To(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Us]||(e[Us]=new Set)).add(t)}function ca(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Us];n&&(n.delete(t),n.size||(e[Us]=void 0))}function hd(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Vg=0;function pd(e,t,n,r){const a=e._endId=++Vg,o=()=>{a===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:l,propCount:c}=Wg(e,t);if(!i)return r();const f=i+"end";let h=0;const v=()=>{e.removeEventListener(f,b),o()},b=x=>{x.target===e&&++h>=c&&v()};setTimeout(()=>{h<c&&v()},l+1),e.addEventListener(f,b)}function Wg(e,t){const n=window.getComputedStyle(e),r=j=>(n[j]||"").split(", "),a=r(`${qo}Delay`),o=r(`${qo}Duration`),i=md(a,o),l=r(`${_s}Delay`),c=r(`${_s}Duration`),f=md(l,c);let h=null,v=0,b=0;t===qo?i>0&&(h=qo,v=i,b=o.length):t===_s?f>0&&(h=_s,v=f,b=c.length):(v=Math.max(i,f),h=v>0?i>f?qo:_s:null,b=h?h===qo?o.length:c.length:0);const x=h===qo&&/\b(?:transform|all)(?:,|$)/.test(r(`${qo}Property`).toString());return{type:h,timeout:v,propCount:b,hasTransform:x}}function md(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>vd(n)+vd(e[r])))}function vd(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function gd(e){return(e?e.ownerDocument:document).body.offsetHeight}function Gg(e,t,n){const r=e[Us];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const yd=Symbol("_vod"),Kg=Symbol("_vsh"),Jg=Symbol(""),Yg=/(?:^|;)\s*display\s*:/;function Qg(e,t,n){const r=e.style,a=Yt(n);let o=!1;if(n&&!a){if(t)if(Yt(t))for(const i of t.split(";")){const l=i.slice(0,i.indexOf(":")).trim();n[l]==null&&Li(r,l,"")}else for(const i in t)n[i]==null&&Li(r,i,"");for(const i in n)i==="display"&&(o=!0),Li(r,i,n[i])}else if(a){if(t!==n){const i=r[Jg];i&&(n+=";"+i),r.cssText=n,o=Yg.test(n)}}else t&&e.removeAttribute("style");yd in e&&(e[yd]=o?r.display:"",e[Kg]&&(r.display="none"))}const wd=/\s*!important$/;function Li(e,t,n){if(Qe(n))n.forEach(r=>Li(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=Xg(e,t);wd.test(n)?e.setProperty(Qo(r),n.replace(wd,""),"important"):e[r]=n}}const bd=["Webkit","Moz","ms"],ou={};function Xg(e,t){const n=ou[t];if(n)return n;let r=ar(t);if(r!=="filter"&&r in e)return ou[t]=r;r=Xi(r);for(let a=0;a<bd.length;a++){const o=bd[a]+r;if(o in e)return ou[t]=o}return t}const _d="http://www.w3.org/1999/xlink";function Td(e,t,n,r,a,o=Ym(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(_d,t.slice(6,t.length)):e.setAttributeNS(_d,t,n):n==null||o&&!Xf(n)?e.removeAttribute(t):e.setAttribute(t,o?"":zr(n)?String(n):n)}function kd(e,t,n,r,a){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?op(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 i=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=Xf(n):n==null&&l==="string"?(n="",i=!0):l==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(a||t)}function Jo(e,t,n,r){e.addEventListener(t,n,r)}function Zg(e,t,n,r){e.removeEventListener(t,n,r)}const Sd=Symbol("_vei");function ey(e,t,n,r,a=null){const o=e[Sd]||(e[Sd]={}),i=o[t];if(r&&i)i.value=r;else{const[l,c]=ty(t);if(r){const f=o[t]=oy(r,a);Jo(e,l,f,c)}else i&&(Zg(e,l,i,c),o[t]=void 0)}}const Cd=/(?:Once|Passive|Capture)$/;function ty(e){let t;if(Cd.test(e)){t={};let r;for(;r=e.match(Cd);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Qo(e.slice(2)),t]}let au=0;const ny=Promise.resolve(),ry=()=>au||(ny.then(()=>au=0),au=Date.now());function oy(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;Wr(ay(r,n.value),t,5,[r])};return n.value=e,n.attached=ry(),n}function ay(e,t){if(Qe(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 xd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,sy=(e,t,n,r,a,o)=>{const i=a==="svg";t==="class"?Gg(e,r,i):t==="style"?Qg(e,n,r):Ji(t)?Yi(t)||ey(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):iy(e,t,r,i))?(kd(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Td(e,t,r,i,o,t!=="value")):e._isVueCE&&(ly(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Yt(r)))?kd(e,ar(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Td(e,t,r,i))};function iy(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&xd(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 xd(t)&&Yt(n)?!1:t in e}function ly(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 Za=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Qe(t)?n=>Ri(t,n):t};function uy(e){e.target.composing=!0}function Ad(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Po=Symbol("_assign");function Ed(e,t,n){return t&&(e=e.trim()),n&&(e=Zi(e)),e}const kn={created(e,{modifiers:{lazy:t,trim:n,number:r}},a){e[Po]=Za(a);const o=r||a.props&&a.props.type==="number";Jo(e,t?"change":"input",i=>{i.target.composing||e[Po](Ed(e.value,n,o))}),(n||o)&&Jo(e,"change",()=>{e.value=Ed(e.value,n,o)}),t||(Jo(e,"compositionstart",uy),Jo(e,"compositionend",Ad),Jo(e,"change",Ad))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:a,number:o}},i){if(e[Po]=Za(i),e.composing)return;const l=(o||e.type==="number")&&!/^0\d/.test(e.value)?Zi(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)}},cy={deep:!0,created(e,t,n){e[Po]=Za(n),Jo(e,"change",()=>{const r=e._modelValue,a=Bs(e),o=e.checked,i=e[Po];if(Qe(r)){const l=rc(r,a),c=l!==-1;if(o&&!c)i(r.concat(a));else if(!o&&c){const f=[...r];f.splice(l,1),i(f)}}else if(rs(r)){const l=new Set(r);o?l.add(a):l.delete(a),i(l)}else i(ip(e,o))})},mounted:Id,beforeUpdate(e,t,n){e[Po]=Za(n),Id(e,t,n)}};function Id(e,{value:t,oldValue:n},r){e._modelValue=t;let a;if(Qe(t))a=rc(t,r.props.value)>-1;else if(rs(t))a=t.has(r.props.value);else{if(t===n)return;a=os(t,ip(e,!0))}e.checked!==a&&(e.checked=a)}const dy={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const a=rs(t);Jo(e,"change",()=>{const o=Array.prototype.filter.call(e.options,i=>i.selected).map(i=>n?Zi(Bs(i)):Bs(i));e[Po](e.multiple?a?new Set(o):o:o[0]),e._assigning=!0,sn(()=>{e._assigning=!1})}),e[Po]=Za(r)},mounted(e,{value:t}){Pd(e,t)},beforeUpdate(e,t,n){e[Po]=Za(n)},updated(e,{value:t}){e._assigning||Pd(e,t)}};function Pd(e,t){const n=e.multiple,r=Qe(t);if(!(n&&!r&&!rs(t))){for(let a=0,o=e.options.length;a<o;a++){const i=e.options[a],l=Bs(i);if(n)if(r){const c=typeof l;c==="string"||c==="number"?i.selected=t.some(f=>String(f)===String(l)):i.selected=rc(t,l)>-1}else i.selected=t.has(l);else if(os(Bs(i),t)){e.selectedIndex!==a&&(e.selectedIndex=a);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Bs(e){return"_value"in e?e._value:e.value}function ip(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const fy=["ctrl","shift","alt","meta"],hy={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)=>fy.some(n=>e[`${n}Key`]&&!t.includes(n))},tt=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((a,...o)=>{for(let i=0;i<t.length;i++){const l=hy[t[i]];if(l&&l(a,t))return}return e(a,...o)}))},py={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},un=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(a=>{if(!("key"in a))return;const o=Qo(a.key);if(t.some(i=>i===o||py[i]===o))return e(a)}))},my=pn({patchProp:sy},Ug);let Md;function vy(){return Md||(Md=wg(my))}const gy=((...e)=>{const t=vy().createApp(...e),{mount:n}=t;return t.mount=r=>{const a=wy(r);if(!a)return;const o=t._component;!ot(o)&&!o.render&&!o.template&&(o.template=a.innerHTML),a.nodeType===1&&(a.textContent="");const i=n(a,!1,yy(a));return a instanceof Element&&(a.removeAttribute("v-cloak"),a.setAttribute("data-v-app","")),i},t});function yy(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function wy(e){return Yt(e)?document.querySelector(e):e}const by="modulepreload",_y=function(e){return"/"+e},Rd={},Si=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let i=function(f){return Promise.all(f.map(h=>Promise.resolve(h).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};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=i(n.map(f=>{if(f=_y(f),f in Rd)return;Rd[f]=!0;const h=f.endsWith(".css"),v=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${v}`))return;const b=document.createElement("link");if(b.rel=h?"stylesheet":by,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(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return a.then(i=>{for(const l of i||[])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 La=typeof document<"u";function lp(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Ty(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&lp(e.default)}const Pt=Object.assign;function su(e,t){const n={};for(const r in t){const a=t[r];n[r]=Gr(a)?a.map(e):e(a)}return n}const Ns=()=>{},Gr=Array.isArray;function $d(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const up=/#/g,ky=/&/g,Sy=/\//g,Cy=/=/g,xy=/\?/g,cp=/\+/g,Ay=/%5B/g,Ey=/%5D/g,dp=/%5E/g,Iy=/%60/g,fp=/%7B/g,Py=/%7C/g,hp=/%7D/g,My=/%20/g;function bc(e){return e==null?"":encodeURI(""+e).replace(Py,"|").replace(Ay,"[").replace(Ey,"]")}function Ry(e){return bc(e).replace(fp,"{").replace(hp,"}").replace(dp,"^")}function Bu(e){return bc(e).replace(cp,"%2B").replace(My,"+").replace(up,"%23").replace(ky,"%26").replace(Iy,"`").replace(fp,"{").replace(hp,"}").replace(dp,"^")}function $y(e){return Bu(e).replace(Cy,"%3D")}function Ny(e){return bc(e).replace(up,"%23").replace(xy,"%3F")}function Oy(e){return Ny(e).replace(Sy,"%2F")}function qs(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Dy=/\/$/,Ly=e=>e.replace(Dy,"");function iu(e,t,n="/"){let r,a={},o="",i="";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),i=t.slice(l,t.length)),r=By(r??t,n),{fullPath:r+o+i,path:r,query:a,hash:qs(i)}}function jy(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Nd(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Fy(e,t,n){const r=t.matched.length-1,a=n.matched.length-1;return r>-1&&r===a&&es(t.matched[r],n.matched[a])&&pp(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function es(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function pp(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Uy(e[n],t[n]))return!1;return!0}function Uy(e,t){return Gr(e)?Od(e,t):Gr(t)?Od(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Od(e,t){return Gr(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function By(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,i,l;for(i=0;i<r.length;i++)if(l=r[i],l!==".")if(l==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(i).join("/")}const Ho={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let qu=(function(e){return e.pop="pop",e.push="push",e})({}),lu=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function qy(e){if(!e)if(La){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Ly(e)}const Hy=/^[^#]+#/;function zy(e,t){return e.replace(Hy,"#")+t}function Vy(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 ll=()=>({left:window.scrollX,top:window.scrollY});function Wy(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=Vy(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 Dd(e,t){return(history.state?history.state.position-t:-1)+e}const Hu=new Map;function Gy(e,t){Hu.set(e,t)}function Ky(e){const t=Hu.get(e);return Hu.delete(e),t}function Jy(e){return typeof e=="string"||e&&typeof e=="object"}function mp(e){return typeof e=="string"||typeof e=="symbol"}let Zt=(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 vp=Symbol("");Zt.MATCHER_NOT_FOUND+"",Zt.NAVIGATION_GUARD_REDIRECT+"",Zt.NAVIGATION_ABORTED+"",Zt.NAVIGATION_CANCELLED+"",Zt.NAVIGATION_DUPLICATED+"";function ts(e,t){return Pt(new Error,{type:e,[vp]:!0},t)}function ko(e,t){return e instanceof Error&&vp in e&&(t==null||!!(e.type&t))}const Yy=["params","query","hash"];function Qy(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Yy)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Xy(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(cp," "),o=a.indexOf("="),i=qs(o<0?a:a.slice(0,o)),l=o<0?null:qs(a.slice(o+1));if(i in t){let c=t[i];Gr(c)||(c=t[i]=[c]),c.push(l)}else t[i]=l}return t}function Ld(e){let t="";for(let n in e){const r=e[n];if(n=$y(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(Gr(r)?r.map(a=>a&&Bu(a)):[r&&Bu(r)]).forEach(a=>{a!==void 0&&(t+=(t.length?"&":"")+n,a!=null&&(t+="="+a))})}return t}function Zy(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=Gr(r)?r.map(a=>a==null?null:""+a):r==null?r:""+r)}return t}const ew=Symbol(""),jd=Symbol(""),ul=Symbol(""),_c=Symbol(""),zu=Symbol("");function Ts(){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 Go(e,t,n,r,a,o=i=>i()){const i=r&&(r.enterCallbacks[a]=r.enterCallbacks[a]||[]);return()=>new Promise((l,c)=>{const f=b=>{b===!1?c(ts(Zt.NAVIGATION_ABORTED,{from:n,to:t})):b instanceof Error?c(b):Jy(b)?c(ts(Zt.NAVIGATION_GUARD_REDIRECT,{from:t,to:b})):(i&&r.enterCallbacks[a]===i&&typeof b=="function"&&i.push(b),l())},h=o(()=>e.call(r&&r.instances[a],t,n,f));let v=Promise.resolve(h);e.length<3&&(v=v.then(f)),v.catch(b=>c(b))})}function uu(e,t,n,r,a=o=>o()){const o=[];for(const i of e)for(const l in i.components){let c=i.components[l];if(!(t!=="beforeRouteEnter"&&!i.instances[l]))if(lp(c)){const f=(c.__vccOpts||c)[t];f&&o.push(Go(f,n,r,i,l,a))}else{let f=c();o.push(()=>f.then(h=>{if(!h)throw new Error(`Couldn't resolve component "${l}" at "${i.path}"`);const v=Ty(h)?h.default:h;i.mods[l]=h,i.components[l]=v;const b=(v.__vccOpts||v)[t];return b&&Go(b,n,r,i,l,a)()}))}}return o}function tw(e,t){const n=[],r=[],a=[],o=Math.max(t.matched.length,e.matched.length);for(let i=0;i<o;i++){const l=t.matched[i];l&&(e.matched.find(f=>es(f,l))?r.push(l):n.push(l));const c=e.matched[i];c&&(t.matched.find(f=>es(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 nw=()=>location.protocol+"//"+location.host;function gp(e,t){const{pathname:n,search:r,hash:a}=t,o=e.indexOf("#");if(o>-1){let i=a.includes(e.slice(o))?e.slice(o).length:1,l=a.slice(i);return l[0]!=="/"&&(l="/"+l),Nd(l,"")}return Nd(n,e)+r+a}function rw(e,t,n,r){let a=[],o=[],i=null;const l=({state:b})=>{const x=gp(e,location),j=n.value,q=t.value;let te=0;if(b){if(n.value=x,t.value=b,i&&i===j){i=null;return}te=q?b.position-q.position:0}else r(x);a.forEach(H=>{H(n.value,j,{delta:te,type:qu.pop,direction:te?te>0?lu.forward:lu.back:lu.unknown})})};function c(){i=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:ll()}),"")}}function v(){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:v}}function Fd(e,t,n,r=!1,a=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:a?ll():null}}function ow(e){const{history:t,location:n}=window,r={value:gp(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 v=e.indexOf("#"),b=v>-1?(n.host&&document.querySelector("base")?e:e.slice(v))+c:nw()+e+c;try{t[h?"replaceState":"pushState"](f,"",b),a.value=f}catch(x){console.error(x),n[h?"replace":"assign"](b)}}function i(c,f){o(c,Pt({},t.state,Fd(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:ll()});o(h.current,h,!0),o(c,Pt({},Fd(r.value,c,null),{position:h.position+1},f),!1),r.value=c}return{location:r,state:a,push:l,replace:i}}function aw(e){e=qy(e);const t=ow(e),n=rw(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const a=Pt({location:"",base:e,go:r,createHref:zy.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 sw(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),aw(e)}let ma=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var fn=(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})(fn||{});const iw={type:ma.Static,value:""},lw=/[a-zA-Z0-9_]/;function uw(e){if(!e)return[[]];if(e==="/")return[[iw]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(x){throw new Error(`ERR (${n})/"${f}": ${x}`)}let n=fn.Static,r=n;const a=[];let o;function i(){o&&a.push(o),o=[]}let l=0,c,f="",h="";function v(){f&&(n===fn.Static?o.push({type:ma.Static,value:f}):n===fn.Param||n===fn.ParamRegExp||n===fn.ParamRegExpEnd?(o.length>1&&(c==="*"||c==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),o.push({type:ma.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!==fn.ParamRegExp){r=n,n=fn.EscapeNext;continue}switch(n){case fn.Static:c==="/"?(f&&v(),i()):c===":"?(v(),n=fn.Param):b();break;case fn.EscapeNext:b(),n=r;break;case fn.Param:c==="("?n=fn.ParamRegExp:lw.test(c)?b():(v(),n=fn.Static,c!=="*"&&c!=="?"&&c!=="+"&&l--);break;case fn.ParamRegExp:c===")"?h[h.length-1]=="\\"?h=h.slice(0,-1)+c:n=fn.ParamRegExpEnd:h+=c;break;case fn.ParamRegExpEnd:v(),n=fn.Static,c!=="*"&&c!=="?"&&c!=="+"&&l--,h="";break;default:t("Unknown state");break}}return n===fn.ParamRegExp&&t(`Unfinished custom RegExp for param "${f}"`),v(),i(),a}const Ud="[^/]+?",cw={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 dw=/[.+*?^${}()[\]/\\]/g;function fw(e,t){const n=Pt({},cw,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 v=0;v<f.length;v++){const b=f[v];let x=nr.Segment+(n.sensitive?nr.BonusCaseSensitive:0);if(b.type===ma.Static)v||(a+="/"),a+=b.value.replace(dw,"\\$&"),x+=nr.Static;else if(b.type===ma.Param){const{value:j,repeatable:q,optional:te,regexp:H}=b;o.push({name:j,repeatable:q,optional:te});const O=H||Ud;if(O!==Ud){x+=nr.BonusCustomRegExp;try{`${O}`}catch(X){throw new Error(`Invalid custom RegExp for param "${j}" (${O}): `+X.message)}}let V=q?`((?:${O})(?:/(?:${O}))*)`:`(${O})`;v||(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 i=new RegExp(a,n.sensitive?"":"i");function l(f){const h=f.match(i),v={};if(!h)return null;for(let b=1;b<h.length;b++){const x=h[b]||"",j=o[b-1];v[j.name]=x&&j.repeatable?x.split("/"):x}return v}function c(f){let h="",v=!1;for(const b of e){(!v||!h.endsWith("/"))&&(h+="/"),v=!1;for(const x of b)if(x.type===ma.Static)h+=x.value;else if(x.type===ma.Param){const{value:j,repeatable:q,optional:te}=x,H=j in f?f[j]:"";if(Gr(H)&&!q)throw new Error(`Provided param "${j}" is an array but it is not repeatable (* or + modifiers)`);const O=Gr(H)?H.join("/"):H;if(!O)if(te)b.length<2&&(h.endsWith("/")?h=h.slice(0,-1):v=!0);else throw new Error(`Missing required param "${j}"`);h+=O}}return h||"/"}return{re:i,score:r,keys:o,parse:l,stringify:c}}function hw(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 yp(e,t){let n=0;const r=e.score,a=t.score;for(;n<r.length&&n<a.length;){const o=hw(r[n],a[n]);if(o)return o;n++}if(Math.abs(a.length-r.length)===1){if(Bd(r))return 1;if(Bd(a))return-1}return a.length-r.length}function Bd(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const pw={strict:!1,end:!0,sensitive:!1};function mw(e,t,n){const r=fw(uw(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 vw(e,t){const n=[],r=new Map;t=$d(pw,t);function a(v){return r.get(v)}function o(v,b,x){const j=!x,q=Hd(v);q.aliasOf=x&&x.record;const te=$d(t,v),H=[q];if("alias"in v){const X=typeof v.alias=="string"?[v.alias]:v.alias;for(const Ce of X)H.push(Hd(Pt({},q,{components:x?x.record.components:q.components,path:Ce,aliasOf:x?x.record:q})))}let O,V;for(const X of H){const{path:Ce}=X;if(b&&Ce[0]!=="/"){const Oe=b.record.path,ce=Oe[Oe.length-1]==="/"?"":"/";X.path=b.record.path+(Ce&&ce+Ce)}if(O=mw(X,b,te),x?x.alias.push(O):(V=V||O,V!==O&&V.alias.push(O),j&&v.name&&!zd(O)&&i(v.name)),wp(O)&&c(O),q.children){const Oe=q.children;for(let ce=0;ce<Oe.length;ce++)o(Oe[ce],O,x&&x.children[ce])}x=x||O}return V?()=>{i(V)}:Ns}function i(v){if(mp(v)){const b=r.get(v);b&&(r.delete(v),n.splice(n.indexOf(b),1),b.children.forEach(i),b.alias.forEach(i))}else{const b=n.indexOf(v);b>-1&&(n.splice(b,1),v.record.name&&r.delete(v.record.name),v.children.forEach(i),v.alias.forEach(i))}}function l(){return n}function c(v){const b=ww(v,n);n.splice(b,0,v),v.record.name&&!zd(v)&&r.set(v.record.name,v)}function f(v,b){let x,j={},q,te;if("name"in v&&v.name){if(x=r.get(v.name),!x)throw ts(Zt.MATCHER_NOT_FOUND,{location:v});te=x.record.name,j=Pt(qd(b.params,x.keys.filter(V=>!V.optional).concat(x.parent?x.parent.keys.filter(V=>V.optional):[]).map(V=>V.name)),v.params&&qd(v.params,x.keys.map(V=>V.name))),q=x.stringify(j)}else if(v.path!=null)q=v.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 ts(Zt.MATCHER_NOT_FOUND,{location:v,currentLocation:b});te=x.record.name,j=Pt({},b.params,v.params),q=x.stringify(j)}const H=[];let O=x;for(;O;)H.unshift(O.record),O=O.parent;return{name:te,path:q,params:j,matched:H,meta:yw(H)}}e.forEach(v=>o(v));function h(){n.length=0,r.clear()}return{addRoute:o,resolve:f,removeRoute:i,clearRoutes:h,getRoutes:l,getRecordMatcher:a}}function qd(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Hd(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:gw(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 gw(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 zd(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function yw(e){return e.reduce((t,n)=>Pt(t,n.meta),{})}function ww(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;yp(e,t[o])<0?r=o:n=o+1}const a=bw(e);return a&&(r=t.lastIndexOf(a,r-1)),r}function bw(e){let t=e;for(;t=t.parent;)if(wp(t)&&yp(e,t)===0)return t}function wp({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Vd(e){const t=Hr(ul),n=Hr(_c),r=ae(()=>{const c=T(e.to);return t.resolve(c)}),a=ae(()=>{const{matched:c}=r.value,{length:f}=c,h=c[f-1],v=n.matched;if(!h||!v.length)return-1;const b=v.findIndex(es.bind(null,h));if(b>-1)return b;const x=Wd(c[f-2]);return f>1&&Wd(h)===x&&v[v.length-1].path!==x?v.findIndex(es.bind(null,c[f-2])):b}),o=ae(()=>a.value>-1&&Cw(n.params,r.value.params)),i=ae(()=>a.value>-1&&a.value===n.matched.length-1&&pp(n.params,r.value.params));function l(c={}){if(Sw(c)){const f=t[T(e.replace)?"replace":"push"](T(e.to)).catch(Ns);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>f),f}return Promise.resolve()}return{route:r,href:ae(()=>r.value.href),isActive:o,isExactActive:i,navigate:l}}function _w(e){return e.length===1?e[0]:e}const Tw=Bn({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:Vd,setup(e,{slots:t}){const n=nl(Vd(e)),{options:r}=Hr(ul),a=ae(()=>({[Gd(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Gd(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&_w(t.default(n));return e.custom?o:wc("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:a.value},o)}}}),kw=Tw;function Sw(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 Cw(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(!Gr(a)||a.length!==r.length||r.some((o,i)=>o.valueOf()!==a[i].valueOf()))return!1}return!0}function Wd(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Gd=(e,t,n)=>e??t??n,xw=Bn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Hr(zu),a=ae(()=>e.route||r.value),o=Hr(jd,0),i=ae(()=>{let f=T(o);const{matched:h}=a.value;let v;for(;(v=h[f])&&!v.components;)f++;return f}),l=ae(()=>a.value.matched[i.value]);$i(jd,ae(()=>i.value+1)),$i(ew,l),$i(zu,a);const c=I();return vt(()=>[c.value,l.value,e.name],([f,h,v],[b,x,j])=>{h&&(h.instances[v]=f,x&&x!==h&&f&&f===b&&(h.leaveGuards.size||(h.leaveGuards=x.leaveGuards),h.updateGuards.size||(h.updateGuards=x.updateGuards))),f&&h&&(!x||!es(h,x)||!b)&&(h.enterCallbacks[v]||[]).forEach(q=>q(f))},{flush:"post"}),()=>{const f=a.value,h=e.name,v=l.value,b=v&&v.components[h];if(!b)return Kd(n.default,{Component:b,route:f});const x=v.props[h],j=x?x===!0?f.params:typeof x=="function"?x(f):x:null,te=wc(b,Pt({},j,t,{onVnodeUnmounted:H=>{H.component.isUnmounted&&(v.instances[h]=null)},ref:c}));return Kd(n.default,{Component:te,route:f})||te}}});function Kd(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Aw=xw;function Ew(e){const t=vw(e.routes,e),n=e.parseQuery||Xy,r=e.stringifyQuery||Ld,a=e.history,o=Ts(),i=Ts(),l=Ts(),c=wv(Ho);let f=Ho;La&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const h=su.bind(null,K=>""+K),v=su.bind(null,Oy),b=su.bind(null,qs);function x(K,_e){let we,De;return mp(K)?(we=t.getRecordMatcher(K),De=_e):De=K,t.addRoute(De,we)}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 H(K,_e){if(_e=Pt({},_e||c.value),typeof K=="string"){const z=iu(n,K,_e.path),ne=t.resolve({path:z.path},_e),J=a.createHref(z.fullPath);return Pt(z,ne,{params:b(ne.params),hash:qs(z.hash),redirectedFrom:void 0,href:J})}let we;if(K.path!=null)we=Pt({},K,{path:iu(n,K.path,_e.path).path});else{const z=Pt({},K.params);for(const ne in z)z[ne]==null&&delete z[ne];we=Pt({},K,{params:v(z)}),_e.params=v(_e.params)}const De=t.resolve(we,_e),Je=K.hash||"";De.params=h(b(De.params));const k=jy(r,Pt({},K,{hash:Ry(Je),path:De.path})),E=a.createHref(k);return Pt({fullPath:k,hash:Je,query:r===Ld?Zy(K.query):K.query||{}},De,{redirectedFrom:void 0,href:E})}function O(K){return typeof K=="string"?iu(n,K,c.value.path):Pt({},K)}function V(K,_e){if(f!==K)return ts(Zt.NAVIGATION_CANCELLED,{from:_e,to:K})}function X(K){return ce(K)}function Ce(K){return X(Pt(O(K),{replace:!0}))}function Oe(K,_e){const we=K.matched[K.matched.length-1];if(we&&we.redirect){const{redirect:De}=we;let Je=typeof De=="function"?De(K,_e):De;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 ce(K,_e){const we=f=H(K),De=c.value,Je=K.state,k=K.force,E=K.replace===!0,z=Oe(we,De);if(z)return ce(Pt(O(z),{state:typeof z=="object"?Pt({},Je,z.state):Je,force:k,replace:E}),_e||we);const ne=we;ne.redirectedFrom=_e;let J;return!k&&Fy(r,De,we)&&(J=ts(Zt.NAVIGATION_DUPLICATED,{to:ne,from:De}),ze(De,De,!0,!1)),(J?Promise.resolve(J):Ae(ne,De)).catch(oe=>ko(oe)?ko(oe,Zt.NAVIGATION_GUARD_REDIRECT)?oe:nt(oe):me(oe,ne,De)).then(oe=>{if(oe){if(ko(oe,Zt.NAVIGATION_GUARD_REDIRECT))return ce(Pt({replace:E},O(oe.to),{state:typeof oe.to=="object"?Pt({},Je,oe.to.state):Je,force:k}),_e||ne)}else oe=ee(ne,De,!0,E,Je);return He(ne,De,oe),oe})}function xe(K,_e){const we=V(K,_e);return we?Promise.reject(we):Promise.resolve()}function Z(K){const _e=ft.values().next().value;return _e&&typeof _e.runWithContext=="function"?_e.runWithContext(K):K()}function Ae(K,_e){let we;const[De,Je,k]=tw(K,_e);we=uu(De.reverse(),"beforeRouteLeave",K,_e);for(const z of De)z.leaveGuards.forEach(ne=>{we.push(Go(ne,K,_e))});const E=xe.bind(null,K,_e);return we.push(E),ct(we).then(()=>{we=[];for(const z of o.list())we.push(Go(z,K,_e));return we.push(E),ct(we)}).then(()=>{we=uu(Je,"beforeRouteUpdate",K,_e);for(const z of Je)z.updateGuards.forEach(ne=>{we.push(Go(ne,K,_e))});return we.push(E),ct(we)}).then(()=>{we=[];for(const z of k)if(z.beforeEnter)if(Gr(z.beforeEnter))for(const ne of z.beforeEnter)we.push(Go(ne,K,_e));else we.push(Go(z.beforeEnter,K,_e));return we.push(E),ct(we)}).then(()=>(K.matched.forEach(z=>z.enterCallbacks={}),we=uu(k,"beforeRouteEnter",K,_e,Z),we.push(E),ct(we))).then(()=>{we=[];for(const z of i.list())we.push(Go(z,K,_e));return we.push(E),ct(we)}).catch(z=>ko(z,Zt.NAVIGATION_CANCELLED)?z:Promise.reject(z))}function He(K,_e,we){l.list().forEach(De=>Z(()=>De(K,_e,we)))}function ee(K,_e,we,De,Je){const k=V(K,_e);if(k)return k;const E=_e===Ho,z=La?history.state:{};we&&(De||E?a.replace(K.fullPath,Pt({scroll:E&&z&&z.scroll},Je)):a.push(K.fullPath,Je)),c.value=K,ze(K,_e,we,E),nt()}let be;function Le(){be||(be=a.listen((K,_e,we)=>{if(!et.listening)return;const De=H(K),Je=Oe(De,et.currentRoute.value);if(Je){ce(Pt(Je,{replace:!0,force:!0}),De).catch(Ns);return}f=De;const k=c.value;La&&Gy(Dd(k.fullPath,we.delta),ll()),Ae(De,k).catch(E=>ko(E,Zt.NAVIGATION_ABORTED|Zt.NAVIGATION_CANCELLED)?E:ko(E,Zt.NAVIGATION_GUARD_REDIRECT)?(ce(Pt(O(E.to),{force:!0}),De).then(z=>{ko(z,Zt.NAVIGATION_ABORTED|Zt.NAVIGATION_DUPLICATED)&&!we.delta&&we.type===qu.pop&&a.go(-1,!1)}).catch(Ns),Promise.reject()):(we.delta&&a.go(-we.delta,!1),me(E,De,k))).then(E=>{E=E||ee(De,k,!1),E&&(we.delta&&!ko(E,Zt.NAVIGATION_CANCELLED)?a.go(-we.delta,!1):we.type===qu.pop&&ko(E,Zt.NAVIGATION_ABORTED|Zt.NAVIGATION_DUPLICATED)&&a.go(-1,!1)),He(De,k,E)}).catch(Ns)}))}let Ke=Ts(),Ue=Ts(),Se;function me(K,_e,we){nt(K);const De=Ue.list();return De.length?De.forEach(Je=>Je(K,_e,we)):console.error(K),Promise.reject(K)}function We(){return Se&&c.value!==Ho?Promise.resolve():new Promise((K,_e)=>{Ke.add([K,_e])})}function nt(K){return Se||(Se=!K,Le(),Ke.list().forEach(([_e,we])=>K?we(K):_e()),Ke.reset()),K}function ze(K,_e,we,De){const{scrollBehavior:Je}=e;if(!La||!Je)return Promise.resolve();const k=!we&&Ky(Dd(K.fullPath,0))||(De||!we)&&history.state&&history.state.scroll||null;return sn().then(()=>Je(K,_e,k)).then(E=>E&&Wy(E)).catch(E=>me(E,K,_e))}const je=K=>a.go(K);let dt;const ft=new Set,et={currentRoute:c,listening:!0,addRoute:x,removeRoute:j,clearRoutes:t.clearRoutes,hasRoute:te,getRoutes:q,resolve:H,options:e,push:X,replace:Ce,go:je,back:()=>je(-1),forward:()=>je(1),beforeEach:o.add,beforeResolve:i.add,afterEach:l.add,onError:Ue.add,isReady:We,install(K){K.component("RouterLink",kw),K.component("RouterView",Aw),K.config.globalProperties.$router=et,Object.defineProperty(K.config.globalProperties,"$route",{enumerable:!0,get:()=>T(c)}),La&&!dt&&c.value===Ho&&(dt=!0,X(a.location).catch(De=>{}));const _e={};for(const De in Ho)Object.defineProperty(_e,De,{get:()=>c.value[De],enumerable:!0});K.provide(ul,et),K.provide(_c,mh(_e)),K.provide(zu,c);const we=K.unmount;ft.add(K),K.unmount=function(){ft.delete(K),ft.size<1&&(f=Ho,be&&be(),be=null,c.value=Ho,dt=!1,Se=!1),we()}}};function ct(K){return K.reduce((_e,we)=>_e.then(()=>Z(we)),Promise.resolve())}return et}function Iw(){return Hr(ul)}function Pw(e){return Hr(_c)}const Jd=768;function Tc(){const e=I(typeof window<"u"?window.innerWidth<Jd:!1);let t=null;function n(r){e.value=r.matches}return Xo(()=>{t=window.matchMedia(`(max-width: ${Jd-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),ol(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Mw={key:0,class:"desktop-sidebar"},Rw={class:"desktop-main"},Yd="codex-web-local.sidebar-width.v1",$w=260,Nw=620,Qd=320,Ow=Bn({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Tc();function r(f){return Math.min(Nw,Math.max($w,f))}function a(){if(typeof window>"u")return Qd;const f=window.localStorage.getItem(Yd),h=Number(f);return Number.isFinite(h)?r(h):Qd}const o=I(a()),i=ae(()=>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(Yd,String(f))}function c(f){f.preventDefault();const h=f.clientX,v=o.value,b=j=>{const q=j.clientX-h;o.value=r(v+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":T(n)}]),style:Io(i.value)},[T(n)?(C(),rt(pa,{key:0,to:"body"},[Ne(sp,{name:"drawer"},{default:ut(()=>[e.isSidebarCollapsed?ie("",!0):(C(),R("div",{key:0,class:"mobile-drawer-backdrop",onClick:h[1]||(h[1]=v=>f.$emit("close-sidebar"))},[m("aside",{class:"mobile-drawer",onClick:h[0]||(h[0]=tt(()=>{},["stop"]))},[ho(f.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):ie("",!0),T(n)?ie("",!0):(C(),R(Ge,{key:1},[e.isSidebarCollapsed?ie("",!0):(C(),R("aside",Mw,[ho(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",Rw,[ho(f.$slots,"content",{},void 0)])],6))}}),At=(e,t)=>{const n=e.__vccOpts||e;for(const[r,a]of t)n[r]=a;return n},Dw=At(Ow,[["__scopeId","data-v-4c6dbcd7"]]);function Xd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class mo extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function Zo(e,t){if(typeof e=="string"&&e.length>0)return e;const n=Xd(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const a=Xd(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 No(e,t,n){return e instanceof mo?e:e instanceof Error?new mo(e.message||t,{code:"unknown_error",method:n}):new mo(t,{code:"unknown_error",method:n})}function bp(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function Lw(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 mo(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=Zo(a,"")||(o==null?void 0:o.slice(0,500))||"",c=`RPC ${e} failed with HTTP ${r.status}`;throw new mo(l?`${c}: ${l}`:c,{code:"http_error",method:e,status:r.status})}const i=a;if(!i||typeof i!="object"||!("result"in i))throw new mo(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return i.result}async function jw(){const e=await fetch("/codex-api/meta/methods");let t=null;try{t=await e.json()}catch{t=null}if(!e.ok)throw new mo(Zo(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 Fw(e){const t=bp(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 Zd(e,t={ok:!0}){e({method:"ready",params:t,atIso:new Date().toISOString()})}function Uw(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 v=Math.min(1e3*2**h,1e4);r=window.setTimeout(()=>{r=null,!n&&f()},v)},i=f=>{const h=Fw(f);h&&e(h)},l=(f=0)=>{if(typeof EventSource>"u"||n)return;t==null||t();const h=new EventSource("/codex-api/events");let v=!1;h.onmessage=b=>{try{i(JSON.parse(b.data))}catch{}},h.addEventListener("ready",b=>{try{const x=b.data?JSON.parse(b.data):{ok:!0};Zd(e,x)}catch{Zd(e)}}),h.onerror=()=>{n||v||h.readyState===EventSource.CLOSED&&(v=!0,h.close(),o(()=>l(f+1),f))},t=()=>{v=!0,h.close()}},c=(f=0)=>{if(typeof WebSocket>"u"||n){l();return}t==null||t();const h=window.location.protocol==="https:"?"wss:":"ws:",v=new WebSocket(`${h}//${window.location.host}/codex-api/ws`);let b=!1,x=!1,j=window.setTimeout(()=>{b||n||x||(x=!0,v.close(),l())},2500);v.onopen=()=>{b=!0,a(),j!==null&&(window.clearTimeout(j),j=null)},v.onmessage=q=>{try{i(JSON.parse(String(q.data)))}catch{}},v.onerror=()=>{},v.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),v.close()}};return typeof WebSocket<"u"?c():l(),()=>{n=!0,a(),t==null||t()}}async function Bw(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 mo(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 mo(Zo(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function qw(){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 mo(Zo(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=bp(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function Hw(e){const t=e.trim();return t?t.startsWith("\\\\?\\UNC\\")?`\\\\${t.slice(8)}`:t.startsWith("\\\\?\\")?t.slice(4):t:""}function jt(e){return Hw(e)}function zw(e){return/^[a-z]:[\\/]/iu.test(e)||e.startsWith("\\\\")}function Vw(e){const t=jt(e).replace(/[\\/]+/gu,"/");return zw(t)?t.toLowerCase():t}function fa(e){const t=jt(e).replace(/[\\/]+$/u,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<0?t:t.slice(n+1)}function cu(e){const t=jt(e).replace(/[\\/]+$/u,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<=0?"":t.slice(0,n)}function Js(e){return fa(e)||jt(e)||"Projectless"}function _p(e){const t=jt(e).replace(/[\\/]+/gu,"/");return t?/(?:^|\/)Documents\/Codex\/\d{4}-\d{2}-\d{2}\/[^/]+$/u.test(t):!1}function ef(e){return new Date(e*1e3).toISOString()}function Ww(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Gw=/^##\s+(.+?):\s+(.+?)\s*$/,Kw=/^#\s*files mentioned by the user\s*:?\s*$/i;function Jw(e){var a,o;const t=e.split(`
|
|
27
|
-
`).findIndex(i=>Kw.test(i.trim()));if(t<0)return[];const n=e.split(`
|
|
28
|
-
`).slice(t+1),r=[];for(const i of n){const l=i.trim();if(!l)continue;const c=l.match(Gw);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 Yw(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 Tp(e){return`/codex-local-image?path=${encodeURIComponent(e)}`}function Qw(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 tf(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 Xw(e){const t=e.trim();if(!t.startsWith("<heartbeat>")||!t.endsWith("</heartbeat>"))return null;const n=tf(t,"instructions");return n?{automationId:tf(t,"automation_id"),instructions:n}:null}function Zw(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(Tp(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:Ww(f),isUnhandled:!0});const o=n.join(`
|
|
29
|
-
`),i=Jw(o),l=Xw(o);return{text:(l==null?void 0:l.instructions)??Yw(o),images:r,fileAttachments:i,rawBlocks:a,isAutomationRun:l!==null,automationDisplayName:(l==null?void 0:l.automationId)||null}}function eb(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 i of n){const l=i.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 v="pending";f==="x"&&(v="completed"),(f==="~"||f===">"||f==="-")&&(v="inProgress"),r.push({step:h,status:v});continue}a.push(l)}return r.length===0?null:{explanation:a.join(`
|
|
32
|
-
`).trim()||void 0,steps:r}}function nf(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 tb(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 Sp(e){const t=Array.isArray(e)?e:[],n=[];for(const r of t){const a=r,o=typeof a.path=="string"?a.path:"",i=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"?tb(i):c==="add"?{addedLineCount:nf(i),removedLineCount:0}:{addedLineCount:0,removedLineCount:nf(i)};n.push({path:o,operation:c,movedToPath:f,diff:i,...h})}return n}function nb(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=Zw(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:[Tp(t)],messageType:"imageView"}]:[]}{const t=e;if(t.type==="imageGeneration"||t.type==="image_generation"){const n=typeof t.result=="string"?Qw(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:eb(t)??void 0}]}if(e.type==="commandExecution"){const t=e,n=rb(t.status),r=typeof t.command=="string"?t.command:"",a=typeof t.cwd=="string"?t.cwd:null,o=typeof t.aggregatedOutput=="string"?t.aggregatedOutput:"",i=typeof t.exitCode=="number"?t.exitCode:null;return[{id:e.id,role:"system",text:r,messageType:"commandExecution",commandExecution:{command:r,cwd:a,status:n,aggregatedOutput:o,exitCode:i}}]}if(e.type==="fileChange"){const t=Sp(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 rb(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function ob(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 ab(e){const t=ob(e);return t.length>0?t:"Untitled thread"}function kc(e){return(e==null?void 0:e.status)==="inProgress"}function sb(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 kc(r)}function ib(e){const t=e,n=jt(typeof t.cwd=="string"?t.cwd:e.cwd),r=Vw(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:ab(e),projectName:Js(n),cwd:n,hasWorktree:a,createdAtIso:ef(e.createdAt),updatedAtIso:ef(e.updatedAt),preview:e.preview,unread:!1,inProgress:sb(e)}}function lb(e){const t=new Map;for(const n of e){const r=t.get(n.projectName);r?r.push(n):t.set(n.projectName,[n])}return Array.from(t.entries()).map(([n,r])=>({projectName:n,threads:r.sort((a,o)=>new Date(o.updatedAtIso).getTime()-new Date(a.updatedAtIso).getTime())})).sort((n,r)=>{var i,l;const a=new Date(((i=n.threads[0])==null?void 0:i.updatedAtIso)??0).getTime();return new Date(((l=r.threads[0])==null?void 0:l.updatedAtIso)??0).getTime()-a})}function ub(e){const t=e.data.map(ib);return lb(t)}function cl(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,i=Array.isArray(a.items)?a.items:[];for(const l of i)for(const c of nb(l))n.push({...c,turnId:o,turnIndex:r})}return n}function Cp(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return kc(t.at(-1))}function xp(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(kc(r)&&typeof r.id=="string"&&r.id.trim().length>0)return r.id.trim()}return""}const cb=5e3;function du(e){return e&&e.length>0?e:null}function fu(e){return e&&e.length>0?e:null}const rf=[{value:"default",label:"Default"},{value:"plan",label:"Plan"}];function at(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function le(e){return typeof e=="string"&&e.length>0?e:null}function hn(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function Er(e){return typeof e=="boolean"?e:null}function Ua(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}function db(e){return e==="payment_required"?e:null}function fb(e){if(!e)return!1;const t=e.toLowerCase();return t.includes("payment required")||/\b402\b/.test(t)}function of(e){const t=at(e);if(!t)return null;const n=hn(t.usedPercent??t.used_percent);if(n===null)return null;const r=hn(t.windowDurationMins??t.window_minutes);return{usedPercent:n,windowDurationMins:r,windowMinutes:r,resetsAt:hn(t.resetsAt??t.resets_at)}}function hb(e){const t=at(e);if(!t)return null;const n=Er(t.hasCredits??t.has_credits),r=Er(t.unlimited);return n===null||r===null?null:{hasCredits:n,unlimited:r,balance:le(t.balance)}}function Vu(e){const t=at(e);if(!t)return null;const n=of(t.primary),r=of(t.secondary),a=hb(t.credits);return!n&&!r&&!a?null:{limitId:le(t.limitId??t.limit_id),limitName:le(t.limitName??t.limit_name),primary:n,secondary:r,credits:a,planType:le(t.planType??t.plan_type)}}function Ap(e,t=null){const n=at(e);if(!n)return null;const r=le(n.accountId),a=le(n.quotaStatus),o=a==="loading"||a==="ready"||a==="error"?a:"idle";return r?{accountId:r,authMode:le(n.authMode),email:le(n.email),planType:le(n.planType),lastRefreshedAtIso:le(n.lastRefreshedAtIso)??"",lastActivatedAtIso:le(n.lastActivatedAtIso),quotaSnapshot:Vu(n.quotaSnapshot),quotaUpdatedAtIso:le(n.quotaUpdatedAtIso),quotaStatus:o,quotaError:le(n.quotaError),unavailableReason:db(n.unavailableReason)??(fb(le(n.quotaError))?"payment_required":null),isActive:Er(n.isActive)??r===t}:null}function Ep(e){const t=at(e);if(!t)return null;const n=at(t.rateLimitsByLimitId??t.rate_limits_by_limit_id),r=Vu(n==null?void 0:n.codex);return r||Vu(t.rateLimits??t.rate_limits)}async function $t(e,t){try{return await Lw(e,t)}catch(n){throw No(n,`RPC ${e} failed`,e)}}function Ip(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 pb(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}function mb(e){return typeof e=="string"&&e.trim().toLowerCase()==="fast"?"fast":"standard"}const vb=50,gb=100;async function yb(e,t){const n=await $t("thread/list",{archived:!1,limit:t,sortKey:"updated_at",modelProviders:[],cursor:e});return{groups:ub(n),nextCursor:typeof n.nextCursor=="string"&&n.nextCursor.length>0?n.nextCursor:null}}async function wb(e){const t=await $t("thread/read",{threadId:e,includeTurns:!0});return{messages:cl(t),inProgress:Cp(t),activeTurnId:xp(t),turnIndexByTurnId:Ip(t)}}async function af(e=null,t=vb){try{return await yb(e,t)}catch(n){throw No(n,"Failed to load thread groups","thread/list")}}function bb(){return gb}async function sf(e){try{return await wb(e)}catch(t){throw No(t,`Failed to load thread ${e}`,"thread/read")}}function _b(e){const t=at(e);if(!t)return null;const n=le(t.key),r=typeof t.text=="string"?t.text:"",a=le(t.kind);return!n||!a||a!=="meta"&&a!=="hunk"&&a!=="add"&&a!=="remove"&&a!=="context"?null:{key:n,kind:a,text:r,oldLine:hn(t.oldLine),newLine:hn(t.newLine)}}function Tb(e){const t=at(e);if(!t)return null;const n=le(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:hn(t.addedLineCount)??0,removedLineCount:hn(t.removedLineCount)??0,oldStart:hn(t.oldStart),oldLineCount:hn(t.oldLineCount)??0,newStart:hn(t.newStart),newLineCount:hn(t.newLineCount)??0,lines:Array.isArray(t.lines)?t.lines.map(o=>_b(o)).filter(o=>o!==null):[]}:null}function kb(e){const t=at(e);if(!t)return null;const n=le(t.id),r=le(t.path),a=le(t.absolutePath),o=le(t.operation);return!n||!r||!a||!o||o!=="add"&&o!=="delete"&&o!=="update"&&o!=="rename"?null:{id:n,path:r,absolutePath:a,previousPath:le(t.previousPath),previousAbsolutePath:le(t.previousAbsolutePath),operation:o,addedLineCount:hn(t.addedLineCount)??0,removedLineCount:hn(t.removedLineCount)??0,diff:typeof t.diff=="string"?t.diff:"",hunks:Array.isArray(t.hunks)?t.hunks.map(i=>Tb(i)).filter(i=>i!==null):[]}}function Pp(e){const t=at(e),n=at(t==null?void 0:t.data),r=at(n==null?void 0:n.summary),a=le(n==null?void 0:n.scope)==="baseBranch"?"baseBranch":"workspace",o=le(n==null?void 0:n.workspaceView)==="staged"?"staged":"unstaged";return{cwd:le(n==null?void 0:n.cwd)??"",gitRoot:le(n==null?void 0:n.gitRoot),isGitRepo:Er(n==null?void 0:n.isGitRepo)??!1,scope:a,workspaceView:o,baseBranch:le(n==null?void 0:n.baseBranch),baseBranchOptions:Array.isArray(n==null?void 0:n.baseBranchOptions)?n.baseBranchOptions.map(i=>le(i)).filter(i=>typeof i=="string"&&i.length>0):[],headBranch:le(n==null?void 0:n.headBranch),mergeBaseSha:le(n==null?void 0:n.mergeBaseSha),generatedAtIso:le(n==null?void 0:n.generatedAtIso)??"",summary:{fileCount:hn(r==null?void 0:r.fileCount)??0,addedLineCount:hn(r==null?void 0:r.addedLineCount)??0,removedLineCount:hn(r==null?void 0:r.removedLineCount)??0},files:Array.isArray(n==null?void 0:n.files)?n.files.map(i=>kb(i)).filter(i=>i!==null):[]}}function Sb(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 Cb(e){var i;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 v=((i=h[1])==null?void 0:i.trim())??"",b=Sb(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:v||`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 lf(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 i=o.length-1;i>=0;i-=1){const l=o[i];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 oP(e){const t=await $t("thread/read",{threadId:e,includeTurns:!0}),n=lf(t,"exitedReviewMode");return{enteredReviewLabel:lf(t,"enteredReviewMode"),result:n?Cb(n):null}}async function aP(){return jw()}function Mp(e){const t=at(e);if(!t)return null;const n=le(t.id),r=le(t.kind),a=le(t.name),o=le(t.prompt),i=le(t.rrule),l=le(t.status);return!n||!a||!o||!i||r!=="heartbeat"&&r!=="cron"||l!=="ACTIVE"&&l!=="PAUSED"?null:{id:n,kind:r,name:a,prompt:o,rrule:i,status:l,targetThreadId:le(t.targetThreadId),createdAtMs:hn(t.createdAtMs),updatedAtMs:hn(t.updatedAtMs),nextRunAtMs:hn(t.nextRunAtMs)}}async function xb(){var a;const e=await fetch("/codex-api/thread-automations"),t=await e.json().catch(()=>null);if(!e.ok)throw new Error(Zo(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,i]of Object.entries(n)){const l=Mp(i);l&&(r[o]=l)}return r}async function Ab(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(Zo(n,"Failed to save thread automation"));const r=Mp((a=at(n))==null?void 0:a.data);if(!r)throw new Error("Thread automation response was malformed");return r}async function uf(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(Zo(n,"Failed to delete thread automation"))}function Eb(e){return Uw(e)}function Ib(e){const t=at(e);if(!t)return null;const n=le(t.id),r=le(t.threadId),a=le(t.cwd),o=le(t.shell);return!n||!r||!a||!o?null:{id:n,threadId:r,cwd:a,shell:o,buffer:typeof t.buffer=="string"?t.buffer:"",truncated:Er(t.truncated)??!1}}async function as(e,t){const n=await fetch(e,t),r=await n.json().catch(()=>null);if(!n.ok)throw new Error(Zo(r,`Terminal request failed with HTTP ${n.status}`));return r}async function sP(e){var r;const t=await as("/codex-api/thread-terminal/attach",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=Ib((r=at(t))==null?void 0:r.session);if(!n)throw new Error("Terminal attach response was malformed");return n}async function Pb(){const e=await as("/codex-api/thread-terminal/status"),t=at(e);return{available:Er(t==null?void 0:t.available)??!1,reason:le(t==null?void 0:t.reason)||null}}async function iP(e){const t=await as(`/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),i=le(o==null?void 0:o.label),l=le(o==null?void 0:o.value),c=le(o==null?void 0:o.source);return!i||!l||c!=="package"&&c!=="script"&&c!=="make"?[]:[{label:i,value:l,source:c}]})}async function lP(e,t){await as("/codex-api/thread-terminal/input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e,data:t})})}async function uP(e,t,n){await as("/codex-api/thread-terminal/resize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e,cols:t,rows:n})})}async function cP(e){await as("/codex-api/thread-terminal/close",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e})})}async function Mb(e,t){await Bw({id:e,...t})}async function Rb(){return qw()}async function $b(){try{const e=await $t("account/rateLimits/read");return Ep(e)}catch(e){throw No(e,"Failed to load account rate limits","account/rateLimits/read")}}function Sc(e){const t=at(e),n=le(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:le(t==null?void 0:t.importedAccountId)??void 0,accounts:r.map(a=>Ap(a,n)).filter(a=>a!==null)}}async function Nb(){const e=await fetch("/codex-api/accounts"),t=await e.json();if(!e.ok)throw new Error(qn(t,"Failed to load accounts"));const n=at(t);return Sc(n==null?void 0:n.data)}async function Ob(){const e=await fetch("/codex-api/accounts/refresh",{method:"POST"}),t=await e.json();if(!e.ok)throw new Error(qn(t,"Failed to refresh accounts"));const n=at(t);return Sc(n==null?void 0:n.data)}async function Db(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(qn(n,"Failed to switch account"));const r=at(n),a=at(r==null?void 0:r.data),o=Ap(a==null?void 0:a.account,le(a==null?void 0:a.activeAccountId));if(!o)throw new Error("Failed to switch account");return o}async function Lb(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(qn(n,"Failed to remove account"));const r=at(n);return Sc(r==null?void 0:r.data)}async function hu(e){const t=await $t("thread/resume",{threadId:e});return{model:Gi(t),messages:cl(t),inProgress:Cp(t),activeTurnId:xp(t),turnIndexByTurnId:Ip(t)}}async function jb(e){await $t("thread/archive",{threadId:e})}async function Fb(e,t){await $t("thread/name/set",{threadId:e,name:t})}async function pu(e,t){const n=await $t("thread/rollback",{threadId:e,numTurns:t});return cl(n)}async function Ub(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 Wu(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 Bb(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 Gi(e){if(!e||typeof e!="object")return"";const t=e.model;return typeof t=="string"?t.trim():""}async function cf(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=Wu(r);if(!a)throw new Error("thread/start did not return a thread id");return{threadId:a,model:Gi(r)}}catch(n){throw No(n,"Failed to start a new thread","thread/start")}}async function df(e,t,n){if(arguments.length<=1)try{const r=await $t("thread/fork",{threadId:e,persistExtendedHistory:!0}),a=Wu(r);if(!a)throw new Error("thread/fork did not return a thread id");return{threadId:a,cwd:Bb(r),model:Gi(r),messages:cl(r)}}catch(r){throw No(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),i=Wu(o);if(!i)throw new Error("thread/fork did not return a thread id");return{threadId:i,model:Gi(o)}}catch(r){throw No(r,`Failed to fork thread ${e}`,"thread/fork")}}function ff(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 qb(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 Hb(e){const t=e.replace(/\\/g,"/");return t.split("/").filter(Boolean).at(-1)??t}async function zb(e,t,n){var c;const r=(t==null?void 0:t.trim())??"";if(r)return{model:r,reasoningEffort:e==="plan"?du(n):fu(n)};let a=null;try{a=await $p()}catch{a=null}const o=(a==null?void 0:a.model.trim())??"";if(o)return{model:o,reasoningEffort:e==="plan"?du(n??(a==null?void 0:a.reasoningEffort)):fu(n??(a==null?void 0:a.reasoningEffort))};let i=[];try{i=await Rp()}catch{i=[]}const l=((c=i.find(f=>f.trim().length>0))==null?void 0:c.trim())??"";if(l)return{model:l,reasoningEffort:e==="plan"?du(n??(a==null?void 0:a.reasoningEffort)):fu(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 mu(e,t,n=[],r,a,o,i=[],l){var c;try{const f=(r==null?void 0:r.trim())??"",h=[];for(const O of n){const V=ff(O.trim());V&&h.push({label:Hb(V),path:V,fsPath:V})}const v=[...i,...h],b=v.filter((O,V)=>v.findIndex(X=>X.fsPath===O.fsPath)===V),j=[{type:"text",text:qb(t,b)}];for(const O of n){const V=O.trim();if(!V)continue;const X=ff(V);if(X){j.push({type:"localImage",path:X});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 zb(l,f,a);te.collaborationMode={mode:l,settings:{model:O.model,reasoning_effort:O.reasoningEffort,developer_instructions:null}}}const H=await $t("turn/start",te);return typeof((c=H==null?void 0:H.turn)==null?void 0:c.id)=="string"?H.turn.id.trim():""}catch(f){throw No(f,`Failed to start turn for thread ${e}`,"turn/start")}}async function Vb(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 No(a,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function Wb(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 Gb(){return await(await fetch("/codex-api/free-mode/status")).json()}async function hf(e){return await(await fetch("/codex-api/free-mode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enable:e})})).json()}async function pf(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 Ra(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 Rp(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(cb)});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 i=o.trim();!i||n.includes(i)||n.push(i)}}}catch{}return n}async function $p(){const e=await $t("config/read",{}),t=e.config.model??"",n=typeof e.config.model_provider=="string"?e.config.model_provider:"",r=pb(e.config.model_reasoning_effort),a=mb(e.config.service_tier);return{model:t,providerId:n,reasoningEffort:r,speedMode:a}}function Np(e){const t=at(e);if(!t)return null;const n=le(t.id),r=le(t.name);return!n||!r?null:{id:n,name:r,description:le(t.description)??"",installUrl:le(t.installUrl??t.install_url)??"",needsAuth:Er(t.needsAuth??t.needs_auth)??!1}}function Kb(e){const t=at(e);if(!t)return null;const n=le(t.name),r=le(t.path);if(!n||!r)return null;const a=at(t.interface);return{name:n,path:r,description:le(t.description)??"",enabled:Er(t.enabled)??!0,displayName:le((a==null?void 0:a.displayName)??(a==null?void 0:a.display_name))??n,shortDescription:le(t.shortDescription??t.short_description)??""}}function Op(e,t={}){const n=at(e);if(!n)return null;const r=le(n.id),a=le(n.name);if(!r||!a)return null;const o=at(n.interface),i=at(n.source),l=le(i==null?void 0:i.type)??"",c=le(i==null?void 0:i.path),f=le(i==null?void 0:i.url)??"",h=l==="remote"?t.name??null:null,v=t.path??(l==="local"?c:null),b=le((o==null?void 0:o.displayName)??(o==null?void 0:o.display_name))??a,x=le((o==null?void 0:o.shortDescription)??(o==null?void 0:o.short_description)),j=le((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:le((o==null?void 0:o.developerName)??(o==null?void 0:o.developer_name))??"",category:le(o==null?void 0:o.category)??"",marketplaceName:t.name??"",marketplaceDisplayName:t.displayName??t.name??"",marketplacePath:v,remoteMarketplaceName:h,sourceType:l,sourceUrl:f,installed:Er(n.installed)??!1,enabled:Er(n.enabled)??!0,installPolicy:le(n.installPolicy??n.install_policy)??"",authPolicy:le(n.authPolicy??n.auth_policy)??"",logoUrl:le((o==null?void 0:o.logoUrl)??(o==null?void 0:o.logo_url))??"",logoPath:le(o==null?void 0:o.logo)??"",composerIconUrl:le((o==null?void 0:o.composerIconUrl)??(o==null?void 0:o.composer_icon_url))??"",composerIconPath:le((o==null?void 0:o.composerIcon)??(o==null?void 0:o.composer_icon))??"",brandColor:le((o==null?void 0:o.brandColor)??(o==null?void 0:o.brand_color))??"",capabilities:Ua(o==null?void 0:o.capabilities),defaultPrompt:Ua((o==null?void 0:o.defaultPrompt)??(o==null?void 0:o.default_prompt)),screenshotUrls:Ua((o==null?void 0:o.screenshotUrls)??(o==null?void 0:o.screenshot_urls)),screenshots:Ua(o==null?void 0:o.screenshots),websiteUrl:le((o==null?void 0:o.websiteUrl)??(o==null?void 0:o.website_url))??"",privacyPolicyUrl:le((o==null?void 0:o.privacyPolicyUrl)??(o==null?void 0:o.privacy_policy_url))??"",termsOfServiceUrl:le((o==null?void 0:o.termsOfServiceUrl)??(o==null?void 0:o.terms_of_service_url))??""}}function Jb(e,t=0){const n=at(e);if(!n)return null;const r=le(n.id),a=le(n.name);if(!r||!a)return null;const o=at(n.branding),i=at(n.appMetadata??n.app_metadata);return{id:r,name:a,description:le(n.description)??le((i==null?void 0:i.seoDescription)??(i==null?void 0:i.seo_description))??"",logoUrl:le(n.logoUrl??n.logo_url)??"",logoUrlDark:le(n.logoUrlDark??n.logo_url_dark)??"",distributionChannel:le(n.distributionChannel??n.distribution_channel)??"",installUrl:le(n.installUrl??n.install_url)??"",isAccessible:Er(n.isAccessible??n.is_accessible)??!1,isEnabled:Er(n.isEnabled??n.is_enabled)??!0,pluginDisplayNames:Ua(n.pluginDisplayNames??n.plugin_display_names),category:le(o==null?void 0:o.category)??"",developer:le(o==null?void 0:o.developer)??le(i==null?void 0:i.developer)??"",website:le(o==null?void 0:o.website)??"",privacyPolicy:le((o==null?void 0:o.privacyPolicy)??(o==null?void 0:o.privacy_policy))??"",termsOfService:le((o==null?void 0:o.termsOfService)??(o==null?void 0:o.terms_of_service))??"",catalogRank:t}}function Yb(e){const t=at(e);if(!t)return null;const n=le(t.name);if(!n)return null;const r=at(t.tools)??{},a=Object.entries(r).map(([c,f])=>{const h=at(f);return{name:le(h==null?void 0:h.name)??c,title:le(h==null?void 0:h.title)??"",description:le(h==null?void 0:h.description)??""}}),o=Array.isArray(t.resources)?t.resources.map(c=>{const f=at(c);return{name:le(f==null?void 0:f.name)??"",title:le(f==null?void 0:f.title)??"",uri:le(f==null?void 0:f.uri)??"",description:le(f==null?void 0:f.description)??""}}).filter(c=>c.name||c.uri):[],i=t.resourceTemplates??t.resource_templates,l=Array.isArray(i)?i.map(c=>{const f=at(c);return{name:le(f==null?void 0:f.name)??"",title:le(f==null?void 0:f.title)??"",uriTemplate:le((f==null?void 0:f.uriTemplate)??(f==null?void 0:f.uri_template))??"",description:le(f==null?void 0:f.description)??""}}).filter(c=>c.name||c.uriTemplate):[];return{name:n,authStatus:le(t.authStatus??t.auth_status)??"unsupported",tools:a,resources:o,resourceTemplates:l}}async function dP(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 i=at(o.interface),l={name:le(o.name)??"",displayName:le((i==null?void 0:i.displayName)??(i==null?void 0:i.display_name))??"",path:le(o.path)},c=Array.isArray(o.plugins)?o.plugins:[];for(const f of c){const h=Op(f,l);h&&r.push(h)}}return r}async function fP(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=Op(r.summary,{name:le(r.marketplaceName)??e.marketplaceName,displayName:e.marketplaceDisplayName,path:le(r.marketplacePath)??e.marketplacePath})??e;return{summary:a,description:le(r.description)??a.longDescription,apps:Array.isArray(r.apps)?r.apps.map(Np).filter(o=>o!==null):[],skills:Array.isArray(r.skills)?r.skills.map(Kb).filter(o=>o!==null):[],mcpServers:Ua(r.mcpServers??r.mcp_servers)}}async function hP(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:le(n.authPolicy??n.auth_policy)??"",appsNeedingAuth:r.map(Np).filter(a=>a!==null)}}async function pP(e){await $t("plugin/uninstall",{pluginId:e})}async function mP(e,t){await $t("config/batchWrite",{edits:[{keyPath:`plugins.${e}.enabled`,value:t,mergeStrategy:"upsert"}],filePath:null,expectedVersion:null,reloadUserConfig:!0})}async function vP(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 i of o.data??[]){const l=Jb(i,r);l&&t.push(l),r+=1}n=le(o.nextCursor??o.next_cursor)}while(n);return t}async function gP(e,t){await $t("config/batchWrite",{edits:[{keyPath:`apps.${e}.enabled`,value:t,mergeStrategy:"upsert"}],filePath:null,expectedVersion:null,reloadUserConfig:!0})}async function yP(){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=Yb(a);o&&e.push(o)}t=le(r.nextCursor??r.next_cursor)}while(t);return e}async function wP(){await $t("config/mcpServer/reload",{})}async function bP(e){const t=await $t("mcpServer/oauth/login",{name:e});return{authorizationUrl:le(t.authorizationUrl??t.authorization_url)??""}}async function _P(){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 TP(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 i=await o.json();return{data:Array.isArray(i.data)?i.data:[],nextCursor:typeof i.nextCursor=="string"&&i.nextCursor.length>0?i.nextCursor:null,total:typeof i.total=="number"&&Number.isFinite(i.total)?Math.max(0,Math.floor(i.total)):0}}async function kP(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 SP(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 CP(){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 xP(){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 Qb(e){const t=e.trim();return t?t.replace(/[_-]+/g," ").replace(/\b\w/g,n=>n.toUpperCase()):""}async function Xb(){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:Qb(r.name||a)||(a==="plan"?"Plan":"Default")}))}if(n.length>0){for(const r of rf)t.has(r.value)||n.push(r);return n.sort((r,a)=>r.value===a.value?0:r.value==="default"?-1:1)}}catch{}return rf}function Zb(e){const t=e&&typeof e=="object"&&!Array.isArray(e)?e:{},n=o=>{if(!Array.isArray(o))return[];const i=[];for(const l of o)typeof l=="string"&&l.length>0&&!i.includes(l)&&i.push(l);return i},r=t.labels,a={};if(r&&typeof r=="object"&&!Array.isArray(r))for(const[o,i]of Object.entries(r)){const l=typeof o=="string"?jt(o):"";l.length>0&&typeof i=="string"&&(a[l]=i)}return{order:n(t.order).map(o=>jt(o)),labels:a,active:n(t.active).map(o=>jt(o))}}function e0(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(i=>typeof i=="string"&&i.trim().length>0):[],a=Array.isArray(t.skills)?t.skills.flatMap(i=>{if(!i||typeof i!="object"||Array.isArray(i))return[];const l=i,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(i=>{if(!i||typeof i!="object"||Array.isArray(i))return[];const l=i,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 Dp(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(i=>{const l=e0(i);return l?[l]:[]});o.length>0&&(t[a]=o)}return t}async function ja(){const e=await fetch("/codex-api/workspace-roots-state"),t=await e.json();if(!e.ok)throw new Error("Failed to load workspace roots state");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{};return Zb(n.data)}async function t0(){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 Dp(n.data)}async function n0(e){if(!(await fetch("/codex-api/thread-queue-state",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(Dp(e))})).ok)throw new Error("Failed to save thread queue state")}async function r0(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:jt(a.data.cwd),gitRoot:jt(a.data.gitRoot)}}async function o0(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:[],i=[],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():"",v=typeof f.label=="string"?f.label.trim():"";!h||l.has(h)||(l.add(h),i.push({value:h,label:v||h}))}return i}async function a0(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:{},i=o.currentBranch,l=typeof i=="string"&&i.trim()?i.trim():null,c=Array.isArray(o.options)?o.options:[],f=[],h=new Set;for(const v of c){if(!v||typeof v!="object"||Array.isArray(v))continue;const b=v,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 s0(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 AP(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()}`),i=await o.json();if(!o.ok)throw new Error(qn(i,"Failed to load review snapshot"));return Pp(i)}async function EP(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(qn(n,"Failed to apply review action"));return Pp(n)}async function IP(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(qn(n,"Failed to initialize Git"))}async function PP(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 mf(){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 i0(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 Cc(r);if(!r.ok){const c=qn(a,"Failed to load local directories");throw new Error(c)}const o=a&&typeof a=="object"&&!Array.isArray(a)?a:{},i=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:{},l=Array.isArray(i.entries)?i.entries:[];return{path:typeof i.path=="string"?jt(i.path):"",parentPath:typeof i.parentPath=="string"?jt(i.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():"",v=typeof f.path=="string"?jt(f.path):"";return h&&v?[{name:h,path:v}]:[]})}}async function Cc(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 vu(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 gu(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=qn(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"?jt(o.path):""}async function l0(e){const t=await fetch("/codex-api/local-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),n=await Cc(t);if(!t.ok){const o=qn(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"?jt(a.path):""}async function u0(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 Cc(t);if(!t.ok){const i=qn(n,"Failed to create new chat folder");throw new Error(i)}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"?jt(a.cwd):"";if(!o)throw new Error("Failed to create new chat folder");return{cwd:o,outputDirectory:typeof a.outputDirectory=="string"?jt(a.outputDirectory):o,workspaceRoot:typeof a.workspaceRoot=="string"?jt(a.workspaceRoot):""}}async function c0(e){const t=new URLSearchParams({basePath:e}),n=await fetch(`/codex-api/project-root-suggestion?${t.toString()}`),r=await n.json();if(!n.ok){const i=qn(r,"Failed to suggest project name");throw new Error(i)}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"?jt(o.path):""}}async function d0(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=qn(o,"Failed to search files");throw new Error(f)}const i=o&&typeof o=="object"&&!Array.isArray(o)?o:{},l=Array.isArray(i.data)?i.data:[],c=[];for(const f of l){if(!f||typeof f!="object"||Array.isArray(f))continue;const v=f.path,b=typeof v=="string"?v.trim():"";b&&c.push({path:b})}return c}async function f0(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 h0(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=qn(r,"Failed to connect Telegram bot");throw new Error(a)}}async function p0(){const e=await fetch("/codex-api/telegram/config"),t=await e.json();if(!e.ok){const i=qn(t,"Failed to load Telegram configuration");throw new Error(i)}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 i of a){if(i==="*"){o.push("*");continue}typeof i=="number"&&Number.isFinite(i)&&o.push(Math.trunc(i))}return{botToken:typeof r.botToken=="string"?r.botToken:"",allowedUserIds:o}}async function m0(){const e=await fetch("/codex-api/telegram/status"),t=await e.json();if(!e.ok){const a=qn(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 qn(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 v0(){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 yu(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 g0(){try{const e=await fetch("/codex-api/thread-pins");return e.ok?(await e.json()).data??{threadIds:[]}:{threadIds:[]}}catch{return{threadIds:[]}}}async function y0(e){try{await fetch("/codex-api/thread-pins",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({threadIds:e})})}catch{}}async function w0(){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 b0(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 _0(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 Gu(e){return e?e.endsWith("/SKILL.md")?e:`${e}/SKILL.md`:""}function T0(e,t){const n=Gu(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 i=r[o+1]??"";if(!i)return null;const l=`/${[...r.slice(0,o+2),"SKILL.md"].join("/")}`;return t.has(l)?{rootPath:l,rootName:i,isNested:l!==n}:{rootPath:l,rootName:i,isNested:l!==n}}async function k0(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await $t("skills/list",t),r=n.data.flatMap(i=>i.skills),a=new Set(r.map(i=>Gu(i.path)).filter(Boolean)),o=new Map;for(const i of n.data)for(const l of i.skills){if(!l.name)continue;const c=T0(l.path,a),f=Gu(l.path),v=!!(c!=null&&c.isNested&&a.has(c.rootPath))?c.rootPath:f,b=f===v,x=o.get(v),j={name:l.name,displayName:c&&v===c.rootPath?c.rootName:void 0,description:l.shortDescription||l.description||"",path:v,scope:l.scope,enabled:l.enabled,__hasRoot:b};if(!x){o.set(v,j);continue}if(x.enabled=x.enabled||l.enabled,!x.__hasRoot&&b){o.set(v,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:i,...l})=>l)}catch{return[]}}async function S0(){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 C0(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 x0(e){try{const t=new URLSearchParams({path:e});return(await fetch(`/codex-api/prompts?${t.toString()}`,{method:"DELETE"})).ok}catch{return!1}}const A0=6e4;async function wu(e){const t=new AbortController,n=setTimeout(()=>t.abort(),A0);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 E0={},I0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function P0(e,t){return C(),R("svg",I0,[...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 Ba=At(E0,[["render",P0]]),M0={},R0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function $0(e,t){return C(),R("svg",R0,[...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 Ci=At(M0,[["render",$0]]),N0={},O0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function D0(e,t){return C(),R("svg",O0,[...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 $a=At(N0,[["render",D0]]),L0={},j0={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function F0(e,t){return C(),R("svg",j0,[...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 Hs=At(L0,[["render",F0]]),U0={},B0={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",B0,[...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 xc=At(U0,[["render",q0]]),H0={},z0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function V0(e,t){return C(),R("svg",z0,[...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 W0=At(H0,[["render",V0]]),G0={},K0={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",K0,[...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 Cs=At(G0,[["render",J0]]),Y0={},Q0={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function X0(e,t){return C(),R("svg",Q0,[...t[0]||(t[0]=[Ag('<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 Z0=At(Y0,[["render",X0]]),e_={},t_={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function n_(e,t){return C(),R("svg",t_,[...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 xi=At(e_,[["render",n_]]),Lp="codex-web-local.ui-language.v1",r_={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...":"搜索技能...",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":"超宽"},vf={en:"English","zh-CN":"简体中文"};function o_(){var t;return typeof window>"u"?"en":((t=window.localStorage.getItem(Lp))==null?void 0:t.trim())==="zh-CN"?"zh-CN":"en"}const dl=I(o_());function jp(e){typeof document>"u"||(document.documentElement.lang=e==="zh-CN"?"zh-CN":"en",document.documentElement.dataset.uiLanguage=e)}jp(dl.value);function a_(e,t){return t?e.replace(/\{(\w+)\}/g,(n,r)=>String(t[r]??"")):e}function s_(e){dl.value=e,jp(e),typeof window<"u"&&window.localStorage.setItem(Lp,e)}function Fp(e,t){const n=dl.value==="zh-CN"?r_[e]??e:e;return a_(n,t)}function ea(){return{uiLanguage:dl,uiLanguageOptions:[{value:"en",label:vf.en},{value:"zh-CN",label:vf["zh-CN"]}],t:Fp,setUiLanguage:s_}}const i_={key:0,class:"sidebar-menu-row-left"},l_={class:"sidebar-menu-row-main"},u_={key:1,class:"sidebar-menu-row-right"},c_={key:0,class:"sidebar-menu-row-right-default"},d_={key:1,class:"sidebar-menu-row-right-hover"},f_=Bn({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=Qv(),r=ae(()=>!!n.left),a=ae(()=>!!n.right),o=ae(()=>!!n["right-hover"]),i=ae(()=>a.value||o.value);return(l,c)=>(C(),rt(hc(t.as),ep({class:"sidebar-menu-row","data-has-left":r.value,"data-has-right":i.value,"data-has-right-hover":o.value,"data-force-right-hover":t.forceRightHover},l.$attrs),{default:ut(()=>[r.value?(C(),R("span",i_,[ho(l.$slots,"left",{},void 0,!0)])):ie("",!0),m("span",l_,[ho(l.$slots,"default",{},void 0,!0)]),i.value?(C(),R("span",u_,[a.value?(C(),R("span",c_,[ho(l.$slots,"right",{},void 0,!0)])):ie("",!0),o.value?(C(),R("span",d_,[ho(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"]))}}),io=At(f_,[["__scopeId","data-v-36239f39"]]),h_={key:0,class:"pinned-section"},p_={class:"thread-tree-header"},m_={key:0,class:"thread-list"},v_=["data-menu-open"],g_={class:"thread-left-stack"},y_=["data-state"],w_=["onClick"],b_=["onClick"],__={class:"thread-row-title-wrap"},T_={class:"thread-row-title-line"},k_={class:"thread-row-title"},S_=["title"],C_=["data-state"],x_={class:"thread-row-time"},A_=["onClick"],E_={class:"projects-section"},I_={class:"thread-tree-header"},P_=["aria-expanded","aria-label","title"],M_={class:"organize-menu-title"},R_=["data-active"],$_={key:0},N_=["data-active"],O_={key:0},D_=["data-active"],L_={key:0},j_={class:"organize-menu-title"},F_=["data-active"],U_={key:0},B_=["data-active"],q_={key:0},H_={key:0,class:"thread-tree-no-results"},z_={key:1,class:"thread-tree-loading"},V_={key:2,class:"thread-list thread-list-global"},W_=["data-menu-open"],G_={class:"thread-left-stack"},K_=["data-state"],J_=["onClick"],Y_=["onClick"],Q_={class:"thread-row-title-wrap"},X_={class:"thread-row-title-line"},Z_={class:"thread-row-title"},eT=["title"],tT=["data-state"],nT={class:"thread-row-time"},rT=["onClick"],oT=["data-project-name","data-expanded","data-dragging"],aT={class:"project-icon-stack"},sT={class:"project-icon-folder"},iT={class:"project-icon-chevron"},lT=["data-dragging-handle","onMousedown"],uT={class:"project-title"},cT={class:"project-hover-controls"},dT=["onClick"],fT=["data-open-direction"],hT=["onClick"],pT=["onClick"],mT={class:"project-menu-label"},vT=["onInput"],gT=["aria-label","title","onClick"],yT={key:0,class:"thread-list"},wT=["data-menu-open"],bT={class:"thread-left-stack"},_T=["data-state"],TT=["onClick"],kT=["onClick"],ST={class:"thread-row-title-wrap"},CT={class:"thread-row-title-line"},xT={class:"thread-row-title"},AT=["title"],ET=["data-state"],IT={class:"thread-row-time"},PT=["onClick"],MT={class:"project-empty"},RT=["onClick"],$T={class:"chats-section"},NT={class:"thread-tree-header"},OT={class:"chats-section-actions"},DT=["aria-pressed","aria-label","title"],LT=["aria-label","title"],jT={key:0,class:"thread-tree-no-results"},FT={key:1,class:"thread-list thread-list-global"},UT=["data-menu-open"],BT={class:"thread-left-stack"},qT=["data-state"],HT=["onClick"],zT=["onClick"],VT={class:"thread-row-title-wrap"},WT={class:"thread-row-title-line"},GT={class:"thread-row-title"},KT=["title"],JT=["data-state"],YT={class:"thread-row-time"},QT=["onClick"],XT=["data-open-direction"],ZT={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},ek={class:"rename-thread-title"},tk=["onKeydown"],nk={class:"rename-thread-actions"},rk={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},ok={class:"rename-thread-title"},ak={class:"rename-thread-subtitle"},sk={class:"rename-thread-actions"},ik={class:"rename-thread-panel automation-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread automation"},lk={class:"rename-thread-title"},uk={class:"automation-thread-field"},ck={class:"automation-thread-field"},dk={class:"automation-thread-field"},fk={class:"automation-thread-field"},hk={value:"ACTIVE"},pk={value:"PAUSED"},mk={key:0,class:"rename-thread-subtitle automation-thread-error"},vk={class:"rename-thread-actions"},gk=["disabled"],yk=["disabled"],wk=["disabled"],bk=4,gf=6,yf="codex-web-local.sidebar-section-expansion.v1",wf="codex-web-local.sidebar-chats-first.v1",bf="codex-web-local.sidebar-chat-sort-mode.v1",_f="codex-web-local.thread-view-mode.v1",Tf="codex-web-local.collapsed-projects.v1",_k=Bn({__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}=ea(),a=t,o=I({}),i=I({}),l=I(!0),c=I(!0),f=I(!0),h=I(oe(wf,!1)),v=I(ye());let b=!1;const x=I([]),j=I(""),q=I(""),te=I({}),H=I({}),O=I({}),V=I("actions"),X=I(""),Ce=I(!1),Oe=I(""),ce=I(""),xe=I(null),Z=I(!1),Ae=I(""),He=I(""),ee=I({}),be=I(!1),Le=I(""),Ke=I("create"),Ue=I(""),Se=I(!1),me=I({name:"",prompt:"",rrule:"FREQ=DAILY;BYHOUR=9;BYMINUTE=0",status:"ACTIVE"}),We=I(null),nt=I(null),ze=I(null);let je=null,dt=null;const ft=I(""),et=I({}),ct=new Map,K=new Map,_e=new Map,we=new WeakMap,De=I(null),Je=I(null),k=I(!1),E=I(J()),z=typeof window<"u"?new ResizeObserver(w=>{for(const _ of w){const S=_.target,W=we.get(S);W&&Ie(W,S)}}):null;function ne(){if(typeof window>"u")return{};try{const w=window.localStorage.getItem(Tf);if(!w)return{};const _=JSON.parse(w);return!_||typeof _!="object"||Array.isArray(_)?{}:_}catch{return{}}}function J(){return typeof window>"u"?"project":window.localStorage.getItem(_f)==="chronological"?"chronological":"project"}function oe(w,_){if(typeof window>"u")return _;const S=window.localStorage.getItem(w);return S==="true"?!0:S==="false"?!1:_}function ye(){return typeof window>"u"?"updated":window.localStorage.getItem(bf)==="created"?"created":"updated"}i.value=ne();function fe(){if(!(typeof window>"u"))try{const w=JSON.parse(window.localStorage.getItem(yf)||"{}");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(yf,JSON.stringify({pinned:l.value,projects:c.value,chats:f.value}))}fe(),vt(i,w=>{typeof window>"u"||window.localStorage.setItem(Tf,JSON.stringify(w))},{deep:!0}),vt(E,w=>{typeof window>"u"||window.localStorage.setItem(_f,w)}),vt(h,w=>{typeof window>"u"||window.localStorage.setItem(wf,String(w))}),vt(v,w=>{typeof window>"u"||window.localStorage.setItem(bf,w)}),vt([l,c,f],pe);const ue=ae(()=>n.searchQuery.trim().toLowerCase()),Re=ae(()=>ue.value.length>0),ve=ae(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null),Pe=ae(()=>new Set(x.value));function Ee(w){if(!Re.value)return!0;if(ve.value)return ve.value.has(w.id);const _=ue.value;return w.title.toLowerCase().includes(_)||w.preview.toLowerCase().includes(_)}const Ze=ae(()=>n.groups.map(w=>({...w,threads:w.threads.filter(_=>!_p(_.cwd)&&Ee(_))})).filter(w=>w.threads.length>0)),D=ae(()=>E.value==="chronological"),F=ae(()=>{const w=[];for(const _ of n.groups)for(const S of _.threads)Pe.value.has(S.id)||Ee(S)&&w.push(S);return w.sort((_,S)=>{const W=new Date(_.updatedAtIso||_.createdAtIso).getTime();return new Date(S.updatedAtIso||S.createdAtIso).getTime()-W})}),U=ae(()=>{const w=F.value.slice(),_=v.value==="created"?"createdAtIso":"updatedAtIso";return w.sort((S,W)=>{const Fe=new Date(S[_]||S.updatedAtIso||S.createdAtIso).getTime();return new Date(W[_]||W.updatedAtIso||W.createdAtIso).getTime()-Fe}).slice(0,4)}),Y=ae(()=>{const w=new Map;for(const _ of n.groups)for(const S of _.threads)w.set(S.id,S);return w});vt(x,w=>{b&&y0(w)}),vt(Y,w=>{const _=x.value.filter(S=>w.has(S));_.length!==x.value.length&&(x.value=_)}),Xo(async()=>{const{threadIds:w}=await g0(),_=Array.isArray(w)?w.filter(S=>typeof S=="string").map(S=>S.trim()).filter((S,W,Fe)=>S.length>0&&Fe.indexOf(S)===W):[];_.length>0&&(x.value=_);try{ee.value=await xb()}catch{ee.value={}}b=!0});const he=ae(()=>lt(Ae.value)),Me=ae(()=>{const w=new Map;for(const _ of n.groups)for(const S of _.threads)w.set(S.id,_.projectName);return w}),Be=ae(()=>{const w=new Map;for(const _ of n.groups){const S=_.threads.filter(W=>!Pe.value.has(W.id));w.set(_.projectName,S)}return w}),Ye=ae(()=>{const w=new Map;for(const _ of n.groups)for(const S of _.threads){const W=new Date(S.updatedAtIso||S.createdAtIso).getTime();w.set(S.id,W)}return w}),$e=ae(()=>{const w=q.value;return w?Y.value.get(w)??null:null}),gt=ae(()=>x.value.map(w=>Y.value.get(w)??null).filter(w=>w!==null).filter(Ee));function Hn(){l.value=!l.value}function mn(){c.value=!c.value}function vo(){f.value=!f.value}const Ot=ae(()=>{const w=ze.value;if(!w||w.dropTargetIndexFull===null||n.groups.length===0)return null;const _=Math.max(0,Math.min(w.dropTargetIndexFull,n.groups.length)),S=_>w.fromIndex?_-1:_,W=Math.max(0,Math.min(S,n.groups.length-1));return W===w.fromIndex?null:W}),hr=ae(()=>{const _=(Re.value?Ze.value:n.groups).map(wt=>wt.projectName),S=ze.value,W=Ot.value;if(!S||W===null)return _;const Fe=[..._],[_t]=Fe.splice(S.fromIndex,1);return _t?(Fe.splice(W,0,_t),Fe):_}),sr=ae(()=>{const w={};let _=0;for(const S of hr.value)w[S]=_,_+=Yn(S);return w}),Kr=ae(()=>{let w=0;for(const _ of hr.value)w+=Yn(_);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 S=Math.floor(_/6e4);if(S<60)return`${S}m`;const W=Math.floor(S/60);return W<24?`${W}h`:`${Math.floor(W/24)}d`}function pr(w){const _=Ye.value.get(w.id);return kr(typeof _=="number"?_:new Date(w.updatedAtIso||w.createdAtIso).getTime())}function zn(w){return Pe.value.has(w)}function Sr(w){if(zn(w)){x.value=x.value.filter(_=>_!==w);return}x.value=[w,...x.value]}function Ft(w){a("select",w)}function lt(w){return!!ee.value[w]}function Pn(w){const _=ee.value[w];if(!_)return"";const S=_.status==="PAUSED"?"-":_.nextRunAtMs?new Date(_.nextRunAtMs).toLocaleString():"Not scheduled";return`${_.name} • Next run: ${S}`}function Vn(w){a("export-thread",w),Gt()}function Jr(w){a("fork-thread",w),Gt()}function Wt(w){return`start new thread ${tn(w)}`}function Wn(w){a("start-new-thread",w)}function qt(w){a("browse-thread-files",w),Gt()}async function Qt(w){var S,W;const _=((W=(S=Y.value.get(w))==null?void 0:S.cwd)==null?void 0:W.trim())??"";if(Gt(),!(!_||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(_)}catch{}}function Ut(w,_){if(q.value===w){if(_){const S=_.relatedTarget,W=Je.value;if(S instanceof Node&&W&&W.contains(S))return}Gt()}}function xt(w){return q.value===w}function Gt(){q.value="",O.value={}}function mr(w){if(q.value===w){Gt();return}Cn(),k.value=!1,q.value=w,sn(()=>{bt(w)})}function ir(w,_){w.preventDefault(),q.value=_}function Ir(w,_){Oe.value=w,ce.value=_,Ce.value=!0,Gt(),sn(()=>{var S,W;(S=xe.value)==null||S.focus(),(W=xe.value)==null||W.select()})}function Mn(){Ce.value=!1,Oe.value="",ce.value=""}function en(){const w=Oe.value,_=ce.value.trim();!w||!_||(a("rename-thread",{threadId:w,title:_}),Mn())}function vr(w,_){Ae.value=w,He.value=_,Z.value=!0,Gt()}function lr(){Z.value=!1,Ae.value="",He.value=""}async function Yr(){const w=Ae.value;if(w){if(lt(w)){try{await uf(w)}catch{}ee.value=Object.fromEntries(Object.entries(ee.value).filter(([_])=>_!==w))}x.value=x.value.filter(_=>_!==w),a("archive",w),lr()}}function Gn(w){const _=ee.value[w];Le.value=w,Ke.value=_?"edit":"create",Ue.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"},be.value=!0,Gt()}function Rn(){be.value=!1,Le.value="",Ue.value="",Se.value=!1}async function Sn(){const w=Le.value;if(w){Se.value=!0,Ue.value="";try{const _=await Ab({threadId:w,name:me.value.name,prompt:me.value.prompt,rrule:me.value.rrule,status:me.value.status});ee.value={...ee.value,[w]:_},Rn()}catch(_){Ue.value=_ instanceof Error?_.message:"Failed to save automation",Se.value=!1}}}async function Kn(){const w=Le.value;if(w){Se.value=!0,Ue.value="";try{await uf(w),ee.value=Object.fromEntries(Object.entries(ee.value).filter(([_])=>_!==w)),Rn()}catch(_){Ue.value=_ instanceof Error?_.message:"Failed to remove automation",Se.value=!1}}}function tn(w){return n.projectDisplayNameById[w]??w}function Cr(w){return j.value===w}function Cn(){j.value="",V.value="actions",X.value=""}function Qr(){const w=!k.value;w&&(Cn(),Gt()),k.value=w}function vn(w){E.value=w,k.value=!1}function ur(){h.value=!h.value}function Jn(w){v.value=w}function gr(w){if(j.value===w){Cn();return}Gt(),k.value=!1,j.value=w,V.value="actions",X.value=tn(w),sn(()=>{go(w)})}function Nt(w){Gt(),j.value=w,V.value="rename",X.value=tn(w),sn(()=>{go(w)})}function $n(w){a("rename-project",{projectName:w,displayName:X.value})}function gn(w){a("remove-project",w),Cn()}function yn(w,_){if(!w.altKey||w.key!=="ArrowUp"&&w.key!=="ArrowDown")return;const S=n.groups.findIndex(_t=>_t.projectName===_);if(S<0)return;const W=w.key==="ArrowUp"?-1:1,Fe=Math.max(0,Math.min(S+W,n.groups.length-1));Fe!==S&&(w.preventDefault(),a("reorder-project",{projectName:_,toIndex:Fe}))}function nn(w){return o.value[w]===!0}function yt(w){return i.value[w]===!0}function yr(w){o.value={...o.value,[w]:!nn(w)}}function rn(w){if(ft.value===w){ft.value="";return}i.value={...i.value,[w]:!yt(w)}}function Yn(w){const _=et.value[w]??0,S=ze.value,Fe=((S==null?void 0:S.projectName)===w?S.groupHeight:null)??_,_t=yt(w)?0:gf;return Math.max(0,Fe+_t)}function wr(w,_){const S=_ instanceof HTMLElement?_:_&&"$el"in _&&_.$el instanceof HTMLElement?_.$el:null;if(S){K.set(w,S);return}K.delete(w)}function Pr(w,_){const S=_ instanceof HTMLElement?_:_&&"$el"in _&&_.$el instanceof HTMLElement?_.$el:null;if(S){_e.set(w,S);return}_e.delete(w)}function Xr(w){let _=w.parentElement;for(;_;){const S=window.getComputedStyle(_),W=S.overflowY||S.overflow;if(W==="auto"||W==="scroll"||W==="hidden"||W==="clip")return _.getBoundingClientRect();_=_.parentElement}return new DOMRect(0,0,window.innerWidth,window.innerHeight)}function wn(w,_){const S=w.getBoundingClientRect(),W=Xr(w),Fe=6,_t=W.bottom-S.bottom,wt=S.top-W.top;return _t>=_+Fe?"down":wt>_t?"up":"down"}function kt(w,_){const S=_e.get(w);if(!S)return"down";const W=wn(S,_);return H.value={...H.value,[w]:W},W}function It(w){return H.value[w]??"down"}function go(w){const _=K.get(w);_&&(te.value={...te.value,[w]:wn(_,112)})}function Zr(w,_,S){return Math.min(Math.max(w,_),S)}function bt(w){const _=_e.get(w);if(!_)return;const S=Je.value,W=S==null?void 0:S.getBoundingClientRect(),Fe=(W==null?void 0:W.height)||(S==null?void 0:S.offsetHeight)||112,_t=(W==null?void 0:W.width)||(S==null?void 0:S.offsetWidth)||160,wt=kt(w,Fe),Tn=_.getBoundingClientRect(),On=8,er=4,Or=Math.max(On,window.innerWidth-_t-On),Dr=Zr(Tn.right-_t,On,Or),na=Zr(wt==="up"?Tn.top-Fe-er:Tn.bottom+er,On,Math.max(On,window.innerHeight-Fe-On));O.value={left:`${Math.round(Dr)}px`,top:`${Math.round(na)}px`}}function on(){const w=q.value;w&&bt(w)}function an(){window.addEventListener("resize",on),document.addEventListener("scroll",on,!0)}function Qn(){window.removeEventListener("resize",on),document.removeEventListener("scroll",on,!0)}function Nn(w){const _=j.value;if(!_)return!1;const S=K.get(_);if(!S)return!1;if((typeof w.composedPath=="function"?w.composedPath():[]).includes(S))return!0;const Fe=w.target;return Fe instanceof Node?S.contains(Fe):!1}function bn(w){const _=q.value;if(!_)return!1;const S=_e.get(_);if(!S)return!1;const W=typeof w.composedPath=="function"?w.composedPath():[];if(W.includes(S))return!0;const Fe=Je.value;if(Fe&&W.includes(Fe))return!0;const _t=w.target;return _t instanceof Node?!!(S.contains(_t)||Fe&&Fe.contains(_t)):!1}function Xn(w){if(k.value){const _=De.value,S=typeof w.composedPath=="function"?w.composedPath():[];!!_&&(S.includes(_)||w.target instanceof Node&&_.contains(w.target))||(k.value=!1)}j.value&&(Nn(w)||Cn(),q.value&&(bn(w)||Gt()))}function br(w){j.value&&!Nn(w)&&Cn(),q.value&&!bn(w)&&Gt()}function M(){k.value&&(k.value=!1),j.value&&Cn(),q.value&&Gt()}function B(){window.addEventListener("pointerdown",Xn,{capture:!0}),window.addEventListener("focusin",br,{capture:!0}),window.addEventListener("blur",M)}function Q(){window.removeEventListener("pointerdown",Xn,{capture:!0}),window.removeEventListener("focusin",br,{capture:!0}),window.removeEventListener("blur",M)}function Ie(w,_){const S=_.getBoundingClientRect().height;if(!Number.isFinite(S)||S<=0)return;const W=et.value[w];W!==void 0&&Math.abs(W-S)<.5||(et.value={...et.value,[w]:S})}function St(w,_){const S=ct.get(w);S&&S!==_&&z&&z.unobserve(S);const W=_ instanceof HTMLElement?_:_&&"$el"in _&&_.$el instanceof HTMLElement?_.$el:null;if(W){ct.set(w,W),we.set(W,w),Ie(w,W),z==null||z.observe(W);return}S&&(z==null||z.unobserve(S)),ct.delete(w)}function Xt(w,_){if(w.button!==0||nt.value||ze.value)return;const S=n.groups.findIndex(wt=>wt.projectName===_),W=ct.get(_);if(S<0||!W)return;const Fe=W.getBoundingClientRect(),_t=yt(_)?0:gf;nt.value={projectName:_,fromIndex:S,startClientX:w.clientX,startClientY:w.clientY,pointerOffsetY:w.clientY-Fe.top,groupLeft:Fe.left,groupWidth:Fe.width,groupHeight:Fe.height,groupOuterHeight:Fe.height+_t},w.preventDefault(),Ht()}function Ht(){window.addEventListener("mousemove",Kt),window.addEventListener("mouseup",cn),window.addEventListener("keydown",Mr)}function mt(){window.removeEventListener("mousemove",Kt),window.removeEventListener("mouseup",cn),window.removeEventListener("keydown",Mr)}function Kt(w){je={clientX:w.clientX,clientY:w.clientY},Rr()}function cn(w){Zn({clientX:w.clientX,clientY:w.clientY});const _=ze.value;if(_&&Ot.value!==null){const S=n.groups.findIndex(W=>W.projectName===_.projectName);if(S>=0){const W=Ot.value;W!==S&&a("reorder-project",{projectName:_.projectName,toIndex:W})}}Do()}function Mr(w){w.key==="Escape"&&(!nt.value&&!ze.value||(w.preventDefault(),Do()))}function Do(){dt!==null&&(window.cancelAnimationFrame(dt),dt=null),je=null,nt.value=null,ze.value=null,ft.value="",mt()}function Rr(){dt===null&&(dt=window.requestAnimationFrame(()=>{if(dt=null,!je)return;const w=je;je=null,Zn(w)}))}function Zn(w){const _=nt.value;if(!ze.value&&_){const S=w.clientX-_.startClientX,W=w.clientY-_.startClientY;if(Math.hypot(S,W)<bk)return;Cn(),ft.value=_.projectName,ze.value={projectName:_.projectName,fromIndex:_.fromIndex,pointerOffsetY:_.pointerOffsetY,groupLeft:_.groupLeft,groupWidth:_.groupWidth,groupHeight:_.groupHeight,groupOuterHeight:_.groupOuterHeight,ghostTop:w.clientY-_.pointerOffsetY,dropTargetIndexFull:null}}ze.value&&qe(w)}function qe(w){const _=ze.value;if(!_)return;if(_.ghostTop=w.clientY-_.pointerOffsetY,!ke(w)){_.dropTargetIndexFull=null;return}const S=w.clientY,W=We.value;if(!W){_.dropTargetIndexFull=null;return}const Fe=W.getBoundingClientRect(),_t=new Map(n.groups.map((er,Or)=>[er.projectName,Or])),wt=n.groups.map(er=>er.projectName).filter(er=>er!==_.projectName);let Tn=0,On=n.groups.length;for(const er of wt){const Or=_t.get(er);if(Or===void 0)continue;const Dr=Yn(er),na=Fe.top+Tn+Dr/2;if(S<na){On=Or;break}Tn+=Dr}_.dropTargetIndexFull=On}function ke(w){const _=We.value;if(!_)return!1;const S=_.getBoundingClientRect(),W=w.clientX>=S.left&&w.clientX<=S.right,Fe=w.clientY>=S.top-32&&w.clientY<=S.bottom+32;return W&&Fe}function Dt(w){var _;return((_=ze.value)==null?void 0:_.projectName)===w}function _n(w){const _=ze.value,S=sr.value[w]??0,W=q.value?Me.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, ${S}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 xn(w){return Be.value.get(w.projectName)??[]}function ta(w){if(Re.value)return xn(w);if(yt(w.projectName))return[];const _=xn(w);return nn(w.projectName)?_:_.slice(0,10)}function zt(w){return Re.value?!1:!yt(w.projectName)&&xn(w).length>10}function cr(w){return xn(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 eo(w){return w.pendingRequestState==="approval"?"awaiting-approval":w.pendingRequestState==="response"?"awaiting-response":w.inProgress?"working":w.unread?"unread":"idle"}vt(()=>n.groups.map(w=>w.projectName),w=>{var Fe,_t;const _=((Fe=ze.value)==null?void 0:Fe.projectName)??((_t=nt.value)==null?void 0:_t.projectName)??"";_&&!n.groups.some(wt=>wt.projectName===_)&&Do();const S=new Set(w),W=Object.fromEntries(Object.entries(et.value).filter(([wt])=>S.has(wt)));Object.keys(W).length!==Object.keys(et.value).length&&(et.value=W)});const to=ae(()=>k.value||j.value!==""||q.value!=="");return vt(to,w=>{if(w){B();return}Q()}),vt(q,w=>{if(!w){Qn();return}an(),sn(()=>{bt(w)})}),wa(()=>{for(const w of ct.values())z==null||z.unobserve(w);ct.clear(),K.clear(),Qn(),Q(),Do()}),(w,_)=>(C(),R("section",{class:it(["thread-tree-root",{"chats-first":h.value}])},[gt.value.length>0?(C(),R("section",h_,[Ne(io,{as:"button",class:"section-toggle-row",type:"button","aria-expanded":l.value,onClick:Hn},{left:ut(()=>[l.value?(C(),rt(Ba,{key:1,class:"thread-icon"})):(C(),rt(Ci,{key:0,class:"thread-icon"}))]),default:ut(()=>[m("span",p_,N(T(r)("Pinned")),1)]),_:1},8,["aria-expanded"]),l.value?(C(),R("ul",m_,[(C(!0),R(Ge,null,Vt(gt.value,S=>(C(),R("li",{key:S.id,class:"thread-row-item","data-menu-open":xt(S.id)?"true":"false"},[Ne(io,{class:"thread-row","data-active":S.id===e.selectedThreadId,"data-pinned":zn(S.id),"data-menu-open":xt(S.id)?"true":"false","force-right-hover":xt(S.id),onClick:W=>Ft(S.id),onMouseleave:W=>Ut(S.id,W),onContextmenu:W=>ir(W,S.id)},{left:ut(()=>[m("span",g_,[$r(S)?(C(),R("span",{key:0,class:"thread-status-indicator","data-state":eo(S)},null,8,y_)):ie("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:tt(W=>Sr(S.id),["stop"])},[Ne(xi,{class:"thread-icon"})],8,w_)])]),right:ut(()=>[m("span",x_,N(pr(S)),1)]),"right-hover":ut(()=>[m("div",{ref_for:!0,ref:W=>Pr(S.id,W),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(W=>mr(S.id),["stop"])},[Ne($a,{class:"thread-icon"})],8,A_)],512)]),default:ut(()=>[m("button",{class:"thread-main-button",type:"button",onClick:tt(W=>Ft(S.id),["stop"])},[m("span",__,[m("span",T_,[m("span",k_,N(S.title),1),S.hasWorktree?(C(),rt(Cs,{key:0,class:"thread-row-worktree-icon",title:T(r)("Worktree thread")},null,8,["title"])):ie("",!0),lt(S.id)?(C(),R("span",{key:1,class:"thread-row-automation-chip",title:Pn(S.id)}," Auto ",8,S_)):ie("",!0),S.pendingRequestState?(C(),R("span",{key:2,class:"thread-row-request-chip","data-state":S.pendingRequestState},N(Nr(S)),9,C_)):ie("",!0)])])],8,b_)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onClick","onMouseleave","onContextmenu"])],8,v_))),128))])):ie("",!0)])):ie("",!0),m("section",E_,[Ne(io,{as:"button",class:"thread-tree-header-row section-toggle-row",type:"button","aria-expanded":c.value,onClick:mn},{left:ut(()=>[c.value?(C(),rt(Ba,{key:1,class:"thread-icon"})):(C(),rt(Ci,{key:0,class:"thread-icon"}))]),right:ut(()=>[m("div",{ref_key:"organizeMenuWrapRef",ref:De,class:"organize-menu-wrap"},[m("button",{class:"organize-menu-trigger",type:"button","aria-expanded":k.value,"aria-label":T(r)("Organize threads"),title:T(r)("Organize threads"),onClick:tt(Qr,["stop"])},[Ne($a,{class:"thread-icon"})],8,P_),k.value?(C(),R("div",{key:0,class:"organize-menu-panel",onClick:_[4]||(_[4]=tt(()=>{},["stop"]))},[m("p",M_,N(T(r)("Organize")),1),m("button",{class:"organize-menu-item","data-active":E.value==="project",type:"button",onClick:_[0]||(_[0]=S=>vn("project"))},[m("span",null,N(T(r)("By project")),1),E.value==="project"?(C(),R("span",$_,"✓")):ie("",!0)],8,R_),m("button",{class:"organize-menu-item","data-active":E.value==="chronological",type:"button",onClick:_[1]||(_[1]=S=>vn("chronological"))},[m("span",null,N(T(r)("Chronological list")),1),E.value==="chronological"?(C(),R("span",O_,"✓")):ie("",!0)],8,N_),m("button",{class:"organize-menu-item","data-active":h.value,type:"button",onClick:ur},[m("span",null,N(T(r)("Chats first")),1),h.value?(C(),R("span",L_,"✓")):ie("",!0)],8,D_),_[22]||(_[22]=m("div",{class:"organize-menu-separator"},null,-1)),m("p",j_,N(T(r)("Sort by")),1),m("button",{class:"organize-menu-item","data-active":v.value==="created",type:"button",onClick:_[2]||(_[2]=S=>Jn("created"))},[m("span",null,N(T(r)("Created")),1),v.value==="created"?(C(),R("span",U_,"✓")):ie("",!0)],8,F_),m("button",{class:"organize-menu-item","data-active":v.value==="updated",type:"button",onClick:_[3]||(_[3]=S=>Jn("updated"))},[m("span",null,N(T(r)("Updated")),1),v.value==="updated"?(C(),R("span",q_,"✓")):ie("",!0)],8,B_)])):ie("",!0)],512)]),default:ut(()=>[m("span",I_,N(T(r)("Projects")),1)]),_:1},8,["aria-expanded"]),c.value?(C(),R(Ge,{key:0},[Re.value&&Ze.value.length===0?(C(),R("p",H_,N(T(r)("No matching threads")),1)):e.isLoading&&e.groups.length===0?(C(),R("p",z_,N(T(r)("Loading threads...")),1)):D.value?(C(),R("ul",V_,[(C(!0),R(Ge,null,Vt(F.value,S=>(C(),R("li",{key:S.id,class:"thread-row-item","data-menu-open":xt(S.id)?"true":"false"},[Ne(io,{class:"thread-row","data-active":S.id===e.selectedThreadId,"data-pinned":zn(S.id),"data-menu-open":xt(S.id)?"true":"false","force-right-hover":xt(S.id),onClick:W=>Ft(S.id),onMouseleave:W=>Ut(S.id,W),onContextmenu:W=>ir(W,S.id)},{left:ut(()=>[m("span",G_,[$r(S)?(C(),R("span",{key:0,class:"thread-status-indicator","data-state":eo(S)},null,8,K_)):ie("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:tt(W=>Sr(S.id),["stop"])},[Ne(xi,{class:"thread-icon"})],8,J_)])]),right:ut(()=>[m("span",nT,N(pr(S)),1)]),"right-hover":ut(()=>[m("div",{ref_for:!0,ref:W=>Pr(S.id,W),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(W=>mr(S.id),["stop"])},[Ne($a,{class:"thread-icon"})],8,rT)],512)]),default:ut(()=>[m("button",{class:"thread-main-button",type:"button",onClick:tt(W=>Ft(S.id),["stop"])},[m("span",Q_,[m("span",X_,[m("span",Z_,N(S.title),1),S.hasWorktree?(C(),rt(Cs,{key:0,class:"thread-row-worktree-icon",title:T(r)("Worktree thread")},null,8,["title"])):ie("",!0),lt(S.id)?(C(),R("span",{key:1,class:"thread-row-automation-chip",title:Pn(S.id)}," Auto ",8,eT)):ie("",!0),S.pendingRequestState?(C(),R("span",{key:2,class:"thread-row-request-chip","data-state":S.pendingRequestState},N(Nr(S)),9,tT)):ie("",!0)])])],8,Y_)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onClick","onMouseleave","onContextmenu"])],8,W_))),128))])):(C(),R("div",{key:3,ref_key:"groupsContainerRef",ref:We,class:"thread-tree-groups",style:Io(Kr.value)},[(C(!0),R(Ge,null,Vt(Ze.value,S=>(C(),R("article",{key:S.projectName,ref_for:!0,ref:W=>St(S.projectName,W),class:"project-group","data-project-name":S.projectName,"data-expanded":!yt(S.projectName),"data-dragging":Dt(S.projectName),style:Io(_n(S.projectName))},[Ne(io,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:W=>rn(S.projectName),onKeydown:[W=>yn(W,S.projectName),un(tt(W=>rn(S.projectName),["prevent"]),["enter"]),un(tt(W=>rn(S.projectName),["prevent"]),["space"])]},{left:ut(()=>[m("span",aT,[m("span",sT,[yt(S.projectName)?(C(),rt(xc,{key:0,class:"thread-icon"})):(C(),rt(W0,{key:1,class:"thread-icon"}))]),m("span",iT,[yt(S.projectName)?(C(),rt(Ci,{key:0,class:"thread-icon"})):(C(),rt(Ba,{key:1,class:"thread-icon"}))])])]),right:ut(()=>[m("div",cT,[m("div",{ref_for:!0,ref:W=>wr(S.projectName,W),class:"project-menu-wrap"},[m("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:tt(W=>gr(S.projectName),["stop"])},[Ne($a,{class:"thread-icon"})],8,dT),Cr(S.projectName)?(C(),R("div",{key:0,class:"project-menu-panel","data-open-direction":te.value[S.projectName]??"down",onClick:_[6]||(_[6]=tt(()=>{},["stop"]))},[V.value==="actions"?(C(),R(Ge,{key:0},[m("button",{class:"project-menu-item",type:"button",onClick:W=>Nt(S.projectName)}," Edit name ",8,hT),m("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:W=>gn(S.projectName)}," Remove ",8,pT)],64)):(C(),R(Ge,{key:1},[m("label",mT,N(T(r)("Project name")),1),ln(m("input",{"onUpdate:modelValue":_[5]||(_[5]=W=>X.value=W),class:"project-menu-input",type:"text",onInput:W=>$n(S.projectName)},null,40,vT),[[kn,X.value]])],64))],8,fT)):ie("",!0)],512),m("button",{class:"thread-start-button",type:"button","aria-label":Wt(S.projectName),title:Wt(S.projectName),onClick:tt(W=>Wn(S.projectName),["stop"])},[Ne(Hs,{class:"thread-icon"})],8,gT)])]),default:ut(()=>[m("span",{class:"project-main-button","data-dragging-handle":Dt(S.projectName),onMousedown:tt(W=>Xt(W,S.projectName),["left"])},[m("span",uT,N(tn(S.projectName)),1)],40,lT)]),_:2},1032,["onClick","onKeydown"]),cr(S)?(C(),R("ul",yT,[(C(!0),R(Ge,null,Vt(ta(S),W=>(C(),R("li",{key:W.id,class:"thread-row-item","data-menu-open":xt(W.id)?"true":"false"},[Ne(io,{class:"thread-row","data-active":W.id===e.selectedThreadId,"data-pinned":zn(W.id),"data-menu-open":xt(W.id)?"true":"false","force-right-hover":xt(W.id),onClick:Fe=>Ft(W.id),onMouseleave:Fe=>Ut(W.id,Fe),onContextmenu:Fe=>ir(Fe,W.id)},{left:ut(()=>[m("span",bT,[$r(W)?(C(),R("span",{key:0,class:"thread-status-indicator","data-state":eo(W)},null,8,_T)):ie("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:tt(Fe=>Sr(W.id),["stop"])},[Ne(xi,{class:"thread-icon"})],8,TT)])]),right:ut(()=>[m("span",IT,N(pr(W)),1)]),"right-hover":ut(()=>[m("div",{ref_for:!0,ref:Fe=>Pr(W.id,Fe),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(Fe=>mr(W.id),["stop"])},[Ne($a,{class:"thread-icon"})],8,PT)],512)]),default:ut(()=>[m("button",{class:"thread-main-button",type:"button",onClick:tt(Fe=>Ft(W.id),["stop"])},[m("span",ST,[m("span",CT,[m("span",xT,N(W.title),1),W.hasWorktree?(C(),rt(Cs,{key:0,class:"thread-row-worktree-icon",title:T(r)("Worktree thread")},null,8,["title"])):ie("",!0),lt(W.id)?(C(),R("span",{key:1,class:"thread-row-automation-chip",title:Pn(W.id)}," Auto ",8,AT)):ie("",!0),W.pendingRequestState?(C(),R("span",{key:2,class:"thread-row-request-chip","data-state":W.pendingRequestState},N(Nr(W)),9,ET)):ie("",!0)])])],8,kT)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onClick","onMouseleave","onContextmenu"])],8,wT))),128))])):(C(),rt(io,{key:1,as:"p",class:"project-empty-row"},{left:ut(()=>[..._[23]||(_[23]=[m("span",{class:"project-empty-spacer"},null,-1)])]),default:ut(()=>[m("span",MT,N(T(r)("No threads")),1)]),_:1})),zt(S)?(C(),rt(io,{key:2,class:"thread-show-more-row"},{left:ut(()=>[..._[24]||(_[24]=[m("span",{class:"thread-show-more-spacer"},null,-1)])]),default:ut(()=>[m("button",{class:"thread-show-more-button",type:"button",onClick:W=>yr(S.projectName)},N(nn(S.projectName)?"Show less":"Show more"),9,RT)]),_:2},1024)):ie("",!0)],12,oT))),128))],4))],64)):ie("",!0)]),m("section",$T,[Ne(io,{as:"button",class:"section-toggle-row",type:"button","aria-expanded":f.value,onClick:vo},{left:ut(()=>[f.value?(C(),rt(Ba,{key:1,class:"thread-icon"})):(C(),rt(Ci,{key:0,class:"thread-icon"}))]),right:ut(()=>[m("div",OT,[m("button",{class:"chats-section-action",type:"button","aria-pressed":e.filterActive,"aria-label":e.filterActive?T(r)("Hide chat filters"):T(r)("Filter chats"),title:e.filterActive?T(r)("Hide chat filters"):T(r)("Filter chats"),onClick:_[7]||(_[7]=tt(S=>w.$emit("toggle-filter"),["stop"]))},[Ne(Z0,{class:"thread-icon"})],8,DT),m("button",{class:"chats-section-action",type:"button","aria-label":T(r)("New chat"),title:T(r)("New chat"),onClick:_[8]||(_[8]=tt(S=>w.$emit("start-new-chat"),["stop"]))},[Ne(Hs,{class:"thread-icon"})],8,LT)])]),default:ut(()=>[m("span",NT,N(T(r)("Chats")),1)]),_:1},8,["aria-expanded"]),f.value&&U.value.length===0?(C(),R("p",jT,N(T(r)("No chats")),1)):f.value?(C(),R("ul",FT,[(C(!0),R(Ge,null,Vt(U.value,S=>(C(),R("li",{key:S.id,class:"thread-row-item","data-menu-open":xt(S.id)?"true":"false"},[Ne(io,{class:"thread-row","data-active":S.id===e.selectedThreadId,"data-pinned":zn(S.id),"data-menu-open":xt(S.id)?"true":"false","force-right-hover":xt(S.id),onClick:W=>Ft(S.id),onMouseleave:W=>Ut(S.id,W),onContextmenu:W=>ir(W,S.id)},{left:ut(()=>[m("span",BT,[$r(S)?(C(),R("span",{key:0,class:"thread-status-indicator","data-state":eo(S)},null,8,qT)):ie("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:tt(W=>Sr(S.id),["stop"])},[Ne(xi,{class:"thread-icon"})],8,HT)])]),right:ut(()=>[m("span",YT,N(pr(S)),1)]),"right-hover":ut(()=>[m("div",{ref_for:!0,ref:W=>Pr(S.id,W),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:tt(W=>mr(S.id),["stop"])},[Ne($a,{class:"thread-icon"})],8,QT)],512)]),default:ut(()=>[m("button",{class:"thread-main-button",type:"button",onClick:tt(W=>Ft(S.id),["stop"])},[m("span",VT,[m("span",WT,[m("span",GT,N(S.title),1),S.hasWorktree?(C(),rt(Cs,{key:0,class:"thread-row-worktree-icon",title:T(r)("Worktree thread")},null,8,["title"])):ie("",!0),lt(S.id)?(C(),R("span",{key:1,class:"thread-row-automation-chip",title:Pn(S.id)}," Auto ",8,KT)):ie("",!0),S.pendingRequestState?(C(),R("span",{key:2,class:"thread-row-request-chip","data-state":S.pendingRequestState},N(Nr(S)),9,JT)):ie("",!0)])])],8,zT)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onClick","onMouseleave","onContextmenu"])],8,UT))),128))])):ie("",!0)]),(C(),rt(pa,{to:"body"},[$e.value?(C(),R("div",{key:0,ref_key:"openThreadMenuPanelRef",ref:Je,class:"thread-menu-panel thread-menu-panel-fixed",style:Io(O.value),"data-open-direction":It($e.value.id),onClick:_[16]||(_[16]=tt(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:_[9]||(_[9]=S=>Gn($e.value.id))},N(lt($e.value.id)?"Edit automation…":"Add automation…"),1),m("button",{class:"thread-menu-item",type:"button",onClick:_[10]||(_[10]=S=>qt($e.value.id))}," Browse files "),m("button",{class:"thread-menu-item",type:"button",onClick:_[11]||(_[11]=S=>Qt($e.value.id))}," Copy path "),m("button",{class:"thread-menu-item",type:"button",onClick:_[12]||(_[12]=S=>Vn($e.value.id))}," Export chat "),m("button",{class:"thread-menu-item",type:"button",onClick:_[13]||(_[13]=S=>Jr($e.value.id))}," Create chat fork "),m("button",{class:"thread-menu-item",type:"button",onClick:_[14]||(_[14]=S=>Ir($e.value.id,$e.value.title))},N(T(r)("Rename thread")),1),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:_[15]||(_[15]=S=>vr($e.value.id,$e.value.title))},N(T(r)("Delete thread")),1)],12,XT)):ie("",!0)])),(C(),rt(pa,{to:"body"},[Ce.value?(C(),R("div",{key:0,class:"rename-thread-overlay",onClick:tt(Mn,["self"])},[m("div",ZT,[m("h3",ek,N(T(r)("Rename thread")),1),_[25]||(_[25]=m("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),ln(m("input",{ref_key:"renameThreadInputRef",ref:xe,"onUpdate:modelValue":_[17]||(_[17]=S=>ce.value=S),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[un(tt(en,["prevent"]),["enter"]),un(tt(Mn,["prevent"]),["esc"])]},null,40,tk),[[kn,ce.value]]),m("div",nk,[m("button",{class:"rename-thread-button",type:"button",onClick:Mn},N(T(r)("Cancel")),1),m("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:en},N(T(r)("Save")),1)])])])):ie("",!0)])),(C(),rt(pa,{to:"body"},[Z.value?(C(),R("div",{key:0,class:"rename-thread-overlay",onClick:tt(lr,["self"])},[m("div",rk,[m("h3",ok,N(he.value?"Archive chat and remove automation?":"Delete thread?"),1),m("p",ak,[he.value?(C(),R(Ge,{key:0},[ya(' This will archive the thread "'+N(He.value)+'" and remove the attached heartbeat automation. ',1)],64)):(C(),R(Ge,{key:1},[ya(' This will archive the thread "'+N(He.value)+'". You can find it later in archived threads. ',1)],64))]),m("div",sk,[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(he.value?"Archive and remove":"Delete"),1)])])])):ie("",!0)])),(C(),rt(pa,{to:"body"},[be.value?(C(),R("div",{key:0,class:"rename-thread-overlay",onClick:tt(Rn,["self"])},[m("div",ik,[m("h3",lk,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",uk,[_[26]||(_[26]=m("span",{class:"automation-thread-label"},"Name",-1)),ln(m("input",{"onUpdate:modelValue":_[18]||(_[18]=S=>me.value.name=S),class:"rename-thread-input",type:"text",placeholder:"Automation name"},null,512),[[kn,me.value.name]])]),m("label",ck,[_[27]||(_[27]=m("span",{class:"automation-thread-label"},"Prompt",-1)),ln(m("textarea",{"onUpdate:modelValue":_[19]||(_[19]=S=>me.value.prompt=S),class:"automation-thread-textarea",rows:"6",placeholder:"Describe what the automation should do"},null,512),[[kn,me.value.prompt]])]),m("label",dk,[_[28]||(_[28]=m("span",{class:"automation-thread-label"},"Schedule (RRULE)",-1)),ln(m("input",{"onUpdate:modelValue":_[20]||(_[20]=S=>me.value.rrule=S),class:"rename-thread-input",type:"text",placeholder:"FREQ=DAILY;BYHOUR=9;BYMINUTE=0"},null,512),[[kn,me.value.rrule]])]),m("label",fk,[_[29]||(_[29]=m("span",{class:"automation-thread-label"},"Status",-1)),ln(m("select",{"onUpdate:modelValue":_[21]||(_[21]=S=>me.value.status=S),class:"automation-thread-select"},[m("option",hk,N(T(r)("Active")),1),m("option",pk,N(T(r)("Paused")),1)],512),[[dy,me.value.status]])]),Ue.value?(C(),R("p",mk,N(Ue.value),1)):ie("",!0),m("div",vk,[Ke.value==="edit"?(C(),R("button",{key:0,class:"rename-thread-button rename-thread-button-danger",type:"button",disabled:Se.value,onClick:Kn}," Remove ",8,gk)):ie("",!0),m("button",{class:"rename-thread-button",type:"button",disabled:Se.value,onClick:Rn},N(T(r)("Cancel")),9,yk),m("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",disabled:Se.value,onClick:Sn},N(Se.value?"Saving…":"Save"),9,wk)])])])):ie("",!0)]))],2))}}),Tk=At(_k,[["__scopeId","data-v-8a2acbba"]]),kk={class:"content-header"},Sk=["title"],Ck={class:"content-actions"},xk=Bn({__name:"ContentHeader",props:{title:{},accent:{type:Boolean}},setup(e){return(t,n)=>(C(),R("header",kk,[m("div",{class:it(["content-leading",{"is-accent":e.accent}])},[ho(t.$slots,"leading",{},void 0)],2),m("h1",{class:it(["content-title",{"is-accent":e.accent}]),title:e.title},N(e.title),11,Sk),m("div",Ck,[ho(t.$slots,"actions",{},void 0)])]))}}),Ak=At(xk,[["__scopeId","data-v-f96f7210"]]),kf=.0025,bu=3,Sf=2,Ek=256;function Ik(e){var He;const t=I("idle"),n=I(typeof navigator<"u"&&!!((He=navigator.mediaDevices)!=null&&He.getUserMedia)),r=I(0),a=I(null);let o=null,i=null,l=[],c=null,f=null,h=null,v=null,b=[],x=!1,j=!1,q=null;function te(){q&&(q.abort(),q=null),t.value==="transcribing"&&(t.value="idle")}function H(){const ee=a.value;if(!ee||typeof window>"u")return;const be=ee.getContext("2d");if(!be)return;const Le=Math.max(1,Math.floor(ee.clientWidth)),Ke=Math.max(1,Math.floor(ee.clientHeight||36)),Ue=window.devicePixelRatio||1,Se=Math.max(1,Math.floor(Le*Ue)),me=Math.max(1,Math.floor(Ke*Ue));(ee.width!==Se||ee.height!==me)&&(ee.width=Se,ee.height=me),be.setTransform(Ue,0,0,Ue,0,0),be.clearRect(0,0,Le,Ke);const We=Math.max(12,Math.floor(Le/(bu+Sf))),nt=b.slice(-We),ze=Math.max(0,We-nt.length),je=Ke/2,dt=getComputedStyle(ee).color||"#000000";for(let ft=0;ft<We;ft+=1){const et=nt[ft-ze]??0,K=Math.max(.08,Math.min(1,et*18))*je,_e=ft*(bu+Sf);be.globalAlpha=et<=kf?.35:1,be.fillStyle=dt,be.fillRect(_e,je-K,bu,K*2)}be.globalAlpha=1}function O(){b=[],r.value=0,H()}function V(){h&&(h.disconnect(),h.onaudioprocess=null,h=null),f&&(f.disconnect(),f=null),c&&(c.close(),c=null),v=null}function X(ee){if(typeof window>"u")return;const be=window.webkitAudioContext,Le=window.AudioContext??be;Le&&(V(),O(),c=new Le,f=c.createMediaStreamSource(ee),h=c.createScriptProcessor(2048,1,1),v=performance.now(),h.onaudioprocess=Ke=>{const Ue=Ke.inputBuffer.getChannelData(0);let Se=0;for(let me=0;me<Ue.length;me+=1){const We=Math.abs(Ue[me]??0);Se+=We<kf?0:We}b.push(Se/Ue.length),b.length>Ek&&b.shift(),v!==null&&(r.value=Math.max(0,performance.now()-v)),H()},f.connect(h),h.connect(c.destination),H())}async function Ce(){var ee;if(t.value==="transcribing"&&te(),!(t.value!=="idle"||!n.value||x)){x=!0,j=!1;try{i=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),l=[],o=new MediaRecorder(i),o.ondataavailable=be=>{be.data.size>0&&l.push(be.data)},o.onstop=()=>{var Ke;const be=l,Le=(o==null?void 0:o.mimeType)||((Ke=be[0])==null?void 0:Ke.type)||"audio/webm";Z(),xe(be,Le)},X(i),o.start(250),t.value="recording",j&&Oe()}catch(be){Z(),t.value="idle",(ee=e.onError)==null||ee.call(e,be)}finally{x=!1}}}function Oe(){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 ce(){j=!1,te(),Z(),t.value="idle"}async function xe(ee,be){var Ue,Se,me,We,nt;if(ee.length===0){(Ue=e.onEmpty)==null||Ue.call(e),t.value="idle";return}const Le=new Blob(ee,{type:be});t.value="transcribing";let Ke=null;try{const ze=be.split(/[/;]/)[1]??"webm",je=new FormData;je.append("file",Le,`codex.${ze}`);const dt=((Se=e.getLanguage)==null?void 0:Se.call(e).trim())??"";dt&&dt.toLowerCase()!=="auto"&&je.append("language",dt),Ke=new AbortController,q=Ke;const ft=await fetch("/codex-api/transcribe",{method:"POST",body:je,signal:Ke.signal}),et=await ft.text();let ct=null;try{ct=et.trim()?JSON.parse(et):null}catch{ct=null}if(!ft.ok){const _e=(me=ct==null?void 0:ct.error)==null?void 0:me.trim(),we=et.trim();throw new Error(_e||we||`Transcription failed: ${ft.status}`)}const K=((ct==null?void 0:ct.text)??"").trim();K.length>0?e.onTranscript(K):(We=e.onEmpty)==null||We.call(e)}catch(ze){if(ze instanceof DOMException&&ze.name==="AbortError")return;(nt=e.onError)==null||nt.call(e,ze)}finally{Ke&&q===Ke&&(q=null),t.value==="transcribing"&&(t.value="idle")}}function Z(){V(),O(),o&&(o.ondataavailable=null,o.onstop=null,o=null),i&&(i.getTracks().forEach(ee=>ee.stop()),i=null),l=[]}wa(()=>{ce()});function Ae(){if(t.value==="recording"){Oe();return}(t.value==="idle"||t.value==="transcribing")&&Ce()}return{state:t,isSupported:n,recordingDurationMs:r,waveformCanvasRef:a,startRecording:Ce,stopRecording:Oe,toggleRecording:Ae,cancel:ce}}const Pk={},Mk={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Rk(e,t){return C(),R("svg",Mk,[...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 $k=At(Pk,[["render",Rk]]),Nk={},Ok={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Dk(e,t){return C(),R("svg",Ok,[...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 ji=At(Nk,[["render",Dk]]),Lk={},jk={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Fk(e,t){return C(),R("svg",jk,[...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 Uk=At(Lk,[["render",Fk]]),Bk={},qk={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Hk(e,t){return C(),R("svg",qk,[...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 Cf=At(Bk,[["render",Hk]]),zk=["disabled"],Vk={class:"composer-dropdown-value"},Wk={class:"composer-dropdown-menu"},Gk={key:0,class:"composer-dropdown-search-wrap"},Kk=["placeholder","onKeydown"],Jk={class:"composer-dropdown-options",role:"listbox"},Yk=["onClick"],Qk={key:0,class:"composer-dropdown-empty"},Xk=Bn({__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=I(null),o=I(null),i=I(!1),l=I(""),c=ae(()=>{var V;const O=n.options.find(X=>X.value===n.modelValue);return O?O.label:((V=n.placeholder)==null?void 0:V.trim())||""}),f=ae(()=>n.openDirection??"down"),h=ae(()=>n.enableSearch===!0),v=ae(()=>{var O;return((O=n.searchPlaceholder)==null?void 0:O.trim())||"Quick search projects"}),b=ae(()=>{var O;return((O=n.emptyLabel)==null?void 0:O.trim())||"No results"}),x=ae(()=>{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||(i.value=!i.value)}function q(O){r("update:modelValue",O),i.value=!1,l.value=""}function te(){if(l.value.length>0){l.value="";return}i.value=!1}function H(O){if(!i.value)return;const V=a.value;if(!V)return;const X=O.target;X instanceof Node&&(V.contains(X)||(i.value=!1,l.value=""))}return vt(i,O=>{O&&h.value&&sn(()=>{var V;return(V=o.value)==null?void 0:V.focus()})}),Xo(()=>{window.addEventListener("pointerdown",H)}),wa(()=>{window.removeEventListener("pointerdown",H)}),(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(hc(e.selectedPrefixIcon),{key:0,class:"composer-dropdown-prefix-icon"})):ie("",!0),m("span",Vk,N(c.value),1),Ne(Ba,{class:"composer-dropdown-chevron"})],8,zk),i.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",Wk,[h.value?(C(),R("div",Gk,[ln(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":V[0]||(V[0]=X=>l.value=X),class:"composer-dropdown-search-input",type:"text",placeholder:v.value,onKeydown:un(tt(te,["prevent"]),["esc"])},null,40,Kk),[[kn,l.value]])])):ie("",!0),m("ul",Jk,[(C(!0),R(Ge,null,Vt(x.value,X=>(C(),R("li",{key:X.value},[m("button",{class:it(["composer-dropdown-option",{"is-selected":X.value===e.modelValue}]),type:"button",onClick:Ce=>q(X.value)},N(X.label),11,Yk)]))),128)),x.value.length===0?(C(),R("li",Qk,N(b.value),1)):ie("",!0)])])],2)):ie("",!0)],512))}}),qa=At(Xk,[["__scopeId","data-v-2527acc2"]]),Zk=["disabled"],eS={class:"search-dropdown-value"},tS={class:"search-dropdown-search-wrap"},nS={class:"search-dropdown-search-row"},rS=["placeholder","onKeydown"],oS=["aria-label","title"],aS={key:0,class:"search-dropdown-list",role:"listbox"},sS=["onPointerenter"],iS=["onClick"],lS={class:"search-dropdown-option-check"},uS={class:"search-dropdown-option-copy"},cS={class:"search-dropdown-option-label"},dS={key:0,class:"search-dropdown-option-desc"},fS=["aria-label","title","onClick"],hS={key:1,class:"search-dropdown-empty"},pS=Bn({__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=I(null),o=I(null),i=I(null),l=I(!1),c=I(""),f=I(0),h=I({}),{t:v}=ea(),b=ae(()=>n.openDirection??"down"),x=ae(()=>new Set(n.selectedValues)),j=ae(()=>{var ce;if((ce=n.displayLabelOverride)!=null&&ce.trim())return n.displayLabelOverride.trim();if(n.selectedValues.length===0)return n.placeholder||v("Select...");if(n.selectedValues.length===1){const xe=n.options.find(Z=>Z.value===n.selectedValues[0]);return(xe==null?void 0:xe.label)||n.placeholder||v("Select...")}return`${n.selectedValues.length} ${v("selected")}`}),q=ae(()=>{const ce=c.value.toLowerCase().trim();return ce?n.options.filter(xe=>{var Z;return xe.label.toLowerCase().includes(ce)||(((Z=xe.description)==null?void 0:Z.toLowerCase().includes(ce))??!1)}):n.options});function te(){const ce=o.value,xe=a.value;if(!ce||!xe)return;const Z=xe.getBoundingClientRect(),Ae=window.innerWidth,He=window.innerHeight,ee=Math.min(384,Ae-16),be=Math.max(8,Math.min(Z.right-ee,Ae-ee-8));if(Ae<640){h.value={position:"fixed",left:"0.5rem",right:"0.5rem",width:"auto",top:b.value==="up"?"auto":`${Z.bottom+8}px`,bottom:b.value==="up"?`${He-Z.top+8}px`:"auto",zIndex:"120"};return}h.value={position:"fixed",width:`${ee}px`,left:`${be}px`,top:b.value==="up"?"auto":`${Z.bottom+8}px`,bottom:b.value==="up"?`${He-Z.top+8}px`:"auto",zIndex:"120"}}function H(){n.disabled||(l.value=!l.value,l.value&&(c.value="",f.value=0,sn(()=>{var ce;sn(()=>{te()}),(ce=i.value)==null||ce.focus()})))}function O(ce){r("toggle",ce.value,!x.value.has(ce.value)),l.value=!1}function V(ce){q.value.length!==0&&(f.value=(f.value+ce+q.value.length)%q.value.length)}function X(){const ce=q.value[f.value];ce&&O(ce)}function Ce(ce){if(!l.value)return;const xe=a.value,Z=o.value;if(!xe)return;const Ae=ce.target;Ae instanceof Node&&(xe.contains(Ae)||Z!=null&&Z.contains(Ae)||(l.value=!1))}vt(c,()=>{f.value=0});function Oe(){l.value&&te()}return Xo(()=>{window.addEventListener("pointerdown",Ce),window.addEventListener("resize",Oe),window.addEventListener("scroll",Oe,!0)}),wa(()=>{window.removeEventListener("pointerdown",Ce),window.removeEventListener("resize",Oe),window.removeEventListener("scroll",Oe,!0)}),(ce,xe)=>(C(),R("div",{ref_key:"rootRef",ref:a,class:"search-dropdown"},[m("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:H},[m("span",eS,N(j.value),1),Ne(Ba,{class:"search-dropdown-chevron"})],8,Zk),(C(),rt(pa,{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:Io(h.value)},[m("div",tS,[m("div",nS,[ln(m("input",{ref_key:"searchRef",ref:i,"onUpdate:modelValue":xe[0]||(xe[0]=Z=>c.value=Z),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[xe[1]||(xe[1]=un(tt(Z=>l.value=!1,["prevent"]),["escape"])),un(tt(X,["prevent"]),["enter"]),xe[2]||(xe[2]=un(tt(Z=>V(1),["prevent"]),["arrow-down"])),xe[3]||(xe[3]=un(tt(Z=>V(-1),["prevent"]),["arrow-up"]))]},null,40,rS),[[kn,c.value]]),e.createLabel?(C(),R("button",{key:0,class:"search-dropdown-create-icon",type:"button","aria-label":e.createLabel,title:e.createLabel,onClick:xe[4]||(xe[4]=Z=>r("create"))}," + ",8,oS)):ie("",!0)]),e.createLabel?(C(),R("button",{key:0,class:"search-dropdown-create",type:"button",onClick:xe[5]||(xe[5]=Z=>r("create"))},N(e.createLabel),1)):ie("",!0)]),q.value.length>0?(C(),R("ul",aS,[(C(!0),R(Ge,null,Vt(q.value,(Z,Ae)=>(C(),R("li",{key:Z.value},[m("div",{class:it(["search-dropdown-option",{"is-selected":x.value.has(Z.value),"is-highlighted":Ae===f.value}]),onPointerenter:He=>f.value=Ae},[m("button",{class:"search-dropdown-option-main",type:"button",onClick:He=>O(Z)},[m("span",lS,N(x.value.has(Z.value)?"✓":""),1),m("span",uS,[m("span",cS,N(Z.label),1),Z.description?(C(),R("span",dS,N(Z.description),1)):ie("",!0)])],8,iS),e.allowRemove?(C(),R("button",{key:0,class:"search-dropdown-option-remove",type:"button","aria-label":`${e.removeLabel} ${Z.label}`,title:`${e.removeLabel} ${Z.label}`,onClick:tt(He=>r("remove",Z.value),["stop"])}," × ",8,fS)):ie("",!0)],42,sS)]))),128))])):(C(),R("div",hS,N(T(v)("No results")),1))],6)):ie("",!0)]))],512))}}),xf=At(pS,[["__scopeId","data-v-5e35d58e"]]),mS={key:0,class:"thread-composer-dictation-error"},vS={key:0,class:"thread-composer-attachments"},gS=["src","alt"],yS=["aria-label","disabled","onClick"],wS={key:1,class:"thread-composer-folder-chips"},bS=["title"],_S={class:"thread-composer-folder-chip-meta"},TS=["aria-label","disabled","onClick"],kS={key:2,class:"thread-composer-file-chips"},SS=["title"],CS=["aria-label","disabled","onClick"],xS={key:3,class:"thread-composer-skill-chips"},AS={class:"thread-composer-skill-chip-name"},ES=["aria-label","onClick"],IS={key:0,class:"thread-composer-drop-overlay","aria-hidden":"true"},PS={key:1,class:"thread-composer-file-mentions"},MS=["onMousedown"],RS={key:1,class:"thread-composer-file-mention-icon-markdown"},$S={class:"thread-composer-file-mention-text"},NS={class:"thread-composer-file-mention-name"},OS={key:0,class:"thread-composer-file-mention-dir"},DS={key:1,class:"thread-composer-file-mention-empty"},LS=["placeholder","disabled"],jS=["aria-label","disabled"],FS={key:0,class:"thread-composer-attach-menu"},US=["disabled"],BS=["disabled"],qS=["disabled"],HS={class:"thread-composer-attach-mode"},zS={class:"thread-composer-attach-mode-label"},VS={class:"thread-composer-attach-mode-buttons"},WS=["disabled"],GS=["disabled"],KS=["aria-checked","aria-label","disabled"],JS={class:"thread-composer-attach-setting-copy"},YS={class:"thread-composer-attach-setting-label"},QS={class:"thread-composer-attach-setting-description"},XS=["aria-checked","aria-label","disabled"],ZS={class:"thread-composer-attach-setting-copy"},e1={class:"thread-composer-attach-setting-label"},t1={class:"thread-composer-attach-setting-description"},n1={key:0,class:"thread-composer-dictation-waveform-wrap","aria-hidden":"true"},r1={key:1,class:"thread-composer-dictation-timer"},o1=["aria-label","title","disabled"],a1=["aria-label","title","disabled"],s1={key:0,class:"thread-composer-stop-spinner","aria-hidden":"true"},i1=["aria-label","title","disabled"],l1=["disabled"],u1=["disabled"],c1=["disabled"],d1=2e3,f1="codex-web-local.thread-draft.v1.",h1=Bn({__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}=ea(),i=I(""),l=I([]),c=I([]),f=I([]),h=I([]),v=I([]),b=I(""),x=I(0),j=I(null),q=I(!1),{state:te,isSupported:H,recordingDurationMs:O,waveformCanvasRef:V,startRecording:X,stopRecording:Ce,toggleRecording:Oe,cancel:ce}=Ik({getLanguage:()=>r.dictationLanguage??"auto",onTranscript:M=>{if(i.value=i.value?`${i.value}
|
|
48
|
-
${M}`:M,b.value="",r.dictationAutoSend!==!1){const B=r.isTurnInProgress?Ee.value:"steer";Me(B);return}sn(()=>{var B;return(B=ee.value)==null?void 0:B.focus()})},onEmpty:()=>{b.value=r.dictationClickToToggle?"No speech detected. Click again after speaking.":"No speech detected. Hold the mic and speak."},onError:M=>{if(M instanceof DOMException&&M.name==="NotAllowedError"){b.value="Microphone access was denied.";return}b.value=M instanceof Error?M.message:"Dictation failed."}}),xe=I(null),Z=I(null),Ae=I(null),He=I(null),ee=I(null),{isMobile:be}=Tc(),Le=I(!1),Ke=I(null),Ue=I(""),Se=I([]),me=I(!1),We=I(0),nt=I(0);let ze=0,je=null,dt=!1,ft=0,et=0;const ct=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 we(M){return M.trim().replace(/^gpt/i,"GPT")}const De=ae(()=>r.models.map(M=>({value:M,label:we(M)}))),Je=ae(()=>r.selectedCollaborationMode==="plan"),k=ae(()=>r.selectedCollaborationMode==="plan"&&r.selectedModel.trim().length===0),E=ae(()=>c.value.map(M=>M.path)),z=ae(()=>(r.skills??[]).map(M=>({value:M.path,label:M.name,description:M.description}))),ne=ae(()=>f.value.map(M=>({value:M.path,label:M.name,description:M.description}))),J=ae(()=>r.disabled||r.isUpdatingSpeedMode||!r.activeThreadId||k.value||x.value>0?!1:i.value.trim().length>0||l.value.length>0||h.value.length>0),oe=ae(()=>i.value.trim().length>0||l.value.length>0||c.value.length>0||h.value.length>0||v.value.length>0),ye=ae(()=>{const M=new Set;for(const B of v.value)for(const Q of B.filePaths)M.add(Q);return h.value.filter(B=>!M.has(B.fsPath))}),fe=ae(()=>r.disabled||!r.activeThreadId),pe=ae(()=>r.selectedModel.trim()==="gpt-5.4"),ue=ae(()=>r.selectedSpeedMode==="fast"&&pe.value),Re=ae(()=>fe.value||r.isUpdatingSpeedMode===!0),ve=ae(()=>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")),Pe=ae(()=>r.inProgressSubmitMode==="steer"?"steer":"queue"),Ee=I(Pe.value),Ze=ae(()=>te.value==="recording"),D=ae(()=>te.value==="recording"?o("Stop dictation"):r.dictationClickToToggle?o("Click to dictate"):o("Hold to dictate")),F=ae(()=>te.value==="idle"?b.value.trim():""),U=ae(()=>{const M=Math.max(0,Math.floor(O.value/1e3)),B=Math.floor(M/60),Q=M%60;return`${B}:${String(Q).padStart(2,"0")}`}),Y=ae(()=>r.activeThreadId?k.value?o("Loading models for plan mode..."):o("Type a message... (@ for files)"):o("Select a thread to send a message")),he=ae(()=>i.value.trim().length>0||l.value.length>0||h.value.length>0);function Me(M="steer"){var Q;const B=i.value.trim();if(J.value){if(a("submit",{text:B,imageUrls:l.value.map(Ie=>Ie.url),fileAttachments:[...h.value],skills:c.value.map(Ie=>({name:Ie.name,path:Ie.path})),mode:M}),vo(r.activeThreadId),$e(),v.value=[],Le.value=!1,rn(),ct||be.value){(Q=ee.value)==null||Q.blur();return}sn(()=>{var Ie;return(Ie=ee.value)==null?void 0:Ie.focus()})}}function Be(M){Ee.value=M}function Ye(M){nt.value+=1,i.value=M.text,l.value=M.imageUrls.map((B,Q)=>({id:`queued-${Date.now()}-${Q}-${Math.random().toString(36).slice(2,8)}`,name:`Image ${Q+1}`,url:B})),c.value=M.skills.map(B=>(r.skills??[]).find(Q=>Q.path===B.path)??{name:B.name,displayName:void 0,description:"",path:B.path}),h.value=M.fileAttachments.map(B=>({...B})),v.value=[],b.value="",j.value=null,x.value=0,Le.value=!1,rn(),et+=1}function $e(){Ye({text:"",imageUrls:[],fileAttachments:[],skills:[]})}function gt(M){return`${f1}${M}`}function Hn(M){if(typeof window>"u")return null;const B=M.trim();if(!B)return null;try{const Q=window.localStorage.getItem(gt(B));if(!Q)return null;const Ie=JSON.parse(Q);return typeof Ie=="string"?{text:Ie,imageUrls:[],fileAttachments:[],skills:[]}:{text:typeof Ie.text=="string"?Ie.text:"",imageUrls:Array.isArray(Ie.imageUrls)?Ie.imageUrls.filter(St=>typeof St=="string"):[],fileAttachments:Array.isArray(Ie.fileAttachments)?Ie.fileAttachments.filter(St=>!!St&&typeof St.label=="string"&&typeof St.path=="string"&&typeof St.fsPath=="string"):[],skills:Array.isArray(Ie.skills)?Ie.skills.filter(St=>!!St&&typeof St.name=="string"&&typeof St.path=="string"):[]}}catch{return null}}function mn(M,B){if(typeof window>"u")return;const Q=M.trim();if(Q)try{if(B.text.trim().length>0||B.imageUrls.length>0||B.fileAttachments.length>0||B.skills.length>0){window.localStorage.setItem(gt(Q),JSON.stringify(B));return}window.localStorage.removeItem(gt(Q))}catch{}}function vo(M){mn(M,{text:"",imageUrls:[],fileAttachments:[],skills:[]})}function Ot(){return{text:i.value,imageUrls:l.value.map(M=>M.url),fileAttachments:h.value.map(M=>({...M})),skills:c.value.map(M=>({name:M.name,path:M.path}))}}function hr(){a("interrupt")}function sr(M){a("update:selected-model",M)}function Kr(){a("update:selected-collaboration-mode",Je.value?"default":"plan")}function kr(M){a("update:selected-reasoning-effort",M)}function pr(){Re.value||a("update:selected-speed-mode",r.selectedSpeedMode==="fast"?"standard":"fast")}function zn(){r.dictationClickToToggle&&(b.value&&(b.value=""),Oe())}function Sr(M){if(r.dictationClickToToggle||(M.preventDefault(),dt))return;dt=!0;const B=M.currentTarget;if(B)try{B.setPointerCapture(M.pointerId)}catch{}b.value&&(b.value=""),window.addEventListener("pointerup",Ft),window.addEventListener("pointercancel",Ft),window.addEventListener("blur",Ft),X()}function Ft(){r.dictationClickToToggle||dt&&(dt=!1,window.removeEventListener("pointerup",Ft),window.removeEventListener("pointercancel",Ft),window.removeEventListener("blur",Ft),Ce())}function lt(){fe.value||(Le.value=!Le.value)}function Pn(){var M;(M=Z.value)==null||M.click()}function Vn(){var M;(M=Ae.value)==null||M.click()}function Jr(){var M;(M=He.value)==null||M.click()}function Wt(M){l.value=l.value.filter(B=>B.id!==M)}function Wn(M){c.value=c.value.filter(B=>B.path!==M)}function qt(M){h.value=h.value.filter(B=>B.fsPath!==M)}function Qt(M){const B=v.value.find(Ie=>Ie.id===M);if(!B)return;const Q=new Set(B.filePaths);h.value=h.value.filter(Ie=>!Q.has(Ie.fsPath)),v.value=v.value.filter(Ie=>Ie.id!==M)}function Ut(M){return M.total<=0?0:Math.round(M.processed/M.total*100)}function xt(M,B){const Q=M.replace(/\\/g,"/");if(h.value.some(Xt=>Xt.fsPath===Q))return;const Ie=Q.split("/").filter(Boolean),St=(B==null?void 0:B.trim())||Ie[Ie.length-1]||Q;h.value=[...h.value,{label:St,path:Q,fsPath:Q}]}function Gt(M){return M.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(M.name)}function mr(M){return M?Array.from(M):[]}function ir(M){return M!==et?!1:(x.value+=1,!0)}function Ir(M){M===et&&(x.value=Math.max(0,x.value-1))}function Mn(M){if(M<=0)return;const B=j.value,Q=B?B.succeeded+B.failed:0;if(!B||Q>=B.total){j.value={total:M,succeeded:0,failed:0};return}j.value={...B,total:B.total+M}}function en(M){const B=j.value;B&&(j.value={...B,succeeded:B.succeeded+(M==="success"?1:0),failed:B.failed+(M==="failure"?1:0)})}function vr(){return`${Date.now()}-${Math.random().toString(36).slice(2)}`}function lr(M){const B=new Date,Q=[B.getFullYear(),String(B.getMonth()+1).padStart(2,"0"),String(B.getDate()).padStart(2,"0"),String(B.getHours()).padStart(2,"0"),String(B.getMinutes()).padStart(2,"0"),String(B.getSeconds()).padStart(2,"0")].join("-"),Ie=M.type.startsWith("image/")&&M.type.slice(6).replace(/[^a-z0-9]+/gi,"")||"png";return`pasted-image-${Q}.${Ie}`}function Yr(){const M=new Date;return`pasted-text-${[M.getFullYear(),String(M.getMonth()+1).padStart(2,"0"),String(M.getDate()).padStart(2,"0"),String(M.getHours()).padStart(2,"0"),String(M.getMinutes()).padStart(2,"0"),String(M.getSeconds()).padStart(2,"0")].join("-")}.txt`}function Gn(M){return M.name.trim()?M:new File([M],lr(M),{type:M.type||"image/png",lastModified:Date.now()})}async function Rn(M,B){if(ir(B))try{const Q=Gn(M),Ie=await wu(Q);if(B!==et)return;if(!Ie){en("failure");return}l.value=[...l.value,{id:vr(),name:Q.name,url:`/codex-local-image?path=${encodeURIComponent(Ie)}`}],en("success")}catch{B===et&&en("failure")}finally{Ir(B)}}async function Sn(M,B){if(ir(B))try{const Q=await wu(M);if(B!==et)return;if(!Q){en("failure");return}xt(Q),en("success")}catch{B===et&&en("failure")}finally{Ir(B)}}function Kn(M){const B=mr(M);if(B.length===0)return;Mn(B.length),Le.value=!1,rn();const Q=et;for(const Ie of B)Gt(Ie)?Rn(Ie,Q):Sn(Ie,Q)}function tn(){ft=0,q.value=!1}function Cr(M){return M?Array.from(M.types??[]).includes("Files"):!1}async function Cn(M){if(!M||M.length===0)return;const B=nt.value,Q=Array.from(M),St=(Q[0].webkitRelativePath||Q[0].name).split("/").filter(Boolean)[0]||"Folder",Xt=`${Date.now()}-${Math.random().toString(36).slice(2)}`;v.value=[...v.value,{id:Xt,name:St,total:Q.length,processed:0,filePaths:[],isUploading:!0}];const Ht=mt=>{B===nt.value&&(v.value=v.value.map(Kt=>Kt.id===Xt?mt(Kt):Kt))};for(const mt of Q)try{const Kt=await wu(mt);if(B!==nt.value)return;if(Kt){const cn=mt.webkitRelativePath||mt.name;xt(Kt,cn),Ht(Mr=>({...Mr,processed:Mr.processed+1,filePaths:[...Mr.filePaths,Kt]}));continue}Ht(cn=>({...cn,processed:cn.processed+1}))}catch{Ht(Kt=>({...Kt,processed:Kt.processed+1}))}Ht(mt=>({...mt,isUploading:!1}))}function Qr(M){M&&(M.value="")}function vn(M){const B=M.target;Kn((B==null?void 0:B.files)??null),Qr(B),Le.value=!1}function ur(M){const B=M.target;Kn((B==null?void 0:B.files)??null),Qr(B),Le.value=!1}function Jn(M){const B=M.target;Cn((B==null?void 0:B.files)??null),Qr(B),Le.value=!1}function gr(M){fe.value||!Cr(M.dataTransfer)||(M.preventDefault(),ft+=1,q.value=!0)}function Nt(M){fe.value||!Cr(M.dataTransfer)||(M.preventDefault(),M.dataTransfer&&(M.dataTransfer.dropEffect="copy"),q.value=!0)}function $n(M){q.value&&(M.preventDefault(),ft=Math.max(0,ft-1),ft===0&&tn())}function gn(M){var B;fe.value||!Cr(M.dataTransfer)||(M.preventDefault(),tn(),Kn(((B=M.dataTransfer)==null?void 0:B.files)??null))}function yn(){!q.value&&ft===0||tn()}function nn(M){var Xt,Ht;if(fe.value)return;const B=((Xt=M.clipboardData)==null?void 0:Xt.getData("text/plain"))??"";if(B.length>=d1){M.preventDefault();const mt=new File([B],Yr(),{type:"text/plain",lastModified:Date.now()});Kn([mt]);return}const Q=Array.from(((Ht=M.clipboardData)==null?void 0:Ht.items)??[]);if(Q.length===0)return;const Ie=B.length>0,St=Q.filter(mt=>mt.kind==="file"&&mt.type.startsWith("image/")).map(mt=>mt.getAsFile()).filter(mt=>mt instanceof File);St.length!==0&&(Ie||M.preventDefault(),Kn(St))}function yt(){b.value&&(b.value=""),Yn()}function yr(M){if(me.value){if(M.key==="Escape"){M.preventDefault(),rn();return}if(M.key==="ArrowDown"){M.preventDefault(),Se.value.length>0&&(We.value=(We.value+1)%Se.value.length);return}if(M.key==="ArrowUp"){if(M.preventDefault(),Se.value.length>0){const Q=Se.value.length;We.value=(We.value+Q-1)%Q}return}if(M.key==="Enter"||M.key==="Tab"){M.preventDefault();const Q=Se.value[We.value];Q?Pr(Q):rn();return}}if(r.sendWithEnter!==!1?M.key==="Enter"&&!M.shiftKey:M.key==="Enter"&&(M.metaKey||M.ctrlKey)){M.preventDefault(),Me(r.isTurnInProgress?Ee.value:"steer");return}}function rn(){me.value=!1,Ke.value=null,Ue.value="",Se.value=[],We.value=0}function Yn(){const M=ee.value;if(!M){rn();return}const B=M.selectionStart??i.value.length,Ie=i.value.slice(0,B).match(/(^|\s)(@[^\s@]*)$/);if(!Ie){rn();return}const St=Ie[2]??"",Xt=St.length,Ht=B-Xt;Ke.value=Ht,Ue.value=St.slice(1),me.value=!0,wr()}async function wr(){if(!me.value)return;const M=(r.cwd??"").trim();if(!M){Se.value=[];return}je&&clearTimeout(je);const B=++ze;je=setTimeout(async()=>{try{const Q=await d0(M,Ue.value,20);if(!me.value||B!==ze)return;Se.value=Q,We.value=0}catch{if(!me.value||B!==ze)return;Se.value=[]}},120)}function Pr(M){const B=ee.value,Q=Ke.value;if(Q!==null&&B){const Ie=B.selectionStart??i.value.length;i.value=`${i.value.slice(0,Q)}${i.value.slice(Ie)}`.trimEnd()}xt(M.path),rn(),sn(()=>B==null?void 0:B.focus())}function Xr(M){ce(),Ye(M),sn(()=>{var B;return(B=ee.value)==null?void 0:B.focus()})}function wn(M){const B=M.trim();B&&(ce(),i.value.trim().length>0?i.value=`${i.value.trimEnd()}
|
|
49
|
-
${B}`:i.value=B,sn(()=>{var Q;return(Q=ee.value)==null?void 0:Q.focus()}))}async function kt(){f.value=await S0()}async function It(){var Ie;const M=((Ie=window.prompt(o("Prompt name")))==null?void 0:Ie.trim())??"";if(!M)return;const B=window.prompt(o("Prompt content"))??"";if(!B.trim())return;const Q=await C0(M,B);Q&&(await kt(),wn(Q.content))}async function go(M){const B=f.value.find(St=>St.path===M);!window.confirm(B?`${o("Remove prompt")} "${B.name}"?`:o("Remove prompt"))||!await x0(M)||await kt()}function Zr(M){const B=f.value.find(Q=>Q.path===M);B&&wn(B.content)}function bt(M){const B=M.lastIndexOf("/");return B<0?M:M.slice(B+1)}function on(M){const B=M.lastIndexOf("/");return B<=0?"":M.slice(0,B)}function an(M){const B=bt(M),Q=B.lastIndexOf(".");return Q<=0?"":B.slice(Q+1).toLowerCase()}function Qn(M){const B=an(M);return B==="ts"?"TS":B==="tsx"?"TSX":B==="js"?"JS":B==="jsx"?"JSX":B==="json"?"{}":""}function Nn(M){const B=an(M);return B.startsWith("ts")?"ts":B.startsWith("js")?"js":B==="json"?"json":"default"}function bn(M){const B=an(M);return B==="md"||B==="mdx"}function Xn(M,B){if(B){const Q=(r.skills??[]).find(Ie=>Ie.path===M);Q&&!c.value.some(Ie=>Ie.path===M)&&(c.value=[...c.value,Q])}else c.value=c.value.filter(Q=>Q.path!==M)}function br(M){if(!Le.value)return;const B=xe.value;if(!B)return;const Q=M.target;!Q||B.contains(Q)||(Le.value=!1)}return Xo(()=>{document.addEventListener("click",br),window.addEventListener("drop",yn),window.addEventListener("dragend",yn),window.addEventListener("blur",yn),kt()}),t({hydrateDraft:Xr,appendTextToDraft:wn,hasUnsavedDraft:()=>oe.value}),wa(()=>{document.removeEventListener("click",br),window.removeEventListener("drop",yn),window.removeEventListener("dragend",yn),window.removeEventListener("blur",yn),window.removeEventListener("pointerup",Ft),window.removeEventListener("pointercancel",Ft),window.removeEventListener("blur",Ft),je&&clearTimeout(je)}),vt(()=>r.activeThreadId,M=>{ce(),K&&mn(K,Ot()),$e();const B=Hn(M);B&&(Ye(B),yt()),K=M.trim()},{immediate:!0}),vt([i,l,h,c],()=>{K&&mn(K,Ot())},{deep:!0}),vt(()=>r.cwd,()=>{me.value&&wr()}),vt(Pe,M=>{Ee.value=M}),(M,B)=>(C(),R("form",{class:"thread-composer",onSubmit:B[4]||(B[4]=tt(Q=>Me(e.isTurnInProgress?Ee.value:"steer"),["prevent"]))},[F.value?(C(),R("p",mS,N(F.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",vS,[(C(!0),R(Ge,null,Vt(l.value,Q=>(C(),R("div",{key:Q.id,class:"thread-composer-attachment"},[m("img",{class:"thread-composer-attachment-image",src:Q.url,alt:Q.name||"Selected image"},null,8,gS),m("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${Q.name||"image"}`,disabled:fe.value,onClick:Ie=>Wt(Q.id)}," x ",8,yS)]))),128))])):ie("",!0),v.value.length>0?(C(),R("div",wS,[(C(!0),R(Ge,null,Vt(v.value,Q=>(C(),R("span",{key:Q.id,class:"thread-composer-folder-chip"},[Ne(xc,{class:"thread-composer-folder-chip-icon"}),m("span",{class:"thread-composer-folder-chip-name",title:Q.name},N(Q.name),9,bS),m("span",_S,[Q.isUploading?(C(),R(Ge,{key:0},[ya(N(Ut(Q))+"% uploading ("+N(Q.processed)+"/"+N(Q.total)+") ",1)],64)):(C(),R(Ge,{key:1},[ya(N(Q.filePaths.length)+" file"+N(Q.filePaths.length===1?"":"s"),1)],64))]),m("button",{class:"thread-composer-folder-chip-remove",type:"button","aria-label":`Remove folder ${Q.name}`,disabled:fe.value,onClick:Ie=>Qt(Q.id)},"×",8,TS)]))),128))])):ie("",!0),ye.value.length>0?(C(),R("div",kS,[(C(!0),R(Ge,null,Vt(ye.value,Q=>(C(),R("span",{key:Q.fsPath,class:"thread-composer-file-chip"},[Ne(Hs,{class:"thread-composer-file-chip-icon"}),m("span",{class:"thread-composer-file-chip-name",title:Q.fsPath},N(Q.label),9,SS),m("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${Q.label}`,disabled:fe.value,onClick:Ie=>qt(Q.fsPath)},"×",8,CS)]))),128))])):ie("",!0),c.value.length>0?(C(),R("div",xS,[(C(!0),R(Ge,null,Vt(c.value,Q=>(C(),R("span",{key:Q.path,class:"thread-composer-skill-chip"},[m("span",AS,N(Q.displayName||Q.name),1),m("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${Q.displayName||Q.name}`,onClick:Ie=>Wn(Q.path)},"×",8,ES)]))),128))])):ie("",!0),m("div",{class:it(["thread-composer-input-wrap",{"thread-composer-input-wrap--drag-active":q.value}]),onDragenter:gr,onDragover:Nt,onDragleave:$n,onDrop:gn},[q.value?(C(),R("div",IS,[...B[5]||(B[5]=[m("span",{class:"thread-composer-drop-overlay-copy"},"Drop images or files",-1)])])):ie("",!0),me.value?(C(),R("div",PS,[Se.value.length>0?(C(!0),R(Ge,{key:0},Vt(Se.value,(Q,Ie)=>(C(),R("button",{key:Q.path,class:it(["thread-composer-file-mention-row",{"is-active":Ie===We.value}]),type:"button",onMousedown:tt(St=>Pr(Q),["prevent"])},[Qn(Q.path)?(C(),R("span",{key:0,class:it(["thread-composer-file-mention-icon-badge",`is-${Nn(Q.path)}`])},N(Qn(Q.path)),3)):bn(Q.path)?(C(),R("span",RS,"↓")):(C(),rt(Hs,{key:2,class:"thread-composer-file-mention-icon-file"})),m("span",$S,[m("span",NS,N(bt(Q.path)),1),on(Q.path)?(C(),R("span",OS,N(on(Q.path)),1)):ie("",!0)])],42,MS))),128)):(C(),R("div",DS,N(T(o)("No matching files")),1))])):ie("",!0),ln(m("textarea",{ref_key:"inputRef",ref:ee,"onUpdate:modelValue":B[0]||(B[0]=Q=>i.value=Q),class:"thread-composer-input",placeholder:Y.value,disabled:fe.value,onInput:yt,onKeydown:yr,onPaste:nn},null,40,LS),[[kn,i.value]])],34),m("div",{class:it(["thread-composer-controls",{"thread-composer-controls--recording":Ze.value}])},[m("div",{ref_key:"attachMenuRootRef",ref:xe,class:"thread-composer-attach"},[m("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":T(o)("Add photos & files"),disabled:fe.value,onClick:lt}," + ",8,jS),Le.value?(C(),R("div",FS,[m("button",{class:"thread-composer-attach-item",type:"button",disabled:fe.value,onClick:Pn},N(T(o)("Add photos & files")),9,US),m("button",{class:"thread-composer-attach-item",type:"button",disabled:fe.value,onClick:Jr},N(T(o)("Add folder")),9,BS),m("button",{class:"thread-composer-attach-item",type:"button",disabled:fe.value,onClick:Vn},N(T(o)("Take photo")),9,qS),B[6]||(B[6]=m("div",{class:"thread-composer-attach-separator"},null,-1)),m("div",HS,[m("span",zS,N(T(o)("In-progress send")),1),m("div",VS,[m("button",{class:it(["thread-composer-attach-mode-button",{"is-active":Ee.value==="steer"}]),type:"button",disabled:fe.value,onClick:B[1]||(B[1]=Q=>Be("steer"))},N(T(o)("Steer")),11,WS),m("button",{class:it(["thread-composer-attach-mode-button",{"is-active":Ee.value==="queue"}]),type:"button",disabled:fe.value,onClick:B[2]||(B[2]=Q=>Be("queue"))},N(T(o)("Queue")),11,GS)])]),B[7]||(B[7]=m("div",{class:"thread-composer-attach-separator"},null,-1)),pe.value?(C(),R("button",{key:0,class:"thread-composer-attach-setting",type:"button",role:"switch","aria-checked":e.selectedSpeedMode==="fast","aria-label":`${T(o)("Fast mode")} ${e.selectedSpeedMode==="fast"?T(o)("enabled"):T(o)("disabled")}`,disabled:Re.value,onClick:pr},[m("span",JS,[m("span",YS,N(T(o)("Fast mode")),1),m("span",QS,N(ve.value),1)]),m("span",{class:it(["thread-composer-attach-switch",{"is-on":e.selectedSpeedMode==="fast","is-busy":e.isUpdatingSpeedMode,"is-disabled":Re.value}])},null,2)],8,KS)):ie("",!0),m("button",{class:"thread-composer-attach-setting",type:"button",role:"switch","aria-checked":Je.value,"aria-label":Je.value?T(o)("Disable plan mode"):T(o)("Enable plan mode"),disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onClick:Kr},[m("span",ZS,[m("span",e1,N(T(o)("Plan mode")),1),m("span",t1,N(T(o)("Agent proposes a plan before acting")),1)]),m("span",{class:it(["thread-composer-attach-switch",{"is-on":Je.value}])},null,2)],8,XS)])):ie("",!0)],512),Ze.value?ie("",!0):(C(),R(Ge,{key:0},[Ne(qa,{class:"thread-composer-control","model-value":e.selectedModel,options:De.value,"selected-prefix-icon":ue.value?ji:null,placeholder:T(o)("Model"),"open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"enable-search":"","search-placeholder":T(o)("Search models..."),"onUpdate:modelValue":sr},null,8,["model-value","options","selected-prefix-icon","placeholder","disabled","search-placeholder"]),Ne(xf,{class:"thread-composer-control",options:z.value,"selected-values":E.value,placeholder:T(o)("Skills"),"search-placeholder":T(o)("Search skills..."),"open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:Xn},null,8,["options","selected-values","placeholder","search-placeholder","disabled"]),Ne(xf,{class:"thread-composer-control",options:ne.value,"selected-values":[],placeholder:T(o)("Prompt"),"display-label-override":T(o)("Prompt"),"search-placeholder":T(o)("Search prompt..."),"create-label":T(o)("Add new prompt"),"allow-remove":!0,"remove-label":T(o)("Remove prompt"),"open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:Zr,onCreate:It,onRemove:go},null,8,["options","placeholder","display-label-override","search-placeholder","create-label","remove-label","disabled"]),Ne(qa,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:_e,placeholder:T(o)("Thinking"),"open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":kr},null,8,["model-value","placeholder","disabled"])],64)),m("div",{class:it(["thread-composer-actions",{"thread-composer-actions--recording":Ze.value}])},[T(te)==="recording"?(C(),R("div",n1,[m("canvas",{ref_key:"dictationWaveformCanvasRef",ref:V,class:"thread-composer-dictation-waveform"},null,512)])):ie("",!0),T(te)==="recording"?(C(),R("span",r1,N(U.value),1)):ie("",!0),T(H)?(C(),R("button",{key:2,class:it(["thread-composer-mic",{"thread-composer-mic--active":T(te)==="recording"}]),type:"button","aria-label":D.value,title:D.value,disabled:fe.value,onClick:zn,onPointerdown:Sr,onPointerup:Ft,onPointercancel:Ft},[T(te)==="recording"?(C(),rt(Cf,{key:0,class:"thread-composer-mic-icon thread-composer-mic-icon--stop"})):(C(),rt(Uk,{key:1,class:"thread-composer-mic-icon"}))],42,o1)):ie("",!0),e.isTurnInProgress&&!he.value?(C(),R("button",{key:3,class:"thread-composer-stop",type:"button","aria-label":e.isStopPending?T(o)("Saving thread before stop is available"):T(o)("Stop"),title:e.isStopPending?T(o)("Saving thread before stop is available"):T(o)("Stop"),disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn||e.isStopPending,onClick:hr},[e.isStopPending?(C(),R("span",s1)):(C(),rt(Cf,{key:1,class:"thread-composer-stop-icon"}))],8,a1)):(C(),R("button",{key:4,class:it(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&Ee.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&Ee.value==="queue"?T(o)("Queue message"):T(o)("Send message"),title:e.isTurnInProgress?`${T(o)("Send")} ${Ee.value==="queue"?T(o)("Queue"):T(o)("Steer")}`:T(o)("Send"),disabled:!J.value,onClick:B[3]||(B[3]=Q=>Me(e.isTurnInProgress?Ee.value:"steer"))},[Ne($k,{class:"thread-composer-submit-icon"})],10,i1))],2)],2)],2),m("input",{ref_key:"photoLibraryInputRef",ref:Z,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:fe.value,onChange:vn},null,40,l1),m("input",{ref_key:"cameraCaptureInputRef",ref:Ae,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:fe.value,onChange:ur},null,40,u1),m("input",{ref_key:"folderPickerInputRef",ref:He,class:"thread-composer-hidden-input",type:"file",multiple:"",webkitdirectory:"",directory:"",disabled:fe.value,onChange:Jn},null,40,c1)],32))}}),Af=At(h1,[["__scopeId","data-v-a53702ef"]]),p1={key:0,class:"thread-pending-request"},m1={class:"thread-pending-request-title"},v1=["title"],g1={class:"thread-pending-request-approval"},y1=["aria-label"],w1=["aria-pressed","onClick"],b1={class:"thread-pending-request-option-index"},_1={class:"thread-pending-request-option-label"},T1={class:"thread-pending-request-footer thread-pending-request-footer--approval"},k1=["value","placeholder"],S1={class:"thread-pending-request-header"},C1={class:"thread-pending-request-heading"},x1={class:"thread-pending-request-eyebrow"},A1={class:"thread-pending-request-title"},E1={key:0,class:"thread-pending-request-counter"},I1={key:0,class:"thread-pending-request-preview"},P1={class:"thread-pending-request-preview-code"},M1={key:1,class:"thread-pending-request-user-input"},R1={key:0,class:"thread-pending-request-question-description"},$1=["href"],N1={class:"thread-pending-request-question-title"},O1={key:0},D1={key:0,class:"thread-pending-request-question-text"},L1={key:1,class:"thread-pending-request-input-wrap"},j1={class:"thread-pending-request-select-label"},F1=["type","value","onInput"],U1={key:2,class:"thread-pending-request-select-wrap"},B1={class:"thread-pending-request-select-label"},q1=["value","onChange"],H1={key:0,value:""},z1={value:"true"},V1={value:"false"},W1={key:3,class:"thread-pending-request-select-wrap"},G1={class:"thread-pending-request-select-label"},K1=["value","onChange"],J1={key:0,value:""},Y1=["value"],Q1={key:4,class:"thread-pending-request-question-options"},X1=["checked","onChange"],Z1={class:"thread-pending-request-checkbox-label"},eC={key:2,class:"thread-pending-request-validation-error"},tC={class:"thread-pending-request-footer"},nC={key:2,class:"thread-pending-request-user-input"},rC={class:"thread-pending-request-question-title"},oC={key:0,class:"thread-pending-request-question-text"},aC={key:1,class:"thread-pending-request-question-options"},sC={class:"thread-pending-request-select-wrap"},iC={class:"thread-pending-request-select-label"},lC=["value","onChange"],uC=["value"],cC={key:0,class:"thread-pending-request-question-description"},dC={key:2,class:"thread-pending-request-input-wrap"},fC={class:"thread-pending-request-select-label"},hC=["value","placeholder","onInput"],pC={class:"thread-pending-request-footer"},mC={key:3,class:"thread-pending-request-actions"},vC={key:4,class:"thread-pending-request-actions"},gC=Bn({__name:"ThreadPendingRequestPanel",props:{request:{},requestCount:{},hasQueueAbove:{type:Boolean}},emits:["respondServerRequest"],setup(e,{emit:t}){const n=e,r=t,a=I("accept"),o=I(""),i=I({}),l=I({}),c=I({}),f=I(""),{t:h}=ea();function v(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 U=(Array.isArray(D.commandActions)?D.commandActions:[]).map(Y=>v(Y)).map(Y=>b(Y==null?void 0:Y.command)).find(Y=>Y.length>0);if(U)return U.replace(/\s+/g," ").trim();if(Array.isArray(D.command)){const Y=D.command.filter(he=>typeof he=="string").map(he=>he.trim()).filter(he=>he.length>0);if(Y.length>0)return Y.map(he=>j(he)).join(" ")}return xe(b(D.command))}function te(D){return D.method==="item/commandExecution/requestApproval"||D.method==="execCommandApproval"}function H(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)||H(D)||O(D)}function X(D){return D.method==="mcpServer/elicitation/request"}function Ce(D){const F=v(D.params);return b(F==null?void 0:F.reason)||b(F==null?void 0:F.prompt)||b(F==null?void 0:F.message)}function Oe(D){return V(D)?"Awaiting approval":X(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 ce(D){const F=Ce(D);return F||(te(D)?"Do you want to run this command?":H(D)?"Do you want to make these changes?":O(D)?"Do you want to grant these permissions?":X(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 xe(D){var Me;const F=D.trim();if(!F)return"";const U=F.match(/-Command\s+(.+)$/i),Y=((Me=U==null?void 0:U[1])==null?void 0:Me.trim())??F;return(Y.startsWith('"')&&Y.endsWith('"')?Y.slice(1,-1):Y).replace(/\\"/g,'"').replace(/`"/g,'"').replace(/""/g,'"').replace(/\s+/g," ").trim()}function Z(D){const F=v(D.params);if(!F)return"";if(te(D))return q(F);if(H(D)){const U=b(F.grantRoot)||b(F.grant_root);if(U)return U.replace(/\s+/g," ").trim();const Y=v(F.fileChanges)??v(F.changes);if(!Y)return"";const he=Object.keys(Y).map(Me=>Me.trim()).filter(Me=>Me.length>0);return he.length===0?"":he.slice(0,3).join(", ")}return O(D)?Ae(F.permissions):X(D)?b(F.serverName)||b(F.url):""}function Ae(D){const F=v(D);if(!F)return"";const U=[],Y=v(F.fileSystem),he=v(F.network),Me=Array.isArray(Y==null?void 0:Y.read)?Y.read.filter(Ye=>typeof Ye=="string"):[],Be=Array.isArray(Y==null?void 0:Y.write)?Y.write.filter(Ye=>typeof Ye=="string"):[];return Me.length>0&&U.push(`Read: ${Me.join(", ")}`),Be.length>0&&U.push(`Write: ${Be.join(", ")}`),(he==null?void 0:he.enabled)===!0&&U.push("Network access"),U.join(" • ")}function He(D){return!D||!V(D)?[]:[{id:"accept",label:"Yes"},{id:"acceptForSession",label:"Yes for Session"}]}const ee=ae(()=>He(n.request));vt(()=>{var D;return((D=n.request)==null?void 0:D.id)??0},()=>{var D;o.value="",i.value={},l.value={},c.value={},f.value="",a.value=((D=ee.value[0])==null?void 0:D.id)??"accept"},{immediate:!0}),vt(ee,D=>{var F;a.value!=="decline"&&(D.some(U=>U.id===a.value)||(a.value=((F=D[0])==null?void 0:F.id)??"accept"))},{immediate:!0});function be(D,F){return`${String(D)}:${F}`}function Le(D){const F=v(D.params),U=Array.isArray(F==null?void 0:F.questions)?F.questions:[],Y=[];for(const he of U){const Me=v(he);if(!Me)continue;const Be=b(Me.id);if(!Be)continue;const Ye=Array.isArray(Me.options)?Me.options.map($e=>v($e)).map($e=>({label:b($e==null?void 0:$e.label),description:b($e==null?void 0:$e.description)})).filter($e=>$e.label.length>0):[];Y.push({id:Be,header:b(Me.header),question:b(Me.question),isOther:Me.isOther===!0,options:Ye})}return Y}function Ke(D,F,U){const Y=be(D,F),he=i.value[Y];return typeof he=="string"&&he.length>0?he:U}function Ue(D,F){return l.value[be(D,F)]??""}function Se(D,F,U){const Y=U.target;if(!(Y instanceof HTMLSelectElement))return;const he=be(D,F);i.value={...i.value,[he]:Y.value}}function me(D,F,U){const Y=U.target;if(!(Y instanceof HTMLInputElement))return;const he=be(D,F);l.value={...l.value,[he]:Y.value}}function We(D,F,U){var he,Me;const Y=Ke(D,F,((he=U[0])==null?void 0:he.label)||"");return((Me=U.find(Be=>Be.label===Y))==null?void 0:Me.description)??""}function nt(D,F){return`${String(D)}:${F}`}function ze(D){var F;return b((F=v(D.params))==null?void 0:F.serverName)}function je(D){var U;const F=b((U=v(D.params))==null?void 0:U.url);if(!F)return"";try{const Y=new URL(F),he=Y.protocol.toLowerCase();return he==="https:"||he==="http:"?Y.toString():""}catch{return""}}function dt(D){const F=v(D.params),U=v(F==null?void 0:F.requestedSchema),Y=v(U==null?void 0:U.properties);if(!Y)return[];const he=new Set(Array.isArray(U==null?void 0:U.required)?U.required.filter(Me=>typeof Me=="string"):[]);return Object.entries(Y).map(([Me,Be])=>ft(Me,v(Be),he.has(Me))).filter(Me=>Me!==null)}function ft(D,F,U){if(!F)return null;const Y=b(F.title)||D,he=b(F.description),Me=b(F.type);if(Me==="boolean")return{key:D,label:Y,description:he,required:U,kind:"boolean",inputType:"checkbox",options:[],defaultValue:typeof F.default=="boolean"?F.default:null,hasExplicitDefault:typeof F.default=="boolean"};if(Me==="number"||Me==="integer")return{key:D,label:Y,description:he,required:U,kind:"number",inputType:"number",options:[],defaultValue:typeof F.default=="number"?F.default:null,hasExplicitDefault:typeof F.default=="number"};const Be=et(F);if(Me==="array")return{key:D,label:Y,description:he,required:U,kind:"multiEnum",inputType:"checkbox",options:Be,defaultValue:Array.isArray(F.default)?F.default.filter($e=>typeof $e=="string"):[],hasExplicitDefault:Array.isArray(F.default)};const Ye=x(F.default);return Be.length>0?{key:D,label:Y,description:he,required:U,kind:"singleEnum",inputType:"select",options:Be,defaultValue:Ye,hasExplicitDefault:Ye!==null}:{key:D,label:Y,description:he,required:U,kind:"string",inputType:ct(F),options:[],defaultValue:Ye,hasExplicitDefault:Ye!==null}}function et(D){const U=(Array.isArray(D.oneOf)?D.oneOf:Array.isArray(D.anyOf)?D.anyOf:[]).map(Be=>v(Be)).map(Be=>({value:b(Be==null?void 0:Be.const),label:b(Be==null?void 0:Be.title)||b(Be==null?void 0:Be.const)})).filter(Be=>Be.value.length>0);if(U.length>0)return U;const Y=v(D.items);if(Y){const Be=et(Y);if(Be.length>0)return Be}const he=Array.isArray(D.enum)?D.enum.filter(Be=>typeof Be=="string"):[],Me=Array.isArray(D.enumNames)?D.enumNames.filter(Be=>typeof Be=="string"):[];return he.map((Be,Ye)=>({value:Be,label:Me[Ye]||Be}))}function ct(D){const F=b(D.format);return F==="email"?"email":F==="uri"?"url":F==="date"?"date":F==="date-time"?"datetime-local":"text"}function K(D,F){const U=c.value[nt(D,F.key)];return U!==void 0?U:F.defaultValue}function _e(D,F){const U=K(D,F);return Array.isArray(U)?U.filter(Y=>typeof Y=="string"):[]}function we(D,F,U){const Y=U.target;if(!(Y instanceof HTMLInputElement)&&!(Y instanceof HTMLSelectElement))return;const he=Y.value,Me=(F.kind==="number",he);c.value={...c.value,[nt(D,F.key)]:he.length>0?Me:null},f.value=""}function De(D,F,U){const Y=U.target;if(!(Y instanceof HTMLSelectElement))return;let he=null;Y.value==="true"?he=!0:Y.value==="false"&&(he=!1),c.value={...c.value,[nt(D,F.key)]:he},f.value=""}function Je(D,F,U,Y){const he=Y.target;if(!(he instanceof HTMLInputElement))return;const Me=new Set(_e(D,F));he.checked?Me.add(U):Me.delete(U),c.value={...c.value,[nt(D,F.key)]:Array.from(Me)},f.value=""}function k(D){return D===!0?"true":D===!1?"false":""}function E(D,F){const U=K(D,F);return F.kind==="multiEnum"?Array.isArray(U)&&U.length>0:F.kind==="boolean"?typeof U=="boolean":F.kind==="number"&&typeof U=="number"?!0:typeof U=="string"&&U.trim().length>0}function z(D){const F=dt(D).filter(U=>U.required&&!E(D.id,U)).map(U=>U.label);return F.length===0?"":F.length===1?`Answer the required field: ${F[0]}.`:`Answer the required fields: ${F.join(", ")}.`}function ne(D){const F={};for(const U of dt(D)){const Y=K(D.id,U);if(U.kind==="multiEnum"){const Me=Array.isArray(Y)?Y:[];(Me.length>0||U.required)&&(F[U.key]=Me);continue}if(U.kind==="boolean"){typeof Y=="boolean"&&(F[U.key]=Y);continue}if(U.kind==="number"){const Me=typeof Y=="number"?Y:Number(String(Y).trim());Number.isNaN(Me)||(F[U.key]=Me);continue}const he=String(Y??"").trim();(he.length>0||U.required)&&(F[U.key]=he)}return F}function J(D){a.value=D}function oe(){a.value="decline"}function ye(D){const F=D.target;F instanceof HTMLInputElement&&(o.value=F.value,a.value="decline")}function fe(D,F){var U;if(O(D)){if(F==="decline"||F==="cancel"){r("respondServerRequest",{id:D.id,error:{code:-32e3,message:F==="cancel"?"Cancelled from CodexUI.":"Declined from CodexUI."}});return}const Y=v((U=v(D.params))==null?void 0:U.permissions)??{};r("respondServerRequest",{id:D.id,result:{permissions:Y,scope:F==="acceptForSession"?"session":"turn"}});return}r("respondServerRequest",{id:D.id,result:{decision:F}})}function pe(D){const F=o.value.trim(),U=F.length>0?"decline":a.value;if(O(D)){fe(D,U);return}r("respondServerRequest",{id:D.id,result:{decision:U},followUpMessageText:F||void 0})}function ue(D,F){const U=v(D.params),Y={action:F};if(F==="accept"&&b(U==null?void 0:U.mode)==="form"){const he=z(D);if(he){f.value=he;return}Y.content=ne(D)}r("respondServerRequest",{id:D.id,result:Y})}function Re(D){var Y;const F=Le(D),U={};for(const he of F){const Me=Ke(D.id,he.id,((Y=he.options[0])==null?void 0:Y.label)||""),Be=Ue(D.id,he.id).trim(),Ye=[Me,Be].map($e=>$e.trim()).filter($e=>$e.length>0);U[he.id]={answers:Ye}}r("respondServerRequest",{id:D.id,result:{answers:U}})}function ve(D){r("respondServerRequest",{id:D.id,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from CodexUI."}]}})}function Pe(D){r("respondServerRequest",{id:D.id,result:{success:!0,contentItems:[]}})}function Ee(D){r("respondServerRequest",{id:D.id,result:{}})}function Ze(D){r("respondServerRequest",{id:D.id,error:{code:-32e3,message:"Rejected from CodexUI."}})}return(D,F)=>e.request?(C(),R("section",p1,[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",m1,N(ce(e.request)),1),Z(e.request)?(C(),R("p",{key:0,class:"thread-pending-request-command-line",title:Z(e.request)},N(Z(e.request)),9,v1)):ie("",!0),m("section",g1,[m("div",{class:"thread-pending-request-options",role:"radiogroup","aria-label":T(h)("Approval choices")},[(C(!0),R(Ge,null,Vt(ee.value,(U,Y)=>(C(),R("button",{key:U.id,type:"button",class:it(["thread-pending-request-option",{"is-selected":a.value===U.id}]),"aria-pressed":a.value===U.id,onClick:he=>J(U.id)},[m("span",b1,N(Y+1)+".",1),m("span",_1,N(U.label),1)],10,w1))),128))],8,y1),m("footer",T1,[m("label",{class:it(["thread-pending-request-inline-input",{"is-active":a.value==="decline"||o.value.length>0}])},[F[11]||(F[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:T(h)("No, and tell Codex what to do differently"),onFocus:oe,onInput:ye,onKeydown:F[0]||(F[0]=un(tt(U=>pe(e.request),["prevent"]),["enter"]))},null,40,k1)],2),m("button",{type:"button",class:"thread-pending-request-secondary",onClick:F[1]||(F[1]=U=>fe(e.request,"cancel"))},N(T(h)("Skip")),1),m("button",{type:"button",class:"thread-pending-request-primary",onClick:F[2]||(F[2]=U=>pe(e.request))},N(T(h)("Send")),1)])])],64)):(C(),R(Ge,{key:1},[m("header",S1,[m("div",C1,[m("p",x1,N(Oe(e.request)),1),m("p",A1,N(ce(e.request)),1)]),(e.requestCount??0)>1?(C(),R("span",E1,N(e.requestCount??0)+" pending",1)):ie("",!0)]),Z(e.request)?(C(),R("div",I1,[m("code",P1,N(Z(e.request)),1)])):ie("",!0),e.request.method==="mcpServer/elicitation/request"?(C(),R("section",M1,[ze(e.request)?(C(),R("p",R1,N(T(h)("Server"))+": "+N(ze(e.request)),1)):ie("",!0),je(e.request)?(C(),R("a",{key:1,class:"thread-pending-request-link",href:je(e.request),target:"_blank",rel:"noopener noreferrer"},N(T(h)("Open authorization link")),9,$1)):ie("",!0),(C(!0),R(Ge,null,Vt(dt(e.request),U=>(C(),R("div",{key:`${e.request.id}:${U.key}`,class:"thread-pending-request-question"},[m("p",N1,[ya(N(U.label),1),U.required?(C(),R("span",O1," *")):ie("",!0)]),U.description?(C(),R("p",D1,N(U.description),1)):ie("",!0),U.kind==="string"||U.kind==="number"?(C(),R("label",L1,[m("span",j1,N(T(h)("Value")),1),m("input",{class:"thread-pending-request-input",type:U.inputType,value:String(K(e.request.id,U)??""),onInput:Y=>we(e.request.id,U,Y)},null,40,F1)])):U.kind==="boolean"?(C(),R("label",U1,[m("span",B1,N(T(h)("Choice")),1),m("select",{class:"thread-pending-request-select",value:k(K(e.request.id,U)),onChange:Y=>De(e.request.id,U,Y)},[U.hasExplicitDefault?ie("",!0):(C(),R("option",H1,N(T(h)("Select true or false")),1)),m("option",z1,N(T(h)("True")),1),m("option",V1,N(T(h)("False")),1)],40,q1)])):U.kind==="singleEnum"?(C(),R("label",W1,[m("span",G1,N(T(h)("Choice")),1),m("select",{class:"thread-pending-request-select",value:String(K(e.request.id,U)??""),onChange:Y=>we(e.request.id,U,Y)},[U.hasExplicitDefault?ie("",!0):(C(),R("option",J1,N(T(h)("Select an option")),1)),(C(!0),R(Ge,null,Vt(U.options,Y=>(C(),R("option",{key:`${e.request.id}:${U.key}:${Y.value}`,value:Y.value},N(Y.label),9,Y1))),128))],40,K1)])):(C(),R("div",Q1,[(C(!0),R(Ge,null,Vt(U.options,Y=>(C(),R("label",{key:`${e.request.id}:${U.key}:${Y.value}`,class:"thread-pending-request-checkbox-row"},[m("input",{class:"thread-pending-request-checkbox",type:"checkbox",checked:_e(e.request.id,U).includes(Y.value),onChange:he=>Je(e.request.id,U,Y.value,he)},null,40,X1),m("span",Z1,N(Y.label),1)]))),128))]))]))),128)),f.value?(C(),R("p",eC,N(f.value),1)):ie("",!0),m("footer",tC,[m("button",{type:"button",class:"thread-pending-request-secondary",onClick:F[3]||(F[3]=U=>ue(e.request,"cancel"))},N(T(h)("Cancel")),1),m("button",{type:"button",class:"thread-pending-request-secondary",onClick:F[4]||(F[4]=U=>ue(e.request,"decline"))},N(T(h)("Decline")),1),m("button",{type:"button",class:"thread-pending-request-primary",onClick:F[5]||(F[5]=U=>ue(e.request,"accept"))},N(T(h)("Continue")),1)])])):e.request.method==="item/tool/requestUserInput"?(C(),R("section",nC,[(C(!0),R(Ge,null,Vt(Le(e.request),U=>{var Y;return C(),R("div",{key:`${e.request.id}:${U.id}`,class:"thread-pending-request-question"},[m("p",rC,N(U.header||U.question),1),U.question?(C(),R("p",oC,N(U.question),1)):ie("",!0),U.options.length>0?(C(),R("div",aC,[m("label",sC,[m("span",iC,N(T(h)("Choice")),1),m("select",{class:"thread-pending-request-select",value:Ke(e.request.id,U.id,((Y=U.options[0])==null?void 0:Y.label)||""),onChange:he=>Se(e.request.id,U.id,he)},[(C(!0),R(Ge,null,Vt(U.options,he=>(C(),R("option",{key:`${e.request.id}:${U.id}:${he.label}`,value:he.label},N(he.label),9,uC))),128))],40,lC)]),We(e.request.id,U.id,U.options)?(C(),R("p",cC,N(We(e.request.id,U.id,U.options)),1)):ie("",!0)])):ie("",!0),U.isOther?(C(),R("label",dC,[m("span",fC,N(T(h)("Other answer")),1),m("input",{class:"thread-pending-request-input",type:"text",value:Ue(e.request.id,U.id),placeholder:T(h)("Other answer"),onInput:he=>me(e.request.id,U.id,he)},null,40,hC)])):ie("",!0)])}),128)),m("footer",pC,[m("button",{type:"button",class:"thread-pending-request-primary",onClick:F[6]||(F[6]=U=>Re(e.request))},N(T(h)("Send")),1)])])):e.request.method==="item/tool/call"?(C(),R("section",mC,[m("button",{type:"button",class:"thread-pending-request-primary",onClick:F[7]||(F[7]=U=>ve(e.request))},N(T(h)("Fail Tool Call")),1),m("button",{type:"button",class:"thread-pending-request-secondary",onClick:F[8]||(F[8]=U=>Pe(e.request))},N(T(h)("Success (Empty)")),1)])):(C(),R("section",vC,[m("button",{type:"button",class:"thread-pending-request-primary",onClick:F[9]||(F[9]=U=>Ee(e.request))},N(T(h)("Return Empty Result")),1),m("button",{type:"button",class:"thread-pending-request-secondary",onClick:F[10]||(F[10]=U=>Ze(e.request))},N(T(h)("Reject Request")),1)]))],64))],2)])):ie("",!0)}}),yC=At(gC,[["__scopeId","data-v-72a9d2d9"]]),wC={key:0,class:"queued-messages"},bC={class:"queued-messages-inner"},_C=["onDragstart","onDragover","onDragleave","onDrop"],TC=["aria-label","title"],kC={class:"queued-row-text"},SC={class:"queued-row-actions"},CC=["title","onClick"],xC=["title","onClick"],AC=["aria-label","title","onClick"],EC=Bn({__name:"QueuedMessages",props:{messages:{}},emits:["edit","steer","delete","reorder"],setup(e,{emit:t}){const n=t,{t:r}=ea(),a=I(""),o=I("");function i(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 v(b){var O,V,X;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,H=((X=b.skills)==null?void 0:X.length)??0;return q>0&&j.push(`${q} ${r(q===1?"image":"images")}`),te>0&&j.push(`${te} ${r(te===1?"file":"files")}`),H>0&&j.push(`${H} ${r(H===1?"skill":"skills")}`),j.join(", ")||r("(empty queued message)")}return(b,x)=>e.messages.length>0?(C(),R("div",wC,[m("div",bC,[(C(!0),R(Ge,null,Vt(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=>i(q,j.id),onDragover:tt(q=>l(j.id),["prevent"]),onDragleave:q=>c(j.id),onDrop:tt(q=>f(j.id),["prevent"]),onDragend:h},[m("button",{class:"queued-row-drag",type:"button","aria-label":T(r)("Drag to reorder queued message"),title:T(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,TC),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",kC,N(v(j)),1),m("div",SC,[m("button",{class:"queued-row-edit",type:"button",title:T(r)("Edit queued message"),onClick:q=>b.$emit("edit",j.id)},N(T(r)("Edit")),9,CC),m("button",{class:"queued-row-steer",type:"button",title:T(r)("Send now without interrupting work"),onClick:q=>b.$emit("steer",j.id)},N(T(r)("Steer")),9,xC),m("button",{class:"queued-row-delete",type:"button","aria-label":T(r)("Delete queued message"),title:T(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,AC)])],42,_C))),128))])])):ie("",!0)}}),IC=At(EC,[["__scopeId","data-v-b7a3edb8"]]),PC={key:0,class:"rate-limit-status","aria-live":"polite"},MC=["title"],RC={class:"rate-limit-card-header"},$C={class:"rate-limit-card-title"},NC={key:0,class:"rate-limit-card-plan"},OC={class:"rate-limit-card-metrics"},DC={key:0,class:"rate-limit-card-footer"},LC=Bn({__name:"RateLimitStatus",props:{snapshots:{}},setup(e){function t(H){var O,V;return((O=H.limitId)==null?void 0:O.trim())||((V=H.limitName)==null?void 0:V.trim())||"__default__"}function n(H){var O,V;return((O=H.limitName)==null?void 0:O.trim())||((V=H.limitId)==null?void 0:V.trim())||"Rate limits"}function r(H){const O=H.trim();return O?O.replace(/[_-]+/g," ").replace(/\b\w/g,V=>V.toUpperCase()):""}function a(H){return!H||H<=0?"Window":H%1440===0?`${H/1440}d`:H%60===0?`${H/60}h`:H<60?`${H}m`:`${Math.round(H/60*10)/10}h`}function o(H){const O=Math.max(0,Math.min(100,100-H));return`${Math.round(O)}% left`}function i(H){return`${Math.round(H)}%`}function l(H,O){return{key:O,label:`${a(H.windowDurationMins)} ${o(H.usedPercent)}`}}function c(H){const O=[];return H.primary&&O.push(l(H.primary,"primary")),H.secondary&&O.push(l(H.secondary,"secondary")),O}function f(H){if(!H)return"";const O=new Date(H*1e3),V=O.getMonth()+1,X=String(O.getDate()).padStart(2,"0"),Ce=String(O.getHours()).padStart(2,"0"),Oe=String(O.getMinutes()).padStart(2,"0");return`${V}.${X} ${Ce}:${Oe}`}function h(H){if(!(H!=null&&H.resetsAt))return"";const O=H.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 X=Math.round(V/60);return X<24?`Resets in ${X}h`:`Resets in ${Math.round(X/24)}d`}function v(H){return[H.primary,H.secondary].filter(O=>O!==null)}function b(H){const O=v(H);return O.length===0?null:[...O].sort((V,X)=>{const Ce=V.windowDurationMins??Number.MAX_SAFE_INTEGER,Oe=X.windowDurationMins??Number.MAX_SAFE_INTEGER;return Ce!==Oe?Ce-Oe:(V.resetsAt??Number.MAX_SAFE_INTEGER)-(X.resetsAt??Number.MAX_SAFE_INTEGER)})[0]}function x(H){const O=v(H);if(O.length===0)return"";const V=[...O].sort((Ce,Oe)=>{const ce=Ce.windowDurationMins??-1,xe=Oe.windowDurationMins??-1;return ce!==xe?xe-ce:(Oe.resetsAt??-1)-(Ce.resetsAt??-1)})[0],X=f(V.resetsAt);return X||""}function j(H){const O=H.credits;return O?O.unlimited?"Unlimited credits":O.balance?`Credits ${O.balance}`:O.hasCredits?"Credits available":"":""}function q(H){return[h(b(H)),x(H),j(H)].filter(O=>O.length>0)}function te(H){const O=[n(H)];for(const V of c(H))O.push(V.label);for(const V of v(H))O.push(`${a(V.windowDurationMins)} used ${i(V.usedPercent)}`);for(const V of q(H))O.push(V);return O.join(`
|
|
50
|
-
`)}return(H,O)=>e.snapshots.length>0?(C(),R("aside",PC,[(C(!0),R(Ge,null,Vt(e.snapshots,V=>(C(),R("div",{key:t(V),class:"rate-limit-card",title:te(V)},[m("div",RC,[m("span",$C,N(n(V)),1),V.planType?(C(),R("span",NC,N(r(V.planType)),1)):ie("",!0)]),m("div",OC,[(C(!0),R(Ge,null,Vt(c(V),X=>(C(),R("span",{key:X.key,class:"rate-limit-card-metric"},N(X.label),1))),128))]),q(V).length>0?(C(),R("div",DC,N(q(V).join(" | ")),1)):ie("",!0)],8,MC))),128))])):ie("",!0)}}),jC=At(LC,[["__scopeId","data-v-df88906b"]]),FC=["aria-label"],UC=["aria-checked","onClick"],BC={class:"runtime-toggle-option-label"},qC=Bn({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,{t:r}=ea(),a=[{value:"local",label:r("Local project"),icon:xc},{value:"worktree",label:r("New worktree"),icon:Cs}];function o(i){n("update:modelValue",i)}return(i,l)=>(C(),R("div",{class:"runtime-toggle",role:"radiogroup","aria-label":T(r)("Continue in")},[(C(),R(Ge,null,Vt(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(hc(c.icon),{class:"runtime-toggle-option-icon"})),m("span",BC,N(c.label),1)],10,UC)),64))],8,FC))}}),HC=At(qC,[["__scopeId","data-v-0f175c28"]]),zC={},VC={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 WC(e,t){return C(),R("svg",VC,[...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 GC=At(zC,[["render",WC]]),KC={},JC={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function YC(e,t){return C(),R("svg",JC,[...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 QC=At(KC,[["render",YC]]),XC={class:"sidebar-thread-controls"},ZC=["aria-label","title"],ex=["aria-label","title"],tx=Bn({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){const{t}=ea();return(n,r)=>(C(),R("div",XC,[m("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?T(t)("Expand sidebar"):T(t)("Collapse sidebar"),title:e.isSidebarCollapsed?T(t)("Expand sidebar"):T(t)("Collapse sidebar"),onClick:r[0]||(r[0]=a=>n.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(C(),rt(QC,{key:0,class:"sidebar-thread-controls-icon"})):(C(),rt(GC,{key:1,class:"sidebar-thread-controls-icon"}))],8,ZC),ho(n.$slots,"default",{},void 0),e.showNewThreadButton?(C(),R("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":T(t)("Start new thread"),title:T(t)("Start new thread"),onClick:r[1]||(r[1]=a=>n.$emit("start-new-thread"))},[Ne(Hs,{class:"sidebar-thread-controls-icon"})],8,ex)):ie("",!0)]))}}),Ef=At(tx,[["__scopeId","data-v-2369affb"]]),nx={},rx={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function ox(e,t){return C(),R("svg",rx,[...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 If=At(nx,[["render",ox]]),ax={},sx={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function ix(e,t){return C(),R("svg",sx,[...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 lx=At(ax,[["render",ix]]),ux={},cx={viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"};function dx(e,t){return C(),R("svg",cx,[...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 fx=At(ux,[["render",dx]]),hx={},px={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function mx(e,t){return C(),R("svg",px,[...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 vx=At(hx,[["render",mx]]);function Tr(e){return e.flatMap(t=>t.threads)}const Up="codex-web-local.thread-read-state.v1",Bp="codex-web-local.thread-scroll-state.v1",qp="codex-web-local.thread-token-usage.v1",Hp="codex-web-local.thread-terminal-open.v1",Ku="codex-web-local.selected-thread-id.v1",Ju="codex-web-local.selected-model-by-context.v1",zp="codex-web-local.selected-model-id.v1",Vp="codex-web-local.project-order.v1",Wp="codex-web-local.project-display-name.v1",Yu="codex-web-local.collaboration-mode-by-context.v1",Gp="codex-web-local.collaboration-mode.v1",Eo="__new-thread__",Kp="__new-thread-provider__::",_u=220,gx=1e4,yx=500,wx=3e3,bx=2e3,Pf=["none","minimal","low","medium","high","xhigh"],Na="__global__",Fr="gpt-5.4-mini";function _x(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Up);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function Mf(e){typeof window>"u"||window.localStorage.setItem(Up,JSON.stringify(e))}function Qu(e){return e==="plan"?"plan":"default"}function ns(e){return typeof e=="string"?e.trim():""}function Br(){return Object.create(null)}function xs(e){const t=Br();for(const[n,r]of Object.entries(e))t[n]=r;return t}function Fi(e,t){if(!(t in e))return e;const n=Br();for(const[r,a]of Object.entries(e))r!==t&&(n[r]=a);return n}function Rf(e,t){let n=!1;const r=Br();for(const[a,o]of Object.entries(e)){if(a===Eo||a.startsWith(Kp)||t.has(a)){r[a]=o;continue}n=!0}return n?r:e}function Jp(e){return e.trim().toLowerCase()||"codex"}function Tu(e){const t=Jp(e);return`${Kp}${t}`}function Ja(e){return e.trim()||Eo}function Tx(){if(typeof window>"u")return Br();try{const n=window.localStorage.getItem(Ju);if(n){const r=JSON.parse(n);if(!r||typeof r!="object"||Array.isArray(r))return Br();const a=Br();for(const[o,i]of Object.entries(r)){if(typeof o!="string"||o.length===0)continue;const l=ns(i);l&&(a[o]=l)}return a}}catch{}const e=ns(window.localStorage.getItem(zp)),t=Br();return e&&(t[Eo]=e),t}function $f(e,t){const n=Ja(t),r=ns(e[n]);return r||ns(e[Eo])}function Ai(e){if(!(typeof window>"u"))try{Object.keys(e).length===0?window.localStorage.removeItem(Ju):window.localStorage.setItem(Ju,JSON.stringify(e)),window.localStorage.removeItem(zp)}catch{}}function kx(){if(typeof window>"u")return Br();try{const n=window.localStorage.getItem(Yu);if(n){const r=JSON.parse(n);if(!r||typeof r!="object"||Array.isArray(r))return Br();const a=Br();for(const[o,i]of Object.entries(r)){if(typeof o!="string"||o.length===0)continue;const l=Qu(i);l==="plan"&&(a[o]=l)}return a}}catch{}const e=Qu(window.localStorage.getItem(Gp)),t=Br();return e==="plan"&&(t[Eo]="plan"),t}function ks(e,t){const n=Ja(t);return Qu(e[n])}function Nf(e,t,n){const r=Ja(t);if(n==="plan"){const a=xs(e);return a[r]="plan",a}return Fi(e,r)}function ku(e){if(!(typeof window>"u"))try{Object.keys(e).length===0?window.localStorage.removeItem(Yu):window.localStorage.setItem(Yu,JSON.stringify(e)),window.localStorage.removeItem(Gp)}catch{}}function Ki(e,t,n){return Math.min(Math.max(e,t),n)}function Sx(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=Ki(t.scrollRatio,0,1)),n}function Cx(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Bp);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=Sx(a);o&&(n[r]=o)}return n}catch{return{}}}function Of(e){typeof window>"u"||window.localStorage.setItem(Bp,JSON.stringify(e))}function Fa(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 Df(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;return{totalTokens:Fa(t.totalTokens)??0,inputTokens:Fa(t.inputTokens)??0,cachedInputTokens:Fa(t.cachedInputTokens)??0,outputTokens:Fa(t.outputTokens)??0,reasoningOutputTokens:Fa(t.reasoningOutputTokens)??0}}function xx(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=Df(t.total),r=Df(t.last);if(!n||!r)return null;const a=Fa(t.modelContextWindow),o=r.totalTokens,i=typeof a=="number"?Math.max(a-o,0):null,l=typeof a=="number"&&a>0?Ki(Math.round((i??0)/a*100),0,100):null;return{total:n,last:r,modelContextWindow:a,currentContextTokens:o,remainingContextTokens:i,remainingContextPercent:l}}function Ax(){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=xx(a);o&&(n[r]=o)}return n}catch{return{}}}function Lf(e){typeof window>"u"||window.localStorage.setItem(qp,JSON.stringify(e))}function Ex(){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))r&&typeof a=="boolean"&&(n[r]=a);return n}catch{return{}}}function Ix(e){typeof window>"u"||window.localStorage.setItem(Hp,JSON.stringify(e))}function Px(){return typeof window>"u"?"":window.localStorage.getItem(Ku)??""}function Mx(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Ku);return}window.localStorage.setItem(Ku,e)}}function Rx(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Vp);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=Js(r);a.length>0&&!n.includes(a)&&n.push(a)}return n}catch{return[]}}function Oa(e){typeof window>"u"||window.localStorage.setItem(Vp,JSON.stringify(e))}function $x(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Wp);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"?Js(r):"";o.length>0&&typeof a=="string"&&(n[o]=a)}return n}catch{return{}}}function Su(e){typeof window>"u"||window.localStorage.setItem(Wp,JSON.stringify(e))}function Ei(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 Ko(e,n)?e:n}function Cu(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 Ko(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 Nx(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 Ox(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function Dx(e=[],t=[]){var n,r,a,o;if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1)if(((n=e[i])==null?void 0:n.step)!==((r=t[i])==null?void 0:r.step)||((a=e[i])==null?void 0:a.status)!==((o=t[i])==null?void 0:o.status))return!1;return!0}function Lx(e,t){return!e&&!t?!0:!e||!t?!1:e.explanation===t.explanation&&e.isStreaming===t.isStreaming&&Dx(e.steps,t.steps)}function Ii(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 Xu(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Ko(e.images,t.images)&&Fx(e.fileChanges,t.fileChanges)&&e.fileChangeStatus===t.fileChangeStatus&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&Ox(e.commandExecution,t.commandExecution)&&Lx(e.plan,t.plan)&&e.turnId===t.turnId&&e.turnIndex===t.turnIndex&&e.isAutomationRun===t.isAutomationRun&&e.automationDisplayName===t.automationDisplayName}function Ha(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 jx(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 v=r.get(h.id);return v&&Xu(v,h)?v:h});if(n.preserveMissing!==!0)return Ha(e,o)?e:o;const i=e.map(h=>{const v=a.get(h.id);return!v||Xu(h,v)?h:v}),l=new Set(e.map(h=>h.id)),c=o.filter(h=>!l.has(h.id)),f=[...i,...c];return Ha(e,f)?e:f}function Fx(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 Zu(e){return e.replace(/\s+/gu," ").trim()}function Ux(e,t){const n=new Set(t.map(o=>o.id)),r=new Set(t.filter(o=>o.role==="assistant").map(o=>Zu(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 i=Zu(o.text);return i.length===0?!1:!r.has(i)});return a.length===e.length?e:a}function Pi(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Xu(r,t))return e;const a=[...e];return a.splice(n,1,t),a}const Yp="worked";function zo(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function Bx(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 i=a>0||o.length===0?a:0;return o.push(`${i}s`),o.join(" ")}function qx(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function Hx(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 zx(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${Bx(e.durationMs)}`,messageType:Yp,turnId:e.turnId}}function Vx(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function Wx(e,t){const n=zx(t),r=e.filter(i=>i.messageType!==Yp),a=Vx(r);if(a<0)return[...r,n];const o=[...r];return o.splice(a,0,n),o}function Ct(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function Gx(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 Kx(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 Jx(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 Yx(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 Jt(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function Mi(e,t){const n=new Map(e.map(a=>[a.projectName,a])),r=t.map(a=>{const o=n.get(a.projectName),i=new Map((o==null?void 0:o.threads.map(c=>[c.id,c]))??[]),l=a.threads.map(c=>{const f=i.get(c.id);return f&&Kx(f,c)?f:c});return o&&o.projectName===a.projectName&&Jx(o.threads,l)?o:{projectName:a.projectName,threads:l}});return Yx(e,r)?e:r}function Qx(e,t,n){const r=new Set(Tr(t).map(l=>l.id)),a=Tr(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])),i=t.map(l=>({projectName:l.projectName,threads:[...l.threads]}));for(const l of a){if(o.get(l.projectName)){const f=i.findIndex(h=>h.projectName===l.projectName);f>=0&&(i[f]={projectName:i[f].projectName,threads:[l,...i[f].threads]});continue}i.push({projectName:l.projectName,threads:[l]})}return i}function Vo(e){return Js(e)}function Xx(e){const t=e.split(`
|
|
51
|
-
`).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function Zx(e){const t=e.trim()||"Untitled thread";return/^fork:\s+/iu.test(t)?t:`Fork: ${t}`}function eA(e){return e.threads.some(t=>t.cwd.trim().length===0)}function tA(e,t){if(!t||t.order.length===0)return e;const n=new Set(t.order.map(r=>Vo(r)));return e.filter(r=>n.has(r.projectName)||eA(r))}function nA(){const e=I([]),t=I([]),n=I(Px()),r=I({}),a=I({}),o=I({}),i=I({}),l=I({}),c=I({}),f=I({}),h=I({}),v=I({});let b=!1;const x=I({}),j=I([]),q=I([{value:"default",label:"Default"},{value:"plan",label:"Plan"}]),te=I(kx()),H=I(Tx()),O=I(ks(te.value,n.value)),V=I($f(H.value,n.value)),X=I("medium"),Ce=I("standard"),Oe=I(""),ce=I(_x()),xe=I(Cx()),Z=I(Rx()),Ae=I($x()),He=I({}),ee=I({}),be=I({}),Le=I({}),Ke=I({}),Ue=I({}),Se=I({}),me=I({}),We=I({}),nt=I({}),ze=I({}),je=I({}),dt=I({}),ft=I(null),et=I(Ax()),ct=I(Ex()),K=I({}),_e=I([]),we=I([]),De=I(!1),Je=I(!1),k=I(!1),E=I(!1),z=I(!1),ne=I(!1),J=I(""),oe=I(!1),ye=I(!1);function fe(s){var u;try{const p=new URL(s,"http://localhost");return p.pathname!=="/codex-local-image"?"":((u=p.searchParams.get("path"))==null?void 0:u.trim())??""}catch{return""}}function pe(s){const u=s.trim().toLowerCase();return u?/\b(attached image|attached screenshot|save the attached|copy (the )?screenshot|save screenshot)\b/i.test(u):!1}function ue(s){var p;const u=r.value[s]??[];for(let y=u.length-1;y>=0;y-=1){const A=u[y];if(!(A.role!=="user"||!Array.isArray(A.images)||A.images.length===0))for(let $=A.images.length-1;$>=0;$-=1){const L=((p=A.images[$])==null?void 0:p.trim())??"";if(L&&fe(L))return L}}return""}let Re=null,ve=null,Pe=null;const Ee=new Map;let Ze=null;const D=new Map;let F=null,U=null,Y=!1;const he=new Set,Me=new Map;let Be=null,Ye=null,$e=!1,gt=!1,Hn=[],mn=null,vo=!1,Ot=!1;const hr=new Map,sr=new Set,Kr=ae(()=>Tr(e.value)),kr=ae(()=>Kr.value.find(s=>s.id===n.value)??null),pr=ae(()=>xe.value[n.value]??null),zn=ae(()=>{const s=n.value;return!!(s&&ct.value[s]===!0)}),Sr=ae(()=>{const s=n.value;return s?We.value[s]===!0:!1}),Ft=ae(()=>{const s=[],u=n.value;return u&&Array.isArray(je.value[u])&&s.push(...je.value[u]),Array.isArray(je.value[Na])&&s.push(...je.value[Na]),s.sort((p,y)=>p.receivedAtIso.localeCompare(y.receivedAtIso))}),lt=ae(()=>{var $;const s=n.value;if(!s)return null;const u=f.value[s]===!0,p=u?Ue.value[s]:void 0,y=u?(i.value[s]??"").trim():"",A=((($=Se.value[s])==null?void 0:$.message)??"").trim();return!p&&!y&&!A?null:{activityLabel:(p==null?void 0:p.label)||"Thinking",activityDetails:(p==null?void 0:p.details)??[],reasoningText:y,errorText:A}}),Pn=ae(()=>ft.value),Vn=ae(()=>{const s=n.value;return s?et.value[s]??null:null}),Jr=ae(()=>{const s=n.value;if(!s)return[];const u=r.value[s]??[],p=a.value[s]??[],y=o.value[s]??[],A=l.value[s]??[],$=c.value[s]??[],L=[...u,...p,...A,...$,...y],G=Ke.value[s];return G?Wx(L,G):L});function Wt(s){if(Ja(s)===Eo){const p=Tu(Oe.value),y=p?ns(H.value[p]):"";if(y)return y}return $f(H.value,s).trim()}function Wn(...s){const u=[...j.value];for(const p of s){const y=p.trim();y&&!u.includes(y)&&u.push(y)}Ko(j.value,u)||(j.value=u)}function qt(s){n.value!==s&&(n.value=s,Mx(s),V.value=Wt(s),Wn(V.value),O.value=ks(te.value,s),Ot=!1)}function Qt(s,u){const p=u.trim(),y=Ja(s);if(p){const A=xs(H.value);A[y]=p,H.value=A}else H.value=Fi(H.value,y);if(s.trim()===n.value?(V.value=Wt(n.value),Wn(V.value)):Wn(p),y===Eo){const A=Tu(Oe.value);if(A)if(p){const $=xs(H.value);$[A]=p,H.value=$}else H.value=Fi(H.value,A)}Ai(H.value)}function Ut(s){Qt(n.value,s)}function xt(s,u){const p=s.trim();if(!p)return;const y=u.trim();if(y){const A=xs(H.value);A[p]=y,H.value=A}else H.value=Fi(H.value,p);Wn(y),n.value===p&&(V.value=Wt(n.value)),Ai(H.value)}function Gt(s,u){const p=s.trim();if(!p)return;if(!u){if(!(p in et.value))return;et.value=Ct(et.value,p),Lf(et.value);return}const y=et.value[p];y&&JSON.stringify(y)===JSON.stringify(u)||(et.value={...et.value,[p]:u},Lf(et.value))}function mr(s){const u=s==="plan"?"plan":"default",p=Ja(n.value);ks(te.value,n.value)===u&&O.value===u||(O.value=u,te.value=Nf(te.value,p,u),ku(te.value))}function ir(s,u){const p=u==="plan"?"plan":"default";te.value=Nf(te.value,s,p),s.trim()===n.value&&(O.value=p),ku(te.value)}function Ir(s){ft.value=s}async function Mn(s=n.value){s.trim()?xt(s,Fr):Ut(Fr),Wn(Fr)}function en(s,u){dt.value={...dt.value,[s]:u}}function vr(s){dt.value[s]&&(dt.value=Ct(dt.value,s))}async function lr(s){if(sr.has(s))return;const u=dt.value[s];if(!(!u||u.fallbackRetried)){sr.add(s),en(s,{...u,fallbackRetried:!0});try{await Mn(s);try{const p=await pu(s,1);Nn(s,p),mt(s),bn(s,[]),Ht(s),l.value[s]&&(l.value=Ct(l.value,s))}catch{}It(s,null),J.value="",nn(s,null),kt(s,{label:"Thinking",details:Sn(Fr,u.effort,u.collaborationMode)}),yt(s,!0),be.value[s]!==!0&&await hu(s),await mu(s,u.text,u.imageUrls,Fr,u.effort||void 0,u.skills.length>0?u.skills:void 0,u.fileAttachments,u.collaborationMode),be.value={...be.value,[s]:!0},Cr(),he.add(s),await Lr()}catch(p){const y=p instanceof Error?p.message:"Unknown application error";It(s,y),J.value=y,yt(s,!1),kt(s,null)}finally{sr.delete(s)}}}function Yr(s){s&&!Pf.includes(s)||(X.value=s)}async function Gn(s){const u=s==="fast"?"fast":"standard";if(z.value||Ce.value===u)return;const p=Ce.value;Ce.value=u,z.value=!0,J.value="";try{await Wb(u)}catch(y){Ce.value=p,J.value=y instanceof Error?y.message:"Failed to update Fast mode"}finally{z.value=!1}}async function Rn(){try{const s=await Xb();q.value=s,s.some(u=>u.value===O.value)||mr("default")}catch{}}function Sn(s,u,p=O.value){const y=s.trim()||"default",A=u||"default",$=p==="plan"?"Plan":"Default",L=Ce.value==="fast"?"Fast":"Standard";return[`Mode: ${$}`,`Model: ${y}`,`Thinking: ${A}`,`Speed: ${L}`]}async function Kn(s){try{const[u,p]=await Promise.all([Rp({includeProviderModels:(s==null?void 0:s.includeProviderModels)!==!1}),$p()]),y=Wt(n.value),A=p.model.trim(),$=Jp(p.providerId);Oe.value=$;const L=Tu($),G=L?ns(H.value[L]):"",se=[...u];if(!(s!=null&&s.providerChanged))for(const Ve of[y,A])Ve&&!se.includes(Ve)&&se.push(Ve);j.value=se;const de=y&&u.includes(y);if((!y||!de||s!=null&&s.providerChanged)&&(s!=null&&s.providerChanged&&se.length>0?G&&se.includes(G)?Ut(G):A&&se.includes(A)?Ut(A):Ut(se[0]):A&&se.includes(A)?Ut(p.model):se.length>0?Ut(se[0]):Ut("")),L&&V.value.trim().length>0){const Ve=xs(H.value);Ve[L]=V.value.trim(),H.value=Ve,Ai(H.value)}p.reasoningEffort&&Pf.includes(p.reasoningEffort)&&(X.value=p.reasoningEffort),Ce.value=p.speedMode}catch{}}async function tn(){if(U){await U;return}U=(async()=>{try{const s=await $b();Ir(s),we.value=s?[s]:[]}catch{}finally{U=null}})(),await U}function Cr(){if(typeof window>"u"){tn();return}Pe!==null&&window.clearTimeout(Pe),Pe=window.setTimeout(()=>{Pe=null,tn()},yx)}function Cn(s){if(!s||typeof window>"u")return;const u=Ee.get(s);u!==void 0&&(window.clearTimeout(u),Ee.delete(s))}function Qr(s){if(!s||typeof window>"u")return;Cn(s);const u=window.setTimeout(()=>{Ee.delete(s),he.add(s),Lr()},wx);Ee.set(s,u)}function vn(s){const u=K.value;return Object.keys(u).length===0?s:s.map(p=>({projectName:p.projectName,threads:p.threads.map(y=>{const A=u[y.id];return A?{...y,title:A}:y})}))}function ur(s){return s?Array.isArray(je.value[s])?je.value[s]:[]:[]}function Jn(s){return s==="item/commandExecution/requestApproval"||s==="item/fileChange/requestApproval"||s==="item/permissions/requestApproval"||s==="execCommandApproval"||s==="applyPatchApproval"}function gr(s){return s.some(u=>Jn(u.method))?"approval":s.length>0?"response":null}function Nt(){const u=vn(t.value).map(p=>({projectName:p.projectName,threads:p.threads.map(y=>{const A=f.value[y.id]===!0,$=gr(ur(y.id)),L=n.value===y.id,G=ce.value[y.id],se=x.value[y.id]===!0,de=!L&&!A&&(se||G!==y.updatedAtIso);return{...y,inProgress:A,unread:de,pendingRequestState:$}})}));e.value=Mi(e.value,u)}function $n(s,u,p){const y=new Date().toISOString(),A=jt(u),$=Js(A),L={id:s,title:Xx(p),projectName:$,cwd:A,hasWorktree:A.includes("/.codex/worktrees/")||A.includes("/.git/worktrees/"),createdAtIso:y,updatedAtIso:y,preview:p,unread:!1,inProgress:!1},G=t.value.findIndex(de=>de.projectName===$);if(G>=0){const Ve=t.value[G].threads.filter(Tt=>Tt.id!==s),ht={projectName:$,threads:[L,...Ve]},pt=[...t.value];pt.splice(G,1,ht),t.value=pt}else t.value=[{projectName:$,threads:[L]},...t.value];const se=Ei(Z.value,t.value);Ko(Z.value,se)||(Z.value=se,Oa(Z.value)),Nt()}function gn(s){const u=new Set(s.map(de=>de.id)),p=n.value.trim();p&&u.add(p);const y=Rf(H.value,u);y!==H.value&&(H.value=y,V.value=Wt(n.value),Wn(V.value),Ai(y));const A=Rf(te.value,u);A!==te.value&&(te.value=A,O.value=ks(A,n.value),ku(A));const $=Jt(ce.value,u);$!==ce.value&&(ce.value=$,Mf($));const L=Jt(xe.value,u);L!==xe.value&&(xe.value=L,Of(L)),ee.value=Jt(ee.value,u),He.value=Jt(He.value,u),be.value=Jt(be.value,u),Le.value=Jt(Le.value,u),r.value=Jt(r.value,u),o.value=Jt(o.value,u),i.value=Jt(i.value,u),l.value=Jt(l.value,u),c.value=Jt(c.value,u),Ke.value=Jt(Ke.value,u),Ue.value=Jt(Ue.value,u),Se.value=Jt(Se.value,u),me.value=Jt(me.value,u),We.value=Jt(We.value,u),nt.value=Jt(nt.value,u),ze.value=Jt(ze.value,u);const G=Jt(h.value,u);G!==h.value&&(h.value=G,no()),et.value=Jt(et.value,u),x.value=Jt(x.value,u),f.value=Jt(f.value,u);const se={};for(const[de,Ve]of Object.entries(je.value))(de===Na||u.has(de))&&(se[de]=Ve);je.value=se}function yn(s){const u=Tr(t.value).find(p=>p.id===s);u&&(ce.value={...ce.value,[s]:u.updatedAtIso},Mf(ce.value),x.value[s]&&(x.value=Ct(x.value,s)),Nt())}function nn(s,u){if(!s)return;const p=Ke.value[s];if(u){if(qx(p,u))return;Ke.value={...Ke.value,[s]:u}}else p&&(Ke.value=Ct(Ke.value,s))}function yt(s,u){!s||f.value[s]===!0===u||(u?f.value={...f.value,[s]:!0}:(f.value=Ct(f.value,s),cn(s),yr(s)),Nt(),!u&&!Fo()&&Be&&cs())}function yr(s){s&&(We.value[s]&&(We.value=Ct(We.value,s)),nt.value[s]&&(nt.value=Ct(nt.value,s)),ze.value[s]&&(ze.value=Ct(ze.value,s)))}function rn(s){s&&(We.value={...We.value,[s]:!0},nt.value[s]&&(nt.value=Ct(nt.value,s)),ze.value[s]&&(ze.value=Ct(ze.value,s)))}function Yn(s){s&&We.value[s]===!0&&nt.value[s]===!0&&ze.value[s]===!0&&yr(s)}function wr(s,u){!s||!u||We.value[s]===!0&&yr(s)}function Pr(s){const u=Object.keys(We.value);if(u.length===0)return;let p=nt.value,y=!1;for(const A of u)!s.has(A)||p[A]===!0||(p={...p,[A]:!0},y=!0);if(y){nt.value=p;for(const A of u)Yn(A)}}function Xr(s,u){s&&We.value[s]===!0&&u.some(p=>p.role==="user")&&(ze.value[s]!==!0&&(ze.value={...ze.value,[s]:!0}),Yn(s))}function wn(s){s&&s!==n.value&&x.value[s]!==!0&&(x.value={...x.value,[s]:!0},Nt())}function kt(s,u){if(!s)return;const p=Ue.value[s];if(!u){p&&(Ue.value=Ct(Ue.value,s));return}const y=Or(u.label)||"Thinking",A=u.details.map(G=>Or(G)).filter(G=>G.length>0&&G!==y),$=Array.from(new Set([...(p==null?void 0:p.details)??[],...A])).slice(-3),L={label:y,details:$};Hx(p,L)||(Ue.value={...Ue.value,[s]:L})}function It(s,u,p={}){if(!s)return;const y=Se.value[s],A=u?Zu(u):"";if(!A){y&&(Se.value=Ct(Se.value,s));return}const $=p.transient===!0;(y==null?void 0:y.message)===A&&y.transient===$||(Se.value={...Se.value,[s]:{message:A,transient:$}})}function go(s){var u;s&&(u=Se.value[s])!=null&&u.transient&&It(s,null)}function Zr(){const s=Object.entries(Se.value).filter(([,p])=>p==null?void 0:p.transient).map(([p])=>p);if(s.length===0)return;let u=Se.value;for(const p of s)u=Ct(u,p);Se.value=u}function bt(s){const u=Tr(t.value).find(p=>p.id===s);return(u==null?void 0:u.updatedAtIso)??""}function on(s,u){if(!s)return;const p={scrollTop:Math.max(0,u.scrollTop),isAtBottom:u.isAtBottom===!0};typeof u.scrollRatio=="number"&&Number.isFinite(u.scrollRatio)&&(p.scrollRatio=Ki(u.scrollRatio,0,1));const y=xe.value[s];y&&y.scrollTop===p.scrollTop&&y.isAtBottom===p.isAtBottom&&y.scrollRatio===p.scrollRatio||(xe.value={...xe.value,[s]:p},Of(xe.value))}function an(s,u){if(!s)return;const p={...ct.value};u?p[s]=!0:delete p[s],ct.value=p,Ix(p)}function Qn(){const s=n.value;s&&an(s,!zn.value)}function Nn(s,u){const p=r.value[s]??[];Ha(p,u)||(r.value={...r.value,[s]:u})}function bn(s,u){const p=o.value[s]??[];Ha(p,u)||(o.value={...o.value,[s]:u})}function Xn(s){s&&s in o.value&&(o.value=Ct(o.value,s))}function br(s,u){const p=c.value[s]??[];Ha(p,u)||(c.value={...c.value,[s]:u})}function M(s,u){const p=a.value[s]??[];Ha(p,u)||(a.value={...a.value,[s]:u})}function B(s,u){const p=a.value[s]??[],y=Pi(p,u);M(s,y)}function Q(s,u){const p=o.value[s]??[],y=Pi(p,u);bn(s,y)}function Ie(s,u){const p=c.value[s]??[],y=Pi(p,u);br(s,y)}function St(s,u){if(!s)return;const p=u.trim(),y=i.value[s]??"";if(p.length===0){if(!y)return;i.value=Ct(i.value,s);return}y!==p&&(i.value={...i.value,[s]:p})}function Xt(s,u){if(!s)return;const p=i.value[s]??"";St(s,`${p}${u}`)}function Ht(s){s&&s in i.value&&(i.value=Ct(i.value,s))}function mt(s){s&&s in a.value&&(a.value=Ct(a.value,s))}function Kt(s){s&&s in c.value&&(c.value=Ct(c.value,s))}function cn(s){s&&(mt(s),Ht(s),kt(s,null),n.value,l.value[s]&&(l.value=Ct(l.value,s)),me.value[s]&&(me.value=Ct(me.value,s)),vr(s))}function Mr(s){return s==="completed"?"completed":s==="inProgress"||s==="in_progress"?"inProgress":"pending"}function Do(s){var p;const u=[];(p=s.explanation)!=null&&p.trim()&&u.push(s.explanation.trim());for(const y of s.steps){const A=y.status==="completed"?"x":y.status==="inProgress"?"~":" ";u.push(`- [${A}] ${y.step}`)}return u.join(`
|
|
52
|
-
`).trim()}function Rr(s){if(s.method!=="turn/plan/updated")return null;const u=qe(s.params),p=zt(s),y=ke(u==null?void 0:u.turnId)||ke(u==null?void 0:u.turn_id),$=(Array.isArray(u==null?void 0:u.plan)?u==null?void 0:u.plan:[]).map(se=>qe(se)).map(se=>({step:ke(se==null?void 0:se.step),status:Mr(se==null?void 0:se.status)})).filter(se=>se.step.length>0);if(!p||!y)return null;const G={explanation:ke(u==null?void 0:u.explanation).trim()||void 0,steps:$,isStreaming:!0};return{threadId:p,message:{id:`${y}:plan`,role:"assistant",text:Do(G),messageType:"plan.live",plan:G}}}function Zn(s){if(s.method!=="item/plan/delta")return null;const u=qe(s.params),p=zt(s),y=ke(u==null?void 0:u.turnId)||ke(u==null?void 0:u.turn_id),A=ke(u==null?void 0:u.delta);if(!p||!y||!A)return null;const $=`${y}:plan`,L=(a.value[p]??[]).find(de=>de.id===$),G=`${(L==null?void 0:L.text)??""}${A}`,se=L!=null&&L.plan?{...L.plan,isStreaming:!0}:void 0;return{threadId:p,message:{id:$,role:"assistant",text:G,messageType:"plan.live",plan:se}}}function qe(s){return s!==null&&typeof s=="object"&&!Array.isArray(s)?s:null}function ke(s){return typeof s=="string"?s:""}function Dt(s){return typeof s=="number"&&Number.isFinite(s)?s:null}function _n(s){const u=qe(s);if(!u)return null;const p=Dt(u.totalTokens??u.total_tokens),y=Dt(u.inputTokens??u.input_tokens),A=Dt(u.cachedInputTokens??u.cached_input_tokens),$=Dt(u.outputTokens??u.output_tokens),L=Dt(u.reasoningOutputTokens??u.reasoning_output_tokens);return p===null||y===null||A===null||$===null||L===null?null:{totalTokens:p,inputTokens:y,cachedInputTokens:A,outputTokens:$,reasoningOutputTokens:L}}function xn(s){const u=qe(s);if(!u)return null;const p=_n(u.total),y=_n(u.last);if(!p||!y)return null;const A=Dt(u.modelContextWindow??u.model_context_window),$=y.totalTokens,L=typeof A=="number"?Math.max(A-$,0):null,G=typeof A=="number"&&A>0?Ki(Math.round((L??0)/A*100),0,100):null;return{total:p,last:y,modelContextWindow:A,currentContextTokens:$,remainingContextTokens:L,remainingContextPercent:G}}function ta(s){if(s.method!=="thread/tokenUsage/updated")return null;const u=qe(s.params),p=zt(s),y=xn((u==null?void 0:u.tokenUsage)??(u==null?void 0:u.token_usage));return!p||!y?null:{threadId:p,usage:y}}function zt(s){const u=qe(s.params);if(!u)return"";const p=ke(u.threadId);if(p)return p;const y=ke(u.thread_id);if(y)return y;const A=ke(u.conversationId);if(A)return A;const $=ke(u.conversation_id);if($)return $;const L=qe(u.thread),G=ke(L==null?void 0:L.id);if(G)return G;const se=qe(u.turn),de=ke(se==null?void 0:se.threadId);if(de)return de;const Ve=ke(se==null?void 0:se.thread_id);return Ve||""}function cr(s){if(s.method!=="turn/completed")return"";const u=qe(s.params),p=qe(u==null?void 0:u.turn);if(!p||p.status!=="failed")return"";const y=qe(p.error);return ke(y==null?void 0:y.message)}function $r(s){var y;if(s.method!=="error")return null;const u=qe(s.params),p=ke(u==null?void 0:u.message)||ke((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(s){const u=qe(s);if(!u)return null;const p=u.id,y=ke(u.method),A=u.params;if(typeof p!="number"||!Number.isInteger(p)||!y)return null;const $=qe(A),L=eo(y,$),G=ke($==null?void 0:$.threadId)||ke($==null?void 0:$.thread_id)||ke($==null?void 0:$.conversationId)||ke($==null?void 0:$.conversation_id)||Na,se=ke($==null?void 0:$.turnId)||ke($==null?void 0:$.turn_id),de=ke($==null?void 0:$.itemId)||ke($==null?void 0:$.item_id)||ke($==null?void 0:$.callId)||ke($==null?void 0:$.call_id),Ve=ke(u.receivedAtIso)||new Date().toISOString();return{id:p,method:L,threadId:G,turnId:se,itemId:de,receivedAtIso:Ve,params:A??null}}function eo(s,u){const p=s.trim();return p&&(p==="item/commandExecution/requestApproval"||p==="execCommandApproval"||p==="exec_approval_request"||to(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"||S(u)?"item/tool/call":p)}function to(s){if(!s)return!1;const u=s.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(s.commandActions)}function w(s){return s?typeof s.grantRoot=="string"&&s.grantRoot.trim().length>0||typeof s.grant_root=="string"&&s.grant_root.trim().length>0||qe(s.fileChanges)?!0:qe(s.changes)!==null:!1}function _(s){return!!(s&&Array.isArray(s.questions))}function S(s){return s?typeof s.toolName=="string"||typeof s.tool_name=="string"||typeof s.name=="string"||Array.isArray(s.arguments):!1}function W(s){if(!s)return!1;const u=ke(s.mode);return typeof s.serverName=="string"&&typeof s.threadId=="string"&&typeof s.message=="string"&&(u==="form"||u==="url")}function Fe(s){return s?typeof s.threadId=="string"&&typeof s.turnId=="string"&&typeof s.itemId=="string"&&qe(s.permissions)!==null:!1}function _t(s){if(s.method!=="item/tool/requestUserInput")return[];const u=qe(s.params),p=Array.isArray(u==null?void 0:u.questions)?u.questions:[],y=[];for(const A of p){const $=qe(A),L=ke($==null?void 0:$.id).trim();L&&y.push(L)}return y}function wt(s){const u=s.threadId||Na,p=je.value[u]??[],y=p.findIndex($=>$.id===s.id),A=[...p];y>=0?A.splice(y,1,s):A.push(s),je.value={...je.value,[u]:A.sort(($,L)=>$.receivedAtIso.localeCompare(L.receivedAtIso))},Nt()}function Tn(s){const u={};for(const[p,y]of Object.entries(je.value)){const A=y.filter($=>$.id!==s);A.length>0&&(u[p]=A)}je.value=u,Nt()}function On(s){const u={};for(const p of s){const y=p.threadId||Na,A=u[y]??[];A.push(p),u[y]=A}for(const p of Object.values(u))p.sort((y,A)=>y.receivedAtIso.localeCompare(A.receivedAtIso));je.value=u}function er(s){if(s.method==="server/request"){const u=Nr(s.params);return u&&wt(u),!0}if(s.method==="server/request/resolved"){const u=qe(s.params),p=u==null?void 0:u.id;return typeof p=="number"&&Number.isInteger(p)&&Tn(p),!0}return!1}function Or(s){return s.replace(/\s+/gu," ").trim()}function Dr(s){const u=zt(s);if(!u)return null;if(s.method==="turn/started")return{threadId:u,activity:{label:"Thinking",details:[]}};if(s.method==="item/started"){const p=qe(s.params),y=qe(p==null?void 0:p.item),A=ke(y==null?void 0:y.type).toLowerCase();if(A==="reasoning")return{threadId:u,activity:{label:"Thinking",details:[]}};if(A==="agentmessage")return{threadId:u,activity:{label:"Writing response",details:[]}};if(A==="commandexecution"){const $=ke(y==null?void 0:y.command);return{threadId:u,activity:{label:"Running command",details:$?[$]:[]}}}if(A==="filechange"){const L=(Array.isArray(y==null?void 0:y.changes)?y.changes:[])[0],G=ke(L==null?void 0:L.path);return{threadId:u,activity:{label:"Applying changes",details:G?[G]:[]}}}}return s.method==="item/commandExecution/outputDelta"?{threadId:u,activity:{label:"Running command",details:[]}}:s.method==="item/fileChange/outputDelta"?{threadId:u,activity:{label:"Applying changes",details:[]}}:s.method==="item/reasoning/summaryTextDelta"||s.method==="item/reasoning/summaryPartAdded"?{threadId:u,activity:{label:"Thinking",details:[]}}:s.method==="item/agentMessage/delta"?{threadId:u,activity:{label:"Writing response",details:[]}}:null}function na(s){if(s.method!=="turn/started")return null;const u=qe(s.params);if(!u)return null;const p=zt(s);if(!p)return null;const y=qe(u.turn),A=ke(y==null?void 0:y.id)||ke(u.turnId)||`${p}:unknown`;if(!A)return null;const $=zo(ke(y==null?void 0:y.startedAt))??zo(ke(u.startedAt))??zo(s.atIso)??Date.now();return{threadId:p,turnId:A,startedAtMs:$}}function Lo(s){if(s.method!=="turn/completed")return null;const u=qe(s.params);if(!u)return null;const p=zt(s);if(!p)return null;const y=qe(u.turn),A=ke(y==null?void 0:y.id)||ke(u.turnId)||`${p}:unknown`;if(!A)return null;const $=zo(ke(y==null?void 0:y.completedAt))??zo(ke(u.completedAt))??zo(s.atIso)??Date.now(),L=zo(ke(y==null?void 0:y.startedAt))??zo(ke(u.startedAt))??void 0;return{threadId:p,turnId:A,completedAtMs:$,startedAtMs:L}}function ba(s){return`${s}:live-reasoning`}function Ys(s){const u=r.value[s]??[];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 An(s,u,p){if(!s||!u||!Number.isInteger(p)||p<0)return;const y=Le.value[s]??{};y[u]!==p&&(Le.value={...Le.value,[s]:{...y,[u]:p}})}function fl(s,u){const p=Le.value[s]??{},y=Object.entries(p),A=Object.entries(u);y.length===A.length&&y.every(([$,L])=>u[$]===L)||(Le.value={...Le.value,[s]:{...u}})}function ss(s){const u=c.value[s];if(!u||u.length===0)return;const p=Le.value[s]??{};let y=!1;const A=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,[s]:A})}function _a(s){const u=qe(s.params);if(!u)return"";if(s.method==="item/started"){const p=qe(u.item);return!p||p.type!=="reasoning"?"":ke(p.id)}return""}function hl(s){const u=qe(s.params);if(!u)return null;if(s.method==="item/reasoning/summaryTextDelta"){const p=ke(u.itemId),y=ke(u.delta);return!p||!y?null:{messageId:ba(p),delta:y}}return null}function Qs(s){const u=qe(s.params);if(!u)return"";if(s.method==="item/reasoning/summaryPartAdded"){const p=ke(u.itemId);return p?ba(p):""}return""}function is(s){const u=qe(s.params);if(!u)return"";if(s.method==="item/completed"){const p=qe(u.item);return!p||p.type!=="reasoning"?"":ba(ke(p.id))}return""}function pl(s){const u=qe(s.params);if(!u)return"";if(s.method==="item/started"){const p=qe(u.item);return!p||p.type!=="agentMessage"?"":ke(p.id)}return""}function ls(s){const u=qe(s.params);if(!u)return null;if(s.method==="item/agentMessage/delta"){const p=ke(u.itemId),y=ke(u.delta);return!p||!y?null:{messageId:p,delta:y}}return null}function Ta(s){const u=qe(s.params);if(!u)return null;if(s.method==="item/completed"){const p=qe(u.item);if(!p||p.type!=="agentMessage")return null;const y=ke(p.id),A=ke(p.text);return!y||!A?null:{id:y,role:"assistant",text:A,messageType:"agentMessage.live"}}return null}function ml(s){return`/codex-local-image?path=${encodeURIComponent(s)}`}function Xs(s){const u=s.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 vl(s){if(s.method!=="item/completed")return null;const u=qe(s.params),p=qe(u==null?void 0:u.item);if(!p)return null;const y=ke(p.id);if(!y)return null;if(p.type==="imageView"){const L=ke(p.path);return L?{id:y,role:"assistant",text:"",images:[ml(L)],messageType:"imageView"}:null}if(p.type!=="imageGeneration"&&p.type!=="image_generation")return null;const A=ke(p.result),$=A?Xs(A):"";return $?{id:y,role:"assistant",text:"",images:[$],messageType:"imageView"}:null}function Zs(s){var de;if(s.method!=="item/started")return null;const u=qe(s.params),p=qe(u==null?void 0:u.item);if(!p||p.type!=="commandExecution")return null;const y=ke(p.id),A=ke(p.command);if(!y)return null;const $=typeof p.cwd=="string"?p.cwd:null,L=zt(s),G=ke(u==null?void 0:u.turnId)||ke(u==null?void 0:u.turn_id),se=L&&G?(de=Le.value[L])==null?void 0:de[G]:void 0;return{id:y,role:"system",text:A,messageType:"commandExecution",commandExecution:{command:A,cwd:$,status:"inProgress",aggregatedOutput:"",exitCode:null},turnId:G||void 0,turnIndex:typeof se=="number"?se:void 0}}function gl(s){if(s.method!=="item/commandExecution/outputDelta")return null;const u=qe(s.params);if(!u)return null;const p=ke(u.itemId),y=ke(u.delta);return!p||!y?null:{itemId:p,delta:y}}function yl(s){var Tt;if(s.method!=="item/completed")return null;const u=qe(s.params),p=qe(u==null?void 0:u.item);if(!p||p.type!=="commandExecution")return null;const y=ke(p.id),A=ke(p.command);if(!y)return null;const $=typeof p.cwd=="string"?p.cwd:null,L=ke(p.status),G=L==="failed"?"failed":L==="declined"?"declined":L==="interrupted"?"interrupted":"completed",se=typeof p.aggregatedOutput=="string"?p.aggregatedOutput:"",de=typeof p.exitCode=="number"?p.exitCode:null,Ve=zt(s),ht=ke(u==null?void 0:u.turnId)||ke(u==null?void 0:u.turn_id),pt=Ve&&ht?(Tt=Le.value[Ve])==null?void 0:Tt[ht]:void 0;return{id:y,role:"system",text:A,messageType:"commandExecution",commandExecution:{command:A,cwd:$,status:G,aggregatedOutput:se,exitCode:de},turnId:ht||void 0,turnIndex:typeof pt=="number"?pt:void 0}}function wl(s){var de;if(s.method!=="item/completed")return null;const u=qe(s.params),p=qe(u==null?void 0:u.item);if(!p||p.type!=="fileChange")return null;const y=ke(p.id);if(!y)return null;const A=ke(u==null?void 0:u.threadId),$=ke(u==null?void 0:u.turnId),L=A&&$?(de=Le.value[A])==null?void 0:de[$]:void 0,G=Sp(p.changes),se=kp(p.status);return G.length===0||se!=="completed"?null:{id:y,role:"system",text:"",messageType:"fileChange",fileChangeStatus:se,fileChanges:G,turnId:$||void 0,turnIndex:typeof L=="number"?L:void 0}}function ra(s,u){const p=l.value[s]??[],y=Pi(p,u);y!==p&&(l.value={...l.value,[s]:y})}function us(s,u){const p=l.value[s];if(!p||p.length===0)return;const y=new Set(u.map($=>$.id)),A=p.filter($=>!y.has($.id));A.length!==p.length&&(A.length===0?l.value=Ct(l.value,s):l.value={...l.value,[s]:A})}function ei(s,u){const p=c.value[s];if(!p||p.length===0)return;const y=new Set(u.map(G=>G.id)),A=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&&A.has(G.turnId))&&!(typeof G.turnIndex=="number"&&$.has(G.turnIndex)));L.length!==p.length&&(L.length===0?c.value=Ct(c.value,s):c.value={...c.value,[s]:L})}function bl(s){if(s.method==="item/agentMessage/delta")return!0;const u=qe(s.params);if(!u)return!1;if(s.method==="item/completed"){const p=qe(u.item);return(p==null?void 0:p.type)==="agentMessage"}return!1}function _l(s){var vs,Ea,mi,gs,vi;if(er(s))return;if(s.method==="account/rateLimits/updated"&&Cr(),s.method==="thread/name/updated"){const Xe=qe(s.params),dr=ke(Xe==null?void 0:Xe.threadId),wo=ke(Xe==null?void 0:Xe.threadName);dr&&wo&&(K.value={...K.value,[dr]:wo},Nt(),yu(dr,wo))}if(s.method==="account/rateLimits/updated"){Ir(Ep(s.params));return}const u=ta(s);if(u){Gt(u.threadId,u.usage);return}const p=Dr(s);p&&kt(p.threadId,p.activity);const y=zt(s),A=$r(s);!A&&y&&go(y);const $=na(s);$&&(hr.set($.turnId,$),An($.threadId,$.turnId,Ys($.threadId)),me.value={...me.value,[$.threadId]:$.turnId},wr($.threadId,$.turnId),mt($.threadId),Kt($.threadId),nn($.threadId,null),It($.threadId,null),yt($.threadId,!0),x.value[$.threadId]&&(x.value=Ct(x.value,$.threadId)));const L=Lo(s),G=cr(s),se=(L==null?void 0:L.threadId)??zt(s),de=se?Wt(se):"",Ve=!!se&&!!G&&de!==Fr&&Ii(new Error(G));if(L){dt.value[L.threadId];const Xe=hr.get(L.turnId);Xe&&hr.delete(L.turnId);const dr=Dt((vs=qe(s.params))==null?void 0:vs.durationMs)??Dt((mi=qe((Ea=qe(s.params))==null?void 0:Ea.turn))==null?void 0:mi.durationMs)??(typeof L.startedAtMs=="number"?L.completedAtMs-L.startedAtMs:null)??(Xe?L.completedAtMs-Xe.startedAtMs:null),wo=typeof dr=="number"?Math.max(0,dr):0;nn(L.threadId,{turnId:L.turnId,durationMs:wo}),me.value[L.threadId]&&(me.value=Ct(me.value,L.threadId)),yt(L.threadId,!1),kt(L.threadId,null),wn(L.threadId),Ve||(vr(L.threadId),hs(L.threadId))}if(G){const Xe=(L==null?void 0:L.threadId)||zt(s);Xe&&It(Xe,G),J.value=G,Xe&&Ve&&lr(Xe)}else L&&It(L.threadId,null);if(A){const Xe=y,dr=Xe?Wt(Xe):V.value.trim();Xe&&It(Xe,A.message,{transient:A.transient}),J.value=A.message,dr!==Fr&&Ii(new Error(A.message))&&(Xe?lr(Xe):Mn())}const ht=Rr(s);ht&&(B(ht.threadId,ht.message),kt(ht.threadId,{label:"Planning",details:((gs=ht.message.plan)==null?void 0:gs.steps.map(Xe=>Xe.step).slice(0,2))??[]}));const pt=Zn(s);if(pt&&(B(pt.threadId,pt.message),kt(pt.threadId,{label:"Planning",details:[]})),!y||y!==n.value)return;pl(s);const Tt=ls(s);if(Tt){const Xe=(o.value[y]??[]).find(wo=>wo.id===Tt.messageId),dr=`${(Xe==null?void 0:Xe.text)??""}${Tt.delta}`;Q(y,{id:Tt.messageId,role:"assistant",text:dr,messageType:"agentMessage.live"})}const dn=Ta(s);dn&&Q(y,dn);const jr=vl(s);jr&&Q(y,jr),_a(s);const yo=hl(s);if(yo&&Xt(y,yo.delta),Qs(s)){const Xe=i.value[y]??"";Xe.trim().length>0&&!Xe.endsWith(`
|
|
53
|
-
|
|
54
|
-
`)&&St(y,`${Xe}
|
|
55
|
-
|
|
56
|
-
`)}is(s);const Uo=Zs(s);Uo&&(ra(y,Uo),kt(y,{label:"Running command",details:[((vi=Uo.commandExecution)==null?void 0:vi.command)??""]}));const aa=gl(s);if(aa){const Xe=(l.value[y]??[]).find(dr=>dr.id===aa.itemId);Xe!=null&&Xe.commandExecution&&ra(y,{...Xe,commandExecution:{...Xe.commandExecution,aggregatedOutput:`${Xe.commandExecution.aggregatedOutput}${aa.delta}`}})}const sa=yl(s);sa&&ra(y,sa);const ms=wl(s);if(ms&&Ie(y,ms),bl(s)&&(Ot&&n.value&&on(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),Ht(y)),s.method==="turn/completed"){Ot=!1,Ht(y),l.value[y]&&(l.value=Ct(l.value,y));const Xe=zt(s);Xe&&(yt(Xe,!1),kt(Xe,null),wn(Xe),Ve||(vr(Xe),hs(Xe)))}}function ti(s){if(s.method==="thread/tokenUsage/updated")return;const u=s.method,p=u==="turn/started"||u==="turn/completed"||u==="error",y=u.startsWith("thread/")||u==="turn/completed";if(!p&&!y)return;const A=zt(s);A&&p&&he.add(A),y&&(Y=!0),!(ve!==null||typeof window>"u")&&(ve=window.setTimeout(()=>{ve=null,Lr()},_u))}async function ni(s,u){if(!vo){vo=!0;try{if(!u)return;const p=[];for(const y of u.order){const A=Vo(y);p.includes(A)||p.push(A)}if(p.length>0){const y=Ei(p,s);Ko(Z.value,y)||(Z.value=y,Oa(Z.value))}if(Object.keys(u.labels).length>0){const y={...Ae.value};let A=!1;for(const[$,L]of Object.entries(u.labels)){const G=Vo($);y[G]!==L&&(y[G]=L,A=!0)}A&&(Ae.value=y,Su(y))}}catch{}}}async function Tl(){if(!(Object.keys(K.value).length>0))try{const s=await v0();Object.keys(s.titles).length>0&&(K.value=s.titles)}catch{}}async function oa(){try{return await ja()}catch{return null}}async function kl(s,u,p){if(K.value[s])return;const y=u.trim();if(!y)return;const A=y.length>300?y.slice(0,300):y;try{const $=await _0(A,p);if(!$||K.value[s])return;K.value={...K.value,[s]:$},Nt(),yu(s,$)}catch{}}function ri(s,u){const p=tA(s,u),y=Ei(Z.value,p);Ko(Z.value,y)||(Z.value=y,Oa(Z.value));const A=Cu(p,Z.value);Pr(new Set(Tr(A).map(L=>L.id)));const $=Qx(t.value,A,f.value);t.value=Mi(t.value,$),f.value=Jt(f.value,new Set(Tr(t.value).map(L=>L.id))),Nt()}function oi(s){const u={};for(const[p,y]of Object.entries(s)){const A=p.trim();!A||y.length===0||(u[A]=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 no(){n0(oi(h.value)).catch(()=>{})}async function jo(){if(!b){b=!0;try{h.value=await t0()}catch{}}}function ai(s,u){if(s.length===0)return u;if(u.length===0)return s;const p=new Map;for(const A of Tr(s))p.set(A.id,A);for(const A of Tr(u))p.set(A.id,A);const y=new Map;for(const A of p.values()){const $=y.get(A.projectName);$?$.push(A):y.set(A.projectName,[A])}return Array.from(y.entries()).map(([A,$])=>({projectName:A,threads:$.sort((L,G)=>new Date(G.updatedAtIso).getTime()-new Date(L.updatedAtIso).getTime())})).sort((A,$)=>{var se,de;const L=new Date(((se=A.threads[0])==null?void 0:se.updatedAtIso)??0).getTime();return new Date(((de=$.threads[0])==null?void 0:de.updatedAtIso)??0).getTime()-L})}function Fo(){return Object.values(f.value).some(s=>s===!0)}function cs(s=mn){if(!(!Be||$e||Fo())){if(mn=s,typeof window>"u"){si(s);return}Ye!==null&&window.clearTimeout(Ye),Ye=window.setTimeout(()=>{Ye=null,!(!Be||Fo())&&si(mn)},gx)}}async function si(s){if(!($e||!Be||Fo())){$e=!0;try{const u=await af(Be,bb());Be=u.nextCursor,gt=u.nextCursor===null,Hn=ai(Hn,u.groups),ri(Hn,s)}catch{}finally{$e=!1,Be&&!Fo()&&cs(s)}}}async function _r(){if(Ze){await Ze;return}Ze=(async()=>{var s;ye.value||(De.value=!0);try{const[u,p]=await Promise.all([af(),oa(),Tl()]);mn=p;const y=u.groups;Hn=ye.value?ai(Hn,y):y,Be=ye.value&&!gt?Be:u.nextCursor,gt=u.nextCursor===null,await ni(y,p),ri(Hn,p),ye.value=!0,gt||cs(p);const A=Tr(e.value);gn(A),!A.some(L=>L.id===n.value)&&!n.value&&qt(((s=A[0])==null?void 0:s.id)??"")}finally{De.value=!1}})().finally(()=>{Ze=null}),await Ze}async function ro(s,u={}){if(!s)return;const p=D.get(s);if(p){await p;return}const y=ee.value[s]===!0,A=u.silent!==!0&&!y;A&&(Je.value=!0);const $=(async()=>{try{const L=bt(s),G=He.value[s]??"",se=Date.now()-(Me.get(s)??0)<bx;if(y&&(se||(L.length===0||G===L)&&f.value[s]!==!0)){yn(s);return}const ht=be.value[s]!==!0?await hu(s):null,pt=ht??await sf(s);ht&&(xt(s,ht.model),be.value={...be.value,[s]:!0});const{messages:Tt,inProgress:dn,activeTurnId:jr,turnIndexByTurnId:yo}=pt;Xr(s,Tt),fl(s,yo),ss(s);const pi=r.value[s]??[],Uo=jx(pi,Tt,{preserveMissing:u.silent===!0});Nn(s,Uo);const aa=o.value[s]??[];if(dn){const sa=Ux(aa,Tt);bn(s,sa)}else Xn(s);us(s,Tt),ei(s,Tt),ee.value={...ee.value,[s]:!0},Me.set(s,Date.now()),L&&(He.value={...He.value,[s]:L}),yt(s,dn),jr?me.value={...me.value,[s]:jr}:me.value[s]&&(me.value=Ct(me.value,s)),dn||cn(s),yn(s)}finally{A&&(Je.value=!1)}})().finally(()=>{D.delete(s)});D.set(s,$),await $}async function ds(s,u={}){s&&ee.value[s]!==!0&&await ro(s,u)}async function ka(){if(F){await F;return}F=(async()=>{var s,u;try{const p=((u=(s=kr.value)==null?void 0:s.cwd)==null?void 0:u.trim())??"";_e.value=await k0(p?[p]:void 0)}catch{}finally{F=null}})(),await F}async function ii(s={}){await Promise.allSettled([Kn({providerChanged:s.providerChanged,includeProviderModels:s.includeProviderModels}),tn(),Rn(),ka()])}function Sl(s={}){const u=()=>{ii(s)};if(typeof window>"u"){u();return}window.setTimeout(u,0)}async function Cl(s={}){J.value="";const u=s.includeSelectedThreadMessages!==!1,p=s.awaitAncillaryRefreshes===!0;try{await jo(),await _r(),u&&await ro(n.value),p?await ii({providerChanged:s.providerChanged,includeProviderModels:s.providerChanged===!0||p}):Sl({providerChanged:s.providerChanged,includeProviderModels:!1})}catch(y){J.value=y instanceof Error?y.message:"Unknown application error"}}async function li(s){qt(s);try{await ro(s),ka()}catch(u){J.value=u instanceof Error?u.message:"Unknown application error"}}async function xl(s){try{await jb(s),await _r(),n.value===s&&await ro(n.value)}catch(u){J.value=u instanceof Error?u.message:"Unknown application error"}}async function ui(s,u){const p=u.trim();if(!(!s||!p))try{await Fb(s,p),K.value={...K.value,[s]:p},Nt(),yu(s,p)}catch(y){J.value=y instanceof Error?y.message:"Unknown application error"}}async function Al(s){var L,G;const u=s.trim();if(!u)return"";const p=Tr(t.value).find(se=>se.id===u),y=((L=p==null?void 0:p.cwd)==null?void 0:L.trim())??"",A=((G=p==null?void 0:p.title)==null?void 0:G.trim())??"Forked chat",$=Wt(u);J.value="";try{const se=await df(u,y||void 0,$||void 0),de=se.threadId.trim();return de?($n(de,y,A),xt(de,se.model),be.value={...be.value,[de]:!0},qt(de),await _r(),await ro(de),de):""}catch(se){return J.value=se instanceof Error?se.message:"Unknown application error",""}}async function El(s,u){var L;const p=s.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 ro(p)}catch(G){return J.value=G instanceof Error?G.message:"Unknown application error",""}const y=r.value[p]??[];let A=-1;for(const G of y)typeof G.turnIndex=="number"&&Number.isFinite(G.turnIndex)&&(A=Math.max(A,G.turnIndex));if(A>=0&&u>A)return"";const $=Tr(t.value).find(G=>G.id===p)??null;try{J.value="";const G=await df(p),se=G.threadId.trim();if(!se)return"";const de=G.cwd.trim()||((L=$==null?void 0:$.cwd)==null?void 0:L.trim())||"",Ve=Zx(($==null?void 0:$.title)||($==null?void 0:$.preview)||"Untitled thread");$n(se,de,Ve),xt(se,G.model),Nn(se,G.messages),ee.value={...ee.value,[se]:!0},be.value={...be.value,[se]:!0},mt(se),bn(se,[]),Ht(se),l.value[se]&&(l.value=Ct(l.value,se)),nn(se,null),kt(se,null),It(se,null),yt(se,!1);const ht=A-u;if(ht>0){const pt=await pu(se,ht);Nn(se,pt)}return await ui(se,Ve),qt(se),_r().catch(()=>{}),se}catch(G){return J.value=G instanceof Error?G.message:"Unknown application error",""}}async function Il(s,u,p=[],y=[],A=[]){if(!s||!u.trim()||p.length>0||y.length>0||A.length>0)return!1;const L=(je.value[s]??[]).filter(de=>de.method==="item/tool/requestUserInput");if(L.length!==1)return!1;const[G]=L,se=_t(G);return se.length!==1?!1:fi({id:G.id,result:{answers:{[se[0]]:{answers:[u.trim()]}}}})}async function fs(s,u=[],p=[],y="steer",A=[],$,L){if(z.value)return;const G=n.value,se=s.trim();if(!G||!se&&u.length===0&&A.length===0||await Il(G,se,u,p,A))return;const de=f.value[G]===!0;if(de&&y==="queue"){const Ve=h.value[G]??[],ht=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,pt=[...Ve],Tt=typeof $=="number"?Math.max(0,Math.min($,pt.length)):pt.length;pt.splice(Tt,0,{id:ht,text:se,imageUrls:u,skills:p,fileAttachments:A,collaborationMode:L==="plan"?"plan":L==="default"?"default":O.value}),h.value={...h.value,[G]:pt},no();return}if(de){Ot=!0,oo(G,se,u,p,A,L).catch(Ve=>{const ht=Ve instanceof Error?Ve.message:"Unknown application error";It(G,ht),J.value=ht});return}J.value="",Ot=!0,nn(G,null),kt(G,{label:"Thinking",details:Sn(Wt(G),X.value,L==="plan"?"plan":L==="default"?"default":O.value)}),It(G,null),yt(G,!0);try{await oo(G,se,u,p,A,L)}catch(Ve){Ot=!1,yt(G,!1),kt(G,null);const ht=Ve instanceof Error?Ve.message:"Unknown application error";throw It(G,ht),J.value=ht,Ve}}async function Pl(s,u,p=[],y=[],A=[]){if(z.value)return"";const $=s.trim(),L=u.trim(),G=Wt(Eo).trim(),se=ks(te.value,Eo);if(!$&&p.length===0&&A.length===0)return"";k.value=!0,J.value="";let de="";try{try{const Tt=await cf(L||void 0,G||void 0);de=Tt.threadId,xt(de,Tt.model),ir(de,se)}catch(Tt){if(G&&G!==Fr&&Ii(Tt)){await Mn();const dn=await cf(L||void 0,Fr);de=dn.threadId,xt(de,dn.model),ir(de,se)}else throw Tt}if(!de)return"";$n(de,L,$||"[Image]"),rn(de),be.value={...be.value,[de]:!0},qt(de),Ot=!0,nn(de,null),kt(de,{label:"Thinking",details:Sn(Wt(de),X.value,se)}),It(de,null),yt(de,!0);const Ve=de,ht=L||null,pt=$;return oo(de,$,p,y,A,se).catch(Tt=>{Ot=!1,yt(de,!1),kt(de,null);const dn=Tt instanceof Error?Tt.message:"Unknown application error";It(de,dn),J.value=dn}).finally(()=>{k.value=!1}),kl(Ve,pt,ht),de}catch(Ve){Ot=!1,de&&(yt(de,!1),kt(de,null));const ht=Ve instanceof Error?Ve.message:"Unknown application error";throw de&&It(de,ht),J.value=ht,k.value=!1,Ve}}async function oo(s,u,p=[],y=[],A=[],$){const L=X.value,G=$==="plan"?"plan":$==="default"?"default":O.value,se=u.trim(),de=[...p];if(de.length===0&&pe(se)){const pt=ue(s);pt&&de.push(pt)}const Ve=y.map(pt=>({name:pt.name,path:pt.path})),ht=A.map(pt=>({...pt}));en(s,{text:se,imageUrls:[...de],skills:Ve,fileAttachments:ht,effort:L,collaborationMode:G,fallbackRetried:!1});try{if(be.value[s]!==!0){const dn=await hu(s);xt(s,dn.model)}const pt=Wt(s);let Tt="";try{Tt=await mu(s,u,de,pt||void 0,L||void 0,y.length>0?y:void 0,A,G)}catch(dn){if(pt&&pt!==Fr&&Ii(dn))await Mn(s),en(s,{text:se,imageUrls:[...de],skills:Ve,fileAttachments:ht,effort:L,collaborationMode:G,fallbackRetried:!0}),Tt=await mu(s,u,de,Fr,L||void 0,y.length>0?y:void 0,A,G);else throw dn}Tt&&(me.value={...me.value,[s]:Tt},wr(s,Tt)),be.value={...be.value,[s]:!0},he.add(s),await Lr(),Qr(s)}catch(pt){throw pt}}async function hs(s){if(v.value[s]===!0)return;const u=h.value[s];if(!u||u.length===0)return;v.value={...v.value,[s]:!0};const[p,...y]=u;h.value=y.length>0?{...h.value,[s]:y}:Ct(h.value,s),no(),k.value=!0,J.value="",Ot=!0,nn(s,null),kt(s,{label:"Thinking",details:Sn(Wt(s),X.value,p.collaborationMode)}),It(s,null),yt(s,!0);try{mr(p.collaborationMode),await oo(s,p.text,p.imageUrls,p.skills,p.fileAttachments)}catch{yt(s,!1),kt(s,null)}finally{v.value=Ct(v.value,s),k.value=!1}}async function Sa(){const s=n.value;if(!s||f.value[s]!==!0||We.value[s]===!0)return;let u=me.value[s];if(!u){const{activeTurnId:p}=await sf(s);u=p,u&&(me.value={...me.value,[s]:u})}if(!u)throw new Error("Could not determine active turn id for interrupt");E.value=!0,J.value="";try{await Vb(s,u),yt(s,!1),kt(s,null),It(s,null),me.value[s]&&(me.value=Ct(me.value,s)),he.add(s),Y=!0,await Lr()}catch(p){const y=p instanceof Error?p.message:"Failed to interrupt active turn";It(s,y),J.value=y}finally{E.value=!1}}async function ci(s){var G,se;const u=n.value;if(!u||ne.value||!s.trim())return;const p=r.value[u]??[],y=p.find(de=>de.turnId===s),A=typeof(y==null?void 0:y.turnIndex)=="number"?y.turnIndex:-1;if(A<0)return;const $=p.reduce((de,Ve)=>typeof Ve.turnIndex=="number"&&Ve.turnIndex>de?Ve.turnIndex:de,-1);if($<0||A>$)return;const L=$-A+1;if(!(L<1)){ne.value=!0,J.value="";try{const de=((se=(G=kr.value)==null?void 0:G.cwd)==null?void 0:se.trim())??"";de&&await Ub(u,s,de);const Ve=await pu(u,L);Nn(u,Ve),bn(u,[]),Ht(u),l.value[u]&&(l.value=Ct(l.value,u)),nn(u,null),kt(u,null),It(u,null),Y=!0,await Lr()}catch(de){J.value=de instanceof Error?de.message:"Failed to rollback thread"}finally{ne.value=!1}}}let Ca=null;async function Ml(s,u){try{const p=await ja(),y={...p.labels};let A=!1;for(const $ of p.order){if(Vo($)!==s)continue;const L=u.trim();L.length===0?y[$]!==void 0&&(delete y[$],A=!0):y[$]!==L&&(y[$]=L,A=!0)}A&&await vu({order:p.order,labels:y,active:p.active})}catch{}}function Rl(s,u){s.length===0||(Ae.value[s]??"")===u||(Ae.value={...Ae.value,[s]:u},Su(Ae.value),Ca!==null&&clearTimeout(Ca),Ca=setTimeout(()=>{Ca=null,Ml(s,u)},500))}async function $l(s){var $;if(s.length===0)return;const u=Z.value.filter(L=>L!==s);if(Ko(Z.value,u)||(Z.value=u,Oa(Z.value)),t.value=t.value.filter(L=>L.projectName!==s),Ae.value[s]!==void 0){const L={...Ae.value};delete L[s],Ae.value=L,Su(L)}Nt();const p=Tr(e.value);gn(p),p.some(L=>L.id===n.value)||qt((($=p[0])==null?void 0:$.id)??"");const A=new Set;try{const L=await ja();for(const G of L.order)Vo(G)===s&&A.add(G);for(const G of L.active)Vo(G)===s&&A.add(G);for(const G of Object.keys(L.labels))Vo(G)===s&&A.add(G)}catch{}if(A.size>0)try{const L=await ja(),G=L.order.filter(Ve=>!A.has(Ve)),se=L.active.filter(Ve=>!A.has(Ve)),de=se.length===0&&G.length>0?[G[0]]:se;await vu({order:G,labels:Gx(L.labels,A),active:de});return}catch{}await xa()}function Nl(s,u){if(s.length===0||t.value.length===0)return;const p=t.value.map(se=>se.projectName),y=p.indexOf(s);if(y===-1)return;const A=Math.max(0,Math.min(u,p.length-1)),$=Nx(p,y,A);if($===p)return;const L=Ei($,t.value);Z.value=L,Oa(Z.value);const G=Cu(t.value,Z.value);t.value=Mi(t.value,G),Nt(),xa()}function Ol(s){const u=s.trim();if(!u)return;const p=[u,...Z.value.filter(A=>A!==u)];if(Ko(Z.value,p))return;Z.value=p,Oa(Z.value);const y=Cu(t.value,Z.value);t.value=Mi(t.value,y),Nt(),xa()}async function xa(){var s,u;try{const p=await ja(),y=new Map;for(const L of p.order){const G=Vo(L);y.has(G)||y.set(G,L)}for(const L of t.value){const G=((u=(s=L.threads[0])==null?void 0:s.cwd)==null?void 0:u.trim())??"";G&&y.set(L.projectName,G)}const A=[];for(const L of Z.value){const G=y.get(L);G&&!A.includes(G)&&A.push(G)}for(const L of p.order)A.includes(L)||A.push(L);const $=p.active.filter(L=>A.includes(L));$.length===0&&A.length>0&&$.push(A[0]),await vu({order:A,labels:p.labels,active:$})}catch{}}async function Lr(){if(oe.value){typeof window<"u"&&ve===null&&(ve=window.setTimeout(()=>{ve=null,Lr()},_u));return}oe.value=!0;const s=Y,u=new Set(he);Y=!1,he.clear();try{s&&await _r();const p=n.value;if(!p)return;const y=u.has(p),A=f.value[p]===!0,$=bt(p),L=He.value[p]??"";($.length>0&&$!==L||A&&ee.value[p]!==!0||y&&ee.value[p]!==!0||s&&ee.value[p]!==!0)&&await ro(p,{silent:!0})}catch{}finally{oe.value=!1,(Y||he.size>0)&&typeof window<"u"&&ve===null&&(ve=window.setTimeout(()=>{ve=null,Lr()},_u))}}async function Aa(){await di(),Y=!ye.value,n.value&&ee.value[n.value]!==!0&&he.add(n.value),await Lr()}function Dl(){typeof window>"u"||Re||(di(),Re=Eb(s=>{if(s.method==="ready"){Zr(),Aa();return}_l(s),ti(s)}))}async function di(){try{const u=(await Rb()).map(p=>Nr(p)).filter(p=>p!==null);On(u)}catch{}}async function fi(s){try{return await Mb(s.id,{result:s.result,error:s.error}),Tn(s.id),!0}catch(u){return J.value=u instanceof Error?u.message:"Failed to reply to server request",!1}}function Ll(){if(Re&&(Re(),Re=null),Y=!1,he.clear(),hr.clear(),ve!==null&&typeof window<"u"&&(window.clearTimeout(ve),ve=null),Pe!==null&&typeof window<"u"&&(window.clearTimeout(Pe),Pe=null),Ye!==null&&typeof window<"u"&&(window.clearTimeout(Ye),Ye=null),typeof window<"u")for(const s of Ee.values())window.clearTimeout(s);Ee.clear(),Ot=!1,r.value={},a.value={},o.value={},i.value={},l.value={},c.value={},Le.value={},Ue.value={},Ke.value={},Se.value={},me.value={},We.value={},nt.value={},ze.value={},h.value={},v.value={},no(),ft.value=null,et.value={}}const jl=ae(()=>{const s=n.value;return s?h.value[s]??[]:[]});function ps(s){const u=n.value;if(!u)return;const p=h.value[u];if(!p)return;const y=p.filter(A=>A.id!==s);h.value=y.length>0?{...h.value,[u]:y}:Ct(h.value,u),no()}function hi(s,u){const p=n.value;if(!p)return;const y=h.value[p];if(!y)return;const A=y.findIndex(se=>se.id===s),$=y.findIndex(se=>se.id===u);if(A<0||$<0||A===$)return;const L=[...y],[G]=L.splice(A,1);L.splice($,0,G),h.value={...h.value,[p]:L},no()}function Fl(s){const u=n.value;if(!u)return;const p=h.value[u];if(!p)return;const y=p.find(A=>A.id===s);y&&(ps(s),mr(y.collaborationMode),fs(y.text,y.imageUrls,y.skills,"steer",y.fileAttachments))}function Ul(s){qt(s)}return{projectGroups:e,projectDisplayNameById:Ae,selectedThread:kr,selectedThreadTokenUsage:Vn,selectedThreadScrollState:pr,selectedThreadTerminalOpen:zn,isSelectedThreadInterruptPending:Sr,selectedThreadServerRequests:Ft,selectedLiveOverlay:lt,codexQuota:Pn,selectedThreadId:n,availableCollaborationModes:q,availableModelIds:j,selectedCollaborationMode:O,selectedModelId:V,selectedReasoningEffort:X,selectedSpeedMode:Ce,installedSkills:_e,accountRateLimitSnapshots:we,messages:Jr,isLoadingThreads:De,isLoadingMessages:Je,isSendingMessage:k,isInterruptingTurn:E,isUpdatingSpeedMode:z,isRollingBack:ne,error:J,refreshAll:Cl,refreshSkills:ka,selectThread:li,loadMessages:ro,ensureThreadMessagesLoaded:ds,setThreadScrollState:on,setThreadTerminalOpen:an,toggleSelectedThreadTerminal:Qn,archiveThreadById:xl,renameThreadById:ui,forkThreadById:Al,forkThreadFromTurn:El,rollbackSelectedThread:ci,sendMessageToSelectedThread:fs,sendMessageToNewThread:Pl,interruptSelectedThreadTurn:Sa,selectedThreadQueuedMessages:jl,removeQueuedMessage:ps,reorderQueuedMessage:hi,steerQueuedMessage:Fl,setSelectedCollaborationMode:mr,readModelIdForThread:Wt,setSelectedModelIdForThread:Qt,setSelectedModelId:Ut,setSelectedReasoningEffort:Yr,updateSelectedSpeedMode:Gn,respondToPendingServerRequest:fi,renameProject:Rl,removeProject:$l,reorderProject:Nl,pinProjectToTop:Ol,startPolling:Dl,stopPolling:Ll,primeSelectedThread:Ul}}const rA={class:"sidebar-root"},oA={class:"sidebar-scrollable"},aA=["aria-pressed","aria-label","title"],sA={key:1,class:"sidebar-search-bar"},iA=["placeholder"],lA=["aria-label"],uA={class:"sidebar-skills-link-icon","aria-hidden":"true"},cA={class:"sidebar-skills-link-copy"},dA={class:"sidebar-skills-link-title"},fA={class:"sidebar-skills-link-subtitle"},hA={class:"sidebar-settings-account-section"},pA={class:"sidebar-settings-account-header"},mA={class:"sidebar-settings-account-header-main"},vA=["aria-expanded","title"],gA={class:"sidebar-settings-account-collapse-icon"},yA={class:"sidebar-settings-account-title"},wA={class:"sidebar-settings-account-count"},bA=["disabled"],_A={key:0,class:"sidebar-settings-account-error"},TA={key:1,class:"sidebar-settings-account-empty"},kA={key:2,class:"sidebar-settings-account-list"},SA=["title","onMouseenter","onMouseleave"],CA={class:"sidebar-settings-account-main"},xA={class:"sidebar-settings-account-email"},AA={class:"sidebar-settings-account-meta"},EA={class:"sidebar-settings-account-quota"},IA={class:"sidebar-settings-account-id"},PA={class:"sidebar-settings-account-actions"},MA=["disabled","onClick"],RA=["disabled","onClick"],$A=["title"],NA={class:"sidebar-settings-label"},OA=["title"],DA={class:"sidebar-settings-label"},LA={class:"sidebar-settings-value"},jA=["title"],FA={class:"sidebar-settings-label"},UA={class:"sidebar-settings-value"},BA=["title"],qA={class:"sidebar-settings-label"},HA=["value"],zA=["value"],VA=["title"],WA={class:"sidebar-settings-label"},GA={class:"sidebar-settings-value"},KA=["title"],JA={class:"sidebar-settings-label"},YA=["title"],QA={class:"sidebar-settings-label"},XA=["title"],ZA={class:"sidebar-settings-label"},eE=["value","disabled"],tE={key:0,class:"sidebar-settings-row sidebar-settings-error"},nE={key:1,class:"sidebar-settings-row sidebar-settings-row--input"},rE={class:"sidebar-settings-provider-info"},oE={class:"sidebar-settings-label"},aE={class:"sidebar-settings-provider-link",href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer"},sE={class:"sidebar-settings-key-group"},iE={class:"sidebar-settings-key-masked"},lE=["disabled","title"],uE=["placeholder"],cE=["disabled"],dE={class:"sidebar-settings-row sidebar-settings-row--select",style:{"margin-top":"4px",padding:"0"}},fE={class:"sidebar-settings-label"},hE=["aria-label"],pE=["disabled"],mE=["disabled"],vE={key:2,class:"sidebar-settings-row sidebar-settings-row--input"},gE={class:"sidebar-settings-provider-info"},yE={class:"sidebar-settings-label"},wE={class:"sidebar-settings-provider-link",href:"https://opencode.ai/auth",target:"_blank",rel:"noopener noreferrer"},bE={class:"sidebar-settings-key-group"},_E=["placeholder"],TE=["disabled"],kE={key:3,class:"sidebar-settings-row sidebar-settings-row--input"},SE={class:"sidebar-settings-label"},CE={class:"sidebar-settings-key-group"},xE=["placeholder"],AE={class:"sidebar-settings-label",style:{"margin-top":"4px"}},EE={class:"sidebar-settings-key-group"},IE=["placeholder"],PE=["disabled"],ME={class:"sidebar-settings-row sidebar-settings-row--select",style:{"margin-top":"4px",padding:"0"}},RE={class:"sidebar-settings-label"},$E=["aria-label"],NE=["title"],OE={class:"sidebar-settings-label"},DE={class:"sidebar-settings-label"},LE={class:"sidebar-settings-value"},jE={key:4,class:"sidebar-settings-telegram-panel"},FE={class:"sidebar-settings-field"},UE={class:"sidebar-settings-field-label"},BE={class:"sidebar-settings-field"},qE={class:"sidebar-settings-field-label"},HE={class:"sidebar-settings-field-help"},zE={key:0,class:"sidebar-settings-telegram-error"},VE={class:"sidebar-settings-telegram-actions"},WE=["disabled"],GE=["data-state","title"],KE={class:"sidebar-settings-label"},JE=["data-state"],YE={class:"sidebar-settings-context-meta"},QE={class:"sidebar-settings-rate-limits"},XE=["aria-label"],ZE={class:"sidebar-settings-button-version"},eI={key:0,class:"content-keyboard-spacer","aria-hidden":"true"},tI={key:1,class:"skills-route-header-icon","aria-hidden":"true"},nI=["aria-pressed","title","aria-label"],rI={class:"content-header-terminal-shortcut"},oI={class:"content-body"},aI={key:1,class:"content-grid content-grid-home"},sI={class:"new-thread-empty"},iI={class:"new-thread-hero"},lI=["title"],uI={class:"new-thread-folder-actions"},cI={key:1,class:"new-thread-launch-card","aria-label":"Plugins and Apps announcement"},dI={class:"new-thread-launch-card-copy"},fI={class:"new-thread-launch-card-topline"},hI={class:"new-thread-launch-card-badge","aria-hidden":"true"},pI={class:"new-thread-launch-card-eyebrow"},mI={class:"new-thread-launch-card-title"},vI={class:"new-thread-launch-card-text"},gI={class:"new-thread-launch-card-actions"},yI=["aria-label","onKeydown"],wI={class:"new-thread-open-folder-header"},bI={class:"new-thread-open-folder-title"},_I={class:"new-thread-open-folder-label"},TI={class:"new-thread-open-folder-current"},kI=["placeholder","title","disabled","onKeydown"],SI=["disabled"],CI={class:"new-thread-open-folder-actions"},xI={class:"new-thread-open-folder-toggle"},AI=["aria-pressed","disabled"],EI={key:0,class:"new-thread-open-folder-create"},II={class:"new-thread-open-folder-create-composer"},PI=["placeholder","onKeydown"],MI=["disabled"],RI={key:0,class:"new-thread-open-folder-error"},$I=["placeholder","onKeydown"],NI={key:1,class:"new-thread-open-folder-error-actions"},OI={class:"new-thread-open-folder-error"},DI=["disabled"],LI={key:2,class:"new-thread-open-folder-status"},jI={key:3,class:"new-thread-open-folder-status"},FI={key:4,class:"new-thread-open-folder-list"},UI=["title","disabled","onClick"],BI={class:"new-thread-open-folder-item-name"},qI=["disabled","onClick"],HI={key:2,class:"new-thread-branch-select"},zI={class:"new-thread-branch-select-label"},VI={class:"new-thread-branch-select-help"},WI={class:"new-thread-runtime-help"},GI={class:"worktree-init-status-title"},KI={class:"worktree-init-status-message"},JI={class:"composer-with-queue"},YI={key:2,class:"content-grid"},QI={class:"content-thread"},XI={class:"composer-with-queue"},jf="codex-web-local.sidebar-collapsed.v1",Ff="codex-web-local.accounts-section-collapsed.v1",Uf="codex-web-local.send-with-enter.v1",Bf="codex-web-local.in-progress-send-mode.v1",qf="codex-web-local.dark-mode.v1",Hf="codex-web-local.dictation-click-to-toggle.v1",zf="codex-web-local.dictation-auto-send.v1",Vf="codex-web-local.dictation-language.v1",Wf="codex-web-local.chat-width.v1",ZI=400,eP=Bn({__name:"App",setup(e){var Uc,Bc;const t=Ti(()=>Si(()=>import("./ThreadConversation-08orN8b4.js"),__vite__mapDeps([0,1]))),n=Ti(()=>Si(()=>import("./ThreadTerminalPanel-Dw7SInGu.js"),__vite__mapDeps([2,3]))),r=Ti(()=>Si(()=>import("./ReviewPane-BkNGxMQY.js"),__vite__mapDeps([4,5]))),a=Ti(()=>Si(()=>import("./DirectoryHub-BsQI3jt6.js"),__vite__mapDeps([6,7]))),{t:o,uiLanguage:i,uiLanguageOptions:l,setUiLanguage:c}=ea(),f="codex-web-local",h="0.1.84",v={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:H,selectedThreadScrollState:O,selectedThreadTerminalOpen:V,selectedThreadServerRequests:X,selectedLiveOverlay:Ce,codexQuota:Oe,selectedThreadId:ce,availableCollaborationModes:xe,availableModelIds:Z,selectedCollaborationMode:Ae,selectedReasoningEffort:He,selectedSpeedMode:ee,installedSkills:be,accountRateLimitSnapshots:Le,messages:Ke,isLoadingThreads:Ue,isLoadingMessages:Se,isSendingMessage:me,isInterruptingTurn:We,isSelectedThreadInterruptPending:nt,isUpdatingSpeedMode:ze,refreshAll:je,refreshSkills:dt,selectThread:ft,ensureThreadMessagesLoaded:et,setThreadScrollState:ct,setThreadTerminalOpen:K,toggleSelectedThreadTerminal:_e,archiveThreadById:we,forkThreadById:De,renameThreadById:Je,forkThreadFromTurn:k,sendMessageToSelectedThread:E,sendMessageToNewThread:z,interruptSelectedThreadTurn:ne,selectedThreadQueuedMessages:J,removeQueuedMessage:oe,reorderQueuedMessage:ye,steerQueuedMessage:fe,setSelectedCollaborationMode:pe,readModelIdForThread:ue,setSelectedModelIdForThread:Re,setSelectedReasoningEffort:ve,updateSelectedSpeedMode:Pe,respondToPendingServerRequest:Ee,renameProject:Ze,removeProject:D,reorderProject:F,pinProjectToTop:U,startPolling:Y,stopPolling:he,primeSelectedThread:Me,rollbackSelectedThread:Be}=nA(),Ye=Pw(),$e=Iw(),{isMobile:gt}=Tc(),Hn=I(null),mn=I(null),vo=I(null),Ot=I(!1),hr=I(!1),sr=I(!1),Kr=I(!0),kr=I(null),pr=I(!1),zn=I("");let Sr=!1;const Ft=I(!1),lt=I(""),Pn=I("local"),Vn=I(""),Jr=I([]),Wt=I(!1),Wn=I({order:[],labels:{}}),qt=I({phase:"idle",title:"",message:""}),Qt=I(Pm()),Ut=I(""),xt=I(!1),Gt=I(null),mr=I(null),ir=I(null),Ir=I(null),Mn=I(null);let en=null,vr=null;const lr=I("New Project (1)"),Yr=I(""),Gn=I(!1),Rn=I(Rm()),Sn=I(!1),Kn=I([]),tn=I(null),Cr=I(!1),Cn=I(!1),Qr=I(null),vn=I([]),ur=I(!1),Jn=I(!1),gr=I(""),Nt=I(""),$n=I(""),gn=I(""),yn=I(zl(Uf,!0)),nn=I(gm()),yt=I(vm()),yr=I(ym()),rn=I(zl(Hf,!1)),Yn=I(zl(zf,!0)),wr=I(Em()),Pr=ae(()=>Im()),Xr=I(!1),wn=I(!1),kt=I(!1),It=I(""),go=I(!1),Zr=I(null),bt=I(!1),on=I(""),an=I("codex"),Qn=I(""),Nn=I(""),bn=I("responses"),Xn=I("responses"),br=I(""),M=I(!1),B=I(""),Q=I(""),Ie=I(""),St=I(!1),Xt=I(!1),Ht=I(""),mt=I(""),Kt=I(!1),cn=I(!1),Mr=I(null),Do=I(null),Rr=I(""),Zn=I(""),qe=I(""),ke=I([]),Dt=I(""),_n=I(!1),xn=I(!1),ta=I(!1),zt=I(""),cr=I({configured:!1,active:!1,mappedChats:0,mappedThreads:0,allowedUsers:0,allowAllUsers:!1,lastError:""}),$r=I(null),Nr=I(!1),eo=I(!1),to=I(typeof window<"u"?((Uc=window.visualViewport)==null?void 0:Uc.height)??window.innerHeight:0),w=I(typeof window<"u"?((Bc=window.visualViewport)==null?void 0:Bc.offsetTop)??0:0),_=I(typeof window<"u"?window.innerHeight:0);let S=null,W=!1,Fe=0;const _t=ae(()=>{const d=Ye.params.threadId;return typeof d=="string"?d:""}),wt=ae(()=>Ye.name==="home"),Tn=ae(()=>Ye.name==="skills"),On=ae(()=>{var d;return Tn.value?o("Skills"):wt.value?o("Start new thread"):((d=te.value)==null?void 0:d.title)??o("Choose a thread")}),er=typeof window<"u"&&(window.location.hostname||window.location.host)||"codexui",Or=ae(()=>{var g,P;return(((P=(g=te.value)==null?void 0:g.title)==null?void 0:P.trim())??"")||er}),Dr=ae(()=>Ke.value.filter(d=>{const g=Nm(d.messageType,d.role);return g==="worked"?!0:!(g==="turnActivity.live"||g==="turnError.live"||g==="agentReasoning.live")})),na=ae(()=>Ce.value),Lo=ae(()=>wt.value?"__new-thread__":ce.value),ba=ae(()=>ue(Lo.value)),Ys=ae(()=>{const d=X.value;return d.length>0?d[d.length-1]:null}),An=ae(()=>{var d,g;return wt.value?lt.value.trim():((g=(d=te.value)==null?void 0:d.cwd)==null?void 0:g.trim())??""}),fl=ae(()=>Kr.value&&(wt.value&&An.value.length>0||Ye.name==="thread"&&ce.value.length>0)),ss=ae(()=>wt.value?Ot.value:V.value),_a=ae(()=>!gt.value||to.value<=0||_.value<=0?!1:_.value-to.value>120),hl=ae(()=>_a.value||ss.value&&sr.value),Qs=ae(()=>{var d,g;return((g=(d=te.value)==null?void 0:d.cwd)==null?void 0:g.trim())??lt.value.trim()}),is=ae(()=>{var d;return!wt.value&&((d=te.value)==null?void 0:d.inProgress)===!0}),pl=ae(()=>!wt.value&&!Tn.value&&ce.value.trim().length>0),ls=ae(()=>me.value||We.value||is.value||X.value.length>0);function Ta(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 ml(d){if(!d)return o("Waiting for Codex thread/tokenUsage/updated events for this thread.");const g=[`${o("Current context usage")}: ${d.currentContextTokens.toLocaleString()} ${o("tokens")}`,`${o("Cumulative thread usage")}: ${d.total.totalTokens.toLocaleString()} ${o("tokens")}`];return typeof d.modelContextWindow=="number"?(g.unshift(`${o("Model context window")}: ${d.modelContextWindow.toLocaleString()} ${o("tokens")}`),g.push(`${o("Remaining context")}: ${(d.remainingContextTokens??0).toLocaleString()} ${o("tokens")}`)):g.push(o("Model context window is unavailable in the latest usage event.")),g.join(`
|
|
57
|
-
`)}function Xs(){Xr.value&&(Xr.value=!1,b0(!0))}function vl(){Xs(),$e.push({name:"skills"})}const Zs=ae(()=>{var g;const d=(g=H.value)==null?void 0:g.remainingContextPercent;return d===null||typeof d!="number"?"pending":d<=10?"danger":d<=25?"warning":"ok"}),gl=ae(()=>{const d=H.value;return d?typeof d.remainingContextTokens=="number"?`${Ta(d.remainingContextTokens)} ${o("left")}`:`${Ta(d.currentContextTokens)} ${o("used")}`:o("Awaiting data")}),yl=ae(()=>{const d=H.value;return d?typeof d.modelContextWindow=="number"?`${Ta(d.currentContextTokens)} ${o("used")} / ${Ta(d.modelContextWindow)}`:o("Window size unavailable"):o("Updates after the next token usage event")}),wl=ae(()=>ml(H.value)),ra=ae(()=>{var re,ge;const d=[],g=new Set;for(const Te of Wn.value.order){const st=Te.trim();!st||g.has(st)||(g.add(st),d.push({value:st,label:Wn.value.labels[st]||fa(st)}))}for(const Te of j.value){const st=((ge=(re=Te.threads[0])==null?void 0:re.cwd)==null?void 0:ge.trim())??"";!st||g.has(st)||_p(st)||(g.add(st),d.push({value:st,label:q.value[Te.projectName]??Te.projectName}))}const P=lt.value.trim();return P&&!g.has(P)&&d.unshift({value:P,label:fa(P)}),d}),us=ae(()=>{const d=Vn.value.trim(),g=[...Jr.value];return d&&!g.some(P=>P.value===d)&&g.unshift({value:d,label:d}),g}),ei=ae(()=>{const d=Vn.value.trim();if(!d)return"";const g=us.value.find(P=>P.value===d);return(g==null?void 0:g.label)??d}),bl=ae(()=>tn.value??"__detached_head__"),_l=ae(()=>{var re;const d=[{value:"__review__",label:Sn.value?"Review (Open)":"Review"}],g=new Set,P=((re=tn.value)==null?void 0:re.trim())??"";P?(d.push({value:P,label:P}),g.add(P)):(d.push({value:"__detached_head__",label:"Detached HEAD"}),g.add("__detached_head__"));for(const ge of Kn.value)!ge.value||g.has(ge.value)||(g.add(ge.value),d.push(ge));return d}),ti=ae(()=>Zn.value.trim()),ni=ae(()=>{const d=Ht.value.trim();return!d||d==="."||d===".."?!1:!/[\\/]/u.test(d)}),Tl=ae(()=>ni.value&&ti.value.trim().length>0&&!Dt.value),oa=ae(()=>{const d=jt(Rr.value).trim();return d||Zn.value.trim()}),kl=ae(()=>Kt.value?"Creating…":"Create"),ri=ae(()=>{const d=Zn.value.trim(),g=qe.value.trim();return!!(d&&g&&d!==g)}),oi=ae(()=>{const d=[];ri.value&&d.push({key:`parent:${qe.value}`,name:"..",path:qe.value,kind:"parent"});for(const g of ke.value)d.push({key:`directory:${g.path}`,name:g.name,path:g.path,kind:"directory"});return d}),no=ae(()=>{const d=zt.value.trim().toLowerCase();return d?oi.value.filter(g=>g.kind==="parent"||g.name.toLowerCase().includes(d)):oi.value}),jo=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null,ai=ae(()=>o(b[yr.value].label)),Fo=ae(()=>typeof navigator<"u"&&/mac|iphone|ipad|ipod/i.test(navigator.platform)?"⌘J":"Ctrl+J"),cs=ae(()=>{const d=b[yr.value],g=Math.max(0,_.value-to.value-w.value);return{"--chat-column-max":d.columnMax,"--chat-card-max":d.cardMax,"--visual-viewport-height":to.value>0?`${to.value}px`:"100dvh","--visual-viewport-offset-top":`${Math.max(0,w.value)}px`,"--virtual-keyboard-inset":`${g}px`}}),si=ae(()=>{if(!cr.value.configured)return o("Not configured");const d=cr.value.active?o("Online"):o("Configured (offline)"),g=cr.value.allowAllUsers?o("allow all users"):`${cr.value.allowedUsers} ${o("allowed user(s)")}`,P=`${cr.value.mappedChats} ${o("chat(s)")}, ${cr.value.mappedThreads} ${o("thread(s)")}, ${g}`,re=cr.value.lastError?`, ${o("error")}: ${cr.value.lastError}`:"";return`${d}, ${P}${re}`});Xo(()=>{var d,g;document.addEventListener("pointerdown",Uo),window.addEventListener("keydown",Ve),document.addEventListener("visibilitychange",sa),window.addEventListener("pageshow",ms),window.addEventListener("focus",vs),window.addEventListener("resize",_r),(d=window.visualViewport)==null||d.addEventListener("resize",_r),(g=window.visualViewport)==null||g.addEventListener("scroll",_r),_r(),gi(),jo==null||jo.addEventListener("change",gi),Om(),im(),ii(),Pa(),bo(),ka(),ds(),Wl(),pi()}),ol(()=>{var d,g;document.removeEventListener("pointerdown",Uo),window.removeEventListener("keydown",Ve),document.removeEventListener("visibilitychange",sa),window.removeEventListener("pageshow",ms),window.removeEventListener("focus",vs),window.removeEventListener("resize",_r),(d=window.visualViewport)==null||d.removeEventListener("resize",_r),(g=window.visualViewport)==null||g.removeEventListener("scroll",_r),jo==null||jo.removeEventListener("change",gi),S!==null&&(window.clearInterval(S),S=null),en&&(clearTimeout(en),en=null),yo(),he()});function _r(){var d,g;typeof window>"u"||(_.value=Math.max(_.value,window.innerHeight),to.value=((d=window.visualViewport)==null?void 0:d.height)??window.innerHeight,w.value=((g=window.visualViewport)==null?void 0:g.offsetTop)??0)}vt(Ut,d=>{const g=d.trim();if(en&&(clearTimeout(en),en=null),!g){Mn.value=null;return}en=setTimeout(()=>{f0(g,1e3).then(P=>{Ut.value.trim()===g&&(Mn.value=P.threadIds)}).catch(()=>{Ut.value.trim()===g&&(Mn.value=null)})},220)}),vt(_a,d=>{d||(sr.value=!1)}),vt(vn,()=>{if(typeof window>"u")return;if(!vn.value.some(g=>g.quotaStatus==="loading")){S!==null&&(window.clearInterval(S),S=null);return}S===null&&(S=window.setInterval(()=>{W||(W=!0,Aa({silent:!0}).finally(()=>{W=!1}))},1500))},{deep:!0});function ro(){dt()}async function ds(){try{cr.value=await m0()}catch(d){const g=d instanceof Error?d.message:"Failed to load Telegram status";cr.value={configured:!1,active:!1,mappedChats:0,mappedThreads:0,allowedUsers:0,allowAllUsers:!1,lastError:g}}}async function ka(){try{const d=await p0();B.value=d.botToken,Q.value=d.allowedUserIds.map(g=>String(g)).join(`
|
|
58
|
-
`),Ie.value=""}catch(d){Ie.value=d instanceof Error?d.message:"Failed to load Telegram configuration"}}async function ii(){const d=await w0();Xr.value=d.dismissed!==!0}function Sl(d){const g=d.split(/[\n,]/).map(ge=>ge.trim().replace(/^(telegram|tg):/i,"").trim()).filter(Boolean),P=g.includes("*"),re=Array.from(new Set(g.filter(ge=>/^-?\d+$/.test(ge)).map(ge=>Number.parseInt(ge,10))));return P?["*",...re]:re}async function Cl(){const d=B.value.trim(),g=Sl(Q.value);if(!d){Ie.value=o("Telegram bot token is required.");return}if(g.length===0){Ie.value=o("At least one allowed Telegram user ID or * is required.");return}St.value=!0,Ie.value="";try{await h0(d,g),Q.value=g.map(P=>String(P)).join(`
|
|
59
|
-
`),await Promise.all([ka(),ds()]),window.alert(o("Telegram bot configured. Only allowlisted Telegram users can use the bridge."))}catch(P){Ie.value=P instanceof Error?P.message:o("Failed to connect Telegram bot"),ds()}finally{St.value=!1}}function li(){xt.value=!xt.value,xt.value?sn(()=>{var d;return(d=Gt.value)==null?void 0:d.focus()}):Ut.value=""}function xl(){var d;Ut.value="",(d=Gt.value)==null||d.focus()}function ui(d){d.key==="Escape"&&(xt.value=!1,Ut.value="")}function Al(d){d&&(Ye.name==="thread"&&_t.value===d||($e.push({name:"thread",params:{threadId:d}}),gt.value&&de(!0)))}async function El(d){d&&(ce.value!==d&&(await ft(d),await $e.push({name:"thread",params:{threadId:d}})),await sn(),fm())}function Il(d){return d.length>8?d.slice(-8):d}function fs(d){const g=[d.planType||o("unknown")];return d.authMode&&g.unshift(d.authMode),g.join(" · ")}function Pl(d){if(!d)return!1;const g=d.toLowerCase();return g.includes("payment required")||/\b402\b/.test(g)}function oo(d){return d.unavailableReason==="payment_required"||Pl(d.quotaError)}function hs(d){return ur.value||Jn.value||gr.value.length>0||d.isActive&&gr.value!==d.accountId&&ls.value}function Sa(d){return Nt.value===d.accountId}function ci(d){return $n.value===d.accountId||Sa(d)}function Ca(d){return oo(d)?o("Unavailable"):d.isActive?o("Active"):Jn.value?o("Switching…"):o("Switch")}function Ml(d){return gr.value===d.accountId?o("Removing…"):Sa(d)?o("Click again to remove"):o("Remove")}function Rl(d){$n.value=d}function $l(d){$n.value===d&&($n.value=""),gr.value!==d&&Nt.value===d&&(Nt.value="")}function Nl(d){const g=d.quotaSnapshot;if(!g)return null;const P=[g==null?void 0:g.primary,g==null?void 0:g.secondary].filter(Te=>Te!==null),re=P.find(Te=>Te.windowMinutes===10080);if(re)return re;const ge=P.filter(Te=>typeof Te.windowMinutes=="number"&&Te.windowMinutes>=10080).sort((Te,st)=>(Te.windowMinutes??0)-(st.windowMinutes??0))[0]??null;return ge||(g.secondary??null)}function Ol(d){if(typeof d!="number"||!Number.isFinite(d))return"";const g=new Date(d*1e3);return`${g.getMonth()+1}月${g.getDate()}日`}function xa(d){var Te,st;if(oo(d))return d.quotaError||o("402 Payment Required");const g=d.quotaSnapshot,P=Nl(d),re=(g==null?void 0:g.primary)??(g==null?void 0:g.secondary)??null,ge=P??re;if(ge){const Dn=Math.max(0,Math.min(100,100-Math.round(ge.usedPercent))),ao=Ol(ge.resetsAt);return ao?`${Dn}% ${o("weekly remaining")} · ${ao}`:`${Dn}% ${o("weekly remaining")}`}return(Te=g==null?void 0:g.credits)!=null&&Te.unlimited?o("Unlimited credits"):(st=g==null?void 0:g.credits)!=null&&st.hasCredits&&g.credits.balance?`${g.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 Lr(d){return[d.email||o("Account"),fs(d),oo(d)?o("Unavailable account"):null,xa(d),`${o("Workspace")} ${d.accountId}`].filter(Boolean).join(`
|
|
60
|
-
`)}async function Aa(d={}){try{const g=await Nb();vn.value=g.accounts,g.accounts.some(P=>P.accountId===$n.value)||($n.value=""),g.accounts.some(P=>P.accountId===Nt.value)||(Nt.value="")}catch(g){if(d.silent===!0)return;gn.value=g instanceof Error?g.message:o("Failed to load accounts")}}async function Dl(){if(!(ur.value||Jn.value)){gn.value="",$n.value="",Nt.value="",ur.value=!0;try{const d=await Ob();vn.value=d.accounts,he(),Y(),je({includeSelectedThreadMessages:!0})}catch(d){gn.value=d instanceof Error?d.message:o("Failed to refresh accounts")}finally{ur.value=!1}}}async function di(d){if(!(Jn.value||ur.value)){if(ls.value){gn.value=o("Finish the current turn and pending requests before switching accounts.");return}gn.value="",$n.value="",Nt.value="",Jn.value=!0;try{const g=await Db(d);vn.value=vn.value.map(P=>P.accountId===d?g:{...P,isActive:!1}),he(),Y(),je({includeSelectedThreadMessages:!0}),Aa({silent:!0})}catch(g){gn.value=g instanceof Error?g.message:o("Failed to switch account")}finally{Jn.value=!1}}}async function fi(d){if(ur.value||Jn.value||gr.value.length>0)return;const g=vn.value.find(re=>re.accountId===d)??null;if(!g)return;if(Nt.value!==d){Nt.value=d;return}if(g.isActive&&ls.value){gn.value=o("Finish the current turn and pending requests before removing the active account.");return}const P=g.isActive;gn.value="",Nt.value="",gr.value=d;try{const re=await Lb(d);vn.value=re.accounts,he(),Y(),P&&je({includeSelectedThreadMessages:!0}),Aa({silent:!0})}catch(re){gn.value=re instanceof Error?re.message:o("Failed to remove account")}finally{gr.value=""}}function Ll(d){we(d)}async function jl(d){const g=await De(d);g&&(wt.value?await $e.replace({name:"thread",params:{threadId:g}}):await $e.push({name:"thread",params:{threadId:g}}),gt.value&&de(!0))}function ps(d){const g=d.trim().replace(/\\/gu,"/");return g?g.includes("/.codex/worktrees/")||g.includes("/.git/worktrees/"):!1}function hi(d,g=""){var Te,st,Dn;const P=j.value.find(ao=>ao.projectName===d);if(!P)return g.trim();const re=P.threads.find(ao=>!ps(ao.cwd));return(((Te=re==null?void 0:re.cwd)==null?void 0:Te.trim())??((Dn=(st=P.threads[0])==null?void 0:st.cwd)==null?void 0:Dn.trim())??"")||g.trim()}function Fl(d){var re,ge;const g=j.value.find(Te=>Te.projectName===d),P=hi(d,((ge=(re=g==null?void 0:g.threads[0])==null?void 0:re.cwd)==null?void 0:ge.trim())??"");P&&(lt.value=P),gt.value&&de(!0),!wt.value&&$e.push({name:"home"})}function Ul(d){var P;let g="";for(const re of j.value){const ge=re.threads.find(Te=>Te.id===d);if((P=ge==null?void 0:ge.cwd)!=null&&P.trim()){g=ge.cwd.trim();break}}!g||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(g)}`,"_blank","noopener,noreferrer")}function s(){lt.value="",Pn.value="local",gt.value&&de(!0),!wt.value&&$e.push({name:"home"})}function u(d){Ze(d.projectName,d.displayName)}function p(d){Je(d.threadId,d.title)}async function y(d){await D(d),await Pa(),bo()}function A(d){F(d.projectName,d.toIndex)}function $(d){ct(d.threadId,d.state)}function L(d){G(d)}async function G(d){var re;const g=await Ee(d),P=((re=d.followUpMessageText)==null?void 0:re.trim())??"";if(!(!g||!P||wt.value))try{await E(P,[],[],"steer",[])}catch{}}async function se(d){const g=await k(d.threadId,d.turnIndex);g&&(await $e.push({name:"thread",params:{threadId:g}}),ce.value!==g&&await ft(g),gt.value&&de(!0))}function de(d){Qt.value!==d&&(Qt.value=d,Mm(d))}function Ve(d){if(d.defaultPrevented)return;if(d.key==="Escape"&&Gn.value){Gn.value=!1;return}if(!d.ctrlKey&&!d.metaKey||d.shiftKey||d.altKey)return;const g=d.key.toLowerCase();if(g==="b"){d.preventDefault(),de(!Qt.value);return}if(g==="j"&&Ye.name==="thread"&&ce.value){d.preventDefault(),ht();return}g==="j"&&wt.value&&An.value&&(d.preventDefault(),ht())}function ht(){if(Kr.value){if(wt.value){if(!An.value)return;Ot.value=!Ot.value,Ot.value||jr();return}_e(),V.value||jr()}}function pt(d){if(hr.value=d,!d){sr.value=!1,yo();return}sr.value=!0,yo(),vr=setTimeout(()=>{vr=null,_a.value||(sr.value=!1)},1500)}function Tt(){Ot.value=!1,jr()}function dn(){ce.value&&K(ce.value,!1),jr()}function jr(){hr.value=!1,sr.value=!1,yo()}function yo(){vr&&(clearTimeout(vr),vr=null)}async function pi(){try{const d=await Pb();Kr.value=d.available,d.available||(Ot.value=!1,ce.value&&K(ce.value,!1))}catch{Kr.value=!1,Ot.value=!1}}function Uo(d){var P,re;const g=d.target;if(g instanceof Node){if(hr.value){const ge=g instanceof Element?g:g.parentElement;ge!=null&&ge.closest(".thread-terminal-panel")||jr()}Gn.value&&((P=ir.value)!=null&&P.contains(g)||(re=Ir.value)!=null&&re.contains(g)||(Gn.value=!1))}}function aa(d){var P,re;if(!Gn.value)return;const g=d.target;g instanceof Node&&((P=ir.value)!=null&&P.contains(g)||(re=Ir.value)!=null&&re.contains(g)||(Gn.value=!1))}function sa(){if(!(typeof document>"u")&>.value){if(document.visibilityState==="hidden"){$r.value=Date.now(),Nr.value=!1;return}Ea()}}function ms(d){d.persisted&&Ea()}function vs(){Ye.name==="home"&&(Pa(),bo()),Ea()}function Ea(){typeof window>"u"||typeof document>"u"||!gt.value||document.visibilityState!=="visible"||Nr.value||$r.value===null||Date.now()-$r.value<ZI||(Nr.value=!0,$r.value=null,mi())}async function mi(){if(!eo.value){eo.value=!0;try{await je({includeSelectedThreadMessages:!0,awaitAncillaryRefreshes:!0}),await Kl()}finally{eo.value=!1}}}function gs(d){const g=d.text;Xe();const P=kr.value,re=d.mode==="queue"&&P&&P.threadId===ce.value?P.queueIndex:void 0;if(kr.value=null,wt.value){Dm(g,d.imageUrls,d.skills,d.fileAttachments);return}E(g,d.imageUrls,d.skills,d.mode,d.fileAttachments,re)}function vi(d){const g=J.value.findIndex(Te=>Te.id===d),P=g>=0?J.value[g]:void 0,re=mn.value;if(!P||!re||re.hasUnsavedDraft()&&!window.confirm("Replace the current draft with this queued message for editing?"))return;kr.value=ce.value?{threadId:ce.value,queueIndex:g}:null;const ge={text:P.text,imageUrls:[...P.imageUrls],fileAttachments:P.fileAttachments.map(Te=>({...Te})),skills:P.skills.map(Te=>({...Te}))};re.hydrateDraft(ge),oe(d)}function Xe(){if(!gt.value||wt.value)return;const d=()=>{var g;(g=vo.value)==null||g.jumpToLatest()};d(),sn(()=>{d(),!(typeof window>"u")&&window.requestAnimationFrame(()=>{d(),window.requestAnimationFrame(d)})})}function dr(d){lt.value=d.trim(),mt.value=""}function wo(d){Vn.value=d.trim()}async function Ac(d){const g=d.trim();if(!g||Ye.name!=="thread"){Kn.value=[],tn.value=null;return}Cr.value=!0;try{const P=await a0(g);Kn.value=P.options,tn.value=P.currentBranch}catch{Kn.value=[],tn.value=null}finally{Cr.value=!1}}function Qp(d){if(d==="__review__"){Sn.value=!Sn.value;return}if(d==="__detached_head__"||Cn.value)return;const g=d.trim();if(!g||g===(tn.value??""))return;const P=An.value.trim();P&&(Cn.value=!0,s0(P,g).then(re=>(tn.value=re||g,Sn.value=!1,Ac(P))).catch(re=>{const ge=re instanceof Error?re.message:"Failed to switch branch";window.alert(ge)}).finally(()=>{Cn.value=!1}))}async function Xp(){const d=await ql();if(!d)return;await bo();const g=lr.value.trim()||"New Project (1)",P=window.prompt(`Create project in ${d}`,g);if(P===null)return;const re=P.trim();if(!re)return;const ge=Mc(Pc(d,re));if(ge)try{const Te=await gu(ge,{createIfMissing:!0,label:""});if(!Te)return;lt.value=Te,U(fa(Te)),await Pa(),await bo()}catch(Te){const st=Te instanceof Error?Te.message:"Failed to create the project.";window.alert(st)}}async function Zp(){const d=lt.value.trim()||await ql();d&&(Xt.value=!1,cn.value=!0,zt.value="",await Bo(d),Dt.value||sn(()=>{var g;return(g=Mr.value)==null?void 0:g.focus()}))}function Ia(){Fe+=1,cn.value=!1,_n.value=!1,Dt.value="",zt.value="",Rr.value="",ys()}async function em(d){!d||_n.value||(zt.value="",await Bo(d))}function tm(){const d=Zn.value.trim();!cn.value||!d||Bo(d)}function nm(){const d=oa.value;!cn.value||!d||_n.value||Bo(d)}function rm(){if(!cn.value||_n.value||xn.value)return;const d=oa.value,g=Zn.value.trim();!d||d===g||Bo(d)}function om(){const d=oa.value,g=Zn.value.trim();if(d){if(d!==g){Bo(d);return}Bl(d)}}async function Bl(d=oa.value){const g=jt(d).trim();if(g){Dt.value="",xn.value=!0;try{const P=await gu(g,{createIfMissing:!1,label:""});if(!P){Dt.value="Failed to open the selected folder.";return}lt.value=P,U(fa(P)),await Pa(),await bo(),Ia()}catch(P){Dt.value=P instanceof Error?P.message:"Failed to open the selected folder."}finally{xn.value=!1}}}async function am(){if(mt.value="",Xt.value){ys();return}if(!cn.value){const d=lt.value.trim()||await ql();if(!d||(cn.value=!0,zt.value="",await Bo(d),Dt.value))return}Dt.value||(Ht.value=lr.value,Xt.value=!0,sn(()=>{var d;return(d=Qr.value)==null?void 0:d.focus()}))}function ys(){mt.value="",Ht.value="",Xt.value=!1}async function Ec(){const d=Ht.value.trim();if(!d)return;if(mt.value="",Dt.value){mt.value="Reload the current folder before creating a new one.";return}Kt.value=!0;const g=ti.value.trim(),P=Mc(Pc(g,d));if(!P){mt.value="Unable to determine where the new folder should be created.",Kt.value=!1;return}if(!ni.value){mt.value="Enter a single folder name.",Kt.value=!1;return}try{const re=await l0(P);if(!re){mt.value="Failed to create the folder.";return}mt.value="",zt.value="",await Bo(re),ys()}catch(re){mt.value=re instanceof Error?re.message:"Failed to create folder."}finally{Kt.value=!1}}async function sm(){var g;if(typeof window>"u")return!1;const d=((g=new URLSearchParams(window.location.search).get("openProjectPath"))==null?void 0:g.trim())??"";if(!d)return!1;try{const P=await gu(d,{createIfMissing:!1,label:""});if(!P)return!1;lt.value=P,U(fa(P)),await $e.replace({name:"home"}),await Pa();const re=new URL(window.location.href);return re.searchParams.delete("openProjectPath"),window.history.replaceState({},"",re.toString()),!0}catch{return!1}}async function ql(){const d=Ic();if(d)return d;try{const g=await mf();if(g)return Yr.value=g,g}catch{}return""}async function bo(){const d=Ic();if(!d){lr.value="New Project (1)";return}try{const g=await c0(d);lr.value=g.name||"New Project (1)"}catch{lr.value="New Project (1)"}}function Ic(){var P,re;const d=lt.value.trim();if(d)return cu(d);const g=((re=(P=ra.value[0])==null?void 0:P.value)==null?void 0:re.trim())??"";return g?cu(g):Yr.value.trim()}async function im(){try{Yr.value=await mf()}catch{Yr.value=""}}async function Pa(){try{const d=await ja();Wn.value={order:[...d.order],labels:{...d.labels}}}catch{Wn.value={order:[],labels:{}}}}async function Bo(d){const g=++Fe,P=jt(d).trim();Rr.value=P,Zn.value=P,Dt.value="",_n.value=!0;try{const re=await i0(d,{showHidden:ta.value});if(g!==Fe)return;Rr.value=re.path,Zn.value=re.path,qe.value=re.parentPath,ke.value=re.entries}catch(re){if(g!==Fe)return;Dt.value=re instanceof Error?re.message:"Failed to load local folders.",qe.value=cu(Zn.value),ke.value=[],ys()}finally{g===Fe&&(_n.value=!1)}}function Pc(d,g){const P=jt(d).trim(),re=jt(g).trim().replace(/^[\\/]+/u,"");if(!P||!re)return"";const ge=P.includes("\\")&&!P.includes("/")?"\\":"/";if(/^[a-zA-Z]:[\\/]?$/u.test(P))return`${P.slice(0,2)}${ge}${re}`;if(/^\/+$/u.test(P))return`/${re}`;const Te=P.replace(/[\\/]+$/u,"");return Te?`${Te}${ge}${re}`:""}function Mc(d){const g=jt(d).trim();if(!g)return"";const P=g.match(/^\\\\([^\\/]+)[\\/]+([^\\/]+)([\\/].*)?$/u);if(P){const[,ge,Te,st=""]=P,Dn=Hl(st.split(/[\\/]+/u));return Dn.length>0?`\\\\${ge}\\${Te}\\${Dn.join("\\")}`:`\\\\${ge}\\${Te}`}const re=g.match(/^([a-zA-Z]:)([\\/].*)?$/u);if(re){const[,ge,Te=""]=re,st=g.includes("\\")&&!g.includes("/")?"\\":"/",Dn=Hl(Te.split(/[\\/]+/u));return Dn.length>0?`${ge}${st}${Dn.join(st)}`:`${ge}${st}`}if(g.startsWith("/")){const ge=Hl(g.split("/"));return ge.length>0?`/${ge.join("/")}`:"/"}return g}function Hl(d){const g=[];for(const P of d){const re=P.trim();if(!(!re||re===".")){if(re===".."){g.length>0&&g.pop();continue}g.push(re)}}return g}function lm(d){ye(d.draggedId,d.targetId)}function Rc(d){Re(Lo.value,d)}function $c(d){ve(d)}function Nc(d){Pe(d)}function um(){ne()}function cm(d){const g=d.turnId.trim();if(g.length>0){const P=[...Dr.value].reverse().find(re=>{var ge;return re.role==="user"&&(((ge=re.turnId)==null?void 0:ge.trim())??"")===g&&re.text.trim().length>0});P!=null&&P.text&&mn.value&&mn.value.appendTextToDraft(P.text)}Be(d.turnId)}function dm(d){wt.value||!ce.value||(pe("default"),Xe(),E("Implement",[],[],"steer",[],void 0,"default"))}function fm(){if(wt.value||Tn.value||typeof document>"u"||!te.value||Dr.value.length===0)return;const d=hm(),g=pm(),P=new Blob([d],{type:"text/markdown;charset=utf-8"}),re=URL.createObjectURL(P),ge=document.createElement("a");ge.href=re,ge.download=g,document.body.appendChild(ge),ge.click(),document.body.removeChild(ge),window.setTimeout(()=>URL.revokeObjectURL(re),0)}function hm(){var P,re,ge;const d=[],g=((re=(P=te.value)==null?void 0:P.title)==null?void 0:re.trim())||"Untitled thread";d.push(`# ${mm(g)}`),d.push(""),d.push(`- Exported: ${new Date().toISOString()}`),d.push(`- Thread ID: ${((ge=te.value)==null?void 0:ge.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 Dn=Te.text.trim();if(Dn&&(d.push(Dn),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 ao of Te.fileAttachments)d.push(`- ${ao.path}`);d.push("")}if(Te.images&&Te.images.length>0){d.push("Images:");for(const ao of Te.images)d.push(`- ${ao}`);d.push("")}}return`${d.join(`
|
|
61
|
-
`).trimEnd()}
|
|
62
|
-
`}function pm(){var ge,Te;const P=(((Te=(ge=te.value)==null?void 0:ge.title)==null?void 0:Te.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",re=new Date().toISOString().replace(/[:.]/g,"-");return`${P}-${re}.md`}function mm(d){return d.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function zl(d,g){if(typeof window>"u")return g;const P=window.localStorage.getItem(d);return P===null?g:P==="1"}function vm(){if(typeof window>"u")return"system";const d=window.localStorage.getItem(qf);return d==="light"||d==="dark"?d:"system"}function gm(){if(typeof window>"u")return"steer";const d=window.localStorage.getItem(Bf);return d==="steer"||d==="queue"?d:"queue"}function ym(){if(typeof window>"u")return"standard";const d=window.localStorage.getItem(Wf);return d==="standard"||d==="wide"||d==="extra-wide"?d:"standard"}function wm(){yn.value=!yn.value,window.localStorage.setItem(Uf,yn.value?"1":"0")}function bm(){nn.value=nn.value==="steer"?"queue":"steer",window.localStorage.setItem(Bf,nn.value)}function _m(){const d=["system","light","dark"],g=d.indexOf(yt.value);yt.value=d[(g+1)%d.length],window.localStorage.setItem(qf,yt.value),gi()}function Tm(){const d=["standard","wide","extra-wide"],g=d.indexOf(yr.value);yr.value=d[(g+1)%d.length],window.localStorage.setItem(Wf,yr.value)}function km(){rn.value=!rn.value,window.localStorage.setItem(Hf,rn.value?"1":"0")}function Sm(){Yn.value=!Yn.value,window.localStorage.setItem(zf,Yn.value?"1":"0")}async function Cm(d){if(!kt.value){kt.value=!0;try{if(d==="codex"){an.value="codex";const g=await hf(!1);wn.value=g.enabled}else if(d==="openrouter"){an.value="openrouter";const g=await hf(!0);wn.value=g.enabled,await Ra("","",{wireApi:Xn.value,provider:"openrouter"})}else d==="opencode-zen"?(an.value="opencode-zen",await Ra("",br.value.trim(),{wireApi:"chat",provider:"opencode-zen"}),wn.value=!0):d==="custom"&&(an.value="custom",Qn.value.trim()&&Nn.value.trim()&&(await Ra(Qn.value.trim(),Nn.value.trim(),{wireApi:bn.value}),wn.value=!0));on.value="",await je({includeSelectedThreadMessages:!1,providerChanged:!0,awaitAncillaryRefreshes:!0}),Ye.name==="thread"&&$e.push({name:"home"})}catch(g){on.value=g instanceof Error?g.message:"Failed to switch provider"}finally{kt.value=!1}}}async function Vl(){if(bt.value)return;const d=Qn.value.trim();if(d){bt.value=!0;try{on.value="",await Ra(d,Nn.value.trim(),{wireApi:bn.value}),wn.value=!0,await je({includeSelectedThreadMessages:!1,providerChanged:!0,awaitAncillaryRefreshes:!0})}catch(g){on.value=g instanceof Error?g.message:"Failed to save custom endpoint"}finally{bt.value=!1}}}async function Oc(d){if(bt.value||kt.value||Xn.value===d)return;const g=Xn.value;Xn.value=d,bt.value=!0;try{on.value="",await Ra("","",{wireApi:d,provider:"openrouter"}),wn.value=!0,await je({includeSelectedThreadMessages:!1,providerChanged:!0,awaitAncillaryRefreshes:!0})}catch(P){Xn.value=g,on.value=P instanceof Error?P.message:"Failed to save OpenRouter API format"}finally{bt.value=!1}}async function Dc(){if(bt.value)return;const d=br.value.trim();if(d){bt.value=!0;try{on.value="",await Ra("",d,{wireApi:"chat",provider:"opencode-zen"}),wn.value=!0,await je({includeSelectedThreadMessages:!1,providerChanged:!0,awaitAncillaryRefreshes:!0})}catch(g){on.value=g instanceof Error?g.message:"Failed to save OpenCode Zen config"}finally{bt.value=!1}}}async function Lc(){if(!bt.value){bt.value=!0;try{const d=It.value.trim();await pf(d),It.value="",await Wl(),await je({includeSelectedThreadMessages:!1})}catch{}finally{bt.value=!1}}}async function xm(){if(!bt.value){bt.value=!0;try{await pf(""),It.value="",await Wl(),await je({includeSelectedThreadMessages:!1})}catch{}finally{bt.value=!1}}}async function Wl(){try{const d=await Gb();wn.value=d.enabled,go.value=d.customKey??!1,Zr.value=d.maskedKey??null,d.enabled?d.provider==="opencode-zen"?an.value="opencode-zen":d.provider==="custom"?(an.value="custom",Qn.value=d.customBaseUrl??"",bn.value=d.wireApi==="chat"?"chat":"responses"):(an.value="openrouter",Xn.value=d.wireApi==="chat"?"chat":"responses"):an.value="codex"}catch{}}function Am(d){const P=Gl(d.trim())||"auto";wr.value=P,window.localStorage.setItem(Vf,P)}function Em(){var P;if(typeof window>"u")return"auto";const d=((P=window.localStorage.getItem(Vf))==null?void 0:P.trim())||"auto";return Gl(d)||"auto"}function Im(){const d=[{value:"auto",label:o("Auto-detect")}],g=new Set(["auto"]);function P(ge){const Te=x[ge]||ge;return`${Te.charAt(0).toUpperCase()+Te.slice(1)} (${ge})`}for(const ge of typeof navigator<"u"?navigator.languages??[]:[]){const Te=Gl(ge);!Te||g.has(Te)||(g.add(Te),d.push({value:Te,label:`Preferred: ${P(Te)}`}))}for(const ge of Object.keys(x))g.has(ge)||(g.add(ge),d.push({value:ge,label:P(ge)}));const re=wr.value.trim();return re&&!g.has(re)&&d.push({value:re,label:P(re)}),d}function Gl(d){const g=d.trim().toLowerCase();if(!g||g==="auto")return"";if(g in x)return g;const P=g.split("-")[0]??g;return P in x?P:""}function gi(){const d=document.documentElement;if(yt.value==="dark")d.classList.add("dark");else if(yt.value==="light")d.classList.remove("dark");else{const g=window.matchMedia("(prefers-color-scheme: dark)").matches;d.classList.toggle("dark",g)}}function Pm(){return typeof window>"u"?!1:window.localStorage.getItem(jf)==="1"}function Mm(d){typeof window>"u"||window.localStorage.setItem(jf,d?"1":"0")}function Rm(){if(typeof window>"u")return!0;const d=window.localStorage.getItem(Ff);return d===null?!0:d==="1"}function $m(){Rn.value=!Rn.value,!(typeof window>"u")&&window.localStorage.setItem(Ff,Rn.value?"1":"0")}function Nm(d,g){const P=(d??"").trim();return P.length>0?P:g.trim()||"message"}function jc(d){pe(d)}async function Om(){await $e.isReady(),Ye.name==="thread"&&_t.value&&Me(_t.value),await je({includeSelectedThreadMessages:Ye.name==="thread"}),Aa({silent:!0}),await sm(),Ft.value=!0,await Kl(),Y()}async function Kl(){if(pr.value){Sr=!0;return}pr.value=!0;try{do{if(Sr=!1,Ye.name==="home"||Ye.name==="skills"){ce.value!==""&&await ft("");continue}if(Ye.name==="thread"){const d=_t.value;if(!d)continue;ce.value!==d?await ft(d):et(d,{silent:!0})}}while(Sr)}finally{pr.value=!1}}vt(()=>[Ye.name,_t.value,Ue.value,ce.value],async()=>{Ft.value&&await Kl()}),vt(()=>ce.value,async d=>{if(Ft.value&&!pr.value&&!(wt.value||Tn.value)){if(!d){Ye.name!=="home"&&await $e.replace({name:"home"});return}Ye.name==="thread"&&_t.value===d||await $e.replace({name:"thread",params:{threadId:d}})}}),vt(()=>ra.value,d=>{if(d.length===0){lt.value="",bo();return}const g=lt.value.trim();g&&(d.some(re=>re.value===g)||(lt.value="")),bo()},{immediate:!0}),vt(()=>lt.value,()=>{qt.value={phase:"idle",title:"",message:""},bo()}),vt(()=>[Pn.value,lt.value],([d,g])=>{d==="worktree"&&Fc(g)},{immediate:!0}),vt(()=>Pn.value,d=>{var g;if(d==="local"){qt.value={phase:"idle",title:"",message:""};const P=lt.value.trim();if(P&&ps(P)){const re=((g=te.value)==null?void 0:g.projectName)??fa(P),ge=hi(re,"");ge&&(lt.value=ge)}return}Fc(lt.value)}),vt(()=>Ye.name,d=>{d!=="home"&&(qt.value={phase:"idle",title:"",message:""}),d!=="thread"&&(Sn.value=!1)}),vt(()=>ce.value,()=>{qt.value={phase:"idle",title:"",message:""}}),vt(()=>[Ye.name,An.value],([d,g])=>{if(d!=="thread"){Kn.value=[],tn.value=null;return}Ac(g)},{immediate:!0}),vt(Or,d=>{typeof document>"u"||(document.title=d)},{immediate:!0}),vt(gt,d=>{d&&!Qt.value&&de(!0)},{immediate:!0});async function Dm(d,g=[],P=[],re=[]){try{qt.value={phase:"idle",title:"",message:""};let ge=lt.value;if(Pn.value==="worktree"){qt.value={phase:"running",title:o("Creating worktree"),message:o("Creating a worktree and running setup.")};try{const st=await r0(lt.value,Vn.value);ge=st.cwd,lt.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(!ge.trim()){const st=await u0(d);ge=st.cwd,lt.value=st.cwd}const Te=await z(d,ge,g,P,re);if(!Te)return;await $e.replace({name:"thread",params:{threadId:Te}}),Xe()}catch{}}function Lm(d){var re;if((re=d.prompt)!=null&&re.trim())return d.prompt.trim();const g=d.displayName.trim()||d.name.trim(),P=d.kind==="skill"?"skill":d.kind==="plugin"?"plugin":d.kind==="composio"?"Composio connector":"app";return`Test ${g} ${P}. Give me a list of what it can do and one useful example.`}function jm(d){return`${d.kind}:${d.name}:${d.skillPath??""}`}async function Fm(d){var re;if(zn.value)return;zn.value=jm(d);const g=Lm(d),P=(re=d.attachedSkills)!=null&&re.length?d.attachedSkills:d.kind==="skill"&&d.skillPath?[{name:d.name,path:d.skillPath}]:[];try{const ge=Qs.value.trim()||An.value.trim(),Te=await z(g,ge,[],P,[]);if(!Te)return;await $e.replace({name:"thread",params:{threadId:Te}}),Xe()}catch{}finally{zn.value=""}}async function Fc(d){var P;const g=d.trim();if(!g){Jr.value=[],Vn.value="";return}Wt.value=!0;try{const re=await o0(g);Jr.value=re;const ge=Vn.value.trim();if(!(ge.length>0&&re.some(st=>st.value===ge))){const st=re.find(Dn=>Dn.value.trim()==="main");Vn.value=(st==null?void 0:st.value)??((P=re[0])==null?void 0:P.value)??""}}catch{Jr.value=[],Vn.value=""}finally{Wt.value=!1}}return(d,g)=>(C(),rt(Dw,{"is-sidebar-collapsed":Qt.value,onCloseSidebar:g[26]||(g[26]=P=>de(!0))},{sidebar:ut(()=>[m("section",rA,[m("div",oA,[Qt.value?ie("",!0):(C(),rt(Ef,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":Qt.value,"show-new-thread-button":!0,onToggleSidebar:g[0]||(g[0]=P=>de(!Qt.value)),onStartNewThread:s},{default:ut(()=>[m("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":xt.value,"aria-label":T(o)("Search threads"),title:T(o)("Search threads"),onClick:li},[Ne(If,{class:"sidebar-search-toggle-icon"})],8,aA)]),_:1},8,["is-sidebar-collapsed"])),!Qt.value&&xt.value?(C(),R("div",sA,[Ne(If,{class:"sidebar-search-bar-icon"}),ln(m("input",{ref_key:"sidebarSearchInputRef",ref:Gt,"onUpdate:modelValue":g[1]||(g[1]=P=>Ut.value=P),class:"sidebar-search-input",type:"text",placeholder:T(o)("Filter threads..."),onKeydown:ui},null,40,iA),[[kn,Ut.value]]),Ut.value.length>0?(C(),R("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":T(o)("Clear search"),onClick:xl},[Ne(vx,{class:"sidebar-search-clear-icon"})],8,lA)):ie("",!0)])):ie("",!0),Qt.value?ie("",!0):(C(),R("button",{key:2,class:it(["sidebar-skills-link",{"is-active":Tn.value}]),type:"button",onClick:g[2]||(g[2]=P=>{T($e).push({name:"skills"}),T(gt)&&de(!0)})},[m("span",uA,[Ne(ji)]),m("span",cA,[m("span",dA,N(T(o)("Skills")),1),m("span",fA,N(T(o)("Plugins, apps, MCPs")),1)])],2)),Qt.value?ie("",!0):(C(),rt(Tk,{key:3,groups:T(j),"project-display-name-by-id":T(q),"selected-thread-id":T(ce),"is-loading":T(Ue),"search-query":Ut.value,"search-matched-thread-ids":Mn.value,"filter-active":xt.value,onSelect:Al,onArchive:Ll,onStartNewThread:Fl,onRenameProject:u,onBrowseThreadFiles:Ul,onRenameThread:p,onForkThread:jl,onRemoveProject:y,onReorderProject:A,onExportThread:El,onStartNewChat:s,onToggleFilter:li},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids","filter-active"]))]),Qt.value?ie("",!0):(C(),R("div",{key:0,ref_key:"settingsAreaRef",ref:mr,class:"sidebar-settings-area",onClick:aa},[Ne(sp,{name:"settings-panel"},{default:ut(()=>[Gn.value?(C(),R("div",{key:0,ref_key:"settingsPanelRef",ref:ir,class:"sidebar-settings-panel",onClick:g[16]||(g[16]=tt(()=>{},["stop"]))},[m("div",hA,[m("div",pA,[m("div",mA,[m("button",{class:"sidebar-settings-account-collapse",type:"button","aria-expanded":!Rn.value,title:Rn.value?T(o)("Expand accounts"):T(o)("Collapse accounts"),onClick:$m},[m("span",gA,N(Rn.value?"▸":"▾"),1)],8,vA),m("span",yA,N(T(o)("Accounts")),1),m("span",wA,N(vn.value.length),1)]),m("button",{class:"sidebar-settings-account-refresh",type:"button",disabled:ur.value||Jn.value,onClick:Dl},N(ur.value?T(o)("Reloading…"):T(o)("Reload")),9,bA)]),Rn.value?ie("",!0):(C(),R(Ge,{key:0},[gn.value?(C(),R("p",_A,N(gn.value),1)):ie("",!0),vn.value.length===0?(C(),R("p",TA,N(T(o)("Run `codex login`, then click reload.")),1)):(C(),R("div",kA,[(C(!0),R(Ge,null,Vt(vn.value,P=>(C(),R("article",{key:P.accountId,class:it(["sidebar-settings-account-item",{"is-active":P.isActive,"is-unavailable":oo(P),"is-confirming-remove":Sa(P),"is-remove-visible":ci(P)}]),title:Lr(P),onMouseenter:re=>Rl(P.accountId),onMouseleave:re=>$l(P.accountId)},[m("div",CA,[m("p",xA,N(P.email||T(o)("Account")),1),m("p",AA,N(fs(P)),1),m("p",EA,N(xa(P)),1),m("p",IA," Workspace "+N(Il(P.accountId)),1)]),m("div",PA,[m("button",{class:"sidebar-settings-account-switch",type:"button",disabled:hs(P)||P.isActive||oo(P),onClick:re=>di(P.accountId)},N(Ca(P)),9,MA),m("button",{class:it(["sidebar-settings-account-remove",{"is-visible":ci(P),"is-confirming":Sa(P)}]),type:"button",disabled:hs(P),onClick:re=>fi(P.accountId)},N(Ml(P)),11,RA)])],42,SA))),128))]))],64))]),m("button",{class:"sidebar-settings-row",type:"button",title:v.sendWithEnter,onClick:wm},[m("span",NA,N(T(o)("Require ⌘ + enter to send")),1),m("span",{class:it(["sidebar-settings-toggle",{"is-on":!yn.value}])},null,2)],8,$A),m("button",{class:"sidebar-settings-row",type:"button",title:v.inProgressSendMode,onClick:bm},[m("span",DA,N(T(o)("When busy, send as")),1),m("span",LA,N(nn.value==="steer"?T(o)("Steer"):T(o)("Queue")),1)],8,OA),m("button",{class:"sidebar-settings-row",type:"button",title:v.appearance,onClick:_m},[m("span",FA,N(T(o)("Appearance")),1),m("span",UA,N(yt.value==="system"?T(o)("System"):yt.value==="dark"?T(o)("Dark"):T(o)("Light")),1)],8,jA),m("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:T(o)("Choose the interface language for the app.")},[m("span",qA,N(T(o)("UI language")),1),m("select",{class:"sidebar-settings-provider-select",value:T(i),onChange:g[3]||(g[3]=P=>T(c)(P.target.value))},[(C(!0),R(Ge,null,Vt(T(l),P=>(C(),R("option",{key:P.value,value:P.value},N(P.label),9,zA))),128))],40,HA)],8,BA),m("button",{class:"sidebar-settings-row",type:"button",title:v.chatWidth,onClick:Tm},[m("span",WA,N(T(o)("Chat width")),1),m("span",GA,N(ai.value),1)],8,VA),m("button",{class:"sidebar-settings-row",type:"button",title:v.dictationClickToToggle,onClick:km},[m("span",JA,N(T(o)("Click to toggle dictation")),1),m("span",{class:it(["sidebar-settings-toggle",{"is-on":rn.value}])},null,2)],8,KA),m("button",{class:"sidebar-settings-row",type:"button",title:v.dictationAutoSend,onClick:Sm},[m("span",QA,N(T(o)("Auto send dictation")),1),m("span",{class:it(["sidebar-settings-toggle",{"is-on":Yn.value}])},null,2)],8,YA),m("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:T(o)("Choose the API provider for the Codex backend")},[m("span",ZA,N(T(o)("Provider")),1),m("select",{class:"sidebar-settings-provider-select",value:an.value,disabled:kt.value,onChange:g[4]||(g[4]=P=>Cm(P.target.value))},[...g[27]||(g[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,eE)],8,XA),on.value?(C(),R("div",tE,N(on.value),1)):ie("",!0),an.value==="openrouter"?(C(),R("div",nE,[m("div",rE,[m("span",oE,N(T(o)("OpenRouter API key")),1),m("a",aE,N(T(o)("Get API key")),1)]),m("div",sE,[go.value&&!It.value?(C(),R(Ge,{key:0},[m("span",iE,N(Zr.value),1),m("button",{class:"sidebar-settings-key-clear",type:"button",disabled:bt.value,title:T(o)("Remove custom key, use community keys"),onClick:xm},"✕",8,lE)],64)):(C(),R(Ge,{key:1},[ln(m("input",{"onUpdate:modelValue":g[5]||(g[5]=P=>It.value=P),class:"sidebar-settings-key-input",type:"password",placeholder:T(o)("sk-or-v1-... (optional, uses free keys if empty)"),onKeydown:un(Lc,["enter"])},null,40,uE),[[kn,It.value]]),m("button",{class:"sidebar-settings-key-save",type:"button",disabled:bt.value||!It.value.trim(),onClick:Lc},N(bt.value?"...":T(o)("Set")),9,cE)],64))]),m("div",dE,[m("span",fE,N(T(o)("API format")),1),m("div",{class:"sidebar-settings-segmented",role:"group","aria-label":T(o)("OpenRouter API format")},[m("button",{type:"button",class:it(["sidebar-settings-segmented-option",{"is-active":Xn.value==="responses"}]),disabled:bt.value||kt.value,onClick:g[6]||(g[6]=P=>Oc("responses"))}," Responses ",10,pE),m("button",{type:"button",class:it(["sidebar-settings-segmented-option",{"is-active":Xn.value==="chat"}]),disabled:bt.value||kt.value,onClick:g[7]||(g[7]=P=>Oc("chat"))}," Completions ",10,mE)],8,hE)])])):ie("",!0),an.value==="opencode-zen"?(C(),R("div",vE,[m("div",gE,[m("span",yE,N(T(o)("OpenCode Zen API key")),1),m("a",wE,N(T(o)("Get API key")),1)]),m("div",bE,[ln(m("input",{"onUpdate:modelValue":g[8]||(g[8]=P=>br.value=P),class:"sidebar-settings-key-input",type:"password",placeholder:T(o)("sk-..."),onKeydown:un(Dc,["enter"])},null,40,_E),[[kn,br.value]]),m("button",{class:"sidebar-settings-key-save",type:"button",disabled:bt.value||!br.value.trim(),onClick:Dc},N(bt.value?"...":T(o)("Save")),9,TE)])])):ie("",!0),an.value==="custom"?(C(),R("div",kE,[m("span",SE,N(T(o)("Custom endpoint URL")),1),m("div",CE,[ln(m("input",{"onUpdate:modelValue":g[9]||(g[9]=P=>Qn.value=P),class:"sidebar-settings-key-input",type:"url",placeholder:T(o)("https://api.example.com/v1"),onKeydown:un(Vl,["enter"])},null,40,xE),[[kn,Qn.value]])]),m("span",AE,N(T(o)("API key")),1),m("div",EE,[ln(m("input",{"onUpdate:modelValue":g[10]||(g[10]=P=>Nn.value=P),class:"sidebar-settings-key-input",type:"password",placeholder:T(o)("Bearer token (optional)"),onKeydown:un(Vl,["enter"])},null,40,IE),[[kn,Nn.value]]),m("button",{class:"sidebar-settings-key-save",type:"button",disabled:bt.value||!Qn.value.trim(),onClick:Vl},N(bt.value?"...":T(o)("Save")),9,PE)]),m("div",ME,[m("span",RE,N(T(o)("API format")),1),m("div",{class:"sidebar-settings-segmented",role:"group","aria-label":T(o)("Custom endpoint API format")},[m("button",{type:"button",class:it(["sidebar-settings-segmented-option",{"is-active":bn.value==="responses"}]),onClick:g[11]||(g[11]=P=>bn.value="responses")}," Responses ",2),m("button",{type:"button",class:it(["sidebar-settings-segmented-option",{"is-active":bn.value==="chat"}]),onClick:g[12]||(g[12]=P=>bn.value="chat")}," Completions ",2)],8,$E)])])):ie("",!0),m("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:v.dictationLanguage},[m("span",OE,N(T(o)("Dictation language")),1),Ne(qa,{class:"sidebar-settings-language-dropdown","model-value":wr.value,options:Pr.value,placeholder:T(o)("Auto-detect"),"open-direction":"up","enable-search":!0,"search-placeholder":T(o)("Search language..."),"onUpdate:modelValue":Am},null,8,["model-value","options","placeholder","search-placeholder"])],8,NE),m("button",{class:"sidebar-settings-row",type:"button","aria-live":"polite",onClick:g[13]||(g[13]=P=>M.value=!M.value)},[m("span",DE,N(T(o)("Telegram")),1),m("span",LE,N(si.value),1)]),M.value?(C(),R("div",jE,[m("label",FE,[m("span",UE,N(T(o)("Bot token")),1),ln(m("input",{"onUpdate:modelValue":g[14]||(g[14]=P=>B.value=P),class:"sidebar-settings-input",type:"password",placeholder:"123456:ABCDEF",autocomplete:"off",spellcheck:"false"},null,512),[[kn,B.value]])]),m("label",BE,[m("span",qE,N(T(o)("Allowed Telegram user IDs")),1),ln(m("textarea",{"onUpdate:modelValue":g[15]||(g[15]=P=>Q.value=P),class:"sidebar-settings-textarea",rows:"3",placeholder:`123456789
|
|
63
|
-
987654321`,spellcheck:"false"},null,512),[[kn,Q.value]])]),m("div",HE,N(T(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),Ie.value?(C(),R("div",zE,N(Ie.value),1)):ie("",!0),m("div",VE,[m("button",{class:"sidebar-settings-telegram-save",type:"button",disabled:St.value,onClick:Cl},N(St.value?T(o)("Saving…"):T(o)("Save Telegram config")),9,WE)])])):ie("",!0),pl.value?(C(),R("div",{key:5,class:"sidebar-settings-row sidebar-settings-context-row","data-state":Zs.value,title:wl.value},[m("span",KE,N(T(o)("Context")),1),m("span",{class:"sidebar-settings-context-value","data-state":Zs.value},[ya(N(gl.value)+" ",1),m("span",YE,N(yl.value),1)],8,JE)],8,GE)):ie("",!0),m("div",QE,[Ne(jC,{snapshots:T(Le)},null,8,["snapshots"])]),m("div",{class:"sidebar-settings-build-label","aria-label":T(o)("Worktree name and version")}," WT "+N(T(f))+" · v"+N(T(h)),9,XE)],512)):ie("",!0)]),_:1}),m("button",{ref_key:"settingsButtonRef",ref:Ir,class:"sidebar-settings-button",type:"button",onClick:g[17]||(g[17]=tt(P=>Gn.value=!Gn.value,["stop"]))},[Ne(lx,{class:"sidebar-settings-icon"}),m("span",null,N(T(o)("Settings")),1),m("span",ZE,N(T(f))+" · v"+N(T(h)),1)],512)],512))])]),content:ut(()=>[m("section",{class:it(["content-root",{"is-virtual-keyboard-open":hl.value,"is-terminal-open":ss.value}]),style:Io(cs.value)},[_a.value?(C(),R("span",eI)):ie("",!0),Ne(Ak,{title:On.value,accent:Tn.value},{leading:ut(()=>[Qt.value||T(gt)?(C(),rt(Ef,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":Qt.value,"show-new-thread-button":!0,onToggleSidebar:g[18]||(g[18]=P=>de(!Qt.value)),onStartNewThread:s},null,8,["is-sidebar-collapsed"])):ie("",!0),Tn.value?(C(),R("span",tI,[Ne(ji)])):ie("",!0)]),actions:ut(()=>[fl.value?(C(),R("button",{key:0,class:"content-header-terminal-toggle",type:"button","aria-pressed":ss.value,title:`${T(o)("Toggle terminal")} (${Fo.value})`,"aria-label":T(o)("Toggle terminal"),onClick:ht},[Ne(fx,{class:"content-header-terminal-toggle-icon"}),m("span",rI,N(Fo.value),1)],8,nI)):ie("",!0),T(Ye).name==="thread"&&T(ce)?(C(),rt(qa,{key:1,class:it(["content-header-branch-dropdown",{"is-review-open":Sn.value}]),"model-value":bl.value,options:_l.value,disabled:Cr.value||Cn.value,"enable-search":!0,"search-placeholder":T(o)("Search branches..."),"onUpdate:modelValue":Qp},null,8,["class","model-value","options","disabled","search-placeholder"])):ie("",!0)]),_:1},8,["title","accent"]),m("section",oI,[Tn.value?(C(),rt(T(a),{key:0,cwd:Qs.value,"thread-id":_t.value,"try-in-flight-key":zn.value,onSkillsChanged:ro,onTryItem:Fm},null,8,["cwd","thread-id","try-in-flight-key"])):wt.value?(C(),R("div",aI,[m("div",sI,[m("p",iI,N(T(o)("Let's build")),1),Ne(qa,{class:"new-thread-folder-dropdown","model-value":lt.value,options:ra.value,placeholder:T(o)("Choose folder"),"enable-search":!0,"search-placeholder":T(o)("Quick search project"),disabled:!1,"onUpdate:modelValue":dr},null,8,["model-value","options","placeholder","search-placeholder"]),lt.value?(C(),R("p",{key:0,class:"new-thread-folder-selected",title:lt.value},N(T(o)("Selected folder"))+": "+N(lt.value),9,lI)):ie("",!0),m("div",uI,[m("button",{class:"new-thread-folder-action new-thread-folder-action-primary",type:"button",onClick:Zp},N(T(o)("Select folder")),1),m("button",{class:"new-thread-folder-action",type:"button",onClick:Xp},N(T(o)("Create Project")),1)]),Xr.value?(C(),R("section",cI,[m("div",dI,[m("div",fI,[m("span",hI,[Ne(ji)]),m("p",pI,N(T(o)("New in Codex")),1)]),m("h2",mI,N(T(o)("Plugins are here")),1),m("p",vI,N(T(o)("Hook Codex up to Gmail, Calendar, GitHub, Slack, Browser Use, and more so it can actually help with real work right away.")),1),g[28]||(g[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",gI,[m("button",{class:"new-thread-launch-card-button new-thread-launch-card-button-primary",type:"button",onClick:vl},N(T(o)("Explore Plugins & Apps")),1),m("button",{class:"new-thread-launch-card-button",type:"button",onClick:Xs},N(T(o)("Dismiss")),1)])])):ie("",!0),(C(),rt(pa,{to:"body"},[cn.value?(C(),R("div",{key:0,class:"new-thread-open-folder-overlay",onClick:tt(Ia,["self"])},[m("div",{class:"new-thread-open-folder",role:"dialog","aria-modal":"true","aria-label":T(o)("Select folder"),onKeydown:un(tt(Ia,["prevent"]),["esc"])},[m("div",wI,[m("p",bI,N(T(o)("Select folder")),1),m("button",{class:"new-thread-open-folder-close",type:"button",onClick:Ia},N(T(o)("Cancel")),1)]),m("p",_I,N(T(o)("Current folder")),1),m("div",TI,[ln(m("input",{ref_key:"existingFolderPathInputRef",ref:Mr,"onUpdate:modelValue":g[19]||(g[19]=P=>Rr.value=P),class:"new-thread-open-folder-path",type:"text",placeholder:T(o)("Current folder"),title:Rr.value||T(o)("Unavailable"),disabled:_n.value||xn.value,onBlur:rm,onKeydown:[un(tt(om,["prevent"]),["enter"]),un(tt(Ia,["prevent"]),["esc"])]},null,40,kI),[[kn,Rr.value]]),m("button",{class:"new-thread-folder-action new-thread-folder-action-primary",type:"button",disabled:!oa.value||_n.value||xn.value,onClick:g[20]||(g[20]=P=>Bl())},N(xn.value?T(o)("Opening…"):T(o)("Open")),9,SI)]),m("div",CI,[m("label",xI,[ln(m("input",{"onUpdate:modelValue":g[21]||(g[21]=P=>ta.value=P),class:"new-thread-open-folder-toggle-input",type:"checkbox",onChange:tm},null,544),[[cy,ta.value]]),m("span",null,N(T(o)("Show hidden folders")),1)]),m("button",{class:it(["new-thread-folder-action",{"new-thread-folder-action-primary":Xt.value}]),type:"button","aria-pressed":Xt.value,disabled:!Zn.value||_n.value||xn.value||Kt.value||!!Dt.value&&!Xt.value,onClick:am},N(T(o)("New folder")),11,AI)]),Xt.value?(C(),R("div",EI,[m("div",II,[ln(m("input",{ref_key:"createFolderInputRef",ref:Qr,"onUpdate:modelValue":g[22]||(g[22]=P=>Ht.value=P),class:"new-thread-open-folder-create-input",type:"text",placeholder:T(o)("Folder name"),onKeydown:[un(tt(Ec,["prevent"]),["enter"]),un(tt(ys,["prevent"]),["esc"])]},null,40,PI),[[kn,Ht.value]]),m("button",{class:"new-thread-folder-action new-thread-folder-action-primary new-thread-open-folder-create-submit",type:"button",disabled:!Tl.value||Kt.value,onClick:Ec},N(kl.value),9,MI)]),mt.value?(C(),R("p",RI,N(mt.value),1)):ie("",!0)])):ie("",!0),ln(m("input",{ref_key:"existingFolderFilterInputRef",ref:Do,"onUpdate:modelValue":g[23]||(g[23]=P=>zt.value=P),class:"new-thread-open-folder-filter",type:"text",placeholder:T(o)("Filter folders..."),onKeydown:un(tt(Ia,["prevent"]),["esc"])},null,40,$I),[[kn,zt.value]]),Dt.value?(C(),R("div",NI,[m("p",OI,N(Dt.value),1),m("button",{class:"new-thread-folder-action",type:"button",disabled:_n.value||xn.value,onClick:nm},N(T(o)("Retry")),9,DI)])):ie("",!0),_n.value?(C(),R("p",LI,N(T(o)("Loading folders…")),1)):!Dt.value&&no.value.length===0?(C(),R("p",jI,N(zt.value.trim()?T(o)("No folders match this filter."):T(o)("No subfolders found here.")),1)):no.value.length>0?(C(),R("ul",FI,[(C(!0),R(Ge,null,Vt(no.value,P=>(C(),R("li",{key:P.key,class:"new-thread-open-folder-item"},[m("button",{class:"new-thread-open-folder-item-main",type:"button",title:P.path,disabled:_n.value||xn.value,onClick:re=>em(P.path)},[m("span",BI,N(P.name),1)],8,UI),P.kind==="directory"?(C(),R("button",{key:0,class:"new-thread-open-folder-item-open",type:"button",disabled:_n.value||xn.value,onClick:re=>Bl(P.path)},N(T(o)("Open")),9,qI)):ie("",!0)]))),128))])):ie("",!0)],40,yI)])):ie("",!0)])),Ne(HC,{class:"new-thread-runtime-dropdown",modelValue:Pn.value,"onUpdate:modelValue":g[24]||(g[24]=P=>Pn.value=P)},null,8,["modelValue"]),Pn.value==="worktree"?(C(),R("div",HI,[m("p",zI,N(T(o)("Base branch")),1),Ne(qa,{class:"new-thread-branch-dropdown","model-value":Vn.value,options:us.value,placeholder:T(o)("Select branch"),"enable-search":!0,"search-placeholder":T(o)("Search branches..."),disabled:Wt.value||us.value.length===0,"onUpdate:modelValue":wo},null,8,["model-value","options","placeholder","search-placeholder","disabled"]),m("p",VI,N(Wt.value?T(o)("Loading branches…"):ei.value?T(o)("New worktree branch will start from {branch}.",{branch:ei.value}):T(o)("No Git branches found for this folder.")),1)])):ie("",!0),m("p",WI,N(T(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",GI,N(qt.value.title),1),m("span",KI,N(qt.value.message),1)],2)):ie("",!0)]),m("div",JI,[Ot.value&&An.value?(C(),rt(T(n),{key:0,class:"content-thread-terminal-panel","thread-id":Lo.value,cwd:An.value,onHide:Tt,onTerminalFocusChange:pt},null,8,["thread-id","cwd"])):ie("",!0),Ne(Af,{ref_key:"homeThreadComposerRef",ref:Hn,"active-thread-id":Lo.value,cwd:An.value,"collaboration-modes":T(xe),"selected-collaboration-mode":T(Ae),models:T(Z),"selected-model":ba.value,"selected-reasoning-effort":T(He),"selected-speed-mode":T(ee),"is-updating-speed-mode":T(ze),skills:T(be),"thread-token-usage":T(H),"codex-quota":T(Oe),"is-turn-in-progress":!1,"is-stop-pending":!1,"is-interrupting-turn":!1,"send-with-enter":yn.value,"in-progress-submit-mode":nn.value,"dictation-click-to-toggle":rn.value,"dictation-auto-send":Yn.value,"dictation-language":wr.value,onSubmit:gs,"onUpdate:selectedCollaborationMode":jc,"onUpdate:selectedModel":Rc,"onUpdate:selectedReasoningEffort":$c,"onUpdate:selectedSpeedMode":Nc},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",YI,[Sn.value&&T(ce)&&An.value?(C(),rt(T(r),{key:0,"thread-id":T(ce),cwd:An.value,"is-thread-in-progress":is.value,onClose:g[25]||(g[25]=P=>Sn.value=!1)},null,8,["thread-id","cwd","is-thread-in-progress"])):(C(),R(Ge,{key:1},[m("div",QI,[Ne(T(t),{ref_key:"threadConversationRef",ref:vo,messages:Dr.value,"is-loading":T(Se),"active-thread-id":Lo.value,cwd:An.value,"scroll-state":T(O),"live-overlay":na.value,"pending-requests":T(X),onUpdateScrollState:$,onForkThread:se,onRollback:cm,onImplementPlan:dm,onRespondServerRequest:L},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests"])]),m("div",XI,[Ne(IC,{messages:T(J),onEdit:vi,onSteer:T(fe),onDelete:T(oe),onReorder:lm},null,8,["messages","onSteer","onDelete"]),T(V)&&T(ce)&&An.value?(C(),rt(T(n),{key:0,class:"content-thread-terminal-panel","thread-id":T(ce),cwd:An.value,onHide:dn,onTerminalFocusChange:pt},null,8,["thread-id","cwd"])):ie("",!0),Ys.value?(C(),rt(yC,{key:1,request:Ys.value,"request-count":T(X).length,"has-queue-above":T(J).length>0,onRespondServerRequest:L},null,8,["request","request-count","has-queue-above"])):(C(),rt(Af,{key:2,ref_key:"threadComposerRef",ref:mn,"active-thread-id":Lo.value,cwd:An.value,"collaboration-modes":T(xe),"selected-collaboration-mode":T(Ae),models:T(Z),"selected-model":ba.value,"selected-reasoning-effort":T(He),"selected-speed-mode":T(ee),"is-updating-speed-mode":T(ze),skills:T(be),"thread-token-usage":T(H),"codex-quota":T(Oe),"is-turn-in-progress":is.value,"is-stop-pending":T(nt),"is-interrupting-turn":T(We),"has-queue-above":T(J).length>0,"send-with-enter":yn.value,"in-progress-submit-mode":nn.value,"dictation-click-to-toggle":rn.value,"dictation-auto-send":Yn.value,"dictation-language":wr.value,"onUpdate:selectedCollaborationMode":jc,onSubmit:gs,"onUpdate:selectedModel":Rc,"onUpdate:selectedReasoningEffort":$c,"onUpdate:selectedSpeedMode":Nc,onInterrupt:um},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"]))}}),tP=At(eP,[["__scopeId","data-v-c404b4b8"]]),xu={render:()=>null},nP=Ew({history:sw(),routes:[{path:"/",name:"home",component:xu},{path:"/thread/:threadId",name:"thread",component:xu},{path:"/skills",name:"skills",component:xu},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexui. github: https://github.com/friuns2/codexUI");gy(tP).use(nP).mount("#app");"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(e=>{console.error(Fp("Service worker registration failed."),e)})});export{vP as $,rt as A,hc as B,Eb as C,lP as D,sP as E,Ge as F,uP as G,iP as H,Hs as I,ea as J,cP as K,ln as L,dy as M,AP as N,IP as O,PP as P,oP as Q,EP as R,xc as S,sp as T,pa as U,ho as V,Ci as W,kn as X,aP as Y,dP as Z,At as _,m as a,_P as a0,TP as a1,fP as a2,bP as a3,kP as a4,CP as a5,xP as a6,hP as a7,pP as a8,mP as a9,gP as aa,wP as ab,yP as ac,SP as ad,Xo as b,R as c,Bn as d,wa as e,ie as f,Vt as g,it as h,rP as i,Ne as j,Cs as k,$k as l,vx as m,sn as n,C as o,tt as p,Io as q,I as r,T as s,N as t,Tc as u,ya as v,vt as w,ut as x,ae as y,Si as z};
|