codexui-android 0.1.107 → 0.1.108

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.
@@ -0,0 +1,63 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/ThreadConversation-DKfW7vC7.js","assets/ThreadConversation-BwA4BCDu.css","assets/ThreadTerminalPanel-CrJKkAvB.js","assets/ThreadTerminalPanel-nYqGBGVO.css","assets/ReviewPane-IP5BRZ-3.js","assets/ReviewPane-BAfo9D_N.css","assets/DirectoryHub-BeJqaP4D.js","assets/DirectoryHub-BjsbwciN.css"])))=>i.map(i=>d[i]);
2
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();/**
3
+ * @vue/shared v3.5.34
4
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
5
+ * @license MIT
6
+ **/function Rc(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Bt={},xs=[],qo=()=>{},Dh=()=>!1,Ol=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),jl=e=>e.startsWith("onUpdate:"),kn=Object.assign,Mc=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},ug=Object.prototype.hasOwnProperty,Pt=(e,t)=>ug.call(e,t),nt=Array.isArray,As=e=>$i(e)==="[object Map]",Dl=e=>$i(e)==="[object Set]",Md=e=>$i(e)==="[object Date]",ct=e=>typeof e=="function",tn=e=>typeof e=="string",ho=e=>typeof e=="symbol",Rt=e=>e!==null&&typeof e=="object",Fh=e=>(Rt(e)||ct(e))&&ct(e.then)&&ct(e.catch),Uh=Object.prototype.toString,$i=e=>Uh.call(e),cg=e=>$i(e).slice(8,-1),Bh=e=>$i(e)==="[object Object]",$c=e=>tn(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,mi=Rc(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Fl=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},dg=/-\w/g,yr=Fl(e=>e.replace(dg,t=>t.slice(1).toUpperCase())),fg=/\B([A-Z])/g,ja=Fl(e=>e.replace(fg,"-$1").toLowerCase()),Ul=Fl(e=>e.charAt(0).toUpperCase()+e.slice(1)),Tu=Fl(e=>e?`on${Ul(e)}`:""),lo=(e,t)=>!Object.is(e,t),yl=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},qh=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Nc=e=>{const t=parseFloat(e);return isNaN(t)?e:t},hg=e=>{const t=tn(e)?Number(e):NaN;return isNaN(t)?e:t};let $d;const Bl=()=>$d||($d=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ua(e){if(nt(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],a=tn(r)?gg(r):ua(r);if(a)for(const o in a)t[o]=a[o]}return t}else if(tn(e)||Rt(e))return e}const pg=/;(?![^(]*\))/g,mg=/:([^]+)/,vg=/\/\*[^]*?\*\//g;function gg(e){const t={};return e.replace(vg,"").split(pg).forEach(n=>{if(n){const r=n.split(mg);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function tt(e){let t="";if(tn(e))t=e;else if(nt(e))for(let n=0;n<e.length;n++){const r=tt(e[n]);r&&(t+=r+" ")}else if(Rt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const yg="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",wg=Rc(yg);function Hh(e){return!!e||e===""}function bg(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Ni(e[r],t[r]);return n}function Ni(e,t){if(e===t)return!0;let n=Md(e),r=Md(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=ho(e),r=ho(t),n||r)return e===t;if(n=nt(e),r=nt(t),n||r)return n&&r?bg(e,t):!1;if(n=Rt(e),r=Rt(t),n||r){if(!n||!r)return!1;const a=Object.keys(e).length,o=Object.keys(t).length;if(a!==o)return!1;for(const s in e){const l=e.hasOwnProperty(s),c=t.hasOwnProperty(s);if(l&&!c||!l&&c||!Ni(e[s],t[s]))return!1}}return String(e)===String(t)}function Wh(e,t){return e.findIndex(n=>Ni(n,t))}const zh=e=>!!(e&&e.__v_isRef===!0),M=e=>tn(e)?e:e==null?"":nt(e)||Rt(e)&&(e.toString===Uh||!ct(e.toString))?zh(e)?M(e.value):JSON.stringify(e,Vh,2):String(e),Vh=(e,t)=>zh(t)?Vh(e,t.value):As(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,a],o)=>(n[ku(r,o)+" =>"]=a,n),{})}:Dl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ku(n))}:ho(t)?ku(t):Rt(t)&&!nt(t)&&!Bh(t)?String(t):t,ku=(e,t="")=>{var n;return ho(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
7
+ * @vue/reactivity v3.5.34
8
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
9
+ * @license MIT
10
+ **/let Dn;class _g{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Dn&&(Dn.active?(this.parent=Dn,this.index=(Dn.scopes||(Dn.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!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=Dn;try{return Dn=this,t()}finally{Dn=n}}}on(){++this._on===1&&(this.prevScope=Dn,Dn=this)}off(){if(this._on>0&&--this._on===0){if(Dn===this)Dn=this.prevScope;else{let t=Dn;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const a=this.parent.scopes.pop();a&&a!==this&&(this.parent.scopes[this.index]=a,a.index=this.index)}this.parent=void 0}}}function Tg(){return Dn}let Gt;const Cu=new WeakSet;class Gh{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,Dn&&(Dn.active?Dn.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Cu.has(this)&&(Cu.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Yh(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Nd(this),Qh(this);const t=Gt,n=co;Gt=this,co=!0;try{return this.fn()}finally{Jh(this),Gt=t,co=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)jc(t);this.deps=this.depsTail=void 0,Nd(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Cu.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ec(this)&&this.run()}get dirty(){return ec(this)}}let Kh=0,vi,gi;function Yh(e,t=!1){if(e.flags|=8,t){e.next=gi,gi=e;return}e.next=vi,vi=e}function Lc(){Kh++}function Oc(){if(--Kh>0)return;if(gi){let t=gi;for(gi=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;vi;){let t=vi;for(vi=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 Qh(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Jh(e){let t,n=e.depsTail,r=n;for(;r;){const a=r.prevDep;r.version===-1?(r===n&&(n=a),jc(r),kg(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=a}e.deps=t,e.depsTail=n}function ec(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Xh(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Xh(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Si)||(e.globalVersion=Si,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ec(e))))return;e.flags|=2;const t=e.dep,n=Gt,r=co;Gt=e,co=!0;try{Qh(e);const a=e.fn(e._value);(t.version===0||lo(a,e._value))&&(e.flags|=128,e._value=a,t.version++)}catch(a){throw t.version++,a}finally{Gt=n,co=r,Jh(e),e.flags&=-3}}function jc(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)jc(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function kg(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let co=!0;const Zh=[];function ca(){Zh.push(co),co=!1}function da(){const e=Zh.pop();co=e===void 0?!0:e}function Nd(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Gt;Gt=void 0;try{t()}finally{Gt=n}}}let Si=0;class Cg{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Dc{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Gt||!co||Gt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Gt)n=this.activeLink=new Cg(Gt,this),Gt.deps?(n.prevDep=Gt.depsTail,Gt.depsTail.nextDep=n,Gt.depsTail=n):Gt.deps=Gt.depsTail=n,ep(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=Gt.depsTail,n.nextDep=void 0,Gt.depsTail.nextDep=n,Gt.depsTail=n,Gt.deps===n&&(Gt.deps=r)}return n}trigger(t){this.version++,Si++,this.notify(t)}notify(t){Lc();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Oc()}}}function ep(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)ep(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const tc=new WeakMap,os=Symbol(""),nc=Symbol(""),xi=Symbol("");function Qn(e,t,n){if(co&&Gt){let r=tc.get(e);r||tc.set(e,r=new Map);let a=r.get(n);a||(r.set(n,a=new Dc),a.map=r,a.key=n),a.track()}}function ia(e,t,n,r,a,o){const s=tc.get(e);if(!s){Si++;return}const l=c=>{c&&c.trigger()};if(Lc(),t==="clear")s.forEach(l);else{const c=nt(e),p=c&&$c(n);if(c&&n==="length"){const f=Number(r);s.forEach((g,_)=>{(_==="length"||_===xi||!ho(_)&&_>=f)&&l(g)})}else switch((n!==void 0||s.has(void 0))&&l(s.get(n)),p&&l(s.get(xi)),t){case"add":c?p&&l(s.get("length")):(l(s.get(os)),As(e)&&l(s.get(nc)));break;case"delete":c||(l(s.get(os)),As(e)&&l(s.get(nc)));break;case"set":As(e)&&l(s.get(os));break}}Oc()}function ps(e){const t=It(e);return t===e?t:(Qn(t,"iterate",xi),Qr(e)?t:t.map(po))}function ql(e){return Qn(e=It(e),"iterate",xi),e}function Fo(e,t){return fa(e)?$s(as(e)?po(t):t):po(t)}const Sg={__proto__:null,[Symbol.iterator](){return Su(this,Symbol.iterator,e=>Fo(this,e))},concat(...e){return ps(this).concat(...e.map(t=>nt(t)?ps(t):t))},entries(){return Su(this,"entries",e=>(e[1]=Fo(this,e[1]),e))},every(e,t){return ta(this,"every",e,t,void 0,arguments)},filter(e,t){return ta(this,"filter",e,t,n=>n.map(r=>Fo(this,r)),arguments)},find(e,t){return ta(this,"find",e,t,n=>Fo(this,n),arguments)},findIndex(e,t){return ta(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ta(this,"findLast",e,t,n=>Fo(this,n),arguments)},findLastIndex(e,t){return ta(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ta(this,"forEach",e,t,void 0,arguments)},includes(...e){return xu(this,"includes",e)},indexOf(...e){return xu(this,"indexOf",e)},join(e){return ps(this).join(e)},lastIndexOf(...e){return xu(this,"lastIndexOf",e)},map(e,t){return ta(this,"map",e,t,void 0,arguments)},pop(){return ai(this,"pop")},push(...e){return ai(this,"push",e)},reduce(e,...t){return Ld(this,"reduce",e,t)},reduceRight(e,...t){return Ld(this,"reduceRight",e,t)},shift(){return ai(this,"shift")},some(e,t){return ta(this,"some",e,t,void 0,arguments)},splice(...e){return ai(this,"splice",e)},toReversed(){return ps(this).toReversed()},toSorted(e){return ps(this).toSorted(e)},toSpliced(...e){return ps(this).toSpliced(...e)},unshift(...e){return ai(this,"unshift",e)},values(){return Su(this,"values",e=>Fo(this,e))}};function Su(e,t,n){const r=ql(e),a=r[t]();return r!==e&&!Qr(e)&&(a._next=a.next,a.next=()=>{const o=a._next();return o.done||(o.value=n(o.value)),o}),a}const xg=Array.prototype;function ta(e,t,n,r,a,o){const s=ql(e),l=s!==e&&!Qr(e),c=s[t];if(c!==xg[t]){const g=c.apply(e,o);return l?po(g):g}let p=n;s!==e&&(l?p=function(g,_){return n.call(this,Fo(e,g),_,e)}:n.length>2&&(p=function(g,_){return n.call(this,g,_,e)}));const f=c.call(s,p,r);return l&&a?a(f):f}function Ld(e,t,n,r){const a=ql(e),o=a!==e&&!Qr(e);let s=n,l=!1;a!==e&&(o?(l=r.length===0,s=function(p,f,g){return l&&(l=!1,p=Fo(e,p)),n.call(this,p,Fo(e,f),g,e)}):n.length>3&&(s=function(p,f,g){return n.call(this,p,f,g,e)}));const c=a[t](s,...r);return l?Fo(e,c):c}function xu(e,t,n){const r=It(e);Qn(r,"iterate",xi);const a=r[t](...n);return(a===-1||a===!1)&&Bc(n[0])?(n[0]=It(n[0]),r[t](...n)):a}function ai(e,t,n=[]){ca(),Lc();const r=It(e)[t].apply(e,n);return Oc(),da(),r}const Ag=Rc("__proto__,__v_isRef,__isVue"),tp=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ho));function Ig(e){ho(e)||(e=String(e));const t=It(this);return Qn(t,"has",e),t.hasOwnProperty(e)}class np{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?Dg:sp:o?ap:op).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const s=nt(t);if(!a){let c;if(s&&(c=Sg[n]))return c;if(n==="hasOwnProperty")return Ig}const l=Reflect.get(t,n,Xn(t)?t:r);if((ho(n)?tp.has(n):Ag(n))||(a||Qn(t,"get",n),o))return l;if(Xn(l)){const c=s&&$c(n)?l:l.value;return a&&Rt(c)?oc(c):c}return Rt(l)?a?oc(l):Hl(l):l}}class rp extends np{constructor(t=!1){super(!1,t)}set(t,n,r,a){let o=t[n];const s=nt(t)&&$c(n);if(!this._isShallow){const p=fa(o);if(!Qr(r)&&!fa(r)&&(o=It(o),r=It(r)),!s&&Xn(o)&&!Xn(r))return p||(o.value=r),!0}const l=s?Number(n)<t.length:Pt(t,n),c=Reflect.set(t,n,r,Xn(t)?t:a);return t===It(a)&&(l?lo(r,o)&&ia(t,"set",n,r):ia(t,"add",n,r)),c}deleteProperty(t,n){const r=Pt(t,n);t[n];const a=Reflect.deleteProperty(t,n);return a&&r&&ia(t,"delete",n,void 0),a}has(t,n){const r=Reflect.has(t,n);return(!ho(n)||!tp.has(n))&&Qn(t,"has",n),r}ownKeys(t){return Qn(t,"iterate",nt(t)?"length":os),Reflect.ownKeys(t)}}class Eg extends np{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Pg=new rp,Rg=new Eg,Mg=new rp(!0);const rc=e=>e,nl=e=>Reflect.getPrototypeOf(e);function $g(e,t,n){return function(...r){const a=this.__v_raw,o=It(a),s=As(o),l=e==="entries"||e===Symbol.iterator&&s,c=e==="keys"&&s,p=a[e](...r),f=n?rc:t?$s:po;return!t&&Qn(o,"iterate",c?nc:os),kn(Object.create(p),{next(){const{value:g,done:_}=p.next();return _?{value:g,done:_}:{value:l?[f(g[0]),f(g[1])]:f(g),done:_}}})}}function rl(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Ng(e,t){const n={get(a){const o=this.__v_raw,s=It(o),l=It(a);e||(lo(a,l)&&Qn(s,"get",a),Qn(s,"get",l));const{has:c}=nl(s),p=t?rc:e?$s:po;if(c.call(s,a))return p(o.get(a));if(c.call(s,l))return p(o.get(l));o!==s&&o.get(a)},get size(){const a=this.__v_raw;return!e&&Qn(It(a),"iterate",os),a.size},has(a){const o=this.__v_raw,s=It(o),l=It(a);return e||(lo(a,l)&&Qn(s,"has",a),Qn(s,"has",l)),a===l?o.has(a):o.has(a)||o.has(l)},forEach(a,o){const s=this,l=s.__v_raw,c=It(l),p=t?rc:e?$s:po;return!e&&Qn(c,"iterate",os),l.forEach((f,g)=>a.call(o,p(f),p(g),s))}};return kn(n,e?{add:rl("add"),set:rl("set"),delete:rl("delete"),clear:rl("clear")}:{add(a){const o=It(this),s=nl(o),l=It(a),c=!t&&!Qr(a)&&!fa(a)?l:a;return s.has.call(o,c)||lo(a,c)&&s.has.call(o,a)||lo(l,c)&&s.has.call(o,l)||(o.add(c),ia(o,"add",c,c)),this},set(a,o){!t&&!Qr(o)&&!fa(o)&&(o=It(o));const s=It(this),{has:l,get:c}=nl(s);let p=l.call(s,a);p||(a=It(a),p=l.call(s,a));const f=c.call(s,a);return s.set(a,o),p?lo(o,f)&&ia(s,"set",a,o):ia(s,"add",a,o),this},delete(a){const o=It(this),{has:s,get:l}=nl(o);let c=s.call(o,a);c||(a=It(a),c=s.call(o,a)),l&&l.call(o,a);const p=o.delete(a);return c&&ia(o,"delete",a,void 0),p},clear(){const a=It(this),o=a.size!==0,s=a.clear();return o&&ia(a,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(a=>{n[a]=$g(a,e,t)}),n}function Fc(e,t){const n=Ng(e,t);return(r,a,o)=>a==="__v_isReactive"?!e:a==="__v_isReadonly"?e:a==="__v_raw"?r:Reflect.get(Pt(n,a)&&a in r?n:r,a,o)}const Lg={get:Fc(!1,!1)},Og={get:Fc(!1,!0)},jg={get:Fc(!0,!1)};const op=new WeakMap,ap=new WeakMap,sp=new WeakMap,Dg=new WeakMap;function Fg(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ug(e){return e.__v_skip||!Object.isExtensible(e)?0:Fg(cg(e))}function Hl(e){return fa(e)?e:Uc(e,!1,Pg,Lg,op)}function ip(e){return Uc(e,!1,Mg,Og,ap)}function oc(e){return Uc(e,!0,Rg,jg,sp)}function Uc(e,t,n,r,a){if(!Rt(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Ug(e);if(o===0)return e;const s=a.get(e);if(s)return s;const l=new Proxy(e,o===2?r:n);return a.set(e,l),l}function as(e){return fa(e)?as(e.__v_raw):!!(e&&e.__v_isReactive)}function fa(e){return!!(e&&e.__v_isReadonly)}function Qr(e){return!!(e&&e.__v_isShallow)}function Bc(e){return e?!!e.__v_raw:!1}function It(e){const t=e&&e.__v_raw;return t?It(t):e}function Bg(e){return!Pt(e,"__v_skip")&&Object.isExtensible(e)&&qh(e,"__v_skip",!0),e}const po=e=>Rt(e)?Hl(e):e,$s=e=>Rt(e)?oc(e):e;function Xn(e){return e?e.__v_isRef===!0:!1}function A(e){return lp(e,!1)}function qg(e){return lp(e,!0)}function lp(e,t){return Xn(e)?e:new Hg(e,t)}class Hg{constructor(t,n){this.dep=new Dc,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:It(t),this._value=n?t:po(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Qr(t)||fa(t);t=r?t:It(t),lo(t,n)&&(this._rawValue=t,this._value=r?t:po(t),this.dep.trigger())}}function S(e){return Xn(e)?e.value:e}const Wg={get:(e,t,n)=>t==="__v_raw"?e:S(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const a=e[t];return Xn(a)&&!Xn(n)?(a.value=n,!0):Reflect.set(e,t,n,r)}};function up(e){return as(e)?e:new Proxy(e,Wg)}class zg{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Dc(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Si-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Gt!==this)return Yh(this,!0),!0}get value(){const t=this.dep.track();return Xh(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Vg(e,t,n=!1){let r,a;return ct(e)?r=e:(r=e.get,a=e.set),new zg(r,a,n)}const ol={},Cl=new WeakMap;let Ja;function Gg(e,t=!1,n=Ja){if(n){let r=Cl.get(n);r||Cl.set(n,r=[]),r.push(e)}}function Kg(e,t,n=Bt){const{immediate:r,deep:a,once:o,scheduler:s,augmentJob:l,call:c}=n,p=te=>a?te:Qr(te)||a===!1||a===0?la(te,1):la(te);let f,g,_,I,O=!1,q=!1;if(Xn(e)?(g=()=>e.value,O=Qr(e)):as(e)?(g=()=>p(e),O=!0):nt(e)?(q=!0,O=e.some(te=>as(te)||Qr(te)),g=()=>e.map(te=>{if(Xn(te))return te.value;if(as(te))return p(te);if(ct(te))return c?c(te,2):te()})):ct(e)?t?g=c?()=>c(e,2):e:g=()=>{if(_){ca();try{_()}finally{da()}}const te=Ja;Ja=f;try{return c?c(e,3,[I]):e(I)}finally{Ja=te}}:g=qo,t&&a){const te=g,_e=a===!0?1/0:a;g=()=>la(te(),_e)}const ee=Tg(),D=()=>{f.stop(),ee&&ee.active&&Mc(ee.effects,f)};if(o&&t){const te=t;t=(..._e)=>{te(..._e),D()}}let j=q?new Array(e.length).fill(ol):ol;const K=te=>{if(!(!(f.flags&1)||!f.dirty&&!te))if(t){const _e=f.run();if(a||O||(q?_e.some((fe,he)=>lo(fe,j[he])):lo(_e,j))){_&&_();const fe=Ja;Ja=f;try{const he=[_e,j===ol?void 0:q&&j[0]===ol?[]:j,I];j=_e,c?c(t,3,he):t(...he)}finally{Ja=fe}}}else f.run()};return l&&l(K),f=new Gh(g),f.scheduler=s?()=>s(K,!1):K,I=te=>Gg(te,!1,f),_=f.onStop=()=>{const te=Cl.get(f);if(te){if(c)c(te,4);else for(const _e of te)_e();Cl.delete(f)}},t?r?K(!0):j=f.run():s?s(K.bind(null,!0),!0):f.run(),D.pause=f.pause.bind(f),D.resume=f.resume.bind(f),D.stop=D,D}function la(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--,Xn(e))la(e.value,t,n);else if(nt(e))for(let r=0;r<e.length;r++)la(e[r],t,n);else if(Dl(e)||As(e))e.forEach(r=>{la(r,t,n)});else if(Bh(e)){for(const r in e)la(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&la(e[r],t,n)}return e}/**
11
+ * @vue/runtime-core v3.5.34
12
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
13
+ * @license MIT
14
+ **/function Li(e,t,n,r){try{return r?e(...r):e()}catch(a){Oi(a,t,n)}}function mo(e,t,n,r){if(ct(e)){const a=Li(e,t,n,r);return a&&Fh(a)&&a.catch(o=>{Oi(o,t,n)}),a}if(nt(e)){const a=[];for(let o=0;o<e.length;o++)a.push(mo(e[o],t,n,r));return a}}function Oi(e,t,n,r=!0){const a=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=t&&t.appContext.config||Bt;if(t){let l=t.parent;const c=t.proxy,p=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const f=l.ec;if(f){for(let g=0;g<f.length;g++)if(f[g](e,c,p)===!1)return}l=l.parent}if(o){ca(),Li(o,null,10,[e,c,p]),da();return}}Yg(e,n,a,r,s)}function Yg(e,t,n,r=!0,a=!1){if(a)throw e;console.error(e)}const vr=[];let jo=-1;const Is=[];let $a=null,ws=0;const cp=Promise.resolve();let Sl=null;function Zt(e){const t=Sl||cp;return e?t.then(this?e.bind(this):e):t}function Qg(e){let t=jo+1,n=vr.length;for(;t<n;){const r=t+n>>>1,a=vr[r],o=Ai(a);o<e||o===e&&a.flags&2?t=r+1:n=r}return t}function qc(e){if(!(e.flags&1)){const t=Ai(e),n=vr[vr.length-1];!n||!(e.flags&2)&&t>=Ai(n)?vr.push(e):vr.splice(Qg(t),0,e),e.flags|=1,dp()}}function dp(){Sl||(Sl=cp.then(hp))}function Jg(e){nt(e)?Is.push(...e):$a&&e.id===-1?$a.splice(ws+1,0,e):e.flags&1||(Is.push(e),e.flags|=1),dp()}function Od(e,t,n=jo+1){for(;n<vr.length;n++){const r=vr[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;vr.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function fp(e){if(Is.length){const t=[...new Set(Is)].sort((n,r)=>Ai(n)-Ai(r));if(Is.length=0,$a){$a.push(...t);return}for($a=t,ws=0;ws<$a.length;ws++){const n=$a[ws];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}$a=null,ws=0}}const Ai=e=>e.id==null?e.flags&2?-1:1/0:e.id;function hp(e){try{for(jo=0;jo<vr.length;jo++){const t=vr[jo];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Li(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;jo<vr.length;jo++){const t=vr[jo];t&&(t.flags&=-2)}jo=-1,vr.length=0,fp(),Sl=null,(vr.length||Is.length)&&hp()}}let Un=null,pp=null;function xl(e){const t=Un;return Un=e,pp=e&&e.type.__scopeId||null,t}function ft(e,t=Un,n){if(!t||e._n)return e;const r=(...a)=>{r._d&&El(-1);const o=xl(t);let s;try{s=e(...a)}finally{xl(o),r._d&&El(1)}return s};return r._n=!0,r._c=!0,r._d=!0,r}function ln(e,t){if(Un===null)return e;const n=Kl(Un),r=e.dirs||(e.dirs=[]);for(let a=0;a<t.length;a++){let[o,s,l,c=Bt]=t[a];o&&(ct(o)&&(o={mounted:o,updated:o}),o.deep&&la(s),r.push({dir:o,instance:n,value:s,oldValue:void 0,arg:l,modifiers:c}))}return e}function Ga(e,t,n,r){const a=e.dirs,o=t&&t.dirs;for(let s=0;s<a.length;s++){const l=a[s];o&&(l.oldValue=o[s].value);let c=l.dir[r];c&&(ca(),mo(c,n,8,[e.el,l,e,t]),da())}}function wl(e,t){if(Fn){let n=Fn.provides;const r=Fn.parent&&Fn.parent.provides;r===n&&(n=Fn.provides=Object.create(r)),n[e]=t}}function fo(e,t,n=!1){const r=Yc();if(r||Ps){let a=Ps?Ps._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&&ct(t)?t.call(r&&r.proxy):t}}const Xg=Symbol.for("v-scx"),Zg=()=>fo(Xg);function ht(e,t,n){return mp(e,t,n)}function mp(e,t,n=Bt){const{immediate:r,deep:a,flush:o,once:s}=n,l=kn({},n),c=t&&r||!t&&o!=="post";let p;if(Ls){if(o==="sync"){const I=Zg();p=I.__watcherHandles||(I.__watcherHandles=[])}else if(!c){const I=()=>{};return I.stop=qo,I.resume=qo,I.pause=qo,I}}const f=Fn;l.call=(I,O,q)=>mo(I,f,O,q);let g=!1;o==="post"?l.scheduler=I=>{pr(I,f&&f.suspense)}:o!=="sync"&&(g=!0,l.scheduler=(I,O)=>{O?I():qc(I)}),l.augmentJob=I=>{t&&(I.flags|=4),g&&(I.flags|=2,f&&(I.id=f.uid,I.i=f))};const _=Kg(e,t,l);return Ls&&(p?p.push(_):c&&_()),_}function ey(e,t,n){const r=this.proxy,a=tn(e)?e.includes(".")?vp(r,e):()=>r[e]:e.bind(r,r);let o;ct(t)?o=t:(o=t.handler,n=t);const s=Di(this),l=mp(a,o.bind(r),n);return s(),l}function vp(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 Ma=new WeakMap,gp=Symbol("_vte"),yp=e=>e.__isTeleport,Xa=e=>e&&(e.disabled||e.disabled===""),ty=e=>e&&(e.defer||e.defer===""),jd=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Dd=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,ac=(e,t)=>{const n=e&&e.to;return tn(n)?t?t(n):null:n},ny={name:"Teleport",__isTeleport:!0,process(e,t,n,r,a,o,s,l,c,p){const{mc:f,pc:g,pbc:_,o:{insert:I,querySelector:O,createText:q,createComment:ee,parentNode:D}}=p,j=Xa(t.props);let{dynamicChildren:K}=t;const te=(he,Re,G)=>{he.shapeFlag&16&&f(he.children,Re,G,a,o,s,l,c)},_e=(he=t)=>{const Re=Xa(he.props),G=he.target=ac(he.props,O),ye=sc(G,he,q,I);G&&(s!=="svg"&&jd(G)?s="svg":s!=="mathml"&&Dd(G)&&(s="mathml"),a&&a.isCE&&(a.ce._teleportTargets||(a.ce._teleportTargets=new Set)).add(G),Re||(te(he,G,ye),ci(he,!1)))},fe=he=>{const Re=()=>{if(Ma.get(he)===Re){if(Ma.delete(he),Xa(he.props)){const G=D(he.el)||n;te(he,G,he.anchor),ci(he,!0)}_e(he)}};Ma.set(he,Re),pr(Re,o)};if(e==null){const he=t.el=q(""),Re=t.anchor=q("");if(I(he,n,r),I(Re,n,r),ty(t.props)||o&&o.pendingBranch){fe(t);return}j&&(te(t,n,Re),ci(t,!0)),_e()}else{t.el=e.el;const he=t.anchor=e.anchor,Re=Ma.get(e);if(Re){Re.flags|=8,Ma.delete(e),fe(t);return}t.targetStart=e.targetStart;const G=t.target=e.target,ye=t.targetAnchor=e.targetAnchor,ke=Xa(e.props),se=ke?n:G,Te=ke?he:ye;if(s==="svg"||jd(G)?s="svg":(s==="mathml"||Dd(G))&&(s="mathml"),K?(_(e.dynamicChildren,K,se,a,o,s,l),Gc(e,t,!0)):c||g(e,t,se,Te,a,o,s,l,!1),j)ke?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):al(t,n,he,p,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const De=t.target=ac(t.props,O);De&&al(t,De,null,p,0)}else ke&&al(t,G,ye,p,1);ci(t,j)}},remove(e,t,n,{um:r,o:{remove:a}},o){const{shapeFlag:s,children:l,anchor:c,targetStart:p,targetAnchor:f,target:g,props:_}=e;let I=o||!Xa(_);const O=Ma.get(e);if(O&&(O.flags|=8,Ma.delete(e),I=!1),g&&(a(p),a(f)),o&&a(c),s&16)for(let q=0;q<l.length;q++){const ee=l[q];r(ee,t,n,I,!!ee.dynamicChildren)}},move:al,hydrate:ry};function al(e,t,n,{o:{insert:r},m:a},o=2){o===0&&r(e.targetAnchor,t,n);const{el:s,anchor:l,shapeFlag:c,children:p,props:f}=e,g=o===2;if(g&&r(s,t,n),!Ma.has(e)&&(!g||Xa(f))&&c&16)for(let _=0;_<p.length;_++)a(p[_],t,n,2);g&&r(l,t,n)}function ry(e,t,n,r,a,o,{o:{nextSibling:s,parentNode:l,querySelector:c,insert:p,createText:f}},g){function _(ee,D){let j=D;for(;j;){if(j&&j.nodeType===8){if(j.data==="teleport start anchor")t.targetStart=j;else if(j.data==="teleport anchor"){t.targetAnchor=j,ee._lpa=t.targetAnchor&&s(t.targetAnchor);break}}j=s(j)}}function I(ee,D){D.anchor=g(s(ee),D,l(ee),n,r,a,o)}const O=t.target=ac(t.props,c),q=Xa(t.props);if(O){const ee=O._lpa||O.firstChild;t.shapeFlag&16&&(q?(I(e,t),_(O,ee),t.targetAnchor||sc(O,t,f,p,l(e)===O?e:null)):(t.anchor=s(e),_(O,ee),t.targetAnchor||sc(O,t,f,p),g(ee&&s(ee),t,O,n,r,a,o))),ci(t,q)}else q&&t.shapeFlag&16&&(I(e,t),t.targetStart=e,t.targetAnchor=s(e));return t.anchor&&s(t.anchor)}const ts=ny;function ci(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 sc(e,t,n,r,a=null){const o=t.targetStart=n(""),s=t.targetAnchor=n("");return o[gp]=s,e&&(r(o,e,a),r(s,e,a)),s}const Do=Symbol("_leaveCb"),si=Symbol("_enterCb");function oy(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return ma(()=>{e.isMounted=!0}),Da(()=>{e.isUnmounting=!0}),e}const Yr=[Function,Array],wp={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Yr,onEnter:Yr,onAfterEnter:Yr,onEnterCancelled:Yr,onBeforeLeave:Yr,onLeave:Yr,onAfterLeave:Yr,onLeaveCancelled:Yr,onBeforeAppear:Yr,onAppear:Yr,onAfterAppear:Yr,onAppearCancelled:Yr},bp=e=>{const t=e.subTree;return t.component?bp(t.component):t},ay={name:"BaseTransition",props:wp,setup(e,{slots:t}){const n=Yc(),r=oy();return()=>{const a=t.default&&kp(t.default(),!0),o=a&&a.length?_p(a):n.subTree?Z():void 0;if(!o)return;const s=It(e),{mode:l}=s;if(r.isLeaving)return Au(o);const c=Fd(o);if(!c)return Au(o);let p=ic(c,s,r,n,g=>p=g);c.type!==Jn&&Ii(c,p);let f=n.subTree&&Fd(n.subTree);if(f&&f.type!==Jn&&!Za(f,c)&&bp(n).type!==Jn){let g=ic(f,s,r,n);if(Ii(f,g),l==="out-in"&&c.type!==Jn)return r.isLeaving=!0,g.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete g.afterLeave,f=void 0},Au(o);l==="in-out"&&c.type!==Jn?g.delayLeave=(_,I,O)=>{const q=Tp(r,f);q[String(f.key)]=f,_[Do]=()=>{I(),_[Do]=void 0,delete p.delayedLeave,f=void 0},p.delayedLeave=()=>{O(),delete p.delayedLeave,f=void 0}}:f=void 0}else f&&(f=void 0);return o}}};function _p(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Jn){t=n;break}}return t}const sy=ay;function Tp(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 ic(e,t,n,r,a){const{appear:o,mode:s,persisted:l=!1,onBeforeEnter:c,onEnter:p,onAfterEnter:f,onEnterCancelled:g,onBeforeLeave:_,onLeave:I,onAfterLeave:O,onLeaveCancelled:q,onBeforeAppear:ee,onAppear:D,onAfterAppear:j,onAppearCancelled:K}=t,te=String(e.key),_e=Tp(n,e),fe=(G,ye)=>{G&&mo(G,r,9,ye)},he=(G,ye)=>{const ke=ye[1];fe(G,ye),nt(G)?G.every(se=>se.length<=1)&&ke():G.length<=1&&ke()},Re={mode:s,persisted:l,beforeEnter(G){let ye=c;if(!n.isMounted)if(o)ye=ee||c;else return;G[Do]&&G[Do](!0);const ke=_e[te];ke&&Za(e,ke)&&ke.el[Do]&&ke.el[Do](),fe(ye,[G])},enter(G){if(_e[te]===e)return;let ye=p,ke=f,se=g;if(!n.isMounted)if(o)ye=D||p,ke=j||f,se=K||g;else return;let Te=!1;G[si]=Be=>{Te||(Te=!0,Be?fe(se,[G]):fe(ke,[G]),Re.delayedLeave&&Re.delayedLeave(),G[si]=void 0)};const De=G[si].bind(null,!1);ye?he(ye,[G,De]):De()},leave(G,ye){const ke=String(e.key);if(G[si]&&G[si](!0),n.isUnmounting)return ye();fe(_,[G]);let se=!1;G[Do]=De=>{se||(se=!0,ye(),De?fe(q,[G]):fe(O,[G]),G[Do]=void 0,_e[ke]===e&&delete _e[ke])};const Te=G[Do].bind(null,!1);_e[ke]=e,I?he(I,[G,Te]):Te()},clone(G){const ye=ic(G,t,n,r,a);return a&&a(ye),ye}};return Re}function Au(e){if(ji(e))return e=Oa(e),e.children=null,e}function Fd(e){if(!ji(e))return yp(e.type)&&e.children?_p(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&&ct(n.default))return n.default()}}function Ii(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Ii(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 kp(e,t=!1,n){let r=[],a=0;for(let o=0;o<e.length;o++){let s=e[o];const l=n==null?s.key:String(n)+String(s.key!=null?s.key:o);s.type===Qe?(s.patchFlag&128&&a++,r=r.concat(kp(s.children,t,l))):(t||s.type!==Jn)&&r.push(l!=null?Oa(s,{key:l}):s)}if(a>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function Bn(e,t){return ct(e)?kn({name:e.name},t,{setup:e}):e}function Hc(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Ud(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Al=new WeakMap;function yi(e,t,n,r,a=!1){if(nt(e)){e.forEach((q,ee)=>yi(q,t&&(nt(t)?t[ee]:t),n,r,a));return}if(Es(r)&&!a){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&yi(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?Kl(r.component):r.el,s=a?null:o,{i:l,r:c}=e,p=t&&t.r,f=l.refs===Bt?l.refs={}:l.refs,g=l.setupState,_=It(g),I=g===Bt?Dh:q=>Ud(f,q)?!1:Pt(_,q),O=(q,ee)=>!(ee&&Ud(f,ee));if(p!=null&&p!==c){if(Bd(t),tn(p))f[p]=null,I(p)&&(g[p]=null);else if(Xn(p)){const q=t;O(p,q.k)&&(p.value=null),q.k&&(f[q.k]=null)}}if(ct(c))Li(c,l,12,[s,f]);else{const q=tn(c),ee=Xn(c);if(q||ee){const D=()=>{if(e.f){const j=q?I(c)?g[c]:f[c]:O()||!e.k?c.value:f[e.k];if(a)nt(j)&&Mc(j,o);else if(nt(j))j.includes(o)||j.push(o);else if(q)f[c]=[o],I(c)&&(g[c]=f[c]);else{const K=[o];O(c,e.k)&&(c.value=K),e.k&&(f[e.k]=K)}}else q?(f[c]=s,I(c)&&(g[c]=s)):ee&&(O(c,e.k)&&(c.value=s),e.k&&(f[e.k]=s))};if(s){const j=()=>{D(),Al.delete(e)};j.id=-1,Al.set(e,j),pr(j,n)}else Bd(e),D()}}}function Bd(e){const t=Al.get(e);t&&(t.flags|=8,Al.delete(e))}const qd=e=>e.nodeType===8;Bl().requestIdleCallback;Bl().cancelIdleCallback;function iy(e,t){if(qd(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(qd(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const Es=e=>!!e.type.__asyncLoader;function sl(e){ct(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:a=200,hydrate:o,timeout:s,suspensible:l=!0,onError:c}=e;let p=null,f,g=0;const _=()=>(g++,p=null,I()),I=()=>{let O;return p||(O=p=t().catch(q=>{if(q=q instanceof Error?q:new Error(String(q)),c)return new Promise((ee,D)=>{c(q,()=>ee(_()),()=>D(q),g+1)});throw q}).then(q=>O!==p&&p?p:(q&&(q.__esModule||q[Symbol.toStringTag]==="Module")&&(q=q.default),f=q,q)))};return Bn({name:"AsyncComponentWrapper",__asyncLoader:I,__asyncHydrate(O,q,ee){let D=!1;(q.bu||(q.bu=[])).push(()=>D=!0);const j=()=>{D||ee()},K=o?()=>{const te=o(j,_e=>iy(O,_e));te&&(q.bum||(q.bum=[])).push(te)}:j;f?K():I().then(()=>!q.isUnmounted&&K())},get __asyncResolved(){return f},setup(){const O=Fn;if(Hc(O),f)return()=>il(f,O);const q=K=>{p=null,Oi(K,O,13,!r)};if(l&&O.suspense||Ls)return I().then(K=>()=>il(K,O)).catch(K=>(q(K),()=>r?je(r,{error:K}):null));const ee=A(!1),D=A(),j=A(!!a);return a&&setTimeout(()=>{j.value=!1},a),s!=null&&setTimeout(()=>{if(!ee.value&&!D.value){const K=new Error(`Async component timed out after ${s}ms.`);q(K),D.value=K}},s),I().then(()=>{ee.value=!0,O.parent&&ji(O.parent.vnode)&&O.parent.update()}).catch(K=>{q(K),D.value=K}),()=>{if(ee.value&&f)return il(f,O);if(D.value&&r)return je(r,{error:D.value});if(n&&!j.value)return il(n,O)}}})}function il(e,t){const{ref:n,props:r,children:a,ce:o}=t.vnode,s=je(e,r,a);return s.ref=n,s.ce=o,delete t.vnode.ce,s}const ji=e=>e.type.__isKeepAlive;function ly(e,t){Cp(e,"a",t)}function uy(e,t){Cp(e,"da",t)}function Cp(e,t,n=Fn){const r=e.__wdc||(e.__wdc=()=>{let a=n;for(;a;){if(a.isDeactivated)return;a=a.parent}return e()});if(Wl(t,r,n),n){let a=n.parent;for(;a&&a.parent;)ji(a.parent.vnode)&&cy(r,t,n,a),a=a.parent}}function cy(e,t,n,r){const a=Wl(t,e,r,!0);zl(()=>{Mc(r[t],a)},n)}function Wl(e,t,n=Fn,r=!1){if(n){const a=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...s)=>{ca();const l=Di(n),c=mo(t,n,e,s);return l(),da(),c});return r?a.unshift(o):a.push(o),o}}const pa=e=>(t,n=Fn)=>{(!Ls||e==="sp")&&Wl(e,(...r)=>t(...r),n)},dy=pa("bm"),ma=pa("m"),fy=pa("bu"),hy=pa("u"),Da=pa("bum"),zl=pa("um"),py=pa("sp"),my=pa("rtg"),vy=pa("rtc");function gy(e,t=Fn){Wl("ec",e,t)}const yy="components",Sp=Symbol.for("v-ndc");function Wc(e){return tn(e)?wy(yy,e,!1)||e:e||Sp}function wy(e,t,n=!0,r=!1){const a=Un||Fn;if(a){const o=a.type;{const l=rw(o,!1);if(l&&(l===t||l===yr(t)||l===Ul(yr(t))))return o}const s=Hd(a[e]||o[e],t)||Hd(a.appContext[e],t);return!s&&r?o:s}}function Hd(e,t){return e&&(e[t]||e[yr(t)]||e[Ul(yr(t))])}function en(e,t,n,r){let a;const o=n,s=nt(e);if(s||tn(e)){const l=s&&as(e);let c=!1,p=!1;l&&(c=!Qr(e),p=fa(e),e=ql(e)),a=new Array(e.length);for(let f=0,g=e.length;f<g;f++)a[f]=t(c?p?$s(po(e[f])):po(e[f]):e[f],f,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,p=l.length;c<p;c++){const f=l[c];a[c]=t(e[f],f,c,o)}}else a=[];return a}function Bo(e,t,n={},r,a){if(Un.ce||Un.parent&&Es(Un.parent)&&Un.parent.ce){const p=Object.keys(n).length>0;return t!=="default"&&(n.name=t),C(),et(Qe,null,[je("slot",n,r)],p?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),C();const s=o&&xp(o(n)),l=n.key||s&&s.key,c=et(Qe,{key:(l&&!ho(l)?l:`_${t}`)+(!s&&r?"_fb":"")},s||[],s&&e._===1?64:-2);return o&&o._c&&(o._d=!0),c}function xp(e){return e.some(t=>Ei(t)?!(t.type===Jn||t.type===Qe&&!xp(t.children)):!0)?e:null}const lc=e=>e?Vp(e)?Kl(e):lc(e.parent):null,wi=kn(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=>lc(e.parent),$root:e=>lc(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ip(e),$forceUpdate:e=>e.f||(e.f=()=>{qc(e.update)}),$nextTick:e=>e.n||(e.n=Zt.bind(e.proxy)),$watch:e=>ey.bind(e)}),Iu=(e,t)=>e!==Bt&&!e.__isScriptSetup&&Pt(e,t),by={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:a,props:o,accessCache:s,type:l,appContext:c}=e;if(t[0]!=="$"){const _=s[t];if(_!==void 0)switch(_){case 1:return r[t];case 2:return a[t];case 4:return n[t];case 3:return o[t]}else{if(Iu(r,t))return s[t]=1,r[t];if(a!==Bt&&Pt(a,t))return s[t]=2,a[t];if(Pt(o,t))return s[t]=3,o[t];if(n!==Bt&&Pt(n,t))return s[t]=4,n[t];uc&&(s[t]=0)}}const p=wi[t];let f,g;if(p)return t==="$attrs"&&Qn(e.attrs,"get",""),p(e);if((f=l.__cssModules)&&(f=f[t]))return f;if(n!==Bt&&Pt(n,t))return s[t]=4,n[t];if(g=c.config.globalProperties,Pt(g,t))return g[t]},set({_:e},t,n){const{data:r,setupState:a,ctx:o}=e;return Iu(a,t)?(a[t]=n,!0):r!==Bt&&Pt(r,t)?(r[t]=n,!0):Pt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:a,props:o,type:s}},l){let c;return!!(n[l]||e!==Bt&&l[0]!=="$"&&Pt(e,l)||Iu(t,l)||Pt(o,l)||Pt(r,l)||Pt(wi,l)||Pt(a.config.globalProperties,l)||(c=s.__cssModules)&&c[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Pt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function _y(){return Ty().slots}function Ty(e){const t=Yc();return t.setupContext||(t.setupContext=Kp(t))}function Wd(e){return nt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let uc=!0;function ky(e){const t=Ip(e),n=e.proxy,r=e.ctx;uc=!1,t.beforeCreate&&zd(t.beforeCreate,e,"bc");const{data:a,computed:o,methods:s,watch:l,provide:c,inject:p,created:f,beforeMount:g,mounted:_,beforeUpdate:I,updated:O,activated:q,deactivated:ee,beforeDestroy:D,beforeUnmount:j,destroyed:K,unmounted:te,render:_e,renderTracked:fe,renderTriggered:he,errorCaptured:Re,serverPrefetch:G,expose:ye,inheritAttrs:ke,components:se,directives:Te,filters:De}=t;if(p&&Cy(p,r,null),s)for(const Ne in s){const Ce=s[Ne];ct(Ce)&&(r[Ne]=Ce.bind(n))}if(a){const Ne=a.call(n,n);Rt(Ne)&&(e.data=Hl(Ne))}if(uc=!0,o)for(const Ne in o){const Ce=o[Ne],Ye=ct(Ce)?Ce.bind(n,n):ct(Ce.get)?Ce.get.bind(n,n):qo,rt=!ct(Ce)&&ct(Ce.set)?Ce.set.bind(n):qo,Ve=ae({get:Ye,set:rt});Object.defineProperty(r,Ne,{enumerable:!0,configurable:!0,get:()=>Ve.value,set:Le=>Ve.value=Le})}if(l)for(const Ne in l)Ap(l[Ne],r,n,Ne);if(c){const Ne=ct(c)?c.call(n):c;Reflect.ownKeys(Ne).forEach(Ce=>{wl(Ce,Ne[Ce])})}f&&zd(f,e,"c");function ze(Ne,Ce){nt(Ce)?Ce.forEach(Ye=>Ne(Ye.bind(n))):Ce&&Ne(Ce.bind(n))}if(ze(dy,g),ze(ma,_),ze(fy,I),ze(hy,O),ze(ly,q),ze(uy,ee),ze(gy,Re),ze(vy,fe),ze(my,he),ze(Da,j),ze(zl,te),ze(py,G),nt(ye))if(ye.length){const Ne=e.exposed||(e.exposed={});ye.forEach(Ce=>{Object.defineProperty(Ne,Ce,{get:()=>n[Ce],set:Ye=>n[Ce]=Ye,enumerable:!0})})}else e.exposed||(e.exposed={});_e&&e.render===qo&&(e.render=_e),ke!=null&&(e.inheritAttrs=ke),se&&(e.components=se),Te&&(e.directives=Te),G&&Hc(e)}function Cy(e,t,n=qo){nt(e)&&(e=cc(e));for(const r in e){const a=e[r];let o;Rt(a)?"default"in a?o=fo(a.from||r,a.default,!0):o=fo(a.from||r):o=fo(a),Xn(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:s=>o.value=s}):t[r]=o}}function zd(e,t,n){mo(nt(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Ap(e,t,n,r){let a=r.includes(".")?vp(n,r):()=>n[r];if(tn(e)){const o=t[e];ct(o)&&ht(a,o)}else if(ct(e))ht(a,e.bind(n));else if(Rt(e))if(nt(e))e.forEach(o=>Ap(o,t,n,r));else{const o=ct(e.handler)?e.handler.bind(n):t[e.handler];ct(o)&&ht(a,o,e)}}function Ip(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:a,optionsCache:o,config:{optionMergeStrategies:s}}=e.appContext,l=o.get(t);let c;return l?c=l:!a.length&&!n&&!r?c=t:(c={},a.length&&a.forEach(p=>Il(c,p,s,!0)),Il(c,t,s)),Rt(t)&&o.set(t,c),c}function Il(e,t,n,r=!1){const{mixins:a,extends:o}=t;o&&Il(e,o,n,!0),a&&a.forEach(s=>Il(e,s,n,!0));for(const s in t)if(!(r&&s==="expose")){const l=Sy[s]||n&&n[s];e[s]=l?l(e[s],t[s]):t[s]}return e}const Sy={data:Vd,props:Gd,emits:Gd,methods:di,computed:di,beforeCreate:hr,created:hr,beforeMount:hr,mounted:hr,beforeUpdate:hr,updated:hr,beforeDestroy:hr,beforeUnmount:hr,destroyed:hr,unmounted:hr,activated:hr,deactivated:hr,errorCaptured:hr,serverPrefetch:hr,components:di,directives:di,watch:Ay,provide:Vd,inject:xy};function Vd(e,t){return t?e?function(){return kn(ct(e)?e.call(this,this):e,ct(t)?t.call(this,this):t)}:t:e}function xy(e,t){return di(cc(e),cc(t))}function cc(e){if(nt(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function hr(e,t){return e?[...new Set([].concat(e,t))]:t}function di(e,t){return e?kn(Object.create(null),e,t):t}function Gd(e,t){return e?nt(e)&&nt(t)?[...new Set([...e,...t])]:kn(Object.create(null),Wd(e),Wd(t??{})):t}function Ay(e,t){if(!e)return t;if(!t)return e;const n=kn(Object.create(null),e);for(const r in t)n[r]=hr(e[r],t[r]);return n}function Ep(){return{app:null,config:{isNativeTag:Dh,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 Iy=0;function Ey(e,t){return function(r,a=null){ct(r)||(r=kn({},r)),a!=null&&!Rt(a)&&(a=null);const o=Ep(),s=new WeakSet,l=[];let c=!1;const p=o.app={_uid:Iy++,_component:r,_props:a,_container:null,_context:o,_instance:null,version:sw,get config(){return o.config},set config(f){},use(f,...g){return s.has(f)||(f&&ct(f.install)?(s.add(f),f.install(p,...g)):ct(f)&&(s.add(f),f(p,...g))),p},mixin(f){return o.mixins.includes(f)||o.mixins.push(f),p},component(f,g){return g?(o.components[f]=g,p):o.components[f]},directive(f,g){return g?(o.directives[f]=g,p):o.directives[f]},mount(f,g,_){if(!c){const I=p._ceVNode||je(r,a);return I.appContext=o,_===!0?_="svg":_===!1&&(_=void 0),e(I,f,_),c=!0,p._container=f,f.__vue_app__=p,Kl(I.component)}},onUnmount(f){l.push(f)},unmount(){c&&(mo(l,p._instance,16),e(null,p._container),delete p._container.__vue_app__)},provide(f,g){return o.provides[f]=g,p},runWithContext(f){const g=Ps;Ps=p;try{return f()}finally{Ps=g}}};return p}}let Ps=null;const Py=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${yr(t)}Modifiers`]||e[`${ja(t)}Modifiers`];function Ry(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||Bt;let a=n;const o=t.startsWith("update:"),s=o&&Py(r,t.slice(7));s&&(s.trim&&(a=n.map(f=>tn(f)?f.trim():f)),s.number&&(a=n.map(Nc)));let l,c=r[l=Tu(t)]||r[l=Tu(yr(t))];!c&&o&&(c=r[l=Tu(ja(t))]),c&&mo(c,e,6,a);const p=r[l+"Once"];if(p){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,mo(p,e,6,a)}}const My=new WeakMap;function Pp(e,t,n=!1){const r=n?My:t.emitsCache,a=r.get(e);if(a!==void 0)return a;const o=e.emits;let s={},l=!1;if(!ct(e)){const c=p=>{const f=Pp(p,t,!0);f&&(l=!0,kn(s,f))};!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):(nt(o)?o.forEach(c=>s[c]=null):kn(s,o),Rt(e)&&r.set(e,s),s)}function Vl(e,t){return!e||!Ol(t)?!1:(t=t.slice(2).replace(/Once$/,""),Pt(e,t[0].toLowerCase()+t.slice(1))||Pt(e,ja(t))||Pt(e,t))}function Kd(e){const{type:t,vnode:n,proxy:r,withProxy:a,propsOptions:[o],slots:s,attrs:l,emit:c,render:p,renderCache:f,props:g,data:_,setupState:I,ctx:O,inheritAttrs:q}=e,ee=xl(e);let D,j;try{if(n.shapeFlag&4){const te=a||r,_e=te;D=Uo(p.call(_e,te,f,g,I,_,O)),j=l}else{const te=t;D=Uo(te.length>1?te(g,{attrs:l,slots:s,emit:c}):te(g,null)),j=t.props?l:$y(l)}}catch(te){bi.length=0,Oi(te,e,1),D=je(Jn)}let K=D;if(j&&q!==!1){const te=Object.keys(j),{shapeFlag:_e}=K;te.length&&_e&7&&(o&&te.some(jl)&&(j=Ny(j,o)),K=Oa(K,j,!1,!0))}return n.dirs&&(K=Oa(K,null,!1,!0),K.dirs=K.dirs?K.dirs.concat(n.dirs):n.dirs),n.transition&&Ii(K,n.transition),D=K,xl(ee),D}const $y=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ol(n))&&((t||(t={}))[n]=e[n]);return t},Ny=(e,t)=>{const n={};for(const r in e)(!jl(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Ly(e,t,n){const{props:r,children:a,component:o}=e,{props:s,children:l,patchFlag:c}=t,p=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Yd(r,s,p):!!s;if(c&8){const f=t.dynamicProps;for(let g=0;g<f.length;g++){const _=f[g];if(Rp(s,r,_)&&!Vl(p,_))return!0}}}else return(a||l)&&(!l||!l.$stable)?!0:r===s?!1:r?s?Yd(r,s,p):!0:!!s;return!1}function Yd(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(Rp(t,e,o)&&!Vl(n,o))return!0}return!1}function Rp(e,t,n){const r=e[n],a=t[n];return n==="style"&&Rt(r)&&Rt(a)?!Ni(r,a):r!==a}function Oy({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 Mp={},$p=()=>Object.create(Mp),Np=e=>Object.getPrototypeOf(e)===Mp;function jy(e,t,n,r=!1){const a={},o=$p();e.propsDefaults=Object.create(null),Lp(e,t,a,o);for(const s in e.propsOptions[0])s in a||(a[s]=void 0);n?e.props=r?a:ip(a):e.type.props?e.props=a:e.props=o,e.attrs=o}function Dy(e,t,n,r){const{props:a,attrs:o,vnode:{patchFlag:s}}=e,l=It(a),[c]=e.propsOptions;let p=!1;if((r||s>0)&&!(s&16)){if(s&8){const f=e.vnode.dynamicProps;for(let g=0;g<f.length;g++){let _=f[g];if(Vl(e.emitsOptions,_))continue;const I=t[_];if(c)if(Pt(o,_))I!==o[_]&&(o[_]=I,p=!0);else{const O=yr(_);a[O]=dc(c,l,O,I,e,!1)}else I!==o[_]&&(o[_]=I,p=!0)}}}else{Lp(e,t,a,o)&&(p=!0);let f;for(const g in l)(!t||!Pt(t,g)&&((f=ja(g))===g||!Pt(t,f)))&&(c?n&&(n[g]!==void 0||n[f]!==void 0)&&(a[g]=dc(c,l,g,void 0,e,!0)):delete a[g]);if(o!==l)for(const g in o)(!t||!Pt(t,g))&&(delete o[g],p=!0)}p&&ia(e.attrs,"set","")}function Lp(e,t,n,r){const[a,o]=e.propsOptions;let s=!1,l;if(t)for(let c in t){if(mi(c))continue;const p=t[c];let f;a&&Pt(a,f=yr(c))?!o||!o.includes(f)?n[f]=p:(l||(l={}))[f]=p:Vl(e.emitsOptions,c)||(!(c in r)||p!==r[c])&&(r[c]=p,s=!0)}if(o){const c=It(n),p=l||Bt;for(let f=0;f<o.length;f++){const g=o[f];n[g]=dc(a,c,g,p[g],e,!Pt(p,g))}}return s}function dc(e,t,n,r,a,o){const s=e[n];if(s!=null){const l=Pt(s,"default");if(l&&r===void 0){const c=s.default;if(s.type!==Function&&!s.skipFactory&&ct(c)){const{propsDefaults:p}=a;if(n in p)r=p[n];else{const f=Di(a);r=p[n]=c.call(null,t),f()}}else r=c;a.ce&&a.ce._setProp(n,r)}s[0]&&(o&&!l?r=!1:s[1]&&(r===""||r===ja(n))&&(r=!0))}return r}const Fy=new WeakMap;function Op(e,t,n=!1){const r=n?Fy:t.propsCache,a=r.get(e);if(a)return a;const o=e.props,s={},l=[];let c=!1;if(!ct(e)){const f=g=>{c=!0;const[_,I]=Op(g,t,!0);kn(s,_),I&&l.push(...I)};!n&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}if(!o&&!c)return Rt(e)&&r.set(e,xs),xs;if(nt(o))for(let f=0;f<o.length;f++){const g=yr(o[f]);Qd(g)&&(s[g]=Bt)}else if(o)for(const f in o){const g=yr(f);if(Qd(g)){const _=o[f],I=s[g]=nt(_)||ct(_)?{type:_}:kn({},_),O=I.type;let q=!1,ee=!0;if(nt(O))for(let D=0;D<O.length;++D){const j=O[D],K=ct(j)&&j.name;if(K==="Boolean"){q=!0;break}else K==="String"&&(ee=!1)}else q=ct(O)&&O.name==="Boolean";I[0]=q,I[1]=ee,(q||Pt(I,"default"))&&l.push(g)}}const p=[s,l];return Rt(e)&&r.set(e,p),p}function Qd(e){return e[0]!=="$"&&!mi(e)}const zc=e=>e==="_"||e==="_ctx"||e==="$stable",Vc=e=>nt(e)?e.map(Uo):[Uo(e)],Uy=(e,t,n)=>{if(t._n)return t;const r=ft((...a)=>Vc(t(...a)),n);return r._c=!1,r},jp=(e,t,n)=>{const r=e._ctx;for(const a in e){if(zc(a))continue;const o=e[a];if(ct(o))t[a]=Uy(a,o,r);else if(o!=null){const s=Vc(o);t[a]=()=>s}}},Dp=(e,t)=>{const n=Vc(t);e.slots.default=()=>n},Fp=(e,t,n)=>{for(const r in t)(n||!zc(r))&&(e[r]=t[r])},By=(e,t,n)=>{const r=e.slots=$p();if(e.vnode.shapeFlag&32){const a=t._;a?(Fp(r,t,n),n&&qh(r,"_",a,!0)):jp(t,r)}else t&&Dp(e,t)},qy=(e,t,n)=>{const{vnode:r,slots:a}=e;let o=!0,s=Bt;if(r.shapeFlag&32){const l=t._;l?n&&l===1?o=!1:Fp(a,t,n):(o=!t.$stable,jp(t,a)),s=t}else t&&(Dp(e,t),s={default:1});if(o)for(const l in a)!zc(l)&&s[l]==null&&delete a[l]},pr=Gy;function Hy(e){return Wy(e)}function Wy(e,t){const n=Bl();n.__VUE__=!0;const{insert:r,remove:a,patchProp:o,createElement:s,createText:l,createComment:c,setText:p,setElementText:f,parentNode:g,nextSibling:_,setScopeId:I=qo,insertStaticContent:O}=e,q=(x,R,V,ie=null,Q=null,le=null,pe=void 0,be=null,we=!!R.dynamicChildren)=>{if(x===R)return;x&&!Za(x,R)&&(ie=ne(x),Le(x,Q,le,!0),x=null),R.patchFlag===-2&&(we=!1,R.dynamicChildren=null);const{type:de,ref:Oe,shapeFlag:ge}=R;switch(de){case Gl:ee(x,R,V,ie);break;case Jn:D(x,R,V,ie);break;case Pu:x==null&&j(R,V,ie,pe);break;case Qe:se(x,R,V,ie,Q,le,pe,be,we);break;default:ge&1?_e(x,R,V,ie,Q,le,pe,be,we):ge&6?Te(x,R,V,ie,Q,le,pe,be,we):(ge&64||ge&128)&&de.process(x,R,V,ie,Q,le,pe,be,we,Fe)}Oe!=null&&Q?yi(Oe,x&&x.ref,le,R||x,!R):Oe==null&&x&&x.ref!=null&&yi(x.ref,null,le,x,!0)},ee=(x,R,V,ie)=>{if(x==null)r(R.el=l(R.children),V,ie);else{const Q=R.el=x.el;R.children!==x.children&&p(Q,R.children)}},D=(x,R,V,ie)=>{x==null?r(R.el=c(R.children||""),V,ie):R.el=x.el},j=(x,R,V,ie)=>{[x.el,x.anchor]=O(x.children,R,V,ie,x.el,x.anchor)},K=({el:x,anchor:R},V,ie)=>{let Q;for(;x&&x!==R;)Q=_(x),r(x,V,ie),x=Q;r(R,V,ie)},te=({el:x,anchor:R})=>{let V;for(;x&&x!==R;)V=_(x),a(x),x=V;a(R)},_e=(x,R,V,ie,Q,le,pe,be,we)=>{if(R.type==="svg"?pe="svg":R.type==="math"&&(pe="mathml"),x==null)fe(R,V,ie,Q,le,pe,be,we);else{const de=x.el&&x.el._isVueCE?x.el:null;try{de&&de._beginPatch(),G(x,R,Q,le,pe,be,we)}finally{de&&de._endPatch()}}},fe=(x,R,V,ie,Q,le,pe,be)=>{let we,de;const{props:Oe,shapeFlag:ge,transition:$e,dirs:Ee}=x;if(we=x.el=s(x.type,le,Oe&&Oe.is,Oe),ge&8?f(we,x.children):ge&16&&Re(x.children,we,null,ie,Q,Eu(x,le),pe,be),Ee&&Ga(x,null,ie,"created"),he(we,x,x.scopeId,pe,ie),Oe){for(const mt in Oe)mt!=="value"&&!mi(mt)&&o(we,mt,null,Oe[mt],le,ie);"value"in Oe&&o(we,"value",null,Oe.value,le),(de=Oe.onVnodeBeforeMount)&&Oo(de,ie,x)}Ee&&Ga(x,null,ie,"beforeMount");const at=zy(Q,$e);at&&$e.beforeEnter(we),r(we,R,V),((de=Oe&&Oe.onVnodeMounted)||at||Ee)&&pr(()=>{try{de&&Oo(de,ie,x),at&&$e.enter(we),Ee&&Ga(x,null,ie,"mounted")}finally{}},Q)},he=(x,R,V,ie,Q)=>{if(V&&I(x,V),ie)for(let le=0;le<ie.length;le++)I(x,ie[le]);if(Q){let le=Q.subTree;if(R===le||qp(le.type)&&(le.ssContent===R||le.ssFallback===R)){const pe=Q.vnode;he(x,pe,pe.scopeId,pe.slotScopeIds,Q.parent)}}},Re=(x,R,V,ie,Q,le,pe,be,we=0)=>{for(let de=we;de<x.length;de++){const Oe=x[de]=be?aa(x[de]):Uo(x[de]);q(null,Oe,R,V,ie,Q,le,pe,be)}},G=(x,R,V,ie,Q,le,pe)=>{const be=R.el=x.el;let{patchFlag:we,dynamicChildren:de,dirs:Oe}=R;we|=x.patchFlag&16;const ge=x.props||Bt,$e=R.props||Bt;let Ee;if(V&&Ka(V,!1),(Ee=$e.onVnodeBeforeUpdate)&&Oo(Ee,V,R,x),Oe&&Ga(R,x,V,"beforeUpdate"),V&&Ka(V,!0),(ge.innerHTML&&$e.innerHTML==null||ge.textContent&&$e.textContent==null)&&f(be,""),de?ye(x.dynamicChildren,de,be,V,ie,Eu(R,Q),le):pe||Ce(x,R,be,null,V,ie,Eu(R,Q),le,!1),we>0){if(we&16)ke(be,ge,$e,V,Q);else if(we&2&&ge.class!==$e.class&&o(be,"class",null,$e.class,Q),we&4&&o(be,"style",ge.style,$e.style,Q),we&8){const at=R.dynamicProps;for(let mt=0;mt<at.length;mt++){const pt=at[mt],bt=ge[pt],yt=$e[pt];(yt!==bt||pt==="value")&&o(be,pt,bt,yt,Q,V)}}we&1&&x.children!==R.children&&f(be,R.children)}else!pe&&de==null&&ke(be,ge,$e,V,Q);((Ee=$e.onVnodeUpdated)||Oe)&&pr(()=>{Ee&&Oo(Ee,V,R,x),Oe&&Ga(R,x,V,"updated")},ie)},ye=(x,R,V,ie,Q,le,pe)=>{for(let be=0;be<R.length;be++){const we=x[be],de=R[be],Oe=we.el&&(we.type===Qe||!Za(we,de)||we.shapeFlag&198)?g(we.el):V;q(we,de,Oe,null,ie,Q,le,pe,!0)}},ke=(x,R,V,ie,Q)=>{if(R!==V){if(R!==Bt)for(const le in R)!mi(le)&&!(le in V)&&o(x,le,R[le],null,Q,ie);for(const le in V){if(mi(le))continue;const pe=V[le],be=R[le];pe!==be&&le!=="value"&&o(x,le,be,pe,Q,ie)}"value"in V&&o(x,"value",R.value,V.value,Q)}},se=(x,R,V,ie,Q,le,pe,be,we)=>{const de=R.el=x?x.el:l(""),Oe=R.anchor=x?x.anchor:l("");let{patchFlag:ge,dynamicChildren:$e,slotScopeIds:Ee}=R;Ee&&(be=be?be.concat(Ee):Ee),x==null?(r(de,V,ie),r(Oe,V,ie),Re(R.children||[],V,Oe,Q,le,pe,be,we)):ge>0&&ge&64&&$e&&x.dynamicChildren&&x.dynamicChildren.length===$e.length?(ye(x.dynamicChildren,$e,V,Q,le,pe,be),(R.key!=null||Q&&R===Q.subTree)&&Gc(x,R,!0)):Ce(x,R,V,Oe,Q,le,pe,be,we)},Te=(x,R,V,ie,Q,le,pe,be,we)=>{R.slotScopeIds=be,x==null?R.shapeFlag&512?Q.ctx.activate(R,V,ie,pe,we):De(R,V,ie,Q,le,pe,we):Be(x,R,we)},De=(x,R,V,ie,Q,le,pe)=>{const be=x.component=Zy(x,ie,Q);if(ji(x)&&(be.ctx.renderer=Fe),ew(be,!1,pe),be.asyncDep){if(Q&&Q.registerDep(be,ze,pe),!x.el){const we=be.subTree=je(Jn);D(null,we,R,V),x.placeholder=we.el}}else ze(be,x,R,V,Q,le,pe)},Be=(x,R,V)=>{const ie=R.component=x.component;if(Ly(x,R,V))if(ie.asyncDep&&!ie.asyncResolved){Ne(ie,R,V);return}else ie.next=R,ie.update();else R.el=x.el,ie.vnode=R},ze=(x,R,V,ie,Q,le,pe)=>{const be=()=>{if(x.isMounted){let{next:ge,bu:$e,u:Ee,parent:at,vnode:mt}=x;{const z=Up(x);if(z){ge&&(ge.el=mt.el,Ne(x,ge,pe)),z.asyncDep.then(()=>{pr(()=>{x.isUnmounted||de()},Q)});return}}let pt=ge,bt;Ka(x,!1),ge?(ge.el=mt.el,Ne(x,ge,pe)):ge=mt,$e&&yl($e),(bt=ge.props&&ge.props.onVnodeBeforeUpdate)&&Oo(bt,at,ge,mt),Ka(x,!0);const yt=Kd(x),F=x.subTree;x.subTree=yt,q(F,yt,g(F.el),ne(F),x,Q,le),ge.el=yt.el,pt===null&&Oy(x,yt.el),Ee&&pr(Ee,Q),(bt=ge.props&&ge.props.onVnodeUpdated)&&pr(()=>Oo(bt,at,ge,mt),Q)}else{let ge;const{el:$e,props:Ee}=R,{bm:at,m:mt,parent:pt,root:bt,type:yt}=x,F=Es(R);Ka(x,!1),at&&yl(at),!F&&(ge=Ee&&Ee.onVnodeBeforeMount)&&Oo(ge,pt,R),Ka(x,!0);{bt.ce&&bt.ce._hasShadowRoot()&&bt.ce._injectChildStyle(yt,x.parent?x.parent.type:void 0);const z=x.subTree=Kd(x);q(null,z,V,ie,x,Q,le),R.el=z.el}if(mt&&pr(mt,Q),!F&&(ge=Ee&&Ee.onVnodeMounted)){const z=R;pr(()=>Oo(ge,pt,z),Q)}(R.shapeFlag&256||pt&&Es(pt.vnode)&&pt.vnode.shapeFlag&256)&&x.a&&pr(x.a,Q),x.isMounted=!0,R=V=ie=null}};x.scope.on();const we=x.effect=new Gh(be);x.scope.off();const de=x.update=we.run.bind(we),Oe=x.job=we.runIfDirty.bind(we);Oe.i=x,Oe.id=x.uid,we.scheduler=()=>qc(Oe),Ka(x,!0),de()},Ne=(x,R,V)=>{R.component=x;const ie=x.vnode.props;x.vnode=R,x.next=null,Dy(x,R.props,ie,V),qy(x,R.children,V),ca(),Od(x),da()},Ce=(x,R,V,ie,Q,le,pe,be,we=!1)=>{const de=x&&x.children,Oe=x?x.shapeFlag:0,ge=R.children,{patchFlag:$e,shapeFlag:Ee}=R;if($e>0){if($e&128){rt(de,ge,V,ie,Q,le,pe,be,we);return}else if($e&256){Ye(de,ge,V,ie,Q,le,pe,be,we);return}}Ee&8?(Oe&16&&wt(de,Q,le),ge!==de&&f(V,ge)):Oe&16?Ee&16?rt(de,ge,V,ie,Q,le,pe,be,we):wt(de,Q,le,!0):(Oe&8&&f(V,""),Ee&16&&Re(ge,V,ie,Q,le,pe,be,we))},Ye=(x,R,V,ie,Q,le,pe,be,we)=>{x=x||xs,R=R||xs;const de=x.length,Oe=R.length,ge=Math.min(de,Oe);let $e;for($e=0;$e<ge;$e++){const Ee=R[$e]=we?aa(R[$e]):Uo(R[$e]);q(x[$e],Ee,V,null,Q,le,pe,be,we)}de>Oe?wt(x,Q,le,!0,!1,ge):Re(R,V,ie,Q,le,pe,be,we,ge)},rt=(x,R,V,ie,Q,le,pe,be,we)=>{let de=0;const Oe=R.length;let ge=x.length-1,$e=Oe-1;for(;de<=ge&&de<=$e;){const Ee=x[de],at=R[de]=we?aa(R[de]):Uo(R[de]);if(Za(Ee,at))q(Ee,at,V,null,Q,le,pe,be,we);else break;de++}for(;de<=ge&&de<=$e;){const Ee=x[ge],at=R[$e]=we?aa(R[$e]):Uo(R[$e]);if(Za(Ee,at))q(Ee,at,V,null,Q,le,pe,be,we);else break;ge--,$e--}if(de>ge){if(de<=$e){const Ee=$e+1,at=Ee<Oe?R[Ee].el:ie;for(;de<=$e;)q(null,R[de]=we?aa(R[de]):Uo(R[de]),V,at,Q,le,pe,be,we),de++}}else if(de>$e)for(;de<=ge;)Le(x[de],Q,le,!0),de++;else{const Ee=de,at=de,mt=new Map;for(de=at;de<=$e;de++){const ve=R[de]=we?aa(R[de]):Uo(R[de]);ve.key!=null&&mt.set(ve.key,de)}let pt,bt=0;const yt=$e-at+1;let F=!1,z=0;const H=new Array(yt);for(de=0;de<yt;de++)H[de]=0;for(de=Ee;de<=ge;de++){const ve=x[de];if(bt>=yt){Le(ve,Q,le,!0);continue}let Ie;if(ve.key!=null)Ie=mt.get(ve.key);else for(pt=at;pt<=$e;pt++)if(H[pt-at]===0&&Za(ve,R[pt])){Ie=pt;break}Ie===void 0?Le(ve,Q,le,!0):(H[Ie-at]=de+1,Ie>=z?z=Ie:F=!0,q(ve,R[Ie],V,null,Q,le,pe,be,we),bt++)}const X=F?Vy(H):xs;for(pt=X.length-1,de=yt-1;de>=0;de--){const ve=at+de,Ie=R[ve],He=R[ve+1],Tt=ve+1<Oe?He.el||Bp(He):ie;H[de]===0?q(null,Ie,V,Tt,Q,le,pe,be,we):F&&(pt<0||de!==X[pt]?Ve(Ie,V,Tt,2):pt--)}}},Ve=(x,R,V,ie,Q=null)=>{const{el:le,type:pe,transition:be,children:we,shapeFlag:de}=x;if(de&6){Ve(x.component.subTree,R,V,ie);return}if(de&128){x.suspense.move(R,V,ie);return}if(de&64){pe.move(x,R,V,Fe);return}if(pe===Qe){r(le,R,V);for(let ge=0;ge<we.length;ge++)Ve(we[ge],R,V,ie);r(x.anchor,R,V);return}if(pe===Pu){K(x,R,V);return}if(ie!==2&&de&1&&be)if(ie===0)be.beforeEnter(le),r(le,R,V),pr(()=>be.enter(le),Q);else{const{leave:ge,delayLeave:$e,afterLeave:Ee}=be,at=()=>{x.ctx.isUnmounted?a(le):r(le,R,V)},mt=()=>{le._isLeaving&&le[Do](!0),ge(le,()=>{at(),Ee&&Ee()})};$e?$e(le,at,mt):mt()}else r(le,R,V)},Le=(x,R,V,ie=!1,Q=!1)=>{const{type:le,props:pe,ref:be,children:we,dynamicChildren:de,shapeFlag:Oe,patchFlag:ge,dirs:$e,cacheIndex:Ee,memo:at}=x;if(ge===-2&&(Q=!1),be!=null&&(ca(),yi(be,null,V,x,!0),da()),Ee!=null&&(R.renderCache[Ee]=void 0),Oe&256){R.ctx.deactivate(x);return}const mt=Oe&1&&$e,pt=!Es(x);let bt;if(pt&&(bt=pe&&pe.onVnodeBeforeUnmount)&&Oo(bt,R,x),Oe&6)qe(x.component,V,ie);else{if(Oe&128){x.suspense.unmount(V,ie);return}mt&&Ga(x,null,R,"beforeUnmount"),Oe&64?x.type.remove(x,R,V,Fe,ie):de&&!de.hasOnce&&(le!==Qe||ge>0&&ge&64)?wt(de,R,V,!1,!0):(le===Qe&&ge&384||!Q&&Oe&16)&&wt(we,R,V),ie&&gt(x)}const yt=at!=null&&Ee==null;(pt&&(bt=pe&&pe.onVnodeUnmounted)||mt||yt)&&pr(()=>{bt&&Oo(bt,R,x),mt&&Ga(x,null,R,"unmounted"),yt&&(x.el=null)},V)},gt=x=>{const{type:R,el:V,anchor:ie,transition:Q}=x;if(R===Qe){Ge(V,ie);return}if(R===Pu){te(x);return}const le=()=>{a(V),Q&&!Q.persisted&&Q.afterLeave&&Q.afterLeave()};if(x.shapeFlag&1&&Q&&!Q.persisted){const{leave:pe,delayLeave:be}=Q,we=()=>pe(V,le);be?be(x.el,le,we):we()}else le()},Ge=(x,R)=>{let V;for(;x!==R;)V=_(x),a(x),x=V;a(R)},qe=(x,R,V)=>{const{bum:ie,scope:Q,job:le,subTree:pe,um:be,m:we,a:de}=x;Jd(we),Jd(de),ie&&yl(ie),Q.stop(),le&&(le.flags|=8,Le(pe,x,R,V)),be&&pr(be,R),pr(()=>{x.isUnmounted=!0},R)},wt=(x,R,V,ie=!1,Q=!1,le=0)=>{for(let pe=le;pe<x.length;pe++)Le(x[pe],R,V,ie,Q)},ne=x=>{if(x.shapeFlag&6)return ne(x.component.subTree);if(x.shapeFlag&128)return x.suspense.next();const R=_(x.anchor||x.el),V=R&&R[gp];return V?_(V):R};let Se=!1;const Ae=(x,R,V)=>{let ie;x==null?R._vnode&&(Le(R._vnode,null,null,!0),ie=R._vnode.component):q(R._vnode||null,x,R,null,null,null,V),R._vnode=x,Se||(Se=!0,Od(ie),fp(),Se=!1)},Fe={p:q,um:Le,m:Ve,r:gt,mt:De,mc:Re,pc:Ce,pbc:ye,n:ne,o:e};return{render:Ae,hydrate:void 0,createApp:Ey(Ae)}}function Eu({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 Ka({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function zy(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Gc(e,t,n=!1){const r=e.children,a=t.children;if(nt(r)&&nt(a))for(let o=0;o<r.length;o++){const s=r[o];let l=a[o];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=a[o]=aa(a[o]),l.el=s.el),!n&&l.patchFlag!==-2&&Gc(s,l)),l.type===Gl&&(l.patchFlag===-1&&(l=a[o]=aa(l)),l.el=s.el),l.type===Jn&&!l.el&&(l.el=s.el)}}function Vy(e){const t=e.slice(),n=[0];let r,a,o,s,l;const c=e.length;for(r=0;r<c;r++){const p=e[r];if(p!==0){if(a=n[n.length-1],e[a]<p){t[r]=a,n.push(r);continue}for(o=0,s=n.length-1;o<s;)l=o+s>>1,e[n[l]]<p?o=l+1:s=l;p<e[n[o]]&&(o>0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,s=n[o-1];o-- >0;)n[o]=s,s=t[s];return n}function Up(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Up(t)}function Jd(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Bp(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Bp(t.subTree):null}const qp=e=>e.__isSuspense;function Gy(e,t){t&&t.pendingBranch?nt(e)?t.effects.push(...e):t.effects.push(e):Jg(e)}const Qe=Symbol.for("v-fgt"),Gl=Symbol.for("v-txt"),Jn=Symbol.for("v-cmt"),Pu=Symbol.for("v-stc"),bi=[];let gr=null;function C(e=!1){bi.push(gr=e?null:[])}function Ky(){bi.pop(),gr=bi[bi.length-1]||null}let Ns=1;function El(e,t=!1){Ns+=e,e<0&&gr&&t&&(gr.hasOnce=!0)}function Hp(e){return e.dynamicChildren=Ns>0?gr||xs:null,Ky(),Ns>0&&gr&&gr.push(e),e}function E(e,t,n,r,a,o){return Hp(m(e,t,n,r,a,o,!0))}function et(e,t,n,r,a){return Hp(je(e,t,n,r,a,!0))}function Ei(e){return e?e.__v_isVNode===!0:!1}function Za(e,t){return e.type===t.type&&e.key===t.key}const Wp=({key:e})=>e??null,bl=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?tn(e)||Xn(e)||ct(e)?{i:Un,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,r=0,a=null,o=e===Qe?0:1,s=!1,l=!1){const c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Wp(t),ref:t&&bl(t),scopeId:pp,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:Un};return l?(Kc(c,n),o&128&&e.normalize(c)):n&&(c.shapeFlag|=tn(n)?8:16),Ns>0&&!s&&gr&&(c.patchFlag>0||o&6)&&c.patchFlag!==32&&gr.push(c),c}const je=Yy;function Yy(e,t=null,n=null,r=0,a=null,o=!1){if((!e||e===Sp)&&(e=Jn),Ei(e)){const l=Oa(e,t,!0);return n&&Kc(l,n),Ns>0&&!o&&gr&&(l.shapeFlag&6?gr[gr.indexOf(e)]=l:gr.push(l)),l.patchFlag=-2,l}if(ow(e)&&(e=e.__vccOpts),t){t=Qy(t);let{class:l,style:c}=t;l&&!tn(l)&&(t.class=tt(l)),Rt(c)&&(Bc(c)&&!nt(c)&&(c=kn({},c)),t.style=ua(c))}const s=tn(e)?1:qp(e)?128:yp(e)?64:Rt(e)?4:ct(e)?2:0;return m(e,t,n,r,a,s,o,!0)}function Qy(e){return e?Bc(e)||Np(e)?kn({},e):e:null}function Oa(e,t,n=!1,r=!1){const{props:a,ref:o,patchFlag:s,children:l,transition:c}=e,p=t?zp(a||{},t):a,f={__v_isVNode:!0,__v_skip:!0,type:e.type,props:p,key:p&&Wp(p),ref:t&&t.ref?n&&o?nt(o)?o.concat(bl(t)):[o,bl(t)]:bl(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!==Qe?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Oa(e.ssContent),ssFallback:e.ssFallback&&Oa(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&Ii(f,c.clone(f)),f}function is(e=" ",t=0){return je(Gl,null,e,t)}function Z(e="",t=!1){return t?(C(),et(Jn,null,e)):je(Jn,null,e)}function Uo(e){return e==null||typeof e=="boolean"?je(Jn):nt(e)?je(Qe,null,e.slice()):Ei(e)?aa(e):je(Gl,null,String(e))}function aa(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Oa(e)}function Kc(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(nt(t))n=16;else if(typeof t=="object")if(r&65){const a=t.default;a&&(a._c&&(a._d=!1),Kc(e,a()),a._c&&(a._d=!0));return}else{n=32;const a=t._;!a&&!Np(t)?t._ctx=Un:a===3&&Un&&(Un.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ct(t)?(t={default:t,_ctx:Un},n=32):(t=String(t),r&64?(n=16,t=[is(t)]):n=8);e.children=t,e.shapeFlag|=n}function zp(...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=tt([t.class,r.class]));else if(a==="style")t.style=ua([t.style,r.style]);else if(Ol(a)){const o=t[a],s=r[a];s&&o!==s&&!(nt(o)&&o.includes(s))?t[a]=o?[].concat(o,s):s:s==null&&o==null&&!jl(a)&&(t[a]=s)}else a!==""&&(t[a]=r[a])}return t}function Oo(e,t,n,r=null){mo(e,t,7,[n,r])}const Jy=Ep();let Xy=0;function Zy(e,t,n){const r=e.type,a=(t?t.appContext:e.appContext)||Jy,o={uid:Xy++,vnode:e,type:r,parent:t,appContext:a,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new _g(!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:Op(r,a),emitsOptions:Pp(r,a),emit:null,emitted:null,propsDefaults:Bt,inheritAttrs:r.inheritAttrs,ctx:Bt,data:Bt,props:Bt,attrs:Bt,slots:Bt,refs:Bt,setupState:Bt,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=t?t.root:o,o.emit=Ry.bind(null,o),e.ce&&e.ce(o),o}let Fn=null;const Yc=()=>Fn||Un;let Pl,fc;{const e=Bl(),t=(n,r)=>{let a;return(a=e[n])||(a=e[n]=[]),a.push(r),o=>{a.length>1?a.forEach(s=>s(o)):a[0](o)}};Pl=t("__VUE_INSTANCE_SETTERS__",n=>Fn=n),fc=t("__VUE_SSR_SETTERS__",n=>Ls=n)}const Di=e=>{const t=Fn;return Pl(e),e.scope.on(),()=>{e.scope.off(),Pl(t)}},Xd=()=>{Fn&&Fn.scope.off(),Pl(null)};function Vp(e){return e.vnode.shapeFlag&4}let Ls=!1;function ew(e,t=!1,n=!1){t&&fc(t);const{props:r,children:a}=e.vnode,o=Vp(e);jy(e,r,o,t),By(e,a,n||t);const s=o?tw(e,t):void 0;return t&&fc(!1),s}function tw(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,by);const{setup:r}=n;if(r){ca();const a=e.setupContext=r.length>1?Kp(e):null,o=Di(e),s=Li(r,e,0,[e.props,a]),l=Fh(s);if(da(),o(),(l||e.sp)&&!Es(e)&&Hc(e),l){if(s.then(Xd,Xd),t)return s.then(c=>{Zd(e,c)}).catch(c=>{Oi(c,e,0)});e.asyncDep=s}else Zd(e,s)}else Gp(e)}function Zd(e,t,n){ct(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Rt(t)&&(e.setupState=up(t)),Gp(e)}function Gp(e,t,n){const r=e.type;e.render||(e.render=r.render||qo);{const a=Di(e);ca();try{ky(e)}finally{da(),a()}}}const nw={get(e,t){return Qn(e,"get",""),e[t]}};function Kp(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,nw),slots:e.slots,emit:e.emit,expose:t}}function Kl(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(up(Bg(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in wi)return wi[n](e)},has(t,n){return n in t||n in wi}})):e.proxy}function rw(e,t=!0){return ct(e)?e.displayName||e.name:e.name||t&&e.__name}function ow(e){return ct(e)&&"__vccOpts"in e}const ae=(e,t)=>Vg(e,t,Ls);function Qc(e,t,n){try{El(-1);const r=arguments.length;return r===2?Rt(t)&&!nt(t)?Ei(t)?je(e,null,[t]):je(e,t):je(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Ei(n)&&(n=[n]),je(e,t,n))}finally{El(1)}}function OM(e,t,n,r){const a=n[r];if(a&&aw(a,e))return a;const o=t();return o.memo=e.slice(),o.cacheIndex=r,n[r]=o}function aw(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let r=0;r<n.length;r++)if(lo(n[r],t[r]))return!1;return Ns>0&&gr&&gr.push(e),!0}const sw="3.5.34";/**
15
+ * @vue/runtime-dom v3.5.34
16
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
17
+ * @license MIT
18
+ **/let hc;const ef=typeof window<"u"&&window.trustedTypes;if(ef)try{hc=ef.createPolicy("vue",{createHTML:e=>e})}catch{}const Yp=hc?e=>hc.createHTML(e):e=>e,iw="http://www.w3.org/2000/svg",lw="http://www.w3.org/1998/Math/MathML",oa=typeof document<"u"?document:null,tf=oa&&oa.createElement("template"),uw={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"?oa.createElementNS(iw,e):t==="mathml"?oa.createElementNS(lw,e):n?oa.createElement(e,{is:n}):oa.createElement(e);return e==="select"&&r&&r.multiple!=null&&a.setAttribute("multiple",r.multiple),a},createText:e=>oa.createTextNode(e),createComment:e=>oa.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>oa.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,a,o){const s=n?n.previousSibling:t.lastChild;if(a&&(a===o||a.nextSibling))for(;t.insertBefore(a.cloneNode(!0),n),!(a===o||!(a=a.nextSibling)););else{tf.innerHTML=Yp(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const l=tf.content;if(r==="svg"||r==="mathml"){const c=l.firstChild;for(;c.firstChild;)l.appendChild(c.firstChild);l.removeChild(c)}t.insertBefore(l,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ea="transition",ii="animation",Pi=Symbol("_vtc"),Qp={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},cw=kn({},wp,Qp),dw=e=>(e.displayName="Transition",e.props=cw,e),Jp=dw((e,{slots:t})=>Qc(sy,fw(e),t)),Ya=(e,t=[])=>{nt(e)?e.forEach(n=>n(...t)):e&&e(...t)},nf=e=>e?nt(e)?e.some(t=>t.length>1):e.length>1:!1;function fw(e){const t={};for(const se in e)se in Qp||(t[se]=e[se]);if(e.css===!1)return t;const{name:n="v",type:r,duration:a,enterFromClass:o=`${n}-enter-from`,enterActiveClass:s=`${n}-enter-active`,enterToClass:l=`${n}-enter-to`,appearFromClass:c=o,appearActiveClass:p=s,appearToClass:f=l,leaveFromClass:g=`${n}-leave-from`,leaveActiveClass:_=`${n}-leave-active`,leaveToClass:I=`${n}-leave-to`}=e,O=hw(a),q=O&&O[0],ee=O&&O[1],{onBeforeEnter:D,onEnter:j,onEnterCancelled:K,onLeave:te,onLeaveCancelled:_e,onBeforeAppear:fe=D,onAppear:he=j,onAppearCancelled:Re=K}=t,G=(se,Te,De,Be)=>{se._enterCancelled=Be,Qa(se,Te?f:l),Qa(se,Te?p:s),De&&De()},ye=(se,Te)=>{se._isLeaving=!1,Qa(se,g),Qa(se,I),Qa(se,_),Te&&Te()},ke=se=>(Te,De)=>{const Be=se?he:j,ze=()=>G(Te,se,De);Ya(Be,[Te,ze]),rf(()=>{Qa(Te,se?c:o),na(Te,se?f:l),nf(Be)||of(Te,r,q,ze)})};return kn(t,{onBeforeEnter(se){Ya(D,[se]),na(se,o),na(se,s)},onBeforeAppear(se){Ya(fe,[se]),na(se,c),na(se,p)},onEnter:ke(!1),onAppear:ke(!0),onLeave(se,Te){se._isLeaving=!0;const De=()=>ye(se,Te);na(se,g),se._enterCancelled?(na(se,_),lf(se)):(lf(se),na(se,_)),rf(()=>{se._isLeaving&&(Qa(se,g),na(se,I),nf(te)||of(se,r,ee,De))}),Ya(te,[se,De])},onEnterCancelled(se){G(se,!1,void 0,!0),Ya(K,[se])},onAppearCancelled(se){G(se,!0,void 0,!0),Ya(Re,[se])},onLeaveCancelled(se){ye(se),Ya(_e,[se])}})}function hw(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 hg(e)}function na(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[Pi]||(e[Pi]=new Set)).add(t)}function Qa(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[Pi];n&&(n.delete(t),n.size||(e[Pi]=void 0))}function rf(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let pw=0;function of(e,t,n,r){const a=e._endId=++pw,o=()=>{a===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:s,timeout:l,propCount:c}=mw(e,t);if(!s)return r();const p=s+"end";let f=0;const g=()=>{e.removeEventListener(p,_),o()},_=I=>{I.target===e&&++f>=c&&g()};setTimeout(()=>{f<c&&g()},l+1),e.addEventListener(p,_)}function mw(e,t){const n=window.getComputedStyle(e),r=O=>(n[O]||"").split(", "),a=r(`${Ea}Delay`),o=r(`${Ea}Duration`),s=af(a,o),l=r(`${ii}Delay`),c=r(`${ii}Duration`),p=af(l,c);let f=null,g=0,_=0;t===Ea?s>0&&(f=Ea,g=s,_=o.length):t===ii?p>0&&(f=ii,g=p,_=c.length):(g=Math.max(s,p),f=g>0?s>p?Ea:ii:null,_=f?f===Ea?o.length:c.length:0);const I=f===Ea&&/\b(?:transform|all)(?:,|$)/.test(r(`${Ea}Property`).toString());return{type:f,timeout:g,propCount:_,hasTransform:I}}function af(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>sf(n)+sf(e[r])))}function sf(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function lf(e){return(e?e.ownerDocument:document).body.offsetHeight}function vw(e,t,n){const r=e[Pi];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const uf=Symbol("_vod"),gw=Symbol("_vsh"),yw=Symbol(""),ww=/(?:^|;)\s*display\s*:/;function bw(e,t,n){const r=e.style,a=tn(n);let o=!1;if(n&&!a){if(t)if(tn(t))for(const s of t.split(";")){const l=s.slice(0,s.indexOf(":")).trim();n[l]==null&&fi(r,l,"")}else for(const s in t)n[s]==null&&fi(r,s,"");for(const s in n){s==="display"&&(o=!0);const l=n[s];l!=null?Tw(e,s,!tn(t)&&t?t[s]:void 0,l)||fi(r,s,l):fi(r,s,"")}}else if(a){if(t!==n){const s=r[yw];s&&(n+=";"+s),r.cssText=n,o=ww.test(n)}}else t&&e.removeAttribute("style");uf in e&&(e[uf]=o?r.display:"",e[gw]&&(r.display="none"))}const cf=/\s*!important$/;function fi(e,t,n){if(nt(n))n.forEach(r=>fi(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=_w(e,t);cf.test(n)?e.setProperty(ja(r),n.replace(cf,""),"important"):e[r]=n}}const df=["Webkit","Moz","ms"],Mu={};function _w(e,t){const n=Mu[t];if(n)return n;let r=yr(t);if(r!=="filter"&&r in e)return Mu[t]=r;r=Ul(r);for(let a=0;a<df.length;a++){const o=df[a]+r;if(o in e)return Mu[t]=o}return t}function Tw(e,t,n,r){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&tn(r)&&n===r}const ff="http://www.w3.org/1999/xlink";function hf(e,t,n,r,a,o=wg(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ff,t.slice(6,t.length)):e.setAttributeNS(ff,t,n):n==null||o&&!Hh(n)?e.removeAttribute(t):e.setAttribute(t,o?"":ho(n)?String(n):n)}function pf(e,t,n,r,a){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Yp(n):n);return}const o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){const l=o==="OPTION"?e.getAttribute("value")||"":e.value,c=n==null?e.type==="checkbox"?"on":"":String(n);(l!==c||!("_value"in e))&&(e.value=c),n==null&&e.removeAttribute(t),e._value=n;return}let s=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=Hh(n):n==null&&l==="string"?(n="",s=!0):l==="number"&&(n=0,s=!0)}try{e[t]=n}catch{}s&&e.removeAttribute(a||t)}function es(e,t,n,r){e.addEventListener(t,n,r)}function kw(e,t,n,r){e.removeEventListener(t,n,r)}const mf=Symbol("_vei");function Cw(e,t,n,r,a=null){const o=e[mf]||(e[mf]={}),s=o[t];if(r&&s)s.value=r;else{const[l,c]=Sw(t);if(r){const p=o[t]=Iw(r,a);es(e,l,p,c)}else s&&(kw(e,l,s,c),o[t]=void 0)}}const vf=/(?:Once|Passive|Capture)$/;function Sw(e){let t;if(vf.test(e)){t={};let r;for(;r=e.match(vf);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):ja(e.slice(2)),t]}let $u=0;const xw=Promise.resolve(),Aw=()=>$u||(xw.then(()=>$u=0),$u=Date.now());function Iw(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;mo(Ew(r,n.value),t,5,[r])};return n.value=e,n.attached=Aw(),n}function Ew(e,t){if(nt(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 gf=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Pw=(e,t,n,r,a,o)=>{const s=a==="svg";t==="class"?vw(e,r,s):t==="style"?bw(e,n,r):Ol(t)?jl(t)||Cw(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Rw(e,t,r,s))?(pf(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&hf(e,t,r,s,o,t!=="value")):e._isVueCE&&(Mw(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!tn(r)))?pf(e,yr(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),hf(e,t,r,s))};function Rw(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&gf(t)&&ct(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 gf(t)&&tn(n)?!1:t in e}function Mw(e,t){const n=e._def.props;if(!n)return!1;const r=yr(t);return Array.isArray(n)?n.some(a=>yr(a)===r):Object.keys(n).some(a=>yr(a)===r)}const Rl=e=>{const t=e.props["onUpdate:modelValue"]||!1;return nt(t)?n=>yl(t,n):t};function $w(e){e.target.composing=!0}function yf(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Rs=Symbol("_assign");function wf(e,t,n){return t&&(e=e.trim()),n&&(e=Nc(e)),e}const mn={created(e,{modifiers:{lazy:t,trim:n,number:r}},a){e[Rs]=Rl(a);const o=r||a.props&&a.props.type==="number";es(e,t?"change":"input",s=>{s.target.composing||e[Rs](wf(e.value,n,o))}),(n||o)&&es(e,"change",()=>{e.value=wf(e.value,n,o)}),t||(es(e,"compositionstart",$w),es(e,"compositionend",yf),es(e,"change",yf))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:a,number:o}},s){if(e[Rs]=Rl(s),e.composing)return;const l=(o||e.type==="number")&&!/^0\d/.test(e.value)?Nc(e.value):e.value,c=t??"";if(l===c)return;const p=e.getRootNode();(p instanceof Document||p instanceof ShadowRoot)&&p.activeElement===e&&e.type!=="range"&&(r&&t===n||a&&e.value.trim()===c)||(e.value=c)}},Nw={deep:!0,created(e,t,n){e[Rs]=Rl(n),es(e,"change",()=>{const r=e._modelValue,a=Lw(e),o=e.checked,s=e[Rs];if(nt(r)){const l=Wh(r,a),c=l!==-1;if(o&&!c)s(r.concat(a));else if(!o&&c){const p=[...r];p.splice(l,1),s(p)}}else if(Dl(r)){const l=new Set(r);o?l.add(a):l.delete(a),s(l)}else s(Xp(e,o))})},mounted:bf,beforeUpdate(e,t,n){e[Rs]=Rl(n),bf(e,t,n)}};function bf(e,{value:t,oldValue:n},r){e._modelValue=t;let a;if(nt(t))a=Wh(t,r.props.value)>-1;else if(Dl(t))a=t.has(r.props.value);else{if(t===n)return;a=Ni(t,Xp(e,!0))}e.checked!==a&&(e.checked=a)}function Lw(e){return"_value"in e?e._value:e.value}function Xp(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Ow=["ctrl","shift","alt","meta"],jw={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)=>Ow.some(n=>e[`${n}Key`]&&!t.includes(n))},Ze=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((a,...o)=>{for(let s=0;s<t.length;s++){const l=jw[t[s]];if(l&&l(a,t))return}return e(a,...o)}))},Dw={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},gn=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(a=>{if(!("key"in a))return;const o=ja(a.key);if(t.some(s=>s===o||Dw[s]===o))return e(a)}))},Fw=kn({patchProp:Pw},uw);let _f;function Uw(){return _f||(_f=Hy(Fw))}const Bw=((...e)=>{const t=Uw().createApp(...e),{mount:n}=t;return t.mount=r=>{const a=Hw(r);if(!a)return;const o=t._component;!ct(o)&&!o.render&&!o.template&&(o.template=a.innerHTML),a.nodeType===1&&(a.textContent="");const s=n(a,!1,qw(a));return a instanceof Element&&(a.removeAttribute("v-cloak"),a.setAttribute("data-v-app","")),s},t});function qw(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Hw(e){return tn(e)?document.querySelector(e):e}const Ww="modulepreload",zw=function(e){return"/"+e},Tf={},ll=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let s=function(p){return Promise.all(p.map(f=>Promise.resolve(f).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));a=s(n.map(p=>{if(p=zw(p),p in Tf)return;Tf[p]=!0;const f=p.endsWith(".css"),g=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const _=document.createElement("link");if(_.rel=f?"stylesheet":Ww,f||(_.as="script"),_.crossOrigin="",_.href=p,c&&_.setAttribute("nonce",c),document.head.appendChild(_),f)return new Promise((I,O)=>{_.addEventListener("load",I),_.addEventListener("error",()=>O(new Error(`Unable to preload CSS for ${p}`)))})}))}function o(s){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=s,window.dispatchEvent(l),!l.defaultPrevented)throw s}return a.then(s=>{for(const l of s||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})};/*!
19
+ * vue-router v4.6.4
20
+ * (c) 2025 Eduardo San Martin Morote
21
+ * @license MIT
22
+ */const bs=typeof document<"u";function Zp(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Vw(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Zp(e.default)}const Et=Object.assign;function Nu(e,t){const n={};for(const r in t){const a=t[r];n[r]=vo(a)?a.map(e):e(a)}return n}const _i=()=>{},vo=Array.isArray;function kf(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const em=/#/g,Gw=/&/g,Kw=/\//g,Yw=/=/g,Qw=/\?/g,tm=/\+/g,Jw=/%5B/g,Xw=/%5D/g,nm=/%5E/g,Zw=/%60/g,rm=/%7B/g,eb=/%7C/g,om=/%7D/g,tb=/%20/g;function Jc(e){return e==null?"":encodeURI(""+e).replace(eb,"|").replace(Jw,"[").replace(Xw,"]")}function nb(e){return Jc(e).replace(rm,"{").replace(om,"}").replace(nm,"^")}function pc(e){return Jc(e).replace(tm,"%2B").replace(tb,"+").replace(em,"%23").replace(Gw,"%26").replace(Zw,"`").replace(rm,"{").replace(om,"}").replace(nm,"^")}function rb(e){return pc(e).replace(Yw,"%3D")}function ob(e){return Jc(e).replace(em,"%23").replace(Qw,"%3F")}function ab(e){return ob(e).replace(Kw,"%2F")}function Ri(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const sb=/\/$/,ib=e=>e.replace(sb,"");function Lu(e,t,n="/"){let r,a={},o="",s="";const l=t.indexOf("#");let c=t.indexOf("?");return c=l>=0&&c>l?-1:c,c>=0&&(r=t.slice(0,c),o=t.slice(c,l>0?l:t.length),a=e(o.slice(1))),l>=0&&(r=r||t.slice(0,l),s=t.slice(l,t.length)),r=db(r??t,n),{fullPath:r+o+s,path:r,query:a,hash:Ri(s)}}function lb(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Cf(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function ub(e,t,n){const r=t.matched.length-1,a=n.matched.length-1;return r>-1&&r===a&&Os(t.matched[r],n.matched[a])&&am(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Os(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function am(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!cb(e[n],t[n]))return!1;return!0}function cb(e,t){return vo(e)?Sf(e,t):vo(t)?Sf(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Sf(e,t){return vo(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function db(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),a=r[r.length-1];(a===".."||a===".")&&r.push("");let o=n.length-1,s,l;for(s=0;s<r.length;s++)if(l=r[s],l!==".")if(l==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(s).join("/")}const Pa={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let mc=(function(e){return e.pop="pop",e.push="push",e})({}),Ou=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function fb(e){if(!e)if(bs){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),ib(e)}const hb=/^[^#]+#/;function pb(e,t){return e.replace(hb,"#")+t}function mb(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 Yl=()=>({left:window.scrollX,top:window.scrollY});function vb(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=mb(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 xf(e,t){return(history.state?history.state.position-t:-1)+e}const vc=new Map;function gb(e,t){vc.set(e,t)}function yb(e){const t=vc.get(e);return vc.delete(e),t}function wb(e){return typeof e=="string"||e&&typeof e=="object"}function sm(e){return typeof e=="string"||typeof e=="symbol"}let pn=(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 im=Symbol("");pn.MATCHER_NOT_FOUND+"",pn.NAVIGATION_GUARD_REDIRECT+"",pn.NAVIGATION_ABORTED+"",pn.NAVIGATION_CANCELLED+"",pn.NAVIGATION_DUPLICATED+"";function js(e,t){return Et(new Error,{type:e,[im]:!0},t)}function ra(e,t){return e instanceof Error&&im in e&&(t==null||!!(e.type&t))}const bb=["params","query","hash"];function _b(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of bb)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function Tb(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(tm," "),o=a.indexOf("="),s=Ri(o<0?a:a.slice(0,o)),l=o<0?null:Ri(a.slice(o+1));if(s in t){let c=t[s];vo(c)||(c=t[s]=[c]),c.push(l)}else t[s]=l}return t}function Af(e){let t="";for(let n in e){const r=e[n];if(n=rb(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(vo(r)?r.map(a=>a&&pc(a)):[r&&pc(r)]).forEach(a=>{a!==void 0&&(t+=(t.length?"&":"")+n,a!=null&&(t+="="+a))})}return t}function kb(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=vo(r)?r.map(a=>a==null?null:""+a):r==null?r:""+r)}return t}const Cb=Symbol(""),If=Symbol(""),Ql=Symbol(""),Xc=Symbol(""),gc=Symbol("");function li(){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 Na(e,t,n,r,a,o=s=>s()){const s=r&&(r.enterCallbacks[a]=r.enterCallbacks[a]||[]);return()=>new Promise((l,c)=>{const p=_=>{_===!1?c(js(pn.NAVIGATION_ABORTED,{from:n,to:t})):_ instanceof Error?c(_):wb(_)?c(js(pn.NAVIGATION_GUARD_REDIRECT,{from:t,to:_})):(s&&r.enterCallbacks[a]===s&&typeof _=="function"&&s.push(_),l())},f=o(()=>e.call(r&&r.instances[a],t,n,p));let g=Promise.resolve(f);e.length<3&&(g=g.then(p)),g.catch(_=>c(_))})}function ju(e,t,n,r,a=o=>o()){const o=[];for(const s of e)for(const l in s.components){let c=s.components[l];if(!(t!=="beforeRouteEnter"&&!s.instances[l]))if(Zp(c)){const p=(c.__vccOpts||c)[t];p&&o.push(Na(p,n,r,s,l,a))}else{let p=c();o.push(()=>p.then(f=>{if(!f)throw new Error(`Couldn't resolve component "${l}" at "${s.path}"`);const g=Vw(f)?f.default:f;s.mods[l]=f,s.components[l]=g;const _=(g.__vccOpts||g)[t];return _&&Na(_,n,r,s,l,a)()}))}}return o}function Sb(e,t){const n=[],r=[],a=[],o=Math.max(t.matched.length,e.matched.length);for(let s=0;s<o;s++){const l=t.matched[s];l&&(e.matched.find(p=>Os(p,l))?r.push(l):n.push(l));const c=e.matched[s];c&&(t.matched.find(p=>Os(p,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 xb=()=>location.protocol+"//"+location.host;function lm(e,t){const{pathname:n,search:r,hash:a}=t,o=e.indexOf("#");if(o>-1){let s=a.includes(e.slice(o))?e.slice(o).length:1,l=a.slice(s);return l[0]!=="/"&&(l="/"+l),Cf(l,"")}return Cf(n,e)+r+a}function Ab(e,t,n,r){let a=[],o=[],s=null;const l=({state:_})=>{const I=lm(e,location),O=n.value,q=t.value;let ee=0;if(_){if(n.value=I,t.value=_,s&&s===O){s=null;return}ee=q?_.position-q.position:0}else r(I);a.forEach(D=>{D(n.value,O,{delta:ee,type:mc.pop,direction:ee?ee>0?Ou.forward:Ou.back:Ou.unknown})})};function c(){s=n.value}function p(_){a.push(_);const I=()=>{const O=a.indexOf(_);O>-1&&a.splice(O,1)};return o.push(I),I}function f(){if(document.visibilityState==="hidden"){const{history:_}=window;if(!_.state)return;_.replaceState(Et({},_.state,{scroll:Yl()}),"")}}function g(){for(const _ of o)_();o=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",f),document.removeEventListener("visibilitychange",f)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",f),document.addEventListener("visibilitychange",f),{pauseListeners:c,listen:p,destroy:g}}function Ef(e,t,n,r=!1,a=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:a?Yl():null}}function Ib(e){const{history:t,location:n}=window,r={value:lm(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,p,f){const g=e.indexOf("#"),_=g>-1?(n.host&&document.querySelector("base")?e:e.slice(g))+c:xb()+e+c;try{t[f?"replaceState":"pushState"](p,"",_),a.value=p}catch(I){console.error(I),n[f?"replace":"assign"](_)}}function s(c,p){o(c,Et({},t.state,Ef(a.value.back,c,a.value.forward,!0),p,{position:a.value.position}),!0),r.value=c}function l(c,p){const f=Et({},a.value,t.state,{forward:c,scroll:Yl()});o(f.current,f,!0),o(c,Et({},Ef(r.value,c,null),{position:f.position+1},p),!1),r.value=c}return{location:r,state:a,push:l,replace:s}}function Eb(e){e=fb(e);const t=Ib(e),n=Ab(e,t.state,t.location,t.replace);function r(o,s=!0){s||n.pauseListeners(),history.go(o)}const a=Et({location:"",base:e,go:r,createHref:pb.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 Pb(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),Eb(e)}let ns=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var _n=(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})(_n||{});const Rb={type:ns.Static,value:""},Mb=/[a-zA-Z0-9_]/;function $b(e){if(!e)return[[]];if(e==="/")return[[Rb]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(I){throw new Error(`ERR (${n})/"${p}": ${I}`)}let n=_n.Static,r=n;const a=[];let o;function s(){o&&a.push(o),o=[]}let l=0,c,p="",f="";function g(){p&&(n===_n.Static?o.push({type:ns.Static,value:p}):n===_n.Param||n===_n.ParamRegExp||n===_n.ParamRegExpEnd?(o.length>1&&(c==="*"||c==="+")&&t(`A repeatable param (${p}) must be alone in its segment. eg: '/:ids+.`),o.push({type:ns.Param,value:p,regexp:f,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):t("Invalid state to consume buffer"),p="")}function _(){p+=c}for(;l<e.length;){if(c=e[l++],c==="\\"&&n!==_n.ParamRegExp){r=n,n=_n.EscapeNext;continue}switch(n){case _n.Static:c==="/"?(p&&g(),s()):c===":"?(g(),n=_n.Param):_();break;case _n.EscapeNext:_(),n=r;break;case _n.Param:c==="("?n=_n.ParamRegExp:Mb.test(c)?_():(g(),n=_n.Static,c!=="*"&&c!=="?"&&c!=="+"&&l--);break;case _n.ParamRegExp:c===")"?f[f.length-1]=="\\"?f=f.slice(0,-1)+c:n=_n.ParamRegExpEnd:f+=c;break;case _n.ParamRegExpEnd:g(),n=_n.Static,c!=="*"&&c!=="?"&&c!=="+"&&l--,f="";break;default:t("Unknown state");break}}return n===_n.ParamRegExp&&t(`Unfinished custom RegExp for param "${p}"`),g(),s(),a}const Pf="[^/]+?",Nb={sensitive:!1,strict:!1,start:!0,end:!0};var mr=(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})(mr||{});const Lb=/[.+*?^${}()[\]/\\]/g;function Ob(e,t){const n=Et({},Nb,t),r=[];let a=n.start?"^":"";const o=[];for(const p of e){const f=p.length?[]:[mr.Root];n.strict&&!p.length&&(a+="/");for(let g=0;g<p.length;g++){const _=p[g];let I=mr.Segment+(n.sensitive?mr.BonusCaseSensitive:0);if(_.type===ns.Static)g||(a+="/"),a+=_.value.replace(Lb,"\\$&"),I+=mr.Static;else if(_.type===ns.Param){const{value:O,repeatable:q,optional:ee,regexp:D}=_;o.push({name:O,repeatable:q,optional:ee});const j=D||Pf;if(j!==Pf){I+=mr.BonusCustomRegExp;try{`${j}`}catch(te){throw new Error(`Invalid custom RegExp for param "${O}" (${j}): `+te.message)}}let K=q?`((?:${j})(?:/(?:${j}))*)`:`(${j})`;g||(K=ee&&p.length<2?`(?:/${K})`:"/"+K),ee&&(K+="?"),a+=K,I+=mr.Dynamic,ee&&(I+=mr.BonusOptional),q&&(I+=mr.BonusRepeatable),j===".*"&&(I+=mr.BonusWildcard)}f.push(I)}r.push(f)}if(n.strict&&n.end){const p=r.length-1;r[p][r[p].length-1]+=mr.BonusStrict}n.strict||(a+="/?"),n.end?a+="$":n.strict&&!a.endsWith("/")&&(a+="(?:/|$)");const s=new RegExp(a,n.sensitive?"":"i");function l(p){const f=p.match(s),g={};if(!f)return null;for(let _=1;_<f.length;_++){const I=f[_]||"",O=o[_-1];g[O.name]=I&&O.repeatable?I.split("/"):I}return g}function c(p){let f="",g=!1;for(const _ of e){(!g||!f.endsWith("/"))&&(f+="/"),g=!1;for(const I of _)if(I.type===ns.Static)f+=I.value;else if(I.type===ns.Param){const{value:O,repeatable:q,optional:ee}=I,D=O in p?p[O]:"";if(vo(D)&&!q)throw new Error(`Provided param "${O}" is an array but it is not repeatable (* or + modifiers)`);const j=vo(D)?D.join("/"):D;if(!j)if(ee)_.length<2&&(f.endsWith("/")?f=f.slice(0,-1):g=!0);else throw new Error(`Missing required param "${O}"`);f+=j}}return f||"/"}return{re:s,score:r,keys:o,parse:l,stringify:c}}function jb(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]===mr.Static+mr.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===mr.Static+mr.Segment?1:-1:0}function um(e,t){let n=0;const r=e.score,a=t.score;for(;n<r.length&&n<a.length;){const o=jb(r[n],a[n]);if(o)return o;n++}if(Math.abs(a.length-r.length)===1){if(Rf(r))return 1;if(Rf(a))return-1}return a.length-r.length}function Rf(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Db={strict:!1,end:!0,sensitive:!1};function Fb(e,t,n){const r=Ob($b(e.path),n),a=Et(r,{record:e,parent:t,children:[],alias:[]});return t&&!a.record.aliasOf==!t.record.aliasOf&&t.children.push(a),a}function Ub(e,t){const n=[],r=new Map;t=kf(Db,t);function a(g){return r.get(g)}function o(g,_,I){const O=!I,q=$f(g);q.aliasOf=I&&I.record;const ee=kf(t,g),D=[q];if("alias"in g){const te=typeof g.alias=="string"?[g.alias]:g.alias;for(const _e of te)D.push($f(Et({},q,{components:I?I.record.components:q.components,path:_e,aliasOf:I?I.record:q})))}let j,K;for(const te of D){const{path:_e}=te;if(_&&_e[0]!=="/"){const fe=_.record.path,he=fe[fe.length-1]==="/"?"":"/";te.path=_.record.path+(_e&&he+_e)}if(j=Fb(te,_,ee),I?I.alias.push(j):(K=K||j,K!==j&&K.alias.push(j),O&&g.name&&!Nf(j)&&s(g.name)),cm(j)&&c(j),q.children){const fe=q.children;for(let he=0;he<fe.length;he++)o(fe[he],j,I&&I.children[he])}I=I||j}return K?()=>{s(K)}:_i}function s(g){if(sm(g)){const _=r.get(g);_&&(r.delete(g),n.splice(n.indexOf(_),1),_.children.forEach(s),_.alias.forEach(s))}else{const _=n.indexOf(g);_>-1&&(n.splice(_,1),g.record.name&&r.delete(g.record.name),g.children.forEach(s),g.alias.forEach(s))}}function l(){return n}function c(g){const _=Hb(g,n);n.splice(_,0,g),g.record.name&&!Nf(g)&&r.set(g.record.name,g)}function p(g,_){let I,O={},q,ee;if("name"in g&&g.name){if(I=r.get(g.name),!I)throw js(pn.MATCHER_NOT_FOUND,{location:g});ee=I.record.name,O=Et(Mf(_.params,I.keys.filter(K=>!K.optional).concat(I.parent?I.parent.keys.filter(K=>K.optional):[]).map(K=>K.name)),g.params&&Mf(g.params,I.keys.map(K=>K.name))),q=I.stringify(O)}else if(g.path!=null)q=g.path,I=n.find(K=>K.re.test(q)),I&&(O=I.parse(q),ee=I.record.name);else{if(I=_.name?r.get(_.name):n.find(K=>K.re.test(_.path)),!I)throw js(pn.MATCHER_NOT_FOUND,{location:g,currentLocation:_});ee=I.record.name,O=Et({},_.params,g.params),q=I.stringify(O)}const D=[];let j=I;for(;j;)D.unshift(j.record),j=j.parent;return{name:ee,path:q,params:O,matched:D,meta:qb(D)}}e.forEach(g=>o(g));function f(){n.length=0,r.clear()}return{addRoute:o,resolve:p,removeRoute:s,clearRoutes:f,getRoutes:l,getRecordMatcher:a}}function Mf(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function $f(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Bb(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 Bb(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 Nf(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function qb(e){return e.reduce((t,n)=>Et(t,n.meta),{})}function Hb(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;um(e,t[o])<0?r=o:n=o+1}const a=Wb(e);return a&&(r=t.lastIndexOf(a,r-1)),r}function Wb(e){let t=e;for(;t=t.parent;)if(cm(t)&&um(e,t)===0)return t}function cm({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Lf(e){const t=fo(Ql),n=fo(Xc),r=ae(()=>{const c=S(e.to);return t.resolve(c)}),a=ae(()=>{const{matched:c}=r.value,{length:p}=c,f=c[p-1],g=n.matched;if(!f||!g.length)return-1;const _=g.findIndex(Os.bind(null,f));if(_>-1)return _;const I=Of(c[p-2]);return p>1&&Of(f)===I&&g[g.length-1].path!==I?g.findIndex(Os.bind(null,c[p-2])):_}),o=ae(()=>a.value>-1&&Yb(n.params,r.value.params)),s=ae(()=>a.value>-1&&a.value===n.matched.length-1&&am(n.params,r.value.params));function l(c={}){if(Kb(c)){const p=t[S(e.replace)?"replace":"push"](S(e.to)).catch(_i);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>p),p}return Promise.resolve()}return{route:r,href:ae(()=>r.value.href),isActive:o,isExactActive:s,navigate:l}}function zb(e){return e.length===1?e[0]:e}const Vb=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:Lf,setup(e,{slots:t}){const n=Hl(Lf(e)),{options:r}=fo(Ql),a=ae(()=>({[jf(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[jf(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&zb(t.default(n));return e.custom?o:Qc("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:a.value},o)}}}),Gb=Vb;function Kb(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 Yb(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(!vo(a)||a.length!==r.length||r.some((o,s)=>o.valueOf()!==a[s].valueOf()))return!1}return!0}function Of(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const jf=(e,t,n)=>e??t??n,Qb=Bn({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=fo(gc),a=ae(()=>e.route||r.value),o=fo(If,0),s=ae(()=>{let p=S(o);const{matched:f}=a.value;let g;for(;(g=f[p])&&!g.components;)p++;return p}),l=ae(()=>a.value.matched[s.value]);wl(If,ae(()=>s.value+1)),wl(Cb,l),wl(gc,a);const c=A();return ht(()=>[c.value,l.value,e.name],([p,f,g],[_,I,O])=>{f&&(f.instances[g]=p,I&&I!==f&&p&&p===_&&(f.leaveGuards.size||(f.leaveGuards=I.leaveGuards),f.updateGuards.size||(f.updateGuards=I.updateGuards))),p&&f&&(!I||!Os(f,I)||!_)&&(f.enterCallbacks[g]||[]).forEach(q=>q(p))},{flush:"post"}),()=>{const p=a.value,f=e.name,g=l.value,_=g&&g.components[f];if(!_)return Df(n.default,{Component:_,route:p});const I=g.props[f],O=I?I===!0?p.params:typeof I=="function"?I(p):I:null,ee=Qc(_,Et({},O,t,{onVnodeUnmounted:D=>{D.component.isUnmounted&&(g.instances[f]=null)},ref:c}));return Df(n.default,{Component:ee,route:p})||ee}}});function Df(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Jb=Qb;function Xb(e){const t=Ub(e.routes,e),n=e.parseQuery||Tb,r=e.stringifyQuery||Af,a=e.history,o=li(),s=li(),l=li(),c=qg(Pa);let p=Pa;bs&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const f=Nu.bind(null,ne=>""+ne),g=Nu.bind(null,ab),_=Nu.bind(null,Ri);function I(ne,Se){let Ae,Fe;return sm(ne)?(Ae=t.getRecordMatcher(ne),Fe=Se):Fe=ne,t.addRoute(Fe,Ae)}function O(ne){const Se=t.getRecordMatcher(ne);Se&&t.removeRoute(Se)}function q(){return t.getRoutes().map(ne=>ne.record)}function ee(ne){return!!t.getRecordMatcher(ne)}function D(ne,Se){if(Se=Et({},Se||c.value),typeof ne=="string"){const V=Lu(n,ne,Se.path),ie=t.resolve({path:V.path},Se),Q=a.createHref(V.fullPath);return Et(V,ie,{params:_(ie.params),hash:Ri(V.hash),redirectedFrom:void 0,href:Q})}let Ae;if(ne.path!=null)Ae=Et({},ne,{path:Lu(n,ne.path,Se.path).path});else{const V=Et({},ne.params);for(const ie in V)V[ie]==null&&delete V[ie];Ae=Et({},ne,{params:g(V)}),Se.params=g(Se.params)}const Fe=t.resolve(Ae,Se),Ke=ne.hash||"";Fe.params=f(_(Fe.params));const x=lb(r,Et({},ne,{hash:nb(Ke),path:Fe.path})),R=a.createHref(x);return Et({fullPath:x,hash:Ke,query:r===Af?kb(ne.query):ne.query||{}},Fe,{redirectedFrom:void 0,href:R})}function j(ne){return typeof ne=="string"?Lu(n,ne,c.value.path):Et({},ne)}function K(ne,Se){if(p!==ne)return js(pn.NAVIGATION_CANCELLED,{from:Se,to:ne})}function te(ne){return he(ne)}function _e(ne){return te(Et(j(ne),{replace:!0}))}function fe(ne,Se){const Ae=ne.matched[ne.matched.length-1];if(Ae&&Ae.redirect){const{redirect:Fe}=Ae;let Ke=typeof Fe=="function"?Fe(ne,Se):Fe;return typeof Ke=="string"&&(Ke=Ke.includes("?")||Ke.includes("#")?Ke=j(Ke):{path:Ke},Ke.params={}),Et({query:ne.query,hash:ne.hash,params:Ke.path!=null?{}:ne.params},Ke)}}function he(ne,Se){const Ae=p=D(ne),Fe=c.value,Ke=ne.state,x=ne.force,R=ne.replace===!0,V=fe(Ae,Fe);if(V)return he(Et(j(V),{state:typeof V=="object"?Et({},Ke,V.state):Ke,force:x,replace:R}),Se||Ae);const ie=Ae;ie.redirectedFrom=Se;let Q;return!x&&ub(r,Fe,Ae)&&(Q=js(pn.NAVIGATION_DUPLICATED,{to:ie,from:Fe}),Ve(Fe,Fe,!0,!1)),(Q?Promise.resolve(Q):ye(ie,Fe)).catch(le=>ra(le)?ra(le,pn.NAVIGATION_GUARD_REDIRECT)?le:rt(le):Ce(le,ie,Fe)).then(le=>{if(le){if(ra(le,pn.NAVIGATION_GUARD_REDIRECT))return he(Et({replace:R},j(le.to),{state:typeof le.to=="object"?Et({},Ke,le.to.state):Ke,force:x}),Se||ie)}else le=se(ie,Fe,!0,R,Ke);return ke(ie,Fe,le),le})}function Re(ne,Se){const Ae=K(ne,Se);return Ae?Promise.reject(Ae):Promise.resolve()}function G(ne){const Se=Ge.values().next().value;return Se&&typeof Se.runWithContext=="function"?Se.runWithContext(ne):ne()}function ye(ne,Se){let Ae;const[Fe,Ke,x]=Sb(ne,Se);Ae=ju(Fe.reverse(),"beforeRouteLeave",ne,Se);for(const V of Fe)V.leaveGuards.forEach(ie=>{Ae.push(Na(ie,ne,Se))});const R=Re.bind(null,ne,Se);return Ae.push(R),wt(Ae).then(()=>{Ae=[];for(const V of o.list())Ae.push(Na(V,ne,Se));return Ae.push(R),wt(Ae)}).then(()=>{Ae=ju(Ke,"beforeRouteUpdate",ne,Se);for(const V of Ke)V.updateGuards.forEach(ie=>{Ae.push(Na(ie,ne,Se))});return Ae.push(R),wt(Ae)}).then(()=>{Ae=[];for(const V of x)if(V.beforeEnter)if(vo(V.beforeEnter))for(const ie of V.beforeEnter)Ae.push(Na(ie,ne,Se));else Ae.push(Na(V.beforeEnter,ne,Se));return Ae.push(R),wt(Ae)}).then(()=>(ne.matched.forEach(V=>V.enterCallbacks={}),Ae=ju(x,"beforeRouteEnter",ne,Se,G),Ae.push(R),wt(Ae))).then(()=>{Ae=[];for(const V of s.list())Ae.push(Na(V,ne,Se));return Ae.push(R),wt(Ae)}).catch(V=>ra(V,pn.NAVIGATION_CANCELLED)?V:Promise.reject(V))}function ke(ne,Se,Ae){l.list().forEach(Fe=>G(()=>Fe(ne,Se,Ae)))}function se(ne,Se,Ae,Fe,Ke){const x=K(ne,Se);if(x)return x;const R=Se===Pa,V=bs?history.state:{};Ae&&(Fe||R?a.replace(ne.fullPath,Et({scroll:R&&V&&V.scroll},Ke)):a.push(ne.fullPath,Ke)),c.value=ne,Ve(ne,Se,Ae,R),rt()}let Te;function De(){Te||(Te=a.listen((ne,Se,Ae)=>{if(!qe.listening)return;const Fe=D(ne),Ke=fe(Fe,qe.currentRoute.value);if(Ke){he(Et(Ke,{replace:!0,force:!0}),Fe).catch(_i);return}p=Fe;const x=c.value;bs&&gb(xf(x.fullPath,Ae.delta),Yl()),ye(Fe,x).catch(R=>ra(R,pn.NAVIGATION_ABORTED|pn.NAVIGATION_CANCELLED)?R:ra(R,pn.NAVIGATION_GUARD_REDIRECT)?(he(Et(j(R.to),{force:!0}),Fe).then(V=>{ra(V,pn.NAVIGATION_ABORTED|pn.NAVIGATION_DUPLICATED)&&!Ae.delta&&Ae.type===mc.pop&&a.go(-1,!1)}).catch(_i),Promise.reject()):(Ae.delta&&a.go(-Ae.delta,!1),Ce(R,Fe,x))).then(R=>{R=R||se(Fe,x,!1),R&&(Ae.delta&&!ra(R,pn.NAVIGATION_CANCELLED)?a.go(-Ae.delta,!1):Ae.type===mc.pop&&ra(R,pn.NAVIGATION_ABORTED|pn.NAVIGATION_DUPLICATED)&&a.go(-1,!1)),ke(Fe,x,R)}).catch(_i)}))}let Be=li(),ze=li(),Ne;function Ce(ne,Se,Ae){rt(ne);const Fe=ze.list();return Fe.length?Fe.forEach(Ke=>Ke(ne,Se,Ae)):console.error(ne),Promise.reject(ne)}function Ye(){return Ne&&c.value!==Pa?Promise.resolve():new Promise((ne,Se)=>{Be.add([ne,Se])})}function rt(ne){return Ne||(Ne=!ne,De(),Be.list().forEach(([Se,Ae])=>ne?Ae(ne):Se()),Be.reset()),ne}function Ve(ne,Se,Ae,Fe){const{scrollBehavior:Ke}=e;if(!bs||!Ke)return Promise.resolve();const x=!Ae&&yb(xf(ne.fullPath,0))||(Fe||!Ae)&&history.state&&history.state.scroll||null;return Zt().then(()=>Ke(ne,Se,x)).then(R=>R&&vb(R)).catch(R=>Ce(R,ne,Se))}const Le=ne=>a.go(ne);let gt;const Ge=new Set,qe={currentRoute:c,listening:!0,addRoute:I,removeRoute:O,clearRoutes:t.clearRoutes,hasRoute:ee,getRoutes:q,resolve:D,options:e,push:te,replace:_e,go:Le,back:()=>Le(-1),forward:()=>Le(1),beforeEach:o.add,beforeResolve:s.add,afterEach:l.add,onError:ze.add,isReady:Ye,install(ne){ne.component("RouterLink",Gb),ne.component("RouterView",Jb),ne.config.globalProperties.$router=qe,Object.defineProperty(ne.config.globalProperties,"$route",{enumerable:!0,get:()=>S(c)}),bs&&!gt&&c.value===Pa&&(gt=!0,te(a.location).catch(Fe=>{}));const Se={};for(const Fe in Pa)Object.defineProperty(Se,Fe,{get:()=>c.value[Fe],enumerable:!0});ne.provide(Ql,qe),ne.provide(Xc,ip(Se)),ne.provide(gc,c);const Ae=ne.unmount;Ge.add(ne),ne.unmount=function(){Ge.delete(ne),Ge.size<1&&(p=Pa,Te&&Te(),Te=null,c.value=Pa,gt=!1,Ne=!1),Ae()}}};function wt(ne){return ne.reduce((Se,Ae)=>Se.then(()=>G(Ae)),Promise.resolve())}return qe}function Zb(){return fo(Ql)}function e0(e){return fo(Xc)}const Ff=768;function Zc(){const e=A(typeof window<"u"?window.innerWidth<Ff:!1);let t=null;function n(r){e.value=r.matches}return ma(()=>{t=window.matchMedia(`(max-width: ${Ff-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),zl(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const t0={key:0,class:"desktop-sidebar"},n0={class:"desktop-main"},Uf="codex-web-local.sidebar-width.v1",r0=260,o0=620,Bf=320,a0=Bn({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Zc();function r(p){return Math.min(o0,Math.max(r0,p))}function a(){if(typeof window>"u")return Bf;const p=window.localStorage.getItem(Uf),f=Number(p);return Number.isFinite(f)?r(f):Bf}const o=A(a()),s=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(p){typeof window>"u"||window.localStorage.setItem(Uf,String(p))}function c(p){p.preventDefault();const f=p.clientX,g=o.value,_=O=>{const q=O.clientX-f;o.value=r(g+q)},I=()=>{l(o.value),window.removeEventListener("mousemove",_),window.removeEventListener("mouseup",I)};window.addEventListener("mousemove",_),window.addEventListener("mouseup",I)}return(p,f)=>(C(),E("div",{class:tt(["desktop-layout",{"is-mobile":S(n)}]),style:ua(s.value)},[S(n)?(C(),et(ts,{key:0,to:"body"},[je(Jp,{name:"drawer"},{default:ft(()=>[e.isSidebarCollapsed?Z("",!0):(C(),E("div",{key:0,class:"mobile-drawer-backdrop",onClick:f[1]||(f[1]=g=>p.$emit("close-sidebar"))},[m("aside",{class:"mobile-drawer",onClick:f[0]||(f[0]=Ze(()=>{},["stop"]))},[Bo(p.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):Z("",!0),S(n)?Z("",!0):(C(),E(Qe,{key:1},[e.isSidebarCollapsed?Z("",!0):(C(),E("aside",t0,[Bo(p.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?Z("",!0):(C(),E("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:c},null,32))],64)),m("section",n0,[Bo(p.$slots,"content",{},void 0)])],6))}}),At=(e,t)=>{const n=e.__vccOpts||e;for(const[r,a]of t)n[r]=a;return n},s0=At(a0,[["__scopeId","data-v-4c6dbcd7"]]);function qf(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class Ho extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function va(e,t){if(typeof e=="string"&&e.length>0)return e;const n=qf(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const a=qf(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 ha(e,t,n){return e instanceof Ho?e:e instanceof Error?new Ho(e.message||t,{code:"unknown_error",method:n}):new Ho(t,{code:"unknown_error",method:n})}function dm(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function i0(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 Ho(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=va(a,"")||(o==null?void 0:o.slice(0,500))||"",c=`RPC ${e} failed with HTTP ${r.status}`;throw new Ho(l?`${c}: ${l}`:c,{code:"http_error",method:e,status:r.status})}const s=a;if(!s||typeof s!="object"||!("result"in s))throw new Ho(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return s.result}async function l0(){const e=await fetch("/codex-api/meta/methods");let t=null;try{t=await e.json()}catch{t=null}if(!e.ok)throw new Ho(va(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 u0(e){const t=dm(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 Hf(e,t={ok:!0}){e({method:"ready",params:t,atIso:new Date().toISOString()})}function c0(e){if(typeof window>"u")return()=>{};let t=null,n=!1,r=null;const a=()=>{r!==null&&(window.clearTimeout(r),r=null)},o=(p,f)=>{if(n||r!==null)return;const g=Math.min(1e3*2**f,1e4);r=window.setTimeout(()=>{r=null,!n&&p()},g)},s=p=>{const f=u0(p);f&&e(f)},l=(p=0)=>{if(typeof EventSource>"u"||n)return;t==null||t();const f=new EventSource("/codex-api/events");let g=!1;f.onmessage=_=>{try{s(JSON.parse(_.data))}catch{}},f.addEventListener("ready",_=>{try{const I=_.data?JSON.parse(_.data):{ok:!0};Hf(e,I)}catch{Hf(e)}}),f.onerror=()=>{n||g||f.readyState===EventSource.CLOSED&&(g=!0,f.close(),o(()=>l(p+1),p))},t=()=>{g=!0,f.close()}},c=(p=0)=>{if(typeof WebSocket>"u"||n){l();return}t==null||t();const f=window.location.protocol==="https:"?"wss:":"ws:",g=new WebSocket(`${f}//${window.location.host}/codex-api/ws`);let _=!1,I=!1,O=window.setTimeout(()=>{_||n||I||(I=!0,g.close(),l())},2500);g.onopen=()=>{_=!0,a(),O!==null&&(window.clearTimeout(O),O=null)},g.onmessage=q=>{try{s(JSON.parse(String(q.data)))}catch{}},g.onerror=()=>{},g.onclose=()=>{if(O!==null&&(window.clearTimeout(O),O=null),!(n||I)){if(!_){l();return}o(()=>c(p+1),p)}},t=()=>{I=!0,O!==null&&(window.clearTimeout(O),O=null),g.close()}};return typeof WebSocket<"u"?c():l(),()=>{n=!0,a(),t==null||t()}}async function d0(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 Ho(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 Ho(va(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function f0(){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 Ho(va(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=dm(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function h0(e){const t=e.trim();return t?t.startsWith("\\\\?\\UNC\\")?`\\\\${t.slice(8)}`:t.startsWith("\\\\?\\")?t.slice(4):t:""}function ot(e){return h0(e)}function p0(e){return/^[a-z]:[\\/]/iu.test(e)||e.startsWith("\\\\")}function m0(e){const t=ot(e).replace(/[\\/]+/gu,"/");return p0(t)?t.toLowerCase():t}function Hr(e){const t=ot(e).replace(/[\\/]+$/u,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<0?t:t.slice(n+1)}function Ms(e){const t=ot(e).replace(/[\\/]+$/u,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n<=0?"":t.slice(0,n)}function Jr(e){return Hr(e)||ot(e)||"Projectless"}function Ml(e){const t=ot(e).replace(/[\\/]+/gu,"/");return t?/(?:^|\/)Documents\/Codex\/\d{4}-\d{2}-\d{2}\/[^/]+$/u.test(t):!1}function Wf(e){return new Date(e*1e3).toISOString()}function v0(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const g0=/^##\s+(.+?):\s+(.+?)\s*$/,y0=/^#\s*files mentioned by the user\s*:?\s*$/i;function w0(e){var a,o;const t=e.split(`
27
+ `).findIndex(s=>y0.test(s.trim()));if(t<0)return[];const n=e.split(`
28
+ `).slice(t+1),r=[];for(const s of n){const l=s.trim();if(!l)continue;const c=l.match(g0);if(!c)break;const p=(a=c[1])==null?void 0:a.trim(),f=(o=c[2])==null?void 0:o.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");p&&f&&r.push({label:p,path:f})}return r}function b0(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 fm(e){return`/codex-local-image?path=${encodeURIComponent(e)}`}function _0(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 T0(e){return e.replace(/&lt;/giu,"<").replace(/&gt;/giu,">").replace(/&amp;/giu,"&")}function Du(e,t){const n=new RegExp(`<${t}>\\s*([\\s\\S]*?)\\s*</${t}>`,"iu").exec(e);return n!=null&&n[1]?T0(n[1].trim()):""}function k0(e){const t=e.trim();if(!t.startsWith("<heartbeat>")||!t.endsWith("</heartbeat>"))return null;const n=Du(t,"current_time_iso"),r=Du(t,"instructions");return!n||!r?null:{automationId:Du(t,"automation_id"),currentTimeIso:n,instructions:r}}function C0(e,t){if(!Array.isArray(t))return{text:"",images:[],skills:[],fileAttachments:[],rawBlocks:[],isAutomationRun:!1,automationDisplayName:null};const n=[],r=[],a=[],o=[];for(const[p,f]of t.entries()){if(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(fm(f.path.trim())),f.type==="skill"){const g=typeof f.name=="string"?f.name.trim():"",_=typeof f.path=="string"?f.path.trim():"";g&&_&&a.push({name:g,path:_})}f.type!=="text"&&f.type!=="image"&&f.type!=="localImage"&&f.type!=="skill"&&o.push({id:`${e}:user-content:${p}`,role:"user",text:"",messageType:`userContent.${f.type}`,rawPayload:v0(f),isUnhandled:!0})}const s=n.join(`
29
+ `),l=w0(s),c=k0(s);return{text:(c==null?void 0:c.instructions)??b0(s),images:r,skills:a,fileAttachments:l,rawBlocks:o,isAutomationRun:c!==null,automationDisplayName:(c==null?void 0:c.automationId)||null}}function S0(e){var o;const t=e.replace(/\r\n/g,`
30
+ `).trim();if(!t)return null;const n=t.split(`
31
+ `),r=[],a=[];for(const s of n){const l=s.trim();if(!l){r.length===0&&a.push("");continue}const c=l.match(/^[-*]\s+\[([ xX~>|-])\]\s+(.+)$/);if(c){const p=(c[1]??" ").toLowerCase(),f=(o=c[2])==null?void 0:o.trim();if(!f)continue;let g="pending";p==="x"&&(g="completed"),(p==="~"||p===">"||p==="-")&&(g="inProgress"),r.push({step:f,status:g});continue}a.push(l)}return r.length===0?null:{explanation:a.join(`
32
+ `).trim()||void 0,steps:r}}function zf(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 x0(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 hm(e){return e==="failed"||e==="declined"||e==="completed"?e:"inProgress"}function pm(e){const t=Array.isArray(e)?e:[],n=[];for(const r of t){const a=r,o=typeof a.path=="string"?a.path:"",s=typeof a.diff=="string"?a.diff:"",l=a.kind,c=l==null?void 0:l.type;if(!o||c!=="add"&&c!=="delete"&&c!=="update")continue;const p=c==="update"&&typeof(l==null?void 0:l.move_path)=="string"?l.move_path:null,f=c==="update"?x0(s):c==="add"?{addedLineCount:zf(s),removedLineCount:0}:{addedLineCount:0,removedLineCount:zf(s)};n.push({path:o,operation:c,movedToPath:p,diff:s,...f})}return n}function A0(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=C0(e.id,e.content),n=[];return(t.text.length>0||t.images.length>0||t.fileAttachments.length>0||t.skills.length>0)&&n.push({id:e.id,role:"user",text:t.text,images:t.images,skills:t.skills.length>0?t.skills:void 0,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:[fm(t)],messageType:"imageView"}]:[]}{const t=e;if(t.type==="imageGeneration"||t.type==="image_generation"){const n=typeof t.result=="string"?_0(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:S0(t)??void 0}]}if(e.type==="commandExecution"){const t=e,n=I0(t.status),r=typeof t.command=="string"?t.command:"",a=typeof t.cwd=="string"?t.cwd:null,o=typeof t.aggregatedOutput=="string"?t.aggregatedOutput:"",s=typeof t.exitCode=="number"?t.exitCode:null;return[{id:e.id,role:"system",text:r,messageType:"commandExecution",commandExecution:{command:r,cwd:a,status:n,aggregatedOutput:o,exitCode:s}}]}if(e.type==="fileChange"){const t=pm(e.changes),n=hm(e.status);return t.length===0||n!=="completed"?[]:[{id:e.id,role:"system",text:"",messageType:"fileChange",fileChangeStatus:n,fileChanges:t}]}return[]}function I0(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function E0(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 P0(e){const t=E0(e);return t.length>0?t:"Untitled thread"}function ed(e){return(e==null?void 0:e.status)==="inProgress"}function R0(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 ed(r)}function M0(e){const t=e,n=ot(typeof t.cwd=="string"?t.cwd:e.cwd),r=m0(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:P0(e),projectName:Jr(n),cwd:n,hasWorktree:a,createdAtIso:Wf(e.createdAt),updatedAtIso:Wf(e.updatedAt),preview:e.preview,unread:!1,inProgress:R0(e)}}function $0(e){const t=new Map;for(const n of e){const r=t.get(n.projectName);r?r.push(n):t.set(n.projectName,[n])}return Array.from(t.entries()).map(([n,r])=>({projectName:n,threads:r.sort((a,o)=>new Date(o.updatedAtIso).getTime()-new Date(a.updatedAtIso).getTime())})).sort((n,r)=>{var s,l;const a=new Date(((s=n.threads[0])==null?void 0:s.updatedAtIso)??0).getTime();return new Date(((l=r.threads[0])==null?void 0:l.updatedAtIso)??0).getTime()-a})}function N0(e){const t=e.data.map(M0);return $0(t)}function Jl(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n=[];for(let r=0;r<t.length;r++){const a=t[r],o=typeof(a==null?void 0:a.id)=="string"?a.id:void 0,s=Array.isArray(a.items)?a.items:[];for(const l of s)for(const c of A0(l))n.push({...c,turnId:o,turnIndex:r})}return n}function mm(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return ed(t.at(-1))}function vm(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(ed(r)&&typeof r.id=="string"&&r.id.trim().length>0)return r.id.trim()}return""}const L0=5e3,O0=8e3;function Fu(e){return e&&e.length>0?e:null}function Uu(e){return e&&e.length>0?e:null}let ul=null,Ti=null;const Vf=[{value:"default",label:"Default"},{value:"plan",label:"Plan"}];function it(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}function ce(e){return typeof e=="string"&&e.length>0?e:null}function Tn(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function Xr(e){return typeof e=="boolean"?e:null}function ks(e){return Array.isArray(e)?e.filter(t=>typeof t=="string"&&t.length>0):[]}function j0(e){return e==="payment_required"?e:null}function D0(e){if(!e)return!1;const t=e.toLowerCase();return t.includes("payment required")||/\b402\b/.test(t)}function Gf(e){const t=it(e);if(!t)return null;const n=Tn(t.usedPercent??t.used_percent);if(n===null)return null;const r=Tn(t.windowDurationMins??t.window_minutes);return{usedPercent:n,windowDurationMins:r,windowMinutes:r,resetsAt:Tn(t.resetsAt??t.resets_at)}}function F0(e){const t=it(e);if(!t)return null;const n=Xr(t.hasCredits??t.has_credits),r=Xr(t.unlimited);return n===null||r===null?null:{hasCredits:n,unlimited:r,balance:ce(t.balance)}}function yc(e){const t=it(e);if(!t)return null;const n=Gf(t.primary),r=Gf(t.secondary),a=F0(t.credits);return!n&&!r&&!a?null:{limitId:ce(t.limitId??t.limit_id),limitName:ce(t.limitName??t.limit_name),primary:n,secondary:r,credits:a,planType:ce(t.planType??t.plan_type)}}function gm(e,t=null){const n=it(e);if(!n)return null;const r=ce(n.accountId),a=ce(n.quotaStatus),o=a==="loading"||a==="ready"||a==="error"?a:"idle";return r?{accountId:r,authMode:ce(n.authMode),email:ce(n.email),planType:ce(n.planType),lastRefreshedAtIso:ce(n.lastRefreshedAtIso)??"",lastActivatedAtIso:ce(n.lastActivatedAtIso),quotaSnapshot:yc(n.quotaSnapshot),quotaUpdatedAtIso:ce(n.quotaUpdatedAtIso),quotaStatus:o,quotaError:ce(n.quotaError),unavailableReason:j0(n.unavailableReason)??(D0(ce(n.quotaError))?"payment_required":null),isActive:Xr(n.isActive)??r===t}:null}function ym(e){const t=it(e);if(!t)return null;const n=it(t.rateLimitsByLimitId??t.rate_limits_by_limit_id),r=yc(n==null?void 0:n.codex);return r||yc(t.rateLimits??t.rate_limits)}async function Mt(e,t){try{return await i0(e,t)}catch(n){throw ha(n,`RPC ${e} failed`,e)}}function wm(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 U0(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}function B0(e){return typeof e=="string"&&e.trim().toLowerCase()==="fast"?"fast":"standard"}const q0=50,H0=100;async function W0(e,t){const n=await Mt("thread/list",{archived:!1,limit:t,sortKey:"updated_at",modelProviders:[],cursor:e});return{groups:N0(n),nextCursor:typeof n.nextCursor=="string"&&n.nextCursor.length>0?n.nextCursor:null}}async function z0(e){const t=await Mt("thread/read",{threadId:e,includeTurns:!0});return{messages:Jl(t),inProgress:mm(t),activeTurnId:vm(t),turnIndexByTurnId:wm(t)}}async function Kf(e=null,t=q0){try{return await W0(e,t)}catch(n){throw ha(n,"Failed to load thread groups","thread/list")}}function V0(){return H0}async function Yf(e){try{return await z0(e)}catch(t){throw ha(t,`Failed to load thread ${e}`,"thread/read")}}function G0(e){const t=it(e);if(!t)return null;const n=ce(t.key),r=typeof t.text=="string"?t.text:"",a=ce(t.kind);return!n||!a||a!=="meta"&&a!=="hunk"&&a!=="add"&&a!=="remove"&&a!=="context"?null:{key:n,kind:a,text:r,oldLine:Tn(t.oldLine),newLine:Tn(t.newLine)}}function K0(e){const t=it(e);if(!t)return null;const n=ce(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:Tn(t.addedLineCount)??0,removedLineCount:Tn(t.removedLineCount)??0,oldStart:Tn(t.oldStart),oldLineCount:Tn(t.oldLineCount)??0,newStart:Tn(t.newStart),newLineCount:Tn(t.newLineCount)??0,lines:Array.isArray(t.lines)?t.lines.map(o=>G0(o)).filter(o=>o!==null):[]}:null}function Y0(e){const t=it(e);if(!t)return null;const n=ce(t.id),r=ce(t.path),a=ce(t.absolutePath),o=ce(t.operation);return!n||!r||!a||!o||o!=="add"&&o!=="delete"&&o!=="update"&&o!=="rename"?null:{id:n,path:r,absolutePath:a,previousPath:ce(t.previousPath),previousAbsolutePath:ce(t.previousAbsolutePath),operation:o,addedLineCount:Tn(t.addedLineCount)??0,removedLineCount:Tn(t.removedLineCount)??0,diff:typeof t.diff=="string"?t.diff:"",hunks:Array.isArray(t.hunks)?t.hunks.map(s=>K0(s)).filter(s=>s!==null):[]}}function bm(e){const t=it(e),n=it(t==null?void 0:t.data),r=it(n==null?void 0:n.summary),a=ce(n==null?void 0:n.scope)==="baseBranch"?"baseBranch":"workspace",o=ce(n==null?void 0:n.workspaceView)==="staged"?"staged":"unstaged";return{cwd:ce(n==null?void 0:n.cwd)??"",gitRoot:ce(n==null?void 0:n.gitRoot),isGitRepo:Xr(n==null?void 0:n.isGitRepo)??!1,scope:a,workspaceView:o,baseBranch:ce(n==null?void 0:n.baseBranch),baseBranchOptions:Array.isArray(n==null?void 0:n.baseBranchOptions)?n.baseBranchOptions.map(s=>ce(s)).filter(s=>typeof s=="string"&&s.length>0):[],headBranch:ce(n==null?void 0:n.headBranch),mergeBaseSha:ce(n==null?void 0:n.mergeBaseSha),generatedAtIso:ce(n==null?void 0:n.generatedAtIso)??"",summary:{fileCount:Tn(r==null?void 0:r.fileCount)??0,addedLineCount:Tn(r==null?void 0:r.addedLineCount)??0,removedLineCount:Tn(r==null?void 0:r.removedLineCount)??0},files:Array.isArray(n==null?void 0:n.files)?n.files.map(s=>Y0(s)).filter(s=>s!==null):[]}}function Q0(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 J0(e){var s;const t=e.replace(/\r\n/g,`
38
+ `).trim();if(!t)return{reviewText:"",summary:"",findings:[]};const n=t.search(/\n(?:Full review comments|Review comment):\n/iu),r=n>=0?t.slice(0,n).trim():t,a=n>=0?t.slice(n).trim():"",o=[];if(a){const c=a.replace(/^(?:Full review comments|Review comment):\n*/iu,"").trim().matchAll(/^- (.+?) — (.+)\n?((?: .*(?:\n|$))*)/gmu);let p=0;for(const f of c){const g=((s=f[1])==null?void 0:s.trim())??"",_=Q0(f[2]??""),I=(f[0]??"").trim(),O=(f[3]??"").split(`
39
+ `).map(q=>q.replace(/^ /u,"")).join(`
40
+ `).trim();o.push({id:`finding:${p}`,title:g||`Finding ${p+1}`,body:O,path:_.absolutePath?_.absolutePath.split("/").filter(Boolean).slice(-1)[0]??_.absolutePath:null,absolutePath:_.absolutePath,startLine:_.startLine,endLine:_.endLine,rawText:I}),p+=1}}return{reviewText:t,summary:r,findings:o}}function Qf(e,t){const n=Array.isArray(e.thread.turns)?e.thread.turns:[];for(let r=n.length-1;r>=0;r-=1){const a=n[r],o=Array.isArray(a==null?void 0:a.items)?a.items:[];for(let s=o.length-1;s>=0;s-=1){const l=o[s];if((l==null?void 0:l.type)!==t)continue;const c=typeof l.review=="string"?l.review.trim():"";if(c)return c}}return null}async function jM(e){const t=await Mt("thread/read",{threadId:e,includeTurns:!0}),n=Qf(t,"exitedReviewMode");return{enteredReviewLabel:Qf(t,"enteredReviewMode"),result:n?J0(n):null}}async function DM(){return l0()}function wc(e){const t=it(e);if(!t)return null;const n=ce(t.id),r=ce(t.kind),a=ce(t.name),o=ce(t.prompt),s=ce(t.rrule),l=ce(t.status);return!n||!a||!o||!s||r!=="heartbeat"&&r!=="cron"||l!=="ACTIVE"&&l!=="PAUSED"?null:{id:n,kind:r,name:a,prompt:o,rrule:s,status:l,targetThreadId:ce(t.targetThreadId),createdAtMs:Tn(t.createdAtMs),updatedAtMs:Tn(t.updatedAtMs),nextRunAtMs:Tn(t.nextRunAtMs)}}function X0(e){if(Array.isArray(e))return e.flatMap(n=>{const r=wc(n);return r?[r]:[]});const t=wc(e);return t?[t]:[]}async function Z0(){var a;const e=await fetch("/codex-api/thread-automations"),t=await e.json().catch(()=>null);if(!e.ok)throw new Error(va(t,"Failed to load thread automations"));const n=it((a=it(t))==null?void 0:a.data),r={};if(!n)return r;for(const[o,s]of Object.entries(n)){const l=X0(s);l.length>0&&(r[o]=l)}return r}async function e_(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(va(n,"Failed to save thread automation"));const r=wc((a=it(n))==null?void 0:a.data);if(!r)throw new Error("Thread automation response was malformed");return r}async function Jf(e,t){const n=new URLSearchParams({threadId:e});t&&n.set("automationId",t);const r=await fetch(`/codex-api/thread-automation?${n.toString()}`,{method:"DELETE"}),a=await r.json().catch(()=>null);if(!r.ok)throw new Error(va(a,"Failed to delete thread automation"))}async function t_(e,t){const n=await fetch("/codex-api/thread-automation/run",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({threadId:e,automationId:t})}),r=await n.json().catch(()=>null);if(!n.ok)throw new Error(va(r,"Failed to run thread automation"))}function n_(e){return c0(e)}function r_(e){const t=it(e);if(!t)return null;const n=ce(t.id),r=ce(t.threadId),a=ce(t.cwd),o=ce(t.shell);return!n||!r||!a||!o?null:{id:n,threadId:r,cwd:a,shell:o,buffer:typeof t.buffer=="string"?t.buffer:"",truncated:Xr(t.truncated)??!1}}async function Fs(e,t){const n=await fetch(e,t),r=await n.json().catch(()=>null);if(!n.ok)throw new Error(va(r,`Terminal request failed with HTTP ${n.status}`));return r}async function FM(e){var r;const t=await Fs("/codex-api/thread-terminal/attach",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=r_((r=it(t))==null?void 0:r.session);if(!n)throw new Error("Terminal attach response was malformed");return n}async function o_(){const e=await Fs("/codex-api/thread-terminal/status"),t=it(e);return{available:Xr(t==null?void 0:t.available)??!1,reason:ce(t==null?void 0:t.reason)||null}}async function a_(e){const t=await Fs(`/codex-api/thread-terminal/quick-commands?cwd=${encodeURIComponent(e)}`),n=it(t);return(Array.isArray(n==null?void 0:n.commands)?n.commands:[]).flatMap(a=>{const o=it(a),s=ce(o==null?void 0:o.label),l=ce(o==null?void 0:o.value),c=ce(o==null?void 0:o.source);return!s||!l||c!=="package"&&c!=="script"&&c!=="make"?[]:[{label:s,value:l,source:c}]})}async function UM(e,t){await Fs("/codex-api/thread-terminal/input",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e,data:t})})}async function BM(e,t,n){await Fs("/codex-api/thread-terminal/resize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e,cols:t,rows:n})})}async function qM(e){await Fs("/codex-api/thread-terminal/close",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e})})}async function s_(e,t){await d0({id:e,...t})}async function i_(){return f0()}async function l_(){try{const e=await Mt("account/rateLimits/read");return ym(e)}catch(e){throw ha(e,"Failed to load account rate limits","account/rateLimits/read")}}function Xl(e){const t=it(e),n=ce(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:ce(t==null?void 0:t.importedAccountId)??void 0,accounts:r.map(a=>gm(a,n)).filter(a=>a!==null)}}async function u_(){const e=await fetch("/codex-api/accounts"),t=await e.json();if(!e.ok)throw new Error($n(t,"Failed to load accounts"));const n=it(t);return Xl(n==null?void 0:n.data)}async function c_(){const e=await fetch("/codex-api/accounts/refresh",{method:"POST"}),t=await e.json();if(!e.ok)throw new Error($n(t,"Failed to refresh accounts"));const n=it(t);return Xl(n==null?void 0:n.data)}async function d_(){const e=await fetch("/codex-api/accounts/login/start",{method:"POST"}),t=await e.json();if(!e.ok)throw new Error($n(t,"Failed to start Codex login"));const n=it(t),r=it(n==null?void 0:n.data),a=ce(r==null?void 0:r.loginUrl);if(!a)throw new Error("Failed to start Codex login");return a}async function f_(e){const t=await fetch("/codex-api/accounts/login/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({callbackUrl:e})}),n=await t.json();if(!t.ok)throw new Error($n(n,"Failed to complete Codex login"));const r=it(n);return Xl(r==null?void 0:r.data)}async function h_(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($n(n,"Failed to switch account"));const r=it(n),a=it(r==null?void 0:r.data),o=gm(a==null?void 0:a.account,ce(a==null?void 0:a.activeAccountId));if(!o)throw new Error("Failed to switch account");return o}async function p_(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($n(n,"Failed to remove account"));const r=it(n);return Xl(r==null?void 0:r.data)}async function Bu(e){const t=await Mt("thread/resume",{threadId:e});return{model:$l(t),messages:Jl(t),inProgress:mm(t),activeTurnId:vm(t),turnIndexByTurnId:wm(t)}}async function m_(e){await Mt("thread/archive",{threadId:e})}async function v_(e,t){await Mt("thread/name/set",{threadId:e,name:t})}async function qu(e,t){const n=await Mt("thread/rollback",{threadId:e,numTurns:t});return Jl(n)}async function g_(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 bc(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 y_(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 $l(e){if(!e||typeof e!="object")return"";const t=e.model;return typeof t=="string"?t.trim():""}async function Xf(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 Mt("thread/start",n),a=bc(r);if(!a)throw new Error("thread/start did not return a thread id");return{threadId:a,model:$l(r)}}catch(n){throw ha(n,"Failed to start a new thread","thread/start")}}async function Zf(e,t,n){if(arguments.length<=1)try{const r=await Mt("thread/fork",{threadId:e,persistExtendedHistory:!0}),a=bc(r);if(!a)throw new Error("thread/fork did not return a thread id");return{threadId:a,cwd:y_(r),model:$l(r),messages:Jl(r)}}catch(r){throw ha(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 Mt("thread/fork",a),s=bc(o);if(!s)throw new Error("thread/fork did not return a thread id");return{threadId:s,model:$l(o)}}catch(r){throw ha(r,`Failed to fork thread ${e}`,"thread/fork")}}function eh(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 w_(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 b_(e){const t=e.replace(/\\/g,"/");return t.split("/").filter(Boolean).at(-1)??t}async function __(e,t,n){var c;const r=(t==null?void 0:t.trim())??"";if(r)return{model:r,reasoningEffort:e==="plan"?Fu(n):Uu(n)};let a=null;try{a=await km()}catch{a=null}const o=(a==null?void 0:a.model.trim())??"";if(o)return{model:o,reasoningEffort:e==="plan"?Fu(n??(a==null?void 0:a.reasoningEffort)):Uu(n??(a==null?void 0:a.reasoningEffort))};let s=[];try{s=await Tm()}catch{s=[]}const l=((c=s.find(p=>p.trim().length>0))==null?void 0:c.trim())??"";if(l)return{model:l,reasoningEffort:e==="plan"?Fu(n??(a==null?void 0:a.reasoningEffort)):Uu(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 Hu(e,t,n=[],r,a,o,s=[],l){var c;try{const p=(r==null?void 0:r.trim())??"",f=[];for(const j of n){const K=eh(j.trim());K&&f.push({label:b_(K),path:K,fsPath:K})}const g=[...s,...f],_=g.filter((j,K)=>g.findIndex(te=>te.fsPath===j.fsPath)===K),O=[{type:"text",text:w_(t,_)}];for(const j of n){const K=j.trim();if(!K)continue;const te=eh(K);if(te){O.push({type:"localImage",path:te});continue}O.push({type:"image",url:K,image_url:K})}if(o)for(const j of o)O.push({type:"skill",name:j.name,path:j.path});const q=_.map(j=>({label:j.label,path:j.path,fsPath:j.fsPath})),ee={threadId:e,input:O};if(q.length>0&&(ee.attachments=q),p&&(ee.model=p),typeof a=="string"&&a.length>0&&(ee.effort=a),l){const j=await __(l,p,a);ee.collaborationMode={mode:l,settings:{model:j.model,reasoning_effort:j.reasoningEffort,developer_instructions:null}}}const D=await Mt("turn/start",ee);return typeof((c=D==null?void 0:D.turn)==null?void 0:c.id)=="string"?D.turn.id.trim():""}catch(p){throw ha(p,`Failed to start turn for thread ${e}`,"turn/start")}}async function T_(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 Mt("turn/interrupt",{threadId:n,turnId:r})}catch(a){throw ha(a,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function k_(e){const t=e==="fast"?"fast":"standard";await Mt("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 _m(){const e=await fetch("/codex-api/free-mode/status",{signal:AbortSignal.timeout(O0)});if(!e.ok)throw new Error(`Free-mode status request failed with ${e.status}`);return await e.json()}async function th(e){return await(await fetch("/codex-api/free-mode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enable:e})})).json()}async function nh(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 ms(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 Tm(e={}){const t=await Mt("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(L0)});let a=null;try{a=await r.json()}catch{a=null}if(r.ok&&Array.isArray(a==null?void 0:a.data)){if(a.exclusive)return a.data.filter(o=>typeof o=="string"&&o.trim().length>0);for(const o of a.data){if(typeof o!="string")continue;const s=o.trim();!s||n.includes(s)||n.push(s)}}}catch{}return n}async function km(){const e=await Mt("config/read",{});let t=e.config.model??"",n=typeof e.config.model_provider=="string"?e.config.model_provider:"";const r=U0(e.config.model_reasoning_effort),a=B0(e.config.service_tier);try{const o=await _m();o.enabled&&(t=o.currentModel??t,n=o.provider??n)}catch{}return{model:t,providerId:n,reasoningEffort:r,speedMode:a}}function Cm(e){const t=it(e);if(!t)return null;const n=ce(t.id),r=ce(t.name);return!n||!r?null:{id:n,name:r,description:ce(t.description)??"",installUrl:ce(t.installUrl??t.install_url)??"",needsAuth:Xr(t.needsAuth??t.needs_auth)??!1}}function C_(e){const t=it(e);if(!t)return null;const n=ce(t.name),r=ce(t.path);if(!n||!r)return null;const a=it(t.interface);return{name:n,path:r,description:ce(t.description)??"",enabled:Xr(t.enabled)??!0,displayName:ce((a==null?void 0:a.displayName)??(a==null?void 0:a.display_name))??n,shortDescription:ce(t.shortDescription??t.short_description)??""}}function Sm(e,t={}){const n=it(e);if(!n)return null;const r=ce(n.id),a=ce(n.name);if(!r||!a)return null;const o=it(n.interface),s=it(n.source),l=ce(s==null?void 0:s.type)??"",c=ce(s==null?void 0:s.path),p=ce(s==null?void 0:s.url)??"",f=l==="remote"?t.name??null:null,g=t.path??(l==="local"?c:null),_=ce((o==null?void 0:o.displayName)??(o==null?void 0:o.display_name))??a,I=ce((o==null?void 0:o.shortDescription)??(o==null?void 0:o.short_description)),O=ce((o==null?void 0:o.longDescription)??(o==null?void 0:o.long_description))??"";return{id:r,name:a,displayName:_,description:I??O,longDescription:O,developerName:ce((o==null?void 0:o.developerName)??(o==null?void 0:o.developer_name))??"",category:ce(o==null?void 0:o.category)??"",marketplaceName:t.name??"",marketplaceDisplayName:t.displayName??t.name??"",marketplacePath:g,remoteMarketplaceName:f,sourceType:l,sourceUrl:p,installed:Xr(n.installed)??!1,enabled:Xr(n.enabled)??!0,installPolicy:ce(n.installPolicy??n.install_policy)??"",authPolicy:ce(n.authPolicy??n.auth_policy)??"",logoUrl:ce((o==null?void 0:o.logoUrl)??(o==null?void 0:o.logo_url))??"",logoPath:ce(o==null?void 0:o.logo)??"",composerIconUrl:ce((o==null?void 0:o.composerIconUrl)??(o==null?void 0:o.composer_icon_url))??"",composerIconPath:ce((o==null?void 0:o.composerIcon)??(o==null?void 0:o.composer_icon))??"",brandColor:ce((o==null?void 0:o.brandColor)??(o==null?void 0:o.brand_color))??"",capabilities:ks(o==null?void 0:o.capabilities),defaultPrompt:ks((o==null?void 0:o.defaultPrompt)??(o==null?void 0:o.default_prompt)),screenshotUrls:ks((o==null?void 0:o.screenshotUrls)??(o==null?void 0:o.screenshot_urls)),screenshots:ks(o==null?void 0:o.screenshots),websiteUrl:ce((o==null?void 0:o.websiteUrl)??(o==null?void 0:o.website_url))??"",privacyPolicyUrl:ce((o==null?void 0:o.privacyPolicyUrl)??(o==null?void 0:o.privacy_policy_url))??"",termsOfServiceUrl:ce((o==null?void 0:o.termsOfServiceUrl)??(o==null?void 0:o.terms_of_service_url))??""}}function S_(e,t=0){const n=it(e);if(!n)return null;const r=ce(n.id),a=ce(n.name);if(!r||!a)return null;const o=it(n.branding),s=it(n.appMetadata??n.app_metadata);return{id:r,name:a,description:ce(n.description)??ce((s==null?void 0:s.seoDescription)??(s==null?void 0:s.seo_description))??"",logoUrl:ce(n.logoUrl??n.logo_url)??"",logoUrlDark:ce(n.logoUrlDark??n.logo_url_dark)??"",distributionChannel:ce(n.distributionChannel??n.distribution_channel)??"",installUrl:ce(n.installUrl??n.install_url)??"",isAccessible:Xr(n.isAccessible??n.is_accessible)??!1,isEnabled:Xr(n.isEnabled??n.is_enabled)??!0,pluginDisplayNames:ks(n.pluginDisplayNames??n.plugin_display_names),category:ce(o==null?void 0:o.category)??"",developer:ce(o==null?void 0:o.developer)??ce(s==null?void 0:s.developer)??"",website:ce(o==null?void 0:o.website)??"",privacyPolicy:ce((o==null?void 0:o.privacyPolicy)??(o==null?void 0:o.privacy_policy))??"",termsOfService:ce((o==null?void 0:o.termsOfService)??(o==null?void 0:o.terms_of_service))??"",catalogRank:t}}function x_(e){const t=it(e);if(!t)return null;const n=ce(t.name);if(!n)return null;const r=it(t.tools)??{},a=Object.entries(r).map(([c,p])=>{const f=it(p);return{name:ce(f==null?void 0:f.name)??c,title:ce(f==null?void 0:f.title)??"",description:ce(f==null?void 0:f.description)??""}}),o=Array.isArray(t.resources)?t.resources.map(c=>{const p=it(c);return{name:ce(p==null?void 0:p.name)??"",title:ce(p==null?void 0:p.title)??"",uri:ce(p==null?void 0:p.uri)??"",description:ce(p==null?void 0:p.description)??""}}).filter(c=>c.name||c.uri):[],s=t.resourceTemplates??t.resource_templates,l=Array.isArray(s)?s.map(c=>{const p=it(c);return{name:ce(p==null?void 0:p.name)??"",title:ce(p==null?void 0:p.title)??"",uriTemplate:ce((p==null?void 0:p.uriTemplate)??(p==null?void 0:p.uri_template))??"",description:ce(p==null?void 0:p.description)??""}}).filter(c=>c.name||c.uriTemplate):[];return{name:n,authStatus:ce(t.authStatus??t.auth_status)??"unsupported",tools:a,resources:o,resourceTemplates:l}}async function HM(e){const t={};e&&e.length>0&&(t.cwds=e);const n=await Mt("plugin/list",t),r=[];for(const a of n.marketplaces??[]){const o=it(a);if(!o)continue;const s=it(o.interface),l={name:ce(o.name)??"",displayName:ce((s==null?void 0:s.displayName)??(s==null?void 0:s.display_name))??"",path:ce(o.path)},c=Array.isArray(o.plugins)?o.plugins:[];for(const p of c){const f=Sm(p,l);f&&r.push(f)}}return r}async function WM(e){const t={pluginName:e.name};e.marketplacePath&&(t.marketplacePath=e.marketplacePath),e.remoteMarketplaceName&&(t.remoteMarketplaceName=e.remoteMarketplaceName);const n=await Mt("plugin/read",t),r=it(n.plugin);if(!r)throw new Error("Plugin detail response is empty");const a=Sm(r.summary,{name:ce(r.marketplaceName)??e.marketplaceName,displayName:e.marketplaceDisplayName,path:ce(r.marketplacePath)??e.marketplacePath})??e;return{summary:a,description:ce(r.description)??a.longDescription,apps:Array.isArray(r.apps)?r.apps.map(Cm).filter(o=>o!==null):[],skills:Array.isArray(r.skills)?r.skills.map(C_).filter(o=>o!==null):[],mcpServers:ks(r.mcpServers??r.mcp_servers)}}async function zM(e){const t={pluginName:e.name};e.marketplacePath&&(t.marketplacePath=e.marketplacePath),e.remoteMarketplaceName&&(t.remoteMarketplaceName=e.remoteMarketplaceName);const n=await Mt("plugin/install",t),r=n.appsNeedingAuth??n.apps_needing_auth??[];return{authPolicy:ce(n.authPolicy??n.auth_policy)??"",appsNeedingAuth:r.map(Cm).filter(a=>a!==null)}}async function VM(e){await Mt("plugin/uninstall",{pluginId:e})}async function GM(e,t){await Mt("config/batchWrite",{edits:[{keyPath:`plugins.${e}.enabled`,value:t,mergeStrategy:"upsert"}],filePath:null,expectedVersion:null,reloadUserConfig:!0})}async function KM(e){const t=[];let n=null,r=0;do{const a={limit:100};n&&(a.cursor=n),e&&(a.threadId=e);const o=await Mt("app/list",a);for(const s of o.data??[]){const l=S_(s,r);l&&t.push(l),r+=1}n=ce(o.nextCursor??o.next_cursor)}while(n);return t}async function YM(e,t){await Mt("config/batchWrite",{edits:[{keyPath:`apps.${e}.enabled`,value:t,mergeStrategy:"upsert"}],filePath:null,expectedVersion:null,reloadUserConfig:!0})}async function QM(){const e=[];let t=null;do{const n={};t&&(n.cursor=t);const r=await Mt("mcpServerStatus/list",n);for(const a of r.data??[]){const o=x_(a);o&&e.push(o)}t=ce(r.nextCursor??r.next_cursor)}while(t);return e}async function JM(){await Mt("config/mcpServer/reload",{})}async function XM(e){const t=await Mt("mcpServer/oauth/login",{name:e});return{authorizationUrl:ce(t.authorizationUrl??t.authorization_url)??""}}async function ZM(){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 e$(e="",t=null,n=50){const r=new URLSearchParams;e.trim()&&r.set("query",e.trim()),t&&r.set("cursor",t),n&&Number.isFinite(n)&&r.set("limit",String(Math.max(1,Math.floor(n))));const a=r.toString(),o=await fetch(`/codex-api/composio/connectors${a?`?${a}`:""}`);if(!o.ok)throw new Error(`Failed to list Composio connectors (${o.status})`);const s=await o.json();return{data:Array.isArray(s.data)?s.data:[],nextCursor:typeof s.nextCursor=="string"&&s.nextCursor.length>0?s.nextCursor:null,total:typeof s.total=="number"&&Number.isFinite(s.total)?Math.max(0,Math.floor(s.total)):0}}async function t$(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 n$(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 r$(){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 o$(){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 A_(e){const t=e.trim();return t?t.replace(/[_-]+/g," ").replace(/\b\w/g,n=>n.toUpperCase()):""}async function I_(){try{const e=await Mt("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:A_(r.name||a)||(a==="plan"?"Plan":"Default")}))}if(n.length>0){for(const r of Vf)t.has(r.value)||n.push(r);return n.sort((r,a)=>r.value===a.value?0:r.value==="default"?-1:1)}}catch{}return Vf}function E_(e){const t=e&&typeof e=="object"&&!Array.isArray(e)?e:{},n=o=>{if(!Array.isArray(o))return[];const s=[];for(const l of o)typeof l=="string"&&l.length>0&&!s.includes(l)&&s.push(l);return s},r=t.labels,a={};if(r&&typeof r=="object"&&!Array.isArray(r))for(const[o,s]of Object.entries(r)){const l=typeof o=="string"?ot(o):"";l.length>0&&typeof s=="string"&&(a[l]=s)}return{order:n(t.order).map(o=>ot(o)),labels:a,active:n(t.active).map(o=>ot(o)),projectOrder:n(t.projectOrder).map(o=>ot(o)),remoteProjects:Array.isArray(t.remoteProjects)?t.remoteProjects.flatMap(o=>{if(!o||typeof o!="object"||Array.isArray(o))return[];const s=o,l=typeof s.id=="string"?s.id.trim():"";return l?[{id:l,hostId:typeof s.hostId=="string"?s.hostId.trim():"",remotePath:typeof s.remotePath=="string"?ot(s.remotePath):"",label:typeof s.label=="string"?s.label.trim():""}]:[]}):[]}}function P_(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=typeof t.id=="string"?t.id.trim():"";if(!n)return null;const r=Array.isArray(t.imageUrls)?t.imageUrls.filter(s=>typeof s=="string"&&s.trim().length>0):[],a=Array.isArray(t.skills)?t.skills.flatMap(s=>{if(!s||typeof s!="object"||Array.isArray(s))return[];const l=s,c=typeof l.name=="string"?l.name.trim():"",p=typeof l.path=="string"?l.path.trim():"";return c&&p?[{name:c,path:p}]:[]}):[],o=Array.isArray(t.fileAttachments)?t.fileAttachments.flatMap(s=>{if(!s||typeof s!="object"||Array.isArray(s))return[];const l=s,c=typeof l.label=="string"?l.label.trim():"",p=typeof l.path=="string"?l.path.trim():"",f=typeof l.fsPath=="string"?l.fsPath.trim():"";return c&&p&&f?[{label:c,path:p,fsPath:f}]:[]}):[];return{id:n,text:typeof t.text=="string"?t.text:"",imageUrls:r,skills:a,fileAttachments:o,collaborationMode:t.collaborationMode==="plan"?"plan":"default"}}function xm(e){if(!e||typeof e!="object"||Array.isArray(e))return{};const t={};for(const[n,r]of Object.entries(e)){const a=n.trim();if(!a||!Array.isArray(r))continue;const o=r.flatMap(s=>{const l=P_(s);return l?[l]:[]});o.length>0&&(t[a]=o)}return t}async function _s(){return Ti?_c(Ti):(ul||(ul=R_().then(e=>(Ti=e,e)).finally(()=>{ul=null})),_c(await ul))}async function R_(){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 E_(n.data)}function _c(e){var t;return{order:[...e.order],labels:{...e.labels},active:[...e.active],projectOrder:[...e.projectOrder],remoteProjects:((t=e.remoteProjects)==null?void 0:t.map(n=>({...n})))??[]}}function M_(){Ti=null}async function rh(){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 xm(n.data)}async function $_(e){if(!(await fetch("/codex-api/thread-queue-state",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(xm(e))})).ok)throw new Error("Failed to save thread queue state")}async function N_(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:ot(a.data.cwd),gitRoot:ot(a.data.gitRoot)}}async function L_(e,t){const n=await fetch("/codex-api/worktree/create-permanent",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceCwd:e,worktreeName:t})}),r=await n.json();if(!n.ok||!r.data)throw new Error(r.error||"Failed to create worktree");return{...r.data,cwd:ot(r.data.cwd),gitRoot:ot(r.data.gitRoot)}}async function O_(e){const t=e.trim();if(!t)return[];const n=new URLSearchParams({sourceCwd:t}),r=await fetch(`/codex-api/worktree/branches?${n.toString()}`),a=await r.json();if(!r.ok)throw new Error(a.error||"Failed to load branches");const o=Array.isArray(a.data)?a.data:[],s=[],l=new Set;for(const c of o){if(!c||typeof c!="object"||Array.isArray(c))continue;const p=c,f=typeof p.value=="string"?p.value.trim():"",g=typeof p.label=="string"?p.label.trim():"";!f||l.has(f)||(l.add(f),s.push({value:f,label:g||f}))}return s}async function j_(e){const t=e.trim();if(!t)return{currentBranch:null,headSha:null,headSubject:null,headDate:null,detached:!1,dirty:!1,gitRoot:"",options:[]};const n=new URLSearchParams({cwd:t}),r=await fetch(`/codex-api/git/branches?${n.toString()}`),a=await r.json();if(!r.ok)throw new Error(a.error||"Failed to load Git branch state");const o=a.data&&typeof a.data=="object"&&!Array.isArray(a.data)?a.data:{},s=o.currentBranch,l=typeof s=="string"&&s.trim()?s.trim():null,c=Array.isArray(o.options)?o.options:[],p=[],f=new Set;for(const q of c){if(!q||typeof q!="object"||Array.isArray(q))continue;const ee=q,D=typeof ee.value=="string"?ee.value.trim():"",j=typeof ee.label=="string"?ee.label.trim():"";!D||f.has(D)||(f.add(D),p.push({value:D,label:j||D,isCurrent:ee.isCurrent===!0,isRemote:ee.isRemote===!0}))}l&&!f.has(l)&&p.unshift({value:l,label:l,isCurrent:!0});const g=o.headSha,_=o.headSubject,I=o.headDate,O=o.gitRoot;return{currentBranch:l,headSha:typeof g=="string"&&g.trim()?g.trim():null,headSubject:typeof _=="string"&&_.trim()?_.trim():null,headDate:typeof I=="string"&&I.trim()?I.trim():null,detached:o.detached===!0,dirty:o.dirty===!0,gitRoot:typeof O=="string"?ot(O):"",options:p}}async function D_(e){const t=e.trim();if(!t)return{isGitRepo:!1,gitRoot:""};const n=new URLSearchParams({cwd:t}),r=await fetch(`/codex-api/git/repository-status?${n.toString()}`),a=await r.json();if(!r.ok)throw new Error(a.error||"Failed to read Git repository status");const o=a.data&&typeof a.data=="object"&&!Array.isArray(a.data)?a.data:{};return{isGitRepo:o.isGitRepo===!0,gitRoot:typeof o.gitRoot=="string"?ot(o.gitRoot):""}}async function F_(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 U_(e,t){const n=e.trim(),r=t.trim();if(!n||!r)return[];const a=new URLSearchParams({cwd:n,branch:r}),o=await fetch(`/codex-api/git/branch-commits?${a.toString()}`),s=await o.json();if(!o.ok)throw new Error(s.error||"Failed to load branch commits");return(Array.isArray(s.data)?s.data:[]).flatMap(c=>{if(!c||typeof c!="object"||Array.isArray(c))return[];const p=c,f=typeof p.sha=="string"?p.sha.trim():"",g=typeof p.shortSha=="string"?p.shortSha.trim():"",_=typeof p.subject=="string"?p.subject.trim():"",I=typeof p.date=="string"?p.date.trim():"";return!f||!g?[]:[{sha:f,shortSha:g,subject:_||g,date:I}]})}async function B_(e,t,n){const r=await fetch("/codex-api/git/reset-to-commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e.trim(),branch:t.trim(),sha:n.trim()})}),a=await r.json();if(!r.ok)throw new Error(a.error||"Failed to reset branch to commit");const o=a.data&&typeof a.data=="object"&&!Array.isArray(a.data)?a.data:{};return{currentBranch:typeof o.currentBranch=="string"&&o.currentBranch.trim()?o.currentBranch.trim():null,headSha:typeof o.headSha=="string"&&o.headSha.trim()?o.headSha.trim():null,headSubject:typeof o.headSubject=="string"&&o.headSubject.trim()?o.headSubject.trim():null,headDate:typeof o.headDate=="string"&&o.headDate.trim()?o.headDate.trim():null,detached:o.detached===!0,dirty:o.dirty===!0,gitRoot:typeof o.gitRoot=="string"?ot(o.gitRoot):"",options:[]}}async function a$(e,t,n,r){const a=new URLSearchParams({cwd:e,scope:t,workspaceView:n});r&&r.trim()&&a.set("baseBranch",r.trim());const o=await fetch(`/codex-api/review/snapshot?${a.toString()}`),s=await o.json();if(!o.ok)throw new Error($n(s,"Failed to load review snapshot"));return bm(s)}async function s$(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($n(n,"Failed to apply review action"));return bm(n)}async function i$(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($n(n,"Failed to initialize Git"))}async function l$(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 Mt("review/start",{threadId:e,target:a,delivery:"inline"})}async function oh(){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 q_(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 td(r);if(!r.ok){const c=$n(a,"Failed to load local directories");throw new Error(c)}const o=a&&typeof a=="object"&&!Array.isArray(a)?a:{},s=o.data&&typeof o.data=="object"&&!Array.isArray(o.data)?o.data:{},l=Array.isArray(s.entries)?s.entries:[];return{path:typeof s.path=="string"?ot(s.path):"",parentPath:typeof s.parentPath=="string"?ot(s.parentPath):"",entries:l.flatMap(c=>{if(!c||typeof c!="object"||Array.isArray(c))return[];const p=c,f=typeof p.name=="string"?p.name.trim():"",g=typeof p.path=="string"?ot(p.path):"";return f&&g?[{name:f,path:g}]:[]})}}async function td(e){const t=await e.text();if(!t)return{};try{return JSON.parse(t)}catch{throw new Error(`Expected JSON response from ${e.url||"request"}`)}}async function Wu(e){if(!(await fetch("/codex-api/workspace-roots-state",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save workspace roots state");Ti=_c(e)}async function cl(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=$n(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:{},s=typeof o.path=="string"?ot(o.path):"";return M_(),s}async function H_(e){const t=await fetch("/codex-api/local-directory",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e})}),n=await td(t);if(!t.ok){const o=$n(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"?ot(a.path):""}async function W_(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 td(t);if(!t.ok){const s=$n(n,"Failed to create new chat folder");throw new Error(s)}const r=n&&typeof n=="object"&&!Array.isArray(n)?n:{},a=r.data&&typeof r.data=="object"&&!Array.isArray(r.data)?r.data:{},o=typeof a.cwd=="string"?ot(a.cwd):"";if(!o)throw new Error("Failed to create new chat folder");return{cwd:o,outputDirectory:typeof a.outputDirectory=="string"?ot(a.outputDirectory):o,workspaceRoot:typeof a.workspaceRoot=="string"?ot(a.workspaceRoot):""}}async function z_(e){const t=new URLSearchParams({basePath:e}),n=await fetch(`/codex-api/project-root-suggestion?${t.toString()}`),r=await n.json();if(!n.ok){const s=$n(r,"Failed to suggest project name");throw new Error(s)}const a=r&&typeof r=="object"&&!Array.isArray(r)?r:{},o=a.data&&typeof a.data=="object"&&!Array.isArray(a.data)?a.data:{};return{name:typeof o.name=="string"?o.name.trim():"",path:typeof o.path=="string"?ot(o.path):""}}async function V_(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 p=$n(o,"Failed to search files");throw new Error(p)}const s=o&&typeof o=="object"&&!Array.isArray(o)?o:{},l=Array.isArray(s.data)?s.data:[],c=[];for(const p of l){if(!p||typeof p!="object"||Array.isArray(p))continue;const g=p.path,_=typeof g=="string"?g.trim():"";_&&c.push({path:_})}return c}async function G_(e,t=200){const n=await fetch("/codex-api/thread-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,limit:t})}),r=await n.json();if(!n.ok)throw new Error(r.error||"Failed to search threads");return r.data??{threadIds:[],indexedThreadCount:0}}async function K_(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=$n(r,"Failed to connect Telegram bot");throw new Error(a)}}async function Y_(){const e=await fetch("/codex-api/telegram/config"),t=await e.json();if(!e.ok){const s=$n(t,"Failed to load Telegram configuration");throw new Error(s)}const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{},a=Array.isArray(r.allowedUserIds)?r.allowedUserIds:[],o=[];for(const s of a){if(s==="*"){o.push("*");continue}typeof s=="number"&&Number.isFinite(s)&&o.push(Math.trunc(s))}return{botToken:typeof r.botToken=="string"?r.botToken:"",allowedUserIds:o}}async function Q_(){const e=await fetch("/codex-api/telegram/status"),t=await e.json();if(!e.ok){const a=$n(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 $n(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 J_(){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 zu(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 X_(){try{const e=await fetch("/codex-api/thread-pins");return e.ok?(await e.json()).data??{threadIds:[]}:{threadIds:[]}}catch{return{threadIds:[]}}}async function Z_(e){try{await fetch("/codex-api/thread-pins",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({threadIds:e})})}catch{}}async function eT(){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 tT(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 nT(e,t){var n;try{return((n=(await Mt("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}function Tc(e){return e?e.endsWith("/SKILL.md")?e:`${e}/SKILL.md`:""}function rT(e,t){const n=Tc(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 p=`/${[...r.slice(0,a+1),c,"SKILL.md"].join("/")}`;if(t.has(p))return{rootPath:p,rootName:c,isNested:p!==n}}}const o=r.indexOf("skills");if(o<0||o+1>=r.length-1)return null;const s=r[o+1]??"";if(!s)return null;const l=`/${[...r.slice(0,o+2),"SKILL.md"].join("/")}`;return t.has(l)?{rootPath:l,rootName:s,isNested:l!==n}:{rootPath:l,rootName:s,isNested:l!==n}}async function oT(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await Mt("skills/list",t),r=n.data.flatMap(s=>s.skills),a=new Set(r.map(s=>Tc(s.path)).filter(Boolean)),o=new Map;for(const s of n.data)for(const l of s.skills){if(!l.name)continue;const c=rT(l.path,a),p=Tc(l.path),g=!!(c!=null&&c.isNested&&a.has(c.rootPath))?c.rootPath:p,_=p===g,I=o.get(g),O={name:l.name,displayName:c&&g===c.rootPath?c.rootName:void 0,description:l.shortDescription||l.description||"",path:g,scope:l.scope,enabled:l.enabled,__hasRoot:_};if(!I){o.set(g,O);continue}if(I.enabled=I.enabled||l.enabled,!I.__hasRoot&&_){o.set(g,O);continue}!I.displayName&&O.displayName&&(I.displayName=O.displayName),!I.description&&O.description&&(I.description=O.description)}return Array.from(o.values()).map(({__hasRoot:s,...l})=>l)}catch{return[]}}async function aT(){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 sT(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 iT(e){try{const t=new URLSearchParams({path:e});return(await fetch(`/codex-api/prompts?${t.toString()}`,{method:"DELETE"})).ok}catch{return!1}}const lT=6e4;async function Vu(e){const t=new AbortController,n=setTimeout(()=>t.abort(),lT);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 uT={},cT={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function dT(e,t){return C(),E("svg",cT,[...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 rs=At(uT,[["render",dT]]),fT={},hT={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function pT(e,t){return C(),E("svg",hT,[...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 hi=At(fT,[["render",pT]]),mT={},vT={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function gT(e,t){return C(),E("svg",vT,[...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 vs=At(mT,[["render",gT]]),yT={},wT={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function bT(e,t){return C(),E("svg",wT,[...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 Ds=At(yT,[["render",bT]]),_T={},TT={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function kT(e,t){return C(),E("svg",TT,[...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 nd=At(_T,[["render",kT]]),CT={},ST={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function xT(e,t){return C(),E("svg",ST,[...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 AT=At(CT,[["render",xT]]),IT={},ET={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function PT(e,t){return C(),E("svg",ET,[...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(IT,[["render",PT]]),RT={},MT={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function $T(e,t){return C(),E("svg",MT,[...t[0]||(t[0]=[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"},null,-1)])])}const dl=At(RT,[["render",$T]]),Am="codex-web-local.ui-language.v1",NT={English:"English","Simplified Chinese":"简体中文","Search threads":"搜索线程","Filter threads...":"筛选线程...","Clear search":"清除搜索",Chats:"聊天",Projects:"项目",Pinned:"已固定","Chats first":"聊天优先","Sort by":"排序",Created:"创建时间",Updated:"更新时间","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":"切换终端","Open terminal":"打开终端","Terminal command":"终端命令","No commands":"没有命令","Search branches...":"搜索分支...","Let's build":"开始构建","Choose folder":"选择文件夹","Quick search project":"快速搜索项目","Selected folder":"已选文件夹","Select folder":"选择文件夹","Create Project":"创建项目","Current folder":"当前文件夹",Unavailable:"不可用","Opening…":"打开中…",Open:"打开","Show hidden folders":"显示隐藏文件夹","New folder":"新建文件夹","Folder name":"文件夹名称","Filter folders...":"筛选文件夹...",Retry:"重试","Loading folders…":"加载文件夹中…","No folders match this filter.":"没有匹配此筛选条件的文件夹。","No subfolders found here.":"这里没有子文件夹。","Base branch":"基础分支","Select branch":"选择分支","Loading branches…":"加载分支中…","No Git branches found for this folder.":"此文件夹未找到 Git 分支。","Local project":"本地项目","New worktree":"新工作树","Service worker registration failed.":"Service Worker 注册失败。","No matching files":"没有匹配的文件","Add photos & files":"添加图片和文件","Add folder":"添加文件夹","Take photo":"拍照","In-progress send":"执行中发送","Fast mode":"快速模式","Plan mode":"规划模式","Agent proposes a plan before acting":"代理在执行前先提出计划",Model:"模型","Search models...":"搜索模型...",Skills:"技能","Search skills...":"搜索技能...","Search skills and prompts...":"搜索技能和提示词...",Thinking:"思考强度","Saving thread before stop is available":"线程保存后才能停止",Stop:"停止","Queue message":"加入队列","Send message":"发送消息",Send:"发送","Drop images or files":"拖放图片或文件","Selected image":"已选图片","Loading messages...":"加载消息中...",Plan:"计划",Updating:"更新中","Edit this message":"编辑此消息","Edit message":"编辑消息","Fork thread from this response":"从此回复分叉线程",Fork:"分叉","Response copied":"回复已复制","Copy response":"复制回复","Jump to latest":"跳转到最新","Jump to latest output":"跳转到最新输出","Close image preview":"关闭图片预览","Expanded message image":"放大消息图片","Changed files":"已更改文件","Close diff viewer":"关闭 diff 查看器","No diff available":"没有可用 diff","This summary was restored from the final answer text, but the thread history does not include patch diff content for this file.":"此摘要是从最终回答文本恢复的,但线程历史中不包含该文件的补丁 diff 内容。",Review:"审查","Close review pane":"关闭审查面板",Compare:"比较",Branch:"分支",Changes:"更改","Reviewing…":"审查中…","Run review":"运行审查","Loading review state":"加载审查状态中","This folder is not a Git repository":"此文件夹不是 Git 仓库","Initialize Git to review local changes and run Codex review.":"初始化 Git 后即可审查本地更改并运行 Codex review。","Initializing…":"初始化中…","Initialize Git":"初始化 Git","Base branch unavailable":"基础分支不可用","Could not resolve `origin/HEAD`, `main`, or `master` for this repository.":"无法为此仓库解析 `origin/HEAD`、`main` 或 `master`。","No changes in this scope":"此范围内没有更改","Your current workspace is clean.":"当前工作区很干净。","No merge diff found against the base branch.":"未找到相对基础分支的合并 diff。","No unified diff available.":"没有可用的统一 diff。",Summary:"摘要","No structured findings yet":"暂时没有结构化发现","The latest review only returned summary text.":"最近一次审查仅返回了摘要文本。","Run review to populate this pane.":"运行审查后会填充此面板。",Findings:"发现",Added:"新增",Deleted:"删除",Renamed:"重命名",Modified:"修改","Repository review":"仓库审查","Staged changes":"已暂存更改","Workspace changes":"工作区更改","Unstage all":"全部取消暂存","Stage all":"全部暂存","Revert all":"全部还原","Unstage file":"取消暂存文件","Stage file":"暂存文件","Revert file":"还原文件","Unstage hunk":"取消暂存代码块","Stage hunk":"暂存代码块","Revert hunk":"还原代码块","Failed to load review snapshot":"加载审查快照失败","Failed to apply review action":"应用审查操作失败","Failed to initialize Git":"初始化 Git 失败","Reviewing current changes":"正在审查当前更改","Failed to start review":"启动审查失败","Review in progress":"审查进行中","Failed to load review result":"加载审查结果失败",pin:"固定","Worktree thread":"工作树线程",Threads:"线程","Organize threads":"整理线程",Organize:"整理","By project":"按项目","Chronological list":"按时间顺序","No matching threads":"没有匹配的线程","Loading threads...":"加载线程中...","Edit name":"编辑名称",Remove:"移除","Project name":"项目名称","No threads":"没有线程","Thread title":"线程标题","Rename thread":"重命名线程","Make it short and recognizable.":"尽量简短且易识别。","Add title...":"输入标题...",Cancel:"取消","Delete thread":"删除线程","Thread automation":"线程自动化","This creates a heartbeat automation attached to the selected thread.":"这会创建一个附加到所选线程的心跳自动化。",Name:"名称","Automation name":"自动化名称",Prompt:"提示词","Search prompt...":"搜索提示词...","Describe what the automation should do":"描述自动化需要执行的内容","Schedule (RRULE)":"计划(RRULE)",Status:"状态",Active:"启用",Paused:"暂停","Expand sidebar":"展开侧边栏","Collapse sidebar":"折叠侧边栏","Start new thread":"新建线程","No skills found":"未找到技能","No results":"没有结果","Approval choices":"审批选项","No, and tell Codex what to do differently":"不允许,并告诉 Codex 应如何调整",Skip:"跳过",Server:"服务器","Open authorization link":"打开授权链接",Value:"值",Choice:"选项","Select true or false":"选择 true 或 false",True:"True",False:"False","Select an option":"选择一个选项",Decline:"拒绝",Continue:"继续","Other answer":"其他答案","Fail Tool Call":"使工具调用失败","Success (Empty)":"成功(空结果)","Return Empty Result":"返回空结果","New terminal":"新终端","Hide terminal":"隐藏终端",Close:"关闭","Edit queued message":"编辑排队消息","Send now without interrupting work":"立即发送且不中断当前工作","Delete queued message":"删除排队消息","AppServer API":"AppServer API","Loading method catalog...":"加载方法目录中...",Disabled:"已禁用",Installed:"已安装","Browse files":"浏览文件","Loading skill contents...":"加载技能内容中...","View on GitHub":"在 GitHub 查看","Show all":"显示全部","Hide all":"隐藏全部","No types yet":"还没有类型","Manage installed skills on this machine":"管理此机器上已安装的技能","Skills Sync (GitHub)":"技能同步(GitHub)",Connected:"已连接","Logged in as":"已登录为","Not connected":"未连接",Startup:"启动",Action:"动作","Manual sync":"手动同步","GitHub device login":"GitHub 设备登录","and enter code:":"并输入代码:","Login with GitHub":"使用 GitHub 登录","Device Login":"设备登录","Logout GitHub":"退出 GitHub","Syncing...":"同步中...","Startup Sync":"启动同步","Pulling...":"拉取中...",Pull:"拉取","Pushing...":"推送中...",Push:"推送","Installed ({count})":"已安装({count})","Find skills":"查找技能","Search the Skills registry with npx skills find.":"使用 npx skills find 搜索 Skills 注册表。","Searching...":"搜索中...","Search results ({count})":"搜索结果({count})","No matching skills found.":"未找到匹配的技能。","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":"刷新账户失败",Login:"登录","Starting login…":"正在启动登录…","Open login URL":"打开登录链接","Paste localhost callback URL":"粘贴 localhost 回调 URL","Complete Codex login":"完成 Codex 登录","Finish login in the browser, then paste the localhost callback URL here.":"在浏览器中完成登录,然后在这里粘贴 localhost 回调 URL。",Complete:"完成","Completing…":"正在完成…","Failed to start Codex login":"启动 Codex 登录失败","Failed to complete Codex login":"完成 Codex 登录失败","Click Login, or run `codex login`, then click reload.":"点击登录,或运行 `codex login`,然后点击重新加载。","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":"超宽"},ah={en:"English","zh-CN":"简体中文"};function LT(){var t;return typeof window>"u"?"en":((t=window.localStorage.getItem(Am))==null?void 0:t.trim())==="zh-CN"?"zh-CN":"en"}const Zl=A(LT());function Im(e){typeof document>"u"||(document.documentElement.lang=e==="zh-CN"?"zh-CN":"en",document.documentElement.dataset.uiLanguage=e)}Im(Zl.value);function OT(e,t){return t?e.replace(/\{(\w+)\}/g,(n,r)=>String(t[r]??"")):e}function jT(e){Zl.value=e,Im(e),typeof window<"u"&&window.localStorage.setItem(Am,e)}function Em(e,t){const n=Zl.value==="zh-CN"?NT[e]??e:e;return OT(n,t)}function Fa(){return{uiLanguage:Zl,uiLanguageOptions:[{value:"en",label:ah.en},{value:"zh-CN",label:ah["zh-CN"]}],t:Em,setUiLanguage:jT}}const DT={key:0,class:"sidebar-menu-row-left"},FT={class:"sidebar-menu-row-main"},UT={key:1,class:"sidebar-menu-row-right"},BT={key:0,class:"sidebar-menu-row-right-default"},qT={key:1,class:"sidebar-menu-row-right-hover"},HT=Bn({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=_y(),r=ae(()=>!!n.left),a=ae(()=>!!n.right),o=ae(()=>!!n["right-hover"]),s=ae(()=>a.value||o.value);return(l,c)=>(C(),et(Wc(t.as),zp({class:"sidebar-menu-row","data-has-left":r.value,"data-has-right":s.value,"data-has-right-hover":o.value,"data-force-right-hover":t.forceRightHover},l.$attrs),{default:ft(()=>[r.value?(C(),E("span",DT,[Bo(l.$slots,"left",{},void 0,!0)])):Z("",!0),m("span",FT,[Bo(l.$slots,"default",{},void 0,!0)]),s.value?(C(),E("span",UT,[a.value?(C(),E("span",BT,[Bo(l.$slots,"right",{},void 0,!0)])):Z("",!0),o.value?(C(),E("span",qT,[Bo(l.$slots,"right-hover",{},void 0,!0)])):Z("",!0)])):Z("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),so=At(HT,[["__scopeId","data-v-36239f39"]]),WT=["title","aria-label","disabled"],zT={key:1,class:"composer-dropdown-value"},VT={class:"composer-dropdown-menu"},GT={key:0,class:"composer-dropdown-search-wrap"},KT=["placeholder","onKeydown"],YT={class:"composer-dropdown-options",role:"listbox"},QT=["onClick"],JT={key:0,class:"composer-dropdown-empty"},XT=Bn({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},selectedPrefixIcon:{},iconOnly:{type:Boolean},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},emptyLabel:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,a=A(null),o=A(null),s=A(!1),l=A(""),c=ae(()=>{var _e;const te=n.options.find(fe=>fe.value===n.modelValue);return te?te.label:((_e=n.placeholder)==null?void 0:_e.trim())||""}),p=ae(()=>n.openDirection??"down"),f=ae(()=>n.iconOnly===!0),g=ae(()=>n.enableSearch===!0),_=ae(()=>{var te;return((te=n.searchPlaceholder)==null?void 0:te.trim())||"Quick search projects"}),I=ae(()=>{var te;return((te=n.emptyLabel)==null?void 0:te.trim())||"No results"}),O=ae(()=>{var te;return c.value||((te=n.placeholder)==null?void 0:te.trim())||"Select option"}),q=ae(()=>{const te=l.value.trim().toLowerCase();return te?n.options.filter(_e=>_e.label.toLowerCase().includes(te)||_e.value.toLowerCase().includes(te)):n.options});function ee(){n.disabled||(s.value=!s.value)}function D(te){r("update:modelValue",te),s.value=!1,l.value=""}function j(){if(l.value.length>0){l.value="";return}s.value=!1}function K(te){if(!s.value)return;const _e=a.value;if(!_e)return;const fe=te.target;fe instanceof Node&&(_e.contains(fe)||(s.value=!1,l.value=""))}return ht(s,te=>{te&&g.value&&Zt(()=>{var _e;return(_e=o.value)==null?void 0:_e.focus()})}),ma(()=>{window.addEventListener("pointerdown",K)}),Da(()=>{window.removeEventListener("pointerdown",K)}),(te,_e)=>(C(),E("div",{ref_key:"rootRef",ref:a,class:"composer-dropdown"},[m("button",{class:"composer-dropdown-trigger",type:"button",title:O.value,"aria-label":O.value,disabled:e.disabled,onClick:ee},[e.selectedPrefixIcon?(C(),et(Wc(e.selectedPrefixIcon),{key:0,class:"composer-dropdown-prefix-icon"})):Z("",!0),f.value?Z("",!0):(C(),E("span",zT,M(c.value),1)),je(rs,{class:"composer-dropdown-chevron"})],8,WT),s.value?(C(),E("div",{key:0,class:tt(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":p.value==="up","composer-dropdown-menu-wrap-down":p.value==="down"}])},[m("div",VT,[g.value?(C(),E("div",GT,[ln(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":_e[0]||(_e[0]=fe=>l.value=fe),class:"composer-dropdown-search-input",type:"text",placeholder:_.value,onKeydown:gn(Ze(j,["prevent"]),["esc"])},null,40,KT),[[mn,l.value]])])):Z("",!0),m("ul",YT,[(C(!0),E(Qe,null,en(q.value,fe=>(C(),E("li",{key:fe.value},[m("button",{class:tt(["composer-dropdown-option",{"is-selected":fe.value===e.modelValue}]),type:"button",onClick:he=>D(fe.value)},M(fe.label),11,QT)]))),128)),q.value.length===0?(C(),E("li",JT,M(I.value),1)):Z("",!0)])])],2)):Z("",!0)],512))}}),Wr=At(XT,[["__scopeId","data-v-5243a93d"]]),ZT={key:0,class:"pinned-section"},ek={class:"thread-tree-header"},tk={key:0,class:"thread-list"},nk=["data-menu-open"],rk={class:"thread-left-stack"},ok=["data-state"],ak=["data-confirming","title","onClick"],sk={key:0,class:"thread-delete-confirm-label"},ik=["onClick"],lk={class:"thread-row-title-wrap"},uk={class:"thread-row-title-line"},ck={class:"thread-row-title"},dk=["title"],fk=["data-state"],hk={class:"thread-row-time"},pk=["onClick"],mk={class:"projects-section"},vk={class:"thread-tree-header"},gk=["aria-expanded","aria-label","title"],yk={class:"organize-menu-title"},wk=["data-active"],bk={key:0},_k=["data-active"],Tk={key:0},kk=["data-active"],Ck={key:0},Sk={class:"organize-menu-title"},xk=["data-active"],Ak={key:0},Ik=["data-active"],Ek={key:0},Pk={key:0,class:"thread-tree-no-results"},Rk={key:1,class:"thread-tree-loading"},Mk={key:2,class:"thread-list thread-list-global"},$k=["data-menu-open"],Nk={class:"thread-left-stack"},Lk=["data-state"],Ok=["data-confirming","title","onClick"],jk={key:0,class:"thread-delete-confirm-label"},Dk=["onClick"],Fk={class:"thread-row-title-wrap"},Uk={class:"thread-row-title-line"},Bk={class:"thread-row-title"},qk=["title"],Hk=["data-state"],Wk={class:"thread-row-time"},zk=["onClick"],Vk=["data-project-name","data-expanded","data-dragging"],Gk={class:"project-icon-stack"},Kk={class:"project-icon-folder"},Yk={class:"project-icon-chevron"},Qk=["data-dragging-handle","onMousedown"],Jk=["title"],Xk={class:"project-hover-controls"},Zk=["onClick"],eC=["data-open-direction"],tC=["onClick"],nC=["onClick"],rC=["onClick"],oC=["onClick"],aC={class:"project-menu-label"},sC=["onInput"],iC=["aria-label","title","onClick"],lC={key:0,class:"thread-list"},uC=["data-menu-open"],cC={class:"thread-left-stack"},dC=["data-state"],fC=["data-confirming","title","onClick"],hC={key:0,class:"thread-delete-confirm-label"},pC=["onClick"],mC={class:"thread-row-title-wrap"},vC={class:"thread-row-title-line"},gC={class:"thread-row-title"},yC=["title"],wC=["data-state"],bC={class:"thread-row-time"},_C=["onClick"],TC={class:"project-empty"},kC=["onClick"],CC={class:"chats-section"},SC={class:"thread-tree-header"},xC={class:"chats-section-actions"},AC=["aria-label","title"],IC={key:0,class:"thread-tree-no-results"},EC={key:1,class:"thread-list thread-list-global"},PC=["data-menu-open"],RC={class:"thread-left-stack"},MC=["data-state"],$C=["data-confirming","title","onClick"],NC={key:0,class:"thread-delete-confirm-label"},LC=["onClick"],OC={class:"thread-row-title-wrap"},jC={class:"thread-row-title-line"},DC={class:"thread-row-title"},FC=["title"],UC=["data-state"],BC={class:"thread-row-time"},qC=["onClick"],HC=["data-open-direction"],WC={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},zC={class:"rename-thread-title"},VC=["onKeydown"],GC={class:"rename-thread-actions"},KC={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},YC={class:"rename-thread-title"},QC={class:"rename-thread-subtitle"},JC={class:"rename-thread-actions"},XC={class:"rename-thread-panel automation-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread automation"},ZC={class:"rename-thread-title"},e1={key:0,class:"automation-thread-list","aria-label":"Thread automations"},t1=["onClick"],n1={class:"automation-thread-field"},r1={class:"automation-thread-field"},o1={class:"automation-thread-field"},a1={class:"automation-schedule-mode-group",role:"radiogroup","aria-label":"Automation schedule type"},s1={key:0,class:"automation-schedule-row"},i1={key:1,class:"automation-schedule-row"},l1={class:"automation-schedule-preview"},u1={class:"automation-thread-field"},c1={key:1,class:"rename-thread-subtitle automation-thread-error"},d1={key:2,class:"rename-thread-subtitle automation-thread-notice"},f1={class:"rename-thread-actions"},h1=["disabled"],p1=["disabled"],m1=["disabled"],v1=["disabled"],g1=4,sh=6,ih="codex-web-local.sidebar-section-expansion.v1",lh="codex-web-local.sidebar-chats-first.v1",uh="codex-web-local.sidebar-chat-sort-mode.v1",ch="codex-web-local.thread-view-mode.v1",dh="codex-web-local.collapsed-projects.v1",y1=Bn({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},projectGitRepoByName:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-thread-files","browse-project-files","request-project-git-status","create-project-worktree","rename-project","rename-thread","remove-project","reorder-project","export-thread","fork-thread","start-new-chat"],setup(e,{emit:t}){const n=e,{t:r}=Fa(),a=t,o=A({}),s=A({}),l=A(!0),c=A(!0),p=A(!0),f=A(!1),g=A(pt(lh,!1)),_=A(bt());let I=!1;const O=A([]),q=A(""),ee=A([]),D=A(""),j=A(""),K=A({}),te=A({}),_e=A({}),fe=A("actions"),he=A(""),Re=A(!1),G=A(""),ye=A(""),ke=A(null),se=A(!1),Te=A(""),De=A(""),Be=A({}),ze=A(!1),Ne=A(""),Ce=A(""),Ye=A("create"),rt=A(""),Ve=A(""),Le=A(!1),gt=A(!1),Ge=A({name:"",prompt:"",rrule:"FREQ=DAILY;BYHOUR=9;BYMINUTE=0",status:"ACTIVE"}),qe=A({mode:"daily",dailyTime:"09:00",interval:1,intervalUnit:"hours"}),wt=[{value:"minutes",label:"minutes"},{value:"hours",label:"hours"},{value:"days",label:"days"}],ne=ae(()=>[{value:"ACTIVE",label:r("Active")},{value:"PAUSED",label:r("Paused")}]),Se=ae(()=>{const y=Ne.value;return y?Be.value[y]??[]:[]}),Ae=ae(()=>_o(Ge.value.rrule)),Fe=A(null),Ke=A(null),x=A(null);let R=null,V=null;const ie=A(""),Q=A({}),le=new Map,pe=new Map,be=new Map,we=new WeakMap,de=A(null),Oe=A(null),ge=A(!1),$e=A(mt()),Ee=typeof window<"u"?new ResizeObserver(y=>{for(const b of y){const w=b.target,L=we.get(w);L&&cr(L,w)}}):null;function at(){if(typeof window>"u")return{};try{const y=window.localStorage.getItem(dh);if(!y)return{};const b=JSON.parse(y);return!b||typeof b!="object"||Array.isArray(b)?{}:b}catch{return{}}}function mt(){return typeof window>"u"?"project":window.localStorage.getItem(ch)==="chronological"?"chronological":"project"}function pt(y,b){if(typeof window>"u")return b;const w=window.localStorage.getItem(y);return w==="true"?!0:w==="false"?!1:b}function bt(){return typeof window>"u"?"updated":window.localStorage.getItem(uh)==="created"?"created":"updated"}s.value=at();function yt(){if(!(typeof window>"u"))try{const y=JSON.parse(window.localStorage.getItem(ih)||"{}");typeof y.pinned=="boolean"&&(l.value=y.pinned),typeof y.projects=="boolean"&&(c.value=y.projects),typeof y.chats=="boolean"&&(p.value=y.chats)}catch{}}function F(){typeof window>"u"||window.localStorage.setItem(ih,JSON.stringify({pinned:l.value,projects:c.value,chats:p.value}))}yt(),ht(s,y=>{typeof window>"u"||window.localStorage.setItem(dh,JSON.stringify(y))},{deep:!0}),ht($e,y=>{typeof window>"u"||window.localStorage.setItem(ch,y)}),ht(g,y=>{typeof window>"u"||window.localStorage.setItem(lh,String(y))}),ht(_,y=>{typeof window>"u"||window.localStorage.setItem(uh,y)}),ht([l,c,p],F);const z=ae(()=>n.searchQuery.trim().toLowerCase()),H=ae(()=>z.value.length>0),X=ae(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null),ve=ae(()=>new Set(O.value)),Ie=ae(()=>new Set(ee.value));function He(y){if(Ie.value.has(y.id))return!1;if(!H.value)return!0;if(X.value)return X.value.has(y.id);const b=z.value;return y.title.toLowerCase().includes(b)||y.preview.toLowerCase().includes(b)}const Tt=ae(()=>n.groups.flatMap(y=>{const b=y.threads.filter(w=>!Ml(w.cwd)&&He(w));return b.length>0?[{...y,threads:b}]:!H.value&&y.threads.length===0?[{...y,threads:b}]:[]})),qt=ae(()=>$e.value==="chronological"),Cn=ae(()=>{const y=[];for(const b of n.groups)for(const w of b.threads)ve.value.has(w.id)||He(w)&&y.push(w);return y.sort((b,w)=>{const L=new Date(b.updatedAtIso||b.createdAtIso).getTime();return new Date(w.updatedAtIso||w.createdAtIso).getTime()-L})}),Zn=ae(()=>{const y=Cn.value.filter(w=>Ml(w.cwd)),b=_.value==="created"?"createdAtIso":"updatedAtIso";return y.sort((w,L)=>{const Pe=new Date(w[b]||w.updatedAtIso||w.createdAtIso).getTime();return new Date(L[b]||L.updatedAtIso||L.createdAtIso).getTime()-Pe})}),Nn=ae(()=>H.value||f.value?Zn.value:Zn.value.slice(0,10)),Wo=ae(()=>H.value?!1:Zn.value.length>10),Ln=ae(()=>{const y=new Map;for(const b of n.groups)for(const w of b.threads)Ie.value.has(w.id)||y.set(w.id,w);return y});ht(O,y=>{I&&Z_(y)}),ht(Ln,y=>{const b=O.value.filter(w=>y.has(w));b.length!==O.value.length&&(O.value=b)}),ma(async()=>{const{threadIds:y}=await X_(),b=Array.isArray(y)?y.filter(w=>typeof w=="string").map(w=>w.trim()).filter((w,L,Pe)=>w.length>0&&Pe.indexOf(w)===L):[];b.length>0&&(O.value=b);try{Be.value=await Z0()}catch{Be.value={}}I=!0});const wr=ae(()=>jt(Te.value)),zr=ae(()=>{const y=new Map;for(const b of n.groups)for(const w of b.threads)y.set(w.id,b.projectName);return y}),go=ae(()=>{const y=new Map;for(const b of n.groups){const w=b.threads.filter(L=>!ve.value.has(L.id)&&!Ie.value.has(L.id));y.set(b.projectName,w)}return y}),Sn=ae(()=>{const y=new Map;for(const b of n.groups)for(const w of b.threads){const L=new Date(w.updatedAtIso||w.createdAtIso).getTime();y.set(w.id,L)}return y}),un=ae(()=>{const y=j.value;return y?Ln.value.get(y)??null:null}),Zr=ae(()=>O.value.map(y=>Ln.value.get(y)??null).filter(y=>y!==null).filter(He));function Rr(){l.value=!l.value}function On(){c.value=!c.value}function yo(){p.value=!p.value}const xn=ae(()=>{const y=x.value;if(!y||y.dropTargetIndexFull===null||n.groups.length===0)return null;const b=Math.max(0,Math.min(y.dropTargetIndexFull,n.groups.length)),w=b>y.fromIndex?b-1:b,L=Math.max(0,Math.min(w,n.groups.length-1));return L===y.fromIndex?null:L}),jn=ae(()=>{const b=(H.value?Tt.value:n.groups).map(Vt=>Vt.projectName),w=x.value,L=xn.value;if(!w||L===null)return b;const Pe=[...b],[lt]=Pe.splice(w.fromIndex,1);return lt?(Pe.splice(L,0,lt),Pe):b}),dt=ae(()=>{const y={};let b=0;for(const w of jn.value)y[w]=b,b+=So(w);return y}),qn=ae(()=>{let y=0;for(const b of jn.value)y+=So(b);return{height:`${Math.max(0,y)}px`}});function vn(y){if(Number.isNaN(y))return"n/a";const b=Math.abs(Date.now()-y);if(b<6e4)return"now";const w=Math.floor(b/6e4);if(w<60)return`${w}m`;const L=Math.floor(w/60);return L<24?`${L}h`:`${Math.floor(L/24)}d`}function br(y){const b=Sn.value.get(y.id);return vn(typeof b=="number"?b:new Date(y.updatedAtIso||y.createdAtIso).getTime())}function Ot(y){return ve.value.has(y)}function eo(y){if(Ot(y)){O.value=O.value.filter(b=>b!==y);return}O.value=[y,...O.value]}function wo(y){eo(y),_t()}function Ht(y){q.value="",a("select",y)}function jt(y){var b;return(((b=Be.value[y])==null?void 0:b.length)??0)>0}function Kt(y){const b=Be.value[y]??[];if(b.length===0)return"";if(b.length>1){const Pe=b.filter(lt=>lt.status==="ACTIVE").length;return`${b.length} automations • ${Pe} active`}const[w]=b,L=w.status==="PAUSED"?"-":w.nextRunAtMs?new Date(w.nextRunAtMs).toLocaleString():"Not scheduled";return`${w.name} • Next run: ${L}`}function Dt(y){return String(Math.max(0,y)).padStart(2,"0")}function Hn(y,b){const w=typeof y=="number"?y:Number(y);return Number.isFinite(w)?Math.max(1,Math.floor(w)):b}function to(y){const[b,w]=y.split(":"),L=Math.min(23,Math.max(0,Number(b)||0)),Pe=Math.min(59,Math.max(0,Number(w)||0));return`FREQ=DAILY;BYHOUR=${L};BYMINUTE=${Pe}`}function ga(y,b){const w=Hn(y,1);return b==="minutes"?`FREQ=MINUTELY;INTERVAL=${w}`:b==="hours"?`FREQ=HOURLY;INTERVAL=${w}`:`FREQ=DAILY;INTERVAL=${w}`}function bo(y){return Object.fromEntries(y.split(";").map(b=>b.trim()).filter(Boolean).map(b=>{const[w,...L]=b.split("=");return[w.toUpperCase(),L.join("=").trim()]}).filter(([b,w])=>b&&w))}function no(y){var Pe;const b=bo(y),w=(Pe=b.FREQ)==null?void 0:Pe.toUpperCase(),L=Hn(b.INTERVAL,1);if(w==="DAILY"&&b.BYHOUR!==void 0&&b.BYMINUTE!==void 0&&L===1){const lt=Math.min(23,Math.max(0,Number(b.BYHOUR)||0)),Vt=Math.min(59,Math.max(0,Number(b.BYMINUTE)||0));return{mode:"daily",dailyTime:`${Dt(lt)}:${Dt(Vt)}`,interval:1,intervalUnit:"hours"}}return w==="MINUTELY"||w==="HOURLY"||w==="DAILY"&&b.INTERVAL!==void 0?{mode:"interval",dailyTime:"09:00",interval:L,intervalUnit:w==="MINUTELY"?"minutes":w==="HOURLY"?"hours":"days"}:{mode:"advanced",dailyTime:"09:00",interval:1,intervalUnit:"hours"}}function _o(y){var Pe;const b=bo(y),w=(Pe=b.FREQ)==null?void 0:Pe.toUpperCase(),L=Hn(b.INTERVAL,1);if(w==="DAILY"&&b.BYHOUR!==void 0&&b.BYMINUTE!==void 0&&L===1){const lt=Math.min(23,Math.max(0,Number(b.BYHOUR)||0)),Vt=Math.min(59,Math.max(0,Number(b.BYMINUTE)||0));return`RRULE: ${y} · runs daily at ${Dt(lt)}:${Dt(Vt)}`}return w==="MINUTELY"?`RRULE: ${y} · runs every ${L} minute${L===1?"":"s"}`:w==="HOURLY"?`RRULE: ${y} · runs every ${L} hour${L===1?"":"s"}`:w==="DAILY"&&b.INTERVAL!==void 0?`RRULE: ${y} · runs every ${L} day${L===1?"":"s"}`:y?`RRULE: ${y}`:"RRULE is required."}function on(){const y=qe.value;y.mode==="daily"?Ge.value.rrule=to(y.dailyTime):y.mode==="interval"&&(Ge.value.rrule=ga(y.interval,y.intervalUnit))}function _r(){qe.value=no(Ge.value.rrule)}function er(y){y!=="minutes"&&y!=="hours"&&y!=="days"||(qe.value.intervalUnit=y,on())}function tr(y){qe.value={...qe.value,mode:y},on()}function Mr(y){a("export-thread",y),_t()}function To(y){a("fork-thread",y),_t()}function Wn(y){return`start new thread ${In(y)}`}function $r(y){a("start-new-thread",y)}function Tr(y){a("browse-thread-files",y),_t()}async function ko(y){var w,L;const b=((L=(w=Ln.value.get(y))==null?void 0:w.cwd)==null?void 0:L.trim())??"";if(_t(),!(!b||typeof navigator>"u"||!navigator.clipboard))try{await navigator.clipboard.writeText(b)}catch{}}function $t(y,b){if(j.value===y){if(b){const w=b.relatedTarget,L=Oe.value;if(w instanceof Node&&L&&L.contains(w))return}_t()}}function Yt(y){return j.value===y}function _t(){j.value="",_e.value={}}function zn(y){if(q.value="",j.value===y){_t();return}xe(),ge.value=!1,j.value=y,Zt(()=>{wa(y)})}function cn(y,b){y.preventDefault(),q.value="",j.value=b}function an(y,b){G.value=y,ye.value=b,Re.value=!0,_t(),Zt(()=>{var w,L;(w=ke.value)==null||w.focus(),(L=ke.value)==null||L.select()})}function Qt(){Re.value=!1,G.value="",ye.value=""}function Nr(){const y=G.value,b=ye.value.trim();!y||!b||(a("rename-thread",{threadId:y,title:b}),Qt())}function nr(y,b){q.value="",Te.value=y,De.value=b,se.value=!0,_t()}function rr(){se.value=!1,Te.value="",De.value=""}async function Co(){const y=Te.value;y&&(kt(y),rr())}function Wt(y){return q.value===y}function kr(y){if(q.value!==y){q.value=y,_t();return}kt(y),q.value=""}function kt(y){Ie.value.has(y)||(ee.value=[y,...ee.value]),q.value="",_t(),O.value=O.value.filter(b=>b!==y),a("archive",y),jt(y)&&(Jf(y).catch(()=>{}),Be.value=Lr(Be.value,y))}function St(y){var w;Ne.value=y,rt.value="",Ve.value="";const b=(w=Be.value[y])==null?void 0:w[0];b?wn(b.id):An(),ze.value=!0,_t()}function An(){Ce.value="",Ye.value="create",rt.value="",Ve.value="",Ge.value={name:"Thread automation",prompt:"",rrule:"FREQ=DAILY;BYHOUR=9;BYMINUTE=0",status:"ACTIVE"},qe.value=no(Ge.value.rrule)}function wn(y){const b=Se.value.find(w=>w.id===y);b&&(Ce.value=b.id,Ye.value="edit",rt.value="",Ve.value="",Ge.value={name:b.name,prompt:b.prompt,rrule:b.rrule,status:b.status},qe.value=no(b.rrule))}function nn(){ze.value=!1,Ne.value="",Ce.value="",rt.value="",Ve.value="",Le.value=!1,gt.value=!1}function Lr(y,b){return Object.fromEntries(Object.entries(y).filter(([w])=>w!==b))}function Or(y,b,w){const L=y[b]??[],Pe=L.findIndex(Vt=>Vt.id===w.id),lt=[...L];return Pe>=0?lt.splice(Pe,1,w):lt.push(w),{...y,[b]:lt}}function bn(y,b,w){const L=(y[b]??[]).filter(Pe=>Pe.id!==w);return L.length>0?{...y,[b]:L}:Lr(y,b)}async function jr(){const y=Ne.value;if(y){Le.value=!0,rt.value="",Ve.value="";try{on();const b=await e_({threadId:y,id:Ce.value||void 0,name:Ge.value.name,prompt:Ge.value.prompt,rrule:Ge.value.rrule,status:Ge.value.status});Be.value=Or(Be.value,y,b),wn(b.id),Ve.value="Automation saved.",Le.value=!1}catch(b){rt.value=b instanceof Error?b.message:"Failed to save automation",Le.value=!1}}}async function Dr(){var w;const y=Ne.value,b=Ce.value;if(!(!y||!b)){Le.value=!0,rt.value="",Ve.value="";try{await Jf(y,b),Be.value=bn(Be.value,y,b);const L=(w=Be.value[y])==null?void 0:w[0];L?wn(L.id):An(),Le.value=!1}catch(L){rt.value=L instanceof Error?L.message:"Failed to remove automation",Le.value=!1}}}async function Vn(){const y=Ne.value,b=Ce.value;if(!(!y||!b)){gt.value=!0,rt.value="",Ve.value="";try{await t_(y,b),Ve.value="Automation run queued."}catch(w){rt.value=w instanceof Error?w.message:"Failed to run automation"}finally{gt.value=!1}}}function In(y){return n.projectDisplayNameById[y]??y}function Ft(y){return y.includes("/")||y.includes("\\")}function or(y){return Ft(y)?y:In(y)}function P(y){const b=Hr(y);if(!b)return!1;let w=0;for(const L of n.groups)if(Ft(L.projectName)&&Hr(L.projectName)===b&&(w+=1,w>1))return!0;return!1}function U(y){const b=n.projectDisplayNameById[y.projectName],w=In(y.projectName),L=y.projectName;if(b&&!Ft(L)&&L!==w)return w.includes(L)||/^[0-9a-f]{8}-[0-9a-f-]{27,}$/iu.test(L)?w:`${w} ${L}`;if(b&&Ft(L)){const Vt=Hr(L),Mn=Hr(Ms(L)),Jt=P(L)?Mn:Vt;return Jt&&Jt!==w?`${w} ${Jt}`:w}if(!w.includes("/")&&!w.includes("\\"))return w;const Pe=Hr(w)||w,lt=Hr(Ms(w));return lt.startsWith(".")&&lt!==Pe?`${Pe} ${lt}`:y.threads.length>0||!P(L)?Pe:lt?`${Pe} ${lt}`:Pe}function oe(y){return D.value===y}function xe(){D.value="",fe.value="actions",he.value=""}function vt(){const y=!ge.value;y&&(xe(),_t()),ge.value=y}function dn(y){$e.value=y,ge.value=!1}function Gn(){g.value=!g.value}function zt(y){_.value=y}function rn(y){a("request-project-git-status",y),Zt(()=>{Sr(y)})}function En(y){if(D.value===y){xe();return}_t(),ge.value=!1,D.value=y,fe.value="actions",he.value=In(y),rn(y)}function ar(y){_t(),ge.value=!1,D.value=y,fe.value="actions",he.value=In(y),rn(y)}function We(y){return n.projectDisplayNameById[y.projectName]??U(y)}function Me(y){_t();const b=y.projectName;D.value=b,fe.value="rename",he.value=We(y),Zt(()=>{Sr(b)})}function Ct(y){a("browse-project-files",y),xe()}function sr(y){a("create-project-worktree",y),xe()}function Cr(y){a("rename-project",{projectName:y,displayName:he.value})}function Us(y){a("remove-project",y),xe()}function sn(y,b){if(!y.altKey||y.key!=="ArrowUp"&&y.key!=="ArrowDown")return;const w=n.groups.findIndex(lt=>lt.projectName===b);if(w<0)return;const L=y.key==="ArrowUp"?-1:1,Pe=Math.max(0,Math.min(w+L,n.groups.length-1));Pe!==w&&(y.preventDefault(),a("reorder-project",{projectName:b,toIndex:Pe}))}function ro(y){return o.value[y]===!0}function Pn(y){return s.value[y]===!0}function Fr(y){o.value={...o.value,[y]:!ro(y)}}function zo(){f.value=!f.value}function Vo(y){if(ie.value===y){ie.value="";return}s.value={...s.value,[y]:!Pn(y)}}function So(y){const b=Q.value[y]??0,w=x.value,Pe=((w==null?void 0:w.projectName)===y?w.groupHeight:null)??b,lt=Pn(y)?0:sh;return Math.max(0,Pe+lt)}function Go(y,b){const w=b instanceof HTMLElement?b:b&&"$el"in b&&b.$el instanceof HTMLElement?b.$el:null;if(w){pe.set(y,w);return}pe.delete(y)}function ir(y,b){const w=b instanceof HTMLElement?b:b&&"$el"in b&&b.$el instanceof HTMLElement?b.$el:null;if(w){be.set(y,w);return}be.delete(y)}function ya(y){let b=y.parentElement;for(;b;){const w=window.getComputedStyle(b),L=w.overflowY||w.overflow;if(L==="auto"||L==="scroll"||L==="hidden"||L==="clip")return b.getBoundingClientRect();b=b.parentElement}return new DOMRect(0,0,window.innerWidth,window.innerHeight)}function Ur(y,b){const w=y.getBoundingClientRect(),L=ya(y),Pe=6,lt=L.bottom-w.bottom,Vt=w.top-L.top;return lt>=b+Pe?"down":Vt>lt?"up":"down"}function xo(y,b){const w=be.get(y);if(!w)return"down";const L=Ur(w,b);return te.value={...te.value,[y]:L},L}function Kn(y){return te.value[y]??"down"}function Sr(y){const b=pe.get(y);if(!b)return;const w=b.querySelector(".project-menu-panel"),L=(w==null?void 0:w.getBoundingClientRect().height)??0;K.value={...K.value,[y]:Ur(b,L)}}function xr(y,b,w){return Math.min(Math.max(y,b),w)}function wa(y){const b=be.get(y);if(!b)return;const w=Oe.value,L=w==null?void 0:w.getBoundingClientRect(),Pe=(L==null?void 0:L.height)||(w==null?void 0:w.offsetHeight)||112,lt=(L==null?void 0:L.width)||(w==null?void 0:w.offsetWidth)||160,Vt=xo(y,Pe),Mn=b.getBoundingClientRect(),Jt=8,Yn=4,dr=Math.max(Jt,window.innerWidth-lt-Jt),fr=xr(Mn.right-lt,Jt,dr),Xo=xr(Vt==="up"?Mn.top-Pe-Yn:Mn.bottom+Yn,Jt,Math.max(Jt,window.innerHeight-Pe-Jt));_e.value={left:`${Math.round(fr)}px`,top:`${Math.round(Xo)}px`}}function Ko(){const y=j.value;y&&wa(y)}function oo(){window.addEventListener("resize",Ko),document.addEventListener("scroll",Ko,!0)}function lr(){window.removeEventListener("resize",Ko),document.removeEventListener("scroll",Ko,!0)}function Ao(y){const b=D.value;if(!b)return!1;const w=pe.get(b);if(!w)return!1;if((typeof y.composedPath=="function"?y.composedPath():[]).includes(w))return!0;const Pe=y.target;return Pe instanceof Node?w.contains(Pe):!1}function Io(y){const b=j.value;if(!b)return!1;const w=be.get(b);if(!w)return!1;const L=typeof y.composedPath=="function"?y.composedPath():[];if(L.includes(w))return!0;const Pe=Oe.value;if(Pe&&L.includes(Pe))return!0;const lt=y.target;return lt instanceof Node?!!(w.contains(lt)||Pe&&Pe.contains(lt)):!1}function yn(y){if(ge.value){const b=de.value,w=typeof y.composedPath=="function"?y.composedPath():[];!!b&&(w.includes(b)||y.target instanceof Node&&b.contains(y.target))||(ge.value=!1)}D.value&&(Ao(y)||xe(),j.value&&(Io(y)||_t()))}function Rn(y){D.value&&!Ao(y)&&xe(),j.value&&!Io(y)&&_t()}function ur(){ge.value&&(ge.value=!1),D.value&&xe(),j.value&&_t()}function Ua(){window.addEventListener("pointerdown",yn,{capture:!0}),window.addEventListener("focusin",Rn,{capture:!0}),window.addEventListener("blur",ur)}function Ar(){window.removeEventListener("pointerdown",yn,{capture:!0}),window.removeEventListener("focusin",Rn,{capture:!0}),window.removeEventListener("blur",ur)}function cr(y,b){const w=b.getBoundingClientRect().height;if(!Number.isFinite(w)||w<=0)return;const L=Q.value[y];L!==void 0&&Math.abs(L-w)<.5||(Q.value={...Q.value,[y]:w})}function ba(y,b){const w=le.get(y);w&&w!==b&&Ee&&Ee.unobserve(w);const L=b instanceof HTMLElement?b:b&&"$el"in b&&b.$el instanceof HTMLElement?b.$el:null;if(L){le.set(y,L),we.set(L,y),cr(y,L),Ee==null||Ee.observe(L);return}w&&(Ee==null||Ee.unobserve(w)),le.delete(y)}function Ba(y,b){if(y.button!==0||H.value||Ke.value||x.value)return;const w=n.groups.findIndex(Vt=>Vt.projectName===b),L=le.get(b);if(w<0||!L)return;const Pe=L.getBoundingClientRect(),lt=Pn(b)?0:sh;Ke.value={projectName:b,fromIndex:w,startClientX:y.clientX,startClientY:y.clientY,pointerOffsetY:y.clientY-Pe.top,groupLeft:Pe.left,groupWidth:Pe.width,groupHeight:Pe.height,groupOuterHeight:Pe.height+lt},y.preventDefault(),qa()}function qa(){window.addEventListener("mousemove",_a),window.addEventListener("mouseup",Po),window.addEventListener("keydown",Br)}function Eo(){window.removeEventListener("mousemove",_a),window.removeEventListener("mouseup",Po),window.removeEventListener("keydown",Br)}function _a(y){R={clientX:y.clientX,clientY:y.clientY},Yo()}function Po(y){Ir({clientX:y.clientX,clientY:y.clientY});const b=x.value;if(b&&xn.value!==null){const w=n.groups.findIndex(L=>L.projectName===b.projectName);if(w>=0){const L=xn.value;L!==w&&a("reorder-project",{projectName:b.projectName,toIndex:L})}}Ro({preserveToggleSuppression:!!b})}function Br(y){y.key==="Escape"&&(!Ke.value&&!x.value||(y.preventDefault(),Ro()))}function Ro(y={}){V!==null&&(window.cancelAnimationFrame(V),V=null),R=null,Ke.value=null,x.value=null,y.preserveToggleSuppression||(ie.value=""),Eo()}function Yo(){V===null&&(V=window.requestAnimationFrame(()=>{if(V=null,!R)return;const y=R;R=null,Ir(y)}))}function Ir(y){const b=Ke.value;if(!x.value&&b){const w=y.clientX-b.startClientX,L=y.clientY-b.startClientY;if(Math.hypot(w,L)<g1)return;xe(),ie.value=b.projectName,x.value={projectName:b.projectName,fromIndex:b.fromIndex,pointerOffsetY:b.pointerOffsetY,groupLeft:b.groupLeft,groupWidth:b.groupWidth,groupHeight:b.groupHeight,groupOuterHeight:b.groupOuterHeight,ghostTop:y.clientY-b.pointerOffsetY,dropTargetIndexFull:null}}x.value&&Ut(y)}function Ut(y){const b=x.value;if(!b)return;if(b.ghostTop=y.clientY-b.pointerOffsetY,!Vr(y)){b.dropTargetIndexFull=null;return}const w=y.clientY,L=Fe.value;if(!L){b.dropTargetIndexFull=null;return}const Pe=L.getBoundingClientRect(),lt=new Map(n.groups.map((Yn,dr)=>[Yn.projectName,dr])),Vt=n.groups.map(Yn=>Yn.projectName).filter(Yn=>Yn!==b.projectName);let Mn=0,Jt=n.groups.length;for(const Yn of Vt){const dr=lt.get(Yn);if(dr===void 0)continue;const fr=So(Yn),Xo=Pe.top+Mn+fr/2;if(w<Xo){Jt=dr;break}Mn+=fr}b.dropTargetIndexFull=Jt}function Vr(y){const b=Fe.value;if(!b)return!1;const w=b.getBoundingClientRect(),L=y.clientX>=w.left&&y.clientX<=w.right,Pe=y.clientY>=w.top-32&&y.clientY<=w.bottom+32;return L&&Pe}function Ta(y){var b;return((b=x.value)==null?void 0:b.projectName)===y}function Bs(y){const b=x.value,w=dt.value[y]??0,L=j.value?zr.value.get(j.value)??"":"",Pe=D.value===y||L===y;return!b||b.projectName!==y?{position:"absolute",top:"0",left:"0",right:"0",zIndex:Pe?"40":"1",transform:`translate3d(0, ${w}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${b.groupLeft}px`,width:`${b.groupWidth}px`,height:`${b.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${b.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function ka(y){return go.value.get(y.projectName)??[]}function Ca(y){if(H.value)return ka(y);if(Pn(y.projectName))return[];const b=ka(y);return ro(y.projectName)?b:b.slice(0,10)}function qs(y){return H.value?!1:!Pn(y.projectName)&&ka(y).length>10}function Mo(y){return ka(y).length>0}function Qo(y){return!!y.pendingRequestState||y.inProgress||y.unread}function Jo(y){return y.pendingRequestState==="approval"?"Awaiting approval":"Awaiting response"}function Nt(y){return y.pendingRequestState==="approval"?"awaiting-approval":y.pendingRequestState==="response"?"awaiting-response":y.inProgress?"working":y.unread?"unread":"idle"}ht(()=>n.groups.map(y=>y.projectName),y=>{var Pe,lt;const b=((Pe=x.value)==null?void 0:Pe.projectName)??((lt=Ke.value)==null?void 0:lt.projectName)??"";b&&!n.groups.some(Vt=>Vt.projectName===b)&&Ro();const w=new Set(y),L=Object.fromEntries(Object.entries(Q.value).filter(([Vt])=>w.has(Vt)));Object.keys(L).length!==Object.keys(Q.value).length&&(Q.value=L)}),ht(()=>{const y=D.value;return y?n.projectGitRepoByName[y]:void 0},()=>{const y=D.value;y&&Zt(()=>{D.value===y&&Sr(y)})});const Hs=ae(()=>ge.value||D.value!==""||j.value!=="");return ht(Hs,y=>{if(y){Ua();return}Ar()}),ht(j,y=>{if(!y){lr();return}oo(),Zt(()=>{wa(y)})}),Da(()=>{for(const y of le.values())Ee==null||Ee.unobserve(y);le.clear(),pe.clear(),lr(),Ar(),Ro()}),(y,b)=>(C(),E("section",{class:tt(["thread-tree-root",{"chats-first":g.value}])},[Zr.value.length>0?(C(),E("section",ZT,[je(so,{as:"button",class:"section-toggle-row",type:"button","aria-expanded":l.value,onClick:Rr},{left:ft(()=>[l.value?(C(),et(rs,{key:1,class:"thread-icon"})):(C(),et(hi,{key:0,class:"thread-icon"}))]),default:ft(()=>[m("span",ek,M(S(r)("Pinned")),1)]),_:1},8,["aria-expanded"]),l.value?(C(),E("ul",tk,[(C(!0),E(Qe,null,en(Zr.value,w=>(C(),E("li",{key:w.id,class:"thread-row-item","data-menu-open":Yt(w.id)?"true":"false"},[je(so,{class:"thread-row","data-active":w.id===e.selectedThreadId,"data-pinned":Ot(w.id),"data-menu-open":Yt(w.id)?"true":"false","force-right-hover":Yt(w.id),onClick:L=>Ht(w.id),onMouseleave:L=>$t(w.id,L),onContextmenu:L=>cn(L,w.id)},{left:ft(()=>[m("span",rk,[Qo(w)?(C(),E("span",{key:0,class:"thread-status-indicator","data-state":Nt(w)},null,8,ok)):Z("",!0),m("button",{class:"thread-delete-button",type:"button","data-confirming":Wt(w.id),title:Wt(w.id)?"Confirm delete":S(r)("Delete thread"),onClick:Ze(L=>kr(w.id),["stop"])},[Wt(w.id)?(C(),E("span",sk,"Confirm")):(C(),et(dl,{key:1,class:"thread-icon"}))],8,ak)])]),right:ft(()=>[m("span",hk,M(br(w)),1)]),"right-hover":ft(()=>[m("div",{ref_for:!0,ref:L=>ir(w.id,L),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Ze(L=>zn(w.id),["stop"])},[je(vs,{class:"thread-icon"})],8,pk)],512)]),default:ft(()=>[m("button",{class:"thread-main-button",type:"button",onClick:Ze(L=>Ht(w.id),["stop"])},[m("span",lk,[m("span",uk,[m("span",ck,M(w.title),1),w.hasWorktree?(C(),et(Cs,{key:0,class:"thread-row-worktree-icon",title:S(r)("Worktree thread")},null,8,["title"])):Z("",!0),jt(w.id)?(C(),E("span",{key:1,class:"thread-row-automation-chip",title:Kt(w.id)}," Auto ",8,dk)):Z("",!0),w.pendingRequestState?(C(),E("span",{key:2,class:"thread-row-request-chip","data-state":w.pendingRequestState},M(Jo(w)),9,fk)):Z("",!0)])])],8,ik)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onClick","onMouseleave","onContextmenu"])],8,nk))),128))])):Z("",!0)])):Z("",!0),m("section",mk,[je(so,{as:"button",class:"thread-tree-header-row section-toggle-row",type:"button","aria-expanded":c.value,onClick:On},{left:ft(()=>[c.value?(C(),et(rs,{key:1,class:"thread-icon"})):(C(),et(hi,{key:0,class:"thread-icon"}))]),right:ft(()=>[m("div",{ref_key:"organizeMenuWrapRef",ref:de,class:"organize-menu-wrap"},[m("button",{class:"organize-menu-trigger",type:"button","aria-expanded":ge.value,"aria-label":S(r)("Organize threads"),title:S(r)("Organize threads"),onClick:Ze(vt,["stop"])},[je(vs,{class:"thread-icon"})],8,gk),ge.value?(C(),E("div",{key:0,class:"organize-menu-panel",onClick:b[4]||(b[4]=Ze(()=>{},["stop"]))},[m("p",yk,M(S(r)("Organize")),1),m("button",{class:"organize-menu-item","data-active":$e.value==="project",type:"button",onClick:b[0]||(b[0]=w=>dn("project"))},[m("span",null,M(S(r)("By project")),1),$e.value==="project"?(C(),E("span",bk,"✓")):Z("",!0)],8,wk),m("button",{class:"organize-menu-item","data-active":$e.value==="chronological",type:"button",onClick:b[1]||(b[1]=w=>dn("chronological"))},[m("span",null,M(S(r)("Chronological list")),1),$e.value==="chronological"?(C(),E("span",Tk,"✓")):Z("",!0)],8,_k),m("button",{class:"organize-menu-item","data-active":g.value,type:"button",onClick:Gn},[m("span",null,M(S(r)("Chats first")),1),g.value?(C(),E("span",Ck,"✓")):Z("",!0)],8,kk),b[27]||(b[27]=m("div",{class:"organize-menu-separator"},null,-1)),m("p",Sk,M(S(r)("Sort by")),1),m("button",{class:"organize-menu-item","data-active":_.value==="created",type:"button",onClick:b[2]||(b[2]=w=>zt("created"))},[m("span",null,M(S(r)("Created")),1),_.value==="created"?(C(),E("span",Ak,"✓")):Z("",!0)],8,xk),m("button",{class:"organize-menu-item","data-active":_.value==="updated",type:"button",onClick:b[3]||(b[3]=w=>zt("updated"))},[m("span",null,M(S(r)("Updated")),1),_.value==="updated"?(C(),E("span",Ek,"✓")):Z("",!0)],8,Ik)])):Z("",!0)],512)]),default:ft(()=>[m("span",vk,M(S(r)("Projects")),1)]),_:1},8,["aria-expanded"]),c.value?(C(),E(Qe,{key:0},[H.value&&Tt.value.length===0?(C(),E("p",Pk,M(S(r)("No matching threads")),1)):e.isLoading&&e.groups.length===0?(C(),E("p",Rk,M(S(r)("Loading threads...")),1)):qt.value?(C(),E("ul",Mk,[(C(!0),E(Qe,null,en(Cn.value,w=>(C(),E("li",{key:w.id,class:"thread-row-item","data-menu-open":Yt(w.id)?"true":"false"},[je(so,{class:"thread-row","data-active":w.id===e.selectedThreadId,"data-pinned":Ot(w.id),"data-menu-open":Yt(w.id)?"true":"false","force-right-hover":Yt(w.id),onClick:L=>Ht(w.id),onMouseleave:L=>$t(w.id,L),onContextmenu:L=>cn(L,w.id)},{left:ft(()=>[m("span",Nk,[Qo(w)?(C(),E("span",{key:0,class:"thread-status-indicator","data-state":Nt(w)},null,8,Lk)):Z("",!0),m("button",{class:"thread-delete-button",type:"button","data-confirming":Wt(w.id),title:Wt(w.id)?"Confirm delete":S(r)("Delete thread"),onClick:Ze(L=>kr(w.id),["stop"])},[Wt(w.id)?(C(),E("span",jk,"Confirm")):(C(),et(dl,{key:1,class:"thread-icon"}))],8,Ok)])]),right:ft(()=>[m("span",Wk,M(br(w)),1)]),"right-hover":ft(()=>[m("div",{ref_for:!0,ref:L=>ir(w.id,L),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Ze(L=>zn(w.id),["stop"])},[je(vs,{class:"thread-icon"})],8,zk)],512)]),default:ft(()=>[m("button",{class:"thread-main-button",type:"button",onClick:Ze(L=>Ht(w.id),["stop"])},[m("span",Fk,[m("span",Uk,[m("span",Bk,M(w.title),1),w.hasWorktree?(C(),et(Cs,{key:0,class:"thread-row-worktree-icon",title:S(r)("Worktree thread")},null,8,["title"])):Z("",!0),jt(w.id)?(C(),E("span",{key:1,class:"thread-row-automation-chip",title:Kt(w.id)}," Auto ",8,qk)):Z("",!0),w.pendingRequestState?(C(),E("span",{key:2,class:"thread-row-request-chip","data-state":w.pendingRequestState},M(Jo(w)),9,Hk)):Z("",!0)])])],8,Dk)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onClick","onMouseleave","onContextmenu"])],8,$k))),128))])):(C(),E("div",{key:3,ref_key:"groupsContainerRef",ref:Fe,class:"thread-tree-groups",style:ua(qn.value)},[(C(!0),E(Qe,null,en(Tt.value,w=>(C(),E("article",{key:w.projectName,ref_for:!0,ref:L=>ba(w.projectName,L),class:"project-group","data-project-name":w.projectName,"data-expanded":!Pn(w.projectName),"data-dragging":Ta(w.projectName),style:ua(Bs(w.projectName))},[je(so,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:L=>Vo(w.projectName),onContextmenu:Ze(L=>ar(w.projectName),["prevent"]),onKeydown:[L=>sn(L,w.projectName),gn(Ze(L=>Vo(w.projectName),["prevent"]),["enter"]),gn(Ze(L=>Vo(w.projectName),["prevent"]),["space"])]},{left:ft(()=>[m("span",Gk,[m("span",Kk,[Pn(w.projectName)?(C(),et(nd,{key:0,class:"thread-icon"})):(C(),et(AT,{key:1,class:"thread-icon"}))]),m("span",Yk,[Pn(w.projectName)?(C(),et(hi,{key:0,class:"thread-icon"})):(C(),et(rs,{key:1,class:"thread-icon"}))])])]),right:ft(()=>[m("div",Xk,[m("div",{ref_for:!0,ref:L=>Go(w.projectName,L),class:"project-menu-wrap"},[m("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:Ze(L=>En(w.projectName),["stop"])},[je(vs,{class:"thread-icon"})],8,Zk),oe(w.projectName)?(C(),E("div",{key:0,class:"project-menu-panel","data-open-direction":K.value[w.projectName]??"down",onClick:b[6]||(b[6]=Ze(()=>{},["stop"]))},[fe.value==="actions"?(C(),E(Qe,{key:0},[m("button",{class:"project-menu-item",type:"button",onClick:L=>Ct(w.projectName)}," Browse files ",8,tC),e.projectGitRepoByName[w.projectName]?(C(),E("button",{key:0,class:"project-menu-item",type:"button",onClick:L=>sr(w.projectName)}," New worktree ",8,nC)):Z("",!0),m("button",{class:"project-menu-item",type:"button",onClick:L=>Me(w)}," Rename project ",8,rC),m("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:L=>Us(w.projectName)}," Remove ",8,oC)],64)):(C(),E(Qe,{key:1},[m("label",aC,M(S(r)("Project name")),1),ln(m("input",{"onUpdate:modelValue":b[5]||(b[5]=L=>he.value=L),class:"project-menu-input",type:"text",onInput:L=>Cr(w.projectName)},null,40,sC),[[mn,he.value]])],64))],8,eC)):Z("",!0)],512),m("button",{class:"thread-start-button",type:"button","aria-label":Wn(w.projectName),title:Wn(w.projectName),onClick:Ze(L=>$r(w.projectName),["stop"])},[je(Ds,{class:"thread-icon"})],8,iC)])]),default:ft(()=>[m("span",{class:"project-main-button","data-dragging-handle":Ta(w.projectName),onMousedown:Ze(L=>Ba(L,w.projectName),["left"])},[m("span",{class:"project-title",title:or(w.projectName)},M(U(w)),9,Jk)],40,Qk)]),_:2},1032,["onClick","onContextmenu","onKeydown"]),Mo(w)?(C(),E("ul",lC,[(C(!0),E(Qe,null,en(Ca(w),L=>(C(),E("li",{key:L.id,class:"thread-row-item","data-menu-open":Yt(L.id)?"true":"false"},[je(so,{class:"thread-row","data-active":L.id===e.selectedThreadId,"data-pinned":Ot(L.id),"data-menu-open":Yt(L.id)?"true":"false","force-right-hover":Yt(L.id),onClick:Pe=>Ht(L.id),onMouseleave:Pe=>$t(L.id,Pe),onContextmenu:Pe=>cn(Pe,L.id)},{left:ft(()=>[m("span",cC,[Qo(L)?(C(),E("span",{key:0,class:"thread-status-indicator","data-state":Nt(L)},null,8,dC)):Z("",!0),m("button",{class:"thread-delete-button",type:"button","data-confirming":Wt(L.id),title:Wt(L.id)?"Confirm delete":S(r)("Delete thread"),onClick:Ze(Pe=>kr(L.id),["stop"])},[Wt(L.id)?(C(),E("span",hC,"Confirm")):(C(),et(dl,{key:1,class:"thread-icon"}))],8,fC)])]),right:ft(()=>[m("span",bC,M(br(L)),1)]),"right-hover":ft(()=>[m("div",{ref_for:!0,ref:Pe=>ir(L.id,Pe),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Ze(Pe=>zn(L.id),["stop"])},[je(vs,{class:"thread-icon"})],8,_C)],512)]),default:ft(()=>[m("button",{class:"thread-main-button",type:"button",onClick:Ze(Pe=>Ht(L.id),["stop"])},[m("span",mC,[m("span",vC,[m("span",gC,M(L.title),1),L.hasWorktree?(C(),et(Cs,{key:0,class:"thread-row-worktree-icon",title:S(r)("Worktree thread")},null,8,["title"])):Z("",!0),jt(L.id)?(C(),E("span",{key:1,class:"thread-row-automation-chip",title:Kt(L.id)}," Auto ",8,yC)):Z("",!0),L.pendingRequestState?(C(),E("span",{key:2,class:"thread-row-request-chip","data-state":L.pendingRequestState},M(Jo(L)),9,wC)):Z("",!0)])])],8,pC)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onClick","onMouseleave","onContextmenu"])],8,uC))),128))])):(C(),et(so,{key:1,as:"p",class:"project-empty-row"},{left:ft(()=>[...b[28]||(b[28]=[m("span",{class:"project-empty-spacer"},null,-1)])]),default:ft(()=>[m("span",TC,M(S(r)("No threads")),1)]),_:1})),qs(w)?(C(),et(so,{key:2,class:"thread-show-more-row"},{left:ft(()=>[...b[29]||(b[29]=[m("span",{class:"thread-show-more-spacer"},null,-1)])]),default:ft(()=>[m("button",{class:"thread-show-more-button",type:"button",onClick:L=>Fr(w.projectName)},M(ro(w.projectName)?"Show less":"Show more"),9,kC)]),_:2},1024)):Z("",!0)],12,Vk))),128))],4))],64)):Z("",!0)]),m("section",CC,[je(so,{as:"button",class:"section-toggle-row",type:"button","aria-expanded":p.value,onClick:yo},{left:ft(()=>[p.value?(C(),et(rs,{key:1,class:"thread-icon"})):(C(),et(hi,{key:0,class:"thread-icon"}))]),right:ft(()=>[m("div",xC,[m("button",{class:"chats-section-action",type:"button","aria-label":S(r)("New chat"),title:S(r)("New chat"),onClick:b[7]||(b[7]=Ze(w=>y.$emit("start-new-chat"),["stop"]))},[je(Ds,{class:"thread-icon"})],8,AC)])]),default:ft(()=>[m("span",SC,M(S(r)("Chats")),1)]),_:1},8,["aria-expanded"]),p.value&&Zn.value.length===0?(C(),E("p",IC,M(S(r)("No chats")),1)):p.value?(C(),E("ul",EC,[(C(!0),E(Qe,null,en(Nn.value,w=>(C(),E("li",{key:w.id,class:"thread-row-item","data-menu-open":Yt(w.id)?"true":"false"},[je(so,{class:"thread-row","data-active":w.id===e.selectedThreadId,"data-pinned":Ot(w.id),"data-menu-open":Yt(w.id)?"true":"false","force-right-hover":Yt(w.id),onClick:L=>Ht(w.id),onMouseleave:L=>$t(w.id,L),onContextmenu:L=>cn(L,w.id)},{left:ft(()=>[m("span",RC,[Qo(w)?(C(),E("span",{key:0,class:"thread-status-indicator","data-state":Nt(w)},null,8,MC)):Z("",!0),m("button",{class:"thread-delete-button",type:"button","data-confirming":Wt(w.id),title:Wt(w.id)?"Confirm delete":S(r)("Delete thread"),onClick:Ze(L=>kr(w.id),["stop"])},[Wt(w.id)?(C(),E("span",NC,"Confirm")):(C(),et(dl,{key:1,class:"thread-icon"}))],8,$C)])]),right:ft(()=>[m("span",BC,M(br(w)),1)]),"right-hover":ft(()=>[m("div",{ref_for:!0,ref:L=>ir(w.id,L),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Ze(L=>zn(w.id),["stop"])},[je(vs,{class:"thread-icon"})],8,qC)],512)]),default:ft(()=>[m("button",{class:"thread-main-button",type:"button",onClick:Ze(L=>Ht(w.id),["stop"])},[m("span",OC,[m("span",jC,[m("span",DC,M(w.title),1),w.hasWorktree?(C(),et(Cs,{key:0,class:"thread-row-worktree-icon",title:S(r)("Worktree thread")},null,8,["title"])):Z("",!0),jt(w.id)?(C(),E("span",{key:1,class:"thread-row-automation-chip",title:Kt(w.id)}," Auto ",8,FC)):Z("",!0),w.pendingRequestState?(C(),E("span",{key:2,class:"thread-row-request-chip","data-state":w.pendingRequestState},M(Jo(w)),9,UC)):Z("",!0)])])],8,LC)]),_:2},1032,["data-active","data-pinned","data-menu-open","force-right-hover","onClick","onMouseleave","onContextmenu"])],8,PC))),128))])):Z("",!0),p.value&&Wo.value?(C(),et(so,{key:2,class:"thread-show-more-row"},{left:ft(()=>[...b[30]||(b[30]=[m("span",{class:"thread-show-more-spacer"},null,-1)])]),default:ft(()=>[m("button",{class:"thread-show-more-button",type:"button",onClick:zo},M(f.value?"Show less":"Show more"),1)]),_:1})):Z("",!0)]),(C(),et(ts,{to:"body"},[un.value?(C(),E("div",{key:0,ref_key:"openThreadMenuPanelRef",ref:Oe,class:"thread-menu-panel thread-menu-panel-fixed",style:ua(_e.value),"data-open-direction":Kn(un.value.id),onClick:b[16]||(b[16]=Ze(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:b[8]||(b[8]=w=>St(un.value.id))},M(jt(un.value.id)?"Manage automations…":"Add automation…"),1),m("button",{class:"thread-menu-item",type:"button",onClick:b[9]||(b[9]=w=>Tr(un.value.id))}," Browse files "),m("button",{class:"thread-menu-item",type:"button",onClick:b[10]||(b[10]=w=>ko(un.value.id))}," Copy path "),m("button",{class:"thread-menu-item",type:"button",onClick:b[11]||(b[11]=w=>Mr(un.value.id))}," Export chat "),m("button",{class:"thread-menu-item",type:"button",onClick:b[12]||(b[12]=w=>To(un.value.id))}," Create chat fork "),m("button",{class:"thread-menu-item",type:"button",onClick:b[13]||(b[13]=w=>wo(un.value.id))},M(Ot(un.value.id)?"Unpin thread":"Pin thread"),1),m("button",{class:"thread-menu-item",type:"button",onClick:b[14]||(b[14]=w=>an(un.value.id,un.value.title))},M(S(r)("Rename thread")),1),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:b[15]||(b[15]=w=>nr(un.value.id,un.value.title))},M(S(r)("Delete thread")),1)],12,HC)):Z("",!0)])),(C(),et(ts,{to:"body"},[Re.value?(C(),E("div",{key:0,class:"rename-thread-overlay",onClick:Ze(Qt,["self"])},[m("div",WC,[m("h3",zC,M(S(r)("Rename thread")),1),b[31]||(b[31]=m("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),ln(m("input",{ref_key:"renameThreadInputRef",ref:ke,"onUpdate:modelValue":b[17]||(b[17]=w=>ye.value=w),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[gn(Ze(Nr,["prevent"]),["enter"]),gn(Ze(Qt,["prevent"]),["esc"])]},null,40,VC),[[mn,ye.value]]),m("div",GC,[m("button",{class:"rename-thread-button",type:"button",onClick:Qt},M(S(r)("Cancel")),1),m("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:Nr},M(S(r)("Save")),1)])])])):Z("",!0)])),(C(),et(ts,{to:"body"},[se.value?(C(),E("div",{key:0,class:"rename-thread-overlay",onClick:Ze(rr,["self"])},[m("div",KC,[m("h3",YC,M(wr.value?"Archive chat and remove automations?":"Delete thread?"),1),m("p",QC,[wr.value?(C(),E(Qe,{key:0},[is(' This will archive the thread "'+M(De.value)+'" and remove the attached heartbeat automations. ',1)],64)):(C(),E(Qe,{key:1},[is(' This will archive the thread "'+M(De.value)+'". You can find it later in archived threads. ',1)],64))]),m("div",JC,[m("button",{class:"rename-thread-button",type:"button",onClick:rr},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:Co},M(wr.value?"Archive and remove":"Delete"),1)])])])):Z("",!0)])),(C(),et(ts,{to:"body"},[ze.value?(C(),E("div",{key:0,class:"rename-thread-overlay",onClick:Ze(nn,["self"])},[m("div",XC,[m("h3",ZC,M(Ye.value==="edit"?"Edit automation":"Add automation"),1),b[38]||(b[38]=m("p",{class:"rename-thread-subtitle"},"This creates heartbeat automations attached to the selected thread.",-1)),Se.value.length>0?(C(),E("div",e1,[(C(!0),E(Qe,null,en(Se.value,w=>(C(),E("button",{key:w.id,class:tt(["automation-thread-list-item",{"is-active":w.id===Ce.value}]),type:"button",onClick:L=>wn(w.id)},[m("span",null,M(w.name),1),m("small",null,M(w.status==="PAUSED"?"Paused":"Active"),1)],10,t1))),128)),m("button",{class:"automation-thread-list-item automation-thread-list-add",type:"button",onClick:An}," Add another automation ")])):Z("",!0),m("label",n1,[b[32]||(b[32]=m("span",{class:"automation-thread-label"},"Name",-1)),ln(m("input",{"onUpdate:modelValue":b[18]||(b[18]=w=>Ge.value.name=w),class:"rename-thread-input",type:"text",placeholder:"Automation name"},null,512),[[mn,Ge.value.name]])]),m("label",r1,[b[33]||(b[33]=m("span",{class:"automation-thread-label"},"Prompt",-1)),ln(m("textarea",{"onUpdate:modelValue":b[19]||(b[19]=w=>Ge.value.prompt=w),class:"automation-thread-textarea",rows:"6",placeholder:"Describe what the automation should do"},null,512),[[mn,Ge.value.prompt]])]),m("div",o1,[b[36]||(b[36]=m("span",{class:"automation-thread-label"},"Schedule",-1)),m("div",a1,[m("button",{class:tt(["automation-schedule-mode",{"is-active":qe.value.mode==="daily"}]),type:"button",onClick:b[20]||(b[20]=w=>tr("daily"))}," Daily ",2),m("button",{class:tt(["automation-schedule-mode",{"is-active":qe.value.mode==="interval"}]),type:"button",onClick:b[21]||(b[21]=w=>tr("interval"))}," Interval ",2),m("button",{class:tt(["automation-schedule-mode",{"is-active":qe.value.mode==="advanced"}]),type:"button",onClick:b[22]||(b[22]=w=>tr("advanced"))}," RRULE ",2)]),qe.value.mode==="daily"?(C(),E("div",s1,[b[34]||(b[34]=m("span",{class:"automation-schedule-copy"},"Run every day at",-1)),ln(m("input",{"onUpdate:modelValue":b[23]||(b[23]=w=>qe.value.dailyTime=w),class:"automation-schedule-time",type:"time",onInput:on},null,544),[[mn,qe.value.dailyTime]])])):qe.value.mode==="interval"?(C(),E("div",i1,[b[35]||(b[35]=m("span",{class:"automation-schedule-copy"},"Run every",-1)),ln(m("input",{"onUpdate:modelValue":b[24]||(b[24]=w=>qe.value.interval=w),class:"automation-schedule-number",type:"number",min:"1",step:"1",onInput:on},null,544),[[mn,qe.value.interval,void 0,{number:!0}]]),je(Wr,{class:"automation-schedule-unit","model-value":qe.value.intervalUnit,options:wt,"onUpdate:modelValue":er},null,8,["model-value"])])):Z("",!0),qe.value.mode==="advanced"?ln((C(),E("input",{key:2,"onUpdate:modelValue":b[25]||(b[25]=w=>Ge.value.rrule=w),class:"rename-thread-input",type:"text",placeholder:"FREQ=DAILY;BYHOUR=9;BYMINUTE=0",onInput:_r},null,544)),[[mn,Ge.value.rrule]]):Z("",!0),m("p",l1,M(Ae.value),1)]),m("label",u1,[b[37]||(b[37]=m("span",{class:"automation-thread-label"},"Status",-1)),je(Wr,{class:"automation-thread-select","model-value":Ge.value.status,options:ne.value,"onUpdate:modelValue":b[26]||(b[26]=w=>Ge.value.status=w)},null,8,["model-value","options"])]),rt.value?(C(),E("p",c1,M(rt.value),1)):Ve.value?(C(),E("p",d1,M(Ve.value),1)):Z("",!0),m("div",f1,[Ye.value==="edit"?(C(),E("button",{key:0,class:"rename-thread-button",type:"button",disabled:Le.value||gt.value,onClick:Vn},M(gt.value?"Running…":"Run now"),9,h1)):Z("",!0),Ye.value==="edit"?(C(),E("button",{key:1,class:"rename-thread-button rename-thread-button-danger",type:"button",disabled:Le.value||gt.value,onClick:Dr}," Remove ",8,p1)):Z("",!0),m("button",{class:"rename-thread-button",type:"button",disabled:Le.value||gt.value,onClick:nn},M(S(r)("Cancel")),9,m1),m("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",disabled:Le.value||gt.value,onClick:jr},M(Le.value?"Saving…":"Save"),9,v1)])])])):Z("",!0)]))],2))}}),w1=At(y1,[["__scopeId","data-v-3c34356c"]]),b1={class:"content-header"},_1=["title"],T1={class:"content-actions"},k1=Bn({__name:"ContentHeader",props:{title:{},accent:{type:Boolean}},setup(e){return(t,n)=>(C(),E("header",b1,[m("div",{class:tt(["content-leading",{"is-accent":e.accent}])},[Bo(t.$slots,"leading",{},void 0)],2),m("h1",{class:tt(["content-title",{"is-accent":e.accent}]),title:e.title},M(e.title),11,_1),m("div",T1,[Bo(t.$slots,"actions",{},void 0)])]))}}),C1=At(k1,[["__scopeId","data-v-f96f7210"]]),fh=.0025,Gu=3,hh=2,S1=256;function x1(e){var ke;const t=A("idle"),n=A(typeof navigator<"u"&&!!((ke=navigator.mediaDevices)!=null&&ke.getUserMedia)),r=A(0),a=A(null);let o=null,s=null,l=[],c=null,p=null,f=null,g=null,_=[],I=!1,O=!1,q=null;function ee(){q&&(q.abort(),q=null),t.value==="transcribing"&&(t.value="idle")}function D(){const se=a.value;if(!se||typeof window>"u")return;const Te=se.getContext("2d");if(!Te)return;const De=Math.max(1,Math.floor(se.clientWidth)),Be=Math.max(1,Math.floor(se.clientHeight||36)),ze=window.devicePixelRatio||1,Ne=Math.max(1,Math.floor(De*ze)),Ce=Math.max(1,Math.floor(Be*ze));(se.width!==Ne||se.height!==Ce)&&(se.width=Ne,se.height=Ce),Te.setTransform(ze,0,0,ze,0,0),Te.clearRect(0,0,De,Be);const Ye=Math.max(12,Math.floor(De/(Gu+hh))),rt=_.slice(-Ye),Ve=Math.max(0,Ye-rt.length),Le=Be/2,gt=getComputedStyle(se).color||"#000000";for(let Ge=0;Ge<Ye;Ge+=1){const qe=rt[Ge-Ve]??0,ne=Math.max(.08,Math.min(1,qe*18))*Le,Se=Ge*(Gu+hh);Te.globalAlpha=qe<=fh?.35:1,Te.fillStyle=gt,Te.fillRect(Se,Le-ne,Gu,ne*2)}Te.globalAlpha=1}function j(){_=[],r.value=0,D()}function K(){f&&(f.disconnect(),f.onaudioprocess=null,f=null),p&&(p.disconnect(),p=null),c&&(c.close(),c=null),g=null}function te(se){if(typeof window>"u")return;const Te=window.webkitAudioContext,De=window.AudioContext??Te;De&&(K(),j(),c=new De,p=c.createMediaStreamSource(se),f=c.createScriptProcessor(2048,1,1),g=performance.now(),f.onaudioprocess=Be=>{const ze=Be.inputBuffer.getChannelData(0);let Ne=0;for(let Ce=0;Ce<ze.length;Ce+=1){const Ye=Math.abs(ze[Ce]??0);Ne+=Ye<fh?0:Ye}_.push(Ne/ze.length),_.length>S1&&_.shift(),g!==null&&(r.value=Math.max(0,performance.now()-g)),D()},p.connect(f),f.connect(c.destination),D())}async function _e(){var se;if(t.value==="transcribing"&&ee(),!(t.value!=="idle"||!n.value||I)){I=!0,O=!1;try{s=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),l=[],o=new MediaRecorder(s),o.ondataavailable=Te=>{Te.data.size>0&&l.push(Te.data)},o.onstop=()=>{var Be;const Te=l,De=(o==null?void 0:o.mimeType)||((Be=Te[0])==null?void 0:Be.type)||"audio/webm";G(),Re(Te,De)},te(s),o.start(250),t.value="recording",O&&fe()}catch(Te){G(),t.value="idle",(se=e.onError)==null||se.call(e,Te)}finally{I=!1}}}function fe(){if(I&&t.value==="idle"){O=!0;return}if(!(t.value!=="recording"||!o)&&o.state!=="inactive"){t.value="transcribing";try{o.requestData()}catch{}o.stop()}}function he(){O=!1,ee(),G(),t.value="idle"}async function Re(se,Te){var ze,Ne,Ce,Ye,rt;if(se.length===0){(ze=e.onEmpty)==null||ze.call(e),t.value="idle";return}const De=new Blob(se,{type:Te});t.value="transcribing";let Be=null;try{const Ve=Te.split(/[/;]/)[1]??"webm",Le=new FormData;Le.append("file",De,`codex.${Ve}`);const gt=((Ne=e.getLanguage)==null?void 0:Ne.call(e).trim())??"";gt&&gt.toLowerCase()!=="auto"&&Le.append("language",gt),Be=new AbortController,q=Be;const Ge=await fetch("/codex-api/transcribe",{method:"POST",body:Le,signal:Be.signal}),qe=await Ge.text();let wt=null;try{wt=qe.trim()?JSON.parse(qe):null}catch{wt=null}if(!Ge.ok){const Se=(Ce=wt==null?void 0:wt.error)==null?void 0:Ce.trim(),Ae=qe.trim();throw new Error(Se||Ae||`Transcription failed: ${Ge.status}`)}const ne=((wt==null?void 0:wt.text)??"").trim();ne.length>0?e.onTranscript(ne):(Ye=e.onEmpty)==null||Ye.call(e)}catch(Ve){if(Ve instanceof DOMException&&Ve.name==="AbortError")return;(rt=e.onError)==null||rt.call(e,Ve)}finally{Be&&q===Be&&(q=null),t.value==="transcribing"&&(t.value="idle")}}function G(){K(),j(),o&&(o.ondataavailable=null,o.onstop=null,o=null),s&&(s.getTracks().forEach(se=>se.stop()),s=null),l=[]}Da(()=>{he()});function ye(){if(t.value==="recording"){fe();return}(t.value==="idle"||t.value==="transcribing")&&_e()}return{state:t,isSupported:n,recordingDurationMs:r,waveformCanvasRef:a,startRecording:_e,stopRecording:fe,toggleRecording:ye,cancel:he}}const A1={},I1={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function E1(e,t){return C(),E("svg",I1,[...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 P1=At(A1,[["render",E1]]),R1={},M1={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function $1(e,t){return C(),E("svg",M1,[...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 _l=At(R1,[["render",$1]]),N1={},L1={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function O1(e,t){return C(),E("svg",L1,[...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 j1=At(N1,[["render",O1]]),D1={},F1={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function U1(e,t){return C(),E("svg",F1,[...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 ph=At(D1,[["render",U1]]),B1=["disabled"],q1={class:"search-dropdown-value"},H1={class:"search-dropdown-search-wrap"},W1={class:"search-dropdown-search-row"},z1=["placeholder","onKeydown"],V1=["aria-label","title"],G1={key:0,class:"search-dropdown-list",role:"listbox"},K1=["onPointerenter"],Y1=["onClick"],Q1={class:"search-dropdown-option-check"},J1=["title"],X1={class:"search-dropdown-option-copy"},Z1={class:"search-dropdown-option-label-row"},eS={class:"search-dropdown-option-label"},tS={key:0,class:"search-dropdown-option-type"},nS={key:0,class:"search-dropdown-option-desc"},rS=["aria-label","title","onClick"],oS={key:1,class:"search-dropdown-empty"},aS=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=A(null),o=A(null),s=A(null),l=A(!1),c=A(""),p=A(0),f=A({}),{t:g}=Fa(),_=ae(()=>n.openDirection??"down"),I=ae(()=>new Set(n.selectedValues)),O=ae(()=>{var he;if((he=n.displayLabelOverride)!=null&&he.trim())return n.displayLabelOverride.trim();if(n.selectedValues.length===0)return n.placeholder||g("Select...");if(n.selectedValues.length===1){const Re=n.options.find(G=>G.value===n.selectedValues[0]);return(Re==null?void 0:Re.label)||n.placeholder||g("Select...")}return`${n.selectedValues.length} ${g("selected")}`}),q=ae(()=>{const he=c.value.toLowerCase().trim();return he?n.options.filter(Re=>{var G;return Re.label.toLowerCase().includes(he)||(((G=Re.description)==null?void 0:G.toLowerCase().includes(he))??!1)}):n.options});function ee(){const he=o.value,Re=a.value;if(!he||!Re)return;const G=Re.getBoundingClientRect(),ye=window.innerWidth,ke=window.innerHeight,se=Math.min(384,ye-16),Te=Math.max(8,Math.min(G.right-se,ye-se-8));if(ye<640){f.value={position:"fixed",left:"0.5rem",right:"0.5rem",width:"auto",top:_.value==="up"?"auto":`${G.bottom+8}px`,bottom:_.value==="up"?`${ke-G.top+8}px`:"auto",zIndex:"120"};return}f.value={position:"fixed",width:`${se}px`,left:`${Te}px`,top:_.value==="up"?"auto":`${G.bottom+8}px`,bottom:_.value==="up"?`${ke-G.top+8}px`:"auto",zIndex:"120"}}function D(){n.disabled||(l.value=!l.value,l.value&&(c.value="",p.value=0,Zt(()=>{var he;Zt(()=>{ee()}),(he=s.value)==null||he.focus()})))}function j(he){r("toggle",he.value,!I.value.has(he.value)),l.value=!1}function K(he){q.value.length!==0&&(p.value=(p.value+he+q.value.length)%q.value.length)}function te(){const he=q.value[p.value];he&&j(he)}function _e(he){if(!l.value)return;const Re=a.value,G=o.value;if(!Re)return;const ye=he.target;ye instanceof Node&&(Re.contains(ye)||G!=null&&G.contains(ye)||(l.value=!1))}ht(c,()=>{p.value=0});function fe(){l.value&&ee()}return ma(()=>{window.addEventListener("pointerdown",_e),window.addEventListener("resize",fe),window.addEventListener("scroll",fe,!0)}),Da(()=>{window.removeEventListener("pointerdown",_e),window.removeEventListener("resize",fe),window.removeEventListener("scroll",fe,!0)}),(he,Re)=>(C(),E("div",{ref_key:"rootRef",ref:a,class:"search-dropdown"},[m("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:D},[m("span",q1,M(O.value),1),je(rs,{class:"search-dropdown-chevron"})],8,B1),(C(),et(ts,{to:"body"},[l.value?(C(),E("div",{key:0,ref_key:"menuRef",ref:o,class:tt(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":_.value==="up","search-dropdown-menu-wrap-down":_.value==="down"}]),style:ua(f.value)},[m("div",H1,[m("div",W1,[ln(m("input",{ref_key:"searchRef",ref:s,"onUpdate:modelValue":Re[0]||(Re[0]=G=>c.value=G),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[Re[1]||(Re[1]=gn(Ze(G=>l.value=!1,["prevent"]),["escape"])),gn(Ze(te,["prevent"]),["enter"]),Re[2]||(Re[2]=gn(Ze(G=>K(1),["prevent"]),["arrow-down"])),Re[3]||(Re[3]=gn(Ze(G=>K(-1),["prevent"]),["arrow-up"]))]},null,40,z1),[[mn,c.value]]),e.createLabel?(C(),E("button",{key:0,class:"search-dropdown-create-icon",type:"button","aria-label":e.createLabel,title:e.createLabel,onClick:Re[4]||(Re[4]=G=>r("create"))}," + ",8,V1)):Z("",!0)]),e.createLabel?(C(),E("button",{key:0,class:"search-dropdown-create",type:"button",onClick:Re[5]||(Re[5]=G=>r("create"))},M(e.createLabel),1)):Z("",!0)]),q.value.length>0?(C(),E("ul",G1,[(C(!0),E(Qe,null,en(q.value,(G,ye)=>(C(),E("li",{key:G.value},[m("div",{class:tt(["search-dropdown-option",{"is-selected":I.value.has(G.value),"is-highlighted":ye===p.value}]),onPointerenter:ke=>p.value=ye},[m("button",{class:"search-dropdown-option-main",type:"button",onClick:ke=>j(G)},[m("span",Q1,M(I.value.has(G.value)?"✓":""),1),G.badge?(C(),E("span",{key:0,class:tt(["search-dropdown-option-badge",G.badgeTone?`is-${G.badgeTone}`:""]),title:G.badgeLabel||G.badge,"aria-hidden":"true"},M(G.badge),11,J1)):Z("",!0),m("span",X1,[m("span",Z1,[m("span",eS,M(G.label),1),G.badgeLabel?(C(),E("span",tS,M(G.badgeLabel),1)):Z("",!0)]),G.description?(C(),E("span",nS,M(G.description),1)):Z("",!0)])],8,Y1),e.allowRemove&&G.removable?(C(),E("button",{key:0,class:"search-dropdown-option-remove",type:"button","aria-label":`${e.removeLabel} ${G.label}`,title:`${e.removeLabel} ${G.label}`,onClick:Ze(ke=>r("remove",G.value),["stop"])}," × ",8,rS)):Z("",!0)],42,K1)]))),128))])):(C(),E("div",oS,M(S(g)("No results")),1))],6)):Z("",!0)]))],512))}}),sS=At(aS,[["__scopeId","data-v-65ed7fdf"]]),iS={key:0,class:"thread-composer-dictation-error"},lS={key:0,class:"thread-composer-attachments"},uS=["src","alt"],cS=["aria-label","disabled","onClick"],dS={key:1,class:"thread-composer-folder-chips"},fS=["title"],hS={class:"thread-composer-folder-chip-meta"},pS=["aria-label","disabled","onClick"],mS={key:2,class:"thread-composer-file-chips"},vS=["title"],gS=["aria-label","disabled","onClick"],yS={key:3,class:"thread-composer-skill-chips"},wS=["title","aria-label","onClick"],bS=["aria-label","onClick"],_S={key:0,class:"thread-composer-drop-overlay","aria-hidden":"true"},TS={key:1,class:"thread-composer-file-mentions"},kS=["onMousedown"],CS={key:1,class:"thread-composer-file-mention-icon-markdown"},SS={class:"thread-composer-file-mention-text"},xS={class:"thread-composer-file-mention-name"},AS={key:0,class:"thread-composer-file-mention-dir"},IS={key:1,class:"thread-composer-file-mention-empty"},ES=["placeholder","disabled"],PS=["aria-label","disabled"],RS={key:0,class:"thread-composer-attach-menu"},MS=["disabled"],$S=["disabled"],NS=["disabled"],LS={class:"thread-composer-attach-mode"},OS={class:"thread-composer-attach-mode-label"},jS={class:"thread-composer-attach-mode-buttons"},DS=["disabled"],FS=["disabled"],US=["aria-checked","aria-label","disabled"],BS={class:"thread-composer-attach-setting-copy"},qS={class:"thread-composer-attach-setting-label"},HS={class:"thread-composer-attach-setting-description"},WS=["aria-checked","aria-label","disabled"],zS={class:"thread-composer-attach-setting-copy"},VS={class:"thread-composer-attach-setting-label"},GS={class:"thread-composer-attach-setting-description"},KS={key:0,class:"thread-composer-dictation-waveform-wrap","aria-hidden":"true"},YS={key:1,class:"thread-composer-dictation-timer"},QS=["aria-label","title","disabled"],JS=["aria-label","title","disabled"],XS={key:0,class:"thread-composer-stop-spinner","aria-hidden":"true"},ZS=["aria-label","title","disabled"],ex=["disabled"],tx=["disabled"],nx=["disabled"],rx=2e3,Ku="prompt:",ox="codex-web-local.thread-draft.v1.",ax=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}=Fa(),s=A(""),l=A([]),c=A([]),p=A([]),f=A([]),g=A([]),_=A(""),I=A(0),O=A(null),q=A(!1),{state:ee,isSupported:D,recordingDurationMs:j,waveformCanvasRef:K,startRecording:te,stopRecording:_e,toggleRecording:fe,cancel:he}=x1({getLanguage:()=>r.dictationLanguage??"auto",onTranscript:P=>{if(s.value=s.value?`${s.value}
48
+ ${P}`:P,_.value="",r.dictationAutoSend!==!1){const U=r.isTurnInProgress?Ee.value:"steer";z(U);return}Zt(()=>{var U;return(U=se.value)==null?void 0:U.focus()})},onEmpty:()=>{_.value=r.dictationClickToToggle?"No speech detected. Click again after speaking.":"No speech detected. Hold the mic and speak."},onError:P=>{if(P instanceof DOMException&&P.name==="NotAllowedError"){_.value="Microphone access was denied.";return}_.value=P instanceof Error?P.message:"Dictation failed."}}),Re=A(null),G=A(null),ye=A(null),ke=A(null),se=A(null),{isMobile:Te}=Zc(),De=A(!1),Be=A(null),ze=A(""),Ne=A([]),Ce=A(!1),Ye=A(0),rt=A(0);let Ve=0,Le=null,gt=!1,Ge=0,qe=0;const wt=typeof navigator<"u"&&/Android/i.test(navigator.userAgent);let ne="";const Se=[{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 Ae(P){return P.trim().replace(/^gpt/i,"GPT")}const Fe=ae(()=>r.models.map(P=>({value:P,label:Ae(P)}))),Ke=ae(()=>r.selectedCollaborationMode==="plan"),x=ae(()=>r.selectedCollaborationMode==="plan"&&r.selectedModel.trim().length===0),R=ae(()=>c.value.map(P=>P.path)),V=ae(()=>[...(r.skills??[]).map(P=>{const U=In(P);return{value:P.path,label:P.name,description:P.description,badge:U.badge,badgeLabel:U.badgeLabel,badgeTone:U.badgeTone,removable:!1}}),...p.value.map(P=>({value:kt(P.path),label:P.name,description:P.description,badge:"T",badgeLabel:"Prompt",badgeTone:"prompt",removable:!0}))]),ie=ae(()=>r.disabled||r.isUpdatingSpeedMode||!r.activeThreadId||x.value||I.value>0?!1:s.value.trim().length>0||l.value.length>0||f.value.length>0),Q=ae(()=>s.value.trim().length>0||l.value.length>0||c.value.length>0||f.value.length>0||g.value.length>0),le=ae(()=>{const P=new Set;for(const U of g.value)for(const oe of U.filePaths)P.add(oe);return f.value.filter(U=>!P.has(U.fsPath))}),pe=ae(()=>r.disabled||!r.activeThreadId),be=ae(()=>r.disabled||!r.activeThreadId),we=ae(()=>/^gpt-5\.(?:4|5)(?:$|-)/.test(r.selectedModel.trim())),de=ae(()=>r.selectedSpeedMode==="fast"&&we.value),Oe=ae(()=>pe.value||r.isUpdatingSpeedMode===!0),ge=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")),$e=ae(()=>r.inProgressSubmitMode==="steer"?"steer":"queue"),Ee=A($e.value),at=ae(()=>ee.value==="recording"),mt=ae(()=>ee.value==="recording"?o("Stop dictation"):r.dictationClickToToggle?o("Click to dictate"):o("Hold to dictate")),pt=ae(()=>ee.value==="idle"?_.value.trim():""),bt=ae(()=>{const P=Math.max(0,Math.floor(j.value/1e3)),U=Math.floor(P/60),oe=P%60;return`${U}:${String(oe).padStart(2,"0")}`}),yt=ae(()=>r.activeThreadId?x.value?o("Loading models for plan mode..."):o("Type a message... (@ for files)"):o("Select a thread to send a message")),F=ae(()=>s.value.trim().length>0||l.value.length>0||f.value.length>0);function z(P="steer"){var oe;const U=s.value.trim();if(ie.value){if(a("submit",{text:U,imageUrls:l.value.map(xe=>xe.url),fileAttachments:[...f.value],skills:c.value.map(xe=>({name:xe.name,path:xe.path})),selectedModel:r.selectedModel,mode:P}),qt(r.activeThreadId),ve(),g.value=[],De.value=!1,Qt(),wt||Te.value){(oe=se.value)==null||oe.blur();return}Zt(()=>{var xe;return(xe=se.value)==null?void 0:xe.focus()})}}function H(P){Ee.value=P}function X(P){rt.value+=1,s.value=P.text,l.value=P.imageUrls.map((U,oe)=>({id:`queued-${Date.now()}-${oe}-${Math.random().toString(36).slice(2,8)}`,name:`Image ${oe+1}`,url:U})),c.value=P.skills.map(U=>(r.skills??[]).find(oe=>oe.path===U.path)??{name:U.name,displayName:void 0,description:"",path:U.path}),f.value=P.fileAttachments.map(U=>({...U})),g.value=[],_.value="",O.value=null,I.value=0,De.value=!1,Qt(),qe+=1}function ve(){X({text:"",imageUrls:[],fileAttachments:[],skills:[]})}function Ie(P){return`${ox}${P}`}function He(P){if(typeof window>"u")return null;const U=P.trim();if(!U)return null;try{const oe=window.localStorage.getItem(Ie(U));if(!oe)return null;const xe=JSON.parse(oe);return typeof xe=="string"?{text:xe,imageUrls:[],fileAttachments:[],skills:[]}:{text:typeof xe.text=="string"?xe.text:"",imageUrls:Array.isArray(xe.imageUrls)?xe.imageUrls.filter(vt=>typeof vt=="string"):[],fileAttachments:Array.isArray(xe.fileAttachments)?xe.fileAttachments.filter(vt=>!!vt&&typeof vt.label=="string"&&typeof vt.path=="string"&&typeof vt.fsPath=="string"):[],skills:Array.isArray(xe.skills)?xe.skills.filter(vt=>!!vt&&typeof vt.name=="string"&&typeof vt.path=="string"):[]}}catch{return null}}function Tt(P,U){if(typeof window>"u")return;const oe=P.trim();if(oe)try{if(U.text.trim().length>0||U.imageUrls.length>0||U.fileAttachments.length>0||U.skills.length>0){window.localStorage.setItem(Ie(oe),JSON.stringify(U));return}window.localStorage.removeItem(Ie(oe))}catch{}}function qt(P){Tt(P,{text:"",imageUrls:[],fileAttachments:[],skills:[]})}function Cn(){return{text:s.value,imageUrls:l.value.map(P=>P.url),fileAttachments:f.value.map(P=>({...P})),skills:c.value.map(P=>({name:P.name,path:P.path}))}}function Zn(){a("interrupt")}function Nn(P){a("update:selected-model",P)}function Wo(){a("update:selected-collaboration-mode",Ke.value?"default":"plan")}function Ln(P){a("update:selected-reasoning-effort",P)}function wr(){Oe.value||a("update:selected-speed-mode",r.selectedSpeedMode==="fast"?"standard":"fast")}function zr(){r.dictationClickToToggle&&(_.value&&(_.value=""),fe())}function go(P){if(r.dictationClickToToggle||(P.preventDefault(),gt))return;gt=!0;const U=P.currentTarget;if(U)try{U.setPointerCapture(P.pointerId)}catch{}_.value&&(_.value=""),window.addEventListener("pointerup",Sn),window.addEventListener("pointercancel",Sn),window.addEventListener("blur",Sn),te()}function Sn(){r.dictationClickToToggle||gt&&(gt=!1,window.removeEventListener("pointerup",Sn),window.removeEventListener("pointercancel",Sn),window.removeEventListener("blur",Sn),_e())}function un(){pe.value||(De.value=!De.value)}function Zr(){var P;(P=G.value)==null||P.click()}function Rr(){var P;(P=ye.value)==null||P.click()}function On(){var P;(P=ke.value)==null||P.click()}function yo(P){l.value=l.value.filter(U=>U.id!==P)}function xn(P){c.value=c.value.filter(U=>U.path!==P)}function jn(P){const U=P.trim();return U?U.endsWith("/SKILL.md")?U:`${U.replace(/\/+$/,"")}/SKILL.md`:""}function dt(P){const U=jn(P.path);!U||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(U)}`,"_blank","noopener,noreferrer")}function qn(P){f.value=f.value.filter(U=>U.fsPath!==P)}function vn(P){const U=g.value.find(xe=>xe.id===P);if(!U)return;const oe=new Set(U.filePaths);f.value=f.value.filter(xe=>!oe.has(xe.fsPath)),g.value=g.value.filter(xe=>xe.id!==P)}function br(P){return P.total<=0?0:Math.round(P.processed/P.total*100)}function Ot(P,U){const oe=P.replace(/\\/g,"/");if(f.value.some(dn=>dn.fsPath===oe))return;const xe=oe.split("/").filter(Boolean),vt=(U==null?void 0:U.trim())||xe[xe.length-1]||oe;f.value=[...f.value,{label:vt,path:oe,fsPath:oe}]}function eo(P){return P.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(P.name)}function wo(P){return P?Array.from(P):[]}function Ht(P){return P!==qe?!1:(I.value+=1,!0)}function jt(P){P===qe&&(I.value=Math.max(0,I.value-1))}function Kt(P){if(P<=0)return;const U=O.value,oe=U?U.succeeded+U.failed:0;if(!U||oe>=U.total){O.value={total:P,succeeded:0,failed:0};return}O.value={...U,total:U.total+P}}function Dt(P){const U=O.value;U&&(O.value={...U,succeeded:U.succeeded+(P==="success"?1:0),failed:U.failed+(P==="failure"?1:0)})}function Hn(){return`${Date.now()}-${Math.random().toString(36).slice(2)}`}function to(P){const U=new Date,oe=[U.getFullYear(),String(U.getMonth()+1).padStart(2,"0"),String(U.getDate()).padStart(2,"0"),String(U.getHours()).padStart(2,"0"),String(U.getMinutes()).padStart(2,"0"),String(U.getSeconds()).padStart(2,"0")].join("-"),xe=P.type.startsWith("image/")&&P.type.slice(6).replace(/[^a-z0-9]+/gi,"")||"png";return`pasted-image-${oe}.${xe}`}function ga(){const P=new Date;return`pasted-text-${[P.getFullYear(),String(P.getMonth()+1).padStart(2,"0"),String(P.getDate()).padStart(2,"0"),String(P.getHours()).padStart(2,"0"),String(P.getMinutes()).padStart(2,"0"),String(P.getSeconds()).padStart(2,"0")].join("-")}.txt`}function bo(P){return P.name.trim()?P:new File([P],to(P),{type:P.type||"image/png",lastModified:Date.now()})}async function no(P,U){if(Ht(U))try{const oe=bo(P),xe=await Vu(oe);if(U!==qe)return;if(!xe){Dt("failure");return}l.value=[...l.value,{id:Hn(),name:oe.name,url:`/codex-local-image?path=${encodeURIComponent(xe)}`}],Dt("success")}catch{U===qe&&Dt("failure")}finally{jt(U)}}async function _o(P,U){if(Ht(U))try{const oe=await Vu(P);if(U!==qe)return;if(!oe){Dt("failure");return}Ot(oe),Dt("success")}catch{U===qe&&Dt("failure")}finally{jt(U)}}function on(P){const U=wo(P);if(U.length===0)return;Kt(U.length),De.value=!1,Qt();const oe=qe;for(const xe of U)eo(xe)?no(xe,oe):_o(xe,oe)}function _r(){Ge=0,q.value=!1}function er(P){return P?Array.from(P.types??[]).includes("Files"):!1}async function tr(P){if(!P||P.length===0)return;const U=rt.value,oe=Array.from(P),vt=(oe[0].webkitRelativePath||oe[0].name).split("/").filter(Boolean)[0]||"Folder",dn=`${Date.now()}-${Math.random().toString(36).slice(2)}`;g.value=[...g.value,{id:dn,name:vt,total:oe.length,processed:0,filePaths:[],isUploading:!0}];const Gn=zt=>{U===rt.value&&(g.value=g.value.map(rn=>rn.id===dn?zt(rn):rn))};for(const zt of oe)try{const rn=await Vu(zt);if(U!==rt.value)return;if(rn){const En=zt.webkitRelativePath||zt.name;Ot(rn,En),Gn(ar=>({...ar,processed:ar.processed+1,filePaths:[...ar.filePaths,rn]}));continue}Gn(En=>({...En,processed:En.processed+1}))}catch{Gn(rn=>({...rn,processed:rn.processed+1}))}Gn(zt=>({...zt,isUploading:!1}))}function Mr(P){P&&(P.value="")}function To(P){const U=P.target;on((U==null?void 0:U.files)??null),Mr(U),De.value=!1}function Wn(P){const U=P.target;on((U==null?void 0:U.files)??null),Mr(U),De.value=!1}function $r(P){const U=P.target;tr((U==null?void 0:U.files)??null),Mr(U),De.value=!1}function Tr(P){pe.value||!er(P.dataTransfer)||(P.preventDefault(),Ge+=1,q.value=!0)}function ko(P){pe.value||!er(P.dataTransfer)||(P.preventDefault(),P.dataTransfer&&(P.dataTransfer.dropEffect="copy"),q.value=!0)}function $t(P){q.value&&(P.preventDefault(),Ge=Math.max(0,Ge-1),Ge===0&&_r())}function Yt(P){var U;pe.value||!er(P.dataTransfer)||(P.preventDefault(),_r(),on(((U=P.dataTransfer)==null?void 0:U.files)??null))}function _t(){!q.value&&Ge===0||_r()}function zn(P){var dn,Gn;if(pe.value)return;const U=((dn=P.clipboardData)==null?void 0:dn.getData("text/plain"))??"";if(U.length>=rx){P.preventDefault();const zt=new File([U],ga(),{type:"text/plain",lastModified:Date.now()});on([zt]);return}const oe=Array.from(((Gn=P.clipboardData)==null?void 0:Gn.items)??[]);if(oe.length===0)return;const xe=U.length>0,vt=oe.filter(zt=>zt.kind==="file"&&zt.type.startsWith("image/")).map(zt=>zt.getAsFile()).filter(zt=>zt instanceof File);vt.length!==0&&(xe||P.preventDefault(),on(vt))}function cn(){_.value&&(_.value=""),Nr()}function an(P){if(Ce.value){if(P.key==="Escape"){P.preventDefault(),Qt();return}if(P.key==="ArrowDown"){P.preventDefault(),Ne.value.length>0&&(Ye.value=(Ye.value+1)%Ne.value.length);return}if(P.key==="ArrowUp"){if(P.preventDefault(),Ne.value.length>0){const oe=Ne.value.length;Ye.value=(Ye.value+oe-1)%oe}return}if(P.key==="Enter"||P.key==="Tab"){P.preventDefault();const oe=Ne.value[Ye.value];oe?rr(oe):Qt();return}}if(r.sendWithEnter!==!1?P.key==="Enter"&&!P.shiftKey:P.key==="Enter"&&(P.metaKey||P.ctrlKey)){P.preventDefault(),z(r.isTurnInProgress?Ee.value:"steer");return}}function Qt(){Ce.value=!1,Be.value=null,ze.value="",Ne.value=[],Ye.value=0}function Nr(){const P=se.value;if(!P){Qt();return}const U=P.selectionStart??s.value.length,xe=s.value.slice(0,U).match(/(^|\s)(@[^\s@]*)$/);if(!xe){Qt();return}const vt=xe[2]??"",dn=vt.length,Gn=U-dn;Be.value=Gn,ze.value=vt.slice(1),Ce.value=!0,nr()}async function nr(){if(!Ce.value)return;const P=(r.cwd??"").trim();if(!P){Ne.value=[];return}Le&&clearTimeout(Le);const U=++Ve;Le=setTimeout(async()=>{try{const oe=await V_(P,ze.value,20);if(!Ce.value||U!==Ve)return;Ne.value=oe,Ye.value=0}catch{if(!Ce.value||U!==Ve)return;Ne.value=[]}},120)}function rr(P){const U=se.value,oe=Be.value;if(oe!==null&&U){const xe=U.selectionStart??s.value.length;s.value=`${s.value.slice(0,oe)}${s.value.slice(xe)}`.trimEnd()}Ot(P.path),Qt(),Zt(()=>U==null?void 0:U.focus())}function Co(P){he(),X(P),Zt(()=>{var U;return(U=se.value)==null?void 0:U.focus()})}function Wt(P){const U=P.trim();U&&(he(),s.value.trim().length>0?s.value=`${s.value.trimEnd()}
49
+ ${U}`:s.value=U,Zt(()=>{var oe;return(oe=se.value)==null?void 0:oe.focus()}))}async function kr(){p.value=await aT()}function kt(P){return`${Ku}${P}`}function St(P){return P.startsWith(Ku)?P.slice(Ku.length):null}async function An(){var xe;const P=((xe=window.prompt(o("Prompt name")))==null?void 0:xe.trim())??"";if(!P)return;const U=window.prompt(o("Prompt content"))??"";if(!U.trim())return;const oe=await sT(P,U);oe&&(await kr(),Wt(oe.content))}async function wn(P){const U=St(P)??P,oe=p.value.find(dn=>dn.path===U);!window.confirm(oe?`${o("Remove prompt")} "${oe.name}"?`:o("Remove prompt"))||!await iT(U)||await kr()}function nn(P){const U=p.value.find(oe=>oe.path===P);U&&Wt(U.content)}function Lr(P){const U=P.lastIndexOf("/");return U<0?P:P.slice(U+1)}function Or(P){const U=P.lastIndexOf("/");return U<=0?"":P.slice(0,U)}function bn(P){const U=Lr(P),oe=U.lastIndexOf(".");return oe<=0?"":U.slice(oe+1).toLowerCase()}function jr(P){const U=bn(P);return U==="ts"?"TS":U==="tsx"?"TSX":U==="js"?"JS":U==="jsx"?"JSX":U==="json"?"{}":""}function Dr(P){const U=bn(P);return U.startsWith("ts")?"ts":U.startsWith("js")?"js":U==="json"?"json":"default"}function Vn(P){const U=bn(P);return U==="md"||U==="mdx"}function In(P){return P.path.toLowerCase().includes("/plugins/cache/")?{badge:"P",badgeLabel:"Plugin",badgeTone:"plugin"}:P.scope==="repo"?{badge:"R",badgeLabel:"Repo",badgeTone:"repo"}:P.scope==="system"?{badge:"S",badgeLabel:"System",badgeTone:"system"}:{badge:"U",badgeLabel:"User",badgeTone:"user"}}function Ft(P,U){const oe=St(P);if(oe){nn(oe);return}if(U){const xe=(r.skills??[]).find(vt=>vt.path===P);xe&&!c.value.some(vt=>vt.path===P)&&(c.value=[...c.value,xe])}else c.value=c.value.filter(xe=>xe.path!==P)}function or(P){if(!De.value)return;const U=Re.value;if(!U)return;const oe=P.target;!oe||U.contains(oe)||(De.value=!1)}return ma(()=>{document.addEventListener("click",or),window.addEventListener("drop",_t),window.addEventListener("dragend",_t),window.addEventListener("blur",_t),kr()}),t({hydrateDraft:Co,appendTextToDraft:Wt,hasUnsavedDraft:()=>Q.value}),Da(()=>{document.removeEventListener("click",or),window.removeEventListener("drop",_t),window.removeEventListener("dragend",_t),window.removeEventListener("blur",_t),window.removeEventListener("pointerup",Sn),window.removeEventListener("pointercancel",Sn),window.removeEventListener("blur",Sn),Le&&clearTimeout(Le)}),ht(()=>r.activeThreadId,P=>{he(),ne&&Tt(ne,Cn()),ve();const U=He(P);U&&(X(U),cn()),ne=P.trim()},{immediate:!0}),ht([s,l,f,c],()=>{ne&&Tt(ne,Cn())},{deep:!0}),ht(()=>r.cwd,()=>{Ce.value&&nr()}),ht($e,P=>{Ee.value=P}),(P,U)=>(C(),E("form",{class:"thread-composer",onSubmit:U[4]||(U[4]=Ze(oe=>z(e.isTurnInProgress?Ee.value:"steer"),["prevent"]))},[pt.value?(C(),E("p",iS,M(pt.value),1)):Z("",!0),m("div",{class:tt(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove,"thread-composer-shell--drag-active":q.value}])},[l.value.length>0?(C(),E("div",lS,[(C(!0),E(Qe,null,en(l.value,oe=>(C(),E("div",{key:oe.id,class:"thread-composer-attachment"},[m("img",{class:"thread-composer-attachment-image",src:oe.url,alt:oe.name||"Selected image"},null,8,uS),m("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${oe.name||"image"}`,disabled:pe.value,onClick:xe=>yo(oe.id)}," x ",8,cS)]))),128))])):Z("",!0),g.value.length>0?(C(),E("div",dS,[(C(!0),E(Qe,null,en(g.value,oe=>(C(),E("span",{key:oe.id,class:"thread-composer-folder-chip"},[je(nd,{class:"thread-composer-folder-chip-icon"}),m("span",{class:"thread-composer-folder-chip-name",title:oe.name},M(oe.name),9,fS),m("span",hS,[oe.isUploading?(C(),E(Qe,{key:0},[is(M(br(oe))+"% uploading ("+M(oe.processed)+"/"+M(oe.total)+") ",1)],64)):(C(),E(Qe,{key:1},[is(M(oe.filePaths.length)+" file"+M(oe.filePaths.length===1?"":"s"),1)],64))]),m("button",{class:"thread-composer-folder-chip-remove",type:"button","aria-label":`Remove folder ${oe.name}`,disabled:pe.value,onClick:xe=>vn(oe.id)},"×",8,pS)]))),128))])):Z("",!0),le.value.length>0?(C(),E("div",mS,[(C(!0),E(Qe,null,en(le.value,oe=>(C(),E("span",{key:oe.fsPath,class:"thread-composer-file-chip"},[je(Ds,{class:"thread-composer-file-chip-icon"}),m("span",{class:"thread-composer-file-chip-name",title:oe.fsPath},M(oe.label),9,vS),m("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${oe.label}`,disabled:pe.value,onClick:xe=>qn(oe.fsPath)},"×",8,gS)]))),128))])):Z("",!0),c.value.length>0?(C(),E("div",yS,[(C(!0),E(Qe,null,en(c.value,oe=>(C(),E("span",{key:oe.path,class:"thread-composer-skill-chip"},[m("button",{class:"thread-composer-skill-chip-name",type:"button",title:jn(oe.path),"aria-label":`Open ${oe.displayName||oe.name} SKILL.md`,onClick:xe=>dt(oe)},M(oe.displayName||oe.name),9,wS),m("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${oe.displayName||oe.name}`,onClick:xe=>xn(oe.path)},"×",8,bS)]))),128))])):Z("",!0),m("div",{class:tt(["thread-composer-input-wrap",{"thread-composer-input-wrap--drag-active":q.value}]),onDragenter:Tr,onDragover:ko,onDragleave:$t,onDrop:Yt},[q.value?(C(),E("div",_S,[...U[5]||(U[5]=[m("span",{class:"thread-composer-drop-overlay-copy"},"Drop images or files",-1)])])):Z("",!0),Ce.value?(C(),E("div",TS,[Ne.value.length>0?(C(!0),E(Qe,{key:0},en(Ne.value,(oe,xe)=>(C(),E("button",{key:oe.path,class:tt(["thread-composer-file-mention-row",{"is-active":xe===Ye.value}]),type:"button",onMousedown:Ze(vt=>rr(oe),["prevent"])},[jr(oe.path)?(C(),E("span",{key:0,class:tt(["thread-composer-file-mention-icon-badge",`is-${Dr(oe.path)}`])},M(jr(oe.path)),3)):Vn(oe.path)?(C(),E("span",CS,"↓")):(C(),et(Ds,{key:2,class:"thread-composer-file-mention-icon-file"})),m("span",SS,[m("span",xS,M(Lr(oe.path)),1),Or(oe.path)?(C(),E("span",AS,M(Or(oe.path)),1)):Z("",!0)])],42,kS))),128)):(C(),E("div",IS,M(S(o)("No matching files")),1))])):Z("",!0),ln(m("textarea",{ref_key:"inputRef",ref:se,"onUpdate:modelValue":U[0]||(U[0]=oe=>s.value=oe),class:"thread-composer-input",placeholder:yt.value,disabled:pe.value,onInput:cn,onKeydown:an,onPaste:zn},null,40,ES),[[mn,s.value]])],34),m("div",{class:tt(["thread-composer-controls",{"thread-composer-controls--recording":at.value}])},[m("div",{ref_key:"attachMenuRootRef",ref:Re,class:"thread-composer-attach"},[m("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":S(o)("Add photos & files"),disabled:pe.value,onClick:un}," + ",8,PS),De.value?(C(),E("div",RS,[m("button",{class:"thread-composer-attach-item",type:"button",disabled:pe.value,onClick:Zr},M(S(o)("Add photos & files")),9,MS),m("button",{class:"thread-composer-attach-item",type:"button",disabled:pe.value,onClick:On},M(S(o)("Add folder")),9,$S),m("button",{class:"thread-composer-attach-item",type:"button",disabled:pe.value,onClick:Rr},M(S(o)("Take photo")),9,NS),U[6]||(U[6]=m("div",{class:"thread-composer-attach-separator"},null,-1)),m("div",LS,[m("span",OS,M(S(o)("In-progress send")),1),m("div",jS,[m("button",{class:tt(["thread-composer-attach-mode-button",{"is-active":Ee.value==="steer"}]),type:"button",disabled:pe.value,onClick:U[1]||(U[1]=oe=>H("steer"))},M(S(o)("Steer")),11,DS),m("button",{class:tt(["thread-composer-attach-mode-button",{"is-active":Ee.value==="queue"}]),type:"button",disabled:pe.value,onClick:U[2]||(U[2]=oe=>H("queue"))},M(S(o)("Queue")),11,FS)])]),U[7]||(U[7]=m("div",{class:"thread-composer-attach-separator"},null,-1)),we.value?(C(),E("button",{key:0,class:"thread-composer-attach-setting",type:"button",role:"switch","aria-checked":e.selectedSpeedMode==="fast","aria-label":`${S(o)("Fast mode")} ${e.selectedSpeedMode==="fast"?S(o)("enabled"):S(o)("disabled")}`,disabled:Oe.value,onClick:wr},[m("span",BS,[m("span",qS,M(S(o)("Fast mode")),1),m("span",HS,M(ge.value),1)]),m("span",{class:tt(["thread-composer-attach-switch",{"is-on":e.selectedSpeedMode==="fast","is-busy":e.isUpdatingSpeedMode,"is-disabled":Oe.value}])},null,2)],8,US)):Z("",!0),m("button",{class:"thread-composer-attach-setting",type:"button",role:"switch","aria-checked":Ke.value,"aria-label":Ke.value?S(o)("Disable plan mode"):S(o)("Enable plan mode"),disabled:be.value,onClick:Wo},[m("span",zS,[m("span",VS,M(S(o)("Plan mode")),1),m("span",GS,M(S(o)("Agent proposes a plan before acting")),1)]),m("span",{class:tt(["thread-composer-attach-switch",{"is-on":Ke.value}])},null,2)],8,WS)])):Z("",!0)],512),at.value?Z("",!0):(C(),E(Qe,{key:0},[je(Wr,{class:"thread-composer-control","model-value":e.selectedModel,options:Fe.value,"selected-prefix-icon":de.value?_l:null,placeholder:S(o)("Model"),"open-direction":"up",disabled:be.value||e.models.length===0,"enable-search":"","search-placeholder":S(o)("Search models..."),"onUpdate:modelValue":Nn},null,8,["model-value","options","selected-prefix-icon","placeholder","disabled","search-placeholder"]),je(sS,{class:"thread-composer-control",options:V.value,"selected-values":R.value,placeholder:S(o)("Skills"),"search-placeholder":S(o)("Search skills and prompts..."),"create-label":S(o)("Add new prompt"),"allow-remove":!0,"remove-label":S(o)("Remove prompt"),"open-direction":"up",disabled:be.value,onToggle:Ft,onCreate:An,onRemove:wn},null,8,["options","selected-values","placeholder","search-placeholder","create-label","remove-label","disabled"]),je(Wr,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:Se,placeholder:S(o)("Thinking"),"open-direction":"up",disabled:be.value,"onUpdate:modelValue":Ln},null,8,["model-value","placeholder","disabled"])],64)),m("div",{class:tt(["thread-composer-actions",{"thread-composer-actions--recording":at.value}])},[S(ee)==="recording"?(C(),E("div",KS,[m("canvas",{ref_key:"dictationWaveformCanvasRef",ref:K,class:"thread-composer-dictation-waveform"},null,512)])):Z("",!0),S(ee)==="recording"?(C(),E("span",YS,M(bt.value),1)):Z("",!0),S(D)?(C(),E("button",{key:2,class:tt(["thread-composer-mic",{"thread-composer-mic--active":S(ee)==="recording"}]),type:"button","aria-label":mt.value,title:mt.value,disabled:pe.value,onClick:zr,onPointerdown:go,onPointerup:Sn,onPointercancel:Sn},[S(ee)==="recording"?(C(),et(ph,{key:0,class:"thread-composer-mic-icon thread-composer-mic-icon--stop"})):(C(),et(j1,{key:1,class:"thread-composer-mic-icon"}))],42,QS)):Z("",!0),e.isTurnInProgress&&!F.value?(C(),E("button",{key:3,class:"thread-composer-stop",type:"button","aria-label":e.isStopPending?S(o)("Saving thread before stop is available"):S(o)("Stop"),title:e.isStopPending?S(o)("Saving thread before stop is available"):S(o)("Stop"),disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn||e.isStopPending,onClick:Zn},[e.isStopPending?(C(),E("span",XS)):(C(),et(ph,{key:1,class:"thread-composer-stop-icon"}))],8,JS)):(C(),E("button",{key:4,class:tt(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&Ee.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&Ee.value==="queue"?S(o)("Queue message"):S(o)("Send message"),title:e.isTurnInProgress?`${S(o)("Send")} ${Ee.value==="queue"?S(o)("Queue"):S(o)("Steer")}`:S(o)("Send"),disabled:!ie.value,onClick:U[3]||(U[3]=oe=>z(e.isTurnInProgress?Ee.value:"steer"))},[je(P1,{class:"thread-composer-submit-icon"})],10,ZS))],2)],2)],2),m("input",{ref_key:"photoLibraryInputRef",ref:G,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:pe.value,onChange:To},null,40,ex),m("input",{ref_key:"cameraCaptureInputRef",ref:ye,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:pe.value,onChange:Wn},null,40,tx),m("input",{ref_key:"folderPickerInputRef",ref:ke,class:"thread-composer-hidden-input",type:"file",multiple:"",webkitdirectory:"",directory:"",disabled:pe.value,onChange:$r},null,40,nx)],32))}}),mh=At(ax,[["__scopeId","data-v-4043f8f1"]]),sx={key:0,class:"thread-pending-request"},ix={class:"thread-pending-request-title"},lx=["title"],ux={class:"thread-pending-request-approval"},cx=["aria-label"],dx=["aria-pressed","onClick"],fx={class:"thread-pending-request-option-index"},hx={class:"thread-pending-request-option-label"},px={class:"thread-pending-request-footer thread-pending-request-footer--approval"},mx=["value","placeholder"],vx={class:"thread-pending-request-header"},gx={class:"thread-pending-request-heading"},yx={class:"thread-pending-request-eyebrow"},wx={class:"thread-pending-request-title"},bx={key:0,class:"thread-pending-request-counter"},_x={key:0,class:"thread-pending-request-preview"},Tx={class:"thread-pending-request-preview-code"},kx={key:1,class:"thread-pending-request-user-input"},Cx={key:0,class:"thread-pending-request-question-description"},Sx=["href"],xx={class:"thread-pending-request-question-title"},Ax={key:0},Ix={key:0,class:"thread-pending-request-question-text"},Ex={key:1,class:"thread-pending-request-input-wrap"},Px={class:"thread-pending-request-select-label"},Rx=["type","value","onInput"],Mx={key:2,class:"thread-pending-request-select-wrap"},$x={class:"thread-pending-request-select-label"},Nx={key:3,class:"thread-pending-request-select-wrap"},Lx={class:"thread-pending-request-select-label"},Ox={key:4,class:"thread-pending-request-question-options"},jx=["checked","onChange"],Dx={class:"thread-pending-request-checkbox-label"},Fx={key:2,class:"thread-pending-request-validation-error"},Ux={class:"thread-pending-request-footer"},Bx={key:2,class:"thread-pending-request-user-input"},qx={class:"thread-pending-request-question-title"},Hx={key:0,class:"thread-pending-request-question-text"},Wx={key:1,class:"thread-pending-request-question-options"},zx={class:"thread-pending-request-select-wrap"},Vx={class:"thread-pending-request-select-label"},Gx={key:0,class:"thread-pending-request-question-description"},Kx={key:2,class:"thread-pending-request-input-wrap"},Yx={class:"thread-pending-request-select-label"},Qx=["value","placeholder","onInput"],Jx={class:"thread-pending-request-footer"},Xx={key:3,class:"thread-pending-request-actions"},Zx={key:4,class:"thread-pending-request-actions"},eA=Bn({__name:"ThreadPendingRequestPanel",props:{request:{},requestCount:{},hasQueueAbove:{type:Boolean}},emits:["respondServerRequest"],setup(e,{emit:t}){const n=e,r=t,a=A("accept"),o=A(""),s=A({}),l=A({}),c=A({}),p=A(""),{t:f}=Fa();function g(F){return F!==null&&typeof F=="object"&&!Array.isArray(F)?F:null}function _(F){return typeof F=="string"?F.trim():""}function I(F){return typeof F=="string"?F:null}function O(F){return/^[A-Za-z0-9_./:@%+=,-]+$/.test(F)?F:JSON.stringify(F)}function q(F){const H=(Array.isArray(F.commandActions)?F.commandActions:[]).map(X=>g(X)).map(X=>_(X==null?void 0:X.command)).find(X=>X.length>0);if(H)return H.replace(/\s+/g," ").trim();if(Array.isArray(F.command)){const X=F.command.filter(ve=>typeof ve=="string").map(ve=>ve.trim()).filter(ve=>ve.length>0);if(X.length>0)return X.map(ve=>O(ve)).join(" ")}return Re(_(F.command))}function ee(F){return F.method==="item/commandExecution/requestApproval"||F.method==="execCommandApproval"}function D(F){return F.method==="item/fileChange/requestApproval"||F.method==="applyPatchApproval"}function j(F){return F.method==="item/permissions/requestApproval"}function K(F){return ee(F)||D(F)||j(F)}function te(F){return F.method==="mcpServer/elicitation/request"}function _e(F){const z=g(F.params);return _(z==null?void 0:z.reason)||_(z==null?void 0:z.prompt)||_(z==null?void 0:z.message)}function fe(F){return K(F)?"Awaiting approval":te(F)?"MCP server input required":F.method==="item/tool/requestUserInput"?"Awaiting response":F.method==="item/tool/call"?"Tool call waiting for response":F.method}function he(F){const z=_e(F);return z||(ee(F)?"Do you want to run this command?":D(F)?"Do you want to make these changes?":j(F)?"Do you want to grant these permissions?":te(F)?"An MCP server needs your input before Codex can continue.":F.method==="item/tool/requestUserInput"?"Codex needs your answer before it can continue.":"Codex is waiting for a response before it can continue.")}function Re(F){var Ie;const z=F.trim();if(!z)return"";const H=z.match(/-Command\s+(.+)$/i),X=((Ie=H==null?void 0:H[1])==null?void 0:Ie.trim())??z;return(X.startsWith('"')&&X.endsWith('"')?X.slice(1,-1):X).replace(/\\"/g,'"').replace(/`"/g,'"').replace(/""/g,'"').replace(/\s+/g," ").trim()}function G(F){const z=g(F.params);if(!z)return"";if(ee(F))return q(z);if(D(F)){const H=_(z.grantRoot)||_(z.grant_root);if(H)return H.replace(/\s+/g," ").trim();const X=g(z.fileChanges)??g(z.changes);if(!X)return"";const ve=Object.keys(X).map(Ie=>Ie.trim()).filter(Ie=>Ie.length>0);return ve.length===0?"":ve.slice(0,3).join(", ")}return j(F)?ye(z.permissions):te(F)?_(z.serverName)||_(z.url):""}function ye(F){const z=g(F);if(!z)return"";const H=[],X=g(z.fileSystem),ve=g(z.network),Ie=Array.isArray(X==null?void 0:X.read)?X.read.filter(Tt=>typeof Tt=="string"):[],He=Array.isArray(X==null?void 0:X.write)?X.write.filter(Tt=>typeof Tt=="string"):[];return Ie.length>0&&H.push(`Read: ${Ie.join(", ")}`),He.length>0&&H.push(`Write: ${He.join(", ")}`),(ve==null?void 0:ve.enabled)===!0&&H.push("Network access"),H.join(" • ")}function ke(F){return!F||!K(F)?[]:[{id:"accept",label:"Yes"},{id:"acceptForSession",label:"Yes for Session"}]}const se=ae(()=>ke(n.request));ht(()=>{var F;return((F=n.request)==null?void 0:F.id)??0},()=>{var F;o.value="",s.value={},l.value={},c.value={},p.value="",a.value=((F=se.value[0])==null?void 0:F.id)??"accept"},{immediate:!0}),ht(se,F=>{var z;a.value!=="decline"&&(F.some(H=>H.id===a.value)||(a.value=((z=F[0])==null?void 0:z.id)??"accept"))},{immediate:!0});function Te(F,z){return`${String(F)}:${z}`}function De(F){const z=g(F.params),H=Array.isArray(z==null?void 0:z.questions)?z.questions:[],X=[];for(const ve of H){const Ie=g(ve);if(!Ie)continue;const He=_(Ie.id);if(!He)continue;const Tt=Array.isArray(Ie.options)?Ie.options.map(qt=>g(qt)).map(qt=>({label:_(qt==null?void 0:qt.label),description:_(qt==null?void 0:qt.description)})).filter(qt=>qt.label.length>0):[];X.push({id:He,header:_(Ie.header),question:_(Ie.question),isOther:Ie.isOther===!0,options:Tt})}return X}function Be(F,z,H){const X=Te(F,z),ve=s.value[X];return typeof ve=="string"&&ve.length>0?ve:H}function ze(F){return F.map(z=>({value:z.label,label:z.label}))}function Ne(F,z){return l.value[Te(F,z)]??""}function Ce(F,z,H){const X=Te(F,z);s.value={...s.value,[X]:H}}function Ye(F,z,H){const X=H.target;if(!(X instanceof HTMLInputElement))return;const ve=Te(F,z);l.value={...l.value,[ve]:X.value}}function rt(F,z,H){var ve,Ie;const X=Be(F,z,((ve=H[0])==null?void 0:ve.label)||"");return((Ie=H.find(He=>He.label===X))==null?void 0:Ie.description)??""}function Ve(F,z){return`${String(F)}:${z}`}function Le(F){var z;return _((z=g(F.params))==null?void 0:z.serverName)}function gt(F){var H;const z=_((H=g(F.params))==null?void 0:H.url);if(!z)return"";try{const X=new URL(z),ve=X.protocol.toLowerCase();return ve==="https:"||ve==="http:"?X.toString():""}catch{return""}}function Ge(F){const z=g(F.params),H=g(z==null?void 0:z.requestedSchema),X=g(H==null?void 0:H.properties);if(!X)return[];const ve=new Set(Array.isArray(H==null?void 0:H.required)?H.required.filter(Ie=>typeof Ie=="string"):[]);return Object.entries(X).map(([Ie,He])=>qe(Ie,g(He),ve.has(Ie))).filter(Ie=>Ie!==null)}function qe(F,z,H){if(!z)return null;const X=_(z.title)||F,ve=_(z.description),Ie=_(z.type);if(Ie==="boolean")return{key:F,label:X,description:ve,required:H,kind:"boolean",inputType:"checkbox",options:[],defaultValue:typeof z.default=="boolean"?z.default:null,hasExplicitDefault:typeof z.default=="boolean"};if(Ie==="number"||Ie==="integer")return{key:F,label:X,description:ve,required:H,kind:"number",inputType:"number",options:[],defaultValue:typeof z.default=="number"?z.default:null,hasExplicitDefault:typeof z.default=="number"};const He=wt(z);if(Ie==="array")return{key:F,label:X,description:ve,required:H,kind:"multiEnum",inputType:"checkbox",options:He,defaultValue:Array.isArray(z.default)?z.default.filter(qt=>typeof qt=="string"):[],hasExplicitDefault:Array.isArray(z.default)};const Tt=I(z.default);return He.length>0?{key:F,label:X,description:ve,required:H,kind:"singleEnum",inputType:"select",options:He,defaultValue:Tt,hasExplicitDefault:Tt!==null}:{key:F,label:X,description:ve,required:H,kind:"string",inputType:ne(z),options:[],defaultValue:Tt,hasExplicitDefault:Tt!==null}}function wt(F){const H=(Array.isArray(F.oneOf)?F.oneOf:Array.isArray(F.anyOf)?F.anyOf:[]).map(He=>g(He)).map(He=>({value:_(He==null?void 0:He.const),label:_(He==null?void 0:He.title)||_(He==null?void 0:He.const)})).filter(He=>He.value.length>0);if(H.length>0)return H;const X=g(F.items);if(X){const He=wt(X);if(He.length>0)return He}const ve=Array.isArray(F.enum)?F.enum.filter(He=>typeof He=="string"):[],Ie=Array.isArray(F.enumNames)?F.enumNames.filter(He=>typeof He=="string"):[];return ve.map((He,Tt)=>({value:He,label:Ie[Tt]||He}))}function ne(F){const z=_(F.format);return z==="email"?"email":z==="uri"?"url":z==="date"?"date":z==="date-time"?"datetime-local":"text"}function Se(F,z){const H=c.value[Ve(F,z.key)];return H!==void 0?H:z.defaultValue}function Ae(F,z){const H=Se(F,z);return Array.isArray(H)?H.filter(X=>typeof X=="string"):[]}function Fe(F,z,H){const X=H.target;!(X instanceof HTMLInputElement)&&!(X instanceof HTMLSelectElement)||Ke(F,z,X.value)}function Ke(F,z,H){const X=(z.kind==="number",H);c.value={...c.value,[Ve(F,z.key)]:H.length>0?X:null},p.value=""}function x(F,z,H){let X=null;H==="true"?X=!0:H==="false"&&(X=!1),c.value={...c.value,[Ve(F,z.key)]:X},p.value=""}function R(F){return[...F.hasExplicitDefault?[]:[{value:"",label:f("Select true or false")}],{value:"true",label:f("True")},{value:"false",label:f("False")}]}function V(F){return[...F.hasExplicitDefault?[]:[{value:"",label:f("Select an option")}],...F.options]}function ie(F,z,H,X){const ve=X.target;if(!(ve instanceof HTMLInputElement))return;const Ie=new Set(Ae(F,z));ve.checked?Ie.add(H):Ie.delete(H),c.value={...c.value,[Ve(F,z.key)]:Array.from(Ie)},p.value=""}function Q(F){return F===!0?"true":F===!1?"false":""}function le(F,z){const H=Se(F,z);return z.kind==="multiEnum"?Array.isArray(H)&&H.length>0:z.kind==="boolean"?typeof H=="boolean":z.kind==="number"&&typeof H=="number"?!0:typeof H=="string"&&H.trim().length>0}function pe(F){const z=Ge(F).filter(H=>H.required&&!le(F.id,H)).map(H=>H.label);return z.length===0?"":z.length===1?`Answer the required field: ${z[0]}.`:`Answer the required fields: ${z.join(", ")}.`}function be(F){const z={};for(const H of Ge(F)){const X=Se(F.id,H);if(H.kind==="multiEnum"){const Ie=Array.isArray(X)?X:[];(Ie.length>0||H.required)&&(z[H.key]=Ie);continue}if(H.kind==="boolean"){typeof X=="boolean"&&(z[H.key]=X);continue}if(H.kind==="number"){const Ie=typeof X=="number"?X:Number(String(X).trim());Number.isNaN(Ie)||(z[H.key]=Ie);continue}const ve=String(X??"").trim();(ve.length>0||H.required)&&(z[H.key]=ve)}return z}function we(F){a.value=F}function de(){a.value="decline"}function Oe(F){const z=F.target;z instanceof HTMLInputElement&&(o.value=z.value,a.value="decline")}function ge(F,z){var H;if(j(F)){if(z==="decline"||z==="cancel"){r("respondServerRequest",{id:F.id,error:{code:-32e3,message:z==="cancel"?"Cancelled from CodexUI.":"Declined from CodexUI."}});return}const X=g((H=g(F.params))==null?void 0:H.permissions)??{};r("respondServerRequest",{id:F.id,result:{permissions:X,scope:z==="acceptForSession"?"session":"turn"}});return}r("respondServerRequest",{id:F.id,result:{decision:z}})}function $e(F){const z=o.value.trim(),H=z.length>0?"decline":a.value;if(j(F)){ge(F,H);return}r("respondServerRequest",{id:F.id,result:{decision:H},followUpMessageText:z||void 0})}function Ee(F,z){const H=g(F.params),X={action:z};if(z==="accept"&&_(H==null?void 0:H.mode)==="form"){const ve=pe(F);if(ve){p.value=ve;return}X.content=be(F)}r("respondServerRequest",{id:F.id,result:X})}function at(F){var X;const z=De(F),H={};for(const ve of z){const Ie=Be(F.id,ve.id,((X=ve.options[0])==null?void 0:X.label)||""),He=Ne(F.id,ve.id).trim(),Tt=[Ie,He].map(qt=>qt.trim()).filter(qt=>qt.length>0);H[ve.id]={answers:Tt}}r("respondServerRequest",{id:F.id,result:{answers:H}})}function mt(F){r("respondServerRequest",{id:F.id,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from CodexUI."}]}})}function pt(F){r("respondServerRequest",{id:F.id,result:{success:!0,contentItems:[]}})}function bt(F){r("respondServerRequest",{id:F.id,result:{}})}function yt(F){r("respondServerRequest",{id:F.id,error:{code:-32e3,message:"Rejected from CodexUI."}})}return(F,z)=>e.request?(C(),E("section",sx,[m("article",{class:tt(["thread-pending-request-shell",{"thread-pending-request-shell--no-top-radius":e.hasQueueAbove}])},[K(e.request)?(C(),E(Qe,{key:0},[m("p",ix,M(he(e.request)),1),G(e.request)?(C(),E("p",{key:0,class:"thread-pending-request-command-line",title:G(e.request)},M(G(e.request)),9,lx)):Z("",!0),m("section",ux,[m("div",{class:"thread-pending-request-options",role:"radiogroup","aria-label":S(f)("Approval choices")},[(C(!0),E(Qe,null,en(se.value,(H,X)=>(C(),E("button",{key:H.id,type:"button",class:tt(["thread-pending-request-option",{"is-selected":a.value===H.id}]),"aria-pressed":a.value===H.id,onClick:ve=>we(H.id)},[m("span",fx,M(X+1)+".",1),m("span",hx,M(H.label),1)],10,dx))),128))],8,cx),m("footer",px,[m("label",{class:tt(["thread-pending-request-inline-input",{"is-active":a.value==="decline"||o.value.length>0}])},[z[11]||(z[11]=m("span",{class:"thread-pending-request-option-index"},"3.",-1)),m("input",{class:"thread-pending-request-inline-control",type:"text",value:o.value,placeholder:S(f)("No, and tell Codex what to do differently"),onFocus:de,onInput:Oe,onKeydown:z[0]||(z[0]=gn(Ze(H=>$e(e.request),["prevent"]),["enter"]))},null,40,mx)],2),m("button",{type:"button",class:"thread-pending-request-secondary",onClick:z[1]||(z[1]=H=>ge(e.request,"cancel"))},M(S(f)("Skip")),1),m("button",{type:"button",class:"thread-pending-request-primary",onClick:z[2]||(z[2]=H=>$e(e.request))},M(S(f)("Send")),1)])])],64)):(C(),E(Qe,{key:1},[m("header",vx,[m("div",gx,[m("p",yx,M(fe(e.request)),1),m("p",wx,M(he(e.request)),1)]),(e.requestCount??0)>1?(C(),E("span",bx,M(e.requestCount??0)+" pending",1)):Z("",!0)]),G(e.request)?(C(),E("div",_x,[m("code",Tx,M(G(e.request)),1)])):Z("",!0),e.request.method==="mcpServer/elicitation/request"?(C(),E("section",kx,[Le(e.request)?(C(),E("p",Cx,M(S(f)("Server"))+": "+M(Le(e.request)),1)):Z("",!0),gt(e.request)?(C(),E("a",{key:1,class:"thread-pending-request-link",href:gt(e.request),target:"_blank",rel:"noopener noreferrer"},M(S(f)("Open authorization link")),9,Sx)):Z("",!0),(C(!0),E(Qe,null,en(Ge(e.request),H=>(C(),E("div",{key:`${e.request.id}:${H.key}`,class:"thread-pending-request-question"},[m("p",xx,[is(M(H.label),1),H.required?(C(),E("span",Ax," *")):Z("",!0)]),H.description?(C(),E("p",Ix,M(H.description),1)):Z("",!0),H.kind==="string"||H.kind==="number"?(C(),E("label",Ex,[m("span",Px,M(S(f)("Value")),1),m("input",{class:"thread-pending-request-input",type:H.inputType,value:String(Se(e.request.id,H)??""),onInput:X=>Fe(e.request.id,H,X)},null,40,Rx)])):H.kind==="boolean"?(C(),E("label",Mx,[m("span",$x,M(S(f)("Choice")),1),je(Wr,{class:"thread-pending-request-select","model-value":Q(Se(e.request.id,H)),options:R(H),placeholder:S(f)("Select true or false"),"onUpdate:modelValue":X=>x(e.request.id,H,X)},null,8,["model-value","options","placeholder","onUpdate:modelValue"])])):H.kind==="singleEnum"?(C(),E("label",Nx,[m("span",Lx,M(S(f)("Choice")),1),je(Wr,{class:"thread-pending-request-select","model-value":String(Se(e.request.id,H)??""),options:V(H),placeholder:S(f)("Select an option"),"onUpdate:modelValue":X=>Ke(e.request.id,H,X)},null,8,["model-value","options","placeholder","onUpdate:modelValue"])])):(C(),E("div",Ox,[(C(!0),E(Qe,null,en(H.options,X=>(C(),E("label",{key:`${e.request.id}:${H.key}:${X.value}`,class:"thread-pending-request-checkbox-row"},[m("input",{class:"thread-pending-request-checkbox",type:"checkbox",checked:Ae(e.request.id,H).includes(X.value),onChange:ve=>ie(e.request.id,H,X.value,ve)},null,40,jx),m("span",Dx,M(X.label),1)]))),128))]))]))),128)),p.value?(C(),E("p",Fx,M(p.value),1)):Z("",!0),m("footer",Ux,[m("button",{type:"button",class:"thread-pending-request-secondary",onClick:z[3]||(z[3]=H=>Ee(e.request,"cancel"))},M(S(f)("Cancel")),1),m("button",{type:"button",class:"thread-pending-request-secondary",onClick:z[4]||(z[4]=H=>Ee(e.request,"decline"))},M(S(f)("Decline")),1),m("button",{type:"button",class:"thread-pending-request-primary",onClick:z[5]||(z[5]=H=>Ee(e.request,"accept"))},M(S(f)("Continue")),1)])])):e.request.method==="item/tool/requestUserInput"?(C(),E("section",Bx,[(C(!0),E(Qe,null,en(De(e.request),H=>{var X;return C(),E("div",{key:`${e.request.id}:${H.id}`,class:"thread-pending-request-question"},[m("p",qx,M(H.header||H.question),1),H.question?(C(),E("p",Hx,M(H.question),1)):Z("",!0),H.options.length>0?(C(),E("div",Wx,[m("label",zx,[m("span",Vx,M(S(f)("Choice")),1),je(Wr,{class:"thread-pending-request-select","model-value":Be(e.request.id,H.id,((X=H.options[0])==null?void 0:X.label)||""),options:ze(H.options),"onUpdate:modelValue":ve=>Ce(e.request.id,H.id,ve)},null,8,["model-value","options","onUpdate:modelValue"])]),rt(e.request.id,H.id,H.options)?(C(),E("p",Gx,M(rt(e.request.id,H.id,H.options)),1)):Z("",!0)])):Z("",!0),H.isOther?(C(),E("label",Kx,[m("span",Yx,M(S(f)("Other answer")),1),m("input",{class:"thread-pending-request-input",type:"text",value:Ne(e.request.id,H.id),placeholder:S(f)("Other answer"),onInput:ve=>Ye(e.request.id,H.id,ve)},null,40,Qx)])):Z("",!0)])}),128)),m("footer",Jx,[m("button",{type:"button",class:"thread-pending-request-primary",onClick:z[6]||(z[6]=H=>at(e.request))},M(S(f)("Send")),1)])])):e.request.method==="item/tool/call"?(C(),E("section",Xx,[m("button",{type:"button",class:"thread-pending-request-primary",onClick:z[7]||(z[7]=H=>mt(e.request))},M(S(f)("Fail Tool Call")),1),m("button",{type:"button",class:"thread-pending-request-secondary",onClick:z[8]||(z[8]=H=>pt(e.request))},M(S(f)("Success (Empty)")),1)])):(C(),E("section",Zx,[m("button",{type:"button",class:"thread-pending-request-primary",onClick:z[9]||(z[9]=H=>bt(e.request))},M(S(f)("Return Empty Result")),1),m("button",{type:"button",class:"thread-pending-request-secondary",onClick:z[10]||(z[10]=H=>yt(e.request))},M(S(f)("Reject Request")),1)]))],64))],2)])):Z("",!0)}}),tA=At(eA,[["__scopeId","data-v-7c342c87"]]),nA={key:0,class:"queued-messages"},rA={class:"queued-messages-inner"},oA=["onDragstart","onDragover","onDragleave","onDrop"],aA=["aria-label","title"],sA={class:"queued-row-text"},iA={class:"queued-row-actions"},lA=["title","onClick"],uA=["title","onClick"],cA=["aria-label","title","onClick"],dA=Bn({__name:"QueuedMessages",props:{messages:{}},emits:["edit","steer","delete","reorder"],setup(e,{emit:t}){const n=t,{t:r}=Fa(),a=A(""),o=A("");function s(_,I){var O;a.value=I,o.value="",(O=_.dataTransfer)==null||O.setData("text/plain",I),_.dataTransfer&&(_.dataTransfer.effectAllowed="move")}function l(_){!a.value||a.value===_||(o.value=_)}function c(_){o.value===_&&(o.value="")}function p(_){const I=a.value;f(),!(!I||I===_)&&n("reorder",{draggedId:I,targetId:_})}function f(){a.value="",o.value=""}function g(_){var j,K,te;const I=_.text.trim();if(I)return I;const O=[],q=((j=_.imageUrls)==null?void 0:j.length)??0,ee=((K=_.fileAttachments)==null?void 0:K.length)??0,D=((te=_.skills)==null?void 0:te.length)??0;return q>0&&O.push(`${q} ${r(q===1?"image":"images")}`),ee>0&&O.push(`${ee} ${r(ee===1?"file":"files")}`),D>0&&O.push(`${D} ${r(D===1?"skill":"skills")}`),O.join(", ")||r("(empty queued message)")}return(_,I)=>e.messages.length>0?(C(),E("div",nA,[m("div",rA,[(C(!0),E(Qe,null,en(e.messages,O=>(C(),E("div",{key:O.id,class:tt(["queued-row",{"is-dragging":a.value===O.id,"is-drop-target":o.value===O.id&&a.value!==O.id}]),draggable:"true",onDragstart:q=>s(q,O.id),onDragover:Ze(q=>l(O.id),["prevent"]),onDragleave:q=>c(O.id),onDrop:Ze(q=>p(O.id),["prevent"]),onDragend:f},[m("button",{class:"queued-row-drag",type:"button","aria-label":S(r)("Drag to reorder queued message"),title:S(r)("Drag to reorder queued message")},[...I[0]||(I[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,aA),I[2]||(I[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",sA,M(g(O)),1),m("div",iA,[m("button",{class:"queued-row-edit",type:"button",title:S(r)("Edit queued message"),onClick:q=>_.$emit("edit",O.id)},M(S(r)("Edit")),9,lA),m("button",{class:"queued-row-steer",type:"button",title:S(r)("Send now without interrupting work"),onClick:q=>_.$emit("steer",O.id)},M(S(r)("Steer")),9,uA),m("button",{class:"queued-row-delete",type:"button","aria-label":S(r)("Delete queued message"),title:S(r)("Delete queued message"),onClick:q=>_.$emit("delete",O.id)},[...I[1]||(I[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,cA)])],42,oA))),128))])])):Z("",!0)}}),fA=At(dA,[["__scopeId","data-v-b7a3edb8"]]),hA={key:0,class:"rate-limit-status","aria-live":"polite"},pA=["title"],mA={class:"rate-limit-card-header"},vA={class:"rate-limit-card-title"},gA={key:0,class:"rate-limit-card-plan"},yA={class:"rate-limit-card-metrics"},wA={key:0,class:"rate-limit-card-footer"},bA=Bn({__name:"RateLimitStatus",props:{snapshots:{}},setup(e){function t(D){var j,K;return((j=D.limitId)==null?void 0:j.trim())||((K=D.limitName)==null?void 0:K.trim())||"__default__"}function n(D){var j,K;return((j=D.limitName)==null?void 0:j.trim())||((K=D.limitId)==null?void 0:K.trim())||"Rate limits"}function r(D){const j=D.trim();return j?j.replace(/[_-]+/g," ").replace(/\b\w/g,K=>K.toUpperCase()):""}function a(D){return!D||D<=0?"Window":D%1440===0?`${D/1440}d`:D%60===0?`${D/60}h`:D<60?`${D}m`:`${Math.round(D/60*10)/10}h`}function o(D){const j=Math.max(0,Math.min(100,100-D));return`${Math.round(j)}% left`}function s(D){return`${Math.round(D)}%`}function l(D,j){return{key:j,label:`${a(D.windowDurationMins)} ${o(D.usedPercent)}`}}function c(D){const j=[];return D.primary&&j.push(l(D.primary,"primary")),D.secondary&&j.push(l(D.secondary,"secondary")),j}function p(D){if(!D)return"";const j=new Date(D*1e3),K=j.getMonth()+1,te=String(j.getDate()).padStart(2,"0"),_e=String(j.getHours()).padStart(2,"0"),fe=String(j.getMinutes()).padStart(2,"0");return`${K}.${te} ${_e}:${fe}`}function f(D){if(!(D!=null&&D.resetsAt))return"";const j=D.resetsAt*1e3-Date.now();if(j<=0)return"Resetting now";const K=Math.round(j/6e4);if(K<60)return`Resets in ${K}m`;const te=Math.round(K/60);return te<24?`Resets in ${te}h`:`Resets in ${Math.round(te/24)}d`}function g(D){return[D.primary,D.secondary].filter(j=>j!==null)}function _(D){const j=g(D);return j.length===0?null:[...j].sort((K,te)=>{const _e=K.windowDurationMins??Number.MAX_SAFE_INTEGER,fe=te.windowDurationMins??Number.MAX_SAFE_INTEGER;return _e!==fe?_e-fe:(K.resetsAt??Number.MAX_SAFE_INTEGER)-(te.resetsAt??Number.MAX_SAFE_INTEGER)})[0]}function I(D){const j=g(D);if(j.length===0)return"";const K=[...j].sort((_e,fe)=>{const he=_e.windowDurationMins??-1,Re=fe.windowDurationMins??-1;return he!==Re?Re-he:(fe.resetsAt??-1)-(_e.resetsAt??-1)})[0],te=p(K.resetsAt);return te||""}function O(D){const j=D.credits;return j?j.unlimited?"Unlimited credits":j.balance?`Credits ${j.balance}`:j.hasCredits?"Credits available":"":""}function q(D){return[f(_(D)),I(D),O(D)].filter(j=>j.length>0)}function ee(D){const j=[n(D)];for(const K of c(D))j.push(K.label);for(const K of g(D))j.push(`${a(K.windowDurationMins)} used ${s(K.usedPercent)}`);for(const K of q(D))j.push(K);return j.join(`
50
+ `)}return(D,j)=>e.snapshots.length>0?(C(),E("aside",hA,[(C(!0),E(Qe,null,en(e.snapshots,K=>(C(),E("div",{key:t(K),class:"rate-limit-card",title:ee(K)},[m("div",mA,[m("span",vA,M(n(K)),1),K.planType?(C(),E("span",gA,M(r(K.planType)),1)):Z("",!0)]),m("div",yA,[(C(!0),E(Qe,null,en(c(K),te=>(C(),E("span",{key:te.key,class:"rate-limit-card-metric"},M(te.label),1))),128))]),q(K).length>0?(C(),E("div",wA,M(q(K).join(" | ")),1)):Z("",!0)],8,pA))),128))])):Z("",!0)}}),_A=At(bA,[["__scopeId","data-v-df88906b"]]),TA=["disabled","title","aria-label"],kA={class:"header-git-trigger-label"},CA={key:0,class:"header-git-dirty-dot","aria-label":"Uncommitted changes"},SA={key:0,class:"header-git-menu-wrap"},xA={class:"header-git-menu"},AA={class:"header-git-state"},IA={class:"header-git-state-label"},EA={class:"header-git-state-value"},PA={key:0,class:"header-git-state-meta"},RA={class:"header-git-search-wrap"},MA=["onKeydown"],$A={class:"header-git-branches",role:"listbox"},NA={class:"header-git-branch-row"},LA=["aria-label","onClick"],OA=["disabled","onClick"],jA={class:"header-git-branch-name"},DA={key:0,class:"header-git-branch-meta"},FA={key:1,class:"header-git-branch-meta"},UA={key:0,class:"header-git-commits"},BA={key:0,class:"header-git-commits-empty"},qA={key:1,class:"header-git-commits-empty is-error"},HA=["disabled","title","onClick"],WA={class:"header-git-commit-top"},zA={class:"header-git-commit-meta"},VA={key:0,class:"header-git-branch-meta"},GA={class:"header-git-commit-subject"},KA={key:2,class:"header-git-commits-empty"},YA={key:0,class:"header-git-empty"},QA=Bn({__name:"HeaderGitBranchDropdown",props:{currentBranch:{},headSha:{},headSubject:{},headDate:{},detached:{type:Boolean},dirty:{type:Boolean},branches:{},commitsByBranch:{},commitsLoadingFor:{},commitsError:{},loading:{type:Boolean},busy:{type:Boolean},error:{},reviewOpen:{type:Boolean},showReview:{type:Boolean}},emits:["toggleReview","checkoutBranch","resetBranchToCommit","loadCommits"],setup(e,{emit:t}){const n=e,r=t,a=A(null),o=A(null),s=A(!1),l=A(""),c=A(""),p=ae(()=>n.showReview!==!1),f=ae(()=>n.currentBranch?n.currentBranch:n.headSubject?n.headSubject:n.headSha?`Detached ${n.headSha}`:n.loading?"Loading branch...":"Detached HEAD"),g=ae(()=>n.detached?[n.headSha,n.headDate].filter(Boolean).join(" · "):""),_=ae(()=>`Git branch: ${f.value}`),I=ae(()=>n.loading&&n.branches.length===0),O=ae(()=>n.busy||n.loading),q=ae(()=>n.error||(n.dirty?"Tracked changes must be committed, stashed, or discarded before switching or resetting. Untracked files are allowed unless Git would overwrite them.":"")),ee=ae(()=>n.error?"error":"info"),D=ae(()=>{const G=l.value.trim().toLowerCase(),ye=n.branches;return G?ye.filter(ke=>ke.label.toLowerCase().includes(G)||ke.value.toLowerCase().includes(G)):ye});function j(){I.value||(s.value=!s.value)}function K(G){c.value=c.value===G?"":G,c.value&&r("loadCommits",G)}function te(G){var ke;const ye=((ke=n.headSha)==null?void 0:ke.trim())??"";return ye?G.sha===ye||G.shortSha===ye||G.sha.startsWith(ye):!1}function _e(G,ye){return G.isRemote?"Remote branches cannot be reset from this menu":`Reset ${G.value} to ${ye.shortSha}`}function fe(G,ye){G.isRemote||r("resetBranchToCommit",{branch:G.value,sha:ye.sha})}function he(){if(l.value){l.value="";return}s.value=!1}function Re(G){if(!s.value)return;const ye=a.value,ke=G.target;!ye||!(ke instanceof Node)||ye.contains(ke)||(s.value=!1,l.value="")}return ht(s,G=>{G&&Zt(()=>{var ye;return(ye=o.value)==null?void 0:ye.focus()})}),ma(()=>window.addEventListener("pointerdown",Re)),Da(()=>window.removeEventListener("pointerdown",Re)),(G,ye)=>(C(),E("div",{ref_key:"rootRef",ref:a,class:tt(["header-git-dropdown",{"is-review-open":e.reviewOpen}])},[m("button",{class:"header-git-trigger",type:"button",disabled:I.value,title:_.value,"aria-label":_.value,onClick:j},[je(Cs,{class:"header-git-trigger-icon"}),m("span",kA,M(f.value),1),e.dirty?(C(),E("span",CA)):Z("",!0),je(rs,{class:"header-git-trigger-chevron"})],8,TA),s.value?(C(),E("div",SA,[m("div",xA,[p.value?(C(),E("button",{key:0,class:"header-git-review-row",type:"button",onClick:ye[0]||(ye[0]=ke=>r("toggleReview"))},[je(Ds,{class:"header-git-row-icon"}),m("span",null,M(e.reviewOpen?"Review (Open)":"Review"),1)])):Z("",!0),m("div",AA,[m("span",IA,M(e.detached?"Detached HEAD":"Current branch"),1),m("span",EA,M(f.value),1),g.value?(C(),E("span",PA,M(g.value),1)):Z("",!0)]),q.value?(C(),E("div",{key:1,class:tt(["header-git-status",{"is-error":ee.value==="error"}])},M(q.value),3)):Z("",!0),m("div",RA,[ln(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":ye[1]||(ye[1]=ke=>l.value=ke),class:"header-git-search",type:"text",placeholder:"Search branches...",onKeydown:gn(Ze(he,["prevent"]),["esc"])},null,40,MA),[[mn,l.value]])]),m("ul",$A,[(C(!0),E(Qe,null,en(D.value,ke=>(C(),E("li",{key:ke.value,class:"header-git-branch-item"},[m("div",NA,[m("button",{class:"header-git-branch-expand",type:"button","aria-label":c.value===ke.value?"Hide commits":"Show commits",onClick:se=>K(ke.value)},[je(hi,{class:tt(["header-git-expand-icon",{"is-expanded":c.value===ke.value}])},null,8,["class"])],8,LA),m("button",{class:tt(["header-git-branch-button",{"is-current":ke.value===e.currentBranch}]),type:"button",disabled:O.value,onClick:se=>r("checkoutBranch",ke.value)},[m("span",jA,M(ke.label),1),ke.value===e.currentBranch?(C(),E("span",DA,"current")):ke.isRemote?(C(),E("span",FA,"remote")):Z("",!0)],10,OA)]),c.value===ke.value?(C(),E("div",UA,[e.commitsLoadingFor===ke.value?(C(),E("div",BA,"Loading commits...")):e.commitsError?(C(),E("div",qA,M(e.commitsError),1)):Z("",!0),(C(!0),E(Qe,null,en(e.commitsByBranch[ke.value]||[],se=>(C(),E("button",{key:se.sha,class:tt(["header-git-commit",{"is-current":te(se)}]),type:"button",disabled:O.value||ke.isRemote,title:_e(ke,se),onClick:Te=>fe(ke,se)},[m("span",WA,[m("code",null,M(se.shortSha),1),m("span",zA,[te(se)?(C(),E("span",VA,"current")):Z("",!0),m("span",null,M(se.date),1)])]),m("span",GA,M(se.subject),1)],10,HA))),128)),e.commitsLoadingFor!==ke.value&&!e.commitsError&&(e.commitsByBranch[ke.value]||[]).length===0?(C(),E("div",KA," No commits found. ")):Z("",!0)])):Z("",!0)]))),128)),D.value.length===0?(C(),E("li",YA,"No branches found.")):Z("",!0)])])])):Z("",!0)],2))}}),JA=At(QA,[["__scopeId","data-v-5f4121b3"]]),XA=["aria-label"],ZA=["aria-checked","onClick"],eI={class:"runtime-toggle-option-label"},tI=Bn({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,{t:r}=Fa(),a=[{value:"local",label:r("Local project"),icon:nd},{value:"worktree",label:r("New worktree"),icon:Cs}];function o(s){n("update:modelValue",s)}return(s,l)=>(C(),E("div",{class:"runtime-toggle",role:"radiogroup","aria-label":S(r)("Continue in")},[(C(),E(Qe,null,en(a,c=>m("button",{key:c.value,class:tt(["runtime-toggle-option",{"is-selected":e.modelValue===c.value}]),type:"button",role:"radio","aria-checked":e.modelValue===c.value,onClick:p=>o(c.value)},[(C(),et(Wc(c.icon),{class:"runtime-toggle-option-icon"})),m("span",eI,M(c.label),1)],10,ZA)),64))],8,XA))}}),nI=At(tI,[["__scopeId","data-v-0f175c28"]]),rI={},oI={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 aI(e,t){return C(),E("svg",oI,[...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 sI=At(rI,[["render",aI]]),iI={},lI={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function uI(e,t){return C(),E("svg",lI,[...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 cI=At(iI,[["render",uI]]),dI={class:"sidebar-thread-controls"},fI=["aria-label","title"],hI=["aria-label","title"],pI=Bn({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){const{t}=Fa();return(n,r)=>(C(),E("div",dI,[m("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?S(t)("Expand sidebar"):S(t)("Collapse sidebar"),title:e.isSidebarCollapsed?S(t)("Expand sidebar"):S(t)("Collapse sidebar"),onClick:r[0]||(r[0]=a=>n.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(C(),et(cI,{key:0,class:"sidebar-thread-controls-icon"})):(C(),et(sI,{key:1,class:"sidebar-thread-controls-icon"}))],8,fI),Bo(n.$slots,"default",{},void 0),e.showNewThreadButton?(C(),E("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":S(t)("Start new thread"),title:S(t)("Start new thread"),onClick:r[1]||(r[1]=a=>n.$emit("start-new-thread"))},[je(Ds,{class:"sidebar-thread-controls-icon"})],8,hI)):Z("",!0)]))}}),vh=At(pI,[["__scopeId","data-v-2369affb"]]),mI={},vI={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function gI(e,t){return C(),E("svg",vI,[...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 gh=At(mI,[["render",gI]]),yI={},wI={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function bI(e,t){return C(),E("svg",wI,[...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 _I=At(yI,[["render",bI]]),TI={},kI={viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"};function CI(e,t){return C(),E("svg",kI,[...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 SI=At(TI,[["render",CI]]),xI={},AI={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function II(e,t){return C(),E("svg",AI,[...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 EI=At(xI,[["render",II]]);function Pr(e){return e.flatMap(t=>t.threads)}function PI(e,t){var r,a;const n=e.findIndex(o=>o.id===t);return n<0?"":((r=e[n+1])==null?void 0:r.id)??((a=e[n-1])==null?void 0:a.id)??""}const Pm="codex-web-local.thread-read-state.v1",yh="codex-web-local.thread-unread-cutoff.v1",Rm="codex-web-local.thread-token-usage.v1",Mm="codex-web-local.thread-terminal-open.v1",kc="codex-web-local.selected-thread-id.v1",Cc="codex-web-local.selected-model-by-context.v1",$m="codex-web-local.project-order.v1",Nm="codex-web-local.project-display-name.v1",Sc="codex-web-local.collaboration-mode-by-context.v1",RI="codex-web-local.collaboration-mode.v1",sa="__new-thread__",Lm="__new-thread-provider__::",Nl="__thread-provider__::",Yu=220,MI=1e4,$I=500,NI=3e3,LI=2e3,wh=["none","minimal","low","medium","high","xhigh"],gs="__global__",io="gpt-5.4-mini";function OI(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Pm);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function bh(e){typeof window>"u"||window.localStorage.setItem(Pm,JSON.stringify(e))}function jI(){if(typeof window>"u")return"";const e=window.localStorage.getItem(yh);if(e)return e;const t=new Date().toISOString();return window.localStorage.setItem(yh,t),t}function DI(e,t){if(!e||!t)return!1;const n=new Date(e).getTime(),r=new Date(t).getTime();return!Number.isFinite(n)||!Number.isFinite(r)?!1:n>r}function FI(e,t,n){return DI(e,t??n)}function Om(e){return e==="plan"?"plan":"default"}function Tl(e){return typeof e=="string"?e.trim():""}function uo(){return Object.create(null)}function pi(e){const t=uo();for(const[n,r]of Object.entries(e))t[n]=r;return t}function ki(e,t){if(!(t in e))return e;const n=uo();for(const[r,a]of Object.entries(e))r!==t&&(n[r]=a);return n}function _h(e,t,n={}){const r=n.preserveLegacyThreadContexts!==!1,a=n.preserveNewThreadContext!==!1;let o=!1;const s=uo();for(const[l,c]of Object.entries(e)){if(l.startsWith(Nl)){const p=qI(l);if(p&&t.has(p)){s[l]=c;continue}o=!0;continue}if(a&&l===sa||l.startsWith(Lm)||r&&t.has(l)){s[l]=c;continue}o=!0}return o?s:e}function Mi(e){const t=e.trim().toLowerCase();return!t||t==="openai"?"codex":t}function UI(e){return Mi(e)==="codex"}function BI(e){return e===sa}function fl(e){const t=Mi(e);return t?`${Lm}${t}`:""}function Qu(e,t){const n=e.trim();if(!n)return"";const r=Mi(t);return r?`${Nl}${r}::${n}`:""}function qI(e){if(!e.startsWith(Nl))return"";const t=e.slice(Nl.length),n=t.indexOf("::");return n<0?"":t.slice(n+2).trim()}function Ci(e){return e.trim()||sa}function HI(){if(typeof window>"u")return uo();try{const e=window.localStorage.getItem(Cc);if(e){const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return uo();const n=uo();for(const[r,a]of Object.entries(t)){if(typeof r!="string"||r.length===0)continue;const o=Tl(a);o&&(n[r]=o)}return n}}catch{}return uo()}function hl(e){if(!(typeof window>"u"))try{Object.keys(e).length===0?window.localStorage.removeItem(Cc):window.localStorage.setItem(Cc,JSON.stringify(e))}catch{}}function WI(){if(typeof window>"u")return uo();try{const e=window.localStorage.getItem(Sc);if(e){const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return uo();const n=uo();for(const[r,a]of Object.entries(t)){if(typeof r!="string"||r.length===0)continue;const o=Om(a);o==="plan"&&(n[r]=o)}return n}}catch{}return uo()}function pl(e,t){const n=Ci(t);return Om(e[n])}function Th(e,t,n){const r=Ci(t);if(BI(r))return ki(e,r);if(n==="plan"){const a=pi(e);return a[r]="plan",a}return ki(e,r)}function Ju(e){if(!(typeof window>"u"))try{Object.keys(e).length===0?window.localStorage.removeItem(Sc):window.localStorage.setItem(Sc,JSON.stringify(e)),window.localStorage.removeItem(RI)}catch{}}function jm(e,t,n){return Math.min(Math.max(e,t),n)}function Ts(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 kh(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;return{totalTokens:Ts(t.totalTokens)??0,inputTokens:Ts(t.inputTokens)??0,cachedInputTokens:Ts(t.cachedInputTokens)??0,outputTokens:Ts(t.outputTokens)??0,reasoningOutputTokens:Ts(t.reasoningOutputTokens)??0}}function zI(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e,n=kh(t.total),r=kh(t.last);if(!n||!r)return null;const a=Ts(t.modelContextWindow),o=r.totalTokens,s=typeof a=="number"?Math.max(a-o,0):null,l=typeof a=="number"&&a>0?jm(Math.round((s??0)/a*100),0,100):null;return{total:n,last:r,modelContextWindow:a,currentContextTokens:o,remainingContextTokens:s,remainingContextPercent:l}}function VI(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Rm);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=zI(a);o&&(n[r]=o)}return n}catch{return{}}}function Ch(e){typeof window>"u"||window.localStorage.setItem(Rm,JSON.stringify(e))}function GI(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Mm);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 KI(e){typeof window>"u"||window.localStorage.setItem(Mm,JSON.stringify(e))}function YI(){return typeof window>"u"?"":window.localStorage.getItem(kc)??""}function QI(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(kc);return}window.localStorage.setItem(kc,e)}}function JI(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem($m);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=Jr(r);a.length>0&&!n.includes(a)&&n.push(a)}return n}catch{return[]}}function ui(e){typeof window>"u"||window.localStorage.setItem($m,JSON.stringify(e))}function XI(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Nm);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"?Jr(r):"";o.length>0&&typeof a=="string"&&(n[o]=a)}return n}catch{return{}}}function Sh(e){typeof window>"u"||window.localStorage.setItem(Nm,JSON.stringify(e))}function ys(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 La(e,n)?e:n}function Xu(e,t){const n=new Map(e.map(a=>[a.projectName,a])),r=t.map(a=>n.get(a)??null).filter(a=>a!==null);for(const a of e)t.includes(a.projectName)||r.push(a);return r}function La(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 ZI(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 eE(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function tE(e=[],t=[]){var n,r,a,o;if(e.length!==t.length)return!1;for(let s=0;s<e.length;s+=1)if(((n=e[s])==null?void 0:n.step)!==((r=t[s])==null?void 0:r.step)||((a=e[s])==null?void 0:a.status)!==((o=t[s])==null?void 0:o.status))return!1;return!0}function nE(e,t){return!e&&!t?!0:!e||!t?!1:e.explanation===t.explanation&&e.isStreaming===t.isStreaming&&tE(e.steps,t.steps)}function ml(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 xc(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&La(e.images,t.images)&&oE(e.fileChanges,t.fileChanges)&&e.fileChangeStatus===t.fileChangeStatus&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&eE(e.commandExecution,t.commandExecution)&&nE(e.plan,t.plan)&&e.turnId===t.turnId&&e.turnIndex===t.turnIndex&&e.isAutomationRun===t.isAutomationRun&&e.automationDisplayName===t.automationDisplayName}function Ss(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 rE(e,t,n={}){const r=new Map(e.map(f=>[f.id,f])),a=new Map(t.map(f=>[f.id,f])),o=t.map(f=>{const g=r.get(f.id);return g&&xc(g,f)?g:f});if(n.preserveMissing!==!0)return Ss(e,o)?e:o;const s=e.map(f=>{const g=a.get(f.id);return!g||xc(f,g)?f:g}),l=new Set(e.map(f=>f.id)),c=o.filter(f=>!l.has(f.id)),p=[...s,...c];return Ss(e,p)?e:p}function oE(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 Ac(e){return e.replace(/\s+/gu," ").trim()}function aE(e,t){const n=new Set(t.map(o=>o.id)),r=new Set(t.filter(o=>o.role==="assistant").map(o=>Ac(o.text)).filter(o=>o.length>0));if(r.size===0)return e;const a=e.filter(o=>{if(o.messageType!=="agentMessage.live")return!0;if(n.has(o.id))return!1;const s=Ac(o.text);return s.length===0?!1:!r.has(s)});return a.length===e.length?e:a}function vl(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(xc(r,t))return e;const a=[...e];return a.splice(n,1,t),a}const Dm="worked";function Ra(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function sE(e){if(!Number.isFinite(e)||e<=0)return"<1s";const t=Math.max(1,Math.round(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),a=t%60,o=[];n>0&&o.push(`${n}h`),(r>0||n>0)&&o.push(`${r}m`);const s=a>0||o.length===0?a:0;return o.push(`${s}s`),o.join(" ")}function iE(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function lE(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 uE(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${sE(e.durationMs)}`,messageType:Dm,turnId:e.turnId}}function cE(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function dE(e,t){const n=uE(t),r=e.filter(s=>s.messageType!==Dm),a=cE(r);if(a<0)return[...r,n];const o=[...r];return o.splice(a,0,n),o}function xt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function fE(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 hE(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 pE(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 mE(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 hn(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function xh(e,t){const n=t.trim();if(!n)return e;let r=!1;const a=[];for(const o of e){const s=o.threads.filter(c=>c.id!==n),l=s.length!==o.threads.length;l&&(r=!0),s.length>0?a.push(l?{...o,threads:s}:o):o.threads.length===0&&a.push(o)}return r?a:e}function gl(e,t){const n=new Map(e.map(a=>[a.projectName,a])),r=t.map(a=>{const o=n.get(a.projectName),s=new Map((o==null?void 0:o.threads.map(c=>[c.id,c]))??[]),l=a.threads.map(c=>{const p=s.get(c.id);return p&&hE(p,c)?p:c});return o&&o.projectName===a.projectName&&pE(o.threads,l)?o:{projectName:a.projectName,threads:l}});return mE(e,r)?e:r}function vE(e,t,n){const r=new Set(Pr(t).map(l=>l.id)),a=Pr(e).filter(l=>n[l.id]===!0&&!r.has(l.id));if(a.length===0)return t;const o=new Map(t.map(l=>[l.projectName,l])),s=t.map(l=>({projectName:l.projectName,threads:[...l.threads]}));for(const l of a){if(o.get(l.projectName)){const p=s.findIndex(f=>f.projectName===l.projectName);p>=0&&(s[p]={projectName:s[p].projectName,threads:[l,...s[p].threads]});continue}s.push({projectName:l.projectName,threads:[l]})}return s}function ss(e){return Jr(e)}function gE(e){const t=e.trim();if(!t)return"";const n=t.lastIndexOf(":");return n>=0?t.slice(n+1):t}function yE(e){const t=e.label||Jr(e.remotePath),n=gE(e.hostId);return n?`${t} ${n}`:t}function Fm(e){const t=(e==null?void 0:e.remoteProjects)??[];return new Map(t.map(n=>[n.id,n]))}function eu(e){if(!e)return[];const t=new Set(e.order),n=new Set((e.remoteProjects??[]).map(a=>a.id)),r=e.projectOrder.filter(a=>t.has(a)||n.has(a));for(const a of e.order)r.includes(a)||r.push(a);for(const a of n)r.includes(a)||r.push(a);return r}function Ic(e,t){const n=Fm(e);return eu(e).map(r=>{if(n.has(r))return r;const a=ot(r).trim(),o=ss(a);return t.has(o)?a:o})}function kl(e,t){return ot(e).trim()===t||ss(e)===t}function wE(e,t){const n=new Set;for(const r of e.order)kl(r,t)&&n.add(r);for(const r of e.active)kl(r,t)&&n.add(r);for(const r of Object.keys(e.labels))kl(r,t)&&n.add(r);return n}function bE(e,t,n){var p,f;const r=new Set((e.remoteProjects??[]).map(g=>g.id)),a=new Map;for(const g of e.order){const _=ss(g);a.has(_)||a.set(_,g)}for(const g of n){const _=((f=(p=g.threads[0])==null?void 0:p.cwd)==null?void 0:f.trim())??"";_&&a.set(g.projectName,_)}const o=[],s=g=>{g&&!o.includes(g)&&o.push(g)};for(const g of t){if(r.has(g)){s(g);continue}const _=a.get(g);_&&s(_)}for(const g of eu(e))s(g);const l=o.filter(g=>e.order.includes(g));for(const g of e.order)l.includes(g)||l.push(g);const c=e.active.filter(g=>l.includes(g));return c.length===0&&l.length>0&&c.push(l[0]),{order:l,active:c,projectOrder:o}}function _E(e,t,n){const r=Ic(t,n);if(r.length===0)return e;const a=new Map(r.map((o,s)=>[o,s]));return[...e].sort((o,s)=>{if(Pc(o)||Pc(s))return 0;const l=a.get(o.projectName)??Number.POSITIVE_INFINITY,c=a.get(s.projectName)??Number.POSITIVE_INFINITY;return l===c?0:l-c})}function Ec(e,t){const n=new Map,r=new Map,a=s=>{const l=ot(s).trim();if(!l)return;const c=Jr(l),p=n.get(c)??new Set;p.add(l),n.set(c,p)};for(const s of(t==null?void 0:t.order)??[]){const l=ot(s).trim();if(!l)continue;const c=Jr(l);Ll(l)||r.set(c,(r.get(c)??0)+1),a(s)}for(const s of e)for(const l of s.threads){const c=ot(l.cwd).trim(),p=Jr(c),f=(t==null?void 0:t.order.some(g=>ot(g).trim()===c))===!0;Ll(c)&&!f&&r.get(p)===1||a(l.cwd)}const o=new Set;for(const[s,l]of n.entries())l.size>1&&o.add(s);return o}function Ll(e){return e.includes("/.codex/worktrees/")}function TE(e,t){const n=Ec(e,t);if(n.size===0)return e;const r=new Set,a=new Set,o=new Map,s=new Set;for(const p of(t==null?void 0:t.order)??[]){const f=ot(p).trim();if(!f||(s.add(f),Ll(f)))continue;const g=Jr(f);r.has(g)?(r.delete(g),a.add(g),o.delete(g)):a.has(g)||(r.add(g),o.set(g,f))}const l=[],c=new Map;for(const p of e)for(const f of p.threads){const g=ot(f.cwd).trim(),_=Jr(g),I=s.has(g),O=Ll(g)&&!I&&r.has(_);let q=p.projectName;O&&n.has(_)?q=o.get(_)??p.projectName:g&&n.has(_)&&(q=g);const ee=f.projectName===q?f:{...f,projectName:q},D=c.get(q);if(D)D.threads.push(ee);else{const j={projectName:q,threads:[ee]};c.set(q,j),l.push(j)}}return l}function kE(e,t,n){if(!t||t.order.length===0&&(t.remoteProjects??[]).length===0)return e;const r=new Set(e.map(s=>s.projectName)),a=[...e],o=Fm(t);for(const s of eu(t)){if(o.has(s)){if(r.has(s))continue;a.push({projectName:s,threads:[]}),r.add(s);continue}const l=ot(s).trim();if(!l)continue;const c=ss(l),p=n.has(c)?l:c;r.has(p)||(a.push({projectName:p,threads:[]}),r.add(p))}return a}function CE(e){const t=e.split(`
51
+ `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function SE(e){const t=e.trim()||"Untitled thread";return/^fork:\s+/iu.test(t)?t:`Fork: ${t}`}function Pc(e){return e.threads.some(t=>t.cwd.trim().length===0||Ml(t.cwd))}function xE(){const e=A([]),t=A([]),n=A(YI()),r=A({}),a=A({}),o=A({}),s=A({}),l=A({}),c=A({}),p=A({}),f=A({}),g=A({});let _=!1;const I=A({}),O=A([]),q=A([{value:"default",label:"Default"},{value:"plan",label:"Plan"}]),ee=A(WI()),D=A(HI()),j=A(pl(ee.value,n.value)),K=A(""),te=A("medium"),_e=A("standard"),fe=A(""),he=A(OI()),Re=A(jI()),G=A(JI()),ye=A(XI()),ke=A({}),se=A({}),Te=A({}),De=A({}),Be=A({}),ze=A({}),Ne=A({}),Ce=A({}),Ye=A({}),rt=A({}),Ve=A({}),Le=A({}),gt=A({}),Ge=A(null),qe=A(VI()),wt=A(GI()),ne=A({}),Se=A([]),Ae=A([]),Fe=A(!1),Ke=A(!1),x=A(!1),R=A(!1),V=A(!1),ie=A(!1),Q=A(""),le=A(!1),pe=A(!1);function be(i){var d;try{const v=new URL(i,"http://localhost");return v.pathname!=="/codex-local-image"?"":((d=v.searchParams.get("path"))==null?void 0:d.trim())??""}catch{return""}}function we(i){const d=i.trim().toLowerCase();return d?/\b(attached image|attached screenshot|save the attached|copy (the )?screenshot|save screenshot)\b/i.test(d):!1}function de(i){var v;const d=r.value[i]??[];for(let T=d.length-1;T>=0;T-=1){const N=d[T];if(!(N.role!=="user"||!Array.isArray(N.images)||N.images.length===0))for(let $=N.images.length-1;$>=0;$-=1){const B=((v=N.images[$])==null?void 0:v.trim())??"";if(B&&be(B))return B}}return""}let Oe=null,ge=null,$e=null;const Ee=new Map;let at=null;const mt=new Map;let pt=null,bt=null,yt=!1;const F=new Set,z=new Map;let H=null,X=null,ve=!1,Ie=!1,He=[],Tt=null,qt=!1,Cn=!1;const Zn=new Map,Nn=new Set,Wo=ae(()=>Pr(e.value)),Ln=ae(()=>Wo.value.find(i=>i.id===n.value)??null),wr=ae(()=>{const i=n.value;return!!(i&&wt.value[i]===!0)}),zr=ae(()=>{const i=n.value;return i?Ye.value[i]===!0:!1}),go=ae(()=>{const i=[],d=n.value;return d&&Array.isArray(Le.value[d])&&i.push(...Le.value[d]),Array.isArray(Le.value[gs])&&i.push(...Le.value[gs]),i.sort((v,T)=>v.receivedAtIso.localeCompare(T.receivedAtIso))}),Sn=ae(()=>{var $;const i=n.value;if(!i)return null;const d=p.value[i]===!0,v=d?ze.value[i]:void 0,T=d?(s.value[i]??"").trim():"",N=((($=Ne.value[i])==null?void 0:$.message)??"").trim();return!v&&!T&&!N?null:{activityLabel:(v==null?void 0:v.label)||"Thinking",activityDetails:(v==null?void 0:v.details)??[],reasoningText:T,errorText:N}}),un=ae(()=>Ge.value),Zr=ae(()=>{const i=n.value;return i?qe.value[i]??null:null}),Rr=ae(()=>{const i=n.value;if(!i)return[];const d=r.value[i]??[],v=a.value[i]??[],T=o.value[i]??[],N=l.value[i]??[],$=c.value[i]??[],B=[...d,...v,...N,...$,...T],Y=Be.value[i];return Y?dE(B,Y):B});function On(i){const d=Ci(i);if(d===sa)return yo();const v=Qu(d,fe.value);return v?Tl(D.value[v]):""}function yo(){const i=fl(fe.value);return i?Tl(D.value[i]):""}function xn(i){return On(i)||yo()}function jn(...i){const d=[...O.value];for(const v of i){const T=v.trim();T&&!d.includes(T)&&d.push(T)}La(O.value,d)||(O.value=d)}function dt(i){n.value!==i&&(n.value=i,QI(i),K.value=xn(i),jn(K.value),j.value=pl(ee.value,i),Cn=!1)}function qn(i){fe.value=Mi(i);const d=xn(n.value).trim();K.value=d,O.value=d?[d]:[]}function vn(i,d){const v=d.trim(),T=Ci(i),N=T===sa,B=(N?fl(fe.value):Qu(T,fe.value))||T;if(v){const Y=pi(D.value);Y[B]=v,D.value=Y}else D.value=ki(D.value,B);if(i.trim()===n.value?(K.value=xn(n.value),jn(K.value)):jn(v),N){const Y=fl(fe.value);if(Y)if(v){const re=pi(D.value);re[Y]=v,D.value=re}else D.value=ki(D.value,Y)}hl(D.value)}function br(i){vn(n.value,i)}function Ot(i,d){const v=i.trim();if(!v)return;const T=d.trim(),$=Qu(v,fe.value)||v;if(T){const B=pi(D.value);B[$]=T,D.value=B}else D.value=ki(D.value,$);jn(T),n.value===v&&(K.value=xn(n.value)),hl(D.value)}function eo(i,d){const v=d.trim();!v||!O.value.includes(v)||Ot(i,v)}function wo(i,d){const v=i.trim();if(!v)return;if(!d){if(!(v in qe.value))return;qe.value=xt(qe.value,v),Ch(qe.value);return}const T=qe.value[v];T&&JSON.stringify(T)===JSON.stringify(d)||(qe.value={...qe.value,[v]:d},Ch(qe.value))}function Ht(i){const d=i==="plan"?"plan":"default",v=Ci(n.value);pl(ee.value,n.value)===d&&j.value===d||(j.value=d,ee.value=Th(ee.value,v,d),Ju(ee.value))}function jt(i,d){const v=d==="plan"?"plan":"default";ee.value=Th(ee.value,i,v),i.trim()===n.value&&(j.value=v),Ju(ee.value)}function Kt(i){Ge.value=i}async function Dt(i=n.value){i.trim()?Ot(i,io):br(io),jn(io)}function Hn(i,d){gt.value={...gt.value,[i]:d}}function to(i){gt.value[i]&&(gt.value=xt(gt.value,i))}async function ga(i){if(Nn.has(i))return;const d=gt.value[i];if(!(!d||d.fallbackRetried)){Nn.add(i),Hn(i,{...d,fallbackRetried:!0});try{await Dt(i);try{const v=await qu(i,1);bn(i,v),vt(i),jr(i,[]),xe(i),l.value[i]&&(l.value=xt(l.value,i))}catch{}St(i,null),Q.value="",cn(i,null),kt(i,{label:"Thinking",details:on(io,d.effort,d.collaborationMode)}),an(i,!0),Te.value[i]!==!0&&await Bu(i),await Hu(i,d.text,d.imageUrls,io,d.effort||void 0,d.skills.length>0?d.skills:void 0,d.fileAttachments,d.collaborationMode),Te.value={...Te.value,[i]:!0},tr(),F.add(i),await ao()}catch(v){const T=v instanceof Error?v.message:"Unknown application error";St(i,T),Q.value=T,an(i,!1),kt(i,null)}finally{Nn.delete(i)}}}function bo(i){i&&!wh.includes(i)||(te.value=i)}async function no(i){const d=i==="fast"?"fast":"standard";if(V.value||_e.value===d)return;const v=_e.value;_e.value=d,V.value=!0,Q.value="";try{await k_(d)}catch(T){_e.value=v,Q.value=T instanceof Error?T.message:"Failed to update Fast mode"}finally{V.value=!1}}async function _o(){try{const i=await I_();q.value=i,i.some(d=>d.value===j.value)||Ht("default")}catch{}}function on(i,d,v=j.value){const T=i.trim()||"default",N=d||"default",$=v==="plan"?"Plan":"Default",B=_e.value==="fast"?"Fast":"Standard";return[`Mode: ${$}`,`Model: ${T}`,`Thinking: ${N}`,`Speed: ${B}`]}async function _r(i){try{const d=await km(),v=d.model.trim(),T=Mi(d.providerId),N=(i==null?void 0:i.includeProviderModels)!==!1&&!UI(T),$=await Tm({includeProviderModels:N});fe.value=T,i!=null&&i.providerChanged&&(Te.value={},se.value={});const B=On(n.value);K.value=B,jn(B);const Y=fl(T),re=Y?Tl(D.value[Y]):"",me=[...$];if(!(i!=null&&i.providerChanged))for(const Xe of[B,v])Xe&&!me.includes(Xe)&&me.push(Xe);O.value=me;const Je=B&&$.includes(B);if(!B||!Je||i!=null&&i.providerChanged){let Xe="";i!=null&&i.providerChanged&&me.length>0?v&&me.includes(v)?Xe=v:re&&me.includes(re)?Xe=re:Xe=me[0]:v&&me.includes(v)?Xe=d.model:me.length>0&&(Xe=me[0]),br(Xe),i!=null&&i.providerChanged&&vn(sa,Xe)}else i!=null&&i.providerChanged&&(v&&me.includes(v)?vn(sa,v):vn(sa,B));if(Y&&!re&&v){const Xe=pi(D.value);Xe[Y]=v,D.value=Xe,hl(D.value)}d.reasoningEffort&&wh.includes(d.reasoningEffort)&&(te.value=d.reasoningEffort),_e.value=d.speedMode}catch{}}async function er(){if(bt){await bt;return}bt=(async()=>{try{const i=await l_();Kt(i),Ae.value=i?[i]:[]}catch{}finally{bt=null}})(),await bt}function tr(){if(typeof window>"u"){er();return}$e!==null&&window.clearTimeout($e),$e=window.setTimeout(()=>{$e=null,er()},$I)}function Mr(i){if(!i||typeof window>"u")return;const d=Ee.get(i);d!==void 0&&(window.clearTimeout(d),Ee.delete(i))}function To(i){if(!i||typeof window>"u")return;Mr(i);const d=window.setTimeout(()=>{Ee.delete(i),F.add(i),ao()},NI);Ee.set(i,d)}function Wn(i){const d=ne.value;return Object.keys(d).length===0?i:i.map(v=>({projectName:v.projectName,threads:v.threads.map(T=>{const N=d[T.id];return N?{...T,title:N}:T})}))}function $r(i){return i?Array.isArray(Le.value[i])?Le.value[i]:[]:[]}function Tr(i){return i==="item/commandExecution/requestApproval"||i==="item/fileChange/requestApproval"||i==="item/permissions/requestApproval"||i==="execCommandApproval"||i==="applyPatchApproval"}function ko(i){return i.some(d=>Tr(d.method))?"approval":i.length>0?"response":null}function $t(){const d=Wn(t.value).map(v=>({projectName:v.projectName,threads:v.threads.map(T=>{const N=p.value[T.id]===!0,$=ko($r(T.id)),B=n.value===T.id,Y=I.value[T.id]===!0,re=FI(T.updatedAtIso,he.value[T.id],Re.value);return{...T,inProgress:N,unread:!B&&!N&&(Y||re),pendingRequestState:$}})}));e.value=gl(e.value,d)}function Yt(i,d,v){const T=new Date().toISOString(),N=ot(d),$=Jr(N),B={id:i,title:CE(v),projectName:$,cwd:N,hasWorktree:N.includes("/.codex/worktrees/")||N.includes("/.git/worktrees/"),createdAtIso:T,updatedAtIso:T,preview:v,unread:!1,inProgress:!1},Y=t.value.findIndex(me=>me.projectName===$);if(Y>=0){const Je=t.value[Y].threads.filter(ut=>ut.id!==i),Xe={projectName:$,threads:[B,...Je]},Lt=[...t.value];Lt.splice(Y,1,Xe),t.value=Lt}else t.value=[{projectName:$,threads:[B]},...t.value];const re=ys(G.value,t.value);La(G.value,re)||(G.value=re,ui(G.value)),$t()}function _t(i){const d=new Set(i.map(re=>re.id)),v=n.value.trim();v&&d.add(v);const T=_h(D.value,d,{preserveLegacyThreadContexts:!1,preserveNewThreadContext:!1});T!==D.value&&(D.value=T,K.value=xn(n.value),jn(K.value),hl(T));const N=_h(ee.value,d);N!==ee.value&&(ee.value=N,j.value=pl(N,n.value),Ju(N));const $=hn(he.value,d);$!==he.value&&(he.value=$,bh($)),se.value=hn(se.value,d),ke.value=hn(ke.value,d),Te.value=hn(Te.value,d),De.value=hn(De.value,d),r.value=hn(r.value,d),o.value=hn(o.value,d),s.value=hn(s.value,d),l.value=hn(l.value,d),c.value=hn(c.value,d),Be.value=hn(Be.value,d),ze.value=hn(ze.value,d),Ne.value=hn(Ne.value,d),Ce.value=hn(Ce.value,d),Ye.value=hn(Ye.value,d),rt.value=hn(rt.value,d),Ve.value=hn(Ve.value,d);const B=hn(f.value,d);B!==f.value&&(f.value=B,L()),qe.value=hn(qe.value,d),I.value=hn(I.value,d),p.value=hn(p.value,d);const Y={};for(const[re,me]of Object.entries(Le.value))(re===gs||d.has(re))&&(Y[re]=me);Le.value=Y}function zn(i){const d=Pr(t.value).find(v=>v.id===i);d&&(he.value={...he.value,[i]:d.updatedAtIso},bh(he.value),I.value[i]&&(I.value=xt(I.value,i)),$t())}function cn(i,d){if(!i)return;const v=Be.value[i];if(d){if(iE(v,d))return;Be.value={...Be.value,[i]:d}}else v&&(Be.value=xt(Be.value,i))}function an(i,d){!i||p.value[i]===!0===d||(d?p.value={...p.value,[i]:!0}:(p.value=xt(p.value,i),Gn(i),Qt(i)),$t(),!d&&!Mn()&&H&&Jt())}function Qt(i){i&&(Ye.value[i]&&(Ye.value=xt(Ye.value,i)),rt.value[i]&&(rt.value=xt(rt.value,i)),Ve.value[i]&&(Ve.value=xt(Ve.value,i)))}function Nr(i){i&&(Ye.value={...Ye.value,[i]:!0},rt.value[i]&&(rt.value=xt(rt.value,i)),Ve.value[i]&&(Ve.value=xt(Ve.value,i)))}function nr(i){i&&Ye.value[i]===!0&&rt.value[i]===!0&&Ve.value[i]===!0&&Qt(i)}function rr(i,d){!i||!d||Ye.value[i]===!0&&Qt(i)}function Co(i){const d=Object.keys(Ye.value);if(d.length===0)return;let v=rt.value,T=!1;for(const N of d)!i.has(N)||v[N]===!0||(v={...v,[N]:!0},T=!0);if(T){rt.value=v;for(const N of d)nr(N)}}function Wt(i,d){i&&Ye.value[i]===!0&&d.some(v=>v.role==="user")&&(Ve.value[i]!==!0&&(Ve.value={...Ve.value,[i]:!0}),nr(i))}function kr(i){i&&i!==n.value&&I.value[i]!==!0&&(I.value={...I.value,[i]:!0},$t())}function kt(i,d){if(!i)return;const v=ze.value[i];if(!d){v&&(ze.value=xt(ze.value,i));return}const T=Ko(d.label)||"Thinking",N=d.details.map(Y=>Ko(Y)).filter(Y=>Y.length>0&&Y!==T),$=Array.from(new Set([...(v==null?void 0:v.details)??[],...N])).slice(-3),B={label:T,details:$};lE(v,B)||(ze.value={...ze.value,[i]:B})}function St(i,d,v={}){if(!i)return;const T=Ne.value[i],N=d?Ac(d):"";if(!N){T&&(Ne.value=xt(Ne.value,i));return}const $=v.transient===!0;(T==null?void 0:T.message)===N&&T.transient===$||(Ne.value={...Ne.value,[i]:{message:N,transient:$}})}function An(i){var d;i&&(d=Ne.value[i])!=null&&d.transient&&St(i,null)}function wn(){const i=Object.entries(Ne.value).filter(([,v])=>v==null?void 0:v.transient).map(([v])=>v);if(i.length===0)return;let d=Ne.value;for(const v of i)d=xt(d,v);Ne.value=d}function nn(i){const d=Pr(t.value).find(v=>v.id===i);return(d==null?void 0:d.updatedAtIso)??""}function Lr(i,d){if(!i)return;const v={...wt.value};d?v[i]=!0:delete v[i],wt.value=v,KI(v)}function Or(){const i=n.value;i&&Lr(i,!wr.value)}function bn(i,d){const v=r.value[i]??[];Ss(v,d)||(r.value={...r.value,[i]:d})}function jr(i,d){const v=o.value[i]??[];Ss(v,d)||(o.value={...o.value,[i]:d})}function Dr(i){i&&i in o.value&&(o.value=xt(o.value,i))}function Vn(i,d){const v=c.value[i]??[];Ss(v,d)||(c.value={...c.value,[i]:d})}function In(i,d){const v=a.value[i]??[];Ss(v,d)||(a.value={...a.value,[i]:d})}function Ft(i,d){const v=a.value[i]??[],T=vl(v,d);In(i,T)}function or(i,d){const v=o.value[i]??[],T=vl(v,d);jr(i,T)}function P(i,d){const v=c.value[i]??[],T=vl(v,d);Vn(i,T)}function U(i,d){if(!i)return;const v=d.trim(),T=s.value[i]??"";if(v.length===0){if(!T)return;s.value=xt(s.value,i);return}T!==v&&(s.value={...s.value,[i]:v})}function oe(i,d){if(!i)return;const v=s.value[i]??"";U(i,`${v}${d}`)}function xe(i){i&&i in s.value&&(s.value=xt(s.value,i))}function vt(i){i&&i in a.value&&(a.value=xt(a.value,i))}function dn(i){i&&i in c.value&&(c.value=xt(c.value,i))}function Gn(i){i&&(vt(i),xe(i),kt(i,null),n.value,l.value[i]&&(l.value=xt(l.value,i)),Ce.value[i]&&(Ce.value=xt(Ce.value,i)),to(i))}function zt(i){return i==="completed"?"completed":i==="inProgress"||i==="in_progress"?"inProgress":"pending"}function rn(i){var v;const d=[];(v=i.explanation)!=null&&v.trim()&&d.push(i.explanation.trim());for(const T of i.steps){const N=T.status==="completed"?"x":T.status==="inProgress"?"~":" ";d.push(`- [${N}] ${T.step}`)}return d.join(`
52
+ `).trim()}function En(i){if(i.method!=="turn/plan/updated")return null;const d=We(i.params),v=sn(i),T=Me(d==null?void 0:d.turnId)||Me(d==null?void 0:d.turn_id),$=(Array.isArray(d==null?void 0:d.plan)?d==null?void 0:d.plan:[]).map(re=>We(re)).map(re=>({step:Me(re==null?void 0:re.step),status:zt(re==null?void 0:re.status)})).filter(re=>re.step.length>0);if(!v||!T)return null;const Y={explanation:Me(d==null?void 0:d.explanation).trim()||void 0,steps:$,isStreaming:!0};return{threadId:v,message:{id:`${T}:plan`,role:"assistant",text:rn(Y),messageType:"plan.live",plan:Y}}}function ar(i){if(i.method!=="item/plan/delta")return null;const d=We(i.params),v=sn(i),T=Me(d==null?void 0:d.turnId)||Me(d==null?void 0:d.turn_id),N=Me(d==null?void 0:d.delta);if(!v||!T||!N)return null;const $=`${T}:plan`,B=(a.value[v]??[]).find(me=>me.id===$),Y=`${(B==null?void 0:B.text)??""}${N}`,re=B!=null&&B.plan?{...B.plan,isStreaming:!0}:void 0;return{threadId:v,message:{id:$,role:"assistant",text:Y,messageType:"plan.live",plan:re}}}function We(i){return i!==null&&typeof i=="object"&&!Array.isArray(i)?i:null}function Me(i){return typeof i=="string"?i:""}function Ct(i){return typeof i=="number"&&Number.isFinite(i)?i:null}function sr(i){const d=We(i);if(!d)return null;const v=Ct(d.totalTokens??d.total_tokens),T=Ct(d.inputTokens??d.input_tokens),N=Ct(d.cachedInputTokens??d.cached_input_tokens),$=Ct(d.outputTokens??d.output_tokens),B=Ct(d.reasoningOutputTokens??d.reasoning_output_tokens);return v===null||T===null||N===null||$===null||B===null?null:{totalTokens:v,inputTokens:T,cachedInputTokens:N,outputTokens:$,reasoningOutputTokens:B}}function Cr(i){const d=We(i);if(!d)return null;const v=sr(d.total),T=sr(d.last);if(!v||!T)return null;const N=Ct(d.modelContextWindow??d.model_context_window),$=T.totalTokens,B=typeof N=="number"?Math.max(N-$,0):null,Y=typeof N=="number"&&N>0?jm(Math.round((B??0)/N*100),0,100):null;return{total:v,last:T,modelContextWindow:N,currentContextTokens:$,remainingContextTokens:B,remainingContextPercent:Y}}function Us(i){if(i.method!=="thread/tokenUsage/updated")return null;const d=We(i.params),v=sn(i),T=Cr((d==null?void 0:d.tokenUsage)??(d==null?void 0:d.token_usage));return!v||!T?null:{threadId:v,usage:T}}function sn(i){const d=We(i.params);if(!d)return"";const v=Me(d.threadId);if(v)return v;const T=Me(d.thread_id);if(T)return T;const N=Me(d.conversationId);if(N)return N;const $=Me(d.conversation_id);if($)return $;const B=We(d.thread),Y=Me(B==null?void 0:B.id);if(Y)return Y;const re=We(d.turn),me=Me(re==null?void 0:re.threadId);if(me)return me;const Je=Me(re==null?void 0:re.thread_id);return Je||""}function ro(i){if(i.method!=="turn/completed")return"";const d=We(i.params),v=We(d==null?void 0:d.turn);if(!v||v.status!=="failed")return"";const T=We(v.error);return Me(T==null?void 0:T.message)}function Pn(i){var T;if(i.method!=="error")return null;const d=We(i.params),v=Me(d==null?void 0:d.message)||Me((T=We(d==null?void 0:d.error))==null?void 0:T.message);return v?{message:v,transient:(d==null?void 0:d.willRetry)===!0}:null}function Fr(i){const d=We(i);if(!d)return null;const v=d.id,T=Me(d.method),N=d.params;if(typeof v!="number"||!Number.isInteger(v)||!T)return null;const $=We(N),B=zo(T,$),Y=Me($==null?void 0:$.threadId)||Me($==null?void 0:$.thread_id)||Me($==null?void 0:$.conversationId)||Me($==null?void 0:$.conversation_id)||gs,re=Me($==null?void 0:$.turnId)||Me($==null?void 0:$.turn_id),me=Me($==null?void 0:$.itemId)||Me($==null?void 0:$.item_id)||Me($==null?void 0:$.callId)||Me($==null?void 0:$.call_id),Je=Me(d.receivedAtIso)||new Date().toISOString();return{id:v,method:B,threadId:Y,turnId:re,itemId:me,receivedAtIso:Je,params:N??null}}function zo(i,d){const v=i.trim();return v&&(v==="item/commandExecution/requestApproval"||v==="execCommandApproval"||v==="exec_approval_request"||Vo(d)?"item/commandExecution/requestApproval":v==="item/fileChange/requestApproval"||v==="applyPatchApproval"||v==="apply_patch_approval_request"||So(d)?"item/fileChange/requestApproval":v==="item/tool/requestUserInput"||v==="request_user_input"||Go(d)?"item/tool/requestUserInput":v==="mcpServer/elicitation/request"||v==="elicitation_request"||ya(d)?"mcpServer/elicitation/request":v==="item/permissions/requestApproval"||Ur(d)?"item/permissions/requestApproval":v==="item/tool/call"||v==="dynamic_tool_call_request"||ir(d)?"item/tool/call":v)}function Vo(i){if(!i)return!1;const d=i.command;return Array.isArray(d)&&d.some(v=>typeof v=="string"&&v.trim().length>0)||typeof d=="string"&&d.trim().length>0?!0:Array.isArray(i.commandActions)}function So(i){return i?typeof i.grantRoot=="string"&&i.grantRoot.trim().length>0||typeof i.grant_root=="string"&&i.grant_root.trim().length>0||We(i.fileChanges)?!0:We(i.changes)!==null:!1}function Go(i){return!!(i&&Array.isArray(i.questions))}function ir(i){return i?typeof i.toolName=="string"||typeof i.tool_name=="string"||typeof i.name=="string"||Array.isArray(i.arguments):!1}function ya(i){if(!i)return!1;const d=Me(i.mode);return typeof i.serverName=="string"&&typeof i.threadId=="string"&&typeof i.message=="string"&&(d==="form"||d==="url")}function Ur(i){return i?typeof i.threadId=="string"&&typeof i.turnId=="string"&&typeof i.itemId=="string"&&We(i.permissions)!==null:!1}function xo(i){if(i.method!=="item/tool/requestUserInput")return[];const d=We(i.params),v=Array.isArray(d==null?void 0:d.questions)?d.questions:[],T=[];for(const N of v){const $=We(N),B=Me($==null?void 0:$.id).trim();B&&T.push(B)}return T}function Kn(i){const d=i.threadId||gs,v=Le.value[d]??[],T=v.findIndex($=>$.id===i.id),N=[...v];T>=0?N.splice(T,1,i):N.push(i),Le.value={...Le.value,[d]:N.sort(($,B)=>$.receivedAtIso.localeCompare(B.receivedAtIso))},$t()}function Sr(i){const d={};for(const[v,T]of Object.entries(Le.value)){const N=T.filter($=>$.id!==i);N.length>0&&(d[v]=N)}Le.value=d,$t()}function xr(i){const d={};for(const v of i){const T=v.threadId||gs,N=d[T]??[];N.push(v),d[T]=N}for(const v of Object.values(d))v.sort((T,N)=>T.receivedAtIso.localeCompare(N.receivedAtIso));Le.value=d}function wa(i){if(i.method==="server/request"){const d=Fr(i.params);return d&&Kn(d),!0}if(i.method==="server/request/resolved"){const d=We(i.params),v=d==null?void 0:d.id;return typeof v=="number"&&Number.isInteger(v)&&Sr(v),!0}return!1}function Ko(i){return i.replace(/\s+/gu," ").trim()}function oo(i){const d=sn(i);if(!d)return null;if(i.method==="turn/started")return{threadId:d,activity:{label:"Thinking",details:[]}};if(i.method==="item/started"){const v=We(i.params),T=We(v==null?void 0:v.item),N=Me(T==null?void 0:T.type).toLowerCase();if(N==="reasoning")return{threadId:d,activity:{label:"Thinking",details:[]}};if(N==="agentmessage")return{threadId:d,activity:{label:"Writing response",details:[]}};if(N==="commandexecution"){const $=Me(T==null?void 0:T.command);return{threadId:d,activity:{label:"Running command",details:$?[$]:[]}}}if(N==="filechange"){const B=(Array.isArray(T==null?void 0:T.changes)?T.changes:[])[0],Y=Me(B==null?void 0:B.path);return{threadId:d,activity:{label:"Applying changes",details:Y?[Y]:[]}}}}return i.method==="item/commandExecution/outputDelta"?{threadId:d,activity:{label:"Running command",details:[]}}:i.method==="item/fileChange/outputDelta"?{threadId:d,activity:{label:"Applying changes",details:[]}}:i.method==="item/reasoning/summaryTextDelta"||i.method==="item/reasoning/summaryPartAdded"?{threadId:d,activity:{label:"Thinking",details:[]}}:i.method==="item/agentMessage/delta"?{threadId:d,activity:{label:"Writing response",details:[]}}:null}function lr(i){if(i.method!=="turn/started")return null;const d=We(i.params);if(!d)return null;const v=sn(i);if(!v)return null;const T=We(d.turn),N=Me(T==null?void 0:T.id)||Me(d.turnId)||`${v}:unknown`;if(!N)return null;const $=Ra(Me(T==null?void 0:T.startedAt))??Ra(Me(d.startedAt))??Ra(i.atIso)??Date.now();return{threadId:v,turnId:N,startedAtMs:$}}function Ao(i){if(i.method!=="turn/completed")return null;const d=We(i.params);if(!d)return null;const v=sn(i);if(!v)return null;const T=We(d.turn),N=Me(T==null?void 0:T.id)||Me(d.turnId)||`${v}:unknown`;if(!N)return null;const $=Ra(Me(T==null?void 0:T.completedAt))??Ra(Me(d.completedAt))??Ra(i.atIso)??Date.now(),B=Ra(Me(T==null?void 0:T.startedAt))??Ra(Me(d.startedAt))??void 0;return{threadId:v,turnId:N,completedAtMs:$,startedAtMs:B}}function Io(i){return`${i}:live-reasoning`}function yn(i){const d=r.value[i]??[];let v=-1;for(const T of d)typeof T.turnIndex=="number"&&Number.isFinite(T.turnIndex)&&(v=Math.max(v,T.turnIndex));return v+1}function Rn(i,d,v){if(!i||!d||!Number.isInteger(v)||v<0)return;const T=De.value[i]??{};T[d]!==v&&(De.value={...De.value,[i]:{...T,[d]:v}})}function ur(i,d){const v=De.value[i]??{},T=Object.entries(v),N=Object.entries(d);T.length===N.length&&T.every(([$,B])=>d[$]===B)||(De.value={...De.value,[i]:{...d}})}function Ua(i){const d=c.value[i];if(!d||d.length===0)return;const v=De.value[i]??{};let T=!1;const N=d.map($=>{if(typeof $.turnIndex=="number"||!$.turnId)return $;const B=v[$.turnId];return typeof B!="number"?$:(T=!0,{...$,turnIndex:B})});T&&(c.value={...c.value,[i]:N})}function Ar(i){const d=We(i.params);if(!d)return"";if(i.method==="item/started"){const v=We(d.item);return!v||v.type!=="reasoning"?"":Me(v.id)}return""}function cr(i){const d=We(i.params);if(!d)return null;if(i.method==="item/reasoning/summaryTextDelta"){const v=Me(d.itemId),T=Me(d.delta);return!v||!T?null:{messageId:Io(v),delta:T}}return null}function ba(i){const d=We(i.params);if(!d)return"";if(i.method==="item/reasoning/summaryPartAdded"){const v=Me(d.itemId);return v?Io(v):""}return""}function Ba(i){const d=We(i.params);if(!d)return"";if(i.method==="item/completed"){const v=We(d.item);return!v||v.type!=="reasoning"?"":Io(Me(v.id))}return""}function qa(i){const d=We(i.params);if(!d)return"";if(i.method==="item/started"){const v=We(d.item);return!v||v.type!=="agentMessage"?"":Me(v.id)}return""}function Eo(i){const d=We(i.params);if(!d)return null;if(i.method==="item/agentMessage/delta"){const v=Me(d.itemId),T=Me(d.delta);return!v||!T?null:{messageId:v,delta:T}}return null}function _a(i){const d=We(i.params);if(!d)return null;if(i.method==="item/completed"){const v=We(d.item);if(!v||v.type!=="agentMessage")return null;const T=Me(v.id),N=Me(v.text);return!T||!N?null:{id:T,role:"assistant",text:N,messageType:"agentMessage.live"}}return null}function Po(i){return`/codex-local-image?path=${encodeURIComponent(i)}`}function Br(i){const d=i.trim();if(!d)return"";if(d.startsWith("data:")||d.startsWith("http://")||d.startsWith("https://")||d.startsWith("/codex-local-image?"))return d;const v=d.replace(/\s+/gu,"");return/^[A-Za-z0-9+/]+={0,2}$/u.test(v)?`data:image/png;base64,${v}`:""}function Ro(i){if(i.method!=="item/completed")return null;const d=We(i.params),v=We(d==null?void 0:d.item);if(!v)return null;const T=Me(v.id);if(!T)return null;if(v.type==="imageView"){const B=Me(v.path);return B?{id:T,role:"assistant",text:"",images:[Po(B)],messageType:"imageView"}:null}if(v.type!=="imageGeneration"&&v.type!=="image_generation")return null;const N=Me(v.result),$=N?Br(N):"";return $?{id:T,role:"assistant",text:"",images:[$],messageType:"imageView"}:null}function Yo(i){var me;if(i.method!=="item/started")return null;const d=We(i.params),v=We(d==null?void 0:d.item);if(!v||v.type!=="commandExecution")return null;const T=Me(v.id),N=Me(v.command);if(!T)return null;const $=typeof v.cwd=="string"?v.cwd:null,B=sn(i),Y=Me(d==null?void 0:d.turnId)||Me(d==null?void 0:d.turn_id),re=B&&Y?(me=De.value[B])==null?void 0:me[Y]:void 0;return{id:T,role:"system",text:N,messageType:"commandExecution",commandExecution:{command:N,cwd:$,status:"inProgress",aggregatedOutput:"",exitCode:null},turnId:Y||void 0,turnIndex:typeof re=="number"?re:void 0}}function Ir(i){if(i.method!=="item/commandExecution/outputDelta")return null;const d=We(i.params);if(!d)return null;const v=Me(d.itemId),T=Me(d.delta);return!v||!T?null:{itemId:v,delta:T}}function Ut(i){var ut;if(i.method!=="item/completed")return null;const d=We(i.params),v=We(d==null?void 0:d.item);if(!v||v.type!=="commandExecution")return null;const T=Me(v.id),N=Me(v.command);if(!T)return null;const $=typeof v.cwd=="string"?v.cwd:null,B=Me(v.status),Y=B==="failed"?"failed":B==="declined"?"declined":B==="interrupted"?"interrupted":"completed",re=typeof v.aggregatedOutput=="string"?v.aggregatedOutput:"",me=typeof v.exitCode=="number"?v.exitCode:null,Je=sn(i),Xe=Me(d==null?void 0:d.turnId)||Me(d==null?void 0:d.turn_id),Lt=Je&&Xe?(ut=De.value[Je])==null?void 0:ut[Xe]:void 0;return{id:T,role:"system",text:N,messageType:"commandExecution",commandExecution:{command:N,cwd:$,status:Y,aggregatedOutput:re,exitCode:me},turnId:Xe||void 0,turnIndex:typeof Lt=="number"?Lt:void 0}}function Vr(i){var me;if(i.method!=="item/completed")return null;const d=We(i.params),v=We(d==null?void 0:d.item);if(!v||v.type!=="fileChange")return null;const T=Me(v.id);if(!T)return null;const N=Me(d==null?void 0:d.threadId),$=Me(d==null?void 0:d.turnId),B=N&&$?(me=De.value[N])==null?void 0:me[$]:void 0,Y=pm(v.changes),re=hm(v.status);return Y.length===0||re!=="completed"?null:{id:T,role:"system",text:"",messageType:"fileChange",fileChangeStatus:re,fileChanges:Y,turnId:$||void 0,turnIndex:typeof B=="number"?B:void 0}}function Ta(i,d){const v=l.value[i]??[],T=vl(v,d);T!==v&&(l.value={...l.value,[i]:T})}function Bs(i,d){const v=l.value[i];if(!v||v.length===0)return;const T=new Set(d.map($=>$.id)),N=v.filter($=>!T.has($.id));N.length!==v.length&&(N.length===0?l.value=xt(l.value,i):l.value={...l.value,[i]:N})}function ka(i,d){const v=c.value[i];if(!v||v.length===0)return;const T=new Set(d.map(Y=>Y.id)),N=new Set(d.filter(Y=>Y.messageType==="fileChange"&&typeof Y.turnId=="string"&&Y.turnId.length>0).map(Y=>Y.turnId)),$=new Set(d.filter(Y=>Y.messageType==="fileChange"&&typeof Y.turnIndex=="number").map(Y=>Y.turnIndex)),B=v.filter(Y=>!T.has(Y.id)&&!(Y.turnId&&N.has(Y.turnId))&&!(typeof Y.turnIndex=="number"&&$.has(Y.turnIndex)));B.length!==v.length&&(B.length===0?c.value=xt(c.value,i):c.value={...c.value,[i]:B})}function Ca(i){if(i.method==="item/agentMessage/delta")return!0;const d=We(i.params);if(!d)return!1;if(i.method==="item/completed"){const v=We(d.item);return(v==null?void 0:v.type)==="agentMessage"}return!1}function qs(i){var Vi,fs,Gi,Ki,Yi;if(wa(i))return;if(i.method==="account/rateLimits/updated"&&tr(),i.method==="thread/name/updated"){const st=We(i.params),Er=Me(st==null?void 0:st.threadId),ea=Me(st==null?void 0:st.threadName);Er&&ea&&(ne.value={...ne.value,[Er]:ea},$t(),zu(Er,ea))}if(i.method==="account/rateLimits/updated"){Kt(ym(i.params));return}const d=Us(i);if(d){wo(d.threadId,d.usage);return}const v=oo(i);v&&kt(v.threadId,v.activity);const T=sn(i),N=Pn(i);!N&&T&&An(T);const $=lr(i);$&&(Zn.set($.turnId,$),Rn($.threadId,$.turnId,yn($.threadId)),Ce.value={...Ce.value,[$.threadId]:$.turnId},rr($.threadId,$.turnId),vt($.threadId),dn($.threadId),cn($.threadId,null),St($.threadId,null),an($.threadId,!0),us($.threadId),I.value[$.threadId]&&(I.value=xt(I.value,$.threadId)));const B=Ao(i),Y=ro(i),re=(B==null?void 0:B.threadId)??sn(i),me=re?On(re):"",Je=!!re&&!!Y&&me!==io&&ml(new Error(Y));if(B){gt.value[B.threadId];const st=Zn.get(B.turnId);st&&Zn.delete(B.turnId);const Er=Ct((Vi=We(i.params))==null?void 0:Vi.durationMs)??Ct((Gi=We((fs=We(i.params))==null?void 0:fs.turn))==null?void 0:Gi.durationMs)??(typeof B.startedAtMs=="number"?B.completedAtMs-B.startedAtMs:null)??(st?B.completedAtMs-st.startedAtMs:null),ea=typeof Er=="number"?Math.max(0,Er):0;cn(B.threadId,{turnId:B.turnId,durationMs:ea}),Ce.value[B.threadId]&&(Ce.value=xt(Ce.value,B.threadId)),an(B.threadId,!1),kt(B.threadId,null),kr(B.threadId),Je||(to(B.threadId),us(B.threadId))}if(Y){const st=(B==null?void 0:B.threadId)||sn(i);st&&St(st,Y),Q.value=Y,st&&Je&&ga(st)}else B&&St(B.threadId,null);if(N){const st=T,Er=st?On(st):K.value.trim();st&&St(st,N.message,{transient:N.transient}),Q.value=N.message,Er!==io&&ml(new Error(N.message))&&(st?ga(st):Dt())}const Xe=En(i);Xe&&(Ft(Xe.threadId,Xe.message),kt(Xe.threadId,{label:"Planning",details:((Ki=Xe.message.plan)==null?void 0:Ki.steps.map(st=>st.step).slice(0,2))??[]}));const Lt=ar(i);if(Lt&&(Ft(Lt.threadId,Lt.message),kt(Lt.threadId,{label:"Planning",details:[]})),!T||T!==n.value)return;qa(i);const ut=Eo(i);if(ut){const st=(o.value[T]??[]).find(ea=>ea.id===ut.messageId),Er=`${(st==null?void 0:st.text)??""}${ut.delta}`;or(T,{id:ut.messageId,role:"assistant",text:Er,messageType:"agentMessage.live"})}const fn=_a(i);fn&&or(T,fn);const Gr=Ro(i);Gr&&or(T,Gr),Ar(i);const ds=cr(i);if(ds&&oe(T,ds.delta),ba(i)){const st=s.value[T]??"";st.trim().length>0&&!st.endsWith(`
53
+
54
+ `)&&U(T,`${st}
55
+
56
+ `)}Ba(i);const xa=Yo(i);xa&&(Ta(T,xa),kt(T,{label:"Running command",details:[((Yi=xa.commandExecution)==null?void 0:Yi.command)??""]}));const za=Ir(i);if(za){const st=(l.value[T]??[]).find(Er=>Er.id===za.itemId);st!=null&&st.commandExecution&&Ta(T,{...st,commandExecution:{...st.commandExecution,aggregatedOutput:`${st.commandExecution.aggregatedOutput}${za.delta}`}})}const Zo=Ut(i);Zo&&Ta(T,Zo);const zi=Vr(i);if(zi&&P(T,zi),Ca(i)&&xe(T),i.method==="turn/completed"){Cn=!1,xe(T),l.value[T]&&(l.value=xt(l.value,T));const st=sn(i);st&&(an(st,!1),kt(st,null),kr(st),Je||(to(st),us(st)))}}function Mo(i){if(i.method==="thread/tokenUsage/updated")return;const d=i.method,v=d==="turn/started"||d==="turn/completed"||d==="error",T=d.startsWith("thread/")||d==="turn/completed";if(!v&&!T)return;const N=sn(i);N&&v&&F.add(N),T&&(yt=!0),!(ge!==null||typeof window>"u")&&(ge=window.setTimeout(()=>{ge=null,ao()},Yu))}async function Qo(i,d){if(!qt){qt=!0;try{if(!d)return;const v=[];for(const T of eu(d)){const N=ss(T);v.includes(N)||v.push(N)}if(v.length>0){const T=d.projectOrder.length>0?ys(v,i):ys(G.value,i);La(G.value,T)||(G.value=T)}if(Object.keys(d.labels).length>0||(d.remoteProjects??[]).length>0){const T={...ye.value};let N=!1;for(const[$,B]of Object.entries(d.labels)){const Y=ot($).trim(),re=[ss($)];Y&&re.push(Y);for(const me of re)T[me]!==B&&(T[me]=B,N=!0)}for(const $ of d.order){const B=ss($),Y=Jr(Ms($));if(!Y.startsWith(".")||Y===B)continue;const re=`${B} ${Y}`;T[B]!==void 0||T[B]===re||(T[B]=re,N=!0)}for(const $ of d.remoteProjects??[]){const B=yE($);T[$.id]!==B&&(T[$.id]=B,N=!0)}N&&(ye.value=T)}}catch{}}}async function Jo(){if(!(Object.keys(ne.value).length>0))try{const i=await J_();Object.keys(i.titles).length>0&&(ne.value=i.titles)}catch{}}async function Nt(){try{return await _s()}catch{return null}}async function Hs(i,d,v){if(ne.value[i])return;const T=d.trim();if(!T)return;const N=T.length>300?T.slice(0,300):T;try{const $=await nT(N,v);if(!$||ne.value[i])return;ne.value={...ne.value,[i]:$},$t(),zu(i,$)}catch{}}function y(i,d){const v=Ec(i,d),T=TE(i,d),N=kE(T,d,v);if(!d||d.order.length===0&&(d.remoteProjects??[]).length===0)return N;const $=new Set;for(const Y of Ic(d,v))$.add(Y);const B=N.filter(Y=>$.has(Y.projectName)?!0:Pc(Y));return _E(B,d,v)}function b(i,d){const v=y(i,d),T=!!(d&&(d.order.length>0||d.projectOrder.length>0||(d.remoteProjects??[]).length>0)),N=d!=null&&d.projectOrder.length?ys(Ic(d,Ec(i,d)),v):ys(G.value,v);La(G.value,N)||(G.value=N,T||ui(G.value));const $=Xu(v,G.value);Co(new Set(Pr($).map(Y=>Y.id)));const B=vE(t.value,$,p.value);t.value=gl(t.value,B),p.value=hn(p.value,new Set(Pr(t.value).map(Y=>Y.id))),$t()}function w(i){const d={};for(const[v,T]of Object.entries(i)){const N=v.trim();!N||T.length===0||(d[N]=T.map($=>({id:$.id,text:$.text,imageUrls:[...$.imageUrls],skills:$.skills.map(B=>({name:B.name,path:B.path})),fileAttachments:$.fileAttachments.map(B=>({label:B.label,path:B.path,fsPath:B.fsPath})),collaborationMode:$.collaborationMode})))}return d}function L(){$_(w(f.value)).catch(()=>{})}async function Pe(){if(!_){_=!0;try{f.value=await rh()}catch{}}}function lt(i){He=xh(He,i),t.value=xh(t.value,i),p.value=xt(p.value,i),$t()}function Vt(i,d){if(i.length===0)return d;if(d.length===0)return i;const v=new Map;for(const N of Pr(i))v.set(N.id,N);for(const N of Pr(d))v.set(N.id,N);const T=new Map;for(const N of v.values()){const $=T.get(N.projectName);$?$.push(N):T.set(N.projectName,[N])}return Array.from(T.entries()).map(([N,$])=>({projectName:N,threads:$.sort((B,Y)=>new Date(Y.updatedAtIso).getTime()-new Date(B.updatedAtIso).getTime())})).sort((N,$)=>{var re,me;const B=new Date(((re=N.threads[0])==null?void 0:re.updatedAtIso)??0).getTime();return new Date(((me=$.threads[0])==null?void 0:me.updatedAtIso)??0).getTime()-B})}function Mn(){return Object.values(p.value).some(i=>i===!0)}function Jt(i=Tt){if(!(!H||ve||Mn())){if(Tt=i,typeof window>"u"){Yn(i);return}X!==null&&window.clearTimeout(X),X=window.setTimeout(()=>{X=null,!(!H||Mn())&&Yn(Tt)},MI)}}async function Yn(i){if(!(ve||!H||Mn())){ve=!0;try{const d=await Kf(H,V0());H=d.nextCursor,Ie=d.nextCursor===null,He=Vt(He,d.groups),b(He,i)}catch{}finally{ve=!1,H&&!Mn()&&Jt(i)}}}async function dr(){if(at){await at;return}at=(async()=>{var i;pe.value||(Fe.value=!0);try{const[d,v]=await Promise.all([Kf(),Nt(),Jo()]);Tt=v;const T=d.groups;He=pe.value?Vt(He,T):T,H=pe.value&&!Ie?H:d.nextCursor,Ie=d.nextCursor===null,await Qo(T,v),b(He,v),pe.value=!0,Ie||Jt(v);const N=Pr(e.value);_t(N),!N.some(B=>B.id===n.value)&&!n.value&&dt(((i=N[0])==null?void 0:i.id)??"")}finally{Fe.value=!1}})().finally(()=>{at=null}),await at}async function fr(i,d={}){if(!i)return;const v=mt.get(i);if(v){await v;return}const T=se.value[i]===!0,N=d.silent!==!0&&!T;N&&(Ke.value=!0);const $=(async()=>{try{const B=nn(i),Y=ke.value[i]??"",re=Date.now()-(z.get(i)??0)<LI;if(T&&(re||(B.length===0||Y===B)&&p.value[i]!==!0)){zn(i);return}const Xe=Te.value[i]!==!0?await Bu(i):null,Lt=Xe??await Yf(i);Xe&&(eo(i,Xe.model),Te.value={...Te.value,[i]:!0});const{messages:ut,inProgress:fn,activeTurnId:Gr,turnIndexByTurnId:ds}=Lt;Wt(i,ut),ur(i,ds),Ua(i);const Wi=r.value[i]??[],xa=rE(Wi,ut,{preserveMissing:d.silent===!0});bn(i,xa);const za=o.value[i]??[];if(fn){const Zo=aE(za,ut);jr(i,Zo)}else Dr(i);Bs(i,ut),ka(i,ut),se.value={...se.value,[i]:!0},z.set(i,Date.now()),B&&(ke.value={...ke.value,[i]:B}),an(i,fn),Gr?Ce.value={...Ce.value,[i]:Gr}:Ce.value[i]&&(Ce.value=xt(Ce.value,i)),fn||Gn(i),zn(i)}finally{N&&(Ke.value=!1)}})().finally(()=>{mt.delete(i)});mt.set(i,$),await $}async function Xo(i,d={}){i&&se.value[i]!==!0&&await fr(i,d)}async function Ws(){if(pt){await pt;return}pt=(async()=>{var i,d;try{const v=((d=(i=Ln.value)==null?void 0:i.cwd)==null?void 0:d.trim())??"";Se.value=await oT(v?[v]:void 0)}catch{}finally{pt=null}})(),await pt}async function Fi(i={}){await Promise.allSettled([_r({providerChanged:i.providerChanged,includeProviderModels:i.includeProviderModels}),er(),_o(),Ws()])}function tu(i={}){const d=()=>{Fi(i)};if(typeof window>"u"){d();return}window.setTimeout(d,0)}async function zs(i={}){Q.value="";const d=i.includeSelectedThreadMessages!==!1,v=i.awaitAncillaryRefreshes===!0;try{await Pe(),await dr(),d&&(await _r({providerChanged:i.providerChanged,includeProviderModels:i.providerChanged===!0||v}),await fr(n.value)),v?await Fi({providerChanged:i.providerChanged,includeProviderModels:i.providerChanged===!0||v}):tu({providerChanged:i.providerChanged,includeProviderModels:!0})}catch(T){Q.value=T instanceof Error?T.message:"Unknown application error"}}async function Vs(i){dt(i);try{await fr(i),Ws()}catch(d){Q.value=d instanceof Error?d.message:"Unknown application error"}}async function nu(i){const d=n.value===i,v=d?PI(Pr(e.value),i):"";d&&(dt(v),v&&fr(v,{silent:!0}));try{await m_(i),lt(i),await dr(),d&&v&&n.value===v&&await Xo(v,{silent:!0})}catch(T){Q.value=T instanceof Error?T.message:"Unknown application error"}}async function Ha(i,d){const v=d.trim();if(!(!i||!v))try{await v_(i,v),ne.value={...ne.value,[i]:v},$t(),zu(i,v)}catch(T){Q.value=T instanceof Error?T.message:"Unknown application error"}}async function Ui(i){var B,Y;const d=i.trim();if(!d)return"";const v=Pr(t.value).find(re=>re.id===d),T=((B=v==null?void 0:v.cwd)==null?void 0:B.trim())??"",N=((Y=v==null?void 0:v.title)==null?void 0:Y.trim())??"Forked chat",$=On(d);Q.value="";try{const re=await Zf(d,T||void 0,$||void 0),me=re.threadId.trim();return me?(Yt(me,T,N),Ot(me,re.model),Te.value={...Te.value,[me]:!0},dt(me),await dr(),await fr(me),me):""}catch(re){return Q.value=re instanceof Error?re.message:"Unknown application error",""}}async function Gs(i,d){var B;const v=i.trim();if(!v||!Number.isInteger(d)||d<0)return"";if(p.value[v]===!0)return Q.value="Finish the current turn before forking from a response.","";if(se.value[v]!==!0)try{await fr(v)}catch(Y){return Q.value=Y instanceof Error?Y.message:"Unknown application error",""}const T=r.value[v]??[];let N=-1;for(const Y of T)typeof Y.turnIndex=="number"&&Number.isFinite(Y.turnIndex)&&(N=Math.max(N,Y.turnIndex));if(N>=0&&d>N)return"";const $=Pr(t.value).find(Y=>Y.id===v)??null;try{Q.value="";const Y=await Zf(v),re=Y.threadId.trim();if(!re)return"";const me=Y.cwd.trim()||((B=$==null?void 0:$.cwd)==null?void 0:B.trim())||"",Je=SE(($==null?void 0:$.title)||($==null?void 0:$.preview)||"Untitled thread");Yt(re,me,Je),Ot(re,Y.model),bn(re,Y.messages),se.value={...se.value,[re]:!0},Te.value={...Te.value,[re]:!0},vt(re),jr(re,[]),xe(re),l.value[re]&&(l.value=xt(l.value,re)),cn(re,null),kt(re,null),St(re,null),an(re,!1);const Xe=N-d;if(Xe>0){const Lt=await qu(re,Xe);bn(re,Lt)}return await Ha(re,Je),dt(re),dr().catch(()=>{}),re}catch(Y){return Q.value=Y instanceof Error?Y.message:"Unknown application error",""}}async function $o(i,d,v=[],T=[],N=[]){if(!i||!d.trim()||v.length>0||T.length>0||N.length>0)return!1;const B=(Le.value[i]??[]).filter(me=>me.method==="item/tool/requestUserInput");if(B.length!==1)return!1;const[Y]=B,re=xo(Y);return re.length!==1?!1:No({id:Y.id,result:{answers:{[re[0]]:{answers:[d.trim()]}}}})}async function Bi(i,d=[],v=[],T="steer",N=[],$,B,Y){if(V.value)return;const re=n.value,me=i.trim();if(!re||!me&&d.length===0&&N.length===0||await $o(re,me,d,v,N))return;const Je=p.value[re]===!0;if(Je&&T==="queue"){const Xe=f.value[re]??[],Lt=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,ut=[...Xe],fn=typeof $=="number"?Math.max(0,Math.min($,ut.length)):ut.length;ut.splice(fn,0,{id:Lt,text:me,imageUrls:d,skills:v,fileAttachments:N,collaborationMode:B==="plan"?"plan":B==="default"?"default":j.value}),f.value={...f.value,[re]:ut},L();return}if(Je){Cn=!0,ls(re,me,d,v,N,B,Y).catch(Xe=>{const Lt=Xe instanceof Error?Xe.message:"Unknown application error";St(re,Lt),Q.value=Lt});return}Q.value="",Cn=!0,cn(re,null),kt(re,{label:"Thinking",details:on((Y==null?void 0:Y.trim())||K.value.trim()||xn(re),te.value,B==="plan"?"plan":B==="default"?"default":j.value)}),St(re,null),an(re,!0);try{await ls(re,me,d,v,N,B,Y)}catch(Xe){Cn=!1,an(re,!1),kt(re,null);const Lt=Xe instanceof Error?Xe.message:"Unknown application error";throw St(re,Lt),Q.value=Lt,Xe}}async function Ks(i,d,v=[],T=[],N=[]){if(V.value)return"";const $=i.trim(),B=d.trim(),Y=On(sa).trim(),re=j.value;if(!$&&v.length===0&&N.length===0)return"";x.value=!0,Q.value="";let me="";try{try{const ut=await Xf(B||void 0,Y||void 0);me=ut.threadId,Ot(me,ut.model),jt(me,re)}catch(ut){if(Y&&Y!==io&&ml(ut)){await Dt();const fn=await Xf(B||void 0,io);me=fn.threadId,Ot(me,fn.model),jt(me,re)}else throw ut}if(!me)return"";Yt(me,B,$||"[Image]"),Nr(me),Te.value={...Te.value,[me]:!0},dt(me),Cn=!0,cn(me,null),kt(me,{label:"Thinking",details:on(On(me),te.value,re)}),St(me,null),an(me,!0);const Je=me,Xe=B||null,Lt=$;return ls(me,$,v,T,N,re).catch(ut=>{Cn=!1,an(me,!1),kt(me,null);const fn=ut instanceof Error?ut.message:"Unknown application error";St(me,fn),Q.value=fn}).finally(()=>{x.value=!1}),Hs(Je,Lt,Xe),me}catch(Je){Cn=!1,me&&(an(me,!1),kt(me,null));const Xe=Je instanceof Error?Je.message:"Unknown application error";throw me&&St(me,Xe),Q.value=Xe,x.value=!1,Je}}async function ls(i,d,v=[],T=[],N=[],$,B){const Y=te.value,re=$==="plan"?"plan":$==="default"?"default":j.value,me=d.trim(),Je=[...v];if(Je.length===0&&we(me)){const ut=de(i);ut&&Je.push(ut)}const Xe=T.map(ut=>({name:ut.name,path:ut.path})),Lt=N.map(ut=>({...ut}));Hn(i,{text:me,imageUrls:[...Je],skills:Xe,fileAttachments:Lt,effort:Y,collaborationMode:re,fallbackRetried:!1});try{if(Te.value[i]!==!0){const Gr=await Bu(i);eo(i,Gr.model)}const ut=(B==null?void 0:B.trim())||K.value.trim()||xn(i);let fn="";try{fn=await Hu(i,d,Je,ut||void 0,Y||void 0,T.length>0?T:void 0,N,re)}catch(Gr){if(ut&&ut!==io&&ml(Gr))await Dt(i),Hn(i,{text:me,imageUrls:[...Je],skills:Xe,fileAttachments:Lt,effort:Y,collaborationMode:re,fallbackRetried:!0}),fn=await Hu(i,d,Je,io,Y||void 0,T.length>0?T:void 0,N,re);else throw Gr}fn&&(Ce.value={...Ce.value,[i]:fn},rr(i,fn)),Te.value={...Te.value,[i]:!0},F.add(i),await ao(),To(i)}catch(ut){throw ut}}async function Ys(i){if(g.value[i]!==!0){g.value={...g.value,[i]:!0};try{f.value=await rh()}catch{}finally{g.value=xt(g.value,i)}}}function us(i){Ys(i),!(typeof window>"u")&&window.setTimeout(()=>{Ys(i)},650)}async function ru(){const i=n.value;if(!i||p.value[i]!==!0||Ye.value[i]===!0)return;let d=Ce.value[i];if(!d){const{activeTurnId:v}=await Yf(i);d=v,d&&(Ce.value={...Ce.value,[i]:d})}if(!d)throw new Error("Could not determine active turn id for interrupt");R.value=!0,Q.value="";try{await T_(i,d),an(i,!1),kt(i,null),St(i,null),Ce.value[i]&&(Ce.value=xt(Ce.value,i)),F.add(i),yt=!0,await ao()}catch(v){const T=v instanceof Error?v.message:"Failed to interrupt active turn";St(i,T),Q.value=T}finally{R.value=!1}}async function Wa(i){var Y,re;const d=n.value;if(!d||ie.value||!i.trim())return;const v=r.value[d]??[],T=v.find(me=>me.turnId===i),N=typeof(T==null?void 0:T.turnIndex)=="number"?T.turnIndex:-1;if(N<0)return;const $=v.reduce((me,Je)=>typeof Je.turnIndex=="number"&&Je.turnIndex>me?Je.turnIndex:me,-1);if($<0||N>$)return;const B=$-N+1;if(!(B<1)){ie.value=!0,Q.value="";try{const me=((re=(Y=Ln.value)==null?void 0:Y.cwd)==null?void 0:re.trim())??"";me&&await g_(d,i,me);const Je=await qu(d,B);bn(d,Je),jr(d,[]),xe(d),l.value[d]&&(l.value=xt(l.value,d)),cn(d,null),kt(d,null),St(d,null),yt=!0,await ao()}catch(me){Q.value=me instanceof Error?me.message:"Failed to rollback thread"}finally{ie.value=!1}}}let cs=null;async function ou(i,d){try{const v=await _s(),T={...v.labels};let N=!1;for(const $ of v.order){if(!kl($,i))continue;const B=d.trim();B.length===0?T[$]!==void 0&&(delete T[$],N=!0):T[$]!==B&&(T[$]=B,N=!0)}N&&await Wu({order:v.order,labels:T,active:v.active,projectOrder:v.projectOrder})}catch{}}function qi(i,d){i.length===0||(ye.value[i]??"")===d||(ye.value={...ye.value,[i]:d},Sh(ye.value),cs!==null&&clearTimeout(cs),cs=setTimeout(()=>{cs=null,ou(i,d)},500))}async function Qs(i){var $;if(i.length===0)return;const d=G.value.filter(B=>B!==i);if(La(G.value,d)||(G.value=d,ui(G.value)),t.value=t.value.filter(B=>B.projectName!==i),ye.value[i]!==void 0){const B={...ye.value};delete B[i],ye.value=B,Sh(B)}$t();const v=Pr(e.value);_t(v),v.some(B=>B.id===n.value)||dt((($=v[0])==null?void 0:$.id)??"");const N=new Set;try{const B=await _s();wE(B,i).forEach(Y=>{N.add(Y)})}catch{}if(N.size>0)try{const B=await _s(),Y=B.order.filter(Je=>!N.has(Je)),re=B.active.filter(Je=>!N.has(Je)),me=re.length===0&&Y.length>0?[Y[0]]:re;await Wu({order:Y,labels:fE(B.labels,N),active:me,projectOrder:B.projectOrder.filter(Je=>Je!==i&&!N.has(Je))});return}catch{}await Js()}function Sa(i,d){if(i.length===0||t.value.length===0)return;const v=t.value.map(re=>re.projectName),T=v.indexOf(i);if(T===-1)return;const N=Math.max(0,Math.min(d,v.length-1)),$=ZI(v,T,N);if($===v)return;const B=ys($,t.value);G.value=B,ui(G.value);const Y=Xu(t.value,G.value);t.value=gl(t.value,Y),$t(),Js()}function au(i){const d=i.trim();if(!d)return;const v=[d,...G.value.filter(N=>N!==d)];if(La(G.value,v))return;G.value=v,ui(G.value);const T=Xu(t.value,G.value);t.value=gl(t.value,T),$t(),Js()}async function Js(){try{const i=await _s(),d=bE(i,G.value,t.value);await Wu({order:d.order,labels:i.labels,active:d.active,projectOrder:d.projectOrder})}catch{}}async function ao(){if(le.value){typeof window<"u"&&ge===null&&(ge=window.setTimeout(()=>{ge=null,ao()},Yu));return}le.value=!0;const i=yt,d=new Set(F);yt=!1,F.clear();try{i&&await dr();const v=n.value;if(!v)return;const T=d.has(v),N=p.value[v]===!0,$=nn(v),B=ke.value[v]??"";($.length>0&&$!==B||N&&se.value[v]!==!0||T&&se.value[v]!==!0||i&&se.value[v]!==!0)&&await fr(v,{silent:!0})}catch{}finally{le.value=!1,(yt||F.size>0)&&typeof window<"u"&&ge===null&&(ge=window.setTimeout(()=>{ge=null,ao()},Yu))}}async function su(){await Hi(),yt=!pe.value,n.value&&se.value[n.value]!==!0&&F.add(n.value),await ao()}function iu(){typeof window>"u"||Oe||(Hi(),Oe=n_(i=>{if(i.method==="ready"){wn(),su();return}qs(i),Mo(i)}))}async function Hi(){try{const d=(await i_()).map(v=>Fr(v)).filter(v=>v!==null);xr(d)}catch{}}async function No(i){try{return await s_(i.id,{result:i.result,error:i.error}),Sr(i.id),!0}catch(d){return Q.value=d instanceof Error?d.message:"Failed to reply to server request",!1}}function lu(){if(Oe&&(Oe(),Oe=null),yt=!1,F.clear(),Zn.clear(),ge!==null&&typeof window<"u"&&(window.clearTimeout(ge),ge=null),$e!==null&&typeof window<"u"&&(window.clearTimeout($e),$e=null),X!==null&&typeof window<"u"&&(window.clearTimeout(X),X=null),typeof window<"u")for(const i of Ee.values())window.clearTimeout(i);Ee.clear(),Cn=!1,r.value={},a.value={},o.value={},s.value={},l.value={},c.value={},De.value={},ze.value={},Be.value={},Ne.value={},Ce.value={},Ye.value={},rt.value={},Ve.value={},f.value={},g.value={},L(),Ge.value=null,qe.value={}}const Xs=ae(()=>{const i=n.value;return i?f.value[i]??[]:[]});function Zs(i){const d=n.value;if(!d)return;const v=f.value[d];if(!v)return;const T=v.filter(N=>N.id!==i);f.value=T.length>0?{...f.value,[d]:T}:xt(f.value,d),L()}function uu(i,d){const v=n.value;if(!v)return;const T=f.value[v];if(!T)return;const N=T.findIndex(re=>re.id===i),$=T.findIndex(re=>re.id===d);if(N<0||$<0||N===$)return;const B=[...T],[Y]=B.splice(N,1);B.splice($,0,Y),f.value={...f.value,[v]:B},L()}function cu(i){const d=n.value;if(!d)return;const v=f.value[d];if(!v)return;const T=v.find(N=>N.id===i);T&&(Zs(i),Ht(T.collaborationMode),Bi(T.text,T.imageUrls,T.skills,"steer",T.fileAttachments))}function du(i){dt(i)}return{projectGroups:e,projectDisplayNameById:ye,selectedThread:Ln,selectedThreadTokenUsage:Zr,selectedThreadTerminalOpen:wr,isSelectedThreadInterruptPending:zr,selectedThreadServerRequests:go,selectedLiveOverlay:Sn,codexQuota:un,selectedThreadId:n,availableCollaborationModes:q,availableModelIds:O,selectedCollaborationMode:j,selectedModelId:K,selectedReasoningEffort:te,selectedSpeedMode:_e,installedSkills:Se,accountRateLimitSnapshots:Ae,messages:Rr,isLoadingThreads:Fe,isLoadingMessages:Ke,isSendingMessage:x,isInterruptingTurn:R,isUpdatingSpeedMode:V,isRollingBack:ie,error:Q,refreshAll:zs,refreshSkills:Ws,selectThread:Vs,loadMessages:fr,ensureThreadMessagesLoaded:Xo,setThreadTerminalOpen:Lr,toggleSelectedThreadTerminal:Or,archiveThreadById:nu,renameThreadById:Ha,forkThreadById:Ui,forkThreadFromTurn:Gs,rollbackSelectedThread:Wa,sendMessageToSelectedThread:Bi,sendMessageToNewThread:Ks,interruptSelectedThreadTurn:ru,selectedThreadQueuedMessages:Xs,removeQueuedMessage:Zs,reorderQueuedMessage:uu,steerQueuedMessage:cu,setSelectedCollaborationMode:Ht,readModelIdForThread:On,previewProviderModelSelection:qn,setSelectedModelIdForThread:vn,setSelectedModelId:br,setSelectedReasoningEffort:bo,updateSelectedSpeedMode:no,respondToPendingServerRequest:No,renameProject:qi,removeProject:Qs,reorderProject:Sa,pinProjectToTop:au,startPolling:iu,stopPolling:lu,primeSelectedThread:du}}const AE={class:"sidebar-root"},IE={class:"sidebar-scrollable"},EE=["aria-pressed","aria-label","title"],PE={key:1,class:"sidebar-search-bar"},RE=["placeholder"],ME=["aria-label"],$E={class:"sidebar-skills-link-icon","aria-hidden":"true"},NE={class:"sidebar-skills-link-copy"},LE={class:"sidebar-skills-link-title"},OE={class:"sidebar-skills-link-subtitle"},jE={class:"sidebar-settings-account-section"},DE={class:"sidebar-settings-account-header"},FE={class:"sidebar-settings-account-header-main"},UE=["aria-expanded","title"],BE={class:"sidebar-settings-account-collapse-icon"},qE={class:"sidebar-settings-account-title"},HE={class:"sidebar-settings-account-count"},WE=["disabled"],zE={key:0,class:"sidebar-settings-account-error"},VE={class:"sidebar-settings-account-login"},GE=["disabled"],KE=["href"],YE={key:1,class:"sidebar-settings-account-empty"},QE={key:2,class:"sidebar-settings-account-list"},JE=["title","onMouseenter","onMouseleave"],XE={class:"sidebar-settings-account-main"},ZE={class:"sidebar-settings-account-email"},eP={class:"sidebar-settings-account-meta"},tP={class:"sidebar-settings-account-quota"},nP={class:"sidebar-settings-account-id"},rP={class:"sidebar-settings-account-actions"},oP=["disabled","onClick"],aP=["disabled","onClick"],sP=["title"],iP={class:"sidebar-settings-label"},lP=["title"],uP={class:"sidebar-settings-label"},cP={class:"sidebar-settings-value"},dP=["title"],fP={class:"sidebar-settings-label"},hP={class:"sidebar-settings-value"},pP=["title"],mP={class:"sidebar-settings-label"},vP=["title"],gP={class:"sidebar-settings-label"},yP={class:"sidebar-settings-value"},wP=["title"],bP={class:"sidebar-settings-label"},_P=["title"],TP={class:"sidebar-settings-label"},kP=["title"],CP={class:"sidebar-settings-label"},SP={key:0,class:"sidebar-settings-row sidebar-settings-error"},xP={key:1,class:"sidebar-settings-row sidebar-settings-row--input"},AP={class:"sidebar-settings-provider-info"},IP={class:"sidebar-settings-label"},EP={class:"sidebar-settings-provider-link",href:"https://openrouter.ai/keys",target:"_blank",rel:"noopener noreferrer"},PP={class:"sidebar-settings-key-group"},RP={class:"sidebar-settings-key-masked"},MP=["disabled","title"],$P=["placeholder"],NP=["disabled"],LP={class:"sidebar-settings-row sidebar-settings-row--select",style:{"margin-top":"4px",padding:"0"}},OP={class:"sidebar-settings-label"},jP=["aria-label"],DP=["disabled"],FP=["disabled"],UP={key:2,class:"sidebar-settings-row sidebar-settings-row--input"},BP={class:"sidebar-settings-provider-info"},qP={class:"sidebar-settings-label"},HP={class:"sidebar-settings-provider-link",href:"https://opencode.ai/auth",target:"_blank",rel:"noopener noreferrer"},WP={class:"sidebar-settings-key-group"},zP=["placeholder"],VP=["disabled"],GP={key:3,class:"sidebar-settings-row sidebar-settings-row--input"},KP={class:"sidebar-settings-label"},YP={class:"sidebar-settings-key-group"},QP=["placeholder"],JP={class:"sidebar-settings-label",style:{"margin-top":"4px"}},XP={class:"sidebar-settings-key-group"},ZP=["placeholder"],eR=["disabled"],tR={class:"sidebar-settings-row sidebar-settings-row--select",style:{"margin-top":"4px",padding:"0"}},nR={class:"sidebar-settings-label"},rR=["aria-label"],oR=["title"],aR={class:"sidebar-settings-label"},sR={class:"sidebar-settings-label"},iR={class:"sidebar-settings-value"},lR={key:4,class:"sidebar-settings-telegram-panel"},uR={class:"sidebar-settings-field"},cR={class:"sidebar-settings-field-label"},dR={class:"sidebar-settings-field"},fR={class:"sidebar-settings-field-label"},hR={class:"sidebar-settings-field-help"},pR={key:0,class:"sidebar-settings-telegram-error"},mR={class:"sidebar-settings-telegram-actions"},vR=["disabled"],gR=["data-state","title"],yR={class:"sidebar-settings-label"},wR=["data-state"],bR={class:"sidebar-settings-context-meta"},_R={class:"sidebar-settings-rate-limits"},TR=["aria-label"],kR={class:"sidebar-settings-button-version"},CR={key:0,class:"content-keyboard-spacer","aria-hidden":"true"},SR={key:1,class:"skills-route-header-icon","aria-hidden":"true"},xR={class:"content-body"},AR={key:1,class:"content-grid content-grid-home"},IR={class:"new-thread-empty"},ER={class:"new-thread-hero"},PR=["title"],RR={class:"new-thread-folder-actions"},MR={key:1,class:"new-thread-launch-card","aria-label":"Plugins and Apps announcement"},$R={class:"new-thread-launch-card-copy"},NR={class:"new-thread-launch-card-topline"},LR={class:"new-thread-launch-card-badge","aria-hidden":"true"},OR={class:"new-thread-launch-card-eyebrow"},jR={class:"new-thread-launch-card-title"},DR={class:"new-thread-launch-card-text"},FR={class:"new-thread-launch-card-actions"},UR=["aria-label","onKeydown"],BR={class:"new-thread-open-folder-header"},qR={class:"new-thread-open-folder-title"},HR={class:"new-thread-open-folder-label"},WR={class:"new-thread-open-folder-current"},zR=["placeholder","title","disabled","onKeydown"],VR=["disabled"],GR={class:"new-thread-open-folder-actions"},KR={class:"new-thread-open-folder-toggle"},YR=["aria-pressed","disabled"],QR={key:0,class:"new-thread-open-folder-create"},JR={class:"new-thread-open-folder-create-composer"},XR=["placeholder","onKeydown"],ZR=["disabled"],eM={key:0,class:"new-thread-open-folder-error"},tM=["placeholder","onKeydown"],nM={key:1,class:"new-thread-open-folder-error-actions"},rM={class:"new-thread-open-folder-error"},oM=["disabled"],aM={key:2,class:"new-thread-open-folder-status"},sM={key:3,class:"new-thread-open-folder-status"},iM={key:4,class:"new-thread-open-folder-list"},lM=["title","disabled","onClick"],uM={class:"new-thread-open-folder-item-name"},cM=["disabled","onClick"],dM={key:3,class:"new-thread-branch-select"},fM={class:"new-thread-branch-select-label"},hM={class:"new-thread-branch-select-help"},pM={key:4,class:"new-thread-runtime-help"},mM={class:"worktree-init-status-title"},vM={class:"worktree-init-status-message"},gM={class:"composer-with-queue"},yM={key:2,class:"content-grid"},wM={class:"content-thread"},bM={class:"composer-with-queue"},_M=["aria-label"],TM={class:"codex-login-modal-header"},kM={class:"codex-login-modal-title"},CM=["aria-label","disabled"],SM={class:"codex-login-modal-copy"},xM=["href"],AM=["placeholder","disabled"],IM={key:1,class:"codex-login-modal-error"},EM={class:"codex-login-modal-actions"},PM=["disabled"],RM=["disabled"],Ah="codex-web-local.sidebar-collapsed.v1",Ih="codex-web-local.accounts-section-collapsed.v1",Eh="codex-web-local.terminal-quick-commands.v1",Ph="__toggle_terminal__",Rh="codex-web-local.send-with-enter.v1",Mh="codex-web-local.in-progress-send-mode.v1",$h="codex-web-local.dark-mode.v1",Nh="codex-web-local.dictation-click-to-toggle.v1",Lh="codex-web-local.dictation-auto-send.v1",Oh="codex-web-local.dictation-language.v1",jh="codex-web-local.chat-width.v1",MM=400,$M=Bn({__name:"App",setup(e){var Pd,Rd;const t=sl(()=>ll(()=>import("./ThreadConversation-DKfW7vC7.js"),__vite__mapDeps([0,1]))),n=sl(()=>ll(()=>import("./ThreadTerminalPanel-CrJKkAvB.js"),__vite__mapDeps([2,3]))),r=sl(()=>ll(()=>import("./ReviewPane-IP5BRZ-3.js"),__vite__mapDeps([4,5]))),a=sl(()=>ll(()=>import("./DirectoryHub-BeJqaP4D.js"),__vite__mapDeps([6,7]))),{t:o,uiLanguage:s,uiLanguageOptions:l,setUiLanguage:c}=Fa(),p="44cd",f="0.1.87",g={sendWithEnter:o("When enabled, press Enter to send. When disabled, use Command+Enter to send."),inProgressSendMode:o("If a turn is still running, choose whether a new prompt should steer the current turn or be queued."),appearance:o("Switch between system theme, light mode, and dark mode."),chatWidth:o("Choose how wide the conversation column and composer can grow on desktop screens."),dictationClickToToggle:o("Use click-to-start and click-to-stop dictation instead of hold-to-talk."),dictationAutoSend:o("Automatically send transcribed dictation when recording stops."),dictationLanguage:o("Choose transcription language or keep auto-detect.")},_={standard:{label:"Standard",columnMax:"45rem",cardMax:"76ch"},wide:{label:"Wide",columnMax:"72rem",cardMax:"88ch"},"extra-wide":{label:"Extra wide",columnMax:"96rem",cardMax:"96ch"}},I={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:O,projectDisplayNameById:q,selectedThread:ee,selectedThreadTokenUsage:D,selectedThreadTerminalOpen:j,selectedThreadServerRequests:K,selectedLiveOverlay:te,codexQuota:_e,selectedThreadId:fe,availableCollaborationModes:he,availableModelIds:Re,selectedCollaborationMode:G,selectedModelId:ye,selectedReasoningEffort:ke,selectedSpeedMode:se,installedSkills:Te,accountRateLimitSnapshots:De,messages:Be,isLoadingThreads:ze,isLoadingMessages:Ne,isSendingMessage:Ce,isInterruptingTurn:Ye,isSelectedThreadInterruptPending:rt,isUpdatingSpeedMode:Ve,refreshAll:Le,refreshSkills:gt,selectThread:Ge,ensureThreadMessagesLoaded:qe,setThreadTerminalOpen:wt,toggleSelectedThreadTerminal:ne,archiveThreadById:Se,forkThreadById:Ae,renameThreadById:Fe,forkThreadFromTurn:Ke,sendMessageToSelectedThread:x,sendMessageToNewThread:R,interruptSelectedThreadTurn:V,selectedThreadQueuedMessages:ie,removeQueuedMessage:Q,reorderQueuedMessage:le,steerQueuedMessage:pe,setSelectedCollaborationMode:be,readModelIdForThread:we,previewProviderModelSelection:de,setSelectedModelIdForThread:Oe,setSelectedReasoningEffort:ge,updateSelectedSpeedMode:$e,respondToPendingServerRequest:Ee,renameProject:at,removeProject:mt,reorderProject:pt,pinProjectToTop:bt,startPolling:yt,stopPolling:F,primeSelectedThread:z,rollbackSelectedThread:H}=xE(),X=e0(),ve=Zb(),{isMobile:Ie}=Zc(),He=A(null),Tt=A(null),qt=A(null),Cn=A(null),Zn=A(null),Nn=A(!1),Wo=A(!1),Ln=A(!1),wr=A(!0),zr=A([]),go=A(ov()),Sn=A(""),un=A(null),Zr=A(!1),Rr=A(""),On=A("");let yo=!1,xn=null;const jn=A(!1),dt=A(""),qn=A("local"),vn=A({}),br=new Map,Ot=A(""),eo=A([]),wo=A(!1),Ht=A({order:[],labels:{},projectOrder:[]}),jt=A({phase:"idle",title:"",message:""}),Kt=A(Xv()),Dt=A(""),Hn=A(!1),to=A(null),ga=A(null),bo=A(null),no=A(null),_o=A(null);let on=null,_r=null,er=0,tr=0;const Mr=A("New Project (1)"),To=A(""),Wn=A(!1),$r=A(eg()),Tr=A(!1),ko=A([]),$t=A(null),Yt=A(null),_t=A(null),zn=A(null),cn=A(!1),an=A(!1),Qt=A(""),Nr=A({}),nr=A(""),rr=A(""),Co=A(!1),Wt=A(!1),kr=A(null),kt=A([]),St=A(!1),An=A(!1),wn=A(!1),nn=A(!1),Lr=A(!1),Or=A(""),bn=A(""),jr=A(null),Dr=A(""),Vn=A(""),In=A(""),Ft=A(""),or=A(yu(Rh,!0)),P=A(jv()),U=A(Ov()),oe=A(Dv()),xe=A(yu(Nh,!1)),vt=A(yu(Lh,!0)),dn=A(Qv()),Gn=ae(()=>Jv()),zt=A(!1),rn=A(!1),En=A(!1),ar=A(""),We=A(!1),Me=A(null),Ct=A(!1),sr=A(""),Cr=A("codex"),Us=ae(()=>[{value:"codex",label:"Codex"},{value:"openrouter",label:"OpenRouter"},{value:"opencode-zen",label:"OpenCode Zen"},{value:"custom",label:o("Custom endpoint")}]),sn=A(""),ro=A(""),Pn=A("responses"),Fr=A("responses"),zo=A(""),Vo=A(!1),So=A(""),Go=A(""),ir=A(""),ya=A(!1),Ur=A(!1),xo=A(""),Kn=A(""),Sr=A(!1),xr=A(!1),wa=A(null),Ko=A(null),oo=A(""),lr=A(""),Ao=A(""),Io=A([]),yn=A(""),Rn=A(!1),ur=A(!1),Ua=A(!1),Ar=A(""),cr=A({configured:!1,active:!1,mappedChats:0,mappedThreads:0,allowedUsers:0,allowAllUsers:!1,lastError:""}),ba=A(null),Ba=A(!1),qa=A(!1),Eo=A(typeof window<"u"?((Pd=window.visualViewport)==null?void 0:Pd.height)??window.innerHeight:0),_a=A(typeof window<"u"?((Rd=window.visualViewport)==null?void 0:Rd.offsetTop)??0:0),Po=A(typeof window<"u"?window.innerHeight:0);let Br=null,Ro=!1,Yo=0;const Ir=ae(()=>{const u=X.params.threadId;return typeof u=="string"?u:""}),Ut=ae(()=>X.name==="home"),Vr=ae(()=>X.name==="skills"),Ta=ae(()=>{var u;return Vr.value?o("Skills"):Ut.value?o("Start new thread"):((u=ee.value)==null?void 0:u.title)??o("Choose a thread")}),Bs=typeof window<"u"&&(window.location.hostname||window.location.host)||"codexui",ka=ae(()=>{var h,k;return(((k=(h=ee.value)==null?void 0:h.title)==null?void 0:k.trim())??"")||Bs}),Ca=ae(()=>Be.value.filter(u=>{const h=ng(u.messageType,u.role);return h==="worked"?!0:!(h==="turnActivity.live"||h==="turnError.live"||h==="agentReasoning.live")})),qs=ae(()=>te.value),Mo=ae(()=>Ut.value?"__new-thread__":fe.value),Qo=ae(()=>we(Mo.value).trim()||ye.value.trim()),Jo=ae(()=>{const u=K.value;return u.length>0?u[u.length-1]:null}),Nt=ae(()=>{var u,h;return Ut.value?dt.value.trim():((h=(u=ee.value)==null?void 0:u.cwd)==null?void 0:h.trim())??""}),Hs=ae(()=>wr.value&&(Ut.value&&Nt.value.length>0||X.name==="thread"&&fe.value.length>0)),y=ae(()=>X.name==="thread"&&fe.value.length>0||Ut.value&&$o.value),b=ae(()=>Ut.value?Nn.value:j.value),w=ae(()=>!Ie.value||Eo.value<=0||Po.value<=0?!1:Po.value-Eo.value>120),L=ae(()=>w.value||b.value&&Ln.value),Pe=ae(()=>{var u,h;return((h=(u=ee.value)==null?void 0:u.cwd)==null?void 0:h.trim())??dt.value.trim()}),lt=ae(()=>{var u;return!Ut.value&&((u=ee.value)==null?void 0:u.inProgress)===!0}),Vt=ae(()=>!Ut.value&&!Vr.value&&fe.value.trim().length>0),Mn=ae(()=>Ce.value||Ye.value||lt.value||K.value.length>0);function Jt(u){return Number.isFinite(u)?new Intl.NumberFormat("en-US",{notation:u>=1e3?"compact":"standard",maximumFractionDigits:u>=1e5?0:1}).format(Math.max(0,Math.trunc(u))):"0"}function Yn(u){if(!u)return o("Waiting for Codex thread/tokenUsage/updated events for this thread.");const h=[`${o("Current context usage")}: ${u.currentContextTokens.toLocaleString()} ${o("tokens")}`,`${o("Cumulative thread usage")}: ${u.total.totalTokens.toLocaleString()} ${o("tokens")}`];return typeof u.modelContextWindow=="number"?(h.unshift(`${o("Model context window")}: ${u.modelContextWindow.toLocaleString()} ${o("tokens")}`),h.push(`${o("Remaining context")}: ${(u.remainingContextTokens??0).toLocaleString()} ${o("tokens")}`)):h.push(o("Model context window is unavailable in the latest usage event.")),h.join(`
57
+ `)}function dr(){zt.value&&(zt.value=!1,tT(!0))}function fr(){dr(),ve.push({name:"skills",query:{tab:"plugins"}})}const Xo=ae(()=>{var h;const u=(h=D.value)==null?void 0:h.remainingContextPercent;return u===null||typeof u!="number"?"pending":u<=10?"danger":u<=25?"warning":"ok"}),Ws=ae(()=>{const u=D.value;return u?typeof u.remainingContextTokens=="number"?`${Jt(u.remainingContextTokens)} ${o("left")}`:`${Jt(u.currentContextTokens)} ${o("used")}`:o("Awaiting data")}),Fi=ae(()=>{const u=D.value;return u?typeof u.modelContextWindow=="number"?`${Jt(u.currentContextTokens)} ${o("used")} / ${Jt(u.modelContextWindow)}`:o("Window size unavailable"):o("Updates after the next token usage event")}),tu=ae(()=>Yn(D.value));function zs(u,h){const k=ot(u).trim(),W=Hr(k);return!k||!W?!1:h.some(J=>{const ue=ot(J).trim();return ue!==k&&Hr(ue)===W})}function Vs(u,h=""){const k=ot(u).trim(),W=h.trim();if(W)return W;const J=Hr(k),ue=[...Ht.value.order,...O.value.map(Ue=>{var Xt,qr;return((qr=(Xt=Ue.threads[0])==null?void 0:Xt.cwd)==null?void 0:qr.trim())??""}).filter(Boolean)];return zs(k,ue)?k:J}function nu(){const u=new Set(Ht.value.order),h=Ht.value.projectOrder.filter(k=>u.has(k));for(const k of Ht.value.order)h.includes(k)||h.push(k);return h}function Ha(u){const h=ot(u).trim(),k=[...Ht.value.order,...O.value.map(W=>{var J,ue;return((ue=(J=W.threads[0])==null?void 0:J.cwd)==null?void 0:ue.trim())??""}).filter(Boolean)];return zs(h,k)?h:Hr(h)}function Ui(u){const h=ot(u).trim();if(!h)return"";const k=[...Ht.value.order,...O.value.map(W=>{var J,ue;return((ue=(J=W.threads[0])==null?void 0:J.cwd)==null?void 0:ue.trim())??""}).filter(Boolean)];for(const W of Ht.value.order){const J=ot(W).trim();if(!J)continue;const ue=Hr(J),Ue=zs(J,k)?J:ue;if(J===h||Ue===h||ue===h)return J}return""}const Gs=ae(()=>{var W,J;const u=[],h=new Set;for(const ue of nu()){const Ue=ue.trim();!Ue||h.has(Ue)||(h.add(Ue),u.push({value:Ue,label:Vs(Ue,Ht.value.labels[Ue])}))}for(const ue of O.value){const Ue=((J=(W=ue.threads[0])==null?void 0:W.cwd)==null?void 0:J.trim())??"";!Ue||h.has(Ue)||Ml(Ue)||(h.add(Ue),u.push({value:Ue,label:Vs(Ue,q.value[ue.projectName])}))}const k=dt.value.trim();return k&&!h.has(k)&&u.unshift({value:k,label:Vs(k)}),u}),$o=ae(()=>{const u=dt.value.trim();return u?vn.value[u]===!0:!1}),Bi=ae(()=>{var h,k;const u={};for(const W of O.value){const J=ei(W.projectName,((k=(h=W.threads[0])==null?void 0:h.cwd)==null?void 0:k.trim())??"");u[W.projectName]=J?vn.value[J]===!0:!1}return u}),Ks=ae(()=>{const u=Ot.value.trim(),h=[...eo.value];return u&&!h.some(k=>k.value===u)&&h.unshift({value:u,label:u}),h}),ls=ae(()=>{const u=Ot.value.trim();if(!u)return"";const h=Ks.value.find(k=>k.value===u);return(h==null?void 0:h.label)??u}),Ys=ae(()=>lr.value.trim()),us=ae(()=>{const u=xo.value.trim();return!u||u==="."||u===".."?!1:!/[\\/]/u.test(u)}),ru=ae(()=>us.value&&Ys.value.trim().length>0&&!yn.value),Wa=ae(()=>{const u=ot(oo.value).trim();return u||lr.value.trim()}),cs=ae(()=>Sr.value?"Creating…":"Create"),ou=ae(()=>{const u=lr.value.trim(),h=Ao.value.trim();return!!(u&&h&&u!==h)}),qi=ae(()=>{const u=[];ou.value&&u.push({key:`parent:${Ao.value}`,name:"..",path:Ao.value,kind:"parent"});for(const h of Io.value)u.push({key:`directory:${h.path}`,name:h.name,path:h.path,kind:"directory"});return u}),Qs=ae(()=>{const u=Ar.value.trim().toLowerCase();return u?qi.value.filter(h=>h.kind==="parent"||h.name.toLowerCase().includes(u)):qi.value}),Sa=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null,au=ae(()=>o(_[oe.value].label)),Js=ae(()=>b.value?o("Terminal"):o("Open terminal")),ao=ae(()=>{const u=new Map(go.value.map(k=>[k.value,k]));return[...zr.value.map((k,W)=>({label:k.label,value:k.value,usageCount:0,lastUsedAt:0,...u.get(k.value)??{},custom:!1,sourceIndex:W}))].sort(rv)}),su=ae(()=>[{label:b.value?o("Hide terminal"):o("Open terminal"),value:Ph},...ao.value.map(u=>({label:u.label,value:u.value}))]),iu=ae(()=>{const u=_[oe.value],h=Math.max(0,Po.value-Eo.value-_a.value);return{"--chat-column-max":u.columnMax,"--chat-card-max":u.cardMax,"--visual-viewport-height":Eo.value>0?`${Eo.value}px`:"100dvh","--visual-viewport-offset-top":`${Math.max(0,_a.value)}px`,"--virtual-keyboard-inset":`${h}px`}}),Hi=ae(()=>{if(!cr.value.configured)return o("Not configured");const u=cr.value.active?o("Online"):o("Configured (offline)"),h=cr.value.allowAllUsers?o("allow all users"):`${cr.value.allowedUsers} ${o("allowed user(s)")}`,k=`${cr.value.mappedChats} ${o("chat(s)")}, ${cr.value.mappedThreads} ${o("thread(s)")}, ${h}`,W=cr.value.lastError?`, ${o("error")}: ${cr.value.lastError}`:"";return`${u}, ${k}${W}`});ma(()=>{var u,h;document.addEventListener("pointerdown",fd),window.addEventListener("keydown",sd),document.addEventListener("visibilitychange",hd),window.addEventListener("pageshow",pd),window.addEventListener("focus",md),window.addEventListener("resize",No),(u=window.visualViewport)==null||u.addEventListener("resize",No),(h=window.visualViewport)==null||h.addEventListener("scroll",No),No(),tl(),Sa==null||Sa.addEventListener("change",tl),rg(),Av(),uu(),Va(),Lo(),Zs(),Xs(),Kv(),lv(),id()}),zl(()=>{var u,h;document.removeEventListener("pointerdown",fd),window.removeEventListener("keydown",sd),document.removeEventListener("visibilitychange",hd),window.removeEventListener("pageshow",pd),window.removeEventListener("focus",md),window.removeEventListener("resize",No),(u=window.visualViewport)==null||u.removeEventListener("resize",No),(h=window.visualViewport)==null||h.removeEventListener("scroll",No),Sa==null||Sa.removeEventListener("change",tl),Br!==null&&(window.clearInterval(Br),Br=null),on&&(clearTimeout(on),on=null),Ji(),F()});function No(){var u,h;typeof window>"u"||(Po.value=Math.max(Po.value,window.innerHeight),Eo.value=((u=window.visualViewport)==null?void 0:u.height)??window.innerHeight,_a.value=((h=window.visualViewport)==null?void 0:h.offsetTop)??0)}ht(Dt,u=>{const h=u.trim();if(on&&(clearTimeout(on),on=null),!h){_o.value=null;return}on=setTimeout(()=>{G_(h,1e3).then(k=>{Dt.value.trim()===h&&(_o.value=k.threadIds)}).catch(()=>{Dt.value.trim()===h&&(_o.value=null)})},220)}),ht(w,u=>{u||(Ln.value=!1)}),ht(kt,()=>{if(typeof window>"u")return;if(!kt.value.some(h=>h.quotaStatus==="loading")){Br!==null&&(window.clearInterval(Br),Br=null);return}Br===null&&(Br=window.setInterval(()=>{Ro||(Ro=!0,Zo({silent:!0}).finally(()=>{Ro=!1}))},1500))},{deep:!0});function lu(){gt()}async function Xs(){try{cr.value=await Q_()}catch(u){const h=u instanceof Error?u.message:"Failed to load Telegram status";cr.value={configured:!1,active:!1,mappedChats:0,mappedThreads:0,allowedUsers:0,allowAllUsers:!1,lastError:h}}}async function Zs(){try{const u=await Y_();So.value=u.botToken,Go.value=u.allowedUserIds.map(h=>String(h)).join(`
58
+ `),ir.value=""}catch(u){ir.value=u instanceof Error?u.message:"Failed to load Telegram configuration"}}async function uu(){const u=await eT();zt.value=u.dismissed!==!0}function cu(u){const h=u.split(/[\n,]/).map(J=>J.trim().replace(/^(telegram|tg):/i,"").trim()).filter(Boolean),k=h.includes("*"),W=Array.from(new Set(h.filter(J=>/^-?\d+$/.test(J)).map(J=>Number.parseInt(J,10))));return k?["*",...W]:W}async function du(){const u=So.value.trim(),h=cu(Go.value);if(!u){ir.value=o("Telegram bot token is required.");return}if(h.length===0){ir.value=o("At least one allowed Telegram user ID or * is required.");return}ya.value=!0,ir.value="";try{await K_(u,h),Go.value=h.map(k=>String(k)).join(`
59
+ `),await Promise.all([Zs(),Xs()]),window.alert(o("Telegram bot configured. Only allowlisted Telegram users can use the bridge."))}catch(k){ir.value=k instanceof Error?k.message:o("Failed to connect Telegram bot"),Xs()}finally{ya.value=!1}}function i(){Hn.value=!Hn.value,Hn.value?Zt(()=>{var u;return(u=to.value)==null?void 0:u.focus()}):Dt.value=""}function d(){var u;Dt.value="",(u=to.value)==null||u.focus()}function v(u){u.key==="Escape"&&(Hn.value=!1,Dt.value="")}function T(u){u&&(X.name==="thread"&&Ir.value===u||(ve.push({name:"thread",params:{threadId:u}}),Ie.value&&Kr(!0)))}async function N(u){u&&(fe.value!==u&&(await Ge(u),await ve.push({name:"thread",params:{threadId:u}})),await Zt(),Mv())}function $(u){return u.length>8?u.slice(-8):u}function B(u){const h=[u.planType||o("unknown")];return u.authMode&&h.unshift(u.authMode),h.join(" · ")}function Y(u){if(!u)return!1;const h=u.toLowerCase();return h.includes("payment required")||/\b402\b/.test(h)}function re(u){return u.unavailableReason==="payment_required"||Y(u.quotaError)}function me(u){return St.value||An.value||wn.value||nn.value||Dr.value.length>0||u.isActive&&Dr.value!==u.accountId&&Mn.value}function Je(u){return Vn.value===u.accountId}function Xe(u){return In.value===u.accountId||Je(u)}function Lt(u){return re(u)?o("Unavailable"):u.isActive?o("Active"):An.value?o("Switching…"):o("Switch")}function ut(u){return Dr.value===u.accountId?o("Removing…"):Je(u)?o("Click again to remove"):o("Remove")}function fn(u){In.value=u}function Gr(u){In.value===u&&(In.value=""),Dr.value!==u&&Vn.value===u&&(Vn.value="")}function ds(u){const h=u.quotaSnapshot;if(!h)return null;const k=[h==null?void 0:h.primary,h==null?void 0:h.secondary].filter(ue=>ue!==null),W=k.find(ue=>ue.windowMinutes===10080);if(W)return W;const J=k.filter(ue=>typeof ue.windowMinutes=="number"&&ue.windowMinutes>=10080).sort((ue,Ue)=>(ue.windowMinutes??0)-(Ue.windowMinutes??0))[0]??null;return J||(h.secondary??null)}function Wi(u){if(typeof u!="number"||!Number.isFinite(u))return"";const h=new Date(u*1e3);return`${h.getMonth()+1}月${h.getDate()}日`}function xa(u){var ue,Ue;if(re(u))return u.quotaError||o("402 Payment Required");const h=u.quotaSnapshot,k=ds(u),W=(h==null?void 0:h.primary)??(h==null?void 0:h.secondary)??null,J=k??W;if(J){const Xt=Math.max(0,Math.min(100,100-Math.round(J.usedPercent))),qr=Wi(J.resetsAt);return qr?`${Xt}% ${o("weekly remaining")} · ${qr}`:`${Xt}% ${o("weekly remaining")}`}return(ue=h==null?void 0:h.credits)!=null&&ue.unlimited?o("Unlimited credits"):(Ue=h==null?void 0:h.credits)!=null&&Ue.hasCredits&&h.credits.balance?`${h.credits.balance} ${o("credits")}`:u.quotaStatus==="loading"?o("Loading quota…"):u.quotaStatus==="error"?u.quotaError||o("Quota unavailable"):u.quotaStatus==="ready"||u.quotaStatus==="idle"?o("Quota unavailable"):o("Fetching account details…")}function za(u){return[u.email||o("Account"),B(u),re(u)?o("Unavailable account"):null,xa(u),`${o("Workspace")} ${u.accountId}`].filter(Boolean).join(`
60
+ `)}async function Zo(u={}){try{const h=await u_();kt.value=h.accounts,h.accounts.some(k=>k.accountId===In.value)||(In.value=""),h.accounts.some(k=>k.accountId===Vn.value)||(Vn.value="")}catch(h){if(u.silent===!0)return;Ft.value=h instanceof Error?h.message:o("Failed to load accounts")}}async function zi(){if(!(St.value||An.value||wn.value||nn.value)){Ft.value="",In.value="",Vn.value="",St.value=!0;try{const u=await c_();kt.value=u.accounts,F(),yt(),Le({includeSelectedThreadMessages:!0})}catch(u){Ft.value=u instanceof Error?u.message:o("Failed to refresh accounts")}finally{St.value=!1}}}async function Vi(){var u;if(!(St.value||An.value||wn.value||nn.value)){Ft.value="",bn.value="",wn.value=!0;try{const h=await d_();Or.value=h,Lr.value=!0,window.open(h,"_blank","noopener,noreferrer"),await Zt(),(u=jr.value)==null||u.focus()}catch(h){Ft.value=h instanceof Error?h.message:o("Failed to start Codex login")}finally{wn.value=!1}}}function fs(){nn.value||(Lr.value=!1,bn.value="")}async function Gi(){const u=bn.value.trim();u&&await Ki(u)}async function Ki(u){if(!(nn.value||u.length===0)){Ft.value="",nn.value=!0;try{const h=await f_(u);kt.value=h.accounts,Or.value="",bn.value="",Lr.value=!1,F(),yt(),Le({includeSelectedThreadMessages:!0})}catch(h){Ft.value=h instanceof Error?h.message:o("Failed to complete Codex login")}finally{nn.value=!1}}}async function Yi(u){if(!(An.value||St.value||wn.value||nn.value)){if(Mn.value){Ft.value=o("Finish the current turn and pending requests before switching accounts.");return}Ft.value="",In.value="",Vn.value="",An.value=!0;try{const h=await h_(u);kt.value=kt.value.map(k=>k.accountId===u?h:{...k,isActive:!1}),F(),yt(),Le({includeSelectedThreadMessages:!0}),Zo({silent:!0})}catch(h){Ft.value=h instanceof Error?h.message:o("Failed to switch account")}finally{An.value=!1}}}async function st(u){if(St.value||An.value||wn.value||nn.value||Dr.value.length>0)return;const h=kt.value.find(W=>W.accountId===u)??null;if(!h)return;if(Vn.value!==u){Vn.value=u;return}if(h.isActive&&Mn.value){Ft.value=o("Finish the current turn and pending requests before removing the active account.");return}const k=h.isActive;Ft.value="",Vn.value="",Dr.value=u;try{const W=await p_(u);kt.value=W.accounts,F(),yt(),k&&Le({includeSelectedThreadMessages:!0}),Zo({silent:!0})}catch(W){Ft.value=W instanceof Error?W.message:o("Failed to remove account")}finally{Dr.value=""}}function Er(u){Se(u)}async function ea(u){const h=await Ae(u);h&&(Ut.value?await ve.replace({name:"thread",params:{threadId:h}}):await ve.push({name:"thread",params:{threadId:h}}),Ie.value&&Kr(!0))}function rd(u){const h=u.trim().replace(/\\/gu,"/");return h?h.includes("/.codex/worktrees/")||h.includes("/.git/worktrees/"):!1}function ei(u,h=""){var ue,Ue,Xt;const k=O.value.find(qr=>qr.projectName===u);if(!k)return Ui(u)||h.trim();const W=k.threads.find(qr=>!rd(qr.cwd));return(((ue=W==null?void 0:W.cwd)==null?void 0:ue.trim())??((Xt=(Ue=k.threads[0])==null?void 0:Ue.cwd)==null?void 0:Xt.trim())??"")||Ui(u)||h.trim()}function Um(u){var W,J;const h=O.value.find(ue=>ue.projectName===u),k=ei(u,((J=(W=h==null?void 0:h.threads[0])==null?void 0:W.cwd)==null?void 0:J.trim())??"");k&&(dt.value=k),Ie.value&&Kr(!0),!Ut.value&&ve.push({name:"home"})}function Bm(u){var k;let h="";for(const W of O.value){const J=W.threads.find(ue=>ue.id===u);if((k=J==null?void 0:J.cwd)!=null&&k.trim()){h=J.cwd.trim();break}}!h||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(h)}`,"_blank","noopener,noreferrer")}function od(u){var k,W;const h=O.value.find(J=>J.projectName===u);return ei(u,((W=(k=h==null?void 0:h.threads[0])==null?void 0:k.cwd)==null?void 0:W.trim())??"")}function qm(u){return(q.value[u]??u).trim()||u}function Hm(u){return qm(u).replace(/[\\/]+/gu,"-").replace(/[\u0000-\u001f]+/gu,"").trim()||"worktree"}function Wm(u){const h=od(u);!h||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(h)}`,"_blank","noopener,noreferrer")}async function zm(u){const h=od(u);if(!h||typeof window>"u"||(await Qi(h),vn.value[h]!==!0))return;const k=`${Hm(u)}-`,W=window.prompt("New worktree folder name",k);if(W===null)return;const J=W.trim();if(J){if(J.includes("/")||J.includes("\\")||J==="."||J===".."){window.alert("Worktree name must be a single folder name.");return}try{const ue=await L_(h,J),Ue=await cl(ue.cwd,{createIfMissing:!1,label:""});if(!Ue)return;dt.value=Ue,qn.value="local",bt(Ha(Ue)),await Va(),await Lo(),Ie.value&&Kr(!0),Ut.value||await ve.push({name:"home"})}catch(ue){const Ue=ue instanceof Error?ue.message:"Failed to create worktree.";window.alert(Ue)}}}function fu(){dt.value="",qn.value="local",Ie.value&&Kr(!0),!Ut.value&&ve.push({name:"home"})}async function Qi(u){const h=u.trim();if(!h||Object.prototype.hasOwnProperty.call(vn.value,h))return;const k=br.get(h);if(k){const ue=await k;Object.prototype.hasOwnProperty.call(vn.value,h)||(vn.value={...vn.value,[h]:ue});return}const W=D_(h).then(ue=>ue.isGitRepo).catch(()=>!1).finally(()=>{br.delete(h)});br.set(h,W);const J=await W;Object.prototype.hasOwnProperty.call(vn.value,h)||(vn.value={...vn.value,[h]:J})}function Vm(u){at(u.projectName,u.displayName)}function Gm(u){Fe(u.threadId,u.title)}async function Km(u){await mt(u),await Va(),Lo()}function Ym(u){pt(u.projectName,u.toIndex)}function Qm(u){var W,J;const h=O.value.find(ue=>ue.projectName===u),k=ei(u,((J=(W=h==null?void 0:h.threads[0])==null?void 0:W.cwd)==null?void 0:J.trim())??"");Qi(k)}function ad(u){Jm(u)}async function Jm(u){var W;const h=await Ee(u),k=((W=u.followUpMessageText)==null?void 0:W.trim())??"";if(!(!h||!k||Ut.value))try{await x(k,[],[],"steer",[])}catch{}}async function Xm(u){const h=await Ke(u.threadId,u.turnIndex);h&&(await ve.push({name:"thread",params:{threadId:h}}),fe.value!==h&&await Ge(h),Ie.value&&Kr(!0))}function Kr(u){Kt.value!==u&&(Kt.value=u,Zv(u))}function sd(u){if(u.defaultPrevented)return;if(u.key==="Escape"&&Wn.value){Wn.value=!1;return}if(!u.ctrlKey&&!u.metaKey||u.shiftKey||u.altKey)return;const h=u.key.toLowerCase();if(h==="b"){u.preventDefault(),Kr(!Kt.value);return}if(h==="j"&&X.name==="thread"&&fe.value){u.preventDefault(),hu();return}h==="j"&&Ut.value&&Nt.value&&(u.preventDefault(),hu())}function hu(){if(wr.value){if(Ut.value){if(!Nt.value)return;Nn.value=!Nn.value,Nn.value||ti();return}ne(),j.value||ti()}}function Zm(u){if(Sn.value="",!!u){if(u===Ph){hu();return}ev(u)}}async function ev(u){if(!wr.value||!Nt.value)return;if(Ut.value)Nn.value=!0;else if(fe.value)wt(fe.value,!0);else return;const h=await tv();if(h)try{await h.runQuickCommand(u),nv(u)}catch{}}async function tv(){for(let u=0;u<20;u+=1){await Zt();const h=Ut.value?Cn.value:Zn.value;if(h)return h;await new Promise(k=>window.setTimeout(k,25))}return null}async function id(){const u=Nt.value.trim();if(!u){zr.value=[];return}try{zr.value=await a_(u)}catch{zr.value=[]}}function nv(u){const h=ld(u);if(!h)return;const k=go.value.find(Xt=>Xt.value===h),W=zr.value.findIndex(Xt=>Xt.value===h),J=W>=0?zr.value[W]:null;if(!J)return;const ue={label:(k==null?void 0:k.label)||(J==null?void 0:J.label)||h,value:h,custom:!1,usageCount:((k==null?void 0:k.usageCount)??0)+1,lastUsedAt:Date.now(),sourceIndex:W>=0?W:void 0},Ue=[...go.value.filter(Xt=>Xt.value!==h),ue];go.value=Ue,av(Ue)}function ld(u){return u.trim().replace(/\s+/g," ")}function rv(u,h){if(h.usageCount!==u.usageCount)return h.usageCount-u.usageCount;if(h.lastUsedAt!==u.lastUsedAt)return h.lastUsedAt-u.lastUsedAt;const k=typeof u.sourceIndex=="number"?u.sourceIndex:Number.MAX_SAFE_INTEGER,W=typeof h.sourceIndex=="number"?h.sourceIndex:Number.MAX_SAFE_INTEGER;return k-W}function ov(){if(typeof window>"u")return[];try{const u=window.localStorage.getItem(Eh);if(!u)return[];const h=JSON.parse(u);if(!Array.isArray(h))return[];const k=new Set,W=[];for(const J of h){const ue=J!==null&&typeof J=="object"&&!Array.isArray(J)?J:null,Ue=ld(ud(ue==null?void 0:ue.value));!Ue||k.has(Ue)||(k.add(Ue),W.push({label:ud(ue==null?void 0:ue.label)||Ue,value:Ue,custom:(ue==null?void 0:ue.custom)!==!1,usageCount:cd(ue==null?void 0:ue.usageCount),lastUsedAt:cd(ue==null?void 0:ue.lastUsedAt)}))}return W}catch{return[]}}function av(u){typeof window>"u"||window.localStorage.setItem(Eh,JSON.stringify(u.map(h=>({label:h.label,value:h.value,custom:h.custom===!0,usageCount:h.usageCount,lastUsedAt:h.lastUsedAt}))))}function ud(u){return typeof u=="string"?u:""}function cd(u){if(typeof u=="number"&&Number.isFinite(u))return Math.max(0,Math.trunc(u));if(typeof u=="string"){const h=Number(u);if(Number.isFinite(h))return Math.max(0,Math.trunc(h))}return 0}function dd(u){if(Wo.value=u,!u){Ln.value=!1,Ji();return}Ln.value=!0,Ji(),_r=setTimeout(()=>{_r=null,w.value||(Ln.value=!1)},1500)}function sv(){Nn.value=!1,ti()}function iv(){fe.value&&wt(fe.value,!1),ti()}function ti(){Wo.value=!1,Ln.value=!1,Ji()}function Ji(){_r&&(clearTimeout(_r),_r=null)}async function lv(){try{const u=await o_();wr.value=u.available,u.available||(Nn.value=!1,fe.value&&wt(fe.value,!1))}catch{wr.value=!1,Nn.value=!1}}function fd(u){var k,W;const h=u.target;if(h instanceof Node){if(Wo.value){const J=h instanceof Element?h:h.parentElement;J!=null&&J.closest(".thread-terminal-panel")||ti()}Wn.value&&((k=bo.value)!=null&&k.contains(h)||(W=no.value)!=null&&W.contains(h)||(Wn.value=!1))}}function uv(u){var k,W;if(!Wn.value)return;const h=u.target;h instanceof Node&&((k=bo.value)!=null&&k.contains(h)||(W=no.value)!=null&&W.contains(h)||(Wn.value=!1))}function hd(){if(!(typeof document>"u")&&Ie.value){if(document.visibilityState==="hidden"){ba.value=Date.now(),Ba.value=!1;return}pu()}}function pd(u){u.persisted&&pu()}function md(){X.name==="home"&&(Va(),Lo()),pu()}function pu(){typeof window>"u"||typeof document>"u"||!Ie.value||document.visibilityState!=="visible"||Ba.value||ba.value===null||Date.now()-ba.value<MM||(Ba.value=!0,ba.value=null,cv())}async function cv(){if(!qa.value){qa.value=!0;try{await Le({includeSelectedThreadMessages:!0,awaitAncillaryRefreshes:!0}),await _u()}finally{qa.value=!1}}}function vd(u){const h=u.text;Xi();const k=un.value,W=u.mode==="queue"&&k&&k.threadId===fe.value?k.queueIndex:void 0;if(un.value=null,Ut.value){ag(h,u.imageUrls,u.skills,u.fileAttachments);return}x(h,u.imageUrls,u.skills,u.mode,u.fileAttachments,W,void 0,u.selectedModel)}function dv(u){const h=ie.value.findIndex(ue=>ue.id===u),k=h>=0?ie.value[h]:void 0,W=Tt.value;if(!k||!W||W.hasUnsavedDraft()&&!window.confirm("Replace the current draft with this queued message for editing?"))return;un.value=fe.value?{threadId:fe.value,queueIndex:h}:null;const J={text:k.text,imageUrls:[...k.imageUrls],fileAttachments:k.fileAttachments.map(ue=>({...ue})),skills:k.skills.map(ue=>({...ue}))};W.hydrateDraft(J),Q(u)}function Xi(){if(!Ie.value||Ut.value)return;const u=()=>{var h;(h=qt.value)==null||h.jumpToLatest()};u(),Zt(()=>{u(),!(typeof window>"u")&&window.requestAnimationFrame(()=>{u(),window.requestAnimationFrame(u)})})}function fv(u){dt.value=u.trim(),Kn.value=""}function hv(u){Ot.value=u.trim()}function Zi(u){const h=Nt.value.trim();return!u||h!==u?!1:X.name==="thread"||X.name==="home"&&$o.value}function gd(){er+=1,tr+=1,ko.value=[],$t.value=null,Yt.value=null,_t.value=null,zn.value=null,cn.value=!1,an.value=!1,Nr.value={},nr.value="",rr.value="",Qt.value="",Co.value=!1}async function ni(u){const h=u.trim();if(!h){gd();return}const k=++er;Co.value=!0,Qt.value="";try{const W=await j_(h);if(k!==er||!Zi(h))return;ko.value=W.options,$t.value=W.currentBranch,Yt.value=W.headSha,_t.value=W.headSubject,zn.value=W.headDate,cn.value=W.detached,an.value=W.dirty}catch{if(k!==er||!Zi(h))return;ko.value=[],$t.value=null,Yt.value=null,_t.value=null,zn.value=null,cn.value=!1,an.value=!1}finally{k===er&&(Co.value=!1)}}function pv(u){$t.value=u.currentBranch,Yt.value=u.headSha,_t.value=u.headSubject,zn.value=u.headDate,cn.value=u.detached,an.value=u.dirty}function mv(u){if(Wt.value)return;const h=u.trim();if(!h||h===($t.value??""))return;const k=Nt.value.trim();k&&(Wt.value=!0,Qt.value="",F_(k,h).then(W=>($t.value=W||h,Yt.value=null,_t.value=null,zn.value=null,cn.value=!1,Tr.value=!1,ni(k))).catch(W=>{const J=W instanceof Error?W.message:"Failed to switch branch";ni(k).finally(()=>{Qt.value=J})}).finally(()=>{Wt.value=!1}))}function vv(u){if(Wt.value)return;const h=u.branch.trim(),k=u.sha.trim(),W=Nt.value.trim();!h||!k||!W||(Wt.value=!0,Qt.value="",B_(W,h,k).then(J=>(pv(J),Tr.value=!1,ni(W))).catch(J=>{const ue=J instanceof Error?J.message:"Failed to reset branch to commit";ni(W).finally(()=>{Qt.value=ue})}).finally(()=>{Wt.value=!1}))}function gv(u){const h=u.trim(),k=Nt.value.trim();if(!h||!k||nr.value===h||Nr.value[h])return;const W=++tr;nr.value=h,rr.value="",U_(k,h).then(J=>{W!==tr||!Zi(k)||(Nr.value={...Nr.value,[h]:J})}).catch(J=>{W!==tr||!Zi(k)||(rr.value=J instanceof Error?J.message:"Failed to load branch commits")}).finally(()=>{W===tr&&nr.value===h&&(nr.value="")})}async function yv(){const u=await vu();if(!u)return;await Lo();const h=Mr.value.trim()||"New Project (1)",k=window.prompt(`Create project in ${u}`,h);if(k===null)return;const W=k.trim();if(!W)return;const J=_d(bd(u,W));if(J)try{const ue=await cl(J,{createIfMissing:!0,label:""});if(!ue)return;dt.value=ue,bt(Ha(ue)),await Va(),await Lo()}catch(ue){const Ue=ue instanceof Error?ue.message:"Failed to create the project.";window.alert(Ue)}}async function wv(){const u=dt.value.trim()||await vu();u&&(Ur.value=!1,xr.value=!0,Ar.value="",await Aa(u),yn.value||Zt(()=>{var h;return(h=wa.value)==null?void 0:h.focus()}))}function hs(){Yo+=1,xr.value=!1,Rn.value=!1,yn.value="",Ar.value="",oo.value="",ri()}async function bv(u){!u||Rn.value||(Ar.value="",await Aa(u))}function _v(){const u=lr.value.trim();!xr.value||!u||Aa(u)}function Tv(){const u=Wa.value;!xr.value||!u||Rn.value||Aa(u)}function kv(){if(!xr.value||Rn.value||ur.value)return;const u=Wa.value,h=lr.value.trim();!u||u===h||Aa(u)}function Cv(){const u=Wa.value,h=lr.value.trim();if(u){if(u!==h){Aa(u);return}mu(u)}}async function mu(u=Wa.value){const h=ot(u).trim();if(h){yn.value="",ur.value=!0;try{const k=await cl(h,{createIfMissing:!1,label:""});if(!k){yn.value="Failed to open the selected folder.";return}dt.value=k,bt(Ha(k)),await Va(),await Lo(),hs()}catch(k){yn.value=k instanceof Error?k.message:"Failed to open the selected folder."}finally{ur.value=!1}}}async function Sv(){if(Kn.value="",Ur.value){ri();return}if(!xr.value){const u=dt.value.trim()||await vu();if(!u||(xr.value=!0,Ar.value="",await Aa(u),yn.value))return}yn.value||(xo.value=Mr.value,Ur.value=!0,Zt(()=>{var u;return(u=kr.value)==null?void 0:u.focus()}))}function ri(){Kn.value="",xo.value="",Ur.value=!1}async function yd(){const u=xo.value.trim();if(!u)return;if(Kn.value="",yn.value){Kn.value="Reload the current folder before creating a new one.";return}Sr.value=!0;const h=Ys.value.trim(),k=_d(bd(h,u));if(!k){Kn.value="Unable to determine where the new folder should be created.",Sr.value=!1;return}if(!us.value){Kn.value="Enter a single folder name.",Sr.value=!1;return}try{const W=await H_(k);if(!W){Kn.value="Failed to create the folder.";return}Kn.value="",Ar.value="",await Aa(W),ri()}catch(W){Kn.value=W instanceof Error?W.message:"Failed to create folder."}finally{Sr.value=!1}}async function xv(){var h;if(typeof window>"u")return!1;const u=((h=new URLSearchParams(window.location.search).get("openProjectPath"))==null?void 0:h.trim())??"";if(!u)return!1;try{const k=await cl(u,{createIfMissing:!1,label:""});if(!k)return!1;dt.value=k,bt(Ha(k)),await ve.replace({name:"home"}),await Va();const W=new URL(window.location.href);return W.searchParams.delete("openProjectPath"),window.history.replaceState({},"",W.toString()),!0}catch{return!1}}async function vu(){const u=wd();if(u)return u;try{const h=await oh();if(h)return To.value=h,h}catch{}return""}async function Lo(){const u=wd();if(!u){Mr.value="New Project (1)";return}try{const h=await z_(u);Mr.value=h.name||"New Project (1)"}catch{Mr.value="New Project (1)"}}function wd(){var k,W;const u=dt.value.trim();if(u)return Ms(u);const h=((W=(k=Gs.value[0])==null?void 0:k.value)==null?void 0:W.trim())??"";return h?Ms(h):To.value.trim()}async function Av(){try{To.value=await oh()}catch{To.value=""}}async function Va(){try{const u=await _s();Ht.value={order:[...u.order],labels:{...u.labels},projectOrder:[...u.projectOrder]}}catch{Ht.value={order:[],labels:{},projectOrder:[]}}}async function Aa(u){const h=++Yo,k=ot(u).trim();oo.value=k,lr.value=k,yn.value="",Rn.value=!0;try{const W=await q_(u,{showHidden:Ua.value});if(h!==Yo)return;oo.value=W.path,lr.value=W.path,Ao.value=W.parentPath,Io.value=W.entries}catch(W){if(h!==Yo)return;yn.value=W instanceof Error?W.message:"Failed to load local folders.",Ao.value=Ms(lr.value),Io.value=[],ri()}finally{h===Yo&&(Rn.value=!1)}}function bd(u,h){const k=ot(u).trim(),W=ot(h).trim().replace(/^[\\/]+/u,"");if(!k||!W)return"";const J=k.includes("\\")&&!k.includes("/")?"\\":"/";if(/^[a-zA-Z]:[\\/]?$/u.test(k))return`${k.slice(0,2)}${J}${W}`;if(/^\/+$/u.test(k))return`/${W}`;const ue=k.replace(/[\\/]+$/u,"");return ue?`${ue}${J}${W}`:""}function _d(u){const h=ot(u).trim();if(!h)return"";const k=h.match(/^\\\\([^\\/]+)[\\/]+([^\\/]+)([\\/].*)?$/u);if(k){const[,J,ue,Ue=""]=k,Xt=gu(Ue.split(/[\\/]+/u));return Xt.length>0?`\\\\${J}\\${ue}\\${Xt.join("\\")}`:`\\\\${J}\\${ue}`}const W=h.match(/^([a-zA-Z]:)([\\/].*)?$/u);if(W){const[,J,ue=""]=W,Ue=h.includes("\\")&&!h.includes("/")?"\\":"/",Xt=gu(ue.split(/[\\/]+/u));return Xt.length>0?`${J}${Ue}${Xt.join(Ue)}`:`${J}${Ue}`}if(h.startsWith("/")){const J=gu(h.split("/"));return J.length>0?`/${J.join("/")}`:"/"}return h}function gu(u){const h=[];for(const k of u){const W=k.trim();if(!(!W||W===".")){if(W===".."){h.length>0&&h.pop();continue}h.push(W)}}return h}function Iv(u){le(u.draggedId,u.targetId)}function Td(u){Oe(Mo.value,u)}function kd(u){ge(u)}function Cd(u){$e(u)}function Ev(){V()}function Pv(u){const h=u.turnId.trim();if(h.length>0){const k=[...Ca.value].reverse().find(W=>{var J;return W.role==="user"&&(((J=W.turnId)==null?void 0:J.trim())??"")===h&&W.text.trim().length>0});k!=null&&k.text&&Tt.value&&Tt.value.appendTextToDraft(k.text)}H(u.turnId)}function Rv(u){Ut.value||!fe.value||(be("default"),Xi(),x("Implement",[],[],"steer",[],void 0,"default"))}function Mv(){if(Ut.value||Vr.value||typeof document>"u"||!ee.value||Ca.value.length===0)return;const u=$v(),h=Nv(),k=new Blob([u],{type:"text/markdown;charset=utf-8"}),W=URL.createObjectURL(k),J=document.createElement("a");J.href=W,J.download=h,document.body.appendChild(J),J.click(),document.body.removeChild(J),window.setTimeout(()=>URL.revokeObjectURL(W),0)}function $v(){var k,W,J;const u=[],h=((W=(k=ee.value)==null?void 0:k.title)==null?void 0:W.trim())||"Untitled thread";u.push(`# ${Lv(h)}`),u.push(""),u.push(`- Exported: ${new Date().toISOString()}`),u.push(`- Thread ID: ${((J=ee.value)==null?void 0:J.id)??""}`),u.push(""),u.push("---"),u.push("");for(const ue of Ca.value){const Ue=ue.role?ue.role.toUpperCase():"MESSAGE";u.push(`## ${Ue}`),u.push("");const Xt=ue.text.trim();if(Xt&&(u.push(Xt),u.push("")),ue.commandExecution&&(u.push("```text"),u.push(`command: ${ue.commandExecution.command}`),u.push(`status: ${ue.commandExecution.status}`),ue.commandExecution.cwd&&u.push(`cwd: ${ue.commandExecution.cwd}`),ue.commandExecution.exitCode!==null&&u.push(`exitCode: ${ue.commandExecution.exitCode}`),u.push(ue.commandExecution.aggregatedOutput||"(no output)"),u.push("```"),u.push("")),ue.fileAttachments&&ue.fileAttachments.length>0){u.push("Attachments:");for(const qr of ue.fileAttachments)u.push(`- ${qr.path}`);u.push("")}if(ue.images&&ue.images.length>0){u.push("Images:");for(const qr of ue.images)u.push(`- ${qr}`);u.push("")}}return`${u.join(`
61
+ `).trimEnd()}
62
+ `}function Nv(){var J,ue;const k=(((ue=(J=ee.value)==null?void 0:J.title)==null?void 0:ue.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",W=new Date().toISOString().replace(/[:.]/g,"-");return`${k}-${W}.md`}function Lv(u){return u.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function yu(u,h){if(typeof window>"u")return h;const k=window.localStorage.getItem(u);return k===null?h:k==="1"}function Ov(){if(typeof window>"u")return"system";const u=window.localStorage.getItem($h);return u==="light"||u==="dark"?u:"system"}function jv(){if(typeof window>"u")return"steer";const u=window.localStorage.getItem(Mh);return u==="steer"||u==="queue"?u:"queue"}function Dv(){if(typeof window>"u")return"standard";const u=window.localStorage.getItem(jh);return u==="standard"||u==="wide"||u==="extra-wide"?u:"standard"}function Fv(){or.value=!or.value,window.localStorage.setItem(Rh,or.value?"1":"0")}function Uv(){P.value=P.value==="steer"?"queue":"steer",window.localStorage.setItem(Mh,P.value)}function Bv(){const u=["system","light","dark"],h=u.indexOf(U.value);U.value=u[(h+1)%u.length],window.localStorage.setItem($h,U.value),tl()}function qv(){const u=["standard","wide","extra-wide"],h=u.indexOf(oe.value);oe.value=u[(h+1)%u.length],window.localStorage.setItem(jh,oe.value)}function Hv(){xe.value=!xe.value,window.localStorage.setItem(Nh,xe.value?"1":"0")}function Wv(){vt.value=!vt.value,window.localStorage.setItem(Lh,vt.value?"1":"0")}async function oi(u){const h=u.trim();h&&(z(h),(X.name!=="thread"||Ir.value!==h)&&await ve.replace({name:"thread",params:{threadId:h}}))}function zv(u){const h=u.trim();h&&(xn!==null&&window.clearTimeout(xn),xn=window.setTimeout(()=>{oi(h).finally(()=>{Rr.value===h&&(Rr.value=""),xn=null})},250))}function Ia(u,h){return new Promise((k,W)=>{const J=window.setTimeout(()=>{W(new Error(`${h} timed out`))},15e3);u.then(ue=>{window.clearTimeout(J),k(ue)},ue=>{window.clearTimeout(J),W(ue)})})}async function Vv(u){if(En.value)return;En.value=!0;const h=X.name==="thread"?Ir.value.trim():fe.value.trim();h&&(Rr.value=h);try{if(u==="codex"){Cr.value="codex",de(u);const k=await Ia(th(!1),"Codex provider switch");rn.value=k.enabled}else if(u==="openrouter"){Cr.value="openrouter",de(u);const k=await Ia(th(!0),"OpenRouter provider switch");rn.value=k.enabled,await Ia(ms("","",{wireApi:Fr.value,provider:"openrouter"}),"OpenRouter provider configuration")}else u==="opencode-zen"?(Cr.value="opencode-zen",de(u),await Ia(ms("",zo.value.trim(),{wireApi:"chat",provider:"opencode-zen"}),"OpenCode Zen provider configuration"),rn.value=!0):u==="custom"&&(Cr.value="custom",de(u),sn.value.trim()&&ro.value.trim()&&(await Ia(ms(sn.value.trim(),ro.value.trim(),{wireApi:Pn.value}),"Custom provider configuration"),rn.value=!0));if(await Ia(el(),"Provider status refresh"),sr.value="",await Ia(Le({includeSelectedThreadMessages:!1,providerChanged:!0,awaitAncillaryRefreshes:!0}),"Provider refresh"),h){const k=we(h).trim(),W=we("__new-thread__").trim()||ye.value.trim();!k&&W&&Oe(h,W),await oi(h),await Ia(qe(h,{silent:!0}).catch(()=>{}),"Provider thread refresh"),await Zt(),await oi(h),zv(h)}}catch(k){sr.value=k instanceof Error?k.message:"Failed to switch provider",h&&Rr.value===h&&(Rr.value="")}finally{En.value=!1}}async function wu(){if(Ct.value)return;const u=sn.value.trim();if(u){Ct.value=!0;try{sr.value="",await ms(u,ro.value.trim(),{wireApi:Pn.value}),rn.value=!0,await Le({includeSelectedThreadMessages:!1,providerChanged:!0,awaitAncillaryRefreshes:!0})}catch(h){sr.value=h instanceof Error?h.message:"Failed to save custom endpoint"}finally{Ct.value=!1}}}async function Sd(u){if(Ct.value||En.value||Fr.value===u)return;const h=Fr.value;Fr.value=u,Ct.value=!0;try{sr.value="",await ms("","",{wireApi:u,provider:"openrouter"}),rn.value=!0,await Le({includeSelectedThreadMessages:!1,providerChanged:!0,awaitAncillaryRefreshes:!0})}catch(k){Fr.value=h,sr.value=k instanceof Error?k.message:"Failed to save OpenRouter API format"}finally{Ct.value=!1}}async function xd(){if(Ct.value)return;const u=zo.value.trim();if(u){Ct.value=!0;try{sr.value="",await ms("",u,{wireApi:"chat",provider:"opencode-zen"}),rn.value=!0,await Le({includeSelectedThreadMessages:!1,providerChanged:!0,awaitAncillaryRefreshes:!0})}catch(h){sr.value=h instanceof Error?h.message:"Failed to save OpenCode Zen config"}finally{Ct.value=!1}}}async function Ad(){if(!Ct.value){Ct.value=!0;try{const u=ar.value.trim();await nh(u),ar.value="",await el(),await Le({includeSelectedThreadMessages:!1})}catch{}finally{Ct.value=!1}}}async function Gv(){if(!Ct.value){Ct.value=!0;try{await nh(""),ar.value="",await el(),await Le({includeSelectedThreadMessages:!1})}catch{}finally{Ct.value=!1}}}async function el(){var u;try{const h=await _m();rn.value=h.enabled,We.value=h.customKey??!1,Me.value=h.maskedKey??null;let k="codex";h.enabled&&(h.provider==="opencode-zen"?k="opencode-zen":h.provider==="custom"?(k="custom",sn.value=h.customBaseUrl??"",Pn.value=h.wireApi==="chat"?"chat":"responses"):(k="openrouter",Fr.value=h.wireApi==="chat"?"chat":"responses")),Cr.value=k,de(k);const W=((u=h.currentModel)==null?void 0:u.trim())??"";if(W){Oe("__new-thread__",W);const J=fe.value.trim();J&&!we(J).trim()&&Oe(J,W)}}catch{}}async function Kv(){await el(),Cr.value!=="codex"&&await Le({includeSelectedThreadMessages:!1,providerChanged:!0,awaitAncillaryRefreshes:!0})}function Yv(u){const k=bu(u.trim())||"auto";dn.value=k,window.localStorage.setItem(Oh,k)}function Qv(){var k;if(typeof window>"u")return"auto";const u=((k=window.localStorage.getItem(Oh))==null?void 0:k.trim())||"auto";return bu(u)||"auto"}function Jv(){const u=[{value:"auto",label:o("Auto-detect")}],h=new Set(["auto"]);function k(J){const ue=I[J]||J;return`${ue.charAt(0).toUpperCase()+ue.slice(1)} (${J})`}for(const J of typeof navigator<"u"?navigator.languages??[]:[]){const ue=bu(J);!ue||h.has(ue)||(h.add(ue),u.push({value:ue,label:`Preferred: ${k(ue)}`}))}for(const J of Object.keys(I))h.has(J)||(h.add(J),u.push({value:J,label:k(J)}));const W=dn.value.trim();return W&&!h.has(W)&&u.push({value:W,label:k(W)}),u}function bu(u){const h=u.trim().toLowerCase();if(!h||h==="auto")return"";if(h in I)return h;const k=h.split("-")[0]??h;return k in I?k:""}function tl(){const u=document.documentElement;if(U.value==="dark")u.classList.add("dark");else if(U.value==="light")u.classList.remove("dark");else{const h=window.matchMedia("(prefers-color-scheme: dark)").matches;u.classList.toggle("dark",h)}}function Xv(){return typeof window>"u"?!1:window.localStorage.getItem(Ah)==="1"}function Zv(u){typeof window>"u"||window.localStorage.setItem(Ah,u?"1":"0")}function eg(){if(typeof window>"u")return!0;const u=window.localStorage.getItem(Ih);return u===null?!0:u==="1"}function tg(){$r.value=!$r.value,!(typeof window>"u")&&window.localStorage.setItem(Ih,$r.value?"1":"0")}function ng(u,h){const k=(u??"").trim();return k.length>0?k:h.trim()||"message"}function Id(u){be(u)}async function rg(){await ve.isReady(),X.name==="thread"&&Ir.value&&z(Ir.value),await Le({includeSelectedThreadMessages:X.name==="thread"}),Zo({silent:!0}),await xv(),jn.value=!0,await _u(),yt()}function og(u){return u?O.value.some(h=>h.threads.some(k=>k.id===u)):!1}async function _u(){if(Zr.value){yo=!0;return}Zr.value=!0;try{do{if(yo=!1,X.name==="home"||X.name==="skills"){const u=Rr.value.trim();if(X.name==="home"&&u){await oi(u);continue}fe.value!==""&&await Ge("");continue}if(X.name==="thread"){const u=Ir.value;if(!u)continue;if(fe.value!==u){if(!og(u)){await Ge(u);continue}await Ge(u)}else qe(u,{silent:!0})}}while(yo)}finally{Zr.value=!1}}ht(()=>[X.name,Ir.value,ze.value,fe.value],async()=>{jn.value&&await _u()}),ht(()=>Nt.value,()=>{id()}),ht(()=>[X.name,Nt.value],([u,h])=>{u==="thread"&&Qi(h)},{immediate:!0}),ht(()=>fe.value,async u=>{if(jn.value&&!Zr.value&&!(Ut.value||Vr.value)){if(!u){const h=Rr.value.trim();if(h){await oi(h);return}X.name!=="home"&&await ve.replace({name:"home"});return}X.name==="thread"&&Ir.value===u||await ve.replace({name:"thread",params:{threadId:u}})}}),ht(()=>Gs.value,u=>{if(u.length===0){dt.value="",Lo();return}const h=dt.value.trim();h&&(u.some(W=>W.value===h)||(dt.value="")),Lo()},{immediate:!0}),ht(()=>dt.value,()=>{jt.value={phase:"idle",title:"",message:""},Lo()}),ht(()=>[X.name,dt.value],([u,h])=>{u==="home"&&Qi(h)},{immediate:!0}),ht($o,u=>{!u&&qn.value==="worktree"&&(qn.value="local")},{immediate:!0}),ht(()=>[qn.value,dt.value],([u,h])=>{u!=="worktree"||!$o.value||Ed(h)},{immediate:!0}),ht(()=>qn.value,u=>{var h;if(u==="local"){jt.value={phase:"idle",title:"",message:""};const k=dt.value.trim();if(k&&rd(k)){const W=((h=ee.value)==null?void 0:h.projectName)??Hr(k),J=ei(W,"");J&&(dt.value=J)}return}$o.value&&Ed(dt.value)}),ht(()=>X.name,u=>{u!=="home"&&(jt.value={phase:"idle",title:"",message:""}),u!=="thread"&&(Tr.value=!1)}),ht(()=>fe.value,()=>{jt.value={phase:"idle",title:"",message:""}}),ht(()=>[X.name,Nt.value,$o.value],([u,h,k])=>{if(!(u==="thread"||u==="home"&&k)){gd();return}tr+=1,Nr.value={},nr.value="",rr.value="",ni(h)},{immediate:!0}),ht(ka,u=>{typeof document>"u"||(document.title=u)},{immediate:!0}),ht(Ie,u=>{u&&!Kt.value&&Kr(!0)},{immediate:!0});async function ag(u,h=[],k=[],W=[]){try{jt.value={phase:"idle",title:"",message:""};let J=dt.value;if(qn.value==="worktree"){jt.value={phase:"running",title:o("Creating worktree"),message:o("Creating a worktree and running setup.")};try{const Ue=await N_(dt.value,Ot.value);J=Ue.cwd,dt.value=Ue.cwd,jt.value={phase:"idle",title:"",message:""}}catch{jt.value={phase:"error",title:o("Worktree setup failed"),message:o("Unable to create worktree. Try again or switch to Local project.")};return}}else if(!J.trim()){const Ue=await W_(u);J=Ue.cwd,dt.value=Ue.cwd}const ue=await R(u,J,h,k,W);if(!ue)return;await ve.replace({name:"thread",params:{threadId:ue}}),Xi()}catch{}}function sg(u){var W;if((W=u.prompt)!=null&&W.trim())return u.prompt.trim();const h=u.displayName.trim()||u.name.trim(),k=u.kind==="skill"?"skill":u.kind==="plugin"?"plugin":u.kind==="composio"?"Composio connector":"app";return`Test ${h} ${k}. Give me a list of what it can do and one useful example.`}function ig(u){return`${u.kind}:${u.name}:${u.skillPath??""}`}async function lg(u){var W;if(On.value)return;On.value=ig(u);const h=sg(u),k=(W=u.attachedSkills)!=null&&W.length?u.attachedSkills:u.kind==="skill"&&u.skillPath?[{name:u.name,path:u.skillPath}]:[];try{const J=Pe.value.trim()||Nt.value.trim(),ue=await R(h,J,[],k,[]);if(!ue)return;await ve.replace({name:"thread",params:{threadId:ue}}),Xi()}catch{}finally{On.value=""}}async function Ed(u){var k;const h=u.trim();if(!h){eo.value=[],Ot.value="";return}wo.value=!0;try{const W=await O_(h);eo.value=W;const J=Ot.value.trim();if(!(J.length>0&&W.some(Ue=>Ue.value===J))){const Ue=W.find(Xt=>Xt.value.trim()==="main");Ot.value=(Ue==null?void 0:Ue.value)??((k=W[0])==null?void 0:k.value)??""}}catch{eo.value=[],Ot.value=""}finally{wo.value=!1}}return(u,h)=>(C(),E(Qe,null,[je(s0,{"is-sidebar-collapsed":Kt.value,onCloseSidebar:h[26]||(h[26]=k=>Kr(!0))},{sidebar:ft(()=>[m("section",AE,[m("div",IE,[Kt.value?Z("",!0):(C(),et(vh,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":Kt.value,"show-new-thread-button":!0,onToggleSidebar:h[0]||(h[0]=k=>Kr(!Kt.value)),onStartNewThread:fu},{default:ft(()=>[m("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":Hn.value,"aria-label":S(o)("Search threads"),title:S(o)("Search threads"),onClick:i},[je(gh,{class:"sidebar-search-toggle-icon"})],8,EE)]),_:1},8,["is-sidebar-collapsed"])),!Kt.value&&Hn.value?(C(),E("div",PE,[je(gh,{class:"sidebar-search-bar-icon"}),ln(m("input",{ref_key:"sidebarSearchInputRef",ref:to,"onUpdate:modelValue":h[1]||(h[1]=k=>Dt.value=k),class:"sidebar-search-input",type:"text",placeholder:S(o)("Filter threads..."),onKeydown:v},null,40,RE),[[mn,Dt.value]]),Dt.value.length>0?(C(),E("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":S(o)("Clear search"),onClick:d},[je(EI,{class:"sidebar-search-clear-icon"})],8,ME)):Z("",!0)])):Z("",!0),Kt.value?Z("",!0):(C(),E("button",{key:2,class:tt(["sidebar-skills-link",{"is-active":Vr.value}]),type:"button",onClick:h[2]||(h[2]=k=>{S(ve).push({name:"skills"}),S(Ie)&&Kr(!0)})},[m("span",$E,[je(_l)]),m("span",NE,[m("span",LE,M(S(o)("Skills")),1),m("span",OE,M(S(o)("Plugins, apps, MCPs")),1)])],2)),Kt.value?Z("",!0):(C(),et(w1,{key:3,groups:S(O),"project-display-name-by-id":S(q),"project-git-repo-by-name":Bi.value,"selected-thread-id":S(fe),"is-loading":S(ze),"search-query":Dt.value,"search-matched-thread-ids":_o.value,onSelect:T,onArchive:Er,onStartNewThread:Um,onRenameProject:Vm,onBrowseThreadFiles:Bm,onBrowseProjectFiles:Wm,onRequestProjectGitStatus:Qm,onCreateProjectWorktree:zm,onRenameThread:Gm,onForkThread:ea,onRemoveProject:Km,onReorderProject:Ym,onExportThread:N,onStartNewChat:fu},null,8,["groups","project-display-name-by-id","project-git-repo-by-name","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),Kt.value?Z("",!0):(C(),E("div",{key:0,ref_key:"settingsAreaRef",ref:ga,class:"sidebar-settings-area",onClick:uv},[je(Jp,{name:"settings-panel"},{default:ft(()=>[Wn.value?(C(),E("div",{key:0,ref_key:"settingsPanelRef",ref:bo,class:"sidebar-settings-panel",onClick:h[15]||(h[15]=Ze(()=>{},["stop"]))},[m("div",jE,[m("div",DE,[m("div",FE,[m("button",{class:"sidebar-settings-account-collapse",type:"button","aria-expanded":!$r.value,title:$r.value?S(o)("Expand accounts"):S(o)("Collapse accounts"),onClick:tg},[m("span",BE,M($r.value?"▸":"▾"),1)],8,UE),m("span",qE,M(S(o)("Accounts")),1),m("span",HE,M(kt.value.length),1)]),m("button",{class:"sidebar-settings-account-refresh",type:"button",disabled:St.value||An.value||wn.value||nn.value,onClick:zi},M(St.value?S(o)("Reloading…"):S(o)("Reload")),9,WE)]),$r.value?Z("",!0):(C(),E(Qe,{key:0},[Ft.value?(C(),E("p",zE,M(Ft.value),1)):Z("",!0),m("div",VE,[m("button",{class:"sidebar-settings-account-login-button",type:"button",disabled:St.value||An.value||wn.value||nn.value,onClick:Vi},M(wn.value?S(o)("Starting login…"):S(o)("Login")),9,GE),Or.value?(C(),E("a",{key:0,class:"sidebar-settings-account-login-link",href:Or.value,target:"_blank",rel:"noreferrer"},M(S(o)("Open login URL")),9,KE)):Z("",!0)]),kt.value.length===0?(C(),E("p",YE,M(S(o)("Click Login, or run `codex login`, then click reload.")),1)):(C(),E("div",QE,[(C(!0),E(Qe,null,en(kt.value,k=>(C(),E("article",{key:k.accountId,class:tt(["sidebar-settings-account-item",{"is-active":k.isActive,"is-unavailable":re(k),"is-confirming-remove":Je(k),"is-remove-visible":Xe(k)}]),title:za(k),onMouseenter:W=>fn(k.accountId),onMouseleave:W=>Gr(k.accountId)},[m("div",XE,[m("p",ZE,M(k.email||S(o)("Account")),1),m("p",eP,M(B(k)),1),m("p",tP,M(xa(k)),1),m("p",nP," Workspace "+M($(k.accountId)),1)]),m("div",rP,[m("button",{class:"sidebar-settings-account-switch",type:"button",disabled:me(k)||k.isActive||re(k),onClick:W=>Yi(k.accountId)},M(Lt(k)),9,oP),m("button",{class:tt(["sidebar-settings-account-remove",{"is-visible":Xe(k),"is-confirming":Je(k)}]),type:"button",disabled:me(k),onClick:W=>st(k.accountId)},M(ut(k)),11,aP)])],42,JE))),128))]))],64))]),m("button",{class:"sidebar-settings-row",type:"button",title:g.sendWithEnter,onClick:Fv},[m("span",iP,M(S(o)("Require ⌘ + enter to send")),1),m("span",{class:tt(["sidebar-settings-toggle",{"is-on":!or.value}])},null,2)],8,sP),m("button",{class:"sidebar-settings-row",type:"button",title:g.inProgressSendMode,onClick:Uv},[m("span",uP,M(S(o)("When busy, send as")),1),m("span",cP,M(P.value==="steer"?S(o)("Steer"):S(o)("Queue")),1)],8,lP),m("button",{class:"sidebar-settings-row",type:"button",title:g.appearance,onClick:Bv},[m("span",fP,M(S(o)("Appearance")),1),m("span",hP,M(U.value==="system"?S(o)("System"):U.value==="dark"?S(o)("Dark"):S(o)("Light")),1)],8,dP),m("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:S(o)("Choose the interface language for the app.")},[m("span",mP,M(S(o)("UI language")),1),je(Wr,{class:"sidebar-settings-language-dropdown","model-value":S(s),options:S(l),"open-direction":"up","onUpdate:modelValue":h[3]||(h[3]=k=>S(c)(k))},null,8,["model-value","options"])],8,pP),m("button",{class:"sidebar-settings-row",type:"button",title:g.chatWidth,onClick:qv},[m("span",gP,M(S(o)("Chat width")),1),m("span",yP,M(au.value),1)],8,vP),m("button",{class:"sidebar-settings-row",type:"button",title:g.dictationClickToToggle,onClick:Hv},[m("span",bP,M(S(o)("Click to toggle dictation")),1),m("span",{class:tt(["sidebar-settings-toggle",{"is-on":xe.value}])},null,2)],8,wP),m("button",{class:"sidebar-settings-row",type:"button",title:g.dictationAutoSend,onClick:Wv},[m("span",TP,M(S(o)("Auto send dictation")),1),m("span",{class:tt(["sidebar-settings-toggle",{"is-on":vt.value}])},null,2)],8,_P),m("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:S(o)("Choose the API provider for the Codex backend")},[m("span",CP,M(S(o)("Provider")),1),je(Wr,{class:"sidebar-settings-provider-dropdown","model-value":Cr.value,options:Us.value,disabled:En.value,placeholder:S(o)("Provider"),"open-direction":"up","onUpdate:modelValue":Vv},null,8,["model-value","options","disabled","placeholder"])],8,kP),sr.value?(C(),E("div",SP,M(sr.value),1)):Z("",!0),Cr.value==="openrouter"?(C(),E("div",xP,[m("div",AP,[m("span",IP,M(S(o)("OpenRouter API key")),1),m("a",EP,M(S(o)("Get API key")),1)]),m("div",PP,[We.value&&!ar.value?(C(),E(Qe,{key:0},[m("span",RP,M(Me.value),1),m("button",{class:"sidebar-settings-key-clear",type:"button",disabled:Ct.value,title:S(o)("Remove custom key, use community keys"),onClick:Gv},"✕",8,MP)],64)):(C(),E(Qe,{key:1},[ln(m("input",{"onUpdate:modelValue":h[4]||(h[4]=k=>ar.value=k),class:"sidebar-settings-key-input",type:"password",placeholder:S(o)("sk-or-v1-... (optional, uses free keys if empty)"),onKeydown:gn(Ad,["enter"])},null,40,$P),[[mn,ar.value]]),m("button",{class:"sidebar-settings-key-save",type:"button",disabled:Ct.value||!ar.value.trim(),onClick:Ad},M(Ct.value?"...":S(o)("Set")),9,NP)],64))]),m("div",LP,[m("span",OP,M(S(o)("API format")),1),m("div",{class:"sidebar-settings-segmented",role:"group","aria-label":S(o)("OpenRouter API format")},[m("button",{type:"button",class:tt(["sidebar-settings-segmented-option",{"is-active":Fr.value==="responses"}]),disabled:Ct.value||En.value,onClick:h[5]||(h[5]=k=>Sd("responses"))}," Responses ",10,DP),m("button",{type:"button",class:tt(["sidebar-settings-segmented-option",{"is-active":Fr.value==="chat"}]),disabled:Ct.value||En.value,onClick:h[6]||(h[6]=k=>Sd("chat"))}," Completions ",10,FP)],8,jP)])])):Z("",!0),Cr.value==="opencode-zen"?(C(),E("div",UP,[m("div",BP,[m("span",qP,M(S(o)("OpenCode Zen API key")),1),m("a",HP,M(S(o)("Get API key")),1)]),m("div",WP,[ln(m("input",{"onUpdate:modelValue":h[7]||(h[7]=k=>zo.value=k),class:"sidebar-settings-key-input",type:"password",placeholder:S(o)("sk-..."),onKeydown:gn(xd,["enter"])},null,40,zP),[[mn,zo.value]]),m("button",{class:"sidebar-settings-key-save",type:"button",disabled:Ct.value||!zo.value.trim(),onClick:xd},M(Ct.value?"...":S(o)("Save")),9,VP)])])):Z("",!0),Cr.value==="custom"?(C(),E("div",GP,[m("span",KP,M(S(o)("Custom endpoint URL")),1),m("div",YP,[ln(m("input",{"onUpdate:modelValue":h[8]||(h[8]=k=>sn.value=k),class:"sidebar-settings-key-input",type:"url",placeholder:S(o)("https://api.example.com/v1"),onKeydown:gn(wu,["enter"])},null,40,QP),[[mn,sn.value]])]),m("span",JP,M(S(o)("API key")),1),m("div",XP,[ln(m("input",{"onUpdate:modelValue":h[9]||(h[9]=k=>ro.value=k),class:"sidebar-settings-key-input",type:"password",placeholder:S(o)("Bearer token (optional)"),onKeydown:gn(wu,["enter"])},null,40,ZP),[[mn,ro.value]]),m("button",{class:"sidebar-settings-key-save",type:"button",disabled:Ct.value||!sn.value.trim(),onClick:wu},M(Ct.value?"...":S(o)("Save")),9,eR)]),m("div",tR,[m("span",nR,M(S(o)("API format")),1),m("div",{class:"sidebar-settings-segmented",role:"group","aria-label":S(o)("Custom endpoint API format")},[m("button",{type:"button",class:tt(["sidebar-settings-segmented-option",{"is-active":Pn.value==="responses"}]),onClick:h[10]||(h[10]=k=>Pn.value="responses")}," Responses ",2),m("button",{type:"button",class:tt(["sidebar-settings-segmented-option",{"is-active":Pn.value==="chat"}]),onClick:h[11]||(h[11]=k=>Pn.value="chat")}," Completions ",2)],8,rR)])])):Z("",!0),m("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:g.dictationLanguage},[m("span",aR,M(S(o)("Dictation language")),1),je(Wr,{class:"sidebar-settings-language-dropdown","model-value":dn.value,options:Gn.value,placeholder:S(o)("Auto-detect"),"open-direction":"up","enable-search":!0,"search-placeholder":S(o)("Search language..."),"onUpdate:modelValue":Yv},null,8,["model-value","options","placeholder","search-placeholder"])],8,oR),m("button",{class:"sidebar-settings-row",type:"button","aria-live":"polite",onClick:h[12]||(h[12]=k=>Vo.value=!Vo.value)},[m("span",sR,M(S(o)("Telegram")),1),m("span",iR,M(Hi.value),1)]),Vo.value?(C(),E("div",lR,[m("label",uR,[m("span",cR,M(S(o)("Bot token")),1),ln(m("input",{"onUpdate:modelValue":h[13]||(h[13]=k=>So.value=k),class:"sidebar-settings-input",type:"password",placeholder:"123456:ABCDEF",autocomplete:"off",spellcheck:"false"},null,512),[[mn,So.value]])]),m("label",dR,[m("span",fR,M(S(o)("Allowed Telegram user IDs")),1),ln(m("textarea",{"onUpdate:modelValue":h[14]||(h[14]=k=>Go.value=k),class:"sidebar-settings-textarea",rows:"3",placeholder:`123456789
63
+ 987654321`,spellcheck:"false"},null,512),[[mn,Go.value]])]),m("div",hR,M(S(o)("Put one Telegram user ID per line or separate them with commas. Use `*` to allow all Telegram users. Unauthorized users will see their own ID in the rejection message so they can copy it here.")),1),ir.value?(C(),E("div",pR,M(ir.value),1)):Z("",!0),m("div",mR,[m("button",{class:"sidebar-settings-telegram-save",type:"button",disabled:ya.value,onClick:du},M(ya.value?S(o)("Saving…"):S(o)("Save Telegram config")),9,vR)])])):Z("",!0),Vt.value?(C(),E("div",{key:5,class:"sidebar-settings-row sidebar-settings-context-row","data-state":Xo.value,title:tu.value},[m("span",yR,M(S(o)("Context")),1),m("span",{class:"sidebar-settings-context-value","data-state":Xo.value},[is(M(Ws.value)+" ",1),m("span",bR,M(Fi.value),1)],8,wR)],8,gR)):Z("",!0),m("div",_R,[je(_A,{snapshots:S(De)},null,8,["snapshots"])]),m("div",{class:"sidebar-settings-build-label","aria-label":S(o)("Worktree name and version")}," WT "+M(S(p))+" · v"+M(S(f)),9,TR)],512)):Z("",!0)]),_:1}),m("button",{ref_key:"settingsButtonRef",ref:no,class:"sidebar-settings-button",type:"button",onClick:h[16]||(h[16]=Ze(k=>Wn.value=!Wn.value,["stop"]))},[je(_I,{class:"sidebar-settings-icon"}),m("span",null,M(S(o)("Settings")),1),m("span",kR,M(S(p))+" · v"+M(S(f)),1)],512)],512))])]),content:ft(()=>[m("section",{class:tt(["content-root",{"is-virtual-keyboard-open":L.value,"is-terminal-open":b.value}]),style:ua(iu.value)},[w.value?(C(),E("span",CR)):Z("",!0),je(C1,{title:Ta.value,accent:Vr.value},{leading:ft(()=>[Kt.value||S(Ie)?(C(),et(vh,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":Kt.value,"show-new-thread-button":!0,onToggleSidebar:h[17]||(h[17]=k=>Kr(!Kt.value)),onStartNewThread:fu},null,8,["is-sidebar-collapsed"])):Z("",!0),Vr.value?(C(),E("span",SR,[je(_l)])):Z("",!0)]),actions:ft(()=>[Hs.value?(C(),et(Wr,{key:0,class:tt(["content-header-terminal-command",{"is-open":b.value}]),"model-value":Sn.value,options:su.value,placeholder:Js.value,"selected-prefix-icon":SI,"icon-only":!0,"empty-label":S(o)("No commands"),"onUpdate:modelValue":Zm},null,8,["class","model-value","options","placeholder","empty-label"])):Z("",!0),y.value?(C(),et(JA,{key:1,class:"content-header-branch-dropdown","current-branch":$t.value,"head-sha":Yt.value,"head-subject":_t.value,"head-date":zn.value,detached:cn.value,dirty:an.value,branches:ko.value,"commits-by-branch":Nr.value,"commits-loading-for":nr.value,"commits-error":rr.value,loading:Co.value,busy:Wt.value,error:Qt.value,"review-open":Tr.value,"show-review":S(X).name==="thread"&&S(fe).length>0,onToggleReview:h[18]||(h[18]=k=>Tr.value=!Tr.value),onCheckoutBranch:mv,onResetBranchToCommit:vv,onLoadCommits:gv},null,8,["current-branch","head-sha","head-subject","head-date","detached","dirty","branches","commits-by-branch","commits-loading-for","commits-error","loading","busy","error","review-open","show-review"])):Z("",!0)]),_:1},8,["title","accent"]),m("section",xR,[Vr.value?(C(),et(S(a),{key:0,cwd:Pe.value,"thread-id":Ir.value,"try-in-flight-key":On.value,onSkillsChanged:lu,onTryItem:lg},null,8,["cwd","thread-id","try-in-flight-key"])):Ut.value?(C(),E("div",AR,[m("div",IR,[m("p",ER,M(S(o)("Let's build")),1),je(Wr,{class:"new-thread-folder-dropdown","model-value":dt.value,options:Gs.value,placeholder:S(o)("Choose folder"),"enable-search":!0,"search-placeholder":S(o)("Quick search project"),disabled:!1,"onUpdate:modelValue":fv},null,8,["model-value","options","placeholder","search-placeholder"]),dt.value?(C(),E("p",{key:0,class:"new-thread-folder-selected",title:dt.value},M(S(o)("Selected folder"))+": "+M(dt.value),9,PR)):Z("",!0),m("div",RR,[m("button",{class:"new-thread-folder-action new-thread-folder-action-primary",type:"button",onClick:wv},M(S(o)("Select folder")),1),m("button",{class:"new-thread-folder-action",type:"button",onClick:yv},M(S(o)("Create Project")),1)]),zt.value?(C(),E("section",MR,[m("div",$R,[m("div",NR,[m("span",LR,[je(_l)]),m("p",OR,M(S(o)("New in Codex")),1)]),m("h2",jR,M(S(o)("Plugins are here")),1),m("p",DR,M(S(o)("Hook Codex up to Gmail, Calendar, GitHub, Slack, Browser Use, and more so it can actually help with real work right away.")),1),h[29]||(h[29]=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",FR,[m("button",{class:"new-thread-launch-card-button new-thread-launch-card-button-primary",type:"button",onClick:fr},M(S(o)("Explore Plugins & Apps")),1),m("button",{class:"new-thread-launch-card-button",type:"button",onClick:dr},M(S(o)("Dismiss")),1)])])):Z("",!0),(C(),et(ts,{to:"body"},[xr.value?(C(),E("div",{key:0,class:"new-thread-open-folder-overlay",onClick:Ze(hs,["self"])},[m("div",{class:"new-thread-open-folder",role:"dialog","aria-modal":"true","aria-label":S(o)("Select folder"),onKeydown:gn(Ze(hs,["prevent"]),["esc"])},[m("div",BR,[m("p",qR,M(S(o)("Select folder")),1),m("button",{class:"new-thread-open-folder-close",type:"button",onClick:hs},M(S(o)("Cancel")),1)]),m("p",HR,M(S(o)("Current folder")),1),m("div",WR,[ln(m("input",{ref_key:"existingFolderPathInputRef",ref:wa,"onUpdate:modelValue":h[19]||(h[19]=k=>oo.value=k),class:"new-thread-open-folder-path",type:"text",placeholder:S(o)("Current folder"),title:oo.value||S(o)("Unavailable"),disabled:Rn.value||ur.value,onBlur:kv,onKeydown:[gn(Ze(Cv,["prevent"]),["enter"]),gn(Ze(hs,["prevent"]),["esc"])]},null,40,zR),[[mn,oo.value]]),m("button",{class:"new-thread-folder-action new-thread-folder-action-primary",type:"button",disabled:!Wa.value||Rn.value||ur.value,onClick:h[20]||(h[20]=k=>mu())},M(ur.value?S(o)("Opening…"):S(o)("Open")),9,VR)]),m("div",GR,[m("label",KR,[ln(m("input",{"onUpdate:modelValue":h[21]||(h[21]=k=>Ua.value=k),class:"new-thread-open-folder-toggle-input",type:"checkbox",onChange:_v},null,544),[[Nw,Ua.value]]),m("span",null,M(S(o)("Show hidden folders")),1)]),m("button",{class:tt(["new-thread-folder-action",{"new-thread-folder-action-primary":Ur.value}]),type:"button","aria-pressed":Ur.value,disabled:!lr.value||Rn.value||ur.value||Sr.value||!!yn.value&&!Ur.value,onClick:Sv},M(S(o)("New folder")),11,YR)]),Ur.value?(C(),E("div",QR,[m("div",JR,[ln(m("input",{ref_key:"createFolderInputRef",ref:kr,"onUpdate:modelValue":h[22]||(h[22]=k=>xo.value=k),class:"new-thread-open-folder-create-input",type:"text",placeholder:S(o)("Folder name"),onKeydown:[gn(Ze(yd,["prevent"]),["enter"]),gn(Ze(ri,["prevent"]),["esc"])]},null,40,XR),[[mn,xo.value]]),m("button",{class:"new-thread-folder-action new-thread-folder-action-primary new-thread-open-folder-create-submit",type:"button",disabled:!ru.value||Sr.value,onClick:yd},M(cs.value),9,ZR)]),Kn.value?(C(),E("p",eM,M(Kn.value),1)):Z("",!0)])):Z("",!0),ln(m("input",{ref_key:"existingFolderFilterInputRef",ref:Ko,"onUpdate:modelValue":h[23]||(h[23]=k=>Ar.value=k),class:"new-thread-open-folder-filter",type:"text",placeholder:S(o)("Filter folders..."),onKeydown:gn(Ze(hs,["prevent"]),["esc"])},null,40,tM),[[mn,Ar.value]]),yn.value?(C(),E("div",nM,[m("p",rM,M(yn.value),1),m("button",{class:"new-thread-folder-action",type:"button",disabled:Rn.value||ur.value,onClick:Tv},M(S(o)("Retry")),9,oM)])):Z("",!0),Rn.value?(C(),E("p",aM,M(S(o)("Loading folders…")),1)):!yn.value&&Qs.value.length===0?(C(),E("p",sM,M(Ar.value.trim()?S(o)("No folders match this filter."):S(o)("No subfolders found here.")),1)):Qs.value.length>0?(C(),E("ul",iM,[(C(!0),E(Qe,null,en(Qs.value,k=>(C(),E("li",{key:k.key,class:"new-thread-open-folder-item"},[m("button",{class:"new-thread-open-folder-item-main",type:"button",title:k.path,disabled:Rn.value||ur.value,onClick:W=>bv(k.path)},[m("span",uM,M(k.name),1)],8,lM),k.kind==="directory"?(C(),E("button",{key:0,class:"new-thread-open-folder-item-open",type:"button",disabled:Rn.value||ur.value,onClick:W=>mu(k.path)},M(S(o)("Open")),9,cM)):Z("",!0)]))),128))])):Z("",!0)],40,UR)])):Z("",!0)])),$o.value?(C(),et(nI,{key:2,class:"new-thread-runtime-dropdown",modelValue:qn.value,"onUpdate:modelValue":h[24]||(h[24]=k=>qn.value=k)},null,8,["modelValue"])):Z("",!0),qn.value==="worktree"?(C(),E("div",dM,[m("p",fM,M(S(o)("Base branch")),1),je(Wr,{class:"new-thread-branch-dropdown","model-value":Ot.value,options:Ks.value,placeholder:S(o)("Select branch"),"enable-search":!0,"search-placeholder":S(o)("Search branches..."),disabled:wo.value||Ks.value.length===0,"onUpdate:modelValue":hv},null,8,["model-value","options","placeholder","search-placeholder","disabled"]),m("p",hM,M(wo.value?S(o)("Loading branches…"):ls.value?S(o)("New worktree branch will start from {branch}.",{branch:ls.value}):S(o)("No Git branches found for this folder.")),1)])):Z("",!0),$o.value?(C(),E("p",pM,M(S(o)("Local project uses the selected folder directly. New worktree creates an isolated Git worktree before the first prompt.")),1)):Z("",!0),jt.value.phase!=="idle"?(C(),E("div",{key:5,class:tt(["worktree-init-status",{"is-running":jt.value.phase==="running","is-error":jt.value.phase==="error"}])},[m("strong",mM,M(jt.value.title),1),m("span",vM,M(jt.value.message),1)],2)):Z("",!0)]),m("div",gM,[Nn.value&&Nt.value?(C(),et(S(n),{key:0,ref_key:"homeTerminalPanelRef",ref:Cn,class:"content-thread-terminal-panel","thread-id":Mo.value,cwd:Nt.value,onHide:sv,onTerminalFocusChange:dd},null,8,["thread-id","cwd"])):Z("",!0),je(mh,{ref_key:"homeThreadComposerRef",ref:He,"active-thread-id":Mo.value,cwd:Nt.value,"collaboration-modes":S(he),"selected-collaboration-mode":S(G),models:S(Re),"selected-model":Qo.value,"selected-reasoning-effort":S(ke),"selected-speed-mode":S(se),"is-updating-speed-mode":S(Ve),disabled:En.value,skills:S(Te),"thread-token-usage":S(D),"codex-quota":S(_e),"is-turn-in-progress":!1,"is-stop-pending":!1,"is-interrupting-turn":!1,"send-with-enter":or.value,"in-progress-submit-mode":P.value,"dictation-click-to-toggle":xe.value,"dictation-auto-send":vt.value,"dictation-language":dn.value,onSubmit:vd,"onUpdate:selectedCollaborationMode":Id,"onUpdate:selectedModel":Td,"onUpdate:selectedReasoningEffort":kd,"onUpdate:selectedSpeedMode":Cd},null,8,["active-thread-id","cwd","collaboration-modes","selected-collaboration-mode","models","selected-model","selected-reasoning-effort","selected-speed-mode","is-updating-speed-mode","disabled","skills","thread-token-usage","codex-quota","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","dictation-language"])])])):(C(),E("div",yM,[Tr.value&&S(fe)&&Nt.value?(C(),et(S(r),{key:0,"thread-id":S(fe),cwd:Nt.value,"is-thread-in-progress":lt.value,onClose:h[25]||(h[25]=k=>Tr.value=!1)},null,8,["thread-id","cwd","is-thread-in-progress"])):(C(),E(Qe,{key:1},[m("div",wM,[je(S(t),{ref_key:"threadConversationRef",ref:qt,messages:Ca.value,"is-loading":S(Ne),"active-thread-id":Mo.value,cwd:Nt.value,"live-overlay":qs.value,"pending-requests":S(K),onForkThread:Xm,onRollback:Pv,onImplementPlan:Rv,onRespondServerRequest:ad},null,8,["messages","is-loading","active-thread-id","cwd","live-overlay","pending-requests"])]),m("div",bM,[je(fA,{messages:S(ie),onEdit:dv,onSteer:S(pe),onDelete:S(Q),onReorder:Iv},null,8,["messages","onSteer","onDelete"]),S(j)&&S(fe)&&Nt.value?(C(),et(S(n),{key:0,ref_key:"threadTerminalPanelRef",ref:Zn,class:"content-thread-terminal-panel","thread-id":S(fe),cwd:Nt.value,onHide:iv,onTerminalFocusChange:dd},null,8,["thread-id","cwd"])):Z("",!0),Jo.value?(C(),et(tA,{key:1,request:Jo.value,"request-count":S(K).length,"has-queue-above":S(ie).length>0,onRespondServerRequest:ad},null,8,["request","request-count","has-queue-above"])):(C(),et(mh,{key:2,ref_key:"threadComposerRef",ref:Tt,"active-thread-id":Mo.value,cwd:Nt.value,"collaboration-modes":S(he),"selected-collaboration-mode":S(G),models:S(Re),"selected-model":Qo.value,"selected-reasoning-effort":S(ke),"selected-speed-mode":S(se),"is-updating-speed-mode":S(Ve),disabled:En.value,skills:S(Te),"thread-token-usage":S(D),"codex-quota":S(_e),"is-turn-in-progress":lt.value,"is-stop-pending":S(rt),"is-interrupting-turn":S(Ye),"has-queue-above":S(ie).length>0,"send-with-enter":or.value,"in-progress-submit-mode":P.value,"dictation-click-to-toggle":xe.value,"dictation-auto-send":vt.value,"dictation-language":dn.value,"onUpdate:selectedCollaborationMode":Id,onSubmit:vd,"onUpdate:selectedModel":Td,"onUpdate:selectedReasoningEffort":kd,"onUpdate:selectedSpeedMode":Cd,onInterrupt:Ev},null,8,["active-thread-id","cwd","collaboration-modes","selected-collaboration-mode","models","selected-model","selected-reasoning-effort","selected-speed-mode","is-updating-speed-mode","disabled","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"]),Lr.value?(C(),E("div",{key:0,class:"codex-login-modal-backdrop",role:"presentation",onClick:fs},[m("form",{class:"codex-login-modal",role:"dialog","aria-modal":"true","aria-label":S(o)("Complete Codex login"),onSubmit:Ze(Gi,["prevent"]),onClick:h[28]||(h[28]=Ze(()=>{},["stop"]))},[m("div",TM,[m("h2",kM,M(S(o)("Complete Codex login")),1),m("button",{class:"codex-login-modal-close",type:"button","aria-label":S(o)("Close"),disabled:nn.value,onClick:fs}," × ",8,CM)]),m("p",SM,M(S(o)("Finish login in the browser, then paste the localhost callback URL here.")),1),Or.value?(C(),E("a",{key:0,class:"codex-login-modal-link",href:Or.value,target:"_blank",rel:"noreferrer"},M(S(o)("Open login URL")),9,xM)):Z("",!0),ln(m("input",{ref_key:"codexLoginCallbackInputRef",ref:jr,"onUpdate:modelValue":h[27]||(h[27]=k=>bn.value=k),class:"codex-login-modal-input",type:"url",inputmode:"url",placeholder:S(o)("Paste localhost callback URL"),disabled:nn.value},null,8,AM),[[mn,bn.value]]),Ft.value?(C(),E("p",IM,M(Ft.value),1)):Z("",!0),m("div",EM,[m("button",{class:"codex-login-modal-cancel",type:"button",disabled:nn.value,onClick:fs},M(S(o)("Cancel")),9,PM),m("button",{class:"codex-login-modal-submit",type:"submit",disabled:nn.value||bn.value.trim().length===0},M(nn.value?S(o)("Completing…"):S(o)("Complete")),9,RM)])],40,_M)])):Z("",!0)],64))}}),NM=At($M,[["__scopeId","data-v-fc3e1ed1"]]),Zu={render:()=>null},LM=Xb({history:Pb(),routes:[{path:"/",name:"home",component:Zu},{path:"/thread/:threadId",name:"thread",component:Zu},{path:"/skills",name:"skills",component:Zu},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexui. github: https://github.com/friuns2/codexUI");Bw(NM).use(LM).mount("#app");"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(e=>{console.error(Em("Service worker registration failed."),e)})});export{DM as $,et as A,Wc as B,n_ as C,UM as D,FM as E,Qe as F,BM as G,a_ as H,Ds as I,Fa as J,qM as K,Wr as L,a$ as M,i$ as N,l$ as O,jM as P,s$ as Q,nd as R,ts as S,Jp as T,ln as U,mn as V,hi as W,Bo as X,e0 as Y,Zb as Z,At as _,m as a,HM as a0,KM as a1,ZM as a2,e$ as a3,WM as a4,XM as a5,t$ as a6,r$ as a7,o$ as a8,zM as a9,VM as aa,GM as ab,YM as ac,JM as ad,QM as ae,n$ as af,ma as b,E as c,Bn as d,Da as e,Z as f,tt as g,OM as h,je as i,Cs as j,P1 as k,EI as l,Ze as m,Zt as n,C as o,ua as p,S as q,en as r,is as s,M as t,Zc as u,ft as v,ht as w,A as x,ae as y,ll as z};