codexapp 0.1.50 → 0.1.51

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.
@@ -2,19 +2,19 @@
2
2
  * @vue/shared v3.5.30
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
- **/function tl(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ct={},cs=[],zn=()=>{},Zu=()=>!1,li=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),nl=e=>e.startsWith("onUpdate:"),Bt=Object.assign,rl=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Ph=Object.prototype.hasOwnProperty,pt=(e,t)=>Ph.call(e,t),We=Array.isArray,us=e=>uo(e)==="[object Map]",ed=e=>uo(e)==="[object Set]",Hl=e=>uo(e)==="[object Date]",Je=e=>typeof e=="function",Mt=e=>typeof e=="string",xn=e=>typeof e=="symbol",mt=e=>e!==null&&typeof e=="object",td=e=>(mt(e)||Je(e))&&Je(e.then)&&Je(e.catch),nd=Object.prototype.toString,uo=e=>nd.call(e),xh=e=>uo(e).slice(8,-1),rd=e=>uo(e)==="[object Object]",sl=e=>Mt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Fs=tl(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ci=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Mh=/-\w/g,fn=ci(e=>e.replace(Mh,t=>t.slice(1).toUpperCase())),$h=/\B([A-Z])/g,$r=ci(e=>e.replace($h,"-$1").toLowerCase()),ui=ci(e=>e.charAt(0).toUpperCase()+e.slice(1)),Bi=ci(e=>e?`on${ui(e)}`:""),Hn=(e,t)=>!Object.is(e,t),No=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},sd=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ol=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Oh=e=>{const t=Mt(e)?Number(e):NaN;return isNaN(t)?e:t};let Wl;const di=()=>Wl||(Wl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Jr(e){if(We(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=Mt(r)?jh(r):Jr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(Mt(e)||mt(e))return e}const Nh=/;(?![^(]*\))/g,Dh=/:([^]+)/,Lh=/\/\*[^]*?\*\//g;function jh(e){const t={};return e.replace(Lh,"").split(Nh).forEach(n=>{if(n){const r=n.split(Dh);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function it(e){let t="";if(Mt(e))t=e;else if(We(e))for(let n=0;n<e.length;n++){const r=it(e[n]);r&&(t+=r+" ")}else if(mt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Uh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Fh=tl(Uh);function od(e){return!!e||e===""}function Bh(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=il(e[r],t[r]);return n}function il(e,t){if(e===t)return!0;let n=Hl(e),r=Hl(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=xn(e),r=xn(t),n||r)return e===t;if(n=We(e),r=We(t),n||r)return n&&r?Bh(e,t):!1;if(n=mt(e),r=mt(t),n||r){if(!n||!r)return!1;const s=Object.keys(e).length,o=Object.keys(t).length;if(s!==o)return!1;for(const i in e){const a=e.hasOwnProperty(i),l=t.hasOwnProperty(i);if(a&&!l||!a&&l||!il(e[i],t[i]))return!1}}return String(e)===String(t)}const id=e=>!!(e&&e.__v_isRef===!0),ie=e=>Mt(e)?e:e==null?"":We(e)||mt(e)&&(e.toString===nd||!Je(e.toString))?id(e)?ie(e.value):JSON.stringify(e,ad,2):String(e),ad=(e,t)=>id(t)?ad(e,t.value):us(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[Hi(r,o)+" =>"]=s,n),{})}:ed(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Hi(n))}:xn(t)?Hi(t):mt(t)&&!We(t)&&!rd(t)?String(t):t,Hi=(e,t="")=>{var n;return xn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
5
+ **/function tl(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const Ct={},cs=[],zn=()=>{},Zu=()=>!1,li=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),nl=e=>e.startsWith("onUpdate:"),Bt=Object.assign,rl=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Ph=Object.prototype.hasOwnProperty,pt=(e,t)=>Ph.call(e,t),We=Array.isArray,us=e=>uo(e)==="[object Map]",ed=e=>uo(e)==="[object Set]",Hl=e=>uo(e)==="[object Date]",Je=e=>typeof e=="function",Mt=e=>typeof e=="string",xn=e=>typeof e=="symbol",mt=e=>e!==null&&typeof e=="object",td=e=>(mt(e)||Je(e))&&Je(e.then)&&Je(e.catch),nd=Object.prototype.toString,uo=e=>nd.call(e),xh=e=>uo(e).slice(8,-1),rd=e=>uo(e)==="[object Object]",sl=e=>Mt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Fs=tl(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ci=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Mh=/-\w/g,fn=ci(e=>e.replace(Mh,t=>t.slice(1).toUpperCase())),$h=/\B([A-Z])/g,$r=ci(e=>e.replace($h,"-$1").toLowerCase()),ui=ci(e=>e.charAt(0).toUpperCase()+e.slice(1)),Bi=ci(e=>e?`on${ui(e)}`:""),Hn=(e,t)=>!Object.is(e,t),No=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},sd=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},ol=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Oh=e=>{const t=Mt(e)?Number(e):NaN;return isNaN(t)?e:t};let Wl;const di=()=>Wl||(Wl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Jr(e){if(We(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=Mt(r)?jh(r):Jr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(Mt(e)||mt(e))return e}const Nh=/;(?![^(]*\))/g,Dh=/:([^]+)/,Lh=/\/\*[^]*?\*\//g;function jh(e){const t={};return e.replace(Lh,"").split(Nh).forEach(n=>{if(n){const r=n.split(Dh);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function it(e){let t="";if(Mt(e))t=e;else if(We(e))for(let n=0;n<e.length;n++){const r=it(e[n]);r&&(t+=r+" ")}else if(mt(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const Uh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Fh=tl(Uh);function od(e){return!!e||e===""}function Bh(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=il(e[r],t[r]);return n}function il(e,t){if(e===t)return!0;let n=Hl(e),r=Hl(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=xn(e),r=xn(t),n||r)return e===t;if(n=We(e),r=We(t),n||r)return n&&r?Bh(e,t):!1;if(n=mt(e),r=mt(t),n||r){if(!n||!r)return!1;const s=Object.keys(e).length,o=Object.keys(t).length;if(s!==o)return!1;for(const i in e){const a=e.hasOwnProperty(i),l=t.hasOwnProperty(i);if(a&&!l||!a&&l||!il(e[i],t[i]))return!1}}return String(e)===String(t)}const id=e=>!!(e&&e.__v_isRef===!0),oe=e=>Mt(e)?e:e==null?"":We(e)||mt(e)&&(e.toString===nd||!Je(e.toString))?id(e)?oe(e.value):JSON.stringify(e,ad,2):String(e),ad=(e,t)=>id(t)?ad(e,t.value):us(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[Hi(r,o)+" =>"]=s,n),{})}:ed(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Hi(n))}:xn(t)?Hi(t):mt(t)&&!We(t)&&!rd(t)?String(t):t,Hi=(e,t="")=>{var n;return xn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
6
6
  * @vue/reactivity v3.5.30
7
7
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
8
  * @license MIT
9
- **/let pn;class Hh{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=pn,!t&&pn&&(this.index=(pn.scopes||(pn.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=pn;try{return pn=this,t()}finally{pn=n}}}on(){++this._on===1&&(this.prevScope=pn,pn=this)}off(){this._on>0&&--this._on===0&&(pn=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function Wh(){return pn}let At;const Wi=new WeakSet;class ld{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,pn&&pn.active&&pn.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Wi.has(this)&&(Wi.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ud(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Vl(this),dd(this);const t=At,n=An;At=this,An=!0;try{return this.fn()}finally{fd(this),At=t,An=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)cl(t);this.deps=this.depsTail=void 0,Vl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Wi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ka(this)&&this.run()}get dirty(){return ka(this)}}let cd=0,Bs,Hs;function ud(e,t=!1){if(e.flags|=8,t){e.next=Hs,Hs=e;return}e.next=Bs,Bs=e}function al(){cd++}function ll(){if(--cd>0)return;if(Hs){let t=Hs;for(Hs=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Bs;){let t=Bs;for(Bs=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 dd(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function fd(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),cl(r),Vh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function ka(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(hd(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function hd(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ys)||(e.globalVersion=Ys,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ka(e))))return;e.flags|=2;const t=e.dep,n=At,r=An;At=e,An=!0;try{dd(e);const s=e.fn(e._value);(t.version===0||Hn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{At=n,An=r,fd(e),e.flags&=-3}}function cl(e,t=!1){const{dep:n,prevSub:r,nextSub:s}=e;if(r&&(r.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)cl(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Vh(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let An=!0;const pd=[];function ir(){pd.push(An),An=!1}function ar(){const e=pd.pop();An=e===void 0?!0:e}function Vl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=At;At=void 0;try{t()}finally{At=n}}}let Ys=0;class Gh{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 ul{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(!At||!An||At===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==At)n=this.activeLink=new Gh(At,this),At.deps?(n.prevDep=At.depsTail,At.depsTail.nextDep=n,At.depsTail=n):At.deps=At.depsTail=n,md(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=At.depsTail,n.nextDep=void 0,At.depsTail.nextDep=n,At.depsTail=n,At.deps===n&&(At.deps=r)}return n}trigger(t){this.version++,Ys++,this.notify(t)}notify(t){al();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ll()}}}function md(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)md(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Ta=new WeakMap,zr=Symbol(""),Sa=Symbol(""),Xs=Symbol("");function tn(e,t,n){if(An&&At){let r=Ta.get(e);r||Ta.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new ul),s.map=r,s.key=n),s.track()}}function tr(e,t,n,r,s,o){const i=Ta.get(e);if(!i){Ys++;return}const a=l=>{l&&l.trigger()};if(al(),t==="clear")i.forEach(a);else{const l=We(e),u=l&&sl(n);if(l&&n==="length"){const c=Number(r);i.forEach((f,m)=>{(m==="length"||m===Xs||!xn(m)&&m>=c)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),u&&a(i.get(Xs)),t){case"add":l?u&&a(i.get("length")):(a(i.get(zr)),us(e)&&a(i.get(Sa)));break;case"delete":l||(a(i.get(zr)),us(e)&&a(i.get(Sa)));break;case"set":us(e)&&a(i.get(zr));break}}ll()}function ss(e){const t=dt(e);return t===e?t:(tn(t,"iterate",Xs),In(e)?t:t.map(Mn))}function fi(e){return tn(e=dt(e),"iterate",Xs),e}function Fn(e,t){return lr(e)?ys(qr(e)?Mn(t):t):Mn(t)}const zh={__proto__:null,[Symbol.iterator](){return Vi(this,Symbol.iterator,e=>Fn(this,e))},concat(...e){return ss(this).concat(...e.map(t=>We(t)?ss(t):t))},entries(){return Vi(this,"entries",e=>(e[1]=Fn(this,e[1]),e))},every(e,t){return Yn(this,"every",e,t,void 0,arguments)},filter(e,t){return Yn(this,"filter",e,t,n=>n.map(r=>Fn(this,r)),arguments)},find(e,t){return Yn(this,"find",e,t,n=>Fn(this,n),arguments)},findIndex(e,t){return Yn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Yn(this,"findLast",e,t,n=>Fn(this,n),arguments)},findLastIndex(e,t){return Yn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Yn(this,"forEach",e,t,void 0,arguments)},includes(...e){return Gi(this,"includes",e)},indexOf(...e){return Gi(this,"indexOf",e)},join(e){return ss(this).join(e)},lastIndexOf(...e){return Gi(this,"lastIndexOf",e)},map(e,t){return Yn(this,"map",e,t,void 0,arguments)},pop(){return $s(this,"pop")},push(...e){return $s(this,"push",e)},reduce(e,...t){return Gl(this,"reduce",e,t)},reduceRight(e,...t){return Gl(this,"reduceRight",e,t)},shift(){return $s(this,"shift")},some(e,t){return Yn(this,"some",e,t,void 0,arguments)},splice(...e){return $s(this,"splice",e)},toReversed(){return ss(this).toReversed()},toSorted(e){return ss(this).toSorted(e)},toSpliced(...e){return ss(this).toSpliced(...e)},unshift(...e){return $s(this,"unshift",e)},values(){return Vi(this,"values",e=>Fn(this,e))}};function Vi(e,t,n){const r=fi(e),s=r[t]();return r!==e&&!In(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const qh=Array.prototype;function Yn(e,t,n,r,s,o){const i=fi(e),a=i!==e&&!In(e),l=i[t];if(l!==qh[t]){const f=l.apply(e,o);return a?Mn(f):f}let u=n;i!==e&&(a?u=function(f,m){return n.call(this,Fn(e,f),m,e)}:n.length>2&&(u=function(f,m){return n.call(this,f,m,e)}));const c=l.call(i,u,r);return a&&s?s(c):c}function Gl(e,t,n,r){const s=fi(e),o=s!==e&&!In(e);let i=n,a=!1;s!==e&&(o?(a=r.length===0,i=function(u,c,f){return a&&(a=!1,u=Fn(e,u)),n.call(this,u,Fn(e,c),f,e)}):n.length>3&&(i=function(u,c,f){return n.call(this,u,c,f,e)}));const l=s[t](i,...r);return a?Fn(e,l):l}function Gi(e,t,n){const r=dt(e);tn(r,"iterate",Xs);const s=r[t](...n);return(s===-1||s===!1)&&hl(n[0])?(n[0]=dt(n[0]),r[t](...n)):s}function $s(e,t,n=[]){ir(),al();const r=dt(e)[t].apply(e,n);return ll(),ar(),r}const Kh=tl("__proto__,__v_isRef,__isVue"),gd=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(xn));function Jh(e){xn(e)||(e=String(e));const t=dt(this);return tn(t,"has",e),t.hasOwnProperty(e)}class vd{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(s?o?op:_d:o?bd:wd).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=We(t);if(!s){let l;if(i&&(l=zh[n]))return l;if(n==="hasOwnProperty")return Jh}const a=Reflect.get(t,n,sn(t)?t:r);if((xn(n)?gd.has(n):Kh(n))||(s||tn(t,"get",n),o))return a;if(sn(a)){const l=i&&sl(n)?a:a.value;return s&&mt(l)?Ea(l):l}return mt(a)?s?Ea(a):hi(a):a}}class yd extends vd{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=We(t)&&sl(n);if(!this._isShallow){const u=lr(o);if(!In(r)&&!lr(r)&&(o=dt(o),r=dt(r)),!i&&sn(o)&&!sn(r))return u||(o.value=r),!0}const a=i?Number(n)<t.length:pt(t,n),l=Reflect.set(t,n,r,sn(t)?t:s);return t===dt(s)&&(a?Hn(r,o)&&tr(t,"set",n,r):tr(t,"add",n,r)),l}deleteProperty(t,n){const r=pt(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&tr(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!xn(n)||!gd.has(n))&&tn(t,"has",n),r}ownKeys(t){return tn(t,"iterate",We(t)?"length":zr),Reflect.ownKeys(t)}}class Yh extends vd{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Xh=new yd,Qh=new Yh,Zh=new yd(!0);const Ia=e=>e,Eo=e=>Reflect.getPrototypeOf(e);function ep(e,t,n){return function(...r){const s=this.__v_raw,o=dt(s),i=us(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,u=s[e](...r),c=n?Ia:t?ys:Mn;return!t&&tn(o,"iterate",l?Sa:zr),Bt(Object.create(u),{next(){const{value:f,done:m}=u.next();return m?{value:f,done:m}:{value:a?[c(f[0]),c(f[1])]:c(f),done:m}}})}}function Co(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function tp(e,t){const n={get(s){const o=this.__v_raw,i=dt(o),a=dt(s);e||(Hn(s,a)&&tn(i,"get",s),tn(i,"get",a));const{has:l}=Eo(i),u=t?Ia:e?ys:Mn;if(l.call(i,s))return u(o.get(s));if(l.call(i,a))return u(o.get(a));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&tn(dt(s),"iterate",zr),s.size},has(s){const o=this.__v_raw,i=dt(o),a=dt(s);return e||(Hn(s,a)&&tn(i,"has",s),tn(i,"has",a)),s===a?o.has(s):o.has(s)||o.has(a)},forEach(s,o){const i=this,a=i.__v_raw,l=dt(a),u=t?Ia:e?ys:Mn;return!e&&tn(l,"iterate",zr),a.forEach((c,f)=>s.call(o,u(c),u(f),i))}};return Bt(n,e?{add:Co("add"),set:Co("set"),delete:Co("delete"),clear:Co("clear")}:{add(s){const o=dt(this),i=Eo(o),a=dt(s),l=!t&&!In(s)&&!lr(s)?a:s;return i.has.call(o,l)||Hn(s,l)&&i.has.call(o,s)||Hn(a,l)&&i.has.call(o,a)||(o.add(l),tr(o,"add",l,l)),this},set(s,o){!t&&!In(o)&&!lr(o)&&(o=dt(o));const i=dt(this),{has:a,get:l}=Eo(i);let u=a.call(i,s);u||(s=dt(s),u=a.call(i,s));const c=l.call(i,s);return i.set(s,o),u?Hn(o,c)&&tr(i,"set",s,o):tr(i,"add",s,o),this},delete(s){const o=dt(this),{has:i,get:a}=Eo(o);let l=i.call(o,s);l||(s=dt(s),l=i.call(o,s)),a&&a.call(o,s);const u=o.delete(s);return l&&tr(o,"delete",s,void 0),u},clear(){const s=dt(this),o=s.size!==0,i=s.clear();return o&&tr(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=ep(s,e,t)}),n}function dl(e,t){const n=tp(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(pt(n,s)&&s in r?n:r,s,o)}const np={get:dl(!1,!1)},rp={get:dl(!1,!0)},sp={get:dl(!0,!1)};const wd=new WeakMap,bd=new WeakMap,_d=new WeakMap,op=new WeakMap;function ip(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ap(e){return e.__v_skip||!Object.isExtensible(e)?0:ip(xh(e))}function hi(e){return lr(e)?e:fl(e,!1,Xh,np,wd)}function kd(e){return fl(e,!1,Zh,rp,bd)}function Ea(e){return fl(e,!0,Qh,sp,_d)}function fl(e,t,n,r,s){if(!mt(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=ap(e);if(o===0)return e;const i=s.get(e);if(i)return i;const a=new Proxy(e,o===2?r:n);return s.set(e,a),a}function qr(e){return lr(e)?qr(e.__v_raw):!!(e&&e.__v_isReactive)}function lr(e){return!!(e&&e.__v_isReadonly)}function In(e){return!!(e&&e.__v_isShallow)}function hl(e){return e?!!e.__v_raw:!1}function dt(e){const t=e&&e.__v_raw;return t?dt(t):e}function lp(e){return!pt(e,"__v_skip")&&Object.isExtensible(e)&&sd(e,"__v_skip",!0),e}const Mn=e=>mt(e)?hi(e):e,ys=e=>mt(e)?Ea(e):e;function sn(e){return e?e.__v_isRef===!0:!1}function D(e){return Td(e,!1)}function cp(e){return Td(e,!0)}function Td(e,t){return sn(e)?e:new up(e,t)}class up{constructor(t,n){this.dep=new ul,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:dt(t),this._value=n?t:Mn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||In(t)||lr(t);t=r?t:dt(t),Hn(t,n)&&(this._rawValue=t,this._value=r?t:Mn(t),this.dep.trigger())}}function ye(e){return sn(e)?e.value:e}const dp={get:(e,t,n)=>t==="__v_raw"?e:ye(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return sn(s)&&!sn(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Sd(e){return qr(e)?e:new Proxy(e,dp)}class fp{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ul(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ys-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&At!==this)return ud(this,!0),!0}get value(){const t=this.dep.track();return hd(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function hp(e,t,n=!1){let r,s;return Je(e)?r=e:(r=e.get,s=e.set),new fp(r,s,n)}const Ao={},Go=new WeakMap;let Fr;function pp(e,t=!1,n=Fr){if(n){let r=Go.get(n);r||Go.set(n,r=[]),r.push(e)}}function mp(e,t,n=Ct){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,u=W=>s?W:In(W)||s===!1||s===0?nr(W,1):nr(W);let c,f,m,k,U=!1,P=!1;if(sn(e)?(f=()=>e.value,U=In(e)):qr(e)?(f=()=>u(e),U=!0):We(e)?(P=!0,U=e.some(W=>qr(W)||In(W)),f=()=>e.map(W=>{if(sn(W))return W.value;if(qr(W))return u(W);if(Je(W))return l?l(W,2):W()})):Je(e)?t?f=l?()=>l(e,2):e:f=()=>{if(m){ir();try{m()}finally{ar()}}const W=Fr;Fr=c;try{return l?l(e,3,[k]):e(k)}finally{Fr=W}}:f=zn,t&&s){const W=f,ce=s===!0?1/0:s;f=()=>nr(W(),ce)}const F=Wh(),R=()=>{c.stop(),F&&F.active&&rl(F.effects,c)};if(o&&t){const W=t;t=(...ce)=>{W(...ce),R()}}let A=P?new Array(e.length).fill(Ao):Ao;const B=W=>{if(!(!(c.flags&1)||!c.dirty&&!W))if(t){const ce=c.run();if(s||U||(P?ce.some((me,ve)=>Hn(me,A[ve])):Hn(ce,A))){m&&m();const me=Fr;Fr=c;try{const ve=[ce,A===Ao?void 0:P&&A[0]===Ao?[]:A,k];A=ce,l?l(t,3,ve):t(...ve)}finally{Fr=me}}}else c.run()};return a&&a(B),c=new ld(f),c.scheduler=i?()=>i(B,!1):B,k=W=>pp(W,!1,c),m=c.onStop=()=>{const W=Go.get(c);if(W){if(l)l(W,4);else for(const ce of W)ce();Go.delete(c)}},t?r?B(!0):A=c.run():i?i(B.bind(null,!0),!0):c.run(),R.pause=c.pause.bind(c),R.resume=c.resume.bind(c),R.stop=R,R}function nr(e,t=1/0,n){if(t<=0||!mt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,sn(e))nr(e.value,t,n);else if(We(e))for(let r=0;r<e.length;r++)nr(e[r],t,n);else if(ed(e)||us(e))e.forEach(r=>{nr(r,t,n)});else if(rd(e)){for(const r in e)nr(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&nr(e[r],t,n)}return e}/**
9
+ **/let pn;class Hh{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=pn,!t&&pn&&(this.index=(pn.scopes||(pn.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=pn;try{return pn=this,t()}finally{pn=n}}}on(){++this._on===1&&(this.prevScope=pn,pn=this)}off(){this._on>0&&--this._on===0&&(pn=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function Wh(){return pn}let At;const Wi=new WeakSet;class ld{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,pn&&pn.active&&pn.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Wi.has(this)&&(Wi.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ud(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Vl(this),dd(this);const t=At,n=An;At=this,An=!0;try{return this.fn()}finally{fd(this),At=t,An=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)cl(t);this.deps=this.depsTail=void 0,Vl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Wi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ka(this)&&this.run()}get dirty(){return ka(this)}}let cd=0,Bs,Hs;function ud(e,t=!1){if(e.flags|=8,t){e.next=Hs,Hs=e;return}e.next=Bs,Bs=e}function al(){cd++}function ll(){if(--cd>0)return;if(Hs){let t=Hs;for(Hs=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Bs;){let t=Bs;for(Bs=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 dd(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function fd(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),cl(r),Vh(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function ka(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(hd(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function hd(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ys)||(e.globalVersion=Ys,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ka(e))))return;e.flags|=2;const t=e.dep,n=At,r=An;At=e,An=!0;try{dd(e);const s=e.fn(e._value);(t.version===0||Hn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{At=n,An=r,fd(e),e.flags&=-3}}function cl(e,t=!1){const{dep:n,prevSub:r,nextSub:s}=e;if(r&&(r.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)cl(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Vh(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let An=!0;const pd=[];function ir(){pd.push(An),An=!1}function ar(){const e=pd.pop();An=e===void 0?!0:e}function Vl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=At;At=void 0;try{t()}finally{At=n}}}let Ys=0;class Gh{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 ul{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(!At||!An||At===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==At)n=this.activeLink=new Gh(At,this),At.deps?(n.prevDep=At.depsTail,At.depsTail.nextDep=n,At.depsTail=n):At.deps=At.depsTail=n,md(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=At.depsTail,n.nextDep=void 0,At.depsTail.nextDep=n,At.depsTail=n,At.deps===n&&(At.deps=r)}return n}trigger(t){this.version++,Ys++,this.notify(t)}notify(t){al();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{ll()}}}function md(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)md(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Ta=new WeakMap,zr=Symbol(""),Sa=Symbol(""),Xs=Symbol("");function tn(e,t,n){if(An&&At){let r=Ta.get(e);r||Ta.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new ul),s.map=r,s.key=n),s.track()}}function tr(e,t,n,r,s,o){const i=Ta.get(e);if(!i){Ys++;return}const a=l=>{l&&l.trigger()};if(al(),t==="clear")i.forEach(a);else{const l=We(e),u=l&&sl(n);if(l&&n==="length"){const c=Number(r);i.forEach((f,m)=>{(m==="length"||m===Xs||!xn(m)&&m>=c)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),u&&a(i.get(Xs)),t){case"add":l?u&&a(i.get("length")):(a(i.get(zr)),us(e)&&a(i.get(Sa)));break;case"delete":l||(a(i.get(zr)),us(e)&&a(i.get(Sa)));break;case"set":us(e)&&a(i.get(zr));break}}ll()}function ss(e){const t=dt(e);return t===e?t:(tn(t,"iterate",Xs),In(e)?t:t.map(Mn))}function fi(e){return tn(e=dt(e),"iterate",Xs),e}function Fn(e,t){return lr(e)?ys(qr(e)?Mn(t):t):Mn(t)}const zh={__proto__:null,[Symbol.iterator](){return Vi(this,Symbol.iterator,e=>Fn(this,e))},concat(...e){return ss(this).concat(...e.map(t=>We(t)?ss(t):t))},entries(){return Vi(this,"entries",e=>(e[1]=Fn(this,e[1]),e))},every(e,t){return Yn(this,"every",e,t,void 0,arguments)},filter(e,t){return Yn(this,"filter",e,t,n=>n.map(r=>Fn(this,r)),arguments)},find(e,t){return Yn(this,"find",e,t,n=>Fn(this,n),arguments)},findIndex(e,t){return Yn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Yn(this,"findLast",e,t,n=>Fn(this,n),arguments)},findLastIndex(e,t){return Yn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Yn(this,"forEach",e,t,void 0,arguments)},includes(...e){return Gi(this,"includes",e)},indexOf(...e){return Gi(this,"indexOf",e)},join(e){return ss(this).join(e)},lastIndexOf(...e){return Gi(this,"lastIndexOf",e)},map(e,t){return Yn(this,"map",e,t,void 0,arguments)},pop(){return $s(this,"pop")},push(...e){return $s(this,"push",e)},reduce(e,...t){return Gl(this,"reduce",e,t)},reduceRight(e,...t){return Gl(this,"reduceRight",e,t)},shift(){return $s(this,"shift")},some(e,t){return Yn(this,"some",e,t,void 0,arguments)},splice(...e){return $s(this,"splice",e)},toReversed(){return ss(this).toReversed()},toSorted(e){return ss(this).toSorted(e)},toSpliced(...e){return ss(this).toSpliced(...e)},unshift(...e){return $s(this,"unshift",e)},values(){return Vi(this,"values",e=>Fn(this,e))}};function Vi(e,t,n){const r=fi(e),s=r[t]();return r!==e&&!In(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const qh=Array.prototype;function Yn(e,t,n,r,s,o){const i=fi(e),a=i!==e&&!In(e),l=i[t];if(l!==qh[t]){const f=l.apply(e,o);return a?Mn(f):f}let u=n;i!==e&&(a?u=function(f,m){return n.call(this,Fn(e,f),m,e)}:n.length>2&&(u=function(f,m){return n.call(this,f,m,e)}));const c=l.call(i,u,r);return a&&s?s(c):c}function Gl(e,t,n,r){const s=fi(e),o=s!==e&&!In(e);let i=n,a=!1;s!==e&&(o?(a=r.length===0,i=function(u,c,f){return a&&(a=!1,u=Fn(e,u)),n.call(this,u,Fn(e,c),f,e)}):n.length>3&&(i=function(u,c,f){return n.call(this,u,c,f,e)}));const l=s[t](i,...r);return a?Fn(e,l):l}function Gi(e,t,n){const r=dt(e);tn(r,"iterate",Xs);const s=r[t](...n);return(s===-1||s===!1)&&hl(n[0])?(n[0]=dt(n[0]),r[t](...n)):s}function $s(e,t,n=[]){ir(),al();const r=dt(e)[t].apply(e,n);return ll(),ar(),r}const Kh=tl("__proto__,__v_isRef,__isVue"),gd=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(xn));function Jh(e){xn(e)||(e=String(e));const t=dt(this);return tn(t,"has",e),t.hasOwnProperty(e)}class vd{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(s?o?op:_d:o?bd:wd).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=We(t);if(!s){let l;if(i&&(l=zh[n]))return l;if(n==="hasOwnProperty")return Jh}const a=Reflect.get(t,n,sn(t)?t:r);if((xn(n)?gd.has(n):Kh(n))||(s||tn(t,"get",n),o))return a;if(sn(a)){const l=i&&sl(n)?a:a.value;return s&&mt(l)?Ea(l):l}return mt(a)?s?Ea(a):hi(a):a}}class yd extends vd{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=We(t)&&sl(n);if(!this._isShallow){const u=lr(o);if(!In(r)&&!lr(r)&&(o=dt(o),r=dt(r)),!i&&sn(o)&&!sn(r))return u||(o.value=r),!0}const a=i?Number(n)<t.length:pt(t,n),l=Reflect.set(t,n,r,sn(t)?t:s);return t===dt(s)&&(a?Hn(r,o)&&tr(t,"set",n,r):tr(t,"add",n,r)),l}deleteProperty(t,n){const r=pt(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&tr(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!xn(n)||!gd.has(n))&&tn(t,"has",n),r}ownKeys(t){return tn(t,"iterate",We(t)?"length":zr),Reflect.ownKeys(t)}}class Yh extends vd{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Xh=new yd,Qh=new Yh,Zh=new yd(!0);const Ia=e=>e,Eo=e=>Reflect.getPrototypeOf(e);function ep(e,t,n){return function(...r){const s=this.__v_raw,o=dt(s),i=us(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,u=s[e](...r),c=n?Ia:t?ys:Mn;return!t&&tn(o,"iterate",l?Sa:zr),Bt(Object.create(u),{next(){const{value:f,done:m}=u.next();return m?{value:f,done:m}:{value:a?[c(f[0]),c(f[1])]:c(f),done:m}}})}}function Co(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function tp(e,t){const n={get(s){const o=this.__v_raw,i=dt(o),a=dt(s);e||(Hn(s,a)&&tn(i,"get",s),tn(i,"get",a));const{has:l}=Eo(i),u=t?Ia:e?ys:Mn;if(l.call(i,s))return u(o.get(s));if(l.call(i,a))return u(o.get(a));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&tn(dt(s),"iterate",zr),s.size},has(s){const o=this.__v_raw,i=dt(o),a=dt(s);return e||(Hn(s,a)&&tn(i,"has",s),tn(i,"has",a)),s===a?o.has(s):o.has(s)||o.has(a)},forEach(s,o){const i=this,a=i.__v_raw,l=dt(a),u=t?Ia:e?ys:Mn;return!e&&tn(l,"iterate",zr),a.forEach((c,f)=>s.call(o,u(c),u(f),i))}};return Bt(n,e?{add:Co("add"),set:Co("set"),delete:Co("delete"),clear:Co("clear")}:{add(s){const o=dt(this),i=Eo(o),a=dt(s),l=!t&&!In(s)&&!lr(s)?a:s;return i.has.call(o,l)||Hn(s,l)&&i.has.call(o,s)||Hn(a,l)&&i.has.call(o,a)||(o.add(l),tr(o,"add",l,l)),this},set(s,o){!t&&!In(o)&&!lr(o)&&(o=dt(o));const i=dt(this),{has:a,get:l}=Eo(i);let u=a.call(i,s);u||(s=dt(s),u=a.call(i,s));const c=l.call(i,s);return i.set(s,o),u?Hn(o,c)&&tr(i,"set",s,o):tr(i,"add",s,o),this},delete(s){const o=dt(this),{has:i,get:a}=Eo(o);let l=i.call(o,s);l||(s=dt(s),l=i.call(o,s)),a&&a.call(o,s);const u=o.delete(s);return l&&tr(o,"delete",s,void 0),u},clear(){const s=dt(this),o=s.size!==0,i=s.clear();return o&&tr(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=ep(s,e,t)}),n}function dl(e,t){const n=tp(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(pt(n,s)&&s in r?n:r,s,o)}const np={get:dl(!1,!1)},rp={get:dl(!1,!0)},sp={get:dl(!0,!1)};const wd=new WeakMap,bd=new WeakMap,_d=new WeakMap,op=new WeakMap;function ip(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ap(e){return e.__v_skip||!Object.isExtensible(e)?0:ip(xh(e))}function hi(e){return lr(e)?e:fl(e,!1,Xh,np,wd)}function kd(e){return fl(e,!1,Zh,rp,bd)}function Ea(e){return fl(e,!0,Qh,sp,_d)}function fl(e,t,n,r,s){if(!mt(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=ap(e);if(o===0)return e;const i=s.get(e);if(i)return i;const a=new Proxy(e,o===2?r:n);return s.set(e,a),a}function qr(e){return lr(e)?qr(e.__v_raw):!!(e&&e.__v_isReactive)}function lr(e){return!!(e&&e.__v_isReadonly)}function In(e){return!!(e&&e.__v_isShallow)}function hl(e){return e?!!e.__v_raw:!1}function dt(e){const t=e&&e.__v_raw;return t?dt(t):e}function lp(e){return!pt(e,"__v_skip")&&Object.isExtensible(e)&&sd(e,"__v_skip",!0),e}const Mn=e=>mt(e)?hi(e):e,ys=e=>mt(e)?Ea(e):e;function sn(e){return e?e.__v_isRef===!0:!1}function D(e){return Td(e,!1)}function cp(e){return Td(e,!0)}function Td(e,t){return sn(e)?e:new up(e,t)}class up{constructor(t,n){this.dep=new ul,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:dt(t),this._value=n?t:Mn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||In(t)||lr(t);t=r?t:dt(t),Hn(t,n)&&(this._rawValue=t,this._value=r?t:Mn(t),this.dep.trigger())}}function ye(e){return sn(e)?e.value:e}const dp={get:(e,t,n)=>t==="__v_raw"?e:ye(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return sn(s)&&!sn(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Sd(e){return qr(e)?e:new Proxy(e,dp)}class fp{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new ul(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ys-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&At!==this)return ud(this,!0),!0}get value(){const t=this.dep.track();return hd(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function hp(e,t,n=!1){let r,s;return Je(e)?r=e:(r=e.get,s=e.set),new fp(r,s,n)}const Ao={},Go=new WeakMap;let Fr;function pp(e,t=!1,n=Fr){if(n){let r=Go.get(n);r||Go.set(n,r=[]),r.push(e)}}function mp(e,t,n=Ct){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,u=W=>s?W:In(W)||s===!1||s===0?nr(W,1):nr(W);let c,f,m,T,U=!1,P=!1;if(sn(e)?(f=()=>e.value,U=In(e)):qr(e)?(f=()=>u(e),U=!0):We(e)?(P=!0,U=e.some(W=>qr(W)||In(W)),f=()=>e.map(W=>{if(sn(W))return W.value;if(qr(W))return u(W);if(Je(W))return l?l(W,2):W()})):Je(e)?t?f=l?()=>l(e,2):e:f=()=>{if(m){ir();try{m()}finally{ar()}}const W=Fr;Fr=c;try{return l?l(e,3,[T]):e(T)}finally{Fr=W}}:f=zn,t&&s){const W=f,ce=s===!0?1/0:s;f=()=>nr(W(),ce)}const F=Wh(),R=()=>{c.stop(),F&&F.active&&rl(F.effects,c)};if(o&&t){const W=t;t=(...ce)=>{W(...ce),R()}}let A=P?new Array(e.length).fill(Ao):Ao;const B=W=>{if(!(!(c.flags&1)||!c.dirty&&!W))if(t){const ce=c.run();if(s||U||(P?ce.some((me,ve)=>Hn(me,A[ve])):Hn(ce,A))){m&&m();const me=Fr;Fr=c;try{const ve=[ce,A===Ao?void 0:P&&A[0]===Ao?[]:A,T];A=ce,l?l(t,3,ve):t(...ve)}finally{Fr=me}}}else c.run()};return a&&a(B),c=new ld(f),c.scheduler=i?()=>i(B,!1):B,T=W=>pp(W,!1,c),m=c.onStop=()=>{const W=Go.get(c);if(W){if(l)l(W,4);else for(const ce of W)ce();Go.delete(c)}},t?r?B(!0):A=c.run():i?i(B.bind(null,!0),!0):c.run(),R.pause=c.pause.bind(c),R.resume=c.resume.bind(c),R.stop=R,R}function nr(e,t=1/0,n){if(t<=0||!mt(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,sn(e))nr(e.value,t,n);else if(We(e))for(let r=0;r<e.length;r++)nr(e[r],t,n);else if(ed(e)||us(e))e.forEach(r=>{nr(r,t,n)});else if(rd(e)){for(const r in e)nr(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&nr(e[r],t,n)}return e}/**
10
10
  * @vue/runtime-core v3.5.30
11
11
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
12
  * @license MIT
13
- **/function fo(e,t,n,r){try{return r?e(...r):e()}catch(s){pi(s,t,n)}}function $n(e,t,n,r){if(Je(e)){const s=fo(e,t,n,r);return s&&td(s)&&s.catch(o=>{pi(o,t,n)}),s}if(We(e)){const s=[];for(let o=0;o<e.length;o++)s.push($n(e[o],t,n,r));return s}}function pi(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||Ct;if(t){let a=t.parent;const l=t.proxy,u=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let f=0;f<c.length;f++)if(c[f](e,l,u)===!1)return}a=a.parent}if(o){ir(),fo(o,null,10,[e,l,u]),ar();return}}gp(e,n,s,r,i)}function gp(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const un=[];let jn=-1;const ds=[];let Sr=null,is=0;const Id=Promise.resolve();let zo=null;function Yt(e){const t=zo||Id;return e?t.then(this?e.bind(this):e):t}function vp(e){let t=jn+1,n=un.length;for(;t<n;){const r=t+n>>>1,s=un[r],o=Qs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function pl(e){if(!(e.flags&1)){const t=Qs(e),n=un[un.length-1];!n||!(e.flags&2)&&t>=Qs(n)?un.push(e):un.splice(vp(t),0,e),e.flags|=1,Ed()}}function Ed(){zo||(zo=Id.then(Ad))}function yp(e){We(e)?ds.push(...e):Sr&&e.id===-1?Sr.splice(is+1,0,e):e.flags&1||(ds.push(e),e.flags|=1),Ed()}function zl(e,t,n=jn+1){for(;n<un.length;n++){const r=un[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;un.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Cd(e){if(ds.length){const t=[...new Set(ds)].sort((n,r)=>Qs(n)-Qs(r));if(ds.length=0,Sr){Sr.push(...t);return}for(Sr=t,is=0;is<Sr.length;is++){const n=Sr[is];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Sr=null,is=0}}const Qs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ad(e){try{for(jn=0;jn<un.length;jn++){const t=un[jn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),fo(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;jn<un.length;jn++){const t=un[jn];t&&(t.flags&=-2)}jn=-1,un.length=0,Cd(),zo=null,(un.length||ds.length)&&Ad()}}let Xt=null,Rd=null;function qo(e){const t=Xt;return Xt=e,Rd=e&&e.type.__scopeId||null,t}function _t(e,t=Xt,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&Qo(-1);const o=qo(t);let i;try{i=e(...s)}finally{qo(o),r._d&&Qo(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function cr(e,t){if(Xt===null)return e;const n=bi(Xt),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=Ct]=t[s];o&&(Je(o)&&(o={mounted:o,updated:o}),o.deep&&nr(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function Nr(e,t,n,r){const s=e.dirs,o=t&&t.dirs;for(let i=0;i<s.length;i++){const a=s[i];o&&(a.oldValue=o[i].value);let l=a.dir[r];l&&(ir(),$n(l,n,8,[e.el,a,e,t]),ar())}}function Do(e,t){if(rn){let n=rn.provides;const r=rn.parent&&rn.parent.provides;r===n&&(n=rn.provides=Object.create(r)),n[e]=t}}function Rn(e,t,n=!1){const r=wl();if(r||hs){let s=hs?hs._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&Je(t)?t.call(r&&r.proxy):t}}const wp=Symbol.for("v-scx"),bp=()=>Rn(wp);function ut(e,t,n){return Pd(e,t,n)}function Pd(e,t,n=Ct){const{immediate:r,deep:s,flush:o,once:i}=n,a=Bt({},n),l=t&&r||!t&&o!=="post";let u;if(ro){if(o==="sync"){const k=bp();u=k.__watcherHandles||(k.__watcherHandles=[])}else if(!l){const k=()=>{};return k.stop=zn,k.resume=zn,k.pause=zn,k}}const c=rn;a.call=(k,U,P)=>$n(k,c,U,P);let f=!1;o==="post"?a.scheduler=k=>{en(k,c&&c.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(k,U)=>{U?k():pl(k)}),a.augmentJob=k=>{t&&(k.flags|=4),f&&(k.flags|=2,c&&(k.id=c.uid,k.i=c))};const m=mp(e,t,a);return ro&&(u?u.push(m):l&&m()),m}function _p(e,t,n){const r=this.proxy,s=Mt(e)?e.includes(".")?xd(r,e):()=>r[e]:e.bind(r,r);let o;Je(t)?o=t:(o=t.handler,n=t);const i=ho(this),a=Pd(s,o.bind(r),n);return i(),a}function xd(e,t){const n=t.split(".");return()=>{let r=e;for(let s=0;s<n.length&&r;s++)r=r[n[s]];return r}}const Md=Symbol("_vte"),$d=e=>e.__isTeleport,Ws=e=>e&&(e.disabled||e.disabled===""),ql=e=>e&&(e.defer||e.defer===""),Kl=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Jl=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ca=(e,t)=>{const n=e&&e.to;return Mt(n)?t?t(n):null:n},Od={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,u){const{mc:c,pc:f,pbc:m,o:{insert:k,querySelector:U,createText:P,createComment:F}}=u,R=Ws(t.props);let{shapeFlag:A,children:B,dynamicChildren:W}=t;if(e==null){const ce=t.el=P(""),me=t.anchor=P("");k(ce,n,r),k(me,n,r);const ve=(re,le)=>{A&16&&c(B,re,le,s,o,i,a,l)},Ie=()=>{const re=t.target=Ca(t.props,U),le=Aa(re,t,P,k);re&&(i!=="svg"&&Kl(re)?i="svg":i!=="mathml"&&Jl(re)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(re),R||(ve(re,le),Lo(t,!1)))};R&&(ve(n,me),Lo(t,!0)),ql(t.props)?(t.el.__isMounted=!1,en(()=>{Ie(),delete t.el.__isMounted},o)):Ie()}else{if(ql(t.props)&&e.el.__isMounted===!1){en(()=>{Od.process(e,t,n,r,s,o,i,a,l,u)},o);return}t.el=e.el,t.targetStart=e.targetStart;const ce=t.anchor=e.anchor,me=t.target=e.target,ve=t.targetAnchor=e.targetAnchor,Ie=Ws(e.props),re=Ie?n:me,le=Ie?ce:ve;if(i==="svg"||Kl(me)?i="svg":(i==="mathml"||Jl(me))&&(i="mathml"),W?(m(e.dynamicChildren,W,re,s,o,i,a),vl(e,t,!0)):l||f(e,t,re,le,s,o,i,a,!1),R)Ie?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Ro(t,n,ce,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const we=t.target=Ca(t.props,U);we&&Ro(t,we,null,u,0)}else Ie&&Ro(t,me,ve,u,1);Lo(t,R)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:u,targetAnchor:c,target:f,props:m}=e;if(f&&(s(u),s(c)),o&&s(l),i&16){const k=o||!Ws(m);for(let U=0;U<a.length;U++){const P=a[U];r(P,t,n,k,!!P.dynamicChildren)}}},move:Ro,hydrate:kp};function Ro(e,t,n,{o:{insert:r},m:s},o=2){o===0&&r(e.targetAnchor,t,n);const{el:i,anchor:a,shapeFlag:l,children:u,props:c}=e,f=o===2;if(f&&r(i,t,n),(!f||Ws(c))&&l&16)for(let m=0;m<u.length;m++)s(u[m],t,n,2);f&&r(a,t,n)}function kp(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:u,createText:c}},f){function m(F,R){let A=R;for(;A;){if(A&&A.nodeType===8){if(A.data==="teleport start anchor")t.targetStart=A;else if(A.data==="teleport anchor"){t.targetAnchor=A,F._lpa=t.targetAnchor&&i(t.targetAnchor);break}}A=i(A)}}function k(F,R){R.anchor=f(i(F),R,a(F),n,r,s,o)}const U=t.target=Ca(t.props,l),P=Ws(t.props);if(U){const F=U._lpa||U.firstChild;t.shapeFlag&16&&(P?(k(e,t),m(U,F),t.targetAnchor||Aa(U,t,c,u,a(e)===U?e:null)):(t.anchor=i(e),m(U,F),t.targetAnchor||Aa(U,t,c,u),f(F&&i(F),t,U,n,r,s,o))),Lo(t,P)}else P&&t.shapeFlag&16&&(k(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Ko=Od;function Lo(e,t){const n=e.ctx;if(n&&n.ut){let r,s;for(t?(r=e.el,s=e.anchor):(r=e.targetStart,s=e.targetAnchor);r&&r!==s;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function Aa(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Md]=i,e&&(r(o,e,s),r(i,e,s)),i}const Un=Symbol("_leaveCb"),Os=Symbol("_enterCb");function Tp(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return pr(()=>{e.isMounted=!0}),mr(()=>{e.isUnmounting=!0}),e}const Tn=[Function,Array],Nd={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Tn,onEnter:Tn,onAfterEnter:Tn,onEnterCancelled:Tn,onBeforeLeave:Tn,onLeave:Tn,onAfterLeave:Tn,onLeaveCancelled:Tn,onBeforeAppear:Tn,onAppear:Tn,onAfterAppear:Tn,onAppearCancelled:Tn},Dd=e=>{const t=e.subTree;return t.component?Dd(t.component):t},Sp={name:"BaseTransition",props:Nd,setup(e,{slots:t}){const n=wl(),r=Tp();return()=>{const s=t.default&&Ud(t.default(),!0);if(!s||!s.length)return;const o=Ld(s),i=dt(e),{mode:a}=i;if(r.isLeaving)return zi(o);const l=Yl(o);if(!l)return zi(o);let u=Ra(l,i,r,n,f=>u=f);l.type!==nn&&Zs(l,u);let c=n.subTree&&Yl(n.subTree);if(c&&c.type!==nn&&!Hr(c,l)&&Dd(n).type!==nn){let f=Ra(c,i,r,n);if(Zs(c,f),a==="out-in"&&l.type!==nn)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,c=void 0},zi(o);a==="in-out"&&l.type!==nn?f.delayLeave=(m,k,U)=>{const P=jd(r,c);P[String(c.key)]=c,m[Un]=()=>{k(),m[Un]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{U(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function Ld(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==nn){t=n;break}}return t}const Ip=Sp;function jd(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 Ra(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:m,onLeave:k,onAfterLeave:U,onLeaveCancelled:P,onBeforeAppear:F,onAppear:R,onAfterAppear:A,onAppearCancelled:B}=t,W=String(e.key),ce=jd(n,e),me=(re,le)=>{re&&$n(re,r,9,le)},ve=(re,le)=>{const we=le[1];me(re,le),We(re)?re.every(Y=>Y.length<=1)&&we():re.length<=1&&we()},Ie={mode:i,persisted:a,beforeEnter(re){let le=l;if(!n.isMounted)if(o)le=F||l;else return;re[Un]&&re[Un](!0);const we=ce[W];we&&Hr(e,we)&&we.el[Un]&&we.el[Un](),me(le,[re])},enter(re){if(ce[W]===e)return;let le=u,we=c,Y=f;if(!n.isMounted)if(o)le=R||u,we=A||c,Y=B||f;else return;let Te=!1;re[Os]=Le=>{Te||(Te=!0,Le?me(Y,[re]):me(we,[re]),Ie.delayedLeave&&Ie.delayedLeave(),re[Os]=void 0)};const xe=re[Os].bind(null,!1);le?ve(le,[re,xe]):xe()},leave(re,le){const we=String(e.key);if(re[Os]&&re[Os](!0),n.isUnmounting)return le();me(m,[re]);let Y=!1;re[Un]=xe=>{Y||(Y=!0,le(),xe?me(P,[re]):me(U,[re]),re[Un]=void 0,ce[we]===e&&delete ce[we])};const Te=re[Un].bind(null,!1);ce[we]=e,k?ve(k,[re,Te]):Te()},clone(re){const le=Ra(re,t,n,r,s);return s&&s(le),le}};return Ie}function zi(e){if(mi(e))return e=Mr(e),e.children=null,e}function Yl(e){if(!mi(e))return $d(e.type)&&e.children?Ld(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&&Je(n.default))return n.default()}}function Zs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Zs(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 Ud(e,t=!1,n){let r=[],s=0;for(let o=0;o<e.length;o++){let i=e[o];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:o);i.type===Be?(i.patchFlag&128&&s++,r=r.concat(Ud(i.children,t,a))):(t||i.type!==nn)&&r.push(a!=null?Mr(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function Ht(e,t){return Je(e)?Bt({name:e.name},t,{setup:e}):e}function Fd(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Xl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Jo=new WeakMap;function Vs(e,t,n,r,s=!1){if(We(e)){e.forEach((P,F)=>Vs(P,t&&(We(t)?t[F]:t),n,r,s));return}if(fs(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Vs(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?bi(r.component):r.el,i=s?null:o,{i:a,r:l}=e,u=t&&t.r,c=a.refs===Ct?a.refs={}:a.refs,f=a.setupState,m=dt(f),k=f===Ct?Zu:P=>Xl(c,P)?!1:pt(m,P),U=(P,F)=>!(F&&Xl(c,F));if(u!=null&&u!==l){if(Ql(t),Mt(u))c[u]=null,k(u)&&(f[u]=null);else if(sn(u)){const P=t;U(u,P.k)&&(u.value=null),P.k&&(c[P.k]=null)}}if(Je(l))fo(l,a,12,[i,c]);else{const P=Mt(l),F=sn(l);if(P||F){const R=()=>{if(e.f){const A=P?k(l)?f[l]:c[l]:U()||!e.k?l.value:c[e.k];if(s)We(A)&&rl(A,o);else if(We(A))A.includes(o)||A.push(o);else if(P)c[l]=[o],k(l)&&(f[l]=c[l]);else{const B=[o];U(l,e.k)&&(l.value=B),e.k&&(c[e.k]=B)}}else P?(c[l]=i,k(l)&&(f[l]=i)):F&&(U(l,e.k)&&(l.value=i),e.k&&(c[e.k]=i))};if(i){const A=()=>{R(),Jo.delete(e)};A.id=-1,Jo.set(e,A),en(A,n)}else Ql(e),R()}}}function Ql(e){const t=Jo.get(e);t&&(t.flags|=8,Jo.delete(e))}di().requestIdleCallback;di().cancelIdleCallback;const fs=e=>!!e.type.__asyncLoader,mi=e=>e.type.__isKeepAlive;function Ep(e,t){Bd(e,"a",t)}function Cp(e,t){Bd(e,"da",t)}function Bd(e,t,n=rn){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(gi(t,r,n),n){let s=n.parent;for(;s&&s.parent;)mi(s.parent.vnode)&&Ap(r,t,n,s),s=s.parent}}function Ap(e,t,n,r){const s=gi(t,e,r,!0);vi(()=>{rl(r[t],s)},n)}function gi(e,t,n=rn,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{ir();const a=ho(n),l=$n(t,n,e,i);return a(),ar(),l});return r?s.unshift(o):s.push(o),o}}const hr=e=>(t,n=rn)=>{(!ro||e==="sp")&&gi(e,(...r)=>t(...r),n)},Rp=hr("bm"),pr=hr("m"),Pp=hr("bu"),xp=hr("u"),mr=hr("bum"),vi=hr("um"),Mp=hr("sp"),$p=hr("rtg"),Op=hr("rtc");function Np(e,t=rn){gi("ec",e,t)}const Dp="components",Hd=Symbol.for("v-ndc");function Yo(e){return Mt(e)?Lp(Dp,e,!1)||e:e||Hd}function Lp(e,t,n=!0,r=!1){const s=Xt||rn;if(s){const o=s.type;{const a=_m(o,!1);if(a&&(a===t||a===fn(t)||a===ui(fn(t))))return o}const i=Zl(s[e]||o[e],t)||Zl(s.appContext[e],t);return!i&&r?o:i}}function Zl(e,t){return e&&(e[t]||e[fn(t)]||e[ui(fn(t))])}function St(e,t,n,r){let s;const o=n,i=We(e);if(i||Mt(e)){const a=i&&qr(e);let l=!1,u=!1;a&&(l=!In(e),u=lr(e),e=fi(e)),s=new Array(e.length);for(let c=0,f=e.length;c<f;c++)s[c]=t(l?u?ys(Mn(e[c])):Mn(e[c]):e[c],c,void 0,o)}else if(typeof e=="number"){s=new Array(e);for(let a=0;a<e;a++)s[a]=t(a+1,a,void 0,o)}else if(mt(e))if(e[Symbol.iterator])s=Array.from(e,(a,l)=>t(a,l,void 0,o));else{const a=Object.keys(e);s=new Array(a.length);for(let l=0,u=a.length;l<u;l++){const c=a[l];s[l]=t(e[c],c,l,o)}}else s=[];return s}function Gn(e,t,n={},r,s){if(Xt.ce||Xt.parent&&fs(Xt.parent)&&Xt.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),ft(Be,null,[Re("slot",n,r)],u?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),w();const i=o&&Wd(o(n)),a=n.key||i&&i.key,l=ft(Be,{key:(a&&!xn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function Wd(e){return e.some(t=>to(t)?!(t.type===nn||t.type===Be&&!Wd(t.children)):!0)?e:null}const Pa=e=>e?uf(e)?bi(e):Pa(e.parent):null,Gs=Bt(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=>Pa(e.parent),$root:e=>Pa(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Gd(e),$forceUpdate:e=>e.f||(e.f=()=>{pl(e.update)}),$nextTick:e=>e.n||(e.n=Yt.bind(e.proxy)),$watch:e=>_p.bind(e)}),qi=(e,t)=>e!==Ct&&!e.__isScriptSetup&&pt(e,t),jp={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,props:o,accessCache:i,type:a,appContext:l}=e;if(t[0]!=="$"){const m=i[t];if(m!==void 0)switch(m){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(qi(r,t))return i[t]=1,r[t];if(s!==Ct&&pt(s,t))return i[t]=2,s[t];if(pt(o,t))return i[t]=3,o[t];if(n!==Ct&&pt(n,t))return i[t]=4,n[t];xa&&(i[t]=0)}}const u=Gs[t];let c,f;if(u)return t==="$attrs"&&tn(e.attrs,"get",""),u(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==Ct&&pt(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,pt(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return qi(s,t)?(s[t]=n,!0):r!==Ct&&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:s,props:o,type:i}},a){let l;return!!(n[a]||e!==Ct&&a[0]!=="$"&&pt(e,a)||qi(t,a)||pt(o,a)||pt(r,a)||pt(Gs,a)||pt(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},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 Up(){return Fp().slots}function Fp(e){const t=wl();return t.setupContext||(t.setupContext=ff(t))}function ec(e){return We(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let xa=!0;function Bp(e){const t=Gd(e),n=e.proxy,r=e.ctx;xa=!1,t.beforeCreate&&tc(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:u,created:c,beforeMount:f,mounted:m,beforeUpdate:k,updated:U,activated:P,deactivated:F,beforeDestroy:R,beforeUnmount:A,destroyed:B,unmounted:W,render:ce,renderTracked:me,renderTriggered:ve,errorCaptured:Ie,serverPrefetch:re,expose:le,inheritAttrs:we,components:Y,directives:Te,filters:xe}=t;if(u&&Hp(u,r,null),i)for(const Oe in i){const Ee=i[Oe];Je(Ee)&&(r[Oe]=Ee.bind(n))}if(s){const Oe=s.call(n,n);mt(Oe)&&(e.data=hi(Oe))}if(xa=!0,o)for(const Oe in o){const Ee=o[Oe],Ye=Je(Ee)?Ee.bind(n,n):Je(Ee.get)?Ee.get.bind(n,n):zn,Ze=!Je(Ee)&&Je(Ee.set)?Ee.set.bind(n):zn,Ne=fe({get:Ye,set:Ze});Object.defineProperty(r,Oe,{enumerable:!0,configurable:!0,get:()=>Ne.value,set:nt=>Ne.value=nt})}if(a)for(const Oe in a)Vd(a[Oe],r,n,Oe);if(l){const Oe=Je(l)?l.call(n):l;Reflect.ownKeys(Oe).forEach(Ee=>{Do(Ee,Oe[Ee])})}c&&tc(c,e,"c");function Pe(Oe,Ee){We(Ee)?Ee.forEach(Ye=>Oe(Ye.bind(n))):Ee&&Oe(Ee.bind(n))}if(Pe(Rp,f),Pe(pr,m),Pe(Pp,k),Pe(xp,U),Pe(Ep,P),Pe(Cp,F),Pe(Np,Ie),Pe(Op,me),Pe($p,ve),Pe(mr,A),Pe(vi,W),Pe(Mp,re),We(le))if(le.length){const Oe=e.exposed||(e.exposed={});le.forEach(Ee=>{Object.defineProperty(Oe,Ee,{get:()=>n[Ee],set:Ye=>n[Ee]=Ye,enumerable:!0})})}else e.exposed||(e.exposed={});ce&&e.render===zn&&(e.render=ce),we!=null&&(e.inheritAttrs=we),Y&&(e.components=Y),Te&&(e.directives=Te),re&&Fd(e)}function Hp(e,t,n=zn){We(e)&&(e=Ma(e));for(const r in e){const s=e[r];let o;mt(s)?"default"in s?o=Rn(s.from||r,s.default,!0):o=Rn(s.from||r):o=Rn(s),sn(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function tc(e,t,n){$n(We(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Vd(e,t,n,r){let s=r.includes(".")?xd(n,r):()=>n[r];if(Mt(e)){const o=t[e];Je(o)&&ut(s,o)}else if(Je(e))ut(s,e.bind(n));else if(mt(e))if(We(e))e.forEach(o=>Vd(o,t,n,r));else{const o=Je(e.handler)?e.handler.bind(n):t[e.handler];Je(o)&&ut(s,o,e)}}function Gd(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,a=o.get(t);let l;return a?l=a:!s.length&&!n&&!r?l=t:(l={},s.length&&s.forEach(u=>Xo(l,u,i,!0)),Xo(l,t,i)),mt(t)&&o.set(t,l),l}function Xo(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Xo(e,o,n,!0),s&&s.forEach(i=>Xo(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=Wp[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const Wp={data:nc,props:rc,emits:rc,methods:Us,computed:Us,beforeCreate:ln,created:ln,beforeMount:ln,mounted:ln,beforeUpdate:ln,updated:ln,beforeDestroy:ln,beforeUnmount:ln,destroyed:ln,unmounted:ln,activated:ln,deactivated:ln,errorCaptured:ln,serverPrefetch:ln,components:Us,directives:Us,watch:Gp,provide:nc,inject:Vp};function nc(e,t){return t?e?function(){return Bt(Je(e)?e.call(this,this):e,Je(t)?t.call(this,this):t)}:t:e}function Vp(e,t){return Us(Ma(e),Ma(t))}function Ma(e){if(We(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function ln(e,t){return e?[...new Set([].concat(e,t))]:t}function Us(e,t){return e?Bt(Object.create(null),e,t):t}function rc(e,t){return e?We(e)&&We(t)?[...new Set([...e,...t])]:Bt(Object.create(null),ec(e),ec(t??{})):t}function Gp(e,t){if(!e)return t;if(!t)return e;const n=Bt(Object.create(null),e);for(const r in t)n[r]=ln(e[r],t[r]);return n}function zd(){return{app:null,config:{isNativeTag:Zu,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 zp=0;function qp(e,t){return function(r,s=null){Je(r)||(r=Bt({},r)),s!=null&&!mt(s)&&(s=null);const o=zd(),i=new WeakSet,a=[];let l=!1;const u=o.app={_uid:zp++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:Tm,get config(){return o.config},set config(c){},use(c,...f){return i.has(c)||(c&&Je(c.install)?(i.add(c),c.install(u,...f)):Je(c)&&(i.add(c),c(u,...f))),u},mixin(c){return o.mixins.includes(c)||o.mixins.push(c),u},component(c,f){return f?(o.components[c]=f,u):o.components[c]},directive(c,f){return f?(o.directives[c]=f,u):o.directives[c]},mount(c,f,m){if(!l){const k=u._ceVNode||Re(r,s);return k.appContext=o,m===!0?m="svg":m===!1&&(m=void 0),e(k,c,m),l=!0,u._container=c,c.__vue_app__=u,bi(k.component)}},onUnmount(c){a.push(c)},unmount(){l&&($n(a,u._instance,16),e(null,u._container),delete u._container.__vue_app__)},provide(c,f){return o.provides[c]=f,u},runWithContext(c){const f=hs;hs=u;try{return c()}finally{hs=f}}};return u}}let hs=null;const Kp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${fn(t)}Modifiers`]||e[`${$r(t)}Modifiers`];function Jp(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||Ct;let s=n;const o=t.startsWith("update:"),i=o&&Kp(r,t.slice(7));i&&(i.trim&&(s=n.map(c=>Mt(c)?c.trim():c)),i.number&&(s=n.map(ol)));let a,l=r[a=Bi(t)]||r[a=Bi(fn(t))];!l&&o&&(l=r[a=Bi($r(t))]),l&&$n(l,e,6,s);const u=r[a+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,$n(u,e,6,s)}}const Yp=new WeakMap;function qd(e,t,n=!1){const r=n?Yp:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!Je(e)){const l=u=>{const c=qd(u,t,!0);c&&(a=!0,Bt(i,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(mt(e)&&r.set(e,null),null):(We(o)?o.forEach(l=>i[l]=null):Bt(i,o),mt(e)&&r.set(e,i),i)}function yi(e,t){return!e||!li(t)?!1:(t=t.slice(2).replace(/Once$/,""),pt(e,t[0].toLowerCase()+t.slice(1))||pt(e,$r(t))||pt(e,t))}function sc(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:u,renderCache:c,props:f,data:m,setupState:k,ctx:U,inheritAttrs:P}=e,F=qo(e);let R,A;try{if(n.shapeFlag&4){const W=s||r,ce=W;R=Bn(u.call(ce,W,c,f,k,m,U)),A=a}else{const W=t;R=Bn(W.length>1?W(f,{attrs:a,slots:i,emit:l}):W(f,null)),A=t.props?a:Xp(a)}}catch(W){zs.length=0,pi(W,e,1),R=Re(nn)}let B=R;if(A&&P!==!1){const W=Object.keys(A),{shapeFlag:ce}=B;W.length&&ce&7&&(o&&W.some(nl)&&(A=Qp(A,o)),B=Mr(B,A,!1,!0))}return n.dirs&&(B=Mr(B,null,!1,!0),B.dirs=B.dirs?B.dirs.concat(n.dirs):n.dirs),n.transition&&Zs(B,n.transition),R=B,qo(F),R}const Xp=e=>{let t;for(const n in e)(n==="class"||n==="style"||li(n))&&((t||(t={}))[n]=e[n]);return t},Qp=(e,t)=>{const n={};for(const r in e)(!nl(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Zp(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:a,patchFlag:l}=t,u=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?oc(r,i,u):!!i;if(l&8){const c=t.dynamicProps;for(let f=0;f<c.length;f++){const m=c[f];if(Kd(i,r,m)&&!yi(u,m))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?oc(r,i,u):!0:!!i;return!1}function oc(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let s=0;s<r.length;s++){const o=r[s];if(Kd(t,e,o)&&!yi(n,o))return!0}return!1}function Kd(e,t,n){const r=e[n],s=t[n];return n==="style"&&mt(r)&&mt(s)?!il(r,s):r!==s}function em({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r===e)(e=t.vnode).el=n,t=t.parent;else break}}const Jd={},Yd=()=>Object.create(Jd),Xd=e=>Object.getPrototypeOf(e)===Jd;function tm(e,t,n,r=!1){const s={},o=Yd();e.propsDefaults=Object.create(null),Qd(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:kd(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function nm(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=dt(s),[l]=e.propsOptions;let u=!1;if((r||i>0)&&!(i&16)){if(i&8){const c=e.vnode.dynamicProps;for(let f=0;f<c.length;f++){let m=c[f];if(yi(e.emitsOptions,m))continue;const k=t[m];if(l)if(pt(o,m))k!==o[m]&&(o[m]=k,u=!0);else{const U=fn(m);s[U]=$a(l,a,U,k,e,!1)}else k!==o[m]&&(o[m]=k,u=!0)}}}else{Qd(e,t,s,o)&&(u=!0);let c;for(const f in a)(!t||!pt(t,f)&&((c=$r(f))===f||!pt(t,c)))&&(l?n&&(n[f]!==void 0||n[c]!==void 0)&&(s[f]=$a(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!pt(t,f))&&(delete o[f],u=!0)}u&&tr(e.attrs,"set","")}function Qd(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(Fs(l))continue;const u=t[l];let c;s&&pt(s,c=fn(l))?!o||!o.includes(c)?n[c]=u:(a||(a={}))[c]=u:yi(e.emitsOptions,l)||(!(l in r)||u!==r[l])&&(r[l]=u,i=!0)}if(o){const l=dt(n),u=a||Ct;for(let c=0;c<o.length;c++){const f=o[c];n[f]=$a(s,l,f,u[f],e,!pt(u,f))}}return i}function $a(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=pt(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&Je(l)){const{propsDefaults:u}=s;if(n in u)r=u[n];else{const c=ho(s);r=u[n]=l.call(null,t),c()}}else r=l;s.ce&&s.ce._setProp(n,r)}i[0]&&(o&&!a?r=!1:i[1]&&(r===""||r===$r(n))&&(r=!0))}return r}const rm=new WeakMap;function Zd(e,t,n=!1){const r=n?rm:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!Je(e)){const c=f=>{l=!0;const[m,k]=Zd(f,t,!0);Bt(i,m),k&&a.push(...k)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!o&&!l)return mt(e)&&r.set(e,cs),cs;if(We(o))for(let c=0;c<o.length;c++){const f=fn(o[c]);ic(f)&&(i[f]=Ct)}else if(o)for(const c in o){const f=fn(c);if(ic(f)){const m=o[c],k=i[f]=We(m)||Je(m)?{type:m}:Bt({},m),U=k.type;let P=!1,F=!0;if(We(U))for(let R=0;R<U.length;++R){const A=U[R],B=Je(A)&&A.name;if(B==="Boolean"){P=!0;break}else B==="String"&&(F=!1)}else P=Je(U)&&U.name==="Boolean";k[0]=P,k[1]=F,(P||pt(k,"default"))&&a.push(f)}}const u=[i,a];return mt(e)&&r.set(e,u),u}function ic(e){return e[0]!=="$"&&!Fs(e)}const ml=e=>e==="_"||e==="_ctx"||e==="$stable",gl=e=>We(e)?e.map(Bn):[Bn(e)],sm=(e,t,n)=>{if(t._n)return t;const r=_t((...s)=>gl(t(...s)),n);return r._c=!1,r},ef=(e,t,n)=>{const r=e._ctx;for(const s in e){if(ml(s))continue;const o=e[s];if(Je(o))t[s]=sm(s,o,r);else if(o!=null){const i=gl(o);t[s]=()=>i}}},tf=(e,t)=>{const n=gl(t);e.slots.default=()=>n},nf=(e,t,n)=>{for(const r in t)(n||!ml(r))&&(e[r]=t[r])},om=(e,t,n)=>{const r=e.slots=Yd();if(e.vnode.shapeFlag&32){const s=t._;s?(nf(r,t,n),n&&sd(r,"_",s,!0)):ef(t,r)}else t&&tf(e,t)},im=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=Ct;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:nf(s,t,n):(o=!t.$stable,ef(t,s)),i=t}else t&&(tf(e,t),i={default:1});if(o)for(const a in s)!ml(a)&&i[a]==null&&delete s[a]},en=dm;function am(e){return lm(e)}function lm(e,t){const n=di();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:u,setElementText:c,parentNode:f,nextSibling:m,setScopeId:k=zn,insertStaticContent:U}=e,P=(g,b,x,q=null,G=null,N=null,V=void 0,J=null,Q=!!b.dynamicChildren)=>{if(g===b)return;g&&!Hr(g,b)&&(q=K(g),nt(g,G,N,!0),g=null),b.patchFlag===-2&&(Q=!1,b.dynamicChildren=null);const{type:z,ref:_e,shapeFlag:de}=b;switch(z){case wi:F(g,b,x,q);break;case nn:R(g,b,x,q);break;case Ji:g==null&&A(b,x,q,V);break;case Be:Y(g,b,x,q,G,N,V,J,Q);break;default:de&1?ce(g,b,x,q,G,N,V,J,Q):de&6?Te(g,b,x,q,G,N,V,J,Q):(de&64||de&128)&&z.process(g,b,x,q,G,N,V,J,Q,be)}_e!=null&&G?Vs(_e,g&&g.ref,N,b||g,!b):_e==null&&g&&g.ref!=null&&Vs(g.ref,null,N,g,!0)},F=(g,b,x,q)=>{if(g==null)r(b.el=a(b.children),x,q);else{const G=b.el=g.el;b.children!==g.children&&u(G,b.children)}},R=(g,b,x,q)=>{g==null?r(b.el=l(b.children||""),x,q):b.el=g.el},A=(g,b,x,q)=>{[g.el,g.anchor]=U(g.children,b,x,q,g.el,g.anchor)},B=({el:g,anchor:b},x,q)=>{let G;for(;g&&g!==b;)G=m(g),r(g,x,q),g=G;r(b,x,q)},W=({el:g,anchor:b})=>{let x;for(;g&&g!==b;)x=m(g),s(g),g=x;s(b)},ce=(g,b,x,q,G,N,V,J,Q)=>{if(b.type==="svg"?V="svg":b.type==="math"&&(V="mathml"),g==null)me(b,x,q,G,N,V,J,Q);else{const z=g.el&&g.el._isVueCE?g.el:null;try{z&&z._beginPatch(),re(g,b,G,N,V,J,Q)}finally{z&&z._endPatch()}}},me=(g,b,x,q,G,N,V,J)=>{let Q,z;const{props:_e,shapeFlag:de,transition:Se,dirs:Me}=g;if(Q=g.el=i(g.type,N,_e&&_e.is,_e),de&8?c(Q,g.children):de&16&&Ie(g.children,Q,null,q,G,Ki(g,N),V,J),Me&&Nr(g,null,q,"created"),ve(Q,g,g.scopeId,V,q),_e){for(const Fe in _e)Fe!=="value"&&!Fs(Fe)&&o(Q,Fe,null,_e[Fe],N,q);"value"in _e&&o(Q,"value",null,_e.value,N),(z=_e.onVnodeBeforeMount)&&Ln(z,q,g)}Me&&Nr(g,null,q,"beforeMount");const De=cm(G,Se);De&&Se.beforeEnter(Q),r(Q,b,x),((z=_e&&_e.onVnodeMounted)||De||Me)&&en(()=>{z&&Ln(z,q,g),De&&Se.enter(Q),Me&&Nr(g,null,q,"mounted")},G)},ve=(g,b,x,q,G)=>{if(x&&k(g,x),q)for(let N=0;N<q.length;N++)k(g,q[N]);if(G){let N=G.subTree;if(b===N||of(N.type)&&(N.ssContent===b||N.ssFallback===b)){const V=G.vnode;ve(g,V,V.scopeId,V.slotScopeIds,G.parent)}}},Ie=(g,b,x,q,G,N,V,J,Q=0)=>{for(let z=Q;z<g.length;z++){const _e=g[z]=J?er(g[z]):Bn(g[z]);P(null,_e,b,x,q,G,N,V,J)}},re=(g,b,x,q,G,N,V)=>{const J=b.el=g.el;let{patchFlag:Q,dynamicChildren:z,dirs:_e}=b;Q|=g.patchFlag&16;const de=g.props||Ct,Se=b.props||Ct;let Me;if(x&&Dr(x,!1),(Me=Se.onVnodeBeforeUpdate)&&Ln(Me,x,b,g),_e&&Nr(b,g,x,"beforeUpdate"),x&&Dr(x,!0),(de.innerHTML&&Se.innerHTML==null||de.textContent&&Se.textContent==null)&&c(J,""),z?le(g.dynamicChildren,z,J,x,q,Ki(b,G),N):V||Ee(g,b,J,null,x,q,Ki(b,G),N,!1),Q>0){if(Q&16)we(J,de,Se,x,G);else if(Q&2&&de.class!==Se.class&&o(J,"class",null,Se.class,G),Q&4&&o(J,"style",de.style,Se.style,G),Q&8){const De=b.dynamicProps;for(let Fe=0;Fe<De.length;Fe++){const He=De[Fe],ot=de[He],tt=Se[He];(tt!==ot||He==="value")&&o(J,He,ot,tt,G,x)}}Q&1&&g.children!==b.children&&c(J,b.children)}else!V&&z==null&&we(J,de,Se,x,G);((Me=Se.onVnodeUpdated)||_e)&&en(()=>{Me&&Ln(Me,x,b,g),_e&&Nr(b,g,x,"updated")},q)},le=(g,b,x,q,G,N,V)=>{for(let J=0;J<b.length;J++){const Q=g[J],z=b[J],_e=Q.el&&(Q.type===Be||!Hr(Q,z)||Q.shapeFlag&198)?f(Q.el):x;P(Q,z,_e,null,q,G,N,V,!0)}},we=(g,b,x,q,G)=>{if(b!==x){if(b!==Ct)for(const N in b)!Fs(N)&&!(N in x)&&o(g,N,b[N],null,G,q);for(const N in x){if(Fs(N))continue;const V=x[N],J=b[N];V!==J&&N!=="value"&&o(g,N,J,V,G,q)}"value"in x&&o(g,"value",b.value,x.value,G)}},Y=(g,b,x,q,G,N,V,J,Q)=>{const z=b.el=g?g.el:a(""),_e=b.anchor=g?g.anchor:a("");let{patchFlag:de,dynamicChildren:Se,slotScopeIds:Me}=b;Me&&(J=J?J.concat(Me):Me),g==null?(r(z,x,q),r(_e,x,q),Ie(b.children||[],x,_e,G,N,V,J,Q)):de>0&&de&64&&Se&&g.dynamicChildren&&g.dynamicChildren.length===Se.length?(le(g.dynamicChildren,Se,x,G,N,V,J),(b.key!=null||G&&b===G.subTree)&&vl(g,b,!0)):Ee(g,b,x,_e,G,N,V,J,Q)},Te=(g,b,x,q,G,N,V,J,Q)=>{b.slotScopeIds=J,g==null?b.shapeFlag&512?G.ctx.activate(b,x,q,V,Q):xe(b,x,q,G,N,V,Q):Le(g,b,Q)},xe=(g,b,x,q,G,N,V)=>{const J=g.component=vm(g,q,G);if(mi(g)&&(J.ctx.renderer=be),ym(J,!1,V),J.asyncDep){if(G&&G.registerDep(J,Pe,V),!g.el){const Q=J.subTree=Re(nn);R(null,Q,b,x),g.placeholder=Q.el}}else Pe(J,g,b,x,G,N,V)},Le=(g,b,x)=>{const q=b.component=g.component;if(Zp(g,b,x))if(q.asyncDep&&!q.asyncResolved){Oe(q,b,x);return}else q.next=b,q.update();else b.el=g.el,q.vnode=b},Pe=(g,b,x,q,G,N,V)=>{const J=()=>{if(g.isMounted){let{next:de,bu:Se,u:Me,parent:De,vnode:Fe}=g;{const yt=rf(g);if(yt){de&&(de.el=Fe.el,Oe(g,de,V)),yt.asyncDep.then(()=>{en(()=>{g.isUnmounted||z()},G)});return}}let He=de,ot;Dr(g,!1),de?(de.el=Fe.el,Oe(g,de,V)):de=Fe,Se&&No(Se),(ot=de.props&&de.props.onVnodeBeforeUpdate)&&Ln(ot,De,de,Fe),Dr(g,!0);const tt=sc(g),vt=g.subTree;g.subTree=tt,P(vt,tt,f(vt.el),K(vt),g,G,N),de.el=tt.el,He===null&&em(g,tt.el),Me&&en(Me,G),(ot=de.props&&de.props.onVnodeUpdated)&&en(()=>Ln(ot,De,de,Fe),G)}else{let de;const{el:Se,props:Me}=b,{bm:De,m:Fe,parent:He,root:ot,type:tt}=g,vt=fs(b);Dr(g,!1),De&&No(De),!vt&&(de=Me&&Me.onVnodeBeforeMount)&&Ln(de,He,b),Dr(g,!0);{ot.ce&&ot.ce._hasShadowRoot()&&ot.ce._injectChildStyle(tt,g.parent?g.parent.type:void 0);const yt=g.subTree=sc(g);P(null,yt,x,q,g,G,N),b.el=yt.el}if(Fe&&en(Fe,G),!vt&&(de=Me&&Me.onVnodeMounted)){const yt=b;en(()=>Ln(de,He,yt),G)}(b.shapeFlag&256||He&&fs(He.vnode)&&He.vnode.shapeFlag&256)&&g.a&&en(g.a,G),g.isMounted=!0,b=x=q=null}};g.scope.on();const Q=g.effect=new ld(J);g.scope.off();const z=g.update=Q.run.bind(Q),_e=g.job=Q.runIfDirty.bind(Q);_e.i=g,_e.id=g.uid,Q.scheduler=()=>pl(_e),Dr(g,!0),z()},Oe=(g,b,x)=>{b.component=g;const q=g.vnode.props;g.vnode=b,g.next=null,nm(g,b.props,q,x),im(g,b.children,x),ir(),zl(g),ar()},Ee=(g,b,x,q,G,N,V,J,Q=!1)=>{const z=g&&g.children,_e=g?g.shapeFlag:0,de=b.children,{patchFlag:Se,shapeFlag:Me}=b;if(Se>0){if(Se&128){Ze(z,de,x,q,G,N,V,J,Q);return}else if(Se&256){Ye(z,de,x,q,G,N,V,J,Q);return}}Me&8?(_e&16&&Xe(z,G,N),de!==z&&c(x,de)):_e&16?Me&16?Ze(z,de,x,q,G,N,V,J,Q):Xe(z,G,N,!0):(_e&8&&c(x,""),Me&16&&Ie(de,x,q,G,N,V,J,Q))},Ye=(g,b,x,q,G,N,V,J,Q)=>{g=g||cs,b=b||cs;const z=g.length,_e=b.length,de=Math.min(z,_e);let Se;for(Se=0;Se<de;Se++){const Me=b[Se]=Q?er(b[Se]):Bn(b[Se]);P(g[Se],Me,x,null,G,N,V,J,Q)}z>_e?Xe(g,G,N,!0,!1,de):Ie(b,x,q,G,N,V,J,Q,de)},Ze=(g,b,x,q,G,N,V,J,Q)=>{let z=0;const _e=b.length;let de=g.length-1,Se=_e-1;for(;z<=de&&z<=Se;){const Me=g[z],De=b[z]=Q?er(b[z]):Bn(b[z]);if(Hr(Me,De))P(Me,De,x,null,G,N,V,J,Q);else break;z++}for(;z<=de&&z<=Se;){const Me=g[de],De=b[Se]=Q?er(b[Se]):Bn(b[Se]);if(Hr(Me,De))P(Me,De,x,null,G,N,V,J,Q);else break;de--,Se--}if(z>de){if(z<=Se){const Me=Se+1,De=Me<_e?b[Me].el:q;for(;z<=Se;)P(null,b[z]=Q?er(b[z]):Bn(b[z]),x,De,G,N,V,J,Q),z++}}else if(z>Se)for(;z<=de;)nt(g[z],G,N,!0),z++;else{const Me=z,De=z,Fe=new Map;for(z=De;z<=Se;z++){const kt=b[z]=Q?er(b[z]):Bn(b[z]);kt.key!=null&&Fe.set(kt.key,z)}let He,ot=0;const tt=Se-De+1;let vt=!1,yt=0;const jt=new Array(tt);for(z=0;z<tt;z++)jt[z]=0;for(z=Me;z<=de;z++){const kt=g[z];if(ot>=tt){nt(kt,G,N,!0);continue}let Rt;if(kt.key!=null)Rt=Fe.get(kt.key);else for(He=De;He<=Se;He++)if(jt[He-De]===0&&Hr(kt,b[He])){Rt=He;break}Rt===void 0?nt(kt,G,N,!0):(jt[Rt-De]=z+1,Rt>=yt?yt=Rt:vt=!0,P(kt,b[Rt],x,null,G,N,V,J,Q),ot++)}const zt=vt?um(jt):cs;for(He=zt.length-1,z=tt-1;z>=0;z--){const kt=De+z,Rt=b[kt],wt=b[kt+1],Dt=kt+1<_e?wt.el||sf(wt):q;jt[z]===0?P(null,Rt,x,Dt,G,N,V,J,Q):vt&&(He<0||z!==zt[He]?Ne(Rt,x,Dt,2):He--)}}},Ne=(g,b,x,q,G=null)=>{const{el:N,type:V,transition:J,children:Q,shapeFlag:z}=g;if(z&6){Ne(g.component.subTree,b,x,q);return}if(z&128){g.suspense.move(b,x,q);return}if(z&64){V.move(g,b,x,be);return}if(V===Be){r(N,b,x);for(let de=0;de<Q.length;de++)Ne(Q[de],b,x,q);r(g.anchor,b,x);return}if(V===Ji){B(g,b,x);return}if(q!==2&&z&1&&J)if(q===0)J.beforeEnter(N),r(N,b,x),en(()=>J.enter(N),G);else{const{leave:de,delayLeave:Se,afterLeave:Me}=J,De=()=>{g.ctx.isUnmounted?s(N):r(N,b,x)},Fe=()=>{N._isLeaving&&N[Un](!0),de(N,()=>{De(),Me&&Me()})};Se?Se(N,De,Fe):Fe()}else r(N,b,x)},nt=(g,b,x,q=!1,G=!1)=>{const{type:N,props:V,ref:J,children:Q,dynamicChildren:z,shapeFlag:_e,patchFlag:de,dirs:Se,cacheIndex:Me}=g;if(de===-2&&(G=!1),J!=null&&(ir(),Vs(J,null,x,g,!0),ar()),Me!=null&&(b.renderCache[Me]=void 0),_e&256){b.ctx.deactivate(g);return}const De=_e&1&&Se,Fe=!fs(g);let He;if(Fe&&(He=V&&V.onVnodeBeforeUnmount)&&Ln(He,b,g),_e&6)et(g.component,x,q);else{if(_e&128){g.suspense.unmount(x,q);return}De&&Nr(g,null,b,"beforeUnmount"),_e&64?g.type.remove(g,b,x,be,q):z&&!z.hasOnce&&(N!==Be||de>0&&de&64)?Xe(z,b,x,!1,!0):(N===Be&&de&384||!G&&_e&16)&&Xe(Q,b,x),q&&gt(g)}(Fe&&(He=V&&V.onVnodeUnmounted)||De)&&en(()=>{He&&Ln(He,b,g),De&&Nr(g,null,b,"unmounted")},x)},gt=g=>{const{type:b,el:x,anchor:q,transition:G}=g;if(b===Be){at(x,q);return}if(b===Ji){W(g);return}const N=()=>{s(x),G&&!G.persisted&&G.afterLeave&&G.afterLeave()};if(g.shapeFlag&1&&G&&!G.persisted){const{leave:V,delayLeave:J}=G,Q=()=>V(x,N);J?J(g.el,N,Q):Q()}else N()},at=(g,b)=>{let x;for(;g!==b;)x=m(g),s(g),g=x;s(b)},et=(g,b,x)=>{const{bum:q,scope:G,job:N,subTree:V,um:J,m:Q,a:z}=g;ac(Q),ac(z),q&&No(q),G.stop(),N&&(N.flags|=8,nt(V,g,b,x)),J&&en(J,b),en(()=>{g.isUnmounted=!0},b)},Xe=(g,b,x,q=!1,G=!1,N=0)=>{for(let V=N;V<g.length;V++)nt(g[V],b,x,q,G)},K=g=>{if(g.shapeFlag&6)return K(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const b=m(g.anchor||g.el),x=b&&b[Md];return x?m(x):b};let he=!1;const ue=(g,b,x)=>{let q;g==null?b._vnode&&(nt(b._vnode,null,null,!0),q=b._vnode.component):P(b._vnode||null,g,b,null,null,null,x),b._vnode=g,he||(he=!0,zl(q),Cd(),he=!1)},be={p:P,um:nt,m:Ne,r:gt,mt:xe,mc:Ie,pc:Ee,pbc:le,n:K,o:e};return{render:ue,hydrate:void 0,createApp:qp(ue)}}function Ki({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 Dr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function cm(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function vl(e,t,n=!1){const r=e.children,s=t.children;if(We(r)&&We(s))for(let o=0;o<r.length;o++){const i=r[o];let a=s[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=s[o]=er(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&vl(i,a)),a.type===wi&&(a.patchFlag===-1&&(a=s[o]=er(a)),a.el=i.el),a.type===nn&&!a.el&&(a.el=i.el)}}function um(e){const t=e.slice(),n=[0];let r,s,o,i,a;const l=e.length;for(r=0;r<l;r++){const u=e[r];if(u!==0){if(s=n[n.length-1],e[s]<u){t[r]=s,n.push(r);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,e[n[a]]<u?o=a+1:i=a;u<e[n[o]]&&(o>0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function rf(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:rf(t)}function ac(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function sf(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?sf(t.subTree):null}const of=e=>e.__isSuspense;function dm(e,t){t&&t.pendingBranch?We(e)?t.effects.push(...e):t.effects.push(e):yp(e)}const Be=Symbol.for("v-fgt"),wi=Symbol.for("v-txt"),nn=Symbol.for("v-cmt"),Ji=Symbol.for("v-stc"),zs=[];let vn=null;function w(e=!1){zs.push(vn=e?null:[])}function fm(){zs.pop(),vn=zs[zs.length-1]||null}let eo=1;function Qo(e,t=!1){eo+=e,e<0&&vn&&t&&(vn.hasOnce=!0)}function af(e){return e.dynamicChildren=eo>0?vn||cs:null,fm(),eo>0&&vn&&vn.push(e),e}function T(e,t,n,r,s,o){return af(p(e,t,n,r,s,o,!0))}function ft(e,t,n,r,s){return af(Re(e,t,n,r,s,!0))}function to(e){return e?e.__v_isVNode===!0:!1}function Hr(e,t){return e.type===t.type&&e.key===t.key}const lf=({key:e})=>e??null,jo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Mt(e)||sn(e)||Je(e)?{i:Xt,r:e,k:t,f:!!n}:e:null);function p(e,t=null,n=null,r=0,s=null,o=e===Be?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&lf(t),ref:t&&jo(t),scopeId:Rd,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Xt};return a?(yl(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=Mt(n)?8:16),eo>0&&!i&&vn&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&vn.push(l),l}const Re=hm;function hm(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===Hd)&&(e=nn),to(e)){const a=Mr(e,t,!0);return n&&yl(a,n),eo>0&&!o&&vn&&(a.shapeFlag&6?vn[vn.indexOf(e)]=a:vn.push(a)),a.patchFlag=-2,a}if(km(e)&&(e=e.__vccOpts),t){t=pm(t);let{class:a,style:l}=t;a&&!Mt(a)&&(t.class=it(a)),mt(l)&&(hl(l)&&!We(l)&&(l=Bt({},l)),t.style=Jr(l))}const i=Mt(e)?1:of(e)?128:$d(e)?64:mt(e)?4:Je(e)?2:0;return p(e,t,n,r,s,i,o,!0)}function pm(e){return e?hl(e)||Xd(e)?Bt({},e):e:null}function Mr(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,u=t?cf(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&lf(u),ref:t&&t.ref?n&&o?We(o)?o.concat(jo(t)):[o,jo(t)]:jo(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Be?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Mr(e.ssContent),ssFallback:e.ssFallback&&Mr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Zs(c,l.clone(c)),c}function no(e=" ",t=0){return Re(wi,null,e,t)}function ae(e="",t=!1){return t?(w(),ft(nn,null,e)):Re(nn,null,e)}function Bn(e){return e==null||typeof e=="boolean"?Re(nn):We(e)?Re(Be,null,e.slice()):to(e)?er(e):Re(wi,null,String(e))}function er(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Mr(e)}function yl(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(We(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),yl(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!Xd(t)?t._ctx=Xt:s===3&&Xt&&(Xt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Je(t)?(t={default:t,_ctx:Xt},n=32):(t=String(t),r&64?(n=16,t=[no(t)]):n=8);e.children=t,e.shapeFlag|=n}function cf(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const s in r)if(s==="class")t.class!==r.class&&(t.class=it([t.class,r.class]));else if(s==="style")t.style=Jr([t.style,r.style]);else if(li(s)){const o=t[s],i=r[s];i&&o!==i&&!(We(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function Ln(e,t,n,r=null){$n(e,t,7,[n,r])}const mm=zd();let gm=0;function vm(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||mm,o={uid:gm++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Hh(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Zd(r,s),emitsOptions:qd(r,s),emit:null,emitted:null,propsDefaults:Ct,inheritAttrs:r.inheritAttrs,ctx:Ct,data:Ct,props:Ct,attrs:Ct,slots:Ct,refs:Ct,setupState:Ct,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=Jp.bind(null,o),e.ce&&e.ce(o),o}let rn=null;const wl=()=>rn||Xt;let Zo,Oa;{const e=di(),t=(n,r)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(r),o=>{s.length>1?s.forEach(i=>i(o)):s[0](o)}};Zo=t("__VUE_INSTANCE_SETTERS__",n=>rn=n),Oa=t("__VUE_SSR_SETTERS__",n=>ro=n)}const ho=e=>{const t=rn;return Zo(e),e.scope.on(),()=>{e.scope.off(),Zo(t)}},lc=()=>{rn&&rn.scope.off(),Zo(null)};function uf(e){return e.vnode.shapeFlag&4}let ro=!1;function ym(e,t=!1,n=!1){t&&Oa(t);const{props:r,children:s}=e.vnode,o=uf(e);tm(e,r,o,t),om(e,s,n||t);const i=o?wm(e,t):void 0;return t&&Oa(!1),i}function wm(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,jp);const{setup:r}=n;if(r){ir();const s=e.setupContext=r.length>1?ff(e):null,o=ho(e),i=fo(r,e,0,[e.props,s]),a=td(i);if(ar(),o(),(a||e.sp)&&!fs(e)&&Fd(e),a){if(i.then(lc,lc),t)return i.then(l=>{cc(e,l)}).catch(l=>{pi(l,e,0)});e.asyncDep=i}else cc(e,i)}else df(e)}function cc(e,t,n){Je(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:mt(t)&&(e.setupState=Sd(t)),df(e)}function df(e,t,n){const r=e.type;e.render||(e.render=r.render||zn);{const s=ho(e);ir();try{Bp(e)}finally{ar(),s()}}}const bm={get(e,t){return tn(e,"get",""),e[t]}};function ff(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,bm),slots:e.slots,emit:e.emit,expose:t}}function bi(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Sd(lp(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Gs)return Gs[n](e)},has(t,n){return n in t||n in Gs}})):e.proxy}function _m(e,t=!0){return Je(e)?e.displayName||e.name:e.name||t&&e.__name}function km(e){return Je(e)&&"__vccOpts"in e}const fe=(e,t)=>hp(e,t,ro);function bl(e,t,n){try{Qo(-1);const r=arguments.length;return r===2?mt(t)&&!We(t)?to(t)?Re(e,null,[t]):Re(e,t):Re(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&to(n)&&(n=[n]),Re(e,t,n))}finally{Qo(1)}}const Tm="3.5.30";/**
13
+ **/function fo(e,t,n,r){try{return r?e(...r):e()}catch(s){pi(s,t,n)}}function $n(e,t,n,r){if(Je(e)){const s=fo(e,t,n,r);return s&&td(s)&&s.catch(o=>{pi(o,t,n)}),s}if(We(e)){const s=[];for(let o=0;o<e.length;o++)s.push($n(e[o],t,n,r));return s}}function pi(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||Ct;if(t){let a=t.parent;const l=t.proxy,u=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const c=a.ec;if(c){for(let f=0;f<c.length;f++)if(c[f](e,l,u)===!1)return}a=a.parent}if(o){ir(),fo(o,null,10,[e,l,u]),ar();return}}gp(e,n,s,r,i)}function gp(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const un=[];let jn=-1;const ds=[];let Sr=null,is=0;const Id=Promise.resolve();let zo=null;function Yt(e){const t=zo||Id;return e?t.then(this?e.bind(this):e):t}function vp(e){let t=jn+1,n=un.length;for(;t<n;){const r=t+n>>>1,s=un[r],o=Qs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function pl(e){if(!(e.flags&1)){const t=Qs(e),n=un[un.length-1];!n||!(e.flags&2)&&t>=Qs(n)?un.push(e):un.splice(vp(t),0,e),e.flags|=1,Ed()}}function Ed(){zo||(zo=Id.then(Ad))}function yp(e){We(e)?ds.push(...e):Sr&&e.id===-1?Sr.splice(is+1,0,e):e.flags&1||(ds.push(e),e.flags|=1),Ed()}function zl(e,t,n=jn+1){for(;n<un.length;n++){const r=un[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;un.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Cd(e){if(ds.length){const t=[...new Set(ds)].sort((n,r)=>Qs(n)-Qs(r));if(ds.length=0,Sr){Sr.push(...t);return}for(Sr=t,is=0;is<Sr.length;is++){const n=Sr[is];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Sr=null,is=0}}const Qs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ad(e){try{for(jn=0;jn<un.length;jn++){const t=un[jn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),fo(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;jn<un.length;jn++){const t=un[jn];t&&(t.flags&=-2)}jn=-1,un.length=0,Cd(),zo=null,(un.length||ds.length)&&Ad()}}let Xt=null,Rd=null;function qo(e){const t=Xt;return Xt=e,Rd=e&&e.type.__scopeId||null,t}function _t(e,t=Xt,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&Qo(-1);const o=qo(t);let i;try{i=e(...s)}finally{qo(o),r._d&&Qo(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function cr(e,t){if(Xt===null)return e;const n=bi(Xt),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=Ct]=t[s];o&&(Je(o)&&(o={mounted:o,updated:o}),o.deep&&nr(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function Nr(e,t,n,r){const s=e.dirs,o=t&&t.dirs;for(let i=0;i<s.length;i++){const a=s[i];o&&(a.oldValue=o[i].value);let l=a.dir[r];l&&(ir(),$n(l,n,8,[e.el,a,e,t]),ar())}}function Do(e,t){if(rn){let n=rn.provides;const r=rn.parent&&rn.parent.provides;r===n&&(n=rn.provides=Object.create(r)),n[e]=t}}function Rn(e,t,n=!1){const r=wl();if(r||hs){let s=hs?hs._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&e in s)return s[e];if(arguments.length>1)return n&&Je(t)?t.call(r&&r.proxy):t}}const wp=Symbol.for("v-scx"),bp=()=>Rn(wp);function ut(e,t,n){return Pd(e,t,n)}function Pd(e,t,n=Ct){const{immediate:r,deep:s,flush:o,once:i}=n,a=Bt({},n),l=t&&r||!t&&o!=="post";let u;if(ro){if(o==="sync"){const T=bp();u=T.__watcherHandles||(T.__watcherHandles=[])}else if(!l){const T=()=>{};return T.stop=zn,T.resume=zn,T.pause=zn,T}}const c=rn;a.call=(T,U,P)=>$n(T,c,U,P);let f=!1;o==="post"?a.scheduler=T=>{en(T,c&&c.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(T,U)=>{U?T():pl(T)}),a.augmentJob=T=>{t&&(T.flags|=4),f&&(T.flags|=2,c&&(T.id=c.uid,T.i=c))};const m=mp(e,t,a);return ro&&(u?u.push(m):l&&m()),m}function _p(e,t,n){const r=this.proxy,s=Mt(e)?e.includes(".")?xd(r,e):()=>r[e]:e.bind(r,r);let o;Je(t)?o=t:(o=t.handler,n=t);const i=ho(this),a=Pd(s,o.bind(r),n);return i(),a}function xd(e,t){const n=t.split(".");return()=>{let r=e;for(let s=0;s<n.length&&r;s++)r=r[n[s]];return r}}const Md=Symbol("_vte"),$d=e=>e.__isTeleport,Ws=e=>e&&(e.disabled||e.disabled===""),ql=e=>e&&(e.defer||e.defer===""),Kl=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Jl=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ca=(e,t)=>{const n=e&&e.to;return Mt(n)?t?t(n):null:n},Od={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,u){const{mc:c,pc:f,pbc:m,o:{insert:T,querySelector:U,createText:P,createComment:F}}=u,R=Ws(t.props);let{shapeFlag:A,children:B,dynamicChildren:W}=t;if(e==null){const ce=t.el=P(""),me=t.anchor=P("");T(ce,n,r),T(me,n,r);const ve=(re,le)=>{A&16&&c(B,re,le,s,o,i,a,l)},Ie=()=>{const re=t.target=Ca(t.props,U),le=Aa(re,t,P,T);re&&(i!=="svg"&&Kl(re)?i="svg":i!=="mathml"&&Jl(re)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(re),R||(ve(re,le),Lo(t,!1)))};R&&(ve(n,me),Lo(t,!0)),ql(t.props)?(t.el.__isMounted=!1,en(()=>{Ie(),delete t.el.__isMounted},o)):Ie()}else{if(ql(t.props)&&e.el.__isMounted===!1){en(()=>{Od.process(e,t,n,r,s,o,i,a,l,u)},o);return}t.el=e.el,t.targetStart=e.targetStart;const ce=t.anchor=e.anchor,me=t.target=e.target,ve=t.targetAnchor=e.targetAnchor,Ie=Ws(e.props),re=Ie?n:me,le=Ie?ce:ve;if(i==="svg"||Kl(me)?i="svg":(i==="mathml"||Jl(me))&&(i="mathml"),W?(m(e.dynamicChildren,W,re,s,o,i,a),vl(e,t,!0)):l||f(e,t,re,le,s,o,i,a,!1),R)Ie?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Ro(t,n,ce,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const we=t.target=Ca(t.props,U);we&&Ro(t,we,null,u,0)}else Ie&&Ro(t,me,ve,u,1);Lo(t,R)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:u,targetAnchor:c,target:f,props:m}=e;if(f&&(s(u),s(c)),o&&s(l),i&16){const T=o||!Ws(m);for(let U=0;U<a.length;U++){const P=a[U];r(P,t,n,T,!!P.dynamicChildren)}}},move:Ro,hydrate:kp};function Ro(e,t,n,{o:{insert:r},m:s},o=2){o===0&&r(e.targetAnchor,t,n);const{el:i,anchor:a,shapeFlag:l,children:u,props:c}=e,f=o===2;if(f&&r(i,t,n),(!f||Ws(c))&&l&16)for(let m=0;m<u.length;m++)s(u[m],t,n,2);f&&r(a,t,n)}function kp(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:u,createText:c}},f){function m(F,R){let A=R;for(;A;){if(A&&A.nodeType===8){if(A.data==="teleport start anchor")t.targetStart=A;else if(A.data==="teleport anchor"){t.targetAnchor=A,F._lpa=t.targetAnchor&&i(t.targetAnchor);break}}A=i(A)}}function T(F,R){R.anchor=f(i(F),R,a(F),n,r,s,o)}const U=t.target=Ca(t.props,l),P=Ws(t.props);if(U){const F=U._lpa||U.firstChild;t.shapeFlag&16&&(P?(T(e,t),m(U,F),t.targetAnchor||Aa(U,t,c,u,a(e)===U?e:null)):(t.anchor=i(e),m(U,F),t.targetAnchor||Aa(U,t,c,u),f(F&&i(F),t,U,n,r,s,o))),Lo(t,P)}else P&&t.shapeFlag&16&&(T(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Ko=Od;function Lo(e,t){const n=e.ctx;if(n&&n.ut){let r,s;for(t?(r=e.el,s=e.anchor):(r=e.targetStart,s=e.targetAnchor);r&&r!==s;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function Aa(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Md]=i,e&&(r(o,e,s),r(i,e,s)),i}const Un=Symbol("_leaveCb"),Os=Symbol("_enterCb");function Tp(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return pr(()=>{e.isMounted=!0}),mr(()=>{e.isUnmounting=!0}),e}const Tn=[Function,Array],Nd={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Tn,onEnter:Tn,onAfterEnter:Tn,onEnterCancelled:Tn,onBeforeLeave:Tn,onLeave:Tn,onAfterLeave:Tn,onLeaveCancelled:Tn,onBeforeAppear:Tn,onAppear:Tn,onAfterAppear:Tn,onAppearCancelled:Tn},Dd=e=>{const t=e.subTree;return t.component?Dd(t.component):t},Sp={name:"BaseTransition",props:Nd,setup(e,{slots:t}){const n=wl(),r=Tp();return()=>{const s=t.default&&Ud(t.default(),!0);if(!s||!s.length)return;const o=Ld(s),i=dt(e),{mode:a}=i;if(r.isLeaving)return zi(o);const l=Yl(o);if(!l)return zi(o);let u=Ra(l,i,r,n,f=>u=f);l.type!==nn&&Zs(l,u);let c=n.subTree&&Yl(n.subTree);if(c&&c.type!==nn&&!Hr(c,l)&&Dd(n).type!==nn){let f=Ra(c,i,r,n);if(Zs(c,f),a==="out-in"&&l.type!==nn)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,c=void 0},zi(o);a==="in-out"&&l.type!==nn?f.delayLeave=(m,T,U)=>{const P=jd(r,c);P[String(c.key)]=c,m[Un]=()=>{T(),m[Un]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{U(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function Ld(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==nn){t=n;break}}return t}const Ip=Sp;function jd(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 Ra(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:m,onLeave:T,onAfterLeave:U,onLeaveCancelled:P,onBeforeAppear:F,onAppear:R,onAfterAppear:A,onAppearCancelled:B}=t,W=String(e.key),ce=jd(n,e),me=(re,le)=>{re&&$n(re,r,9,le)},ve=(re,le)=>{const we=le[1];me(re,le),We(re)?re.every(Y=>Y.length<=1)&&we():re.length<=1&&we()},Ie={mode:i,persisted:a,beforeEnter(re){let le=l;if(!n.isMounted)if(o)le=F||l;else return;re[Un]&&re[Un](!0);const we=ce[W];we&&Hr(e,we)&&we.el[Un]&&we.el[Un](),me(le,[re])},enter(re){if(ce[W]===e)return;let le=u,we=c,Y=f;if(!n.isMounted)if(o)le=R||u,we=A||c,Y=B||f;else return;let Te=!1;re[Os]=Le=>{Te||(Te=!0,Le?me(Y,[re]):me(we,[re]),Ie.delayedLeave&&Ie.delayedLeave(),re[Os]=void 0)};const xe=re[Os].bind(null,!1);le?ve(le,[re,xe]):xe()},leave(re,le){const we=String(e.key);if(re[Os]&&re[Os](!0),n.isUnmounting)return le();me(m,[re]);let Y=!1;re[Un]=xe=>{Y||(Y=!0,le(),xe?me(P,[re]):me(U,[re]),re[Un]=void 0,ce[we]===e&&delete ce[we])};const Te=re[Un].bind(null,!1);ce[we]=e,T?ve(T,[re,Te]):Te()},clone(re){const le=Ra(re,t,n,r,s);return s&&s(le),le}};return Ie}function zi(e){if(mi(e))return e=Mr(e),e.children=null,e}function Yl(e){if(!mi(e))return $d(e.type)&&e.children?Ld(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&&Je(n.default))return n.default()}}function Zs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Zs(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 Ud(e,t=!1,n){let r=[],s=0;for(let o=0;o<e.length;o++){let i=e[o];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:o);i.type===Fe?(i.patchFlag&128&&s++,r=r.concat(Ud(i.children,t,a))):(t||i.type!==nn)&&r.push(a!=null?Mr(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function Ht(e,t){return Je(e)?Bt({name:e.name},t,{setup:e}):e}function Fd(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Xl(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Jo=new WeakMap;function Vs(e,t,n,r,s=!1){if(We(e)){e.forEach((P,F)=>Vs(P,t&&(We(t)?t[F]:t),n,r,s));return}if(fs(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Vs(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?bi(r.component):r.el,i=s?null:o,{i:a,r:l}=e,u=t&&t.r,c=a.refs===Ct?a.refs={}:a.refs,f=a.setupState,m=dt(f),T=f===Ct?Zu:P=>Xl(c,P)?!1:pt(m,P),U=(P,F)=>!(F&&Xl(c,F));if(u!=null&&u!==l){if(Ql(t),Mt(u))c[u]=null,T(u)&&(f[u]=null);else if(sn(u)){const P=t;U(u,P.k)&&(u.value=null),P.k&&(c[P.k]=null)}}if(Je(l))fo(l,a,12,[i,c]);else{const P=Mt(l),F=sn(l);if(P||F){const R=()=>{if(e.f){const A=P?T(l)?f[l]:c[l]:U()||!e.k?l.value:c[e.k];if(s)We(A)&&rl(A,o);else if(We(A))A.includes(o)||A.push(o);else if(P)c[l]=[o],T(l)&&(f[l]=c[l]);else{const B=[o];U(l,e.k)&&(l.value=B),e.k&&(c[e.k]=B)}}else P?(c[l]=i,T(l)&&(f[l]=i)):F&&(U(l,e.k)&&(l.value=i),e.k&&(c[e.k]=i))};if(i){const A=()=>{R(),Jo.delete(e)};A.id=-1,Jo.set(e,A),en(A,n)}else Ql(e),R()}}}function Ql(e){const t=Jo.get(e);t&&(t.flags|=8,Jo.delete(e))}di().requestIdleCallback;di().cancelIdleCallback;const fs=e=>!!e.type.__asyncLoader,mi=e=>e.type.__isKeepAlive;function Ep(e,t){Bd(e,"a",t)}function Cp(e,t){Bd(e,"da",t)}function Bd(e,t,n=rn){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(gi(t,r,n),n){let s=n.parent;for(;s&&s.parent;)mi(s.parent.vnode)&&Ap(r,t,n,s),s=s.parent}}function Ap(e,t,n,r){const s=gi(t,e,r,!0);vi(()=>{rl(r[t],s)},n)}function gi(e,t,n=rn,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{ir();const a=ho(n),l=$n(t,n,e,i);return a(),ar(),l});return r?s.unshift(o):s.push(o),o}}const hr=e=>(t,n=rn)=>{(!ro||e==="sp")&&gi(e,(...r)=>t(...r),n)},Rp=hr("bm"),pr=hr("m"),Pp=hr("bu"),xp=hr("u"),mr=hr("bum"),vi=hr("um"),Mp=hr("sp"),$p=hr("rtg"),Op=hr("rtc");function Np(e,t=rn){gi("ec",e,t)}const Dp="components",Hd=Symbol.for("v-ndc");function Yo(e){return Mt(e)?Lp(Dp,e,!1)||e:e||Hd}function Lp(e,t,n=!0,r=!1){const s=Xt||rn;if(s){const o=s.type;{const a=_m(o,!1);if(a&&(a===t||a===fn(t)||a===ui(fn(t))))return o}const i=Zl(s[e]||o[e],t)||Zl(s.appContext[e],t);return!i&&r?o:i}}function Zl(e,t){return e&&(e[t]||e[fn(t)]||e[ui(fn(t))])}function St(e,t,n,r){let s;const o=n,i=We(e);if(i||Mt(e)){const a=i&&qr(e);let l=!1,u=!1;a&&(l=!In(e),u=lr(e),e=fi(e)),s=new Array(e.length);for(let c=0,f=e.length;c<f;c++)s[c]=t(l?u?ys(Mn(e[c])):Mn(e[c]):e[c],c,void 0,o)}else if(typeof e=="number"){s=new Array(e);for(let a=0;a<e;a++)s[a]=t(a+1,a,void 0,o)}else if(mt(e))if(e[Symbol.iterator])s=Array.from(e,(a,l)=>t(a,l,void 0,o));else{const a=Object.keys(e);s=new Array(a.length);for(let l=0,u=a.length;l<u;l++){const c=a[l];s[l]=t(e[c],c,l,o)}}else s=[];return s}function Gn(e,t,n={},r,s){if(Xt.ce||Xt.parent&&fs(Xt.parent)&&Xt.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),ft(Fe,null,[Re("slot",n,r)],u?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),w();const i=o&&Wd(o(n)),a=n.key||i&&i.key,l=ft(Fe,{key:(a&&!xn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function Wd(e){return e.some(t=>to(t)?!(t.type===nn||t.type===Fe&&!Wd(t.children)):!0)?e:null}const Pa=e=>e?uf(e)?bi(e):Pa(e.parent):null,Gs=Bt(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=>Pa(e.parent),$root:e=>Pa(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Gd(e),$forceUpdate:e=>e.f||(e.f=()=>{pl(e.update)}),$nextTick:e=>e.n||(e.n=Yt.bind(e.proxy)),$watch:e=>_p.bind(e)}),qi=(e,t)=>e!==Ct&&!e.__isScriptSetup&&pt(e,t),jp={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,props:o,accessCache:i,type:a,appContext:l}=e;if(t[0]!=="$"){const m=i[t];if(m!==void 0)switch(m){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(qi(r,t))return i[t]=1,r[t];if(s!==Ct&&pt(s,t))return i[t]=2,s[t];if(pt(o,t))return i[t]=3,o[t];if(n!==Ct&&pt(n,t))return i[t]=4,n[t];xa&&(i[t]=0)}}const u=Gs[t];let c,f;if(u)return t==="$attrs"&&tn(e.attrs,"get",""),u(e);if((c=a.__cssModules)&&(c=c[t]))return c;if(n!==Ct&&pt(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,pt(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return qi(s,t)?(s[t]=n,!0):r!==Ct&&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:s,props:o,type:i}},a){let l;return!!(n[a]||e!==Ct&&a[0]!=="$"&&pt(e,a)||qi(t,a)||pt(o,a)||pt(r,a)||pt(Gs,a)||pt(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},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 Up(){return Fp().slots}function Fp(e){const t=wl();return t.setupContext||(t.setupContext=ff(t))}function ec(e){return We(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let xa=!0;function Bp(e){const t=Gd(e),n=e.proxy,r=e.ctx;xa=!1,t.beforeCreate&&tc(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:u,created:c,beforeMount:f,mounted:m,beforeUpdate:T,updated:U,activated:P,deactivated:F,beforeDestroy:R,beforeUnmount:A,destroyed:B,unmounted:W,render:ce,renderTracked:me,renderTriggered:ve,errorCaptured:Ie,serverPrefetch:re,expose:le,inheritAttrs:we,components:Y,directives:Te,filters:xe}=t;if(u&&Hp(u,r,null),i)for(const Oe in i){const Ee=i[Oe];Je(Ee)&&(r[Oe]=Ee.bind(n))}if(s){const Oe=s.call(n,n);mt(Oe)&&(e.data=hi(Oe))}if(xa=!0,o)for(const Oe in o){const Ee=o[Oe],Ye=Je(Ee)?Ee.bind(n,n):Je(Ee.get)?Ee.get.bind(n,n):zn,Ze=!Je(Ee)&&Je(Ee.set)?Ee.set.bind(n):zn,Ne=fe({get:Ye,set:Ze});Object.defineProperty(r,Oe,{enumerable:!0,configurable:!0,get:()=>Ne.value,set:nt=>Ne.value=nt})}if(a)for(const Oe in a)Vd(a[Oe],r,n,Oe);if(l){const Oe=Je(l)?l.call(n):l;Reflect.ownKeys(Oe).forEach(Ee=>{Do(Ee,Oe[Ee])})}c&&tc(c,e,"c");function Pe(Oe,Ee){We(Ee)?Ee.forEach(Ye=>Oe(Ye.bind(n))):Ee&&Oe(Ee.bind(n))}if(Pe(Rp,f),Pe(pr,m),Pe(Pp,T),Pe(xp,U),Pe(Ep,P),Pe(Cp,F),Pe(Np,Ie),Pe(Op,me),Pe($p,ve),Pe(mr,A),Pe(vi,W),Pe(Mp,re),We(le))if(le.length){const Oe=e.exposed||(e.exposed={});le.forEach(Ee=>{Object.defineProperty(Oe,Ee,{get:()=>n[Ee],set:Ye=>n[Ee]=Ye,enumerable:!0})})}else e.exposed||(e.exposed={});ce&&e.render===zn&&(e.render=ce),we!=null&&(e.inheritAttrs=we),Y&&(e.components=Y),Te&&(e.directives=Te),re&&Fd(e)}function Hp(e,t,n=zn){We(e)&&(e=Ma(e));for(const r in e){const s=e[r];let o;mt(s)?"default"in s?o=Rn(s.from||r,s.default,!0):o=Rn(s.from||r):o=Rn(s),sn(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function tc(e,t,n){$n(We(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function Vd(e,t,n,r){let s=r.includes(".")?xd(n,r):()=>n[r];if(Mt(e)){const o=t[e];Je(o)&&ut(s,o)}else if(Je(e))ut(s,e.bind(n));else if(mt(e))if(We(e))e.forEach(o=>Vd(o,t,n,r));else{const o=Je(e.handler)?e.handler.bind(n):t[e.handler];Je(o)&&ut(s,o,e)}}function Gd(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,a=o.get(t);let l;return a?l=a:!s.length&&!n&&!r?l=t:(l={},s.length&&s.forEach(u=>Xo(l,u,i,!0)),Xo(l,t,i)),mt(t)&&o.set(t,l),l}function Xo(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Xo(e,o,n,!0),s&&s.forEach(i=>Xo(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=Wp[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const Wp={data:nc,props:rc,emits:rc,methods:Us,computed:Us,beforeCreate:ln,created:ln,beforeMount:ln,mounted:ln,beforeUpdate:ln,updated:ln,beforeDestroy:ln,beforeUnmount:ln,destroyed:ln,unmounted:ln,activated:ln,deactivated:ln,errorCaptured:ln,serverPrefetch:ln,components:Us,directives:Us,watch:Gp,provide:nc,inject:Vp};function nc(e,t){return t?e?function(){return Bt(Je(e)?e.call(this,this):e,Je(t)?t.call(this,this):t)}:t:e}function Vp(e,t){return Us(Ma(e),Ma(t))}function Ma(e){if(We(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function ln(e,t){return e?[...new Set([].concat(e,t))]:t}function Us(e,t){return e?Bt(Object.create(null),e,t):t}function rc(e,t){return e?We(e)&&We(t)?[...new Set([...e,...t])]:Bt(Object.create(null),ec(e),ec(t??{})):t}function Gp(e,t){if(!e)return t;if(!t)return e;const n=Bt(Object.create(null),e);for(const r in t)n[r]=ln(e[r],t[r]);return n}function zd(){return{app:null,config:{isNativeTag:Zu,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 zp=0;function qp(e,t){return function(r,s=null){Je(r)||(r=Bt({},r)),s!=null&&!mt(s)&&(s=null);const o=zd(),i=new WeakSet,a=[];let l=!1;const u=o.app={_uid:zp++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:Tm,get config(){return o.config},set config(c){},use(c,...f){return i.has(c)||(c&&Je(c.install)?(i.add(c),c.install(u,...f)):Je(c)&&(i.add(c),c(u,...f))),u},mixin(c){return o.mixins.includes(c)||o.mixins.push(c),u},component(c,f){return f?(o.components[c]=f,u):o.components[c]},directive(c,f){return f?(o.directives[c]=f,u):o.directives[c]},mount(c,f,m){if(!l){const T=u._ceVNode||Re(r,s);return T.appContext=o,m===!0?m="svg":m===!1&&(m=void 0),e(T,c,m),l=!0,u._container=c,c.__vue_app__=u,bi(T.component)}},onUnmount(c){a.push(c)},unmount(){l&&($n(a,u._instance,16),e(null,u._container),delete u._container.__vue_app__)},provide(c,f){return o.provides[c]=f,u},runWithContext(c){const f=hs;hs=u;try{return c()}finally{hs=f}}};return u}}let hs=null;const Kp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${fn(t)}Modifiers`]||e[`${$r(t)}Modifiers`];function Jp(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||Ct;let s=n;const o=t.startsWith("update:"),i=o&&Kp(r,t.slice(7));i&&(i.trim&&(s=n.map(c=>Mt(c)?c.trim():c)),i.number&&(s=n.map(ol)));let a,l=r[a=Bi(t)]||r[a=Bi(fn(t))];!l&&o&&(l=r[a=Bi($r(t))]),l&&$n(l,e,6,s);const u=r[a+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,$n(u,e,6,s)}}const Yp=new WeakMap;function qd(e,t,n=!1){const r=n?Yp:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!Je(e)){const l=u=>{const c=qd(u,t,!0);c&&(a=!0,Bt(i,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(mt(e)&&r.set(e,null),null):(We(o)?o.forEach(l=>i[l]=null):Bt(i,o),mt(e)&&r.set(e,i),i)}function yi(e,t){return!e||!li(t)?!1:(t=t.slice(2).replace(/Once$/,""),pt(e,t[0].toLowerCase()+t.slice(1))||pt(e,$r(t))||pt(e,t))}function sc(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:u,renderCache:c,props:f,data:m,setupState:T,ctx:U,inheritAttrs:P}=e,F=qo(e);let R,A;try{if(n.shapeFlag&4){const W=s||r,ce=W;R=Bn(u.call(ce,W,c,f,T,m,U)),A=a}else{const W=t;R=Bn(W.length>1?W(f,{attrs:a,slots:i,emit:l}):W(f,null)),A=t.props?a:Xp(a)}}catch(W){zs.length=0,pi(W,e,1),R=Re(nn)}let B=R;if(A&&P!==!1){const W=Object.keys(A),{shapeFlag:ce}=B;W.length&&ce&7&&(o&&W.some(nl)&&(A=Qp(A,o)),B=Mr(B,A,!1,!0))}return n.dirs&&(B=Mr(B,null,!1,!0),B.dirs=B.dirs?B.dirs.concat(n.dirs):n.dirs),n.transition&&Zs(B,n.transition),R=B,qo(F),R}const Xp=e=>{let t;for(const n in e)(n==="class"||n==="style"||li(n))&&((t||(t={}))[n]=e[n]);return t},Qp=(e,t)=>{const n={};for(const r in e)(!nl(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Zp(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:a,patchFlag:l}=t,u=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?oc(r,i,u):!!i;if(l&8){const c=t.dynamicProps;for(let f=0;f<c.length;f++){const m=c[f];if(Kd(i,r,m)&&!yi(u,m))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?oc(r,i,u):!0:!!i;return!1}function oc(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let s=0;s<r.length;s++){const o=r[s];if(Kd(t,e,o)&&!yi(n,o))return!0}return!1}function Kd(e,t,n){const r=e[n],s=t[n];return n==="style"&&mt(r)&&mt(s)?!il(r,s):r!==s}function em({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r===e)(e=t.vnode).el=n,t=t.parent;else break}}const Jd={},Yd=()=>Object.create(Jd),Xd=e=>Object.getPrototypeOf(e)===Jd;function tm(e,t,n,r=!1){const s={},o=Yd();e.propsDefaults=Object.create(null),Qd(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:kd(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function nm(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=dt(s),[l]=e.propsOptions;let u=!1;if((r||i>0)&&!(i&16)){if(i&8){const c=e.vnode.dynamicProps;for(let f=0;f<c.length;f++){let m=c[f];if(yi(e.emitsOptions,m))continue;const T=t[m];if(l)if(pt(o,m))T!==o[m]&&(o[m]=T,u=!0);else{const U=fn(m);s[U]=$a(l,a,U,T,e,!1)}else T!==o[m]&&(o[m]=T,u=!0)}}}else{Qd(e,t,s,o)&&(u=!0);let c;for(const f in a)(!t||!pt(t,f)&&((c=$r(f))===f||!pt(t,c)))&&(l?n&&(n[f]!==void 0||n[c]!==void 0)&&(s[f]=$a(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!pt(t,f))&&(delete o[f],u=!0)}u&&tr(e.attrs,"set","")}function Qd(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(Fs(l))continue;const u=t[l];let c;s&&pt(s,c=fn(l))?!o||!o.includes(c)?n[c]=u:(a||(a={}))[c]=u:yi(e.emitsOptions,l)||(!(l in r)||u!==r[l])&&(r[l]=u,i=!0)}if(o){const l=dt(n),u=a||Ct;for(let c=0;c<o.length;c++){const f=o[c];n[f]=$a(s,l,f,u[f],e,!pt(u,f))}}return i}function $a(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=pt(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&Je(l)){const{propsDefaults:u}=s;if(n in u)r=u[n];else{const c=ho(s);r=u[n]=l.call(null,t),c()}}else r=l;s.ce&&s.ce._setProp(n,r)}i[0]&&(o&&!a?r=!1:i[1]&&(r===""||r===$r(n))&&(r=!0))}return r}const rm=new WeakMap;function Zd(e,t,n=!1){const r=n?rm:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!Je(e)){const c=f=>{l=!0;const[m,T]=Zd(f,t,!0);Bt(i,m),T&&a.push(...T)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!o&&!l)return mt(e)&&r.set(e,cs),cs;if(We(o))for(let c=0;c<o.length;c++){const f=fn(o[c]);ic(f)&&(i[f]=Ct)}else if(o)for(const c in o){const f=fn(c);if(ic(f)){const m=o[c],T=i[f]=We(m)||Je(m)?{type:m}:Bt({},m),U=T.type;let P=!1,F=!0;if(We(U))for(let R=0;R<U.length;++R){const A=U[R],B=Je(A)&&A.name;if(B==="Boolean"){P=!0;break}else B==="String"&&(F=!1)}else P=Je(U)&&U.name==="Boolean";T[0]=P,T[1]=F,(P||pt(T,"default"))&&a.push(f)}}const u=[i,a];return mt(e)&&r.set(e,u),u}function ic(e){return e[0]!=="$"&&!Fs(e)}const ml=e=>e==="_"||e==="_ctx"||e==="$stable",gl=e=>We(e)?e.map(Bn):[Bn(e)],sm=(e,t,n)=>{if(t._n)return t;const r=_t((...s)=>gl(t(...s)),n);return r._c=!1,r},ef=(e,t,n)=>{const r=e._ctx;for(const s in e){if(ml(s))continue;const o=e[s];if(Je(o))t[s]=sm(s,o,r);else if(o!=null){const i=gl(o);t[s]=()=>i}}},tf=(e,t)=>{const n=gl(t);e.slots.default=()=>n},nf=(e,t,n)=>{for(const r in t)(n||!ml(r))&&(e[r]=t[r])},om=(e,t,n)=>{const r=e.slots=Yd();if(e.vnode.shapeFlag&32){const s=t._;s?(nf(r,t,n),n&&sd(r,"_",s,!0)):ef(t,r)}else t&&tf(e,t)},im=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=Ct;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:nf(s,t,n):(o=!t.$stable,ef(t,s)),i=t}else t&&(tf(e,t),i={default:1});if(o)for(const a in s)!ml(a)&&i[a]==null&&delete s[a]},en=dm;function am(e){return lm(e)}function lm(e,t){const n=di();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:u,setElementText:c,parentNode:f,nextSibling:m,setScopeId:T=zn,insertStaticContent:U}=e,P=(g,b,M,q=null,G=null,N=null,V=void 0,J=null,Q=!!b.dynamicChildren)=>{if(g===b)return;g&&!Hr(g,b)&&(q=K(g),nt(g,G,N,!0),g=null),b.patchFlag===-2&&(Q=!1,b.dynamicChildren=null);const{type:z,ref:_e,shapeFlag:de}=b;switch(z){case wi:F(g,b,M,q);break;case nn:R(g,b,M,q);break;case Ji:g==null&&A(b,M,q,V);break;case Fe:Y(g,b,M,q,G,N,V,J,Q);break;default:de&1?ce(g,b,M,q,G,N,V,J,Q):de&6?Te(g,b,M,q,G,N,V,J,Q):(de&64||de&128)&&z.process(g,b,M,q,G,N,V,J,Q,be)}_e!=null&&G?Vs(_e,g&&g.ref,N,b||g,!b):_e==null&&g&&g.ref!=null&&Vs(g.ref,null,N,g,!0)},F=(g,b,M,q)=>{if(g==null)r(b.el=a(b.children),M,q);else{const G=b.el=g.el;b.children!==g.children&&u(G,b.children)}},R=(g,b,M,q)=>{g==null?r(b.el=l(b.children||""),M,q):b.el=g.el},A=(g,b,M,q)=>{[g.el,g.anchor]=U(g.children,b,M,q,g.el,g.anchor)},B=({el:g,anchor:b},M,q)=>{let G;for(;g&&g!==b;)G=m(g),r(g,M,q),g=G;r(b,M,q)},W=({el:g,anchor:b})=>{let M;for(;g&&g!==b;)M=m(g),s(g),g=M;s(b)},ce=(g,b,M,q,G,N,V,J,Q)=>{if(b.type==="svg"?V="svg":b.type==="math"&&(V="mathml"),g==null)me(b,M,q,G,N,V,J,Q);else{const z=g.el&&g.el._isVueCE?g.el:null;try{z&&z._beginPatch(),re(g,b,G,N,V,J,Q)}finally{z&&z._endPatch()}}},me=(g,b,M,q,G,N,V,J)=>{let Q,z;const{props:_e,shapeFlag:de,transition:Se,dirs:Me}=g;if(Q=g.el=i(g.type,N,_e&&_e.is,_e),de&8?c(Q,g.children):de&16&&Ie(g.children,Q,null,q,G,Ki(g,N),V,J),Me&&Nr(g,null,q,"created"),ve(Q,g,g.scopeId,V,q),_e){for(const Be in _e)Be!=="value"&&!Fs(Be)&&o(Q,Be,null,_e[Be],N,q);"value"in _e&&o(Q,"value",null,_e.value,N),(z=_e.onVnodeBeforeMount)&&Ln(z,q,g)}Me&&Nr(g,null,q,"beforeMount");const De=cm(G,Se);De&&Se.beforeEnter(Q),r(Q,b,M),((z=_e&&_e.onVnodeMounted)||De||Me)&&en(()=>{z&&Ln(z,q,g),De&&Se.enter(Q),Me&&Nr(g,null,q,"mounted")},G)},ve=(g,b,M,q,G)=>{if(M&&T(g,M),q)for(let N=0;N<q.length;N++)T(g,q[N]);if(G){let N=G.subTree;if(b===N||of(N.type)&&(N.ssContent===b||N.ssFallback===b)){const V=G.vnode;ve(g,V,V.scopeId,V.slotScopeIds,G.parent)}}},Ie=(g,b,M,q,G,N,V,J,Q=0)=>{for(let z=Q;z<g.length;z++){const _e=g[z]=J?er(g[z]):Bn(g[z]);P(null,_e,b,M,q,G,N,V,J)}},re=(g,b,M,q,G,N,V)=>{const J=b.el=g.el;let{patchFlag:Q,dynamicChildren:z,dirs:_e}=b;Q|=g.patchFlag&16;const de=g.props||Ct,Se=b.props||Ct;let Me;if(M&&Dr(M,!1),(Me=Se.onVnodeBeforeUpdate)&&Ln(Me,M,b,g),_e&&Nr(b,g,M,"beforeUpdate"),M&&Dr(M,!0),(de.innerHTML&&Se.innerHTML==null||de.textContent&&Se.textContent==null)&&c(J,""),z?le(g.dynamicChildren,z,J,M,q,Ki(b,G),N):V||Ee(g,b,J,null,M,q,Ki(b,G),N,!1),Q>0){if(Q&16)we(J,de,Se,M,G);else if(Q&2&&de.class!==Se.class&&o(J,"class",null,Se.class,G),Q&4&&o(J,"style",de.style,Se.style,G),Q&8){const De=b.dynamicProps;for(let Be=0;Be<De.length;Be++){const He=De[Be],ot=de[He],tt=Se[He];(tt!==ot||He==="value")&&o(J,He,ot,tt,G,M)}}Q&1&&g.children!==b.children&&c(J,b.children)}else!V&&z==null&&we(J,de,Se,M,G);((Me=Se.onVnodeUpdated)||_e)&&en(()=>{Me&&Ln(Me,M,b,g),_e&&Nr(b,g,M,"updated")},q)},le=(g,b,M,q,G,N,V)=>{for(let J=0;J<b.length;J++){const Q=g[J],z=b[J],_e=Q.el&&(Q.type===Fe||!Hr(Q,z)||Q.shapeFlag&198)?f(Q.el):M;P(Q,z,_e,null,q,G,N,V,!0)}},we=(g,b,M,q,G)=>{if(b!==M){if(b!==Ct)for(const N in b)!Fs(N)&&!(N in M)&&o(g,N,b[N],null,G,q);for(const N in M){if(Fs(N))continue;const V=M[N],J=b[N];V!==J&&N!=="value"&&o(g,N,J,V,G,q)}"value"in M&&o(g,"value",b.value,M.value,G)}},Y=(g,b,M,q,G,N,V,J,Q)=>{const z=b.el=g?g.el:a(""),_e=b.anchor=g?g.anchor:a("");let{patchFlag:de,dynamicChildren:Se,slotScopeIds:Me}=b;Me&&(J=J?J.concat(Me):Me),g==null?(r(z,M,q),r(_e,M,q),Ie(b.children||[],M,_e,G,N,V,J,Q)):de>0&&de&64&&Se&&g.dynamicChildren&&g.dynamicChildren.length===Se.length?(le(g.dynamicChildren,Se,M,G,N,V,J),(b.key!=null||G&&b===G.subTree)&&vl(g,b,!0)):Ee(g,b,M,_e,G,N,V,J,Q)},Te=(g,b,M,q,G,N,V,J,Q)=>{b.slotScopeIds=J,g==null?b.shapeFlag&512?G.ctx.activate(b,M,q,V,Q):xe(b,M,q,G,N,V,Q):Le(g,b,Q)},xe=(g,b,M,q,G,N,V)=>{const J=g.component=vm(g,q,G);if(mi(g)&&(J.ctx.renderer=be),ym(J,!1,V),J.asyncDep){if(G&&G.registerDep(J,Pe,V),!g.el){const Q=J.subTree=Re(nn);R(null,Q,b,M),g.placeholder=Q.el}}else Pe(J,g,b,M,G,N,V)},Le=(g,b,M)=>{const q=b.component=g.component;if(Zp(g,b,M))if(q.asyncDep&&!q.asyncResolved){Oe(q,b,M);return}else q.next=b,q.update();else b.el=g.el,q.vnode=b},Pe=(g,b,M,q,G,N,V)=>{const J=()=>{if(g.isMounted){let{next:de,bu:Se,u:Me,parent:De,vnode:Be}=g;{const yt=rf(g);if(yt){de&&(de.el=Be.el,Oe(g,de,V)),yt.asyncDep.then(()=>{en(()=>{g.isUnmounted||z()},G)});return}}let He=de,ot;Dr(g,!1),de?(de.el=Be.el,Oe(g,de,V)):de=Be,Se&&No(Se),(ot=de.props&&de.props.onVnodeBeforeUpdate)&&Ln(ot,De,de,Be),Dr(g,!0);const tt=sc(g),vt=g.subTree;g.subTree=tt,P(vt,tt,f(vt.el),K(vt),g,G,N),de.el=tt.el,He===null&&em(g,tt.el),Me&&en(Me,G),(ot=de.props&&de.props.onVnodeUpdated)&&en(()=>Ln(ot,De,de,Be),G)}else{let de;const{el:Se,props:Me}=b,{bm:De,m:Be,parent:He,root:ot,type:tt}=g,vt=fs(b);Dr(g,!1),De&&No(De),!vt&&(de=Me&&Me.onVnodeBeforeMount)&&Ln(de,He,b),Dr(g,!0);{ot.ce&&ot.ce._hasShadowRoot()&&ot.ce._injectChildStyle(tt,g.parent?g.parent.type:void 0);const yt=g.subTree=sc(g);P(null,yt,M,q,g,G,N),b.el=yt.el}if(Be&&en(Be,G),!vt&&(de=Me&&Me.onVnodeMounted)){const yt=b;en(()=>Ln(de,He,yt),G)}(b.shapeFlag&256||He&&fs(He.vnode)&&He.vnode.shapeFlag&256)&&g.a&&en(g.a,G),g.isMounted=!0,b=M=q=null}};g.scope.on();const Q=g.effect=new ld(J);g.scope.off();const z=g.update=Q.run.bind(Q),_e=g.job=Q.runIfDirty.bind(Q);_e.i=g,_e.id=g.uid,Q.scheduler=()=>pl(_e),Dr(g,!0),z()},Oe=(g,b,M)=>{b.component=g;const q=g.vnode.props;g.vnode=b,g.next=null,nm(g,b.props,q,M),im(g,b.children,M),ir(),zl(g),ar()},Ee=(g,b,M,q,G,N,V,J,Q=!1)=>{const z=g&&g.children,_e=g?g.shapeFlag:0,de=b.children,{patchFlag:Se,shapeFlag:Me}=b;if(Se>0){if(Se&128){Ze(z,de,M,q,G,N,V,J,Q);return}else if(Se&256){Ye(z,de,M,q,G,N,V,J,Q);return}}Me&8?(_e&16&&Xe(z,G,N),de!==z&&c(M,de)):_e&16?Me&16?Ze(z,de,M,q,G,N,V,J,Q):Xe(z,G,N,!0):(_e&8&&c(M,""),Me&16&&Ie(de,M,q,G,N,V,J,Q))},Ye=(g,b,M,q,G,N,V,J,Q)=>{g=g||cs,b=b||cs;const z=g.length,_e=b.length,de=Math.min(z,_e);let Se;for(Se=0;Se<de;Se++){const Me=b[Se]=Q?er(b[Se]):Bn(b[Se]);P(g[Se],Me,M,null,G,N,V,J,Q)}z>_e?Xe(g,G,N,!0,!1,de):Ie(b,M,q,G,N,V,J,Q,de)},Ze=(g,b,M,q,G,N,V,J,Q)=>{let z=0;const _e=b.length;let de=g.length-1,Se=_e-1;for(;z<=de&&z<=Se;){const Me=g[z],De=b[z]=Q?er(b[z]):Bn(b[z]);if(Hr(Me,De))P(Me,De,M,null,G,N,V,J,Q);else break;z++}for(;z<=de&&z<=Se;){const Me=g[de],De=b[Se]=Q?er(b[Se]):Bn(b[Se]);if(Hr(Me,De))P(Me,De,M,null,G,N,V,J,Q);else break;de--,Se--}if(z>de){if(z<=Se){const Me=Se+1,De=Me<_e?b[Me].el:q;for(;z<=Se;)P(null,b[z]=Q?er(b[z]):Bn(b[z]),M,De,G,N,V,J,Q),z++}}else if(z>Se)for(;z<=de;)nt(g[z],G,N,!0),z++;else{const Me=z,De=z,Be=new Map;for(z=De;z<=Se;z++){const kt=b[z]=Q?er(b[z]):Bn(b[z]);kt.key!=null&&Be.set(kt.key,z)}let He,ot=0;const tt=Se-De+1;let vt=!1,yt=0;const jt=new Array(tt);for(z=0;z<tt;z++)jt[z]=0;for(z=Me;z<=de;z++){const kt=g[z];if(ot>=tt){nt(kt,G,N,!0);continue}let Rt;if(kt.key!=null)Rt=Be.get(kt.key);else for(He=De;He<=Se;He++)if(jt[He-De]===0&&Hr(kt,b[He])){Rt=He;break}Rt===void 0?nt(kt,G,N,!0):(jt[Rt-De]=z+1,Rt>=yt?yt=Rt:vt=!0,P(kt,b[Rt],M,null,G,N,V,J,Q),ot++)}const zt=vt?um(jt):cs;for(He=zt.length-1,z=tt-1;z>=0;z--){const kt=De+z,Rt=b[kt],wt=b[kt+1],Dt=kt+1<_e?wt.el||sf(wt):q;jt[z]===0?P(null,Rt,M,Dt,G,N,V,J,Q):vt&&(He<0||z!==zt[He]?Ne(Rt,M,Dt,2):He--)}}},Ne=(g,b,M,q,G=null)=>{const{el:N,type:V,transition:J,children:Q,shapeFlag:z}=g;if(z&6){Ne(g.component.subTree,b,M,q);return}if(z&128){g.suspense.move(b,M,q);return}if(z&64){V.move(g,b,M,be);return}if(V===Fe){r(N,b,M);for(let de=0;de<Q.length;de++)Ne(Q[de],b,M,q);r(g.anchor,b,M);return}if(V===Ji){B(g,b,M);return}if(q!==2&&z&1&&J)if(q===0)J.beforeEnter(N),r(N,b,M),en(()=>J.enter(N),G);else{const{leave:de,delayLeave:Se,afterLeave:Me}=J,De=()=>{g.ctx.isUnmounted?s(N):r(N,b,M)},Be=()=>{N._isLeaving&&N[Un](!0),de(N,()=>{De(),Me&&Me()})};Se?Se(N,De,Be):Be()}else r(N,b,M)},nt=(g,b,M,q=!1,G=!1)=>{const{type:N,props:V,ref:J,children:Q,dynamicChildren:z,shapeFlag:_e,patchFlag:de,dirs:Se,cacheIndex:Me}=g;if(de===-2&&(G=!1),J!=null&&(ir(),Vs(J,null,M,g,!0),ar()),Me!=null&&(b.renderCache[Me]=void 0),_e&256){b.ctx.deactivate(g);return}const De=_e&1&&Se,Be=!fs(g);let He;if(Be&&(He=V&&V.onVnodeBeforeUnmount)&&Ln(He,b,g),_e&6)et(g.component,M,q);else{if(_e&128){g.suspense.unmount(M,q);return}De&&Nr(g,null,b,"beforeUnmount"),_e&64?g.type.remove(g,b,M,be,q):z&&!z.hasOnce&&(N!==Fe||de>0&&de&64)?Xe(z,b,M,!1,!0):(N===Fe&&de&384||!G&&_e&16)&&Xe(Q,b,M),q&&gt(g)}(Be&&(He=V&&V.onVnodeUnmounted)||De)&&en(()=>{He&&Ln(He,b,g),De&&Nr(g,null,b,"unmounted")},M)},gt=g=>{const{type:b,el:M,anchor:q,transition:G}=g;if(b===Fe){at(M,q);return}if(b===Ji){W(g);return}const N=()=>{s(M),G&&!G.persisted&&G.afterLeave&&G.afterLeave()};if(g.shapeFlag&1&&G&&!G.persisted){const{leave:V,delayLeave:J}=G,Q=()=>V(M,N);J?J(g.el,N,Q):Q()}else N()},at=(g,b)=>{let M;for(;g!==b;)M=m(g),s(g),g=M;s(b)},et=(g,b,M)=>{const{bum:q,scope:G,job:N,subTree:V,um:J,m:Q,a:z}=g;ac(Q),ac(z),q&&No(q),G.stop(),N&&(N.flags|=8,nt(V,g,b,M)),J&&en(J,b),en(()=>{g.isUnmounted=!0},b)},Xe=(g,b,M,q=!1,G=!1,N=0)=>{for(let V=N;V<g.length;V++)nt(g[V],b,M,q,G)},K=g=>{if(g.shapeFlag&6)return K(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const b=m(g.anchor||g.el),M=b&&b[Md];return M?m(M):b};let he=!1;const ue=(g,b,M)=>{let q;g==null?b._vnode&&(nt(b._vnode,null,null,!0),q=b._vnode.component):P(b._vnode||null,g,b,null,null,null,M),b._vnode=g,he||(he=!0,zl(q),Cd(),he=!1)},be={p:P,um:nt,m:Ne,r:gt,mt:xe,mc:Ie,pc:Ee,pbc:le,n:K,o:e};return{render:ue,hydrate:void 0,createApp:qp(ue)}}function Ki({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 Dr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function cm(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function vl(e,t,n=!1){const r=e.children,s=t.children;if(We(r)&&We(s))for(let o=0;o<r.length;o++){const i=r[o];let a=s[o];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=s[o]=er(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&vl(i,a)),a.type===wi&&(a.patchFlag===-1&&(a=s[o]=er(a)),a.el=i.el),a.type===nn&&!a.el&&(a.el=i.el)}}function um(e){const t=e.slice(),n=[0];let r,s,o,i,a;const l=e.length;for(r=0;r<l;r++){const u=e[r];if(u!==0){if(s=n[n.length-1],e[s]<u){t[r]=s,n.push(r);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,e[n[a]]<u?o=a+1:i=a;u<e[n[o]]&&(o>0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function rf(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:rf(t)}function ac(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function sf(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?sf(t.subTree):null}const of=e=>e.__isSuspense;function dm(e,t){t&&t.pendingBranch?We(e)?t.effects.push(...e):t.effects.push(e):yp(e)}const Fe=Symbol.for("v-fgt"),wi=Symbol.for("v-txt"),nn=Symbol.for("v-cmt"),Ji=Symbol.for("v-stc"),zs=[];let vn=null;function w(e=!1){zs.push(vn=e?null:[])}function fm(){zs.pop(),vn=zs[zs.length-1]||null}let eo=1;function Qo(e,t=!1){eo+=e,e<0&&vn&&t&&(vn.hasOnce=!0)}function af(e){return e.dynamicChildren=eo>0?vn||cs:null,fm(),eo>0&&vn&&vn.push(e),e}function k(e,t,n,r,s,o){return af(p(e,t,n,r,s,o,!0))}function ft(e,t,n,r,s){return af(Re(e,t,n,r,s,!0))}function to(e){return e?e.__v_isVNode===!0:!1}function Hr(e,t){return e.type===t.type&&e.key===t.key}const lf=({key:e})=>e??null,jo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Mt(e)||sn(e)||Je(e)?{i:Xt,r:e,k:t,f:!!n}:e:null);function p(e,t=null,n=null,r=0,s=null,o=e===Fe?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&lf(t),ref:t&&jo(t),scopeId:Rd,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:Xt};return a?(yl(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=Mt(n)?8:16),eo>0&&!i&&vn&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&vn.push(l),l}const Re=hm;function hm(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===Hd)&&(e=nn),to(e)){const a=Mr(e,t,!0);return n&&yl(a,n),eo>0&&!o&&vn&&(a.shapeFlag&6?vn[vn.indexOf(e)]=a:vn.push(a)),a.patchFlag=-2,a}if(km(e)&&(e=e.__vccOpts),t){t=pm(t);let{class:a,style:l}=t;a&&!Mt(a)&&(t.class=it(a)),mt(l)&&(hl(l)&&!We(l)&&(l=Bt({},l)),t.style=Jr(l))}const i=Mt(e)?1:of(e)?128:$d(e)?64:mt(e)?4:Je(e)?2:0;return p(e,t,n,r,s,i,o,!0)}function pm(e){return e?hl(e)||Xd(e)?Bt({},e):e:null}function Mr(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,u=t?cf(s||{},t):s,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&lf(u),ref:t&&t.ref?n&&o?We(o)?o.concat(jo(t)):[o,jo(t)]:jo(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Fe?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Mr(e.ssContent),ssFallback:e.ssFallback&&Mr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Zs(c,l.clone(c)),c}function no(e=" ",t=0){return Re(wi,null,e,t)}function ae(e="",t=!1){return t?(w(),ft(nn,null,e)):Re(nn,null,e)}function Bn(e){return e==null||typeof e=="boolean"?Re(nn):We(e)?Re(Fe,null,e.slice()):to(e)?er(e):Re(wi,null,String(e))}function er(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Mr(e)}function yl(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(We(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),yl(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!Xd(t)?t._ctx=Xt:s===3&&Xt&&(Xt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Je(t)?(t={default:t,_ctx:Xt},n=32):(t=String(t),r&64?(n=16,t=[no(t)]):n=8);e.children=t,e.shapeFlag|=n}function cf(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const s in r)if(s==="class")t.class!==r.class&&(t.class=it([t.class,r.class]));else if(s==="style")t.style=Jr([t.style,r.style]);else if(li(s)){const o=t[s],i=r[s];i&&o!==i&&!(We(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function Ln(e,t,n,r=null){$n(e,t,7,[n,r])}const mm=zd();let gm=0;function vm(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||mm,o={uid:gm++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Hh(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Zd(r,s),emitsOptions:qd(r,s),emit:null,emitted:null,propsDefaults:Ct,inheritAttrs:r.inheritAttrs,ctx:Ct,data:Ct,props:Ct,attrs:Ct,slots:Ct,refs:Ct,setupState:Ct,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=Jp.bind(null,o),e.ce&&e.ce(o),o}let rn=null;const wl=()=>rn||Xt;let Zo,Oa;{const e=di(),t=(n,r)=>{let s;return(s=e[n])||(s=e[n]=[]),s.push(r),o=>{s.length>1?s.forEach(i=>i(o)):s[0](o)}};Zo=t("__VUE_INSTANCE_SETTERS__",n=>rn=n),Oa=t("__VUE_SSR_SETTERS__",n=>ro=n)}const ho=e=>{const t=rn;return Zo(e),e.scope.on(),()=>{e.scope.off(),Zo(t)}},lc=()=>{rn&&rn.scope.off(),Zo(null)};function uf(e){return e.vnode.shapeFlag&4}let ro=!1;function ym(e,t=!1,n=!1){t&&Oa(t);const{props:r,children:s}=e.vnode,o=uf(e);tm(e,r,o,t),om(e,s,n||t);const i=o?wm(e,t):void 0;return t&&Oa(!1),i}function wm(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,jp);const{setup:r}=n;if(r){ir();const s=e.setupContext=r.length>1?ff(e):null,o=ho(e),i=fo(r,e,0,[e.props,s]),a=td(i);if(ar(),o(),(a||e.sp)&&!fs(e)&&Fd(e),a){if(i.then(lc,lc),t)return i.then(l=>{cc(e,l)}).catch(l=>{pi(l,e,0)});e.asyncDep=i}else cc(e,i)}else df(e)}function cc(e,t,n){Je(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:mt(t)&&(e.setupState=Sd(t)),df(e)}function df(e,t,n){const r=e.type;e.render||(e.render=r.render||zn);{const s=ho(e);ir();try{Bp(e)}finally{ar(),s()}}}const bm={get(e,t){return tn(e,"get",""),e[t]}};function ff(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,bm),slots:e.slots,emit:e.emit,expose:t}}function bi(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Sd(lp(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Gs)return Gs[n](e)},has(t,n){return n in t||n in Gs}})):e.proxy}function _m(e,t=!0){return Je(e)?e.displayName||e.name:e.name||t&&e.__name}function km(e){return Je(e)&&"__vccOpts"in e}const fe=(e,t)=>hp(e,t,ro);function bl(e,t,n){try{Qo(-1);const r=arguments.length;return r===2?mt(t)&&!We(t)?to(t)?Re(e,null,[t]):Re(e,t):Re(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&to(n)&&(n=[n]),Re(e,t,n))}finally{Qo(1)}}const Tm="3.5.30";/**
14
14
  * @vue/runtime-dom v3.5.30
15
15
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
16
  * @license MIT
17
- **/let Na;const uc=typeof window<"u"&&window.trustedTypes;if(uc)try{Na=uc.createPolicy("vue",{createHTML:e=>e})}catch{}const hf=Na?e=>Na.createHTML(e):e=>e,Sm="http://www.w3.org/2000/svg",Im="http://www.w3.org/1998/Math/MathML",Zn=typeof document<"u"?document:null,dc=Zn&&Zn.createElement("template"),Em={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?Zn.createElementNS(Sm,e):t==="mathml"?Zn.createElementNS(Im,e):n?Zn.createElement(e,{is:n}):Zn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>Zn.createTextNode(e),createComment:e=>Zn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Zn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,s,o){const i=n?n.previousSibling:t.lastChild;if(s&&(s===o||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===o||!(s=s.nextSibling)););else{dc.innerHTML=hf(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=dc.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},br="transition",Ns="animation",so=Symbol("_vtc"),pf={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},Cm=Bt({},Nd,pf),Am=e=>(e.displayName="Transition",e.props=Cm,e),mf=Am((e,{slots:t})=>bl(Ip,Rm(e),t)),Lr=(e,t=[])=>{We(e)?e.forEach(n=>n(...t)):e&&e(...t)},fc=e=>e?We(e)?e.some(t=>t.length>1):e.length>1:!1;function Rm(e){const t={};for(const Y in e)Y in pf||(t[Y]=e[Y]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=o,appearActiveClass:u=i,appearToClass:c=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:m=`${n}-leave-active`,leaveToClass:k=`${n}-leave-to`}=e,U=Pm(s),P=U&&U[0],F=U&&U[1],{onBeforeEnter:R,onEnter:A,onEnterCancelled:B,onLeave:W,onLeaveCancelled:ce,onBeforeAppear:me=R,onAppear:ve=A,onAppearCancelled:Ie=B}=t,re=(Y,Te,xe,Le)=>{Y._enterCancelled=Le,jr(Y,Te?c:a),jr(Y,Te?u:i),xe&&xe()},le=(Y,Te)=>{Y._isLeaving=!1,jr(Y,f),jr(Y,k),jr(Y,m),Te&&Te()},we=Y=>(Te,xe)=>{const Le=Y?ve:A,Pe=()=>re(Te,Y,xe);Lr(Le,[Te,Pe]),hc(()=>{jr(Te,Y?l:o),Xn(Te,Y?c:a),fc(Le)||pc(Te,r,P,Pe)})};return Bt(t,{onBeforeEnter(Y){Lr(R,[Y]),Xn(Y,o),Xn(Y,i)},onBeforeAppear(Y){Lr(me,[Y]),Xn(Y,l),Xn(Y,u)},onEnter:we(!1),onAppear:we(!0),onLeave(Y,Te){Y._isLeaving=!0;const xe=()=>le(Y,Te);Xn(Y,f),Y._enterCancelled?(Xn(Y,m),vc(Y)):(vc(Y),Xn(Y,m)),hc(()=>{Y._isLeaving&&(jr(Y,f),Xn(Y,k),fc(W)||pc(Y,r,F,xe))}),Lr(W,[Y,xe])},onEnterCancelled(Y){re(Y,!1,void 0,!0),Lr(B,[Y])},onAppearCancelled(Y){re(Y,!0,void 0,!0),Lr(Ie,[Y])},onLeaveCancelled(Y){le(Y),Lr(ce,[Y])}})}function Pm(e){if(e==null)return null;if(mt(e))return[Yi(e.enter),Yi(e.leave)];{const t=Yi(e);return[t,t]}}function Yi(e){return Oh(e)}function Xn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[so]||(e[so]=new Set)).add(t)}function jr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[so];n&&(n.delete(t),n.size||(e[so]=void 0))}function hc(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let xm=0;function pc(e,t,n,r){const s=e._endId=++xm,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=Mm(e,t);if(!i)return r();const u=i+"end";let c=0;const f=()=>{e.removeEventListener(u,m),o()},m=k=>{k.target===e&&++c>=l&&f()};setTimeout(()=>{c<l&&f()},a+1),e.addEventListener(u,m)}function Mm(e,t){const n=window.getComputedStyle(e),r=U=>(n[U]||"").split(", "),s=r(`${br}Delay`),o=r(`${br}Duration`),i=mc(s,o),a=r(`${Ns}Delay`),l=r(`${Ns}Duration`),u=mc(a,l);let c=null,f=0,m=0;t===br?i>0&&(c=br,f=i,m=o.length):t===Ns?u>0&&(c=Ns,f=u,m=l.length):(f=Math.max(i,u),c=f>0?i>u?br:Ns:null,m=c?c===br?o.length:l.length:0);const k=c===br&&/\b(?:transform|all)(?:,|$)/.test(r(`${br}Property`).toString());return{type:c,timeout:f,propCount:m,hasTransform:k}}function mc(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>gc(n)+gc(e[r])))}function gc(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function vc(e){return(e?e.ownerDocument:document).body.offsetHeight}function $m(e,t,n){const r=e[so];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const yc=Symbol("_vod"),Om=Symbol("_vsh"),Nm=Symbol(""),Dm=/(?:^|;)\s*display\s*:/;function Lm(e,t,n){const r=e.style,s=Mt(n);let o=!1;if(n&&!s){if(t)if(Mt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Uo(r,a,"")}else for(const i in t)n[i]==null&&Uo(r,i,"");for(const i in n)i==="display"&&(o=!0),Uo(r,i,n[i])}else if(s){if(t!==n){const i=r[Nm];i&&(n+=";"+i),r.cssText=n,o=Dm.test(n)}}else t&&e.removeAttribute("style");yc in e&&(e[yc]=o?r.display:"",e[Om]&&(r.display="none"))}const wc=/\s*!important$/;function Uo(e,t,n){if(We(n))n.forEach(r=>Uo(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=jm(e,t);wc.test(n)?e.setProperty($r(r),n.replace(wc,""),"important"):e[r]=n}}const bc=["Webkit","Moz","ms"],Xi={};function jm(e,t){const n=Xi[t];if(n)return n;let r=fn(t);if(r!=="filter"&&r in e)return Xi[t]=r;r=ui(r);for(let s=0;s<bc.length;s++){const o=bc[s]+r;if(o in e)return Xi[t]=o}return t}const _c="http://www.w3.org/1999/xlink";function kc(e,t,n,r,s,o=Fh(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(_c,t.slice(6,t.length)):e.setAttributeNS(_c,t,n):n==null||o&&!od(n)?e.removeAttribute(t):e.setAttribute(t,o?"":xn(n)?String(n):n)}function Tc(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?hf(n):n);return}const o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){const a=o==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=od(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(s||t)}function as(e,t,n,r){e.addEventListener(t,n,r)}function Um(e,t,n,r){e.removeEventListener(t,n,r)}const Sc=Symbol("_vei");function Fm(e,t,n,r,s=null){const o=e[Sc]||(e[Sc]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=Bm(t);if(r){const u=o[t]=Vm(r,s);as(e,a,u,l)}else i&&(Um(e,a,i,l),o[t]=void 0)}}const Ic=/(?:Once|Passive|Capture)$/;function Bm(e){let t;if(Ic.test(e)){t={};let r;for(;r=e.match(Ic);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):$r(e.slice(2)),t]}let Qi=0;const Hm=Promise.resolve(),Wm=()=>Qi||(Hm.then(()=>Qi=0),Qi=Date.now());function Vm(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;$n(Gm(r,n.value),t,5,[r])};return n.value=e,n.attached=Wm(),n}function Gm(e,t){if(We(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>s=>!s._stopped&&r&&r(s))}else return t}const Ec=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,zm=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?$m(e,r,i):t==="style"?Lm(e,n,r):li(t)?nl(t)||Fm(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):qm(e,t,r,i))?(Tc(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&kc(e,t,r,i,o,t!=="value")):e._isVueCE&&(Km(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Mt(r)))?Tc(e,fn(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),kc(e,t,r,i))};function qm(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Ec(t)&&Je(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Ec(t)&&Mt(n)?!1:t in e}function Km(e,t){const n=e._def.props;if(!n)return!1;const r=fn(t);return Array.isArray(n)?n.some(s=>fn(s)===r):Object.keys(n).some(s=>fn(s)===r)}const Cc=e=>{const t=e.props["onUpdate:modelValue"]||!1;return We(t)?n=>No(t,n):t};function Jm(e){e.target.composing=!0}function Ac(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Zi=Symbol("_assign");function Rc(e,t,n){return t&&(e=e.trim()),n&&(e=ol(e)),e}const ur={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[Zi]=Cc(s);const o=r||s.props&&s.props.type==="number";as(e,t?"change":"input",i=>{i.target.composing||e[Zi](Rc(e.value,n,o))}),(n||o)&&as(e,"change",()=>{e.value=Rc(e.value,n,o)}),t||(as(e,"compositionstart",Jm),as(e,"compositionend",Ac),as(e,"change",Ac))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[Zi]=Cc(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?ol(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===l)||(e.value=l))}},Ym=["ctrl","shift","alt","meta"],Xm={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Ym.some(n=>e[`${n}Key`]&&!t.includes(n))},ct=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...o)=>{for(let i=0;i<t.length;i++){const a=Xm[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},Qm={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},dn=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=$r(s.key);if(t.some(i=>i===o||Qm[i]===o))return e(s)}))},Zm=Bt({patchProp:zm},Em);let Pc;function eg(){return Pc||(Pc=am(Zm))}const tg=((...e)=>{const t=eg().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=rg(r);if(!s)return;const o=t._component;!Je(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,ng(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function ng(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function rg(e){return Mt(e)?document.querySelector(e):e}/*!
17
+ **/let Na;const uc=typeof window<"u"&&window.trustedTypes;if(uc)try{Na=uc.createPolicy("vue",{createHTML:e=>e})}catch{}const hf=Na?e=>Na.createHTML(e):e=>e,Sm="http://www.w3.org/2000/svg",Im="http://www.w3.org/1998/Math/MathML",Zn=typeof document<"u"?document:null,dc=Zn&&Zn.createElement("template"),Em={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?Zn.createElementNS(Sm,e):t==="mathml"?Zn.createElementNS(Im,e):n?Zn.createElement(e,{is:n}):Zn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>Zn.createTextNode(e),createComment:e=>Zn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Zn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,s,o){const i=n?n.previousSibling:t.lastChild;if(s&&(s===o||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===o||!(s=s.nextSibling)););else{dc.innerHTML=hf(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=dc.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},br="transition",Ns="animation",so=Symbol("_vtc"),pf={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},Cm=Bt({},Nd,pf),Am=e=>(e.displayName="Transition",e.props=Cm,e),mf=Am((e,{slots:t})=>bl(Ip,Rm(e),t)),Lr=(e,t=[])=>{We(e)?e.forEach(n=>n(...t)):e&&e(...t)},fc=e=>e?We(e)?e.some(t=>t.length>1):e.length>1:!1;function Rm(e){const t={};for(const Y in e)Y in pf||(t[Y]=e[Y]);if(e.css===!1)return t;const{name:n="v",type:r,duration:s,enterFromClass:o=`${n}-enter-from`,enterActiveClass:i=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:l=o,appearActiveClass:u=i,appearToClass:c=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:m=`${n}-leave-active`,leaveToClass:T=`${n}-leave-to`}=e,U=Pm(s),P=U&&U[0],F=U&&U[1],{onBeforeEnter:R,onEnter:A,onEnterCancelled:B,onLeave:W,onLeaveCancelled:ce,onBeforeAppear:me=R,onAppear:ve=A,onAppearCancelled:Ie=B}=t,re=(Y,Te,xe,Le)=>{Y._enterCancelled=Le,jr(Y,Te?c:a),jr(Y,Te?u:i),xe&&xe()},le=(Y,Te)=>{Y._isLeaving=!1,jr(Y,f),jr(Y,T),jr(Y,m),Te&&Te()},we=Y=>(Te,xe)=>{const Le=Y?ve:A,Pe=()=>re(Te,Y,xe);Lr(Le,[Te,Pe]),hc(()=>{jr(Te,Y?l:o),Xn(Te,Y?c:a),fc(Le)||pc(Te,r,P,Pe)})};return Bt(t,{onBeforeEnter(Y){Lr(R,[Y]),Xn(Y,o),Xn(Y,i)},onBeforeAppear(Y){Lr(me,[Y]),Xn(Y,l),Xn(Y,u)},onEnter:we(!1),onAppear:we(!0),onLeave(Y,Te){Y._isLeaving=!0;const xe=()=>le(Y,Te);Xn(Y,f),Y._enterCancelled?(Xn(Y,m),vc(Y)):(vc(Y),Xn(Y,m)),hc(()=>{Y._isLeaving&&(jr(Y,f),Xn(Y,T),fc(W)||pc(Y,r,F,xe))}),Lr(W,[Y,xe])},onEnterCancelled(Y){re(Y,!1,void 0,!0),Lr(B,[Y])},onAppearCancelled(Y){re(Y,!0,void 0,!0),Lr(Ie,[Y])},onLeaveCancelled(Y){le(Y),Lr(ce,[Y])}})}function Pm(e){if(e==null)return null;if(mt(e))return[Yi(e.enter),Yi(e.leave)];{const t=Yi(e);return[t,t]}}function Yi(e){return Oh(e)}function Xn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[so]||(e[so]=new Set)).add(t)}function jr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[so];n&&(n.delete(t),n.size||(e[so]=void 0))}function hc(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let xm=0;function pc(e,t,n,r){const s=e._endId=++xm,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=Mm(e,t);if(!i)return r();const u=i+"end";let c=0;const f=()=>{e.removeEventListener(u,m),o()},m=T=>{T.target===e&&++c>=l&&f()};setTimeout(()=>{c<l&&f()},a+1),e.addEventListener(u,m)}function Mm(e,t){const n=window.getComputedStyle(e),r=U=>(n[U]||"").split(", "),s=r(`${br}Delay`),o=r(`${br}Duration`),i=mc(s,o),a=r(`${Ns}Delay`),l=r(`${Ns}Duration`),u=mc(a,l);let c=null,f=0,m=0;t===br?i>0&&(c=br,f=i,m=o.length):t===Ns?u>0&&(c=Ns,f=u,m=l.length):(f=Math.max(i,u),c=f>0?i>u?br:Ns:null,m=c?c===br?o.length:l.length:0);const T=c===br&&/\b(?:transform|all)(?:,|$)/.test(r(`${br}Property`).toString());return{type:c,timeout:f,propCount:m,hasTransform:T}}function mc(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>gc(n)+gc(e[r])))}function gc(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function vc(e){return(e?e.ownerDocument:document).body.offsetHeight}function $m(e,t,n){const r=e[so];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const yc=Symbol("_vod"),Om=Symbol("_vsh"),Nm=Symbol(""),Dm=/(?:^|;)\s*display\s*:/;function Lm(e,t,n){const r=e.style,s=Mt(n);let o=!1;if(n&&!s){if(t)if(Mt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Uo(r,a,"")}else for(const i in t)n[i]==null&&Uo(r,i,"");for(const i in n)i==="display"&&(o=!0),Uo(r,i,n[i])}else if(s){if(t!==n){const i=r[Nm];i&&(n+=";"+i),r.cssText=n,o=Dm.test(n)}}else t&&e.removeAttribute("style");yc in e&&(e[yc]=o?r.display:"",e[Om]&&(r.display="none"))}const wc=/\s*!important$/;function Uo(e,t,n){if(We(n))n.forEach(r=>Uo(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=jm(e,t);wc.test(n)?e.setProperty($r(r),n.replace(wc,""),"important"):e[r]=n}}const bc=["Webkit","Moz","ms"],Xi={};function jm(e,t){const n=Xi[t];if(n)return n;let r=fn(t);if(r!=="filter"&&r in e)return Xi[t]=r;r=ui(r);for(let s=0;s<bc.length;s++){const o=bc[s]+r;if(o in e)return Xi[t]=o}return t}const _c="http://www.w3.org/1999/xlink";function kc(e,t,n,r,s,o=Fh(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(_c,t.slice(6,t.length)):e.setAttributeNS(_c,t,n):n==null||o&&!od(n)?e.removeAttribute(t):e.setAttribute(t,o?"":xn(n)?String(n):n)}function Tc(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?hf(n):n);return}const o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){const a=o==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=od(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(s||t)}function as(e,t,n,r){e.addEventListener(t,n,r)}function Um(e,t,n,r){e.removeEventListener(t,n,r)}const Sc=Symbol("_vei");function Fm(e,t,n,r,s=null){const o=e[Sc]||(e[Sc]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=Bm(t);if(r){const u=o[t]=Vm(r,s);as(e,a,u,l)}else i&&(Um(e,a,i,l),o[t]=void 0)}}const Ic=/(?:Once|Passive|Capture)$/;function Bm(e){let t;if(Ic.test(e)){t={};let r;for(;r=e.match(Ic);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):$r(e.slice(2)),t]}let Qi=0;const Hm=Promise.resolve(),Wm=()=>Qi||(Hm.then(()=>Qi=0),Qi=Date.now());function Vm(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;$n(Gm(r,n.value),t,5,[r])};return n.value=e,n.attached=Wm(),n}function Gm(e,t){if(We(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>s=>!s._stopped&&r&&r(s))}else return t}const Ec=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,zm=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?$m(e,r,i):t==="style"?Lm(e,n,r):li(t)?nl(t)||Fm(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):qm(e,t,r,i))?(Tc(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&kc(e,t,r,i,o,t!=="value")):e._isVueCE&&(Km(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Mt(r)))?Tc(e,fn(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),kc(e,t,r,i))};function qm(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Ec(t)&&Je(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Ec(t)&&Mt(n)?!1:t in e}function Km(e,t){const n=e._def.props;if(!n)return!1;const r=fn(t);return Array.isArray(n)?n.some(s=>fn(s)===r):Object.keys(n).some(s=>fn(s)===r)}const Cc=e=>{const t=e.props["onUpdate:modelValue"]||!1;return We(t)?n=>No(t,n):t};function Jm(e){e.target.composing=!0}function Ac(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Zi=Symbol("_assign");function Rc(e,t,n){return t&&(e=e.trim()),n&&(e=ol(e)),e}const ur={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[Zi]=Cc(s);const o=r||s.props&&s.props.type==="number";as(e,t?"change":"input",i=>{i.target.composing||e[Zi](Rc(e.value,n,o))}),(n||o)&&as(e,"change",()=>{e.value=Rc(e.value,n,o)}),t||(as(e,"compositionstart",Jm),as(e,"compositionend",Ac),as(e,"change",Ac))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[Zi]=Cc(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?ol(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===l)||(e.value=l))}},Ym=["ctrl","shift","alt","meta"],Xm={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Ym.some(n=>e[`${n}Key`]&&!t.includes(n))},ct=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...o)=>{for(let i=0;i<t.length;i++){const a=Xm[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},Qm={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},dn=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=$r(s.key);if(t.some(i=>i===o||Qm[i]===o))return e(s)}))},Zm=Bt({patchProp:zm},Em);let Pc;function eg(){return Pc||(Pc=am(Zm))}const tg=((...e)=>{const t=eg().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=rg(r);if(!s)return;const o=t._component;!Je(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,ng(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function ng(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function rg(e){return Mt(e)?document.querySelector(e):e}/*!
18
18
  * vue-router v4.6.4
19
19
  * (c) 2025 Eduardo San Martin Morote
20
20
  * @license MIT
@@ -22,10 +22,10 @@
22
22
  * vue-router v4.6.4
23
23
  * (c) 2025 Eduardo San Martin Morote
24
24
  * @license MIT
25
- */let jg=()=>location.protocol+"//"+location.host;function If(e,t){const{pathname:n,search:r,hash:s}=t,o=e.indexOf("#");if(o>-1){let i=s.includes(e.slice(o))?e.slice(o).length:1,a=s.slice(i);return a[0]!=="/"&&(a="/"+a),Mc(a,"")}return Mc(n,e)+r+s}function Ug(e,t,n,r){let s=[],o=[],i=null;const a=({state:m})=>{const k=If(e,location),U=n.value,P=t.value;let F=0;if(m){if(n.value=k,t.value=m,i&&i===U){i=null;return}F=P?m.position-P.position:0}else r(k);s.forEach(R=>{R(n.value,U,{delta:F,type:La.pop,direction:F?F>0?na.forward:na.back:na.unknown})})};function l(){i=n.value}function u(m){s.push(m);const k=()=>{const U=s.indexOf(m);U>-1&&s.splice(U,1)};return o.push(k),k}function c(){if(document.visibilityState==="hidden"){const{history:m}=window;if(!m.state)return;m.replaceState(ht({},m.state,{scroll:_i()}),"")}}function f(){for(const m of o)m();o=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:l,listen:u,destroy:f}}function Lc(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?_i():null}}function Fg(e){const{history:t,location:n}=window,r={value:If(e,n)},s={value:t.state};s.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(l,u,c){const f=e.indexOf("#"),m=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:jg()+e+l;try{t[c?"replaceState":"pushState"](u,"",m),s.value=u}catch(k){console.error(k),n[c?"replace":"assign"](m)}}function i(l,u){o(l,ht({},t.state,Lc(s.value.back,l,s.value.forward,!0),u,{position:s.value.position}),!0),r.value=l}function a(l,u){const c=ht({},s.value,t.state,{forward:l,scroll:_i()});o(c.current,c,!0),o(l,ht({},Lc(r.value,l,null),{position:c.position+1},u),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function Bg(e){e=Sg(e);const t=Fg(e),n=Ug(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=ht({location:"",base:e,go:r,createHref:Eg.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}function Hg(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),Bg(e)}let Vr=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Ft=(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})(Ft||{});const Wg={type:Vr.Static,value:""},Vg=/[a-zA-Z0-9_]/;function Gg(e){if(!e)return[[]];if(e==="/")return[[Wg]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(k){throw new Error(`ERR (${n})/"${u}": ${k}`)}let n=Ft.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,u="",c="";function f(){u&&(n===Ft.Static?o.push({type:Vr.Static,value:u}):n===Ft.Param||n===Ft.ParamRegExp||n===Ft.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),o.push({type:Vr.Param,value:u,regexp:c,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),u="")}function m(){u+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==Ft.ParamRegExp){r=n,n=Ft.EscapeNext;continue}switch(n){case Ft.Static:l==="/"?(u&&f(),i()):l===":"?(f(),n=Ft.Param):m();break;case Ft.EscapeNext:m(),n=r;break;case Ft.Param:l==="("?n=Ft.ParamRegExp:Vg.test(l)?m():(f(),n=Ft.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Ft.ParamRegExp:l===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+l:n=Ft.ParamRegExpEnd:c+=l;break;case Ft.ParamRegExpEnd:f(),n=Ft.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===Ft.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),f(),i(),s}const jc="[^/]+?",zg={sensitive:!1,strict:!1,start:!0,end:!0};var cn=(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})(cn||{});const qg=/[.+*?^${}()[\]/\\]/g;function Kg(e,t){const n=ht({},zg,t),r=[];let s=n.start?"^":"";const o=[];for(const u of e){const c=u.length?[]:[cn.Root];n.strict&&!u.length&&(s+="/");for(let f=0;f<u.length;f++){const m=u[f];let k=cn.Segment+(n.sensitive?cn.BonusCaseSensitive:0);if(m.type===Vr.Static)f||(s+="/"),s+=m.value.replace(qg,"\\$&"),k+=cn.Static;else if(m.type===Vr.Param){const{value:U,repeatable:P,optional:F,regexp:R}=m;o.push({name:U,repeatable:P,optional:F});const A=R||jc;if(A!==jc){k+=cn.BonusCustomRegExp;try{`${A}`}catch(W){throw new Error(`Invalid custom RegExp for param "${U}" (${A}): `+W.message)}}let B=P?`((?:${A})(?:/(?:${A}))*)`:`(${A})`;f||(B=F&&u.length<2?`(?:/${B})`:"/"+B),F&&(B+="?"),s+=B,k+=cn.Dynamic,F&&(k+=cn.BonusOptional),P&&(k+=cn.BonusRepeatable),A===".*"&&(k+=cn.BonusWildcard)}c.push(k)}r.push(c)}if(n.strict&&n.end){const u=r.length-1;r[u][r[u].length-1]+=cn.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const i=new RegExp(s,n.sensitive?"":"i");function a(u){const c=u.match(i),f={};if(!c)return null;for(let m=1;m<c.length;m++){const k=c[m]||"",U=o[m-1];f[U.name]=k&&U.repeatable?k.split("/"):k}return f}function l(u){let c="",f=!1;for(const m of e){(!f||!c.endsWith("/"))&&(c+="/"),f=!1;for(const k of m)if(k.type===Vr.Static)c+=k.value;else if(k.type===Vr.Param){const{value:U,repeatable:P,optional:F}=k,R=U in u?u[U]:"";if(On(R)&&!P)throw new Error(`Provided param "${U}" is an array but it is not repeatable (* or + modifiers)`);const A=On(R)?R.join("/"):R;if(!A)if(F)m.length<2&&(c.endsWith("/")?c=c.slice(0,-1):f=!0);else throw new Error(`Missing required param "${U}"`);c+=A}}return c||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function Jg(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]===cn.Static+cn.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===cn.Static+cn.Segment?1:-1:0}function Ef(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=Jg(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(Uc(r))return 1;if(Uc(s))return-1}return s.length-r.length}function Uc(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Yg={strict:!1,end:!0,sensitive:!1};function Xg(e,t,n){const r=Kg(Gg(e.path),n),s=ht(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function Qg(e,t){const n=[],r=new Map;t=xc(Yg,t);function s(f){return r.get(f)}function o(f,m,k){const U=!k,P=Bc(f);P.aliasOf=k&&k.record;const F=xc(t,f),R=[P];if("alias"in f){const W=typeof f.alias=="string"?[f.alias]:f.alias;for(const ce of W)R.push(Bc(ht({},P,{components:k?k.record.components:P.components,path:ce,aliasOf:k?k.record:P})))}let A,B;for(const W of R){const{path:ce}=W;if(m&&ce[0]!=="/"){const me=m.record.path,ve=me[me.length-1]==="/"?"":"/";W.path=m.record.path+(ce&&ve+ce)}if(A=Xg(W,m,F),k?k.alias.push(A):(B=B||A,B!==A&&B.alias.push(A),U&&f.name&&!Hc(A)&&i(f.name)),Cf(A)&&l(A),P.children){const me=P.children;for(let ve=0;ve<me.length;ve++)o(me[ve],A,k&&k.children[ve])}k=k||A}return B?()=>{i(B)}:qs}function i(f){if(Tf(f)){const m=r.get(f);m&&(r.delete(f),n.splice(n.indexOf(m),1),m.children.forEach(i),m.alias.forEach(i))}else{const m=n.indexOf(f);m>-1&&(n.splice(m,1),f.record.name&&r.delete(f.record.name),f.children.forEach(i),f.alias.forEach(i))}}function a(){return n}function l(f){const m=tv(f,n);n.splice(m,0,f),f.record.name&&!Hc(f)&&r.set(f.record.name,f)}function u(f,m){let k,U={},P,F;if("name"in f&&f.name){if(k=r.get(f.name),!k)throw bs(Ot.MATCHER_NOT_FOUND,{location:f});F=k.record.name,U=ht(Fc(m.params,k.keys.filter(B=>!B.optional).concat(k.parent?k.parent.keys.filter(B=>B.optional):[]).map(B=>B.name)),f.params&&Fc(f.params,k.keys.map(B=>B.name))),P=k.stringify(U)}else if(f.path!=null)P=f.path,k=n.find(B=>B.re.test(P)),k&&(U=k.parse(P),F=k.record.name);else{if(k=m.name?r.get(m.name):n.find(B=>B.re.test(m.path)),!k)throw bs(Ot.MATCHER_NOT_FOUND,{location:f,currentLocation:m});F=k.record.name,U=ht({},m.params,f.params),P=k.stringify(U)}const R=[];let A=k;for(;A;)R.unshift(A.record),A=A.parent;return{name:F,path:P,params:U,matched:R,meta:ev(R)}}e.forEach(f=>o(f));function c(){n.length=0,r.clear()}return{addRoute:o,resolve:u,removeRoute:i,clearRoutes:c,getRoutes:a,getRecordMatcher:s}}function Fc(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Bc(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Zg(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 Zg(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 Hc(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function ev(e){return e.reduce((t,n)=>ht(t,n.meta),{})}function tv(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;Ef(e,t[o])<0?r=o:n=o+1}const s=nv(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function nv(e){let t=e;for(;t=t.parent;)if(Cf(t)&&Ef(e,t)===0)return t}function Cf({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Wc(e){const t=Rn(ki),n=Rn(kl),r=fe(()=>{const l=ye(e.to);return t.resolve(l)}),s=fe(()=>{const{matched:l}=r.value,{length:u}=l,c=l[u-1],f=n.matched;if(!c||!f.length)return-1;const m=f.findIndex(ws.bind(null,c));if(m>-1)return m;const k=Vc(l[u-2]);return u>1&&Vc(c)===k&&f[f.length-1].path!==k?f.findIndex(ws.bind(null,l[u-2])):m}),o=fe(()=>s.value>-1&&av(n.params,r.value.params)),i=fe(()=>s.value>-1&&s.value===n.matched.length-1&&kf(n.params,r.value.params));function a(l={}){if(iv(l)){const u=t[ye(e.replace)?"replace":"push"](ye(e.to)).catch(qs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:r,href:fe(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function rv(e){return e.length===1?e[0]:e}const sv=Ht({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:Wc,setup(e,{slots:t}){const n=hi(Wc(e)),{options:r}=Rn(ki),s=fe(()=>({[Gc(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Gc(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&rv(t.default(n));return e.custom?o:bl("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),ov=sv;function iv(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 av(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!On(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function Vc(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Gc=(e,t,n)=>e??t??n,lv=Ht({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Rn(Ua),s=fe(()=>e.route||r.value),o=Rn(Dc,0),i=fe(()=>{let u=ye(o);const{matched:c}=s.value;let f;for(;(f=c[u])&&!f.components;)u++;return u}),a=fe(()=>s.value.matched[i.value]);Do(Dc,fe(()=>i.value+1)),Do(Dg,a),Do(Ua,s);const l=D();return ut(()=>[l.value,a.value,e.name],([u,c,f],[m,k,U])=>{c&&(c.instances[f]=u,k&&k!==c&&u&&u===m&&(c.leaveGuards.size||(c.leaveGuards=k.leaveGuards),c.updateGuards.size||(c.updateGuards=k.updateGuards))),u&&c&&(!k||!ws(c,k)||!m)&&(c.enterCallbacks[f]||[]).forEach(P=>P(u))},{flush:"post"}),()=>{const u=s.value,c=e.name,f=a.value,m=f&&f.components[c];if(!m)return zc(n.default,{Component:m,route:u});const k=f.props[c],U=k?k===!0?u.params:typeof k=="function"?k(u):k:null,F=bl(m,ht({},U,t,{onVnodeUnmounted:R=>{R.component.isUnmounted&&(f.instances[c]=null)},ref:l}));return zc(n.default,{Component:F,route:u})||F}}});function zc(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const cv=lv;function uv(e){const t=Qg(e.routes,e),n=e.parseQuery||Og,r=e.stringifyQuery||Nc,s=e.history,o=Ds(),i=Ds(),a=Ds(),l=cp(_r);let u=_r;ls&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=ea.bind(null,K=>""+K),f=ea.bind(null,vg),m=ea.bind(null,oo);function k(K,he){let ue,be;return Tf(K)?(ue=t.getRecordMatcher(K),be=he):be=K,t.addRoute(be,ue)}function U(K){const he=t.getRecordMatcher(K);he&&t.removeRoute(he)}function P(){return t.getRoutes().map(K=>K.record)}function F(K){return!!t.getRecordMatcher(K)}function R(K,he){if(he=ht({},he||l.value),typeof K=="string"){const x=ta(n,K,he.path),q=t.resolve({path:x.path},he),G=s.createHref(x.fullPath);return ht(x,q,{params:m(q.params),hash:oo(x.hash),redirectedFrom:void 0,href:G})}let ue;if(K.path!=null)ue=ht({},K,{path:ta(n,K.path,he.path).path});else{const x=ht({},K.params);for(const q in x)x[q]==null&&delete x[q];ue=ht({},K,{params:f(x)}),he.params=f(he.params)}const be=t.resolve(ue,he),$e=K.hash||"";be.params=c(m(be.params));const g=bg(r,ht({},K,{hash:pg($e),path:be.path})),b=s.createHref(g);return ht({fullPath:g,hash:$e,query:r===Nc?Ng(K.query):K.query||{}},be,{redirectedFrom:void 0,href:b})}function A(K){return typeof K=="string"?ta(n,K,l.value.path):ht({},K)}function B(K,he){if(u!==K)return bs(Ot.NAVIGATION_CANCELLED,{from:he,to:K})}function W(K){return ve(K)}function ce(K){return W(ht(A(K),{replace:!0}))}function me(K,he){const ue=K.matched[K.matched.length-1];if(ue&&ue.redirect){const{redirect:be}=ue;let $e=typeof be=="function"?be(K,he):be;return typeof $e=="string"&&($e=$e.includes("?")||$e.includes("#")?$e=A($e):{path:$e},$e.params={}),ht({query:K.query,hash:K.hash,params:$e.path!=null?{}:K.params},$e)}}function ve(K,he){const ue=u=R(K),be=l.value,$e=K.state,g=K.force,b=K.replace===!0,x=me(ue,be);if(x)return ve(ht(A(x),{state:typeof x=="object"?ht({},$e,x.state):$e,force:g,replace:b}),he||ue);const q=ue;q.redirectedFrom=he;let G;return!g&&_g(r,be,ue)&&(G=bs(Ot.NAVIGATION_DUPLICATED,{to:q,from:be}),Ne(be,be,!0,!1)),(G?Promise.resolve(G):le(q,be)).catch(N=>Qn(N)?Qn(N,Ot.NAVIGATION_GUARD_REDIRECT)?N:Ze(N):Ee(N,q,be)).then(N=>{if(N){if(Qn(N,Ot.NAVIGATION_GUARD_REDIRECT))return ve(ht({replace:b},A(N.to),{state:typeof N.to=="object"?ht({},$e,N.to.state):$e,force:g}),he||q)}else N=Y(q,be,!0,b,$e);return we(q,be,N),N})}function Ie(K,he){const ue=B(K,he);return ue?Promise.reject(ue):Promise.resolve()}function re(K){const he=at.values().next().value;return he&&typeof he.runWithContext=="function"?he.runWithContext(K):K()}function le(K,he){let ue;const[be,$e,g]=Lg(K,he);ue=ra(be.reverse(),"beforeRouteLeave",K,he);for(const x of be)x.leaveGuards.forEach(q=>{ue.push(Ir(q,K,he))});const b=Ie.bind(null,K,he);return ue.push(b),Xe(ue).then(()=>{ue=[];for(const x of o.list())ue.push(Ir(x,K,he));return ue.push(b),Xe(ue)}).then(()=>{ue=ra($e,"beforeRouteUpdate",K,he);for(const x of $e)x.updateGuards.forEach(q=>{ue.push(Ir(q,K,he))});return ue.push(b),Xe(ue)}).then(()=>{ue=[];for(const x of g)if(x.beforeEnter)if(On(x.beforeEnter))for(const q of x.beforeEnter)ue.push(Ir(q,K,he));else ue.push(Ir(x.beforeEnter,K,he));return ue.push(b),Xe(ue)}).then(()=>(K.matched.forEach(x=>x.enterCallbacks={}),ue=ra(g,"beforeRouteEnter",K,he,re),ue.push(b),Xe(ue))).then(()=>{ue=[];for(const x of i.list())ue.push(Ir(x,K,he));return ue.push(b),Xe(ue)}).catch(x=>Qn(x,Ot.NAVIGATION_CANCELLED)?x:Promise.reject(x))}function we(K,he,ue){a.list().forEach(be=>re(()=>be(K,he,ue)))}function Y(K,he,ue,be,$e){const g=B(K,he);if(g)return g;const b=he===_r,x=ls?history.state:{};ue&&(be||b?s.replace(K.fullPath,ht({scroll:b&&x&&x.scroll},$e)):s.push(K.fullPath,$e)),l.value=K,Ne(K,he,ue,b),Ze()}let Te;function xe(){Te||(Te=s.listen((K,he,ue)=>{if(!et.listening)return;const be=R(K),$e=me(be,et.currentRoute.value);if($e){ve(ht($e,{replace:!0,force:!0}),be).catch(qs);return}u=be;const g=l.value;ls&&Rg(Oc(g.fullPath,ue.delta),_i()),le(be,g).catch(b=>Qn(b,Ot.NAVIGATION_ABORTED|Ot.NAVIGATION_CANCELLED)?b:Qn(b,Ot.NAVIGATION_GUARD_REDIRECT)?(ve(ht(A(b.to),{force:!0}),be).then(x=>{Qn(x,Ot.NAVIGATION_ABORTED|Ot.NAVIGATION_DUPLICATED)&&!ue.delta&&ue.type===La.pop&&s.go(-1,!1)}).catch(qs),Promise.reject()):(ue.delta&&s.go(-ue.delta,!1),Ee(b,be,g))).then(b=>{b=b||Y(be,g,!1),b&&(ue.delta&&!Qn(b,Ot.NAVIGATION_CANCELLED)?s.go(-ue.delta,!1):ue.type===La.pop&&Qn(b,Ot.NAVIGATION_ABORTED|Ot.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),we(be,g,b)}).catch(qs)}))}let Le=Ds(),Pe=Ds(),Oe;function Ee(K,he,ue){Ze(K);const be=Pe.list();return be.length?be.forEach($e=>$e(K,he,ue)):console.error(K),Promise.reject(K)}function Ye(){return Oe&&l.value!==_r?Promise.resolve():new Promise((K,he)=>{Le.add([K,he])})}function Ze(K){return Oe||(Oe=!K,xe(),Le.list().forEach(([he,ue])=>K?ue(K):he()),Le.reset()),K}function Ne(K,he,ue,be){const{scrollBehavior:$e}=e;if(!ls||!$e)return Promise.resolve();const g=!ue&&Pg(Oc(K.fullPath,0))||(be||!ue)&&history.state&&history.state.scroll||null;return Yt().then(()=>$e(K,he,g)).then(b=>b&&Ag(b)).catch(b=>Ee(b,K,he))}const nt=K=>s.go(K);let gt;const at=new Set,et={currentRoute:l,listening:!0,addRoute:k,removeRoute:U,clearRoutes:t.clearRoutes,hasRoute:F,getRoutes:P,resolve:R,options:e,push:W,replace:ce,go:nt,back:()=>nt(-1),forward:()=>nt(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Pe.add,isReady:Ye,install(K){K.component("RouterLink",ov),K.component("RouterView",cv),K.config.globalProperties.$router=et,Object.defineProperty(K.config.globalProperties,"$route",{enumerable:!0,get:()=>ye(l)}),ls&&!gt&&l.value===_r&&(gt=!0,W(s.location).catch(be=>{}));const he={};for(const be in _r)Object.defineProperty(he,be,{get:()=>l.value[be],enumerable:!0});K.provide(ki,et),K.provide(kl,kd(he)),K.provide(Ua,l);const ue=K.unmount;at.add(K),K.unmount=function(){at.delete(K),at.size<1&&(u=_r,Te&&Te(),Te=null,l.value=_r,gt=!1,Oe=!1),ue()}}};function Xe(K){return K.reduce((he,ue)=>he.then(()=>re(ue)),Promise.resolve())}return et}function dv(){return Rn(ki)}function fv(e){return Rn(kl)}const qc=768;function Af(){const e=D(typeof window<"u"?window.innerWidth<qc:!1);let t=null;function n(r){e.value=r.matches}return pr(()=>{t=window.matchMedia(`(max-width: ${qc-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),vi(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const hv={key:0,class:"desktop-sidebar"},pv={class:"desktop-main"},Kc="codex-web-local.sidebar-width.v1",mv=260,gv=620,Jc=320,vv=Ht({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Af();function r(u){return Math.min(gv,Math.max(mv,u))}function s(){if(typeof window>"u")return Jc;const u=window.localStorage.getItem(Kc),c=Number(u);return Number.isFinite(c)?r(c):Jc}const o=D(s()),i=fe(()=>n.value||t.isSidebarCollapsed?{"--sidebar-width":"0px","--layout-columns":"minmax(0, 1fr)"}:{"--sidebar-width":`${o.value}px`,"--layout-columns":"var(--sidebar-width) 1px minmax(0, 1fr)"});function a(u){typeof window>"u"||window.localStorage.setItem(Kc,String(u))}function l(u){u.preventDefault();const c=u.clientX,f=o.value,m=U=>{const P=U.clientX-c;o.value=r(f+P)},k=()=>{a(o.value),window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",k)};window.addEventListener("mousemove",m),window.addEventListener("mouseup",k)}return(u,c)=>(w(),T("div",{class:it(["desktop-layout",{"is-mobile":ye(n)}]),style:Jr(i.value)},[ye(n)?(w(),ft(Ko,{key:0,to:"body"},[Re(mf,{name:"drawer"},{default:_t(()=>[e.isSidebarCollapsed?ae("",!0):(w(),T("div",{key:0,class:"mobile-drawer-backdrop",onClick:c[1]||(c[1]=f=>u.$emit("close-sidebar"))},[p("aside",{class:"mobile-drawer",onClick:c[0]||(c[0]=ct(()=>{},["stop"]))},[Gn(u.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):ae("",!0),ye(n)?ae("",!0):(w(),T(Be,{key:1},[e.isSidebarCollapsed?ae("",!0):(w(),T("aside",hv,[Gn(u.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?ae("",!0):(w(),T("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),p("section",pv,[Gn(u.$slots,"content",{},void 0)])],6))}}),st=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},yv=st(vv,[["__scopeId","data-v-df29c633"]]),wv={},bv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function _v(e,t){return w(),T("svg",bv,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const Ti=st(wv,[["render",_v]]),kv={},Tv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Sv(e,t){return w(),T("svg",Tv,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const Rf=st(kv,[["render",Sv]]),Iv={},Ev={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Cv(e,t){return w(),T("svg",Ev,[...t[0]||(t[0]=[p("path",{fill:"currentColor",d:"M6 12a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4"},null,-1)])])}const Ls=st(Iv,[["render",Cv]]),Av={},Rv={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function Pv(e,t){return w(),T("svg",Rv,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 20h4L18.5 9.5a2.828 2.828 0 1 0-4-4L4 16zm9.5-13.5l4 4"},null,-1)])])}const ei=st(Av,[["render",Pv]]),xv={},Mv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function $v(e,t){return w(),T("svg",Mv,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2"},null,-1)])])}const Tl=st(xv,[["render",$v]]),Ov={},Nv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Dv(e,t){return w(),T("svg",Nv,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m5 19l2.757-7.351A1 1 0 0 1 8.693 11H21a1 1 0 0 1 .986 1.164l-.996 5.211A2 2 0 0 1 19.026 19za2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2"},null,-1)])])}const Lv=st(Ov,[["render",Dv]]),jv={},Uv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Fv(e,t){return w(),T("svg",Uv,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 18v-6m0 0a4 4 0 0 1 4-4h2m-6 4a4 4 0 0 0-4-4H6m0-4a2 2 0 1 0 0 4a2 2 0 0 0 0-4m12 0a2 2 0 1 0 0 4a2 2 0 0 0 0-4m-6 14a2 2 0 1 0 0 4a2 2 0 0 0 0-4"},null,-1)])])}const Fo=st(jv,[["render",Fv]]),Bv={},Hv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Wv(e,t){return w(),T("svg",Hv,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 4.5l-4 4L7 10l-1.5 1.5l7 7L14 17l1.5-4l4-4M9 15l-4.5 4.5M14.5 4L20 9.5"},null,-1)])])}const sa=st(Bv,[["render",Wv]]),Vv={key:0,class:"sidebar-menu-row-left"},Gv={class:"sidebar-menu-row-main"},zv={key:1,class:"sidebar-menu-row-right"},qv={key:0,class:"sidebar-menu-row-right-default"},Kv={key:1,class:"sidebar-menu-row-right-hover"},Jv=Ht({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=Up(),r=fe(()=>!!n.left),s=fe(()=>!!n.right),o=fe(()=>!!n["right-hover"]),i=fe(()=>s.value||o.value);return(a,l)=>(w(),ft(Yo(t.as),cf({class:"sidebar-menu-row","data-has-left":r.value,"data-has-right":i.value,"data-has-right-hover":o.value,"data-force-right-hover":t.forceRightHover},a.$attrs),{default:_t(()=>[r.value?(w(),T("span",Vv,[Gn(a.$slots,"left",{},void 0,!0)])):ae("",!0),p("span",Gv,[Gn(a.$slots,"default",{},void 0,!0)]),i.value?(w(),T("span",zv,[s.value?(w(),T("span",qv,[Gn(a.$slots,"right",{},void 0,!0)])):ae("",!0),o.value?(w(),T("span",Kv,[Gn(a.$slots,"right-hover",{},void 0,!0)])):ae("",!0)])):ae("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),Ur=st(Jv,[["__scopeId","data-v-daeca4df"]]),Yv={class:"thread-tree-root"},Xv={key:0,class:"pinned-section"},Qv={class:"thread-list"},Zv={class:"thread-left-stack"},ey=["data-state"],ty=["onClick"],ny=["onClick"],ry={class:"thread-row-title-wrap"},sy={class:"thread-row-title"},oy={class:"thread-row-time"},iy=["onClick"],ay=["onClick"],ly=["onClick"],cy=["onClick"],uy=["aria-expanded"],dy=["data-active"],fy={key:0},hy=["data-active"],py={key:0},my={key:1,class:"thread-tree-no-results"},gy={key:2,class:"thread-tree-loading"},vy={key:3,class:"thread-list thread-list-global"},yy={class:"thread-left-stack"},wy=["data-state"],by=["onClick"],_y=["onClick"],ky={class:"thread-row-title-wrap"},Ty={class:"thread-row-title"},Sy={class:"thread-row-time"},Iy=["onClick"],Ey=["onClick"],Cy=["onClick"],Ay=["onClick"],Ry=["data-project-name","data-expanded","data-dragging"],Py={class:"project-icon-stack"},xy={class:"project-icon-folder"},My={class:"project-icon-chevron"},$y=["data-dragging-handle","onMousedown"],Oy={class:"project-title"},Ny={class:"project-hover-controls"},Dy=["onClick"],Ly=["onClick"],jy=["onClick"],Uy=["onClick"],Fy=["onInput"],By=["aria-label","title","onClick"],Hy={key:0,class:"thread-list"},Wy={class:"thread-left-stack"},Vy=["data-state"],Gy=["onClick"],zy=["onClick"],qy={class:"thread-row-title-wrap"},Ky={class:"thread-row-title"},Jy={class:"thread-row-time"},Yy=["onClick"],Xy=["onClick"],Qy=["onClick"],Zy=["onClick"],ew=["onClick"],tw={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},nw=["onKeydown"],rw={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},sw={class:"rename-thread-subtitle"},ow=4,Yc=6,Xc="codex-web-local.thread-view-mode.v1",Qc="codex-web-local.collapsed-projects.v1",iw=Ht({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-project-files","rename-project","rename-thread","remove-project","reorder-project","export-thread"],setup(e,{emit:t}){const n=e,r=t,s=D({}),o=D({}),i=D([]),a=D(""),l=D(""),u=D("actions"),c=D(""),f=D(!1),m=D(""),k=D(""),U=D(null),P=D(!1),F=D(""),R=D(""),A=D(null),B=D(null),W=D(null);let ce=null,me=null;const ve=D(""),Ie=D({}),re=new Map,le=new Map,we=new Map,Y=new WeakMap,Te=D(null),xe=D(!1),Le=D(Ee()),Pe=typeof window<"u"?new ResizeObserver(I=>{for(const $ of I){const L=$.target,ee=Y.get(L);ee&&O(ee,L)}}):null;function Oe(){if(typeof window>"u")return{};try{const I=window.localStorage.getItem(Qc);if(!I)return{};const $=JSON.parse(I);return!$||typeof $!="object"||Array.isArray($)?{}:$}catch{return{}}}function Ee(){return typeof window>"u"?"project":window.localStorage.getItem(Xc)==="chronological"?"chronological":"project"}o.value=Oe(),ut(o,I=>{typeof window>"u"||window.localStorage.setItem(Qc,JSON.stringify(I))},{deep:!0}),ut(Le,I=>{typeof window>"u"||window.localStorage.setItem(Xc,I)});const Ye=fe(()=>n.searchQuery.trim().toLowerCase()),Ze=fe(()=>Ye.value.length>0),Ne=fe(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function nt(I){if(!Ze.value)return!0;if(Ne.value)return Ne.value.has(I.id);const $=Ye.value;return I.title.toLowerCase().includes($)||I.preview.toLowerCase().includes($)}const gt=fe(()=>Ze.value?n.groups.map(I=>({...I,threads:I.threads.filter(nt)})).filter(I=>I.threads.length>0):n.groups),at=fe(()=>Le.value==="chronological"),et=fe(()=>{const I=gt.value,$=[];for(const L of I)for(const ee of L.threads)b(ee.id)||$.push(ee);return $.sort((L,ee)=>{const Ge=new Date(L.updatedAtIso||L.createdAtIso).getTime();return new Date(ee.updatedAtIso||ee.createdAtIso).getTime()-Ge})}),Xe=fe(()=>{const I=new Map;for(const $ of n.groups)for(const L of $.threads)I.set(L.id,L);return I}),K=fe(()=>i.value.map(I=>Xe.value.get(I)??null).filter(I=>I!==null).filter(nt)),he=fe(()=>{const I=W.value;if(!I||I.dropTargetIndexFull===null||n.groups.length===0)return null;const $=Math.max(0,Math.min(I.dropTargetIndexFull,n.groups.length)),L=$>I.fromIndex?$-1:$,ee=Math.max(0,Math.min(L,n.groups.length-1));return ee===I.fromIndex?null:ee}),ue=fe(()=>{const $=(Ze.value?gt.value:n.groups).map(gn=>gn.projectName),L=W.value,ee=he.value;if(!L||ee===null)return $;const Ge=[...$],[Ut]=Ge.splice(L.fromIndex,1);return Ut?(Ge.splice(ee,0,Ut),Ge):$}),be=fe(()=>{const I={};let $=0;for(const L of ue.value)I[L]=$,$+=It(L);return I}),$e=fe(()=>{let I=0;for(const $ of ue.value)I+=It($);return{height:`${Math.max(0,I)}px`}});function g(I){const $=new Date(I).getTime();if(Number.isNaN($))return"n/a";const L=Math.abs(Date.now()-$);if(L<6e4)return"now";const ee=Math.floor(L/6e4);if(ee<60)return`${ee}m`;const Ge=Math.floor(ee/60);return Ge<24?`${Ge}h`:`${Math.floor(Ge/24)}d`}function b(I){return i.value.includes(I)}function x(I){if(b(I)){i.value=i.value.filter($=>$!==I);return}i.value=[I,...i.value]}function q(I){r("select",I)}function G(I){r("export-thread",I),z()}function N(I){return`start new thread ${ot(I)}`}function V(I){r("start-new-thread",I)}function J(I){l.value===I&&z()}function Q(I){return l.value===I}function z(){l.value=""}function _e(I){if(l.value===I){z();return}l.value=I}function de(I,$){m.value=I,k.value=$,f.value=!0,z(),Yt(()=>{var L,ee;(L=U.value)==null||L.focus(),(ee=U.value)==null||ee.select()})}function Se(){f.value=!1,m.value="",k.value=""}function Me(){const I=m.value,$=k.value.trim();!I||!$||(r("rename-thread",{threadId:I,title:$}),Se())}function De(I,$){F.value=I,R.value=$,P.value=!0,z()}function Fe(){P.value=!1,F.value="",R.value=""}function He(){const I=F.value;I&&(i.value=i.value.filter($=>$!==I),r("archive",I),Fe())}function ot(I){return n.projectDisplayNameById[I]??I}function tt(I){return a.value===I}function vt(){a.value="",u.value="actions",c.value=""}function yt(){xe.value=!xe.value}function jt(I){Le.value=I,xe.value=!1}function zt(I){if(a.value===I){vt();return}a.value=I,u.value="actions",c.value=ot(I)}function kt(I){a.value=I,u.value="rename",c.value=ot(I)}function Rt(I){r("rename-project",{projectName:I,displayName:c.value})}function wt(I){r("remove-project",I),vt()}function Dt(I){r("browse-project-files",I),vt()}function Qt(I,$){if(!I.altKey||I.key!=="ArrowUp"&&I.key!=="ArrowDown")return;const L=n.groups.findIndex(Ut=>Ut.projectName===$);if(L<0)return;const ee=I.key==="ArrowUp"?-1:1,Ge=Math.max(0,Math.min(L+ee,n.groups.length-1));Ge!==L&&(I.preventDefault(),r("reorder-project",{projectName:$,toIndex:Ge}))}function qt(I){return s.value[I]===!0}function xt(I){return o.value[I]===!0}function Tt(I){s.value={...s.value,[I]:!qt(I)}}function Kt(I){if(ve.value===I){ve.value="";return}o.value={...o.value,[I]:!xt(I)}}function It(I){const $=Ie.value[I]??0,L=W.value,Ge=((L==null?void 0:L.projectName)===I?L.groupHeight:null)??$,Ut=xt(I)?0:Yc;return Math.max(0,Ge+Ut)}function bt(I,$){const L=$ instanceof HTMLElement?$:$&&"$el"in $&&$.$el instanceof HTMLElement?$.$el:null;if(L){le.set(I,L);return}le.delete(I)}function Jt(I,$){const L=$ instanceof HTMLElement?$:$&&"$el"in $&&$.$el instanceof HTMLElement?$.$el:null;if(L){we.set(I,L);return}we.delete(I)}function yn(I){const $=a.value;if(!$)return!1;const L=le.get($);if(!L)return!1;if((typeof I.composedPath=="function"?I.composedPath():[]).includes(L))return!0;const Ge=I.target;return Ge instanceof Node?L.contains(Ge):!1}function $t(I){const $=l.value;if(!$)return!1;const L=we.get($);if(!L)return!1;if((typeof I.composedPath=="function"?I.composedPath():[]).includes(L))return!0;const Ge=I.target;return Ge instanceof Node?L.contains(Ge):!1}function Wt(I){if(xe.value){const $=Te.value,L=typeof I.composedPath=="function"?I.composedPath():[];!!$&&(L.includes($)||I.target instanceof Node&&$.contains(I.target))||(xe.value=!1)}a.value&&(yn(I)||vt(),l.value&&($t(I)||z()))}function wn(I){a.value&&!yn(I)&&vt(),l.value&&!$t(I)&&z()}function _(){xe.value&&(xe.value=!1),a.value&&vt(),l.value&&z()}function S(){window.addEventListener("pointerdown",Wt,{capture:!0}),window.addEventListener("focusin",wn,{capture:!0}),window.addEventListener("blur",_)}function E(){window.removeEventListener("pointerdown",Wt,{capture:!0}),window.removeEventListener("focusin",wn,{capture:!0}),window.removeEventListener("blur",_)}function O(I,$){const L=$.getBoundingClientRect().height;if(!Number.isFinite(L)||L<=0)return;const ee=Ie.value[I];ee!==void 0&&Math.abs(ee-L)<.5||(Ie.value={...Ie.value,[I]:L})}function H(I,$){const L=re.get(I);L&&L!==$&&Pe&&Pe.unobserve(L);const ee=$ instanceof HTMLElement?$:$&&"$el"in $&&$.$el instanceof HTMLElement?$.$el:null;if(ee){re.set(I,ee),Y.set(ee,I),O(I,ee),Pe==null||Pe.observe(ee);return}L&&(Pe==null||Pe.unobserve(L)),re.delete(I)}function oe(I,$){if(I.button!==0||B.value||W.value)return;const L=n.groups.findIndex(gn=>gn.projectName===$),ee=re.get($);if(L<0||!ee)return;const Ge=ee.getBoundingClientRect(),Ut=xt($)?0:Yc;B.value={projectName:$,fromIndex:L,startClientX:I.clientX,startClientY:I.clientY,pointerOffsetY:I.clientY-Ge.top,groupLeft:Ge.left,groupWidth:Ge.width,groupHeight:Ge.height,groupOuterHeight:Ge.height+Ut},I.preventDefault(),Ce()}function Ce(){window.addEventListener("mousemove",Ke),window.addEventListener("mouseup",lt),window.addEventListener("keydown",rt)}function ge(){window.removeEventListener("mousemove",Ke),window.removeEventListener("mouseup",lt),window.removeEventListener("keydown",rt)}function Ke(I){ce={clientX:I.clientX,clientY:I.clientY},mn()}function lt(I){Nn({clientX:I.clientX,clientY:I.clientY});const $=W.value;if($&&he.value!==null){const L=n.groups.findIndex(ee=>ee.projectName===$.projectName);if(L>=0){const ee=he.value;ee!==L&&r("reorder-project",{projectName:$.projectName,toIndex:ee})}}Nt()}function rt(I){I.key==="Escape"&&(!B.value&&!W.value||(I.preventDefault(),Nt()))}function Nt(){me!==null&&(window.cancelAnimationFrame(me),me=null),ce=null,B.value=null,W.value=null,ve.value="",ge()}function mn(){me===null&&(me=window.requestAnimationFrame(()=>{if(me=null,!ce)return;const I=ce;ce=null,Nn(I)}))}function Nn(I){const $=B.value;if(!W.value&&$){const L=I.clientX-$.startClientX,ee=I.clientY-$.startClientY;if(Math.hypot(L,ee)<ow)return;vt(),ve.value=$.projectName,W.value={projectName:$.projectName,fromIndex:$.fromIndex,pointerOffsetY:$.pointerOffsetY,groupLeft:$.groupLeft,groupWidth:$.groupWidth,groupHeight:$.groupHeight,groupOuterHeight:$.groupOuterHeight,ghostTop:I.clientY-$.pointerOffsetY,dropTargetIndexFull:null}}W.value&&j(I)}function j(I){const $=W.value;if(!$)return;if($.ghostTop=I.clientY-$.pointerOffsetY,!X(I)){$.dropTargetIndexFull=null;return}const L=I.clientY,ee=A.value;if(!ee){$.dropTargetIndexFull=null;return}const Ge=ee.getBoundingClientRect(),Ut=new Map(n.groups.map((kn,vr)=>[kn.projectName,vr])),gn=n.groups.map(kn=>kn.projectName).filter(kn=>kn!==$.projectName);let Xr=0,gr=n.groups.length;for(const kn of gn){const vr=Ut.get(kn);if(vr===void 0)continue;const Qr=It(kn),Cs=Ge.top+Xr+Qr/2;if(L<Cs){gr=vr;break}Xr+=Qr}$.dropTargetIndexFull=gr}function X(I){const $=A.value;if(!$)return!1;const L=$.getBoundingClientRect(),ee=I.clientX>=L.left&&I.clientX<=L.right,Ge=I.clientY>=L.top-32&&I.clientY<=L.bottom+32;return ee&&Ge}function se(I){var $;return(($=W.value)==null?void 0:$.projectName)===I}function qe(I){const $=W.value,L=be.value[I]??0,ee=a.value===I;return!$||$.projectName!==I?{position:"absolute",top:"0",left:"0",right:"0",zIndex:ee?"40":"1",transform:`translate3d(0, ${L}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${$.groupLeft}px`,width:`${$.groupWidth}px`,height:`${$.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${$.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function Pt(I){return I.threads.filter($=>!b($.id))}function bn(I){if(Ze.value)return Pt(I);if(xt(I.projectName))return[];const $=Pt(I);return qt(I.projectName)?$:$.slice(0,10)}function _n(I){return Ze.value?!1:!xt(I.projectName)&&Pt(I).length>10}function an(I){return Pt(I).length>0}function Vt(I){return I.inProgress?"working":I.unread?"unread":"idle"}ut(()=>n.groups.map(I=>I.projectName),I=>{var Ge,Ut;const $=((Ge=W.value)==null?void 0:Ge.projectName)??((Ut=B.value)==null?void 0:Ut.projectName)??"";$&&!n.groups.some(gn=>gn.projectName===$)&&Nt();const L=new Set(I),ee=Object.fromEntries(Object.entries(Ie.value).filter(([gn])=>L.has(gn)));Object.keys(ee).length!==Object.keys(Ie.value).length&&(Ie.value=ee)});const Dn=fe(()=>xe.value||a.value!=="");return ut(Dn,I=>{if(I){S();return}E()}),mr(()=>{for(const I of re.values())Pe==null||Pe.unobserve(I);re.clear(),le.clear(),E(),Nt()}),(I,$)=>(w(),T("section",Yv,[K.value.length>0?(w(),T("section",Xv,[p("ul",Qv,[(w(!0),T(Be,null,St(K.value,L=>(w(),T("li",{key:L.id,class:"thread-row-item"},[Re(Ur,{class:"thread-row","data-active":L.id===e.selectedThreadId,"data-pinned":b(L.id),onMouseleave:ee=>J(L.id)},{left:_t(()=>[p("span",Zv,[L.inProgress||L.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Vt(L)},null,8,ey)):ae("",!0),p("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:ee=>x(L.id)},[Re(sa,{class:"thread-icon"})],8,ty)])]),right:_t(()=>[p("span",oy,ie(g(L.createdAtIso||L.updatedAtIso)),1)]),"right-hover":_t(()=>[p("div",{ref_for:!0,ref:ee=>Jt(L.id,ee),class:"thread-menu-wrap"},[p("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ct(ee=>_e(L.id),["stop"])},[Re(Ls,{class:"thread-icon"})],8,iy),Q(L.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:$[0]||($[0]=ct(()=>{},["stop"]))},[p("button",{class:"thread-menu-item",type:"button",onClick:ee=>G(L.id)}," Export chat ",8,ay),p("button",{class:"thread-menu-item",type:"button",onClick:ee=>de(L.id,L.title)}," Rename thread ",8,ly),p("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:ee=>De(L.id,L.title)}," Delete thread ",8,cy)])):ae("",!0)],512)]),default:_t(()=>[p("button",{class:"thread-main-button",type:"button",onClick:ee=>q(L.id)},[p("span",ry,[p("span",sy,ie(L.title),1),L.hasWorktree?(w(),ft(Fo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ae("",!0)])],8,ny)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):ae("",!0),Re(Ur,{as:"header",class:"thread-tree-header-row"},{right:_t(()=>[p("div",{ref_key:"organizeMenuWrapRef",ref:Te,class:"organize-menu-wrap"},[p("button",{class:"organize-menu-trigger",type:"button","aria-expanded":xe.value,"aria-label":"Organize threads",title:"Organize threads",onClick:yt},[Re(Ls,{class:"thread-icon"})],8,uy),xe.value?(w(),T("div",{key:0,class:"organize-menu-panel",onClick:$[3]||($[3]=ct(()=>{},["stop"]))},[$[11]||($[11]=p("p",{class:"organize-menu-title"},"Organize",-1)),p("button",{class:"organize-menu-item","data-active":Le.value==="project",type:"button",onClick:$[1]||($[1]=L=>jt("project"))},[$[9]||($[9]=p("span",null,"By project",-1)),Le.value==="project"?(w(),T("span",fy,"✓")):ae("",!0)],8,dy),p("button",{class:"organize-menu-item","data-active":Le.value==="chronological",type:"button",onClick:$[2]||($[2]=L=>jt("chronological"))},[$[10]||($[10]=p("span",null,"Chronological list",-1)),Le.value==="chronological"?(w(),T("span",py,"✓")):ae("",!0)],8,hy)])):ae("",!0)],512)]),default:_t(()=>[$[12]||($[12]=p("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),Ze.value&&gt.value.length===0?(w(),T("p",my,"No matching threads")):e.isLoading&&e.groups.length===0?(w(),T("p",gy,"Loading threads...")):at.value?(w(),T("ul",vy,[(w(!0),T(Be,null,St(et.value,L=>(w(),T("li",{key:L.id,class:"thread-row-item"},[Re(Ur,{class:"thread-row","data-active":L.id===e.selectedThreadId,"data-pinned":b(L.id),onMouseleave:ee=>J(L.id)},{left:_t(()=>[p("span",yy,[L.inProgress||L.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Vt(L)},null,8,wy)):ae("",!0),p("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:ee=>x(L.id)},[Re(sa,{class:"thread-icon"})],8,by)])]),right:_t(()=>[p("span",Sy,ie(g(L.createdAtIso||L.updatedAtIso)),1)]),"right-hover":_t(()=>[p("div",{ref_for:!0,ref:ee=>Jt(L.id,ee),class:"thread-menu-wrap"},[p("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ct(ee=>_e(L.id),["stop"])},[Re(Ls,{class:"thread-icon"})],8,Iy),Q(L.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:$[4]||($[4]=ct(()=>{},["stop"]))},[p("button",{class:"thread-menu-item",type:"button",onClick:ee=>G(L.id)}," Export chat ",8,Ey),p("button",{class:"thread-menu-item",type:"button",onClick:ee=>de(L.id,L.title)}," Rename thread ",8,Cy),p("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:ee=>De(L.id,L.title)}," Delete thread ",8,Ay)])):ae("",!0)],512)]),default:_t(()=>[p("button",{class:"thread-main-button",type:"button",onClick:ee=>q(L.id)},[p("span",ky,[p("span",Ty,ie(L.title),1),L.hasWorktree?(w(),ft(Fo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ae("",!0)])],8,_y)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),T("div",{key:4,ref_key:"groupsContainerRef",ref:A,class:"thread-tree-groups",style:Jr($e.value)},[(w(!0),T(Be,null,St(gt.value,L=>(w(),T("article",{key:L.projectName,ref_for:!0,ref:ee=>H(L.projectName,ee),class:"project-group","data-project-name":L.projectName,"data-expanded":!xt(L.projectName),"data-dragging":se(L.projectName),style:Jr(qe(L.projectName))},[Re(Ur,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:ee=>Kt(L.projectName),onKeydown:[ee=>Qt(ee,L.projectName),dn(ct(ee=>Kt(L.projectName),["prevent"]),["enter"]),dn(ct(ee=>Kt(L.projectName),["prevent"]),["space"])]},{left:_t(()=>[p("span",Py,[p("span",xy,[xt(L.projectName)?(w(),ft(Tl,{key:0,class:"thread-icon"})):(w(),ft(Lv,{key:1,class:"thread-icon"}))]),p("span",My,[xt(L.projectName)?(w(),ft(Rf,{key:0,class:"thread-icon"})):(w(),ft(Ti,{key:1,class:"thread-icon"}))])])]),right:_t(()=>[p("div",Ny,[p("div",{ref_for:!0,ref:ee=>bt(L.projectName,ee),class:"project-menu-wrap"},[p("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:ct(ee=>zt(L.projectName),["stop"])},[Re(Ls,{class:"thread-icon"})],8,Dy),tt(L.projectName)?(w(),T("div",{key:0,class:"project-menu-panel",onClick:$[6]||($[6]=ct(()=>{},["stop"]))},[u.value==="actions"?(w(),T(Be,{key:0},[p("button",{class:"project-menu-item",type:"button",onClick:ee=>Dt(L.projectName)}," Browse files ",8,Ly),p("button",{class:"project-menu-item",type:"button",onClick:ee=>kt(L.projectName)}," Edit name ",8,jy),p("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:ee=>wt(L.projectName)}," Remove ",8,Uy)],64)):(w(),T(Be,{key:1},[$[13]||($[13]=p("label",{class:"project-menu-label"},"Project name",-1)),cr(p("input",{"onUpdate:modelValue":$[5]||($[5]=ee=>c.value=ee),class:"project-menu-input",type:"text",onInput:ee=>Rt(L.projectName)},null,40,Fy),[[ur,c.value]])],64))])):ae("",!0)],512),p("button",{class:"thread-start-button",type:"button","aria-label":N(L.projectName),title:N(L.projectName),onClick:ct(ee=>V(L.projectName),["stop"])},[Re(ei,{class:"thread-icon"})],8,By)])]),default:_t(()=>[p("span",{class:"project-main-button","data-dragging-handle":se(L.projectName),onMousedown:ct(ee=>oe(ee,L.projectName),["left"])},[p("span",Oy,ie(ot(L.projectName)),1)],40,$y)]),_:2},1032,["onClick","onKeydown"]),an(L)?(w(),T("ul",Hy,[(w(!0),T(Be,null,St(bn(L),ee=>(w(),T("li",{key:ee.id,class:"thread-row-item"},[Re(Ur,{class:"thread-row","data-active":ee.id===e.selectedThreadId,"data-pinned":b(ee.id),onMouseleave:Ge=>J(ee.id)},{left:_t(()=>[p("span",Wy,[ee.inProgress||ee.unread?(w(),T("span",{key:0,class:"thread-status-indicator","data-state":Vt(ee)},null,8,Vy)):ae("",!0),p("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Ge=>x(ee.id)},[Re(sa,{class:"thread-icon"})],8,Gy)])]),right:_t(()=>[p("span",Jy,ie(g(ee.createdAtIso||ee.updatedAtIso)),1)]),"right-hover":_t(()=>[p("div",{ref_for:!0,ref:Ge=>Jt(ee.id,Ge),class:"thread-menu-wrap"},[p("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ct(Ge=>_e(ee.id),["stop"])},[Re(Ls,{class:"thread-icon"})],8,Yy),Q(ee.id)?(w(),T("div",{key:0,class:"thread-menu-panel",onClick:$[7]||($[7]=ct(()=>{},["stop"]))},[p("button",{class:"thread-menu-item",type:"button",onClick:Ge=>G(ee.id)}," Export chat ",8,Xy),p("button",{class:"thread-menu-item",type:"button",onClick:Ge=>de(ee.id,ee.title)}," Rename thread ",8,Qy),p("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Ge=>De(ee.id,ee.title)}," Delete thread ",8,Zy)])):ae("",!0)],512)]),default:_t(()=>[p("button",{class:"thread-main-button",type:"button",onClick:Ge=>q(ee.id)},[p("span",qy,[p("span",Ky,ie(ee.title),1),ee.hasWorktree?(w(),ft(Fo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ae("",!0)])],8,zy)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),ft(Ur,{key:1,as:"p",class:"project-empty-row"},{left:_t(()=>[...$[14]||($[14]=[p("span",{class:"project-empty-spacer"},null,-1)])]),default:_t(()=>[$[15]||($[15]=p("span",{class:"project-empty"},"No threads",-1))]),_:1})),_n(L)?(w(),ft(Ur,{key:2,class:"thread-show-more-row"},{left:_t(()=>[...$[16]||($[16]=[p("span",{class:"thread-show-more-spacer"},null,-1)])]),default:_t(()=>[p("button",{class:"thread-show-more-button",type:"button",onClick:ee=>Tt(L.projectName)},ie(qt(L.projectName)?"Show less":"Show more"),9,ew)]),_:2},1024)):ae("",!0)],12,Ry))),128))],4)),(w(),ft(Ko,{to:"body"},[f.value?(w(),T("div",{key:0,class:"rename-thread-overlay",onClick:ct(Se,["self"])},[p("div",tw,[$[17]||($[17]=p("h3",{class:"rename-thread-title"},"Rename thread",-1)),$[18]||($[18]=p("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),cr(p("input",{ref_key:"renameThreadInputRef",ref:U,"onUpdate:modelValue":$[8]||($[8]=L=>k.value=L),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[dn(ct(Me,["prevent"]),["enter"]),dn(ct(Se,["prevent"]),["esc"])]},null,40,nw),[[ur,k.value]]),p("div",{class:"rename-thread-actions"},[p("button",{class:"rename-thread-button",type:"button",onClick:Se},"Cancel"),p("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:Me},"Save")])])])):ae("",!0)])),(w(),ft(Ko,{to:"body"},[P.value?(w(),T("div",{key:0,class:"rename-thread-overlay",onClick:ct(Fe,["self"])},[p("div",rw,[$[19]||($[19]=p("h3",{class:"rename-thread-title"},"Delete thread?",-1)),p("p",sw,' This will archive the thread "'+ie(R.value)+'". You can find it later in archived threads. ',1),p("div",{class:"rename-thread-actions"},[p("button",{class:"rename-thread-button",type:"button",onClick:Fe},"Cancel"),p("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:He},"Delete")])])])):ae("",!0)]))]))}}),aw=st(iw,[["__scopeId","data-v-e2f8a8e1"]]),lw={class:"content-header"},cw={class:"content-leading"},uw={class:"content-title"},dw={class:"content-actions"},fw=Ht({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(w(),T("header",lw,[p("div",cw,[Gn(t.$slots,"leading",{},void 0)]),p("h1",uw,ie(e.title),1),p("div",dw,[Gn(t.$slots,"actions",{},void 0)])]))}}),hw=st(fw,[["__scopeId","data-v-66ee223c"]]),pw={},mw={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function gw(e,t){return w(),T("svg",mw,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const Sl=st(pw,[["render",gw]]),vw={},yw={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ww(e,t){return w(),T("svg",yw,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 14L4 9l5-5m-5 5h11a4 4 0 0 1 0 8H4"},null,-1)])])}const bw=st(vw,[["render",ww]]),_w={},kw={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Tw(e,t){return w(),T("svg",kw,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2zm-4 4a2 2 0 0 1-2-2V8m4 8h10"},null,-1)])])}const Sw=st(_w,[["render",Tw]]),Iw={class:"conversation-root"},Ew={key:0,class:"conversation-loading"},Cw={key:1,class:"conversation-empty"},Aw={class:"message-row"},Rw={class:"message-stack"},Pw={class:"request-card"},xw={class:"request-title"},Mw={class:"request-meta"},$w={key:0,class:"request-reason"},Ow={key:1,class:"request-actions"},Nw=["onClick"],Dw=["onClick"],Lw=["onClick"],jw=["onClick"],Uw={key:2,class:"request-actions"},Fw=["onClick"],Bw=["onClick"],Hw=["onClick"],Ww=["onClick"],Vw={key:3,class:"request-user-input"},Gw={class:"request-question-title"},zw={key:0,class:"request-question-text"},qw=["value","onChange"],Kw=["value"],Jw=["value","onInput"],Yw=["onClick"],Xw={key:4,class:"request-actions"},Qw=["onClick"],Zw=["onClick"],eb={key:5,class:"request-actions"},tb=["onClick"],nb=["onClick"],rb=["data-role","data-message-type"],sb={key:0,class:"message-row","data-role":"system"},ob={class:"message-stack","data-role":"system"},ib=["onClick"],ab={class:"cmd-label"},lb={class:"cmd-status"},cb={class:"cmd-output-inner"},ub={class:"cmd-output"},db=["data-role","data-message-type"],fb=["data-role"],hb=["data-role"],pb=["data-role"],mb=["onClick"],gb=["src"],vb={key:1,class:"message-file-attachments"},yb={class:"message-file-link-wrap"},wb=["href","title"],bb=["href","title"],_b=["data-role"],kb={key:0,class:"worked-separator-wrap","aria-live":"polite"},Tb=["onClick"],Sb={class:"worked-separator-text"},Ib={key:0,class:"worked-details"},Eb=["onClick"],Cb={class:"cmd-label"},Ab={class:"cmd-status"},Rb={class:"cmd-output-inner"},Pb={class:"cmd-output"},xb={key:1,class:"message-text-flow"},Mb={key:0,class:"message-text"},$b={key:0},Ob={key:1,class:"message-bold-text"},Nb={key:2,class:"message-file-link-wrap"},Db=["href","title"],Lb=["href","title"],jb=["href","title"],Ub={key:4,class:"message-inline-code"},Fb={key:1,class:"message-text"},Bb=["onClick"],Hb=["src","alt","onError"],Wb={key:0,class:"message-actions"},Vb=["onClick"],Gb=["onClick"],zb={key:0,class:"conversation-item conversation-item-overlay"},qb={class:"message-row"},Kb={class:"message-stack"},Jb={class:"live-overlay-inline","aria-live":"polite"},Yb={class:"live-overlay-label"},Xb={key:1,class:"live-overlay-error"},Qb=["src"],Zb=16,e_=Ht({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},cwd:{},scrollState:{},isTurnInProgress:{type:Boolean},isRollingBack:{type:Boolean}},emits:["updateScrollState","respondServerRequest","rollback"],setup(e,{emit:t}){const n=D(new Set),r=D(new Set),s=D(new Set),o=D({});function i(_){return _.messageType==="commandExecution"&&!!_.commandExecution}function a(_){var S;return((S=_.commandExecution)==null?void 0:S.status)==="inProgress"||r.value.has(_.id)?!0:n.value.has(_.id)}function l(_){return r.value.has(_.id)}function u(_){var E;if(((E=_.commandExecution)==null?void 0:E.status)==="inProgress")return;const S=new Set(n.value);S.has(_.id)?S.delete(_.id):S.add(_.id),n.value=S}function c(_){const S=new Set(s.value);S.has(_.id)?S.delete(_.id):S.add(_.id),s.value=S}function f(_){return s.value.has(_.id)}function m(_){const S=_.commandExecution;if(!S)return"";switch(S.status){case"inProgress":return"⟳ Running";case"completed":return S.exitCode===0?"✓ Completed":`✗ Exit ${S.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function k(_){var E,O;const S=(E=_.commandExecution)==null?void 0:E.status;return S==="inProgress"?"cmd-status-running":S==="completed"&&((O=_.commandExecution)==null?void 0:O.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function U(_){const S=new Set(r.value);S.add(_),r.value=S,setTimeout(()=>{const E=new Set(r.value);E.delete(_),r.value=E},1e3)}function P(_,S){const E=[];for(let O=S-1;O>=0;O--){const H=_[O];if(H.messageType==="commandExecution")E.unshift(H);else if(H.role==="user"||H.messageType==="worked")break}return E}const F=e,R=t,A=D(null),B=D(null),W=D(null),ce=D(""),me=D({}),ve=D({});let Ie=0,re=0,le=0;const we=new WeakSet,Y=D(new Set);function Te(_){if(!_||_.endsWith("/")||_.endsWith("\\"))return!1;if(_.startsWith("file://"))return!0;if(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(_))return!1;const S=_.startsWith("/"),E=/^[A-Za-z]:[\\/]/u.test(_),O=_.startsWith("./")||_.startsWith("../")||_.startsWith("~/"),H=_.includes("/")||_.includes("\\");return S||E||O||H}function xe(_){return _.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||_}function Le(_){return _.replace(/\\/gu,"/")}function Pe(_){if(!_.startsWith("file://"))return _;let S=_.replace(/^file:\/\//u,"");try{S=decodeURIComponent(S)}catch{}return/^\/[A-Za-z]:\//u.test(S)&&(S=S.slice(1)),S}function Oe(_){const S=Le(_),E=S.match(/^\/Users\/([^/]+)/u);if(E)return`/Users/${E[1]}`;const O=S.match(/^\/home\/([^/]+)/u);return O?`/home/${O[1]}`:""}function Ee(_){const S=Le(_);if(!S)return S;let E="",O=S;const H=O.match(/^([A-Za-z]:)(\/.*)?$/u);H?(E=`${H[1]}/`,O=(H[2]??"").replace(/^\/+/u,"")):O.startsWith("/")&&(E="/",O=O.slice(1));const oe=O.split("/").filter(Boolean),Ce=[];for(const Ke of oe)if(Ke!=="."){if(Ke===".."){Ce.length>0&&Ce.pop();continue}Ce.push(Ke)}const ge=Ce.join("/");return E?`${E}${ge}`.replace(/\/+$/u,"")||E:ge||S}function Ye(_,S){const E=Le(Pe(_.trim()));if(!E)return"";if(E.startsWith("/")||/^[A-Za-z]:\//u.test(E))return Ee(E);if(E.startsWith("~/")){const oe=Oe(S);if(oe)return Ee(`${oe}/${E.slice(2)}`)}const H=Le(S.trim());return Ee(H?`${H.replace(/\/+$/u,"")}/${E}`:E)}function Ze(_){if(!_)return null;let S=_.trim();S=Ne(S).core.trim();let O=null;const H=S.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(H)S=H[1],O=Number(H[2]);else{const oe=S.match(/^(.*):(\d+)(?::\d+)?$/u);oe&&(S=oe[1],O=Number(oe[2]))}return S=Pe(S),Te(S)?{path:S,line:O}:null}function Ne(_){let S=_,E="",O="";for(;/^['"`“‘]/u.test(S);)E+=S[0],S=S.slice(1);for(;/['"`”’]$/u.test(S);)O=S.slice(-1)+O,S=S.slice(0,-1);return{core:S,leading:E,trailing:O}}function nt(_){const S=_.trim(),E=gt(S,0);if(!E||E.end!==S.length)return null;const O=E.label.trim(),H=E.target.trim(),oe=Ne(O).core.trim()||O,Ce=Ne(H).core.trim();return Ce?{label:oe,target:Ce}:null}function gt(_,S){if(_[S]!=="[")return null;const E=_.indexOf("](",S+1);if(E<0)return null;const O=_.slice(S+1,E);if(!O||O.includes(`
26
- `))return null;let H=E+2,oe=1;for(;H<_.length;){const Ce=_[H];if(Ce===`
27
- `)return null;if(Ce==="(")oe+=1;else if(Ce===")"&&(oe-=1,oe===0)){const ge=_.slice(E+2,H);return ge.trim()?{label:O,target:ge,end:H+1}:null}H+=1}return null}function at(_){const S=[],E=/https?:\/\/\S+|file:\/\/\S+|\S*[\\/]\S+/gu;let O=0;for(const H of _.matchAll(E)){if(typeof H.index!="number")continue;const oe=H.index,Ce=oe+H[0].length;oe>O&&S.push({kind:"text",value:_.slice(O,oe)});let ge=H[0],Ke="";for(;/[.,;:]$/u.test(ge);)Ke=ge.slice(-1)+Ke,ge=ge.slice(0,-1);const lt=Ne(ge);ge=lt.core;const rt=lt.leading,Nt=lt.trailing+Ke;if(rt&&S.push({kind:"text",value:rt}),ge.startsWith("**")&&ge.endsWith("**")&&ge.length>4)S.push({kind:"bold",value:ge.slice(2,-2)}),Nt&&S.push({kind:"text",value:Nt});else if(/^https?:\/\//u.test(ge))S.push({kind:"url",value:ge,href:ge}),Nt&&S.push({kind:"text",value:Nt});else{const mn=Ze(ge);mn?(S.push({kind:"file",value:ge,path:mn.path,displayPath:ge,downloadName:xe(mn.path)}),Nt&&S.push({kind:"text",value:Nt})):S.push({kind:"text",value:H[0]})}O=Ce}return O<_.length&&S.push({kind:"text",value:_.slice(O)}),et(S)}function et(_){const S=[];let E=!1,O="";const H=oe=>{oe&&S.push({kind:"text",value:oe})};for(const oe of _){if(oe.kind!=="text"){E&&(H(`**${O}`),E=!1,O=""),S.push(oe);continue}let Ce=oe.value;for(;Ce.length>0;){const ge=Ce.indexOf("**");if(ge<0){E?O+=Ce:H(Ce);break}const Ke=Ce.slice(0,ge);E?O+=Ke:H(Ke),Ce=Ce.slice(ge+2),E?(O.length>0?S.push({kind:"bold",value:O}):H("****"),O="",E=!1):E=!0}}return E&&H(`**${O}`),S}function Xe(_){const S=[];let E=0;for(;E<_.length;){const O=_.indexOf("[",E);if(O<0)break;const H=gt(_,O);if(!H){E=O+1;continue}O>E&&S.push(...at(_.slice(E,O)));const oe=Ne(H.label.trim()).core.trim()||H.label.trim(),Ce=Ne(H.target.trim()).core.trim();if(/^https?:\/\//u.test(Ce))S.push({kind:"url",value:oe||Ce,href:Ce});else{const ge=Ze(Ce);ge?S.push({kind:"file",value:Ce,path:ge.path,displayPath:oe||Ce,downloadName:xe(ge.path)}):S.push({kind:"text",value:_.slice(O,H.end)})}E=H.end}return E<_.length&&S.push(...at(_.slice(E))),S}function K(_){if(!_.includes("`"))return Xe(_);const S=[];let E=0,O=0;for(;E<_.length;){if(_[E]!=="`"){E+=1;continue}let H=1;for(;E+H<_.length&&_[E+H]==="`";)H+=1;const oe="`".repeat(H);let Ce=E+H,ge=-1;for(;Ce<_.length;){const lt=_.indexOf(oe,Ce);if(lt<0)break;const rt=lt>0&&_[lt-1]==="`",Nt=lt+H<_.length&&_[lt+H]==="`",mn=_.slice(E+H,lt).includes(`
28
- `);if(!rt&&!Nt&&!mn){ge=lt;break}Ce=lt+1}if(ge<0){E+=H;continue}E>O&&S.push(...Xe(_.slice(O,E)));const Ke=_.slice(E+H,ge);if(Ke.length>0){const lt=nt(Ke);if(lt)if(/^https?:\/\//u.test(lt.target))S.push({kind:"url",value:lt.label||lt.target,href:lt.target});else{const rt=Ze(lt.target);rt?S.push({kind:"file",value:lt.target,path:rt.path,displayPath:lt.label||lt.target,downloadName:xe(rt.path)}):S.push({kind:"code",value:Ke})}else{const rt=Ze(Ke);if(rt){const Nt=rt.line?`${rt.path}:${String(rt.line)}`:rt.path;S.push({kind:"file",value:Ke,path:rt.path,displayPath:Nt,downloadName:xe(rt.path)})}else S.push({kind:"code",value:Ke})}}else S.push({kind:"text",value:`${oe}${oe}`});E=ge+H,O=E}return O<_.length&&S.push(...Xe(_.slice(O))),S}function he(_){const S=_.trim();if(!S)return"";if(S.startsWith("data:")||S.startsWith("blob:")||S.startsWith("http://")||S.startsWith("https://")||S.startsWith("/codex-local-image?"))return S;if(S.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(S)}`;const E=S.startsWith("/"),O=/^[A-Za-z]:[\\/]/u.test(S);return E||O?`/codex-local-image?path=${encodeURIComponent(S)}`:S}function ue(_){const S=_.trim();if(!S)return"#";const E=Ce=>Ce.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(Ce),O=Ze(S),H=(O==null?void 0:O.path)??S,oe=Ye(H,F.cwd);if(E(oe)){const Ce=oe.startsWith("/")?oe:`/${oe}`;return`/codex-local-browse${encodeURI(Ce)}`}return"#"}function be(_){return $e(_)!=="#"}function $e(_){const S=_.trim();if(!S)return"#";const E=Ze(S),O=(E==null?void 0:E.path)??S,H=Ye(O,F.cwd);if(!(ge=>ge.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(ge))(H))return"#";const Ce=H.startsWith("/")?H:`/${H}`;return`/codex-local-edit${encodeURI(Ce)}`}function g(_){if(!_.includes("![")||!_.includes("]("))return[{kind:"text",value:_}];const S=[],E=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let O=0;for(const H of _.matchAll(E)){const[oe,Ce,ge]=H;if(typeof H.index!="number")continue;const Ke=H.index,lt=Ke+oe.length,rt=he(ge.trim());rt&&(Ke>O&&S.push({kind:"text",value:_.slice(O,Ke)}),S.push({kind:"image",url:rt,alt:Ce.trim(),markdown:oe}),O=lt)}return O<_.length&&S.push({kind:"text",value:_.slice(O)}),S.length>0?S:[{kind:"text",value:_}]}function b(_){return _!==null&&typeof _=="object"&&!Array.isArray(_)?_:null}function x(_){const S=new Date(_);return Number.isNaN(S.getTime())?_:S.toLocaleTimeString()}function q(_){const S=b(_.params),E=S==null?void 0:S.reason;return typeof E=="string"?E.trim():""}function G(_,S){return`${String(_)}:${S}`}function N(_){const S=b(_.params),E=Array.isArray(S==null?void 0:S.questions)?S.questions:[],O=[];for(const H of E){const oe=b(H);if(!oe)continue;const Ce=typeof oe.id=="string"?oe.id:"";if(!Ce)continue;const ge=Array.isArray(oe.options)?oe.options.map(Ke=>b(Ke)).map(Ke=>Ke==null?void 0:Ke.label).filter(Ke=>typeof Ke=="string"&&Ke.length>0):[];O.push({id:Ce,header:typeof oe.header=="string"?oe.header:"",question:typeof oe.question=="string"?oe.question:"",isOther:oe.isOther===!0,options:ge})}return O}function V(_,S,E){const O=G(_,S),H=me.value[O];return typeof H=="string"&&H.length>0?H:E}function J(_,S){const E=G(_,S);return ve.value[E]??""}function Q(_,S,E){const O=E.target;if(!(O instanceof HTMLSelectElement))return;const H=G(_,S);me.value={...me.value,[H]:O.value}}function z(_,S,E){const O=E.target;if(!(O instanceof HTMLInputElement))return;const H=G(_,S);ve.value={...ve.value,[H]:O.value}}function _e(_,S){R("respondServerRequest",{id:_,result:{decision:S}})}function de(_){const S=N(_),E={};for(const O of S){const H=V(_.id,O.id,O.options[0]||""),oe=J(_.id,O.id).trim(),Ce=[H,oe].map(ge=>ge.trim()).filter(ge=>ge.length>0);E[O.id]={answers:Ce}}R("respondServerRequest",{id:_.id,result:{answers:E}})}function Se(_){R("respondServerRequest",{id:_,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function Me(_){R("respondServerRequest",{id:_,result:{success:!0,contentItems:[]}})}function De(_){R("respondServerRequest",{id:_,result:{}})}function Fe(_){R("respondServerRequest",{id:_,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function He(_){return!(_.role!=="user"&&_.role!=="assistant"||typeof _.turnIndex!="number"||F.isTurnInProgress||F.isRollingBack)}function ot(_){return _.role!=="user"&&_.role!=="assistant"?!1:_.text.trim().length>0}function tt(_){return ot(_)||He(_)}async function vt(_){if(!ot(_))return;const S=_.text.trim();try{await navigator.clipboard.writeText(S)}catch{const E=document.createElement("textarea");E.value=S,E.setAttribute("readonly","true"),E.style.position="fixed",E.style.opacity="0",document.body.appendChild(E),E.select(),document.execCommand("copy"),document.body.removeChild(E)}}function yt(_){if(!He(_))return;const S=_.role==="user"?_.text.trim():"";R("rollback",{turnIndex:_.turnIndex,prependText:S.length>0?S:void 0})}function jt(){const _=A.value,S=B.value;!_||!S||(_.scrollTop=_.scrollHeight,S.scrollIntoView({block:"end"}))}function zt(_){return _.scrollHeight-(_.scrollTop+_.clientHeight)<=Zb}function kt(_){if(!F.activeThreadId)return;const S=Math.max(_.scrollHeight-_.clientHeight,0),E=S>0?Math.min(Math.max(_.scrollTop/S,0),1):1;R("updateScrollState",{threadId:F.activeThreadId,state:{scrollTop:_.scrollTop,isAtBottom:zt(_),scrollRatio:E}})}function Rt(){const _=A.value;if(!_)return;const S=F.scrollState;if(!S||S.isAtBottom){wt();return}const E=Math.max(_.scrollHeight-_.clientHeight,0),O=typeof S.scrollRatio=="number"?S.scrollRatio*E:S.scrollTop;_.scrollTop=Math.min(Math.max(O,0),E),kt(_)}function wt(){const _=A.value;_&&(jt(),kt(_))}function Dt(){const _=F.scrollState;return!_||_.isAtBottom===!0}function Qt(){if(!Dt()){le=0,re=0;return}if(wt(),le-=1,le<=0){re=0;return}re=requestAnimationFrame(Qt)}function qt(_=6){Dt()&&(re&&(cancelAnimationFrame(re),re=0),le=Math.max(_,1),re=requestAnimationFrame(Qt))}function xt(){qt(3)}function Tt(){if(!Dt())return;const _=A.value;if(!_)return;const S=_.querySelectorAll("img.message-image-preview");for(const E of S)E.complete||we.has(E)||(we.add(E),E.addEventListener("load",xt,{once:!0}),E.addEventListener("error",xt,{once:!0}))}async function Kt(){await Yt(),Ie&&cancelAnimationFrame(Ie),Ie=requestAnimationFrame(()=>{Ie=0,Rt(),Tt(),qt()})}ut(()=>F.messages,async _=>{if(!F.isLoading){for(const S of _){if(S.messageType!=="commandExecution"||!S.commandExecution)continue;const E=o.value[S.id],O=S.commandExecution.status;E==="inProgress"&&O!=="inProgress"&&U(S.id),o.value[S.id]=O}await Kt()}}),ut(()=>F.liveOverlay,async _=>{_&&(await Yt(),wt(),qt(8))},{deep:!0}),ut(()=>F.isLoading,async _=>{_||await Kt()}),ut(()=>F.activeThreadId,()=>{ce.value="",Y.value=new Set},{flush:"post"});function It(){const _=A.value;!_||F.isLoading||kt(_)}function bt(_){ce.value=he(_)}function Jt(_,S){return`${_}:${String(S)}`}function yn(_,S){const E=new Set(Y.value);E.add(Jt(_,S)),Y.value=E}function $t(_,S){return Y.value.has(Jt(_,S))}function Wt(){ce.value=""}function wn(){const _=W.value;_&&(_.scrollTop=_.scrollHeight)}return ut(()=>{var _;return(_=F.liveOverlay)==null?void 0:_.reasoningText},async _=>{_&&(await Yt(),wn())}),mr(()=>{Ie&&cancelAnimationFrame(Ie),re&&cancelAnimationFrame(re)}),(_,S)=>(w(),T("section",Iw,[e.isLoading?(w(),T("p",Ew,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(w(),T("p",Cw," No messages in this thread yet. ")):(w(),T("ul",{key:2,ref_key:"conversationListRef",ref:A,class:"conversation-list",onScroll:It},[(w(!0),T(Be,null,St(e.pendingRequests,E=>(w(),T("li",{key:`server-request:${E.id}`,class:"conversation-item conversation-item-request"},[p("div",Aw,[p("div",Rw,[p("article",Pw,[p("p",xw,ie(E.method),1),p("p",Mw,"Request #"+ie(E.id)+" · "+ie(x(E.receivedAtIso)),1),q(E)?(w(),T("p",$w,ie(q(E)),1)):ae("",!0),E.method==="item/commandExecution/requestApproval"?(w(),T("section",Ow,[p("button",{type:"button",class:"request-button request-button-primary",onClick:O=>_e(E.id,"accept")},"Accept",8,Nw),p("button",{type:"button",class:"request-button",onClick:O=>_e(E.id,"acceptForSession")},"Accept for Session",8,Dw),p("button",{type:"button",class:"request-button",onClick:O=>_e(E.id,"decline")},"Decline",8,Lw),p("button",{type:"button",class:"request-button",onClick:O=>_e(E.id,"cancel")},"Cancel",8,jw)])):E.method==="item/fileChange/requestApproval"?(w(),T("section",Uw,[p("button",{type:"button",class:"request-button request-button-primary",onClick:O=>_e(E.id,"accept")},"Accept",8,Fw),p("button",{type:"button",class:"request-button",onClick:O=>_e(E.id,"acceptForSession")},"Accept for Session",8,Bw),p("button",{type:"button",class:"request-button",onClick:O=>_e(E.id,"decline")},"Decline",8,Hw),p("button",{type:"button",class:"request-button",onClick:O=>_e(E.id,"cancel")},"Cancel",8,Ww)])):E.method==="item/tool/requestUserInput"?(w(),T("section",Vw,[(w(!0),T(Be,null,St(N(E),O=>(w(),T("div",{key:`${E.id}:${O.id}`,class:"request-question"},[p("p",Gw,ie(O.header||O.question),1),O.header&&O.question?(w(),T("p",zw,ie(O.question),1)):ae("",!0),p("select",{class:"request-select",value:V(E.id,O.id,O.options[0]||""),onChange:H=>Q(E.id,O.id,H)},[(w(!0),T(Be,null,St(O.options,H=>(w(),T("option",{key:`${E.id}:${O.id}:${H}`,value:H},ie(H),9,Kw))),128))],40,qw),O.isOther?(w(),T("input",{key:1,class:"request-input",type:"text",value:J(E.id,O.id),placeholder:"Other answer",onInput:H=>z(E.id,O.id,H)},null,40,Jw)):ae("",!0)]))),128)),p("button",{type:"button",class:"request-button request-button-primary",onClick:O=>de(E)}," Submit Answers ",8,Yw)])):E.method==="item/tool/call"?(w(),T("section",Xw,[p("button",{type:"button",class:"request-button request-button-primary",onClick:O=>Se(E.id)},"Fail Tool Call",8,Qw),p("button",{type:"button",class:"request-button",onClick:O=>Me(E.id)},"Success (Empty)",8,Zw)])):(w(),T("section",eb,[p("button",{type:"button",class:"request-button request-button-primary",onClick:O=>De(E.id)},"Return Empty Result",8,tb),p("button",{type:"button",class:"request-button",onClick:O=>Fe(E.id)},"Reject Request",8,nb)]))])])])]))),128)),(w(!0),T(Be,null,St(e.messages,E=>{var O,H;return w(),T("li",{key:E.id,class:it(["conversation-item",{"conversation-item-actionable":tt(E)}]),"data-role":E.role,"data-message-type":E.messageType||""},[i(E)?(w(),T("div",sb,[p("div",ob,[p("button",{type:"button",class:it(["cmd-row",[k(E),{"cmd-expanded":a(E)}]]),onClick:oe=>u(E)},[p("span",{class:it(["cmd-chevron",{"cmd-chevron-open":a(E)}])},"▶",2),p("code",ab,ie(((O=E.commandExecution)==null?void 0:O.command)||"(command)"),1),p("span",lb,ie(m(E)),1)],10,ib),p("div",{class:it(["cmd-output-wrap",{"cmd-output-visible":a(E),"cmd-output-collapsing":l(E)}])},[p("div",cb,[p("pre",ub,ie(((H=E.commandExecution)==null?void 0:H.aggregatedOutput)||"(no output)"),1)])],2)])])):(w(),T("div",{key:1,class:"message-row","data-role":E.role,"data-message-type":E.messageType||""},[p("div",{class:"message-stack","data-role":E.role},[p("article",{class:"message-body","data-role":E.role},[E.images&&E.images.length>0?(w(),T("ul",{key:0,class:"message-image-list","data-role":E.role},[(w(!0),T(Be,null,St(E.images,oe=>(w(),T("li",{key:oe,class:"message-image-item"},[p("button",{class:"message-image-button",type:"button",onClick:Ce=>bt(oe)},[p("img",{class:"message-image-preview",src:he(oe),alt:"Message image preview",loading:"lazy"},null,8,gb)],8,mb)]))),128))],8,pb)):ae("",!0),E.fileAttachments&&E.fileAttachments.length>0?(w(),T("div",vb,[(w(!0),T(Be,null,St(E.fileAttachments,oe=>(w(),T("span",{key:oe.path,class:"message-file-chip"},[S[1]||(S[1]=p("span",{class:"message-file-chip-icon"},"📄",-1)),p("span",yb,[p("a",{class:"message-file-link message-file-chip-name",href:ue(oe.path),target:"_blank",rel:"noopener noreferrer",title:oe.path},ie(oe.path),9,wb),be(oe.path)?(w(),T("a",{key:0,class:"message-file-edit-link",href:$e(oe.path),target:"_blank",rel:"noopener noreferrer",title:`Edit ${oe.path}`,"aria-label":"Edit file"}," Edit ",8,bb)):ae("",!0)])]))),128))])):ae("",!0),E.text.length>0?(w(),T("article",{key:2,class:"message-card","data-role":E.role},[E.messageType==="worked"?(w(),T("div",kb,[p("button",{type:"button",class:"worked-separator",onClick:oe=>c(E)},[S[2]||(S[2]=p("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),p("span",{class:it(["worked-chevron",{"worked-chevron-open":f(E)}])},"▶",2),p("p",Sb,ie(E.text),1),S[3]||(S[3]=p("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Tb),f(E)?(w(),T("div",Ib,[(w(!0),T(Be,null,St(P(e.messages,e.messages.indexOf(E)),oe=>{var Ce,ge;return w(),T("div",{key:`worked-cmd-${oe.id}`,class:"worked-cmd-item"},[p("button",{type:"button",class:it(["cmd-row",[k(oe),{"cmd-expanded":a(oe)}]]),onClick:Ke=>u(oe)},[p("span",{class:it(["cmd-chevron",{"cmd-chevron-open":a(oe)}])},"▶",2),p("code",Cb,ie(((Ce=oe.commandExecution)==null?void 0:Ce.command)||"(command)"),1),p("span",Ab,ie(m(oe)),1)],10,Eb),p("div",{class:it(["cmd-output-wrap",{"cmd-output-visible":a(oe),"cmd-output-collapsing":l(oe)}])},[p("div",Rb,[p("pre",Pb,ie(((ge=oe.commandExecution)==null?void 0:ge.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):ae("",!0)])):(w(),T("div",xb,[(w(!0),T(Be,null,St(g(E.text),(oe,Ce)=>(w(),T(Be,{key:`block-${Ce}`},[oe.kind==="text"?(w(),T("p",Mb,[(w(!0),T(Be,null,St(K(oe.value),(ge,Ke)=>(w(),T(Be,{key:`seg-${Ce}-${Ke}`},[ge.kind==="text"?(w(),T("span",$b,ie(ge.value),1)):ge.kind==="bold"?(w(),T("strong",Ob,ie(ge.value),1)):ge.kind==="file"?(w(),T("span",Nb,[p("a",{class:"message-file-link",href:ue(ge.path),target:"_blank",rel:"noopener noreferrer",title:ge.path},ie(ge.displayPath),9,Db),be(ge.path)?(w(),T("a",{key:0,class:"message-file-edit-link",href:$e(ge.path),target:"_blank",rel:"noopener noreferrer",title:`Edit ${ge.path}`,"aria-label":"Edit file"}," Edit ",8,Lb)):ae("",!0)])):ge.kind==="url"?(w(),T("a",{key:3,class:"message-file-link",href:ge.href,target:"_blank",rel:"noopener noreferrer",title:ge.href},ie(ge.value),9,jb)):(w(),T("code",Ub,ie(ge.value),1))],64))),128))])):$t(E.id,Ce)?(w(),T("p",Fb,ie(oe.markdown),1)):(w(),T("button",{key:2,class:"message-image-button",type:"button",onClick:ge=>bt(oe.url)},[p("img",{class:"message-image-preview message-markdown-image",src:oe.url,alt:oe.alt||"Embedded message image",loading:"lazy",onError:ge=>yn(E.id,Ce)},null,40,Hb)],8,Bb))],64))),128))]))],8,_b)):ae("",!0)],8,hb),tt(E)?(w(),T("div",Wb,[ot(E)?(w(),T("button",{key:0,class:"message-action-button",type:"button",title:"Copy message text",onClick:oe=>vt(E)},[Re(Sw,{class:"message-action-icon"}),S[4]||(S[4]=p("span",{class:"message-action-label"},"Copy",-1))],8,Vb)):ae("",!0),He(E)?(w(),T("button",{key:1,class:"message-action-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:oe=>yt(E)},[Re(bw,{class:"message-action-icon"}),S[5]||(S[5]=p("span",{class:"message-action-label"},"Rollback",-1))],8,Gb)):ae("",!0)])):ae("",!0)],8,fb)],8,db))],10,rb)}),128)),e.liveOverlay?(w(),T("li",zb,[p("div",qb,[p("div",Kb,[p("article",Jb,[p("p",Yb,ie(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(w(),T("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:W},ie(e.liveOverlay.reasoningText),513)):ae("",!0),e.liveOverlay.errorText?(w(),T("p",Xb,ie(e.liveOverlay.errorText),1)):ae("",!0)])])])])):ae("",!0),p("li",{ref_key:"bottomAnchorRef",ref:B,class:"conversation-bottom-anchor"},null,512)],544)),ce.value.length>0?(w(),T("div",{key:3,class:"image-modal-backdrop",onClick:Wt},[p("div",{class:"image-modal-content",onClick:S[0]||(S[0]=ct(()=>{},["stop"]))},[p("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:Wt},[Re(Sl,{class:"icon-svg"})]),p("img",{class:"image-modal-image",src:ce.value,alt:"Expanded message image"},null,8,Qb)])])):ae("",!0)]))}}),t_=st(e_,[["__scopeId","data-v-bc40021f"]]),Zc=.0025,oa=3,eu=2,n_=256;function r_(e){var we;const t=D("idle"),n=D(typeof navigator<"u"&&!!((we=navigator.mediaDevices)!=null&&we.getUserMedia)),r=D(0),s=D(null);let o=null,i=null,a=[],l=null,u=null,c=null,f=null,m=[],k=!1,U=!1,P=null;function F(){P&&(P.abort(),P=null),t.value==="transcribing"&&(t.value="idle")}function R(){const Y=s.value;if(!Y||typeof window>"u")return;const Te=Y.getContext("2d");if(!Te)return;const xe=Math.max(1,Math.floor(Y.clientWidth)),Le=Math.max(1,Math.floor(Y.clientHeight||36)),Pe=window.devicePixelRatio||1,Oe=Math.max(1,Math.floor(xe*Pe)),Ee=Math.max(1,Math.floor(Le*Pe));(Y.width!==Oe||Y.height!==Ee)&&(Y.width=Oe,Y.height=Ee),Te.setTransform(Pe,0,0,Pe,0,0),Te.clearRect(0,0,xe,Le);const Ye=Math.max(12,Math.floor(xe/(oa+eu))),Ze=m.slice(-Ye),Ne=Math.max(0,Ye-Ze.length),nt=Le/2,gt=getComputedStyle(Y).color||"#000000";for(let at=0;at<Ye;at+=1){const et=Ze[at-Ne]??0,K=Math.max(.08,Math.min(1,et*18))*nt,he=at*(oa+eu);Te.globalAlpha=et<=Zc?.35:1,Te.fillStyle=gt,Te.fillRect(he,nt-K,oa,K*2)}Te.globalAlpha=1}function A(){m=[],r.value=0,R()}function B(){c&&(c.disconnect(),c.onaudioprocess=null,c=null),u&&(u.disconnect(),u=null),l&&(l.close(),l=null),f=null}function W(Y){if(typeof window>"u")return;const Te=window.webkitAudioContext,xe=window.AudioContext??Te;xe&&(B(),A(),l=new xe,u=l.createMediaStreamSource(Y),c=l.createScriptProcessor(2048,1,1),f=performance.now(),c.onaudioprocess=Le=>{const Pe=Le.inputBuffer.getChannelData(0);let Oe=0;for(let Ee=0;Ee<Pe.length;Ee+=1){const Ye=Math.abs(Pe[Ee]??0);Oe+=Ye<Zc?0:Ye}m.push(Oe/Pe.length),m.length>n_&&m.shift(),f!==null&&(r.value=Math.max(0,performance.now()-f)),R()},u.connect(c),c.connect(l.destination),R())}async function ce(){var Y;if(t.value==="transcribing"&&F(),!(t.value!=="idle"||!n.value||k)){k=!0,U=!1;try{i=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),a=[],o=new MediaRecorder(i),o.ondataavailable=Te=>{Te.data.size>0&&a.push(Te.data)},o.onstop=()=>{var Le;const Te=a,xe=(o==null?void 0:o.mimeType)||((Le=Te[0])==null?void 0:Le.type)||"audio/webm";re(),Ie(Te,xe)},W(i),o.start(250),t.value="recording",U&&me()}catch(Te){re(),t.value="idle",(Y=e.onError)==null||Y.call(e,Te)}finally{k=!1}}}function me(){if(k&&t.value==="idle"){U=!0;return}if(!(t.value!=="recording"||!o)&&o.state!=="inactive"){t.value="transcribing";try{o.requestData()}catch{}o.stop()}}function ve(){U=!1,F(),re(),t.value="idle"}async function Ie(Y,Te){var Pe,Oe,Ee,Ye,Ze;if(Y.length===0){(Pe=e.onEmpty)==null||Pe.call(e),t.value="idle";return}const xe=new Blob(Y,{type:Te});t.value="transcribing";let Le=null;try{const Ne=Te.split(/[/;]/)[1]??"webm",nt=new FormData;nt.append("file",xe,`codex.${Ne}`);const gt=((Oe=e.getLanguage)==null?void 0:Oe.call(e).trim())??"";gt&&gt.toLowerCase()!=="auto"&&nt.append("language",gt),Le=new AbortController,P=Le;const at=await fetch("/codex-api/transcribe",{method:"POST",body:nt,signal:Le.signal}),et=await at.text();let Xe=null;try{Xe=et.trim()?JSON.parse(et):null}catch{Xe=null}if(!at.ok){const he=(Ee=Xe==null?void 0:Xe.error)==null?void 0:Ee.trim(),ue=et.trim();throw new Error(he||ue||`Transcription failed: ${at.status}`)}const K=((Xe==null?void 0:Xe.text)??"").trim();K.length>0?e.onTranscript(K):(Ye=e.onEmpty)==null||Ye.call(e)}catch(Ne){if(Ne instanceof DOMException&&Ne.name==="AbortError")return;(Ze=e.onError)==null||Ze.call(e,Ne)}finally{Le&&P===Le&&(P=null),t.value==="transcribing"&&(t.value="idle")}}function re(){B(),A(),o&&(o.ondataavailable=null,o.onstop=null,o=null),i&&(i.getTracks().forEach(Y=>Y.stop()),i=null),a=[]}mr(()=>{ve()});function le(){if(t.value==="recording"){me();return}(t.value==="idle"||t.value==="transcribing")&&ce()}return{state:t,isSupported:n,recordingDurationMs:r,waveformCanvasRef:s,startRecording:ce,stopRecording:me,toggleRecording:le,cancel:ve}}function tu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class or extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function Il(e,t){const n=tu(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=tu(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function Ss(e,t,n){return e instanceof or?e:e instanceof Error?new or(e.message||t,{code:"unknown_error",method:n}):new or(t,{code:"unknown_error",method:n})}function Pf(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function s_(e,t){const n={method:e,params:t??null};let r;try{r=await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(i){throw new or(i instanceof Error?i.message:`RPC ${e} failed before request was sent`,{code:"network_error",method:e})}let s=null;try{s=await r.json()}catch{s=null}if(!r.ok)throw new or(Il(s,`RPC ${e} failed with HTTP ${r.status}`),{code:"http_error",method:e,status:r.status});const o=s;if(!o||typeof o!="object"||!("result"in o))throw new or(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function nu(e){const t=Pf(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 o_(e){if(typeof window>"u")return()=>{};let t=null,n=!1;const r=()=>{if(typeof EventSource>"u"||n)return;const s=new EventSource("/codex-api/events");s.onmessage=o=>{try{const i=JSON.parse(o.data),a=nu(i);a&&e(a)}catch{}},t=()=>s.close()};if(typeof WebSocket<"u"){const s=window.location.protocol==="https:"?"wss:":"ws:",o=new WebSocket(`${s}//${window.location.host}/codex-api/ws`);let i=!1,a=window.setTimeout(()=>{i||n||(o.close(),r())},2500);o.onopen=()=>{i=!0,a!==null&&(window.clearTimeout(a),a=null)},o.onmessage=l=>{try{const u=JSON.parse(String(l.data)),c=nu(u);c&&e(c)}catch{}},o.onerror=()=>{!i&&!n&&r()},o.onclose=()=>{a!==null&&(window.clearTimeout(a),a=null),!i&&!n&&r()},t=()=>o.close()}else r();return()=>{n=!0,t==null||t()}}async function i_(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 or(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 or(Il(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function a_(){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 or(Il(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Pf(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function ru(e){return new Date(e*1e3).toISOString()}function l_(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function c_(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const u_=/^##\s+(.+?):\s+(.+?)\s*$/,d_=/^#\s*files mentioned by the user\s*:?\s*$/i;function f_(e){var s,o;const t=e.split(`
25
+ */let jg=()=>location.protocol+"//"+location.host;function If(e,t){const{pathname:n,search:r,hash:s}=t,o=e.indexOf("#");if(o>-1){let i=s.includes(e.slice(o))?e.slice(o).length:1,a=s.slice(i);return a[0]!=="/"&&(a="/"+a),Mc(a,"")}return Mc(n,e)+r+s}function Ug(e,t,n,r){let s=[],o=[],i=null;const a=({state:m})=>{const T=If(e,location),U=n.value,P=t.value;let F=0;if(m){if(n.value=T,t.value=m,i&&i===U){i=null;return}F=P?m.position-P.position:0}else r(T);s.forEach(R=>{R(n.value,U,{delta:F,type:La.pop,direction:F?F>0?na.forward:na.back:na.unknown})})};function l(){i=n.value}function u(m){s.push(m);const T=()=>{const U=s.indexOf(m);U>-1&&s.splice(U,1)};return o.push(T),T}function c(){if(document.visibilityState==="hidden"){const{history:m}=window;if(!m.state)return;m.replaceState(ht({},m.state,{scroll:_i()}),"")}}function f(){for(const m of o)m();o=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:l,listen:u,destroy:f}}function Lc(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?_i():null}}function Fg(e){const{history:t,location:n}=window,r={value:If(e,n)},s={value:t.state};s.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(l,u,c){const f=e.indexOf("#"),m=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:jg()+e+l;try{t[c?"replaceState":"pushState"](u,"",m),s.value=u}catch(T){console.error(T),n[c?"replace":"assign"](m)}}function i(l,u){o(l,ht({},t.state,Lc(s.value.back,l,s.value.forward,!0),u,{position:s.value.position}),!0),r.value=l}function a(l,u){const c=ht({},s.value,t.state,{forward:l,scroll:_i()});o(c.current,c,!0),o(l,ht({},Lc(r.value,l,null),{position:c.position+1},u),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function Bg(e){e=Sg(e);const t=Fg(e),n=Ug(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=ht({location:"",base:e,go:r,createHref:Eg.bind(null,e)},t,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>t.state.value}),s}function Hg(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),Bg(e)}let Vr=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var Ft=(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})(Ft||{});const Wg={type:Vr.Static,value:""},Vg=/[a-zA-Z0-9_]/;function Gg(e){if(!e)return[[]];if(e==="/")return[[Wg]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(T){throw new Error(`ERR (${n})/"${u}": ${T}`)}let n=Ft.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,u="",c="";function f(){u&&(n===Ft.Static?o.push({type:Vr.Static,value:u}):n===Ft.Param||n===Ft.ParamRegExp||n===Ft.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),o.push({type:Vr.Param,value:u,regexp:c,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),u="")}function m(){u+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==Ft.ParamRegExp){r=n,n=Ft.EscapeNext;continue}switch(n){case Ft.Static:l==="/"?(u&&f(),i()):l===":"?(f(),n=Ft.Param):m();break;case Ft.EscapeNext:m(),n=r;break;case Ft.Param:l==="("?n=Ft.ParamRegExp:Vg.test(l)?m():(f(),n=Ft.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case Ft.ParamRegExp:l===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+l:n=Ft.ParamRegExpEnd:c+=l;break;case Ft.ParamRegExpEnd:f(),n=Ft.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,c="";break;default:t("Unknown state");break}}return n===Ft.ParamRegExp&&t(`Unfinished custom RegExp for param "${u}"`),f(),i(),s}const jc="[^/]+?",zg={sensitive:!1,strict:!1,start:!0,end:!0};var cn=(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})(cn||{});const qg=/[.+*?^${}()[\]/\\]/g;function Kg(e,t){const n=ht({},zg,t),r=[];let s=n.start?"^":"";const o=[];for(const u of e){const c=u.length?[]:[cn.Root];n.strict&&!u.length&&(s+="/");for(let f=0;f<u.length;f++){const m=u[f];let T=cn.Segment+(n.sensitive?cn.BonusCaseSensitive:0);if(m.type===Vr.Static)f||(s+="/"),s+=m.value.replace(qg,"\\$&"),T+=cn.Static;else if(m.type===Vr.Param){const{value:U,repeatable:P,optional:F,regexp:R}=m;o.push({name:U,repeatable:P,optional:F});const A=R||jc;if(A!==jc){T+=cn.BonusCustomRegExp;try{`${A}`}catch(W){throw new Error(`Invalid custom RegExp for param "${U}" (${A}): `+W.message)}}let B=P?`((?:${A})(?:/(?:${A}))*)`:`(${A})`;f||(B=F&&u.length<2?`(?:/${B})`:"/"+B),F&&(B+="?"),s+=B,T+=cn.Dynamic,F&&(T+=cn.BonusOptional),P&&(T+=cn.BonusRepeatable),A===".*"&&(T+=cn.BonusWildcard)}c.push(T)}r.push(c)}if(n.strict&&n.end){const u=r.length-1;r[u][r[u].length-1]+=cn.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const i=new RegExp(s,n.sensitive?"":"i");function a(u){const c=u.match(i),f={};if(!c)return null;for(let m=1;m<c.length;m++){const T=c[m]||"",U=o[m-1];f[U.name]=T&&U.repeatable?T.split("/"):T}return f}function l(u){let c="",f=!1;for(const m of e){(!f||!c.endsWith("/"))&&(c+="/"),f=!1;for(const T of m)if(T.type===Vr.Static)c+=T.value;else if(T.type===Vr.Param){const{value:U,repeatable:P,optional:F}=T,R=U in u?u[U]:"";if(On(R)&&!P)throw new Error(`Provided param "${U}" is an array but it is not repeatable (* or + modifiers)`);const A=On(R)?R.join("/"):R;if(!A)if(F)m.length<2&&(c.endsWith("/")?c=c.slice(0,-1):f=!0);else throw new Error(`Missing required param "${U}"`);c+=A}}return c||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function Jg(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]===cn.Static+cn.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===cn.Static+cn.Segment?1:-1:0}function Ef(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=Jg(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(Uc(r))return 1;if(Uc(s))return-1}return s.length-r.length}function Uc(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Yg={strict:!1,end:!0,sensitive:!1};function Xg(e,t,n){const r=Kg(Gg(e.path),n),s=ht(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function Qg(e,t){const n=[],r=new Map;t=xc(Yg,t);function s(f){return r.get(f)}function o(f,m,T){const U=!T,P=Bc(f);P.aliasOf=T&&T.record;const F=xc(t,f),R=[P];if("alias"in f){const W=typeof f.alias=="string"?[f.alias]:f.alias;for(const ce of W)R.push(Bc(ht({},P,{components:T?T.record.components:P.components,path:ce,aliasOf:T?T.record:P})))}let A,B;for(const W of R){const{path:ce}=W;if(m&&ce[0]!=="/"){const me=m.record.path,ve=me[me.length-1]==="/"?"":"/";W.path=m.record.path+(ce&&ve+ce)}if(A=Xg(W,m,F),T?T.alias.push(A):(B=B||A,B!==A&&B.alias.push(A),U&&f.name&&!Hc(A)&&i(f.name)),Cf(A)&&l(A),P.children){const me=P.children;for(let ve=0;ve<me.length;ve++)o(me[ve],A,T&&T.children[ve])}T=T||A}return B?()=>{i(B)}:qs}function i(f){if(Tf(f)){const m=r.get(f);m&&(r.delete(f),n.splice(n.indexOf(m),1),m.children.forEach(i),m.alias.forEach(i))}else{const m=n.indexOf(f);m>-1&&(n.splice(m,1),f.record.name&&r.delete(f.record.name),f.children.forEach(i),f.alias.forEach(i))}}function a(){return n}function l(f){const m=tv(f,n);n.splice(m,0,f),f.record.name&&!Hc(f)&&r.set(f.record.name,f)}function u(f,m){let T,U={},P,F;if("name"in f&&f.name){if(T=r.get(f.name),!T)throw bs(Ot.MATCHER_NOT_FOUND,{location:f});F=T.record.name,U=ht(Fc(m.params,T.keys.filter(B=>!B.optional).concat(T.parent?T.parent.keys.filter(B=>B.optional):[]).map(B=>B.name)),f.params&&Fc(f.params,T.keys.map(B=>B.name))),P=T.stringify(U)}else if(f.path!=null)P=f.path,T=n.find(B=>B.re.test(P)),T&&(U=T.parse(P),F=T.record.name);else{if(T=m.name?r.get(m.name):n.find(B=>B.re.test(m.path)),!T)throw bs(Ot.MATCHER_NOT_FOUND,{location:f,currentLocation:m});F=T.record.name,U=ht({},m.params,f.params),P=T.stringify(U)}const R=[];let A=T;for(;A;)R.unshift(A.record),A=A.parent;return{name:F,path:P,params:U,matched:R,meta:ev(R)}}e.forEach(f=>o(f));function c(){n.length=0,r.clear()}return{addRoute:o,resolve:u,removeRoute:i,clearRoutes:c,getRoutes:a,getRecordMatcher:s}}function Fc(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Bc(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Zg(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 Zg(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 Hc(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function ev(e){return e.reduce((t,n)=>ht(t,n.meta),{})}function tv(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;Ef(e,t[o])<0?r=o:n=o+1}const s=nv(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function nv(e){let t=e;for(;t=t.parent;)if(Cf(t)&&Ef(e,t)===0)return t}function Cf({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Wc(e){const t=Rn(ki),n=Rn(kl),r=fe(()=>{const l=ye(e.to);return t.resolve(l)}),s=fe(()=>{const{matched:l}=r.value,{length:u}=l,c=l[u-1],f=n.matched;if(!c||!f.length)return-1;const m=f.findIndex(ws.bind(null,c));if(m>-1)return m;const T=Vc(l[u-2]);return u>1&&Vc(c)===T&&f[f.length-1].path!==T?f.findIndex(ws.bind(null,l[u-2])):m}),o=fe(()=>s.value>-1&&av(n.params,r.value.params)),i=fe(()=>s.value>-1&&s.value===n.matched.length-1&&kf(n.params,r.value.params));function a(l={}){if(iv(l)){const u=t[ye(e.replace)?"replace":"push"](ye(e.to)).catch(qs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:r,href:fe(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function rv(e){return e.length===1?e[0]:e}const sv=Ht({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:Wc,setup(e,{slots:t}){const n=hi(Wc(e)),{options:r}=Rn(ki),s=fe(()=>({[Gc(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Gc(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&rv(t.default(n));return e.custom?o:bl("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),ov=sv;function iv(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 av(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!On(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function Vc(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Gc=(e,t,n)=>e??t??n,lv=Ht({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Rn(Ua),s=fe(()=>e.route||r.value),o=Rn(Dc,0),i=fe(()=>{let u=ye(o);const{matched:c}=s.value;let f;for(;(f=c[u])&&!f.components;)u++;return u}),a=fe(()=>s.value.matched[i.value]);Do(Dc,fe(()=>i.value+1)),Do(Dg,a),Do(Ua,s);const l=D();return ut(()=>[l.value,a.value,e.name],([u,c,f],[m,T,U])=>{c&&(c.instances[f]=u,T&&T!==c&&u&&u===m&&(c.leaveGuards.size||(c.leaveGuards=T.leaveGuards),c.updateGuards.size||(c.updateGuards=T.updateGuards))),u&&c&&(!T||!ws(c,T)||!m)&&(c.enterCallbacks[f]||[]).forEach(P=>P(u))},{flush:"post"}),()=>{const u=s.value,c=e.name,f=a.value,m=f&&f.components[c];if(!m)return zc(n.default,{Component:m,route:u});const T=f.props[c],U=T?T===!0?u.params:typeof T=="function"?T(u):T:null,F=bl(m,ht({},U,t,{onVnodeUnmounted:R=>{R.component.isUnmounted&&(f.instances[c]=null)},ref:l}));return zc(n.default,{Component:F,route:u})||F}}});function zc(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const cv=lv;function uv(e){const t=Qg(e.routes,e),n=e.parseQuery||Og,r=e.stringifyQuery||Nc,s=e.history,o=Ds(),i=Ds(),a=Ds(),l=cp(_r);let u=_r;ls&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=ea.bind(null,K=>""+K),f=ea.bind(null,vg),m=ea.bind(null,oo);function T(K,he){let ue,be;return Tf(K)?(ue=t.getRecordMatcher(K),be=he):be=K,t.addRoute(be,ue)}function U(K){const he=t.getRecordMatcher(K);he&&t.removeRoute(he)}function P(){return t.getRoutes().map(K=>K.record)}function F(K){return!!t.getRecordMatcher(K)}function R(K,he){if(he=ht({},he||l.value),typeof K=="string"){const M=ta(n,K,he.path),q=t.resolve({path:M.path},he),G=s.createHref(M.fullPath);return ht(M,q,{params:m(q.params),hash:oo(M.hash),redirectedFrom:void 0,href:G})}let ue;if(K.path!=null)ue=ht({},K,{path:ta(n,K.path,he.path).path});else{const M=ht({},K.params);for(const q in M)M[q]==null&&delete M[q];ue=ht({},K,{params:f(M)}),he.params=f(he.params)}const be=t.resolve(ue,he),$e=K.hash||"";be.params=c(m(be.params));const g=bg(r,ht({},K,{hash:pg($e),path:be.path})),b=s.createHref(g);return ht({fullPath:g,hash:$e,query:r===Nc?Ng(K.query):K.query||{}},be,{redirectedFrom:void 0,href:b})}function A(K){return typeof K=="string"?ta(n,K,l.value.path):ht({},K)}function B(K,he){if(u!==K)return bs(Ot.NAVIGATION_CANCELLED,{from:he,to:K})}function W(K){return ve(K)}function ce(K){return W(ht(A(K),{replace:!0}))}function me(K,he){const ue=K.matched[K.matched.length-1];if(ue&&ue.redirect){const{redirect:be}=ue;let $e=typeof be=="function"?be(K,he):be;return typeof $e=="string"&&($e=$e.includes("?")||$e.includes("#")?$e=A($e):{path:$e},$e.params={}),ht({query:K.query,hash:K.hash,params:$e.path!=null?{}:K.params},$e)}}function ve(K,he){const ue=u=R(K),be=l.value,$e=K.state,g=K.force,b=K.replace===!0,M=me(ue,be);if(M)return ve(ht(A(M),{state:typeof M=="object"?ht({},$e,M.state):$e,force:g,replace:b}),he||ue);const q=ue;q.redirectedFrom=he;let G;return!g&&_g(r,be,ue)&&(G=bs(Ot.NAVIGATION_DUPLICATED,{to:q,from:be}),Ne(be,be,!0,!1)),(G?Promise.resolve(G):le(q,be)).catch(N=>Qn(N)?Qn(N,Ot.NAVIGATION_GUARD_REDIRECT)?N:Ze(N):Ee(N,q,be)).then(N=>{if(N){if(Qn(N,Ot.NAVIGATION_GUARD_REDIRECT))return ve(ht({replace:b},A(N.to),{state:typeof N.to=="object"?ht({},$e,N.to.state):$e,force:g}),he||q)}else N=Y(q,be,!0,b,$e);return we(q,be,N),N})}function Ie(K,he){const ue=B(K,he);return ue?Promise.reject(ue):Promise.resolve()}function re(K){const he=at.values().next().value;return he&&typeof he.runWithContext=="function"?he.runWithContext(K):K()}function le(K,he){let ue;const[be,$e,g]=Lg(K,he);ue=ra(be.reverse(),"beforeRouteLeave",K,he);for(const M of be)M.leaveGuards.forEach(q=>{ue.push(Ir(q,K,he))});const b=Ie.bind(null,K,he);return ue.push(b),Xe(ue).then(()=>{ue=[];for(const M of o.list())ue.push(Ir(M,K,he));return ue.push(b),Xe(ue)}).then(()=>{ue=ra($e,"beforeRouteUpdate",K,he);for(const M of $e)M.updateGuards.forEach(q=>{ue.push(Ir(q,K,he))});return ue.push(b),Xe(ue)}).then(()=>{ue=[];for(const M of g)if(M.beforeEnter)if(On(M.beforeEnter))for(const q of M.beforeEnter)ue.push(Ir(q,K,he));else ue.push(Ir(M.beforeEnter,K,he));return ue.push(b),Xe(ue)}).then(()=>(K.matched.forEach(M=>M.enterCallbacks={}),ue=ra(g,"beforeRouteEnter",K,he,re),ue.push(b),Xe(ue))).then(()=>{ue=[];for(const M of i.list())ue.push(Ir(M,K,he));return ue.push(b),Xe(ue)}).catch(M=>Qn(M,Ot.NAVIGATION_CANCELLED)?M:Promise.reject(M))}function we(K,he,ue){a.list().forEach(be=>re(()=>be(K,he,ue)))}function Y(K,he,ue,be,$e){const g=B(K,he);if(g)return g;const b=he===_r,M=ls?history.state:{};ue&&(be||b?s.replace(K.fullPath,ht({scroll:b&&M&&M.scroll},$e)):s.push(K.fullPath,$e)),l.value=K,Ne(K,he,ue,b),Ze()}let Te;function xe(){Te||(Te=s.listen((K,he,ue)=>{if(!et.listening)return;const be=R(K),$e=me(be,et.currentRoute.value);if($e){ve(ht($e,{replace:!0,force:!0}),be).catch(qs);return}u=be;const g=l.value;ls&&Rg(Oc(g.fullPath,ue.delta),_i()),le(be,g).catch(b=>Qn(b,Ot.NAVIGATION_ABORTED|Ot.NAVIGATION_CANCELLED)?b:Qn(b,Ot.NAVIGATION_GUARD_REDIRECT)?(ve(ht(A(b.to),{force:!0}),be).then(M=>{Qn(M,Ot.NAVIGATION_ABORTED|Ot.NAVIGATION_DUPLICATED)&&!ue.delta&&ue.type===La.pop&&s.go(-1,!1)}).catch(qs),Promise.reject()):(ue.delta&&s.go(-ue.delta,!1),Ee(b,be,g))).then(b=>{b=b||Y(be,g,!1),b&&(ue.delta&&!Qn(b,Ot.NAVIGATION_CANCELLED)?s.go(-ue.delta,!1):ue.type===La.pop&&Qn(b,Ot.NAVIGATION_ABORTED|Ot.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),we(be,g,b)}).catch(qs)}))}let Le=Ds(),Pe=Ds(),Oe;function Ee(K,he,ue){Ze(K);const be=Pe.list();return be.length?be.forEach($e=>$e(K,he,ue)):console.error(K),Promise.reject(K)}function Ye(){return Oe&&l.value!==_r?Promise.resolve():new Promise((K,he)=>{Le.add([K,he])})}function Ze(K){return Oe||(Oe=!K,xe(),Le.list().forEach(([he,ue])=>K?ue(K):he()),Le.reset()),K}function Ne(K,he,ue,be){const{scrollBehavior:$e}=e;if(!ls||!$e)return Promise.resolve();const g=!ue&&Pg(Oc(K.fullPath,0))||(be||!ue)&&history.state&&history.state.scroll||null;return Yt().then(()=>$e(K,he,g)).then(b=>b&&Ag(b)).catch(b=>Ee(b,K,he))}const nt=K=>s.go(K);let gt;const at=new Set,et={currentRoute:l,listening:!0,addRoute:T,removeRoute:U,clearRoutes:t.clearRoutes,hasRoute:F,getRoutes:P,resolve:R,options:e,push:W,replace:ce,go:nt,back:()=>nt(-1),forward:()=>nt(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Pe.add,isReady:Ye,install(K){K.component("RouterLink",ov),K.component("RouterView",cv),K.config.globalProperties.$router=et,Object.defineProperty(K.config.globalProperties,"$route",{enumerable:!0,get:()=>ye(l)}),ls&&!gt&&l.value===_r&&(gt=!0,W(s.location).catch(be=>{}));const he={};for(const be in _r)Object.defineProperty(he,be,{get:()=>l.value[be],enumerable:!0});K.provide(ki,et),K.provide(kl,kd(he)),K.provide(Ua,l);const ue=K.unmount;at.add(K),K.unmount=function(){at.delete(K),at.size<1&&(u=_r,Te&&Te(),Te=null,l.value=_r,gt=!1,Oe=!1),ue()}}};function Xe(K){return K.reduce((he,ue)=>he.then(()=>re(ue)),Promise.resolve())}return et}function dv(){return Rn(ki)}function fv(e){return Rn(kl)}const qc=768;function Af(){const e=D(typeof window<"u"?window.innerWidth<qc:!1);let t=null;function n(r){e.value=r.matches}return pr(()=>{t=window.matchMedia(`(max-width: ${qc-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),vi(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const hv={key:0,class:"desktop-sidebar"},pv={class:"desktop-main"},Kc="codex-web-local.sidebar-width.v1",mv=260,gv=620,Jc=320,vv=Ht({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Af();function r(u){return Math.min(gv,Math.max(mv,u))}function s(){if(typeof window>"u")return Jc;const u=window.localStorage.getItem(Kc),c=Number(u);return Number.isFinite(c)?r(c):Jc}const o=D(s()),i=fe(()=>n.value||t.isSidebarCollapsed?{"--sidebar-width":"0px","--layout-columns":"minmax(0, 1fr)"}:{"--sidebar-width":`${o.value}px`,"--layout-columns":"var(--sidebar-width) 1px minmax(0, 1fr)"});function a(u){typeof window>"u"||window.localStorage.setItem(Kc,String(u))}function l(u){u.preventDefault();const c=u.clientX,f=o.value,m=U=>{const P=U.clientX-c;o.value=r(f+P)},T=()=>{a(o.value),window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",T)};window.addEventListener("mousemove",m),window.addEventListener("mouseup",T)}return(u,c)=>(w(),k("div",{class:it(["desktop-layout",{"is-mobile":ye(n)}]),style:Jr(i.value)},[ye(n)?(w(),ft(Ko,{key:0,to:"body"},[Re(mf,{name:"drawer"},{default:_t(()=>[e.isSidebarCollapsed?ae("",!0):(w(),k("div",{key:0,class:"mobile-drawer-backdrop",onClick:c[1]||(c[1]=f=>u.$emit("close-sidebar"))},[p("aside",{class:"mobile-drawer",onClick:c[0]||(c[0]=ct(()=>{},["stop"]))},[Gn(u.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):ae("",!0),ye(n)?ae("",!0):(w(),k(Fe,{key:1},[e.isSidebarCollapsed?ae("",!0):(w(),k("aside",hv,[Gn(u.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?ae("",!0):(w(),k("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),p("section",pv,[Gn(u.$slots,"content",{},void 0)])],6))}}),st=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},yv=st(vv,[["__scopeId","data-v-df29c633"]]),wv={},bv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function _v(e,t){return w(),k("svg",bv,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const Ti=st(wv,[["render",_v]]),kv={},Tv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Sv(e,t){return w(),k("svg",Tv,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const Rf=st(kv,[["render",Sv]]),Iv={},Ev={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Cv(e,t){return w(),k("svg",Ev,[...t[0]||(t[0]=[p("path",{fill:"currentColor",d:"M6 12a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4"},null,-1)])])}const Ls=st(Iv,[["render",Cv]]),Av={},Rv={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function Pv(e,t){return w(),k("svg",Rv,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 20h4L18.5 9.5a2.828 2.828 0 1 0-4-4L4 16zm9.5-13.5l4 4"},null,-1)])])}const ei=st(Av,[["render",Pv]]),xv={},Mv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function $v(e,t){return w(),k("svg",Mv,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2"},null,-1)])])}const Tl=st(xv,[["render",$v]]),Ov={},Nv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Dv(e,t){return w(),k("svg",Nv,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m5 19l2.757-7.351A1 1 0 0 1 8.693 11H21a1 1 0 0 1 .986 1.164l-.996 5.211A2 2 0 0 1 19.026 19za2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2"},null,-1)])])}const Lv=st(Ov,[["render",Dv]]),jv={},Uv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Fv(e,t){return w(),k("svg",Uv,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 18v-6m0 0a4 4 0 0 1 4-4h2m-6 4a4 4 0 0 0-4-4H6m0-4a2 2 0 1 0 0 4a2 2 0 0 0 0-4m12 0a2 2 0 1 0 0 4a2 2 0 0 0 0-4m-6 14a2 2 0 1 0 0 4a2 2 0 0 0 0-4"},null,-1)])])}const Fo=st(jv,[["render",Fv]]),Bv={},Hv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Wv(e,t){return w(),k("svg",Hv,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 4.5l-4 4L7 10l-1.5 1.5l7 7L14 17l1.5-4l4-4M9 15l-4.5 4.5M14.5 4L20 9.5"},null,-1)])])}const sa=st(Bv,[["render",Wv]]),Vv={key:0,class:"sidebar-menu-row-left"},Gv={class:"sidebar-menu-row-main"},zv={key:1,class:"sidebar-menu-row-right"},qv={key:0,class:"sidebar-menu-row-right-default"},Kv={key:1,class:"sidebar-menu-row-right-hover"},Jv=Ht({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=Up(),r=fe(()=>!!n.left),s=fe(()=>!!n.right),o=fe(()=>!!n["right-hover"]),i=fe(()=>s.value||o.value);return(a,l)=>(w(),ft(Yo(t.as),cf({class:"sidebar-menu-row","data-has-left":r.value,"data-has-right":i.value,"data-has-right-hover":o.value,"data-force-right-hover":t.forceRightHover},a.$attrs),{default:_t(()=>[r.value?(w(),k("span",Vv,[Gn(a.$slots,"left",{},void 0,!0)])):ae("",!0),p("span",Gv,[Gn(a.$slots,"default",{},void 0,!0)]),i.value?(w(),k("span",zv,[s.value?(w(),k("span",qv,[Gn(a.$slots,"right",{},void 0,!0)])):ae("",!0),o.value?(w(),k("span",Kv,[Gn(a.$slots,"right-hover",{},void 0,!0)])):ae("",!0)])):ae("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),Ur=st(Jv,[["__scopeId","data-v-daeca4df"]]),Yv={class:"thread-tree-root"},Xv={key:0,class:"pinned-section"},Qv={class:"thread-list"},Zv={class:"thread-left-stack"},ey=["data-state"],ty=["onClick"],ny=["onClick"],ry={class:"thread-row-title-wrap"},sy={class:"thread-row-title"},oy={class:"thread-row-time"},iy=["onClick"],ay=["onClick"],ly=["onClick"],cy=["onClick"],uy=["aria-expanded"],dy=["data-active"],fy={key:0},hy=["data-active"],py={key:0},my={key:1,class:"thread-tree-no-results"},gy={key:2,class:"thread-tree-loading"},vy={key:3,class:"thread-list thread-list-global"},yy={class:"thread-left-stack"},wy=["data-state"],by=["onClick"],_y=["onClick"],ky={class:"thread-row-title-wrap"},Ty={class:"thread-row-title"},Sy={class:"thread-row-time"},Iy=["onClick"],Ey=["onClick"],Cy=["onClick"],Ay=["onClick"],Ry=["data-project-name","data-expanded","data-dragging"],Py={class:"project-icon-stack"},xy={class:"project-icon-folder"},My={class:"project-icon-chevron"},$y=["data-dragging-handle","onMousedown"],Oy={class:"project-title"},Ny={class:"project-hover-controls"},Dy=["onClick"],Ly=["onClick"],jy=["onClick"],Uy=["onClick"],Fy=["onInput"],By=["aria-label","title","onClick"],Hy={key:0,class:"thread-list"},Wy={class:"thread-left-stack"},Vy=["data-state"],Gy=["onClick"],zy=["onClick"],qy={class:"thread-row-title-wrap"},Ky={class:"thread-row-title"},Jy={class:"thread-row-time"},Yy=["onClick"],Xy=["onClick"],Qy=["onClick"],Zy=["onClick"],ew=["onClick"],tw={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},nw=["onKeydown"],rw={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},sw={class:"rename-thread-subtitle"},ow=4,Yc=6,Xc="codex-web-local.thread-view-mode.v1",Qc="codex-web-local.collapsed-projects.v1",iw=Ht({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-project-files","rename-project","rename-thread","remove-project","reorder-project","export-thread"],setup(e,{emit:t}){const n=e,r=t,s=D({}),o=D({}),i=D([]),a=D(""),l=D(""),u=D("actions"),c=D(""),f=D(!1),m=D(""),T=D(""),U=D(null),P=D(!1),F=D(""),R=D(""),A=D(null),B=D(null),W=D(null);let ce=null,me=null;const ve=D(""),Ie=D({}),re=new Map,le=new Map,we=new Map,Y=new WeakMap,Te=D(null),xe=D(!1),Le=D(Ee()),Pe=typeof window<"u"?new ResizeObserver(I=>{for(const $ of I){const L=$.target,ee=Y.get(L);ee&&O(ee,L)}}):null;function Oe(){if(typeof window>"u")return{};try{const I=window.localStorage.getItem(Qc);if(!I)return{};const $=JSON.parse(I);return!$||typeof $!="object"||Array.isArray($)?{}:$}catch{return{}}}function Ee(){return typeof window>"u"?"project":window.localStorage.getItem(Xc)==="chronological"?"chronological":"project"}o.value=Oe(),ut(o,I=>{typeof window>"u"||window.localStorage.setItem(Qc,JSON.stringify(I))},{deep:!0}),ut(Le,I=>{typeof window>"u"||window.localStorage.setItem(Xc,I)});const Ye=fe(()=>n.searchQuery.trim().toLowerCase()),Ze=fe(()=>Ye.value.length>0),Ne=fe(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function nt(I){if(!Ze.value)return!0;if(Ne.value)return Ne.value.has(I.id);const $=Ye.value;return I.title.toLowerCase().includes($)||I.preview.toLowerCase().includes($)}const gt=fe(()=>Ze.value?n.groups.map(I=>({...I,threads:I.threads.filter(nt)})).filter(I=>I.threads.length>0):n.groups),at=fe(()=>Le.value==="chronological"),et=fe(()=>{const I=gt.value,$=[];for(const L of I)for(const ee of L.threads)b(ee.id)||$.push(ee);return $.sort((L,ee)=>{const Ge=new Date(L.updatedAtIso||L.createdAtIso).getTime();return new Date(ee.updatedAtIso||ee.createdAtIso).getTime()-Ge})}),Xe=fe(()=>{const I=new Map;for(const $ of n.groups)for(const L of $.threads)I.set(L.id,L);return I}),K=fe(()=>i.value.map(I=>Xe.value.get(I)??null).filter(I=>I!==null).filter(nt)),he=fe(()=>{const I=W.value;if(!I||I.dropTargetIndexFull===null||n.groups.length===0)return null;const $=Math.max(0,Math.min(I.dropTargetIndexFull,n.groups.length)),L=$>I.fromIndex?$-1:$,ee=Math.max(0,Math.min(L,n.groups.length-1));return ee===I.fromIndex?null:ee}),ue=fe(()=>{const $=(Ze.value?gt.value:n.groups).map(gn=>gn.projectName),L=W.value,ee=he.value;if(!L||ee===null)return $;const Ge=[...$],[Ut]=Ge.splice(L.fromIndex,1);return Ut?(Ge.splice(ee,0,Ut),Ge):$}),be=fe(()=>{const I={};let $=0;for(const L of ue.value)I[L]=$,$+=It(L);return I}),$e=fe(()=>{let I=0;for(const $ of ue.value)I+=It($);return{height:`${Math.max(0,I)}px`}});function g(I){const $=new Date(I).getTime();if(Number.isNaN($))return"n/a";const L=Math.abs(Date.now()-$);if(L<6e4)return"now";const ee=Math.floor(L/6e4);if(ee<60)return`${ee}m`;const Ge=Math.floor(ee/60);return Ge<24?`${Ge}h`:`${Math.floor(Ge/24)}d`}function b(I){return i.value.includes(I)}function M(I){if(b(I)){i.value=i.value.filter($=>$!==I);return}i.value=[I,...i.value]}function q(I){r("select",I)}function G(I){r("export-thread",I),z()}function N(I){return`start new thread ${ot(I)}`}function V(I){r("start-new-thread",I)}function J(I){l.value===I&&z()}function Q(I){return l.value===I}function z(){l.value=""}function _e(I){if(l.value===I){z();return}l.value=I}function de(I,$){m.value=I,T.value=$,f.value=!0,z(),Yt(()=>{var L,ee;(L=U.value)==null||L.focus(),(ee=U.value)==null||ee.select()})}function Se(){f.value=!1,m.value="",T.value=""}function Me(){const I=m.value,$=T.value.trim();!I||!$||(r("rename-thread",{threadId:I,title:$}),Se())}function De(I,$){F.value=I,R.value=$,P.value=!0,z()}function Be(){P.value=!1,F.value="",R.value=""}function He(){const I=F.value;I&&(i.value=i.value.filter($=>$!==I),r("archive",I),Be())}function ot(I){return n.projectDisplayNameById[I]??I}function tt(I){return a.value===I}function vt(){a.value="",u.value="actions",c.value=""}function yt(){xe.value=!xe.value}function jt(I){Le.value=I,xe.value=!1}function zt(I){if(a.value===I){vt();return}a.value=I,u.value="actions",c.value=ot(I)}function kt(I){a.value=I,u.value="rename",c.value=ot(I)}function Rt(I){r("rename-project",{projectName:I,displayName:c.value})}function wt(I){r("remove-project",I),vt()}function Dt(I){r("browse-project-files",I),vt()}function Qt(I,$){if(!I.altKey||I.key!=="ArrowUp"&&I.key!=="ArrowDown")return;const L=n.groups.findIndex(Ut=>Ut.projectName===$);if(L<0)return;const ee=I.key==="ArrowUp"?-1:1,Ge=Math.max(0,Math.min(L+ee,n.groups.length-1));Ge!==L&&(I.preventDefault(),r("reorder-project",{projectName:$,toIndex:Ge}))}function qt(I){return s.value[I]===!0}function xt(I){return o.value[I]===!0}function Tt(I){s.value={...s.value,[I]:!qt(I)}}function Kt(I){if(ve.value===I){ve.value="";return}o.value={...o.value,[I]:!xt(I)}}function It(I){const $=Ie.value[I]??0,L=W.value,Ge=((L==null?void 0:L.projectName)===I?L.groupHeight:null)??$,Ut=xt(I)?0:Yc;return Math.max(0,Ge+Ut)}function bt(I,$){const L=$ instanceof HTMLElement?$:$&&"$el"in $&&$.$el instanceof HTMLElement?$.$el:null;if(L){le.set(I,L);return}le.delete(I)}function Jt(I,$){const L=$ instanceof HTMLElement?$:$&&"$el"in $&&$.$el instanceof HTMLElement?$.$el:null;if(L){we.set(I,L);return}we.delete(I)}function yn(I){const $=a.value;if(!$)return!1;const L=le.get($);if(!L)return!1;if((typeof I.composedPath=="function"?I.composedPath():[]).includes(L))return!0;const Ge=I.target;return Ge instanceof Node?L.contains(Ge):!1}function $t(I){const $=l.value;if(!$)return!1;const L=we.get($);if(!L)return!1;if((typeof I.composedPath=="function"?I.composedPath():[]).includes(L))return!0;const Ge=I.target;return Ge instanceof Node?L.contains(Ge):!1}function Wt(I){if(xe.value){const $=Te.value,L=typeof I.composedPath=="function"?I.composedPath():[];!!$&&(L.includes($)||I.target instanceof Node&&$.contains(I.target))||(xe.value=!1)}a.value&&(yn(I)||vt(),l.value&&($t(I)||z()))}function wn(I){a.value&&!yn(I)&&vt(),l.value&&!$t(I)&&z()}function _(){xe.value&&(xe.value=!1),a.value&&vt(),l.value&&z()}function S(){window.addEventListener("pointerdown",Wt,{capture:!0}),window.addEventListener("focusin",wn,{capture:!0}),window.addEventListener("blur",_)}function E(){window.removeEventListener("pointerdown",Wt,{capture:!0}),window.removeEventListener("focusin",wn,{capture:!0}),window.removeEventListener("blur",_)}function O(I,$){const L=$.getBoundingClientRect().height;if(!Number.isFinite(L)||L<=0)return;const ee=Ie.value[I];ee!==void 0&&Math.abs(ee-L)<.5||(Ie.value={...Ie.value,[I]:L})}function H(I,$){const L=re.get(I);L&&L!==$&&Pe&&Pe.unobserve(L);const ee=$ instanceof HTMLElement?$:$&&"$el"in $&&$.$el instanceof HTMLElement?$.$el:null;if(ee){re.set(I,ee),Y.set(ee,I),O(I,ee),Pe==null||Pe.observe(ee);return}L&&(Pe==null||Pe.unobserve(L)),re.delete(I)}function ie(I,$){if(I.button!==0||B.value||W.value)return;const L=n.groups.findIndex(gn=>gn.projectName===$),ee=re.get($);if(L<0||!ee)return;const Ge=ee.getBoundingClientRect(),Ut=xt($)?0:Yc;B.value={projectName:$,fromIndex:L,startClientX:I.clientX,startClientY:I.clientY,pointerOffsetY:I.clientY-Ge.top,groupLeft:Ge.left,groupWidth:Ge.width,groupHeight:Ge.height,groupOuterHeight:Ge.height+Ut},I.preventDefault(),Ce()}function Ce(){window.addEventListener("mousemove",Ke),window.addEventListener("mouseup",lt),window.addEventListener("keydown",rt)}function ge(){window.removeEventListener("mousemove",Ke),window.removeEventListener("mouseup",lt),window.removeEventListener("keydown",rt)}function Ke(I){ce={clientX:I.clientX,clientY:I.clientY},mn()}function lt(I){Nn({clientX:I.clientX,clientY:I.clientY});const $=W.value;if($&&he.value!==null){const L=n.groups.findIndex(ee=>ee.projectName===$.projectName);if(L>=0){const ee=he.value;ee!==L&&r("reorder-project",{projectName:$.projectName,toIndex:ee})}}Nt()}function rt(I){I.key==="Escape"&&(!B.value&&!W.value||(I.preventDefault(),Nt()))}function Nt(){me!==null&&(window.cancelAnimationFrame(me),me=null),ce=null,B.value=null,W.value=null,ve.value="",ge()}function mn(){me===null&&(me=window.requestAnimationFrame(()=>{if(me=null,!ce)return;const I=ce;ce=null,Nn(I)}))}function Nn(I){const $=B.value;if(!W.value&&$){const L=I.clientX-$.startClientX,ee=I.clientY-$.startClientY;if(Math.hypot(L,ee)<ow)return;vt(),ve.value=$.projectName,W.value={projectName:$.projectName,fromIndex:$.fromIndex,pointerOffsetY:$.pointerOffsetY,groupLeft:$.groupLeft,groupWidth:$.groupWidth,groupHeight:$.groupHeight,groupOuterHeight:$.groupOuterHeight,ghostTop:I.clientY-$.pointerOffsetY,dropTargetIndexFull:null}}W.value&&j(I)}function j(I){const $=W.value;if(!$)return;if($.ghostTop=I.clientY-$.pointerOffsetY,!X(I)){$.dropTargetIndexFull=null;return}const L=I.clientY,ee=A.value;if(!ee){$.dropTargetIndexFull=null;return}const Ge=ee.getBoundingClientRect(),Ut=new Map(n.groups.map((kn,vr)=>[kn.projectName,vr])),gn=n.groups.map(kn=>kn.projectName).filter(kn=>kn!==$.projectName);let Xr=0,gr=n.groups.length;for(const kn of gn){const vr=Ut.get(kn);if(vr===void 0)continue;const Qr=It(kn),Cs=Ge.top+Xr+Qr/2;if(L<Cs){gr=vr;break}Xr+=Qr}$.dropTargetIndexFull=gr}function X(I){const $=A.value;if(!$)return!1;const L=$.getBoundingClientRect(),ee=I.clientX>=L.left&&I.clientX<=L.right,Ge=I.clientY>=L.top-32&&I.clientY<=L.bottom+32;return ee&&Ge}function se(I){var $;return(($=W.value)==null?void 0:$.projectName)===I}function qe(I){const $=W.value,L=be.value[I]??0,ee=a.value===I;return!$||$.projectName!==I?{position:"absolute",top:"0",left:"0",right:"0",zIndex:ee?"40":"1",transform:`translate3d(0, ${L}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${$.groupLeft}px`,width:`${$.groupWidth}px`,height:`${$.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${$.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function Pt(I){return I.threads.filter($=>!b($.id))}function bn(I){if(Ze.value)return Pt(I);if(xt(I.projectName))return[];const $=Pt(I);return qt(I.projectName)?$:$.slice(0,10)}function _n(I){return Ze.value?!1:!xt(I.projectName)&&Pt(I).length>10}function an(I){return Pt(I).length>0}function Vt(I){return I.inProgress?"working":I.unread?"unread":"idle"}ut(()=>n.groups.map(I=>I.projectName),I=>{var Ge,Ut;const $=((Ge=W.value)==null?void 0:Ge.projectName)??((Ut=B.value)==null?void 0:Ut.projectName)??"";$&&!n.groups.some(gn=>gn.projectName===$)&&Nt();const L=new Set(I),ee=Object.fromEntries(Object.entries(Ie.value).filter(([gn])=>L.has(gn)));Object.keys(ee).length!==Object.keys(Ie.value).length&&(Ie.value=ee)});const Dn=fe(()=>xe.value||a.value!=="");return ut(Dn,I=>{if(I){S();return}E()}),mr(()=>{for(const I of re.values())Pe==null||Pe.unobserve(I);re.clear(),le.clear(),E(),Nt()}),(I,$)=>(w(),k("section",Yv,[K.value.length>0?(w(),k("section",Xv,[p("ul",Qv,[(w(!0),k(Fe,null,St(K.value,L=>(w(),k("li",{key:L.id,class:"thread-row-item"},[Re(Ur,{class:"thread-row","data-active":L.id===e.selectedThreadId,"data-pinned":b(L.id),onMouseleave:ee=>J(L.id)},{left:_t(()=>[p("span",Zv,[L.inProgress||L.unread?(w(),k("span",{key:0,class:"thread-status-indicator","data-state":Vt(L)},null,8,ey)):ae("",!0),p("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:ee=>M(L.id)},[Re(sa,{class:"thread-icon"})],8,ty)])]),right:_t(()=>[p("span",oy,oe(g(L.createdAtIso||L.updatedAtIso)),1)]),"right-hover":_t(()=>[p("div",{ref_for:!0,ref:ee=>Jt(L.id,ee),class:"thread-menu-wrap"},[p("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ct(ee=>_e(L.id),["stop"])},[Re(Ls,{class:"thread-icon"})],8,iy),Q(L.id)?(w(),k("div",{key:0,class:"thread-menu-panel",onClick:$[0]||($[0]=ct(()=>{},["stop"]))},[p("button",{class:"thread-menu-item",type:"button",onClick:ee=>G(L.id)}," Export chat ",8,ay),p("button",{class:"thread-menu-item",type:"button",onClick:ee=>de(L.id,L.title)}," Rename thread ",8,ly),p("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:ee=>De(L.id,L.title)}," Delete thread ",8,cy)])):ae("",!0)],512)]),default:_t(()=>[p("button",{class:"thread-main-button",type:"button",onClick:ee=>q(L.id)},[p("span",ry,[p("span",sy,oe(L.title),1),L.hasWorktree?(w(),ft(Fo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ae("",!0)])],8,ny)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):ae("",!0),Re(Ur,{as:"header",class:"thread-tree-header-row"},{right:_t(()=>[p("div",{ref_key:"organizeMenuWrapRef",ref:Te,class:"organize-menu-wrap"},[p("button",{class:"organize-menu-trigger",type:"button","aria-expanded":xe.value,"aria-label":"Organize threads",title:"Organize threads",onClick:yt},[Re(Ls,{class:"thread-icon"})],8,uy),xe.value?(w(),k("div",{key:0,class:"organize-menu-panel",onClick:$[3]||($[3]=ct(()=>{},["stop"]))},[$[11]||($[11]=p("p",{class:"organize-menu-title"},"Organize",-1)),p("button",{class:"organize-menu-item","data-active":Le.value==="project",type:"button",onClick:$[1]||($[1]=L=>jt("project"))},[$[9]||($[9]=p("span",null,"By project",-1)),Le.value==="project"?(w(),k("span",fy,"✓")):ae("",!0)],8,dy),p("button",{class:"organize-menu-item","data-active":Le.value==="chronological",type:"button",onClick:$[2]||($[2]=L=>jt("chronological"))},[$[10]||($[10]=p("span",null,"Chronological list",-1)),Le.value==="chronological"?(w(),k("span",py,"✓")):ae("",!0)],8,hy)])):ae("",!0)],512)]),default:_t(()=>[$[12]||($[12]=p("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),Ze.value&&gt.value.length===0?(w(),k("p",my,"No matching threads")):e.isLoading&&e.groups.length===0?(w(),k("p",gy,"Loading threads...")):at.value?(w(),k("ul",vy,[(w(!0),k(Fe,null,St(et.value,L=>(w(),k("li",{key:L.id,class:"thread-row-item"},[Re(Ur,{class:"thread-row","data-active":L.id===e.selectedThreadId,"data-pinned":b(L.id),onMouseleave:ee=>J(L.id)},{left:_t(()=>[p("span",yy,[L.inProgress||L.unread?(w(),k("span",{key:0,class:"thread-status-indicator","data-state":Vt(L)},null,8,wy)):ae("",!0),p("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:ee=>M(L.id)},[Re(sa,{class:"thread-icon"})],8,by)])]),right:_t(()=>[p("span",Sy,oe(g(L.createdAtIso||L.updatedAtIso)),1)]),"right-hover":_t(()=>[p("div",{ref_for:!0,ref:ee=>Jt(L.id,ee),class:"thread-menu-wrap"},[p("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ct(ee=>_e(L.id),["stop"])},[Re(Ls,{class:"thread-icon"})],8,Iy),Q(L.id)?(w(),k("div",{key:0,class:"thread-menu-panel",onClick:$[4]||($[4]=ct(()=>{},["stop"]))},[p("button",{class:"thread-menu-item",type:"button",onClick:ee=>G(L.id)}," Export chat ",8,Ey),p("button",{class:"thread-menu-item",type:"button",onClick:ee=>de(L.id,L.title)}," Rename thread ",8,Cy),p("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:ee=>De(L.id,L.title)}," Delete thread ",8,Ay)])):ae("",!0)],512)]),default:_t(()=>[p("button",{class:"thread-main-button",type:"button",onClick:ee=>q(L.id)},[p("span",ky,[p("span",Ty,oe(L.title),1),L.hasWorktree?(w(),ft(Fo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ae("",!0)])],8,_y)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),k("div",{key:4,ref_key:"groupsContainerRef",ref:A,class:"thread-tree-groups",style:Jr($e.value)},[(w(!0),k(Fe,null,St(gt.value,L=>(w(),k("article",{key:L.projectName,ref_for:!0,ref:ee=>H(L.projectName,ee),class:"project-group","data-project-name":L.projectName,"data-expanded":!xt(L.projectName),"data-dragging":se(L.projectName),style:Jr(qe(L.projectName))},[Re(Ur,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:ee=>Kt(L.projectName),onKeydown:[ee=>Qt(ee,L.projectName),dn(ct(ee=>Kt(L.projectName),["prevent"]),["enter"]),dn(ct(ee=>Kt(L.projectName),["prevent"]),["space"])]},{left:_t(()=>[p("span",Py,[p("span",xy,[xt(L.projectName)?(w(),ft(Tl,{key:0,class:"thread-icon"})):(w(),ft(Lv,{key:1,class:"thread-icon"}))]),p("span",My,[xt(L.projectName)?(w(),ft(Rf,{key:0,class:"thread-icon"})):(w(),ft(Ti,{key:1,class:"thread-icon"}))])])]),right:_t(()=>[p("div",Ny,[p("div",{ref_for:!0,ref:ee=>bt(L.projectName,ee),class:"project-menu-wrap"},[p("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:ct(ee=>zt(L.projectName),["stop"])},[Re(Ls,{class:"thread-icon"})],8,Dy),tt(L.projectName)?(w(),k("div",{key:0,class:"project-menu-panel",onClick:$[6]||($[6]=ct(()=>{},["stop"]))},[u.value==="actions"?(w(),k(Fe,{key:0},[p("button",{class:"project-menu-item",type:"button",onClick:ee=>Dt(L.projectName)}," Browse files ",8,Ly),p("button",{class:"project-menu-item",type:"button",onClick:ee=>kt(L.projectName)}," Edit name ",8,jy),p("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:ee=>wt(L.projectName)}," Remove ",8,Uy)],64)):(w(),k(Fe,{key:1},[$[13]||($[13]=p("label",{class:"project-menu-label"},"Project name",-1)),cr(p("input",{"onUpdate:modelValue":$[5]||($[5]=ee=>c.value=ee),class:"project-menu-input",type:"text",onInput:ee=>Rt(L.projectName)},null,40,Fy),[[ur,c.value]])],64))])):ae("",!0)],512),p("button",{class:"thread-start-button",type:"button","aria-label":N(L.projectName),title:N(L.projectName),onClick:ct(ee=>V(L.projectName),["stop"])},[Re(ei,{class:"thread-icon"})],8,By)])]),default:_t(()=>[p("span",{class:"project-main-button","data-dragging-handle":se(L.projectName),onMousedown:ct(ee=>ie(ee,L.projectName),["left"])},[p("span",Oy,oe(ot(L.projectName)),1)],40,$y)]),_:2},1032,["onClick","onKeydown"]),an(L)?(w(),k("ul",Hy,[(w(!0),k(Fe,null,St(bn(L),ee=>(w(),k("li",{key:ee.id,class:"thread-row-item"},[Re(Ur,{class:"thread-row","data-active":ee.id===e.selectedThreadId,"data-pinned":b(ee.id),onMouseleave:Ge=>J(ee.id)},{left:_t(()=>[p("span",Wy,[ee.inProgress||ee.unread?(w(),k("span",{key:0,class:"thread-status-indicator","data-state":Vt(ee)},null,8,Vy)):ae("",!0),p("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Ge=>M(ee.id)},[Re(sa,{class:"thread-icon"})],8,Gy)])]),right:_t(()=>[p("span",Jy,oe(g(ee.createdAtIso||ee.updatedAtIso)),1)]),"right-hover":_t(()=>[p("div",{ref_for:!0,ref:Ge=>Jt(ee.id,Ge),class:"thread-menu-wrap"},[p("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:ct(Ge=>_e(ee.id),["stop"])},[Re(Ls,{class:"thread-icon"})],8,Yy),Q(ee.id)?(w(),k("div",{key:0,class:"thread-menu-panel",onClick:$[7]||($[7]=ct(()=>{},["stop"]))},[p("button",{class:"thread-menu-item",type:"button",onClick:Ge=>G(ee.id)}," Export chat ",8,Xy),p("button",{class:"thread-menu-item",type:"button",onClick:Ge=>de(ee.id,ee.title)}," Rename thread ",8,Qy),p("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Ge=>De(ee.id,ee.title)}," Delete thread ",8,Zy)])):ae("",!0)],512)]),default:_t(()=>[p("button",{class:"thread-main-button",type:"button",onClick:Ge=>q(ee.id)},[p("span",qy,[p("span",Ky,oe(ee.title),1),ee.hasWorktree?(w(),ft(Fo,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ae("",!0)])],8,zy)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),ft(Ur,{key:1,as:"p",class:"project-empty-row"},{left:_t(()=>[...$[14]||($[14]=[p("span",{class:"project-empty-spacer"},null,-1)])]),default:_t(()=>[$[15]||($[15]=p("span",{class:"project-empty"},"No threads",-1))]),_:1})),_n(L)?(w(),ft(Ur,{key:2,class:"thread-show-more-row"},{left:_t(()=>[...$[16]||($[16]=[p("span",{class:"thread-show-more-spacer"},null,-1)])]),default:_t(()=>[p("button",{class:"thread-show-more-button",type:"button",onClick:ee=>Tt(L.projectName)},oe(qt(L.projectName)?"Show less":"Show more"),9,ew)]),_:2},1024)):ae("",!0)],12,Ry))),128))],4)),(w(),ft(Ko,{to:"body"},[f.value?(w(),k("div",{key:0,class:"rename-thread-overlay",onClick:ct(Se,["self"])},[p("div",tw,[$[17]||($[17]=p("h3",{class:"rename-thread-title"},"Rename thread",-1)),$[18]||($[18]=p("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),cr(p("input",{ref_key:"renameThreadInputRef",ref:U,"onUpdate:modelValue":$[8]||($[8]=L=>T.value=L),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[dn(ct(Me,["prevent"]),["enter"]),dn(ct(Se,["prevent"]),["esc"])]},null,40,nw),[[ur,T.value]]),p("div",{class:"rename-thread-actions"},[p("button",{class:"rename-thread-button",type:"button",onClick:Se},"Cancel"),p("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:Me},"Save")])])])):ae("",!0)])),(w(),ft(Ko,{to:"body"},[P.value?(w(),k("div",{key:0,class:"rename-thread-overlay",onClick:ct(Be,["self"])},[p("div",rw,[$[19]||($[19]=p("h3",{class:"rename-thread-title"},"Delete thread?",-1)),p("p",sw,' This will archive the thread "'+oe(R.value)+'". You can find it later in archived threads. ',1),p("div",{class:"rename-thread-actions"},[p("button",{class:"rename-thread-button",type:"button",onClick:Be},"Cancel"),p("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:He},"Delete")])])])):ae("",!0)]))]))}}),aw=st(iw,[["__scopeId","data-v-e2f8a8e1"]]),lw={class:"content-header"},cw={class:"content-leading"},uw={class:"content-title"},dw={class:"content-actions"},fw=Ht({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(w(),k("header",lw,[p("div",cw,[Gn(t.$slots,"leading",{},void 0)]),p("h1",uw,oe(e.title),1),p("div",dw,[Gn(t.$slots,"actions",{},void 0)])]))}}),hw=st(fw,[["__scopeId","data-v-66ee223c"]]),pw={},mw={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function gw(e,t){return w(),k("svg",mw,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const Sl=st(pw,[["render",gw]]),vw={},yw={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ww(e,t){return w(),k("svg",yw,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 14L4 9l5-5m-5 5h11a4 4 0 0 1 0 8H4"},null,-1)])])}const bw=st(vw,[["render",ww]]),_w={},kw={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Tw(e,t){return w(),k("svg",kw,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 16a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2zm-4 4a2 2 0 0 1-2-2V8m4 8h10"},null,-1)])])}const Sw=st(_w,[["render",Tw]]),Iw={class:"conversation-root"},Ew={key:0,class:"conversation-loading"},Cw={key:1,class:"conversation-empty"},Aw={class:"message-row"},Rw={class:"message-stack"},Pw={class:"request-card"},xw={class:"request-title"},Mw={class:"request-meta"},$w={key:0,class:"request-reason"},Ow={key:1,class:"request-actions"},Nw=["onClick"],Dw=["onClick"],Lw=["onClick"],jw=["onClick"],Uw={key:2,class:"request-actions"},Fw=["onClick"],Bw=["onClick"],Hw=["onClick"],Ww=["onClick"],Vw={key:3,class:"request-user-input"},Gw={class:"request-question-title"},zw={key:0,class:"request-question-text"},qw=["value","onChange"],Kw=["value"],Jw=["value","onInput"],Yw=["onClick"],Xw={key:4,class:"request-actions"},Qw=["onClick"],Zw=["onClick"],eb={key:5,class:"request-actions"},tb=["onClick"],nb=["onClick"],rb=["data-role","data-message-type"],sb={key:0,class:"message-row","data-role":"system"},ob={class:"message-stack","data-role":"system"},ib=["onClick"],ab={class:"cmd-label"},lb={class:"cmd-status"},cb={class:"cmd-output-inner"},ub={class:"cmd-output"},db=["data-role","data-message-type"],fb=["data-role"],hb=["data-role"],pb=["data-role"],mb=["onClick"],gb=["src"],vb={key:1,class:"message-file-attachments"},yb={class:"message-file-link-wrap"},wb=["href","title"],bb=["href","title"],_b=["data-role"],kb={key:0,class:"worked-separator-wrap","aria-live":"polite"},Tb=["onClick"],Sb={class:"worked-separator-text"},Ib={key:0,class:"worked-details"},Eb=["onClick"],Cb={class:"cmd-label"},Ab={class:"cmd-status"},Rb={class:"cmd-output-inner"},Pb={class:"cmd-output"},xb={key:1,class:"message-text-flow"},Mb={key:0,class:"message-text"},$b={key:0},Ob={key:1,class:"message-bold-text"},Nb={key:2,class:"message-file-link-wrap"},Db=["href","title"],Lb=["href","title"],jb=["href","title"],Ub={key:4,class:"message-inline-code"},Fb={key:1,class:"message-text"},Bb=["onClick"],Hb=["src","alt","onError"],Wb={key:0,class:"message-actions"},Vb=["onClick"],Gb=["onClick"],zb={key:0,class:"conversation-item conversation-item-overlay"},qb={class:"message-row"},Kb={class:"message-stack"},Jb={class:"live-overlay-inline","aria-live":"polite"},Yb={class:"live-overlay-label"},Xb={key:1,class:"live-overlay-error"},Qb=["src"],Zb=16,e_=Ht({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},cwd:{},scrollState:{},isTurnInProgress:{type:Boolean},isRollingBack:{type:Boolean}},emits:["updateScrollState","respondServerRequest","rollback"],setup(e,{emit:t}){const n=D(new Set),r=D(new Set),s=D(new Set),o=D({});function i(_){return _.messageType==="commandExecution"&&!!_.commandExecution}function a(_){var S;return((S=_.commandExecution)==null?void 0:S.status)==="inProgress"||r.value.has(_.id)?!0:n.value.has(_.id)}function l(_){return r.value.has(_.id)}function u(_){var E;if(((E=_.commandExecution)==null?void 0:E.status)==="inProgress")return;const S=new Set(n.value);S.has(_.id)?S.delete(_.id):S.add(_.id),n.value=S}function c(_){const S=new Set(s.value);S.has(_.id)?S.delete(_.id):S.add(_.id),s.value=S}function f(_){return s.value.has(_.id)}function m(_){const S=_.commandExecution;if(!S)return"";switch(S.status){case"inProgress":return"⟳ Running";case"completed":return S.exitCode===0?"✓ Completed":`✗ Exit ${S.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function T(_){var E,O;const S=(E=_.commandExecution)==null?void 0:E.status;return S==="inProgress"?"cmd-status-running":S==="completed"&&((O=_.commandExecution)==null?void 0:O.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function U(_){const S=new Set(r.value);S.add(_),r.value=S,setTimeout(()=>{const E=new Set(r.value);E.delete(_),r.value=E},1e3)}function P(_,S){const E=[];for(let O=S-1;O>=0;O--){const H=_[O];if(H.messageType==="commandExecution")E.unshift(H);else if(H.role==="user"||H.messageType==="worked")break}return E}const F=e,R=t,A=D(null),B=D(null),W=D(null),ce=D(""),me=D({}),ve=D({});let Ie=0,re=0,le=0;const we=new WeakSet,Y=D(new Set);function Te(_){if(!_||_.endsWith("/")||_.endsWith("\\"))return!1;if(_.startsWith("file://"))return!0;if(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(_))return!1;const S=_.startsWith("/"),E=/^[A-Za-z]:[\\/]/u.test(_),O=_.startsWith("./")||_.startsWith("../")||_.startsWith("~/"),H=_.includes("/")||_.includes("\\");return S||E||O||H}function xe(_){return _.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||_}function Le(_){return _.replace(/\\/gu,"/")}function Pe(_){if(!_.startsWith("file://"))return _;let S=_.replace(/^file:\/\//u,"");try{S=decodeURIComponent(S)}catch{}return/^\/[A-Za-z]:\//u.test(S)&&(S=S.slice(1)),S}function Oe(_){const S=Le(_),E=S.match(/^\/Users\/([^/]+)/u);if(E)return`/Users/${E[1]}`;const O=S.match(/^\/home\/([^/]+)/u);return O?`/home/${O[1]}`:""}function Ee(_){const S=Le(_);if(!S)return S;let E="",O=S;const H=O.match(/^([A-Za-z]:)(\/.*)?$/u);H?(E=`${H[1]}/`,O=(H[2]??"").replace(/^\/+/u,"")):O.startsWith("/")&&(E="/",O=O.slice(1));const ie=O.split("/").filter(Boolean),Ce=[];for(const Ke of ie)if(Ke!=="."){if(Ke===".."){Ce.length>0&&Ce.pop();continue}Ce.push(Ke)}const ge=Ce.join("/");return E?`${E}${ge}`.replace(/\/+$/u,"")||E:ge||S}function Ye(_,S){const E=Le(Pe(_.trim()));if(!E)return"";if(E.startsWith("/")||/^[A-Za-z]:\//u.test(E))return Ee(E);if(E.startsWith("~/")){const ie=Oe(S);if(ie)return Ee(`${ie}/${E.slice(2)}`)}const H=Le(S.trim());return Ee(H?`${H.replace(/\/+$/u,"")}/${E}`:E)}function Ze(_){if(!_)return null;let S=_.trim();S=Ne(S).core.trim();let O=null;const H=S.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(H)S=H[1],O=Number(H[2]);else{const ie=S.match(/^(.*):(\d+)(?::\d+)?$/u);ie&&(S=ie[1],O=Number(ie[2]))}return S=Pe(S),Te(S)?{path:S,line:O}:null}function Ne(_){let S=_,E="",O="";for(;/^['"`“‘]/u.test(S);)E+=S[0],S=S.slice(1);for(;/['"`”’]$/u.test(S);)O=S.slice(-1)+O,S=S.slice(0,-1);return{core:S,leading:E,trailing:O}}function nt(_){const S=_.trim(),E=gt(S,0);if(!E||E.end!==S.length)return null;const O=E.label.trim(),H=E.target.trim(),ie=Ne(O).core.trim()||O,Ce=Ne(H).core.trim();return Ce?{label:ie,target:Ce}:null}function gt(_,S){if(_[S]!=="[")return null;const E=_.indexOf("](",S+1);if(E<0)return null;const O=_.slice(S+1,E);if(!O||O.includes(`
26
+ `))return null;let H=E+2,ie=1;for(;H<_.length;){const Ce=_[H];if(Ce===`
27
+ `)return null;if(Ce==="(")ie+=1;else if(Ce===")"&&(ie-=1,ie===0)){const ge=_.slice(E+2,H);return ge.trim()?{label:O,target:ge,end:H+1}:null}H+=1}return null}function at(_){const S=[],E=/https?:\/\/\S+|file:\/\/\S+|\S*[\\/]\S+/gu;let O=0;for(const H of _.matchAll(E)){if(typeof H.index!="number")continue;const ie=H.index,Ce=ie+H[0].length;ie>O&&S.push({kind:"text",value:_.slice(O,ie)});let ge=H[0],Ke="";for(;/[.,;:]$/u.test(ge);)Ke=ge.slice(-1)+Ke,ge=ge.slice(0,-1);const lt=Ne(ge);ge=lt.core;const rt=lt.leading,Nt=lt.trailing+Ke;if(rt&&S.push({kind:"text",value:rt}),ge.startsWith("**")&&ge.endsWith("**")&&ge.length>4)S.push({kind:"bold",value:ge.slice(2,-2)}),Nt&&S.push({kind:"text",value:Nt});else if(/^https?:\/\//u.test(ge))S.push({kind:"url",value:ge,href:ge}),Nt&&S.push({kind:"text",value:Nt});else{const mn=Ze(ge);mn?(S.push({kind:"file",value:ge,path:mn.path,displayPath:ge,downloadName:xe(mn.path)}),Nt&&S.push({kind:"text",value:Nt})):S.push({kind:"text",value:H[0]})}O=Ce}return O<_.length&&S.push({kind:"text",value:_.slice(O)}),et(S)}function et(_){const S=[];let E=!1,O="";const H=ie=>{ie&&S.push({kind:"text",value:ie})};for(const ie of _){if(ie.kind!=="text"){E&&(H(`**${O}`),E=!1,O=""),S.push(ie);continue}let Ce=ie.value;for(;Ce.length>0;){const ge=Ce.indexOf("**");if(ge<0){E?O+=Ce:H(Ce);break}const Ke=Ce.slice(0,ge);E?O+=Ke:H(Ke),Ce=Ce.slice(ge+2),E?(O.length>0?S.push({kind:"bold",value:O}):H("****"),O="",E=!1):E=!0}}return E&&H(`**${O}`),S}function Xe(_){const S=[];let E=0;for(;E<_.length;){const O=_.indexOf("[",E);if(O<0)break;const H=gt(_,O);if(!H){E=O+1;continue}O>E&&S.push(...at(_.slice(E,O)));const ie=Ne(H.label.trim()).core.trim()||H.label.trim(),Ce=Ne(H.target.trim()).core.trim();if(/^https?:\/\//u.test(Ce))S.push({kind:"url",value:ie||Ce,href:Ce});else{const ge=Ze(Ce);ge?S.push({kind:"file",value:Ce,path:ge.path,displayPath:ie||Ce,downloadName:xe(ge.path)}):S.push({kind:"text",value:_.slice(O,H.end)})}E=H.end}return E<_.length&&S.push(...at(_.slice(E))),S}function K(_){if(!_.includes("`"))return Xe(_);const S=[];let E=0,O=0;for(;E<_.length;){if(_[E]!=="`"){E+=1;continue}let H=1;for(;E+H<_.length&&_[E+H]==="`";)H+=1;const ie="`".repeat(H);let Ce=E+H,ge=-1;for(;Ce<_.length;){const lt=_.indexOf(ie,Ce);if(lt<0)break;const rt=lt>0&&_[lt-1]==="`",Nt=lt+H<_.length&&_[lt+H]==="`",mn=_.slice(E+H,lt).includes(`
28
+ `);if(!rt&&!Nt&&!mn){ge=lt;break}Ce=lt+1}if(ge<0){E+=H;continue}E>O&&S.push(...Xe(_.slice(O,E)));const Ke=_.slice(E+H,ge);if(Ke.length>0){const lt=nt(Ke);if(lt)if(/^https?:\/\//u.test(lt.target))S.push({kind:"url",value:lt.label||lt.target,href:lt.target});else{const rt=Ze(lt.target);rt?S.push({kind:"file",value:lt.target,path:rt.path,displayPath:lt.label||lt.target,downloadName:xe(rt.path)}):S.push({kind:"code",value:Ke})}else{const rt=Ze(Ke);if(rt){const Nt=rt.line?`${rt.path}:${String(rt.line)}`:rt.path;S.push({kind:"file",value:Ke,path:rt.path,displayPath:Nt,downloadName:xe(rt.path)})}else S.push({kind:"code",value:Ke})}}else S.push({kind:"text",value:`${ie}${ie}`});E=ge+H,O=E}return O<_.length&&S.push(...Xe(_.slice(O))),S}function he(_){const S=_.trim();if(!S)return"";if(S.startsWith("data:")||S.startsWith("blob:")||S.startsWith("http://")||S.startsWith("https://")||S.startsWith("/codex-local-image?"))return S;if(S.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(S)}`;const E=S.startsWith("/"),O=/^[A-Za-z]:[\\/]/u.test(S);return E||O?`/codex-local-image?path=${encodeURIComponent(S)}`:S}function ue(_){const S=_.trim();if(!S)return"#";const E=Ce=>Ce.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(Ce),O=Ze(S),H=(O==null?void 0:O.path)??S,ie=Ye(H,F.cwd);if(E(ie)){const Ce=ie.startsWith("/")?ie:`/${ie}`;return`/codex-local-browse${encodeURI(Ce)}`}return"#"}function be(_){return $e(_)!=="#"}function $e(_){const S=_.trim();if(!S)return"#";const E=Ze(S),O=(E==null?void 0:E.path)??S,H=Ye(O,F.cwd);if(!(ge=>ge.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(ge))(H))return"#";const Ce=H.startsWith("/")?H:`/${H}`;return`/codex-local-edit${encodeURI(Ce)}`}function g(_){if(!_.includes("![")||!_.includes("]("))return[{kind:"text",value:_}];const S=[],E=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let O=0;for(const H of _.matchAll(E)){const[ie,Ce,ge]=H;if(typeof H.index!="number")continue;const Ke=H.index,lt=Ke+ie.length,rt=he(ge.trim());rt&&(Ke>O&&S.push({kind:"text",value:_.slice(O,Ke)}),S.push({kind:"image",url:rt,alt:Ce.trim(),markdown:ie}),O=lt)}return O<_.length&&S.push({kind:"text",value:_.slice(O)}),S.length>0?S:[{kind:"text",value:_}]}function b(_){return _!==null&&typeof _=="object"&&!Array.isArray(_)?_:null}function M(_){const S=new Date(_);return Number.isNaN(S.getTime())?_:S.toLocaleTimeString()}function q(_){const S=b(_.params),E=S==null?void 0:S.reason;return typeof E=="string"?E.trim():""}function G(_,S){return`${String(_)}:${S}`}function N(_){const S=b(_.params),E=Array.isArray(S==null?void 0:S.questions)?S.questions:[],O=[];for(const H of E){const ie=b(H);if(!ie)continue;const Ce=typeof ie.id=="string"?ie.id:"";if(!Ce)continue;const ge=Array.isArray(ie.options)?ie.options.map(Ke=>b(Ke)).map(Ke=>Ke==null?void 0:Ke.label).filter(Ke=>typeof Ke=="string"&&Ke.length>0):[];O.push({id:Ce,header:typeof ie.header=="string"?ie.header:"",question:typeof ie.question=="string"?ie.question:"",isOther:ie.isOther===!0,options:ge})}return O}function V(_,S,E){const O=G(_,S),H=me.value[O];return typeof H=="string"&&H.length>0?H:E}function J(_,S){const E=G(_,S);return ve.value[E]??""}function Q(_,S,E){const O=E.target;if(!(O instanceof HTMLSelectElement))return;const H=G(_,S);me.value={...me.value,[H]:O.value}}function z(_,S,E){const O=E.target;if(!(O instanceof HTMLInputElement))return;const H=G(_,S);ve.value={...ve.value,[H]:O.value}}function _e(_,S){R("respondServerRequest",{id:_,result:{decision:S}})}function de(_){const S=N(_),E={};for(const O of S){const H=V(_.id,O.id,O.options[0]||""),ie=J(_.id,O.id).trim(),Ce=[H,ie].map(ge=>ge.trim()).filter(ge=>ge.length>0);E[O.id]={answers:Ce}}R("respondServerRequest",{id:_.id,result:{answers:E}})}function Se(_){R("respondServerRequest",{id:_,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function Me(_){R("respondServerRequest",{id:_,result:{success:!0,contentItems:[]}})}function De(_){R("respondServerRequest",{id:_,result:{}})}function Be(_){R("respondServerRequest",{id:_,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function He(_){return!(_.role!=="user"&&_.role!=="assistant"||typeof _.turnIndex!="number"||F.isTurnInProgress||F.isRollingBack)}function ot(_){return _.role!=="user"&&_.role!=="assistant"?!1:_.text.trim().length>0}function tt(_){return ot(_)||He(_)}async function vt(_){if(!ot(_))return;const S=_.text.trim();try{await navigator.clipboard.writeText(S)}catch{const E=document.createElement("textarea");E.value=S,E.setAttribute("readonly","true"),E.style.position="fixed",E.style.opacity="0",document.body.appendChild(E),E.select(),document.execCommand("copy"),document.body.removeChild(E)}}function yt(_){if(!He(_))return;const S=_.role==="user"?_.text.trim():"";R("rollback",{turnIndex:_.turnIndex,prependText:S.length>0?S:void 0})}function jt(){const _=A.value,S=B.value;!_||!S||(_.scrollTop=_.scrollHeight,S.scrollIntoView({block:"end"}))}function zt(_){return _.scrollHeight-(_.scrollTop+_.clientHeight)<=Zb}function kt(_){if(!F.activeThreadId)return;const S=Math.max(_.scrollHeight-_.clientHeight,0),E=S>0?Math.min(Math.max(_.scrollTop/S,0),1):1;R("updateScrollState",{threadId:F.activeThreadId,state:{scrollTop:_.scrollTop,isAtBottom:zt(_),scrollRatio:E}})}function Rt(){const _=A.value;if(!_)return;const S=F.scrollState;if(!S||S.isAtBottom){wt();return}const E=Math.max(_.scrollHeight-_.clientHeight,0),O=typeof S.scrollRatio=="number"?S.scrollRatio*E:S.scrollTop;_.scrollTop=Math.min(Math.max(O,0),E),kt(_)}function wt(){const _=A.value;_&&(jt(),kt(_))}function Dt(){const _=F.scrollState;return!_||_.isAtBottom===!0}function Qt(){if(!Dt()){le=0,re=0;return}if(wt(),le-=1,le<=0){re=0;return}re=requestAnimationFrame(Qt)}function qt(_=6){Dt()&&(re&&(cancelAnimationFrame(re),re=0),le=Math.max(_,1),re=requestAnimationFrame(Qt))}function xt(){qt(3)}function Tt(){if(!Dt())return;const _=A.value;if(!_)return;const S=_.querySelectorAll("img.message-image-preview");for(const E of S)E.complete||we.has(E)||(we.add(E),E.addEventListener("load",xt,{once:!0}),E.addEventListener("error",xt,{once:!0}))}async function Kt(){await Yt(),Ie&&cancelAnimationFrame(Ie),Ie=requestAnimationFrame(()=>{Ie=0,Rt(),Tt(),qt()})}ut(()=>F.messages,async _=>{if(!F.isLoading){for(const S of _){if(S.messageType!=="commandExecution"||!S.commandExecution)continue;const E=o.value[S.id],O=S.commandExecution.status;E==="inProgress"&&O!=="inProgress"&&U(S.id),o.value[S.id]=O}await Kt()}}),ut(()=>F.liveOverlay,async _=>{_&&(await Yt(),wt(),qt(8))},{deep:!0}),ut(()=>F.isLoading,async _=>{_||await Kt()}),ut(()=>F.activeThreadId,()=>{ce.value="",Y.value=new Set},{flush:"post"});function It(){const _=A.value;!_||F.isLoading||kt(_)}function bt(_){ce.value=he(_)}function Jt(_,S){return`${_}:${String(S)}`}function yn(_,S){const E=new Set(Y.value);E.add(Jt(_,S)),Y.value=E}function $t(_,S){return Y.value.has(Jt(_,S))}function Wt(){ce.value=""}function wn(){const _=W.value;_&&(_.scrollTop=_.scrollHeight)}return ut(()=>{var _;return(_=F.liveOverlay)==null?void 0:_.reasoningText},async _=>{_&&(await Yt(),wn())}),mr(()=>{Ie&&cancelAnimationFrame(Ie),re&&cancelAnimationFrame(re)}),(_,S)=>(w(),k("section",Iw,[e.isLoading?(w(),k("p",Ew,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(w(),k("p",Cw," No messages in this thread yet. ")):(w(),k("ul",{key:2,ref_key:"conversationListRef",ref:A,class:"conversation-list",onScroll:It},[(w(!0),k(Fe,null,St(e.pendingRequests,E=>(w(),k("li",{key:`server-request:${E.id}`,class:"conversation-item conversation-item-request"},[p("div",Aw,[p("div",Rw,[p("article",Pw,[p("p",xw,oe(E.method),1),p("p",Mw,"Request #"+oe(E.id)+" · "+oe(M(E.receivedAtIso)),1),q(E)?(w(),k("p",$w,oe(q(E)),1)):ae("",!0),E.method==="item/commandExecution/requestApproval"?(w(),k("section",Ow,[p("button",{type:"button",class:"request-button request-button-primary",onClick:O=>_e(E.id,"accept")},"Accept",8,Nw),p("button",{type:"button",class:"request-button",onClick:O=>_e(E.id,"acceptForSession")},"Accept for Session",8,Dw),p("button",{type:"button",class:"request-button",onClick:O=>_e(E.id,"decline")},"Decline",8,Lw),p("button",{type:"button",class:"request-button",onClick:O=>_e(E.id,"cancel")},"Cancel",8,jw)])):E.method==="item/fileChange/requestApproval"?(w(),k("section",Uw,[p("button",{type:"button",class:"request-button request-button-primary",onClick:O=>_e(E.id,"accept")},"Accept",8,Fw),p("button",{type:"button",class:"request-button",onClick:O=>_e(E.id,"acceptForSession")},"Accept for Session",8,Bw),p("button",{type:"button",class:"request-button",onClick:O=>_e(E.id,"decline")},"Decline",8,Hw),p("button",{type:"button",class:"request-button",onClick:O=>_e(E.id,"cancel")},"Cancel",8,Ww)])):E.method==="item/tool/requestUserInput"?(w(),k("section",Vw,[(w(!0),k(Fe,null,St(N(E),O=>(w(),k("div",{key:`${E.id}:${O.id}`,class:"request-question"},[p("p",Gw,oe(O.header||O.question),1),O.header&&O.question?(w(),k("p",zw,oe(O.question),1)):ae("",!0),p("select",{class:"request-select",value:V(E.id,O.id,O.options[0]||""),onChange:H=>Q(E.id,O.id,H)},[(w(!0),k(Fe,null,St(O.options,H=>(w(),k("option",{key:`${E.id}:${O.id}:${H}`,value:H},oe(H),9,Kw))),128))],40,qw),O.isOther?(w(),k("input",{key:1,class:"request-input",type:"text",value:J(E.id,O.id),placeholder:"Other answer",onInput:H=>z(E.id,O.id,H)},null,40,Jw)):ae("",!0)]))),128)),p("button",{type:"button",class:"request-button request-button-primary",onClick:O=>de(E)}," Submit Answers ",8,Yw)])):E.method==="item/tool/call"?(w(),k("section",Xw,[p("button",{type:"button",class:"request-button request-button-primary",onClick:O=>Se(E.id)},"Fail Tool Call",8,Qw),p("button",{type:"button",class:"request-button",onClick:O=>Me(E.id)},"Success (Empty)",8,Zw)])):(w(),k("section",eb,[p("button",{type:"button",class:"request-button request-button-primary",onClick:O=>De(E.id)},"Return Empty Result",8,tb),p("button",{type:"button",class:"request-button",onClick:O=>Be(E.id)},"Reject Request",8,nb)]))])])])]))),128)),(w(!0),k(Fe,null,St(e.messages,E=>{var O,H;return w(),k("li",{key:E.id,class:it(["conversation-item",{"conversation-item-actionable":tt(E)}]),"data-role":E.role,"data-message-type":E.messageType||""},[i(E)?(w(),k("div",sb,[p("div",ob,[p("button",{type:"button",class:it(["cmd-row",[T(E),{"cmd-expanded":a(E)}]]),onClick:ie=>u(E)},[p("span",{class:it(["cmd-chevron",{"cmd-chevron-open":a(E)}])},"▶",2),p("code",ab,oe(((O=E.commandExecution)==null?void 0:O.command)||"(command)"),1),p("span",lb,oe(m(E)),1)],10,ib),p("div",{class:it(["cmd-output-wrap",{"cmd-output-visible":a(E),"cmd-output-collapsing":l(E)}])},[p("div",cb,[p("pre",ub,oe(((H=E.commandExecution)==null?void 0:H.aggregatedOutput)||"(no output)"),1)])],2)])])):(w(),k("div",{key:1,class:"message-row","data-role":E.role,"data-message-type":E.messageType||""},[p("div",{class:"message-stack","data-role":E.role},[p("article",{class:"message-body","data-role":E.role},[E.images&&E.images.length>0?(w(),k("ul",{key:0,class:"message-image-list","data-role":E.role},[(w(!0),k(Fe,null,St(E.images,ie=>(w(),k("li",{key:ie,class:"message-image-item"},[p("button",{class:"message-image-button",type:"button",onClick:Ce=>bt(ie)},[p("img",{class:"message-image-preview",src:he(ie),alt:"Message image preview",loading:"lazy"},null,8,gb)],8,mb)]))),128))],8,pb)):ae("",!0),E.fileAttachments&&E.fileAttachments.length>0?(w(),k("div",vb,[(w(!0),k(Fe,null,St(E.fileAttachments,ie=>(w(),k("span",{key:ie.path,class:"message-file-chip"},[S[1]||(S[1]=p("span",{class:"message-file-chip-icon"},"📄",-1)),p("span",yb,[p("a",{class:"message-file-link message-file-chip-name",href:ue(ie.path),target:"_blank",rel:"noopener noreferrer",title:ie.path},oe(ie.path),9,wb),be(ie.path)?(w(),k("a",{key:0,class:"message-file-edit-link",href:$e(ie.path),target:"_blank",rel:"noopener noreferrer",title:`Edit ${ie.path}`,"aria-label":"Edit file"}," Edit ",8,bb)):ae("",!0)])]))),128))])):ae("",!0),E.text.length>0?(w(),k("article",{key:2,class:"message-card","data-role":E.role},[E.messageType==="worked"?(w(),k("div",kb,[p("button",{type:"button",class:"worked-separator",onClick:ie=>c(E)},[S[2]||(S[2]=p("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),p("span",{class:it(["worked-chevron",{"worked-chevron-open":f(E)}])},"▶",2),p("p",Sb,oe(E.text),1),S[3]||(S[3]=p("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Tb),f(E)?(w(),k("div",Ib,[(w(!0),k(Fe,null,St(P(e.messages,e.messages.indexOf(E)),ie=>{var Ce,ge;return w(),k("div",{key:`worked-cmd-${ie.id}`,class:"worked-cmd-item"},[p("button",{type:"button",class:it(["cmd-row",[T(ie),{"cmd-expanded":a(ie)}]]),onClick:Ke=>u(ie)},[p("span",{class:it(["cmd-chevron",{"cmd-chevron-open":a(ie)}])},"▶",2),p("code",Cb,oe(((Ce=ie.commandExecution)==null?void 0:Ce.command)||"(command)"),1),p("span",Ab,oe(m(ie)),1)],10,Eb),p("div",{class:it(["cmd-output-wrap",{"cmd-output-visible":a(ie),"cmd-output-collapsing":l(ie)}])},[p("div",Rb,[p("pre",Pb,oe(((ge=ie.commandExecution)==null?void 0:ge.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):ae("",!0)])):(w(),k("div",xb,[(w(!0),k(Fe,null,St(g(E.text),(ie,Ce)=>(w(),k(Fe,{key:`block-${Ce}`},[ie.kind==="text"?(w(),k("p",Mb,[(w(!0),k(Fe,null,St(K(ie.value),(ge,Ke)=>(w(),k(Fe,{key:`seg-${Ce}-${Ke}`},[ge.kind==="text"?(w(),k("span",$b,oe(ge.value),1)):ge.kind==="bold"?(w(),k("strong",Ob,oe(ge.value),1)):ge.kind==="file"?(w(),k("span",Nb,[p("a",{class:"message-file-link",href:ue(ge.path),target:"_blank",rel:"noopener noreferrer",title:ge.path},oe(ge.displayPath),9,Db),be(ge.path)?(w(),k("a",{key:0,class:"message-file-edit-link",href:$e(ge.path),target:"_blank",rel:"noopener noreferrer",title:`Edit ${ge.path}`,"aria-label":"Edit file"}," Edit ",8,Lb)):ae("",!0)])):ge.kind==="url"?(w(),k("a",{key:3,class:"message-file-link",href:ge.href,target:"_blank",rel:"noopener noreferrer",title:ge.href},oe(ge.value),9,jb)):(w(),k("code",Ub,oe(ge.value),1))],64))),128))])):$t(E.id,Ce)?(w(),k("p",Fb,oe(ie.markdown),1)):(w(),k("button",{key:2,class:"message-image-button",type:"button",onClick:ge=>bt(ie.url)},[p("img",{class:"message-image-preview message-markdown-image",src:ie.url,alt:ie.alt||"Embedded message image",loading:"lazy",onError:ge=>yn(E.id,Ce)},null,40,Hb)],8,Bb))],64))),128))]))],8,_b)):ae("",!0)],8,hb),tt(E)?(w(),k("div",Wb,[ot(E)?(w(),k("button",{key:0,class:"message-action-button",type:"button",title:"Copy message text",onClick:ie=>vt(E)},[Re(Sw,{class:"message-action-icon"}),S[4]||(S[4]=p("span",{class:"message-action-label"},"Copy",-1))],8,Vb)):ae("",!0),He(E)?(w(),k("button",{key:1,class:"message-action-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:ie=>yt(E)},[Re(bw,{class:"message-action-icon"}),S[5]||(S[5]=p("span",{class:"message-action-label"},"Rollback",-1))],8,Gb)):ae("",!0)])):ae("",!0)],8,fb)],8,db))],10,rb)}),128)),e.liveOverlay?(w(),k("li",zb,[p("div",qb,[p("div",Kb,[p("article",Jb,[p("p",Yb,oe(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(w(),k("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:W},oe(e.liveOverlay.reasoningText),513)):ae("",!0),e.liveOverlay.errorText?(w(),k("p",Xb,oe(e.liveOverlay.errorText),1)):ae("",!0)])])])])):ae("",!0),p("li",{ref_key:"bottomAnchorRef",ref:B,class:"conversation-bottom-anchor"},null,512)],544)),ce.value.length>0?(w(),k("div",{key:3,class:"image-modal-backdrop",onClick:Wt},[p("div",{class:"image-modal-content",onClick:S[0]||(S[0]=ct(()=>{},["stop"]))},[p("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:Wt},[Re(Sl,{class:"icon-svg"})]),p("img",{class:"image-modal-image",src:ce.value,alt:"Expanded message image"},null,8,Qb)])])):ae("",!0)]))}}),t_=st(e_,[["__scopeId","data-v-bc40021f"]]),Zc=.0025,oa=3,eu=2,n_=256;function r_(e){var we;const t=D("idle"),n=D(typeof navigator<"u"&&!!((we=navigator.mediaDevices)!=null&&we.getUserMedia)),r=D(0),s=D(null);let o=null,i=null,a=[],l=null,u=null,c=null,f=null,m=[],T=!1,U=!1,P=null;function F(){P&&(P.abort(),P=null),t.value==="transcribing"&&(t.value="idle")}function R(){const Y=s.value;if(!Y||typeof window>"u")return;const Te=Y.getContext("2d");if(!Te)return;const xe=Math.max(1,Math.floor(Y.clientWidth)),Le=Math.max(1,Math.floor(Y.clientHeight||36)),Pe=window.devicePixelRatio||1,Oe=Math.max(1,Math.floor(xe*Pe)),Ee=Math.max(1,Math.floor(Le*Pe));(Y.width!==Oe||Y.height!==Ee)&&(Y.width=Oe,Y.height=Ee),Te.setTransform(Pe,0,0,Pe,0,0),Te.clearRect(0,0,xe,Le);const Ye=Math.max(12,Math.floor(xe/(oa+eu))),Ze=m.slice(-Ye),Ne=Math.max(0,Ye-Ze.length),nt=Le/2,gt=getComputedStyle(Y).color||"#000000";for(let at=0;at<Ye;at+=1){const et=Ze[at-Ne]??0,K=Math.max(.08,Math.min(1,et*18))*nt,he=at*(oa+eu);Te.globalAlpha=et<=Zc?.35:1,Te.fillStyle=gt,Te.fillRect(he,nt-K,oa,K*2)}Te.globalAlpha=1}function A(){m=[],r.value=0,R()}function B(){c&&(c.disconnect(),c.onaudioprocess=null,c=null),u&&(u.disconnect(),u=null),l&&(l.close(),l=null),f=null}function W(Y){if(typeof window>"u")return;const Te=window.webkitAudioContext,xe=window.AudioContext??Te;xe&&(B(),A(),l=new xe,u=l.createMediaStreamSource(Y),c=l.createScriptProcessor(2048,1,1),f=performance.now(),c.onaudioprocess=Le=>{const Pe=Le.inputBuffer.getChannelData(0);let Oe=0;for(let Ee=0;Ee<Pe.length;Ee+=1){const Ye=Math.abs(Pe[Ee]??0);Oe+=Ye<Zc?0:Ye}m.push(Oe/Pe.length),m.length>n_&&m.shift(),f!==null&&(r.value=Math.max(0,performance.now()-f)),R()},u.connect(c),c.connect(l.destination),R())}async function ce(){var Y;if(t.value==="transcribing"&&F(),!(t.value!=="idle"||!n.value||T)){T=!0,U=!1;try{i=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),a=[],o=new MediaRecorder(i),o.ondataavailable=Te=>{Te.data.size>0&&a.push(Te.data)},o.onstop=()=>{var Le;const Te=a,xe=(o==null?void 0:o.mimeType)||((Le=Te[0])==null?void 0:Le.type)||"audio/webm";re(),Ie(Te,xe)},W(i),o.start(250),t.value="recording",U&&me()}catch(Te){re(),t.value="idle",(Y=e.onError)==null||Y.call(e,Te)}finally{T=!1}}}function me(){if(T&&t.value==="idle"){U=!0;return}if(!(t.value!=="recording"||!o)&&o.state!=="inactive"){t.value="transcribing";try{o.requestData()}catch{}o.stop()}}function ve(){U=!1,F(),re(),t.value="idle"}async function Ie(Y,Te){var Pe,Oe,Ee,Ye,Ze;if(Y.length===0){(Pe=e.onEmpty)==null||Pe.call(e),t.value="idle";return}const xe=new Blob(Y,{type:Te});t.value="transcribing";let Le=null;try{const Ne=Te.split(/[/;]/)[1]??"webm",nt=new FormData;nt.append("file",xe,`codex.${Ne}`);const gt=((Oe=e.getLanguage)==null?void 0:Oe.call(e).trim())??"";gt&&gt.toLowerCase()!=="auto"&&nt.append("language",gt),Le=new AbortController,P=Le;const at=await fetch("/codex-api/transcribe",{method:"POST",body:nt,signal:Le.signal}),et=await at.text();let Xe=null;try{Xe=et.trim()?JSON.parse(et):null}catch{Xe=null}if(!at.ok){const he=(Ee=Xe==null?void 0:Xe.error)==null?void 0:Ee.trim(),ue=et.trim();throw new Error(he||ue||`Transcription failed: ${at.status}`)}const K=((Xe==null?void 0:Xe.text)??"").trim();K.length>0?e.onTranscript(K):(Ye=e.onEmpty)==null||Ye.call(e)}catch(Ne){if(Ne instanceof DOMException&&Ne.name==="AbortError")return;(Ze=e.onError)==null||Ze.call(e,Ne)}finally{Le&&P===Le&&(P=null),t.value==="transcribing"&&(t.value="idle")}}function re(){B(),A(),o&&(o.ondataavailable=null,o.onstop=null,o=null),i&&(i.getTracks().forEach(Y=>Y.stop()),i=null),a=[]}mr(()=>{ve()});function le(){if(t.value==="recording"){me();return}(t.value==="idle"||t.value==="transcribing")&&ce()}return{state:t,isSupported:n,recordingDurationMs:r,waveformCanvasRef:s,startRecording:ce,stopRecording:me,toggleRecording:le,cancel:ve}}function tu(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class or extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function Il(e,t){const n=tu(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=tu(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function Ss(e,t,n){return e instanceof or?e:e instanceof Error?new or(e.message||t,{code:"unknown_error",method:n}):new or(t,{code:"unknown_error",method:n})}function Pf(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function s_(e,t){const n={method:e,params:t??null};let r;try{r=await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}catch(i){throw new or(i instanceof Error?i.message:`RPC ${e} failed before request was sent`,{code:"network_error",method:e})}let s=null;try{s=await r.json()}catch{s=null}if(!r.ok)throw new or(Il(s,`RPC ${e} failed with HTTP ${r.status}`),{code:"http_error",method:e,status:r.status});const o=s;if(!o||typeof o!="object"||!("result"in o))throw new or(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function nu(e){const t=Pf(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 o_(e){if(typeof window>"u")return()=>{};let t=null,n=!1;const r=()=>{if(typeof EventSource>"u"||n)return;const s=new EventSource("/codex-api/events");s.onmessage=o=>{try{const i=JSON.parse(o.data),a=nu(i);a&&e(a)}catch{}},t=()=>s.close()};if(typeof WebSocket<"u"){const s=window.location.protocol==="https:"?"wss:":"ws:",o=new WebSocket(`${s}//${window.location.host}/codex-api/ws`);let i=!1,a=window.setTimeout(()=>{i||n||(o.close(),r())},2500);o.onopen=()=>{i=!0,a!==null&&(window.clearTimeout(a),a=null)},o.onmessage=l=>{try{const u=JSON.parse(String(l.data)),c=nu(u);c&&e(c)}catch{}},o.onerror=()=>{!i&&!n&&r()},o.onclose=()=>{a!==null&&(window.clearTimeout(a),a=null),!i&&!n&&r()},t=()=>o.close()}else r();return()=>{n=!0,t==null||t()}}async function i_(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 or(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 or(Il(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function a_(){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 or(Il(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Pf(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function ru(e){return new Date(e*1e3).toISOString()}function l_(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function c_(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const u_=/^##\s+(.+?):\s+(.+?)\s*$/,d_=/^#\s*files mentioned by the user\s*:?\s*$/i;function f_(e){var s,o;const t=e.split(`
29
29
  `).findIndex(i=>d_.test(i.trim()));if(t<0)return[];const n=e.split(`
30
30
  `).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match(u_);if(!l)break;const u=(s=l[1])==null?void 0:s.trim(),c=(o=l[2])==null?void 0:o.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");u&&c&&r.push({label:u,path:c})}return r}function h_(e){const t=/(?:^|\n)\s{0,3}#{0,6}\s*my request for codex\s*:?\s*/giu,n=Array.from(e.matchAll(t));if(n.length===0)return e.trim();const r=n.at(-1);if(!r||typeof r.index!="number")return e.trim();const s=r.index+r[0].length;return e.slice(s).trim()}function p_(e,t){if(!Array.isArray(t))return{text:"",images:[],fileAttachments:[],rawBlocks:[]};const n=[],r=[],s=[];for(const[a,l]of t.entries())l.type==="text"&&typeof l.text=="string"&&l.text.length>0&&n.push(l.text),l.type==="image"&&typeof l.url=="string"&&l.url.trim().length>0&&r.push(l.url.trim()),l.type!=="text"&&l.type!=="image"&&s.push({id:`${e}:user-content:${a}`,role:"user",text:"",messageType:`userContent.${l.type}`,rawPayload:c_(l),isUnhandled:!0});const o=n.join(`
31
31
  `),i=f_(o);return{text:h_(o),images:r,fileAttachments:i,rawBlocks:s}}function m_(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=p_(e.id,e.content),n=[];return(t.text.length>0||t.images.length>0||t.fileAttachments.length>0)&&n.push({id:e.id,role:"user",text:t.text,images:t.images,fileAttachments:t.fileAttachments.length>0?t.fileAttachments:void 0,messageType:e.type}),n.push(...t.rawBlocks),n.length===0?[]:n}if(e.type==="reasoning")return[];if(e.type==="commandExecution"){const t=e,n=g_(t.status),r=typeof t.command=="string"?t.command:"",s=typeof t.cwd=="string"?t.cwd:null,o=typeof t.aggregatedOutput=="string"?t.aggregatedOutput:"",i=typeof t.exitCode=="number"?t.exitCode:null;return[{id:e.id,role:"system",text:r,messageType:"commandExecution",commandExecution:{command:r,cwd:s,status:n,aggregatedOutput:o,exitCode:i}}]}return[]}function g_(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function v_(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function y_(e){const t=v_(e);return t.length>0?t:"Untitled thread"}function xf(e){return(e==null?void 0:e.status)==="inProgress"}function w_(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 xf(r)}function b_(e){const t=e,n=typeof t.cwd=="string"?t.cwd:e.cwd,r=t.isWorktree===!0||t.worktree===!0||t.worktreeId!==void 0||t.worktreePath!==void 0||n.includes("/.codex/worktrees/")||n.includes("/.git/worktrees/");return{id:e.id,title:y_(e),projectName:l_(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:ru(e.createdAt),updatedAtIso:ru(e.updatedAt),preview:e.preview,unread:!1,inProgress:w_(e)}}function __(e){const t=new Map;for(const n of e){const r=t.get(n.projectName);r?r.push(n):t.set(n.projectName,[n])}return Array.from(t.entries()).map(([n,r])=>({projectName:n,threads:r.sort((s,o)=>new Date(o.updatedAtIso).getTime()-new Date(s.updatedAtIso).getTime())})).sort((n,r)=>{var i,a;const s=new Date(((i=n.threads[0])==null?void 0:i.updatedAtIso)??0).getTime();return new Date(((a=r.threads[0])==null?void 0:a.updatedAtIso)??0).getTime()-s})}function k_(e){const t=e.data.map(b_);return __(t)}function Mf(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n=[];for(let r=0;r<t.length;r++){const s=t[r],o=Array.isArray(s.items)?s.items:[];for(const i of o)for(const a of m_(i))n.push({...a,turnIndex:r})}return n}function T_(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return xf(t.at(-1))}function su(e,t){const n=t.trim();if(!n)return"";const r=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),[s="",o=""]=e.split("/",2),i=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=s&&o?`${i}\\s*/\\s*${a}`:r;return n.replace(/^[★☆*\s:|\-]+/u,"").replace(/^(sponsor|star)\s+/i,"").replace(new RegExp(`^${r}\\s*[-:|]*\\s*`,"i"),"").replace(new RegExp(`^${l}\\s*[-:|]*\\s*`,"i"),"").replace(/^(sponsor|star)\s+/i,"").trim()}async function on(e,t){try{return await s_(e,t)}catch(n){throw Ss(n,`RPC ${e} failed`,e)}}function S_(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}function I_(e){return typeof e=="string"&&e.trim().toLowerCase()==="fast"?"fast":"standard"}async function E_(){const e=await on("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return k_(e)}async function C_(e){const t=await on("thread/read",{threadId:e,includeTurns:!0});return{messages:Mf(t),inProgress:T_(t)}}async function A_(){try{return await E_()}catch(e){throw Ss(e,"Failed to load thread groups","thread/list")}}async function R_(e){try{return await C_(e)}catch(t){throw Ss(t,`Failed to load thread ${e}`,"thread/read")}}function P_(e){return o_(e)}async function x_(e,t){await i_({id:e,...t})}async function M_(){return a_()}async function ia(e){await on("thread/resume",{threadId:e})}async function $_(e){await on("thread/archive",{threadId:e})}async function O_(e,t){await on("thread/name/set",{threadId:e,name:t})}async function ou(e,t){const n=await on("thread/rollback",{threadId:e,numTurns:t});return Mf(n)}function N_(e){if(!e||typeof e!="object")return"";const n=e.thread;if(n&&typeof n=="object"){const r=n.id;if(typeof r=="string"&&r.length>0)return r}return""}async function iu(e,t){try{const n={};typeof e=="string"&&e.trim().length>0&&(n.cwd=e.trim()),typeof t=="string"&&t.trim().length>0&&(n.model=t.trim());const r=await on("thread/start",n),s=N_(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw Ss(n,"Failed to start a new thread","thread/start")}}function D_(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
@@ -35,10 +35,10 @@
35
35
  ## My request for Codex:
36
36
 
37
37
  ${e}
38
- `}async function aa(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:D_(t,i)}];for(const f of n){const m=f.trim();m&&l.push({type:"image",url:m,image_url:m})}if(o)for(const f of o)l.push({type:"skill",name:f.name,path:f.path});const u=i.map(f=>({label:f.label,path:f.path,fsPath:f.fsPath})),c={threadId:e,input:l};u.length>0&&(c.attachments=u),typeof r=="string"&&r.length>0&&(c.model=r),typeof s=="string"&&s.length>0&&(c.effort=s),await on("turn/start",c)}catch(a){throw Ss(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function L_(e,t){const n=e.trim(),r=(t==null?void 0:t.trim())||"";if(n)try{if(!r)throw new Error("turn/interrupt requires turnId");await on("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw Ss(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function j_(e){await on("setDefaultModel",{model:e})}async function U_(e){const t=e==="fast"?"fast":"standard";await on("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 F_(){const e=await on("model/list",{}),t=[];for(const n of e.data){const r=n.id||n.model;!r||t.includes(r)||t.push(r)}return t}async function B_(){const e=await on("config/read",{}),t=e.config.model??"",n=S_(e.config.model_reasoning_effort),r=I_(e.config.service_tier);return{model:t,reasoningEffort:n,speedMode:r}}async function H_(){return await on("account/rateLimits/read")}function W_(e){const t=e&&typeof e=="object"&&!Array.isArray(e)?e:{},n=o=>{if(!Array.isArray(o))return[];const i=[];for(const a of o)typeof a=="string"&&a.length>0&&!i.includes(a)&&i.push(a);return i},r=t.labels,s={};if(r&&typeof r=="object"&&!Array.isArray(r))for(const[o,i]of Object.entries(r))typeof o=="string"&&o.length>0&&typeof i=="string"&&(s[o]=i);return{order:n(t.order),labels:s,active:n(t.active)}}async function Fa(){const e=await fetch("/codex-api/workspace-roots-state"),t=await e.json();if(!e.ok)throw new Error("Failed to load workspace roots state");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{};return W_(n.data)}async function V_(e){const t=await fetch("/codex-api/worktree/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceCwd:e})}),n=await t.json();if(!t.ok||!n.data)throw new Error(n.error||"Failed to create worktree");return n.data}async function G_(e,t){const n=await fetch("/codex-api/worktree/auto-commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e,message:t})}),r=await n.json();if(!n.ok||!r.data)throw new Error(r.error||"Failed to auto-commit worktree changes");return r.data}async function z_(e,t){const n=await fetch("/codex-api/worktree/rollback-to-message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e,message:t})}),r=await n.json();if(!n.ok||!r.data)throw new Error(r.error||"Failed to rollback worktree to message commit");return r.data}async function au(){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){if(!(await fetch("/codex-api/workspace-roots-state",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save workspace roots state")}async function lu(e,t){const n=await fetch("/codex-api/project-root",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,createIfMissing:(t==null?void 0:t.createIfMissing)===!0,label:(t==null?void 0:t.label)??""})}),r=await n.json();if(!n.ok){const a=Si(r,"Failed to open project root");throw new Error(a)}const s=r&&typeof r=="object"&&!Array.isArray(r)?r:{},o=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{};return typeof o.path=="string"?o.path.trim():""}async function K_(e){const t=new URLSearchParams({basePath:e}),n=await fetch(`/codex-api/project-root-suggestion?${t.toString()}`),r=await n.json();if(!n.ok){const i=Si(r,"Failed to suggest project name");throw new Error(i)}const s=r&&typeof r=="object"&&!Array.isArray(r)?r:{},o=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{};return{name:typeof o.name=="string"?o.name.trim():"",path:typeof o.path=="string"?o.path.trim():""}}async function J_(e,t,n=20){const r=e.trim();if(!r)return[];const s=await fetch("/codex-api/composer-file-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:r,query:t.trim(),limit:n})}),o=await s.json();if(!s.ok){const u=Si(o,"Failed to search files");throw new Error(u)}const i=o&&typeof o=="object"&&!Array.isArray(o)?o:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const u of a){if(!u||typeof u!="object"||Array.isArray(u))continue;const f=u.path,m=typeof f=="string"?f.trim():"";m&&l.push({path:m})}return l}async function Y_(e,t=200){const n=await fetch("/codex-api/thread-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,limit:t})}),r=await n.json();if(!n.ok)throw new Error(r.error||"Failed to search threads");return r.data??{threadIds:[],indexedThreadCount:0}}function X_(e){const t=e.getUTCFullYear(),n=String(e.getUTCMonth()+1).padStart(2,"0"),r=String(e.getUTCDate()).padStart(2,"0");return`${t}-${n}-${r}`}async function Q_(e,t=6){const n=Math.min(10,Math.max(1,Math.floor(t)));if(e.startsWith("search-")){const c=new Date;e==="search-daily"?c.setUTCDate(c.getUTCDate()-1):e==="search-weekly"?c.setUTCDate(c.getUTCDate()-7):c.setUTCDate(c.getUTCDate()-30);const f=new URLSearchParams({q:`created:>=${X_(c)}`,sort:"stars",order:"desc",per_page:String(n)}),m=await fetch(`https://api.github.com/search/repositories?${f.toString()}`,{headers:{Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}});if(!m.ok)throw new Error(`Failed to fetch GitHub search projects (${m.status})`);const k=await m.json(),U=k&&typeof k=="object"&&!Array.isArray(k)?k:{},P=Array.isArray(U.items)?U.items:[],F=[];for(const R of P){if(!R||typeof R!="object"||Array.isArray(R))continue;const A=R,B=typeof A.id=="number"?A.id:0,W=typeof A.full_name=="string"?A.full_name.trim():"",ce=typeof A.html_url=="string"?A.html_url.trim():"";if(!B||!W||!ce)continue;const[me="",ve=""]=W.split("/",2);F.push({id:B,fullName:W,owner:me,repo:ve,url:ce,description:su(W,typeof A.description=="string"?A.description:""),language:typeof A.language=="string"?A.language.trim():"",stars:typeof A.stargazers_count=="number"?A.stargazers_count:0})}return F}const r=e==="trending-daily"?"daily":e==="trending-weekly"?"weekly":"monthly",s=new URLSearchParams({since:r,limit:String(n)}),o=await fetch(`/codex-api/github-trending?${s.toString()}`),i=await o.json();if(!o.ok){const c=Si(i,"Failed to fetch GitHub trending projects");throw new Error(c)}const a=i&&typeof i=="object"&&!Array.isArray(i)?i:{},l=Array.isArray(a.data)?a.data:[],u=[];for(const c of l){if(!c||typeof c!="object"||Array.isArray(c))continue;const f=c,m=typeof f.id=="number"?f.id:0,k=typeof f.fullName=="string"?f.fullName.trim():"",U=typeof f.url=="string"?f.url.trim():"";if(!m||!k||!U)continue;const[P="",F=""]=k.split("/",2);u.push({id:m,fullName:k,owner:P,repo:F,url:U,description:su(k,typeof f.description=="string"?f.description:""),language:typeof f.language=="string"?f.language.trim():"",stars:typeof f.stars=="number"?f.stars:0})}return u}function Si(e,t){const r=(e&&typeof e=="object"&&!Array.isArray(e)?e:{}).error;return typeof r=="string"&&r.trim().length>0?r:t}async function Z_(){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 la(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 ek(e,t){var n;try{return((n=(await on("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function tk(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await on("skills/list",t),r=[],s=new Set;for(const o of n.data)for(const i of o.skills)!i.name||s.has(i.path)||(s.add(i.path),r.push({name:i.name,description:i.shortDescription||i.description||"",path:i.path,scope:i.scope,enabled:i.enabled}));return r}catch{return[]}}async function cu(e){try{const t=new FormData;t.append("file",e);const n=await fetch("/codex-api/upload-file",{method:"POST",body:t});return n.ok?(await n.json()).path??null:null}catch{return null}}const nk={},rk={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function sk(e,t){return w(),T("svg",rk,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m12 5l0 14m-6-8l6-6l6 6"},null,-1)])])}const ok=st(nk,[["render",sk]]),ik={},ak={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function lk(e,t){return w(),T("svg",ak,[...t[0]||(t[0]=[p("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 ck=st(ik,[["render",lk]]),uk={},dk={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function fk(e,t){return w(),T("svg",dk,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 2m0 3a3 3 0 0 1 3-3h0a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3h0a3 3 0 0 1-3-3zM5 10a7 7 0 0 0 14 0M8 21h8M12 17v4"},null,-1)])])}const hk=st(uk,[["render",fk]]),pk={},mk={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function gk(e,t){return w(),T("svg",mk,[...t[0]||(t[0]=[p("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),p("path",{fill:"currentColor",d:"M8 5a3 3 0 0 0 -3 3v8a3 3 0 0 0 3 3h8a3 3 0 0 0 3 -3v-8a3 3 0 0 0 -3 -3h-8z"},null,-1)])])}const uu=st(pk,[["render",gk]]),vk=["disabled"],yk={class:"composer-dropdown-value"},wk={class:"composer-dropdown-menu"},bk={key:0,class:"composer-dropdown-search-wrap"},_k=["placeholder","onKeydown"],kk={class:"composer-dropdown-options",role:"listbox"},Tk=["onClick"],Sk={key:0,class:"composer-dropdown-empty"},Ik={key:1,class:"composer-dropdown-add-wrap"},Ek=["placeholder","onKeydown"],Ck=Ht({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},selectedPrefixIcon:{},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},showAddAction:{type:Boolean},addActionLabel:{},defaultAddValue:{},addPlaceholder:{}},emits:["update:modelValue","add"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(null),a=D(!1),l=D(""),u=D(!1),c=D(""),f=fe(()=>{var we;const le=n.options.find(Y=>Y.value===n.modelValue);return le?le.label:((we=n.placeholder)==null?void 0:we.trim())||""}),m=fe(()=>n.openDirection??"down"),k=fe(()=>n.enableSearch===!0),U=fe(()=>n.showAddAction===!0),P=fe(()=>{var le;return((le=n.searchPlaceholder)==null?void 0:le.trim())||"Quick search projects"}),F=fe(()=>{var le;return((le=n.addActionLabel)==null?void 0:le.trim())||"Add new project"}),R=fe(()=>{var le;return((le=n.addPlaceholder)==null?void 0:le.trim())||"Project name or absolute path"}),A=fe(()=>{const le=l.value.trim().toLowerCase();return le?n.options.filter(we=>we.label.toLowerCase().includes(le)||we.value.toLowerCase().includes(le)):n.options});function B(){n.disabled||(a.value=!a.value)}function W(le){r("update:modelValue",le),a.value=!1,l.value=""}function ce(){var le;u.value=!0,c.value=((le=n.defaultAddValue)==null?void 0:le.trim())||"",Yt(()=>{var we;return(we=i.value)==null?void 0:we.focus()})}function me(){if(l.value.length>0){l.value="";return}a.value=!1}function ve(){const le=c.value.trim();le&&(r("add",le),u.value=!1,c.value="",a.value=!1,l.value="")}function Ie(){u.value=!1,c.value="",a.value=!1,l.value=""}function re(le){if(!a.value)return;const we=s.value;if(!we)return;const Y=le.target;Y instanceof Node&&(we.contains(Y)||(a.value=!1,l.value="",u.value=!1,c.value=""))}return ut(a,le=>{if(!le){u.value=!1,c.value="";return}k.value&&Yt(()=>{var we;return(we=o.value)==null?void 0:we.focus()})}),pr(()=>{window.addEventListener("pointerdown",re)}),mr(()=>{window.removeEventListener("pointerdown",re)}),(le,we)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[p("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:B},[e.selectedPrefixIcon?(w(),ft(Yo(e.selectedPrefixIcon),{key:0,class:"composer-dropdown-prefix-icon"})):ae("",!0),p("span",yk,ie(f.value),1),Re(Ti,{class:"composer-dropdown-chevron"})],8,vk),a.value?(w(),T("div",{key:0,class:it(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":m.value==="up","composer-dropdown-menu-wrap-down":m.value==="down"}])},[p("div",wk,[k.value?(w(),T("div",bk,[cr(p("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":we[0]||(we[0]=Y=>l.value=Y),class:"composer-dropdown-search-input",type:"text",placeholder:P.value,onKeydown:dn(ct(me,["prevent"]),["esc"])},null,40,_k),[[ur,l.value]])])):ae("",!0),p("ul",kk,[(w(!0),T(Be,null,St(A.value,Y=>(w(),T("li",{key:Y.value},[p("button",{class:it(["composer-dropdown-option",{"is-selected":Y.value===e.modelValue}]),type:"button",onClick:Te=>W(Y.value)},ie(Y.label),11,Tk)]))),128)),A.value.length===0?(w(),T("li",Sk," No matching projects ")):ae("",!0)]),U.value?(w(),T("div",Ik,[u.value?(w(),T(Be,{key:0},[cr(p("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":we[1]||(we[1]=Y=>c.value=Y),class:"composer-dropdown-add-input",type:"text",placeholder:R.value,onKeydown:[dn(ct(ve,["prevent"]),["enter"]),dn(ct(Ie,["prevent"]),["esc"])]},null,40,Ek),[[ur,c.value]]),p("div",{class:"composer-dropdown-add-actions"},[p("button",{type:"button",class:"composer-dropdown-add-btn",onClick:ve},"Open"),p("button",{type:"button",class:"composer-dropdown-add-btn",onClick:Ie},"Cancel")])],64)):(w(),T("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:ce},ie(F.value),1))])):ae("",!0)])],2)):ae("",!0)],512))}}),Ks=st(Ck,[["__scopeId","data-v-47426238"]]),Ak=["disabled"],Rk={class:"search-dropdown-value"},Pk={class:"search-dropdown-search-wrap"},xk=["placeholder","onKeydown"],Mk={key:0,class:"search-dropdown-list",role:"listbox"},$k=["onClick","onPointerenter"],Ok={class:"search-dropdown-option-check"},Nk={class:"search-dropdown-option-label"},Dk={key:0,class:"search-dropdown-option-desc"},Lk={key:1,class:"search-dropdown-empty"},jk=Ht({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(!1),a=D(""),l=D(0),u=fe(()=>n.openDirection??"down"),c=fe(()=>new Set(n.selectedValues)),f=fe(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const A=n.options.find(B=>B.value===n.selectedValues[0]);return(A==null?void 0:A.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),m=fe(()=>{const A=a.value.toLowerCase().trim();return A?n.options.filter(B=>{var W;return B.label.toLowerCase().includes(A)||(((W=B.description)==null?void 0:W.toLowerCase().includes(A))??!1)}):n.options});function k(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,Yt(()=>{var A;return(A=o.value)==null?void 0:A.focus()})))}function U(A){r("toggle",A.value,!c.value.has(A.value))}function P(A){m.value.length!==0&&(l.value=(l.value+A+m.value.length)%m.value.length)}function F(){const A=m.value[l.value];A&&U(A)}function R(A){if(!i.value)return;const B=s.value;if(!B)return;const W=A.target;W instanceof Node&&(B.contains(W)||(i.value=!1))}return ut(a,()=>{l.value=0}),pr(()=>window.addEventListener("pointerdown",R)),mr(()=>window.removeEventListener("pointerdown",R)),(A,B)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[p("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:k},[p("span",Rk,ie(f.value),1),Re(Ti,{class:"search-dropdown-chevron"})],8,Ak),i.value?(w(),T("div",{key:0,class:it(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":u.value==="up","search-dropdown-menu-wrap-down":u.value==="down"}])},[p("div",Pk,[cr(p("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":B[0]||(B[0]=W=>a.value=W),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[B[1]||(B[1]=dn(ct(W=>i.value=!1,["prevent"]),["escape"])),dn(ct(F,["prevent"]),["enter"]),B[2]||(B[2]=dn(ct(W=>P(1),["prevent"]),["arrow-down"])),B[3]||(B[3]=dn(ct(W=>P(-1),["prevent"]),["arrow-up"]))]},null,40,xk),[[ur,a.value]])]),m.value.length>0?(w(),T("ul",Mk,[(w(!0),T(Be,null,St(m.value,(W,ce)=>(w(),T("li",{key:W.value},[p("button",{class:it(["search-dropdown-option",{"is-selected":c.value.has(W.value),"is-highlighted":ce===l.value}]),type:"button",onClick:me=>U(W),onPointerenter:me=>l.value=ce},[p("span",Ok,ie(c.value.has(W.value)?"✓":""),1),p("span",Nk,ie(W.label),1),W.description?(w(),T("span",Dk,ie(W.description),1)):ae("",!0)],42,$k)]))),128))])):(w(),T("div",Lk,"No results"))],2)):ae("",!0)],512))}}),Uk=st(jk,[["__scopeId","data-v-a0f2edd4"]]),Fk={class:"skill-picker-header"},Bk=["onKeydown"],Hk={key:0,class:"skill-picker-list",role:"listbox"},Wk=["onClick","onPointerenter"],Vk={class:"skill-picker-name"},Gk={key:0,class:"skill-picker-desc"},zk={key:1,class:"skill-picker-empty"},qk=Ht({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(""),a=D(0),l=fe(()=>{const m=i.value.toLowerCase().trim();return m?n.skills.filter(k=>k.name.toLowerCase().includes(m)||k.description.toLowerCase().includes(m)):n.skills}),u=fe(()=>{const m={};return n.anchorBottom!=null&&(m.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(m.left=`${n.anchorLeft}px`),m});function c(m){l.value.length!==0&&(a.value=(a.value+m+l.value.length)%l.value.length)}function f(){const m=l.value[a.value];m&&r("select",m)}return ut(()=>n.visible,m=>{m&&(i.value="",a.value=0,Yt(()=>{var k;return(k=o.value)==null?void 0:k.focus()}))}),ut(i,()=>{a.value=0}),(m,k)=>e.visible?(w(),T("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:Jr(u.value)},[p("div",Fk,[cr(p("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":k[0]||(k[0]=U=>i.value=U),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[k[1]||(k[1]=dn(ct(U=>m.$emit("close"),["prevent"]),["escape"])),dn(ct(f,["prevent"]),["enter"]),k[2]||(k[2]=dn(ct(U=>c(1),["prevent"]),["arrow-down"])),k[3]||(k[3]=dn(ct(U=>c(-1),["prevent"]),["arrow-up"]))]},null,40,Bk),[[ur,i.value]])]),l.value.length>0?(w(),T("ul",Hk,[(w(!0),T(Be,null,St(l.value,(U,P)=>(w(),T("li",{key:U.path},[p("button",{class:it(["skill-picker-item",{"is-highlighted":P===a.value}]),type:"button",onClick:F=>m.$emit("select",U),onPointerenter:F=>a.value=P},[p("span",Vk,ie(U.name),1),U.description?(w(),T("span",Gk,ie(U.description),1)):ae("",!0)],42,Wk)]))),128))])):(w(),T("div",zk,"No skills found"))],4)):ae("",!0)}}),Kk=st(qk,[["__scopeId","data-v-ff3fb7dc"]]),Jk={key:0,class:"thread-composer-dictation-error"},Yk={key:0,class:"thread-composer-attachments"},Xk=["src","alt"],Qk=["aria-label","disabled","onClick"],Zk={key:1,class:"thread-composer-folder-chips"},e0=["title"],t0={class:"thread-composer-folder-chip-meta"},n0=["aria-label","disabled","onClick"],r0={key:2,class:"thread-composer-file-chips"},s0=["title"],o0=["aria-label","disabled","onClick"],i0={key:3,class:"thread-composer-skill-chips"},a0={class:"thread-composer-skill-chip-name"},l0=["aria-label","onClick"],c0={class:"thread-composer-input-wrap"},u0={key:0,class:"thread-composer-file-mentions"},d0=["onMousedown"],f0={key:1,class:"thread-composer-file-mention-icon-markdown"},h0={class:"thread-composer-file-mention-text"},p0={class:"thread-composer-file-mention-name"},m0={key:0,class:"thread-composer-file-mention-dir"},g0={key:1,class:"thread-composer-file-mention-empty"},v0=["placeholder","disabled"],y0=["disabled"],w0={key:0,class:"thread-composer-attach-menu"},b0=["disabled"],_0=["disabled"],k0=["disabled"],T0=["aria-checked","aria-label","disabled"],S0={class:"thread-composer-attach-setting-copy"},I0={class:"thread-composer-attach-setting-description"},E0={key:0,class:"thread-composer-dictation-waveform-wrap","aria-hidden":"true"},C0={key:1,class:"thread-composer-dictation-timer"},A0=["aria-label","title","disabled"],R0=["disabled"],P0=["aria-label","title","disabled"],x0=["disabled"],M0=["disabled"],$0=["disabled"],O0=Ht({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},models:{},selectedModel:{},selectedReasoningEffort:{},selectedSpeedMode:{},skills:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},isUpdatingSpeedMode:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{},dictationClickToToggle:{type:Boolean},prependDraftRequest:{},dictationAutoSend:{type:Boolean},dictationLanguage:{}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort","update:selected-speed-mode"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=D(""),i=D([]),a=D([]),l=D([]),u=D([]),c=D(""),{state:f,isSupported:m,recordingDurationMs:k,waveformCanvasRef:U,startRecording:P,stopRecording:F,toggleRecording:R,cancel:A}=r_({getLanguage:()=>r.dictationLanguage??"auto",onTranscript:j=>{if(o.value=o.value?`${o.value}
39
- ${j}`:j,c.value="",r.dictationAutoSend!==!1){const X=r.isTurnInProgress?q.value:"steer";z(X,{rollbackLatestUserTurn:X==="steer"&&Ye}),Ye=!1;return}Yt(()=>{var X;return(X=ve.value)==null?void 0:X.focus()})},onEmpty:()=>{c.value=r.dictationClickToToggle?"No speech detected. Click again after speaking.":"No speech detected. Hold the mic and speak."},onError:j=>{if(j instanceof DOMException&&j.name==="NotAllowedError"){c.value="Microphone access was denied.";return}c.value=j instanceof Error?j.message:"Dictation failed."}}),B=D(null),W=D(null),ce=D(null),me=D(null),ve=D(null),Ie=D(!1),re=D(!1),le=D(null),we=D(""),Y=D([]),Te=D(!1),xe=D(0),Le=D(0);let Pe=0,Oe=null,Ee=!1,Ye=!1;const Ze=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),Ne=[{value:"none",label:"None"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}];function nt(j){return j.trim().replace(/^gpt/i,"GPT")}const gt=fe(()=>r.models.map(j=>({value:j,label:nt(j)}))),at=fe(()=>r.skills??[]),et=fe(()=>a.value.map(j=>j.path)),Xe=fe(()=>(r.skills??[]).map(j=>({value:j.path,label:j.name,description:j.description}))),K=fe(()=>r.disabled||r.isUpdatingSpeedMode||!r.activeThreadId?!1:o.value.trim().length>0||i.value.length>0||l.value.length>0),he=fe(()=>o.value.trim().length>0||i.value.length>0||a.value.length>0||l.value.length>0||u.value.length>0),ue=fe(()=>{const j=new Set;for(const X of u.value)for(const se of X.filePaths)j.add(se);return l.value.filter(X=>!j.has(X.fsPath))}),be=fe(()=>r.disabled||!r.activeThreadId),$e=fe(()=>r.selectedModel.trim()==="gpt-5.4"),g=fe(()=>r.selectedSpeedMode==="fast"&&$e.value),b=fe(()=>be.value||r.isUpdatingSpeedMode===!0),x=fe(()=>r.isUpdatingSpeedMode?"Saving speed setting...":r.selectedSpeedMode==="fast"?"About 1.5x faster, with credits used at 2x":"Default speed with normal credit usage"),q=fe(()=>r.inProgressSubmitMode==="steer"?"steer":"queue"),G=fe(()=>f.value==="recording"),N=fe(()=>f.value==="recording"?"Stop dictation":r.dictationClickToToggle?"Click to dictate":"Hold to dictate"),V=fe(()=>f.value==="idle"?c.value.trim():""),J=fe(()=>{const j=Math.max(0,Math.floor(k.value/1e3)),X=Math.floor(j/60),se=j%60;return`${X}:${String(se).padStart(2,"0")}`}),Q=fe(()=>r.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function z(j="steer",X){var qe;const se=o.value.trim();if(K.value){if(s("submit",{text:se,imageUrls:i.value.map(Pt=>Pt.url),fileAttachments:[...l.value],skills:a.value.map(Pt=>({name:Pt.name,path:Pt.path})),mode:j,rollbackLatestUserTurn:(X==null?void 0:X.rollbackLatestUserTurn)===!0}),de(),Ze){(qe=ve.value)==null||qe.blur();return}Yt(()=>{var Pt;return(Pt=ve.value)==null?void 0:Pt.focus()})}}function _e(j){Le.value+=1,o.value=j.text,i.value=j.imageUrls.map((X,se)=>({id:`queued-${Date.now()}-${se}-${Math.random().toString(36).slice(2,8)}`,name:`Image ${se+1}`,url:X})),a.value=j.skills.map(X=>(r.skills??[]).find(se=>se.path===X.path)??{name:X.name,description:"",path:X.path}),l.value=j.fileAttachments.map(X=>({...X})),u.value=[],c.value="",Ie.value=!1,re.value=!1,_()}function de(){_e({text:"",imageUrls:[],fileAttachments:[],skills:[]})}function Se(){s("interrupt")}function Me(j){s("update:selected-model",j)}function De(j){s("update:selected-reasoning-effort",j)}function Fe(){b.value||s("update:selected-speed-mode",r.selectedSpeedMode==="fast"?"standard":"fast")}function He(){r.dictationClickToToggle&&(c.value&&(c.value=""),f.value==="idle"&&(Ye=r.isTurnInProgress===!0&&r.inProgressSubmitMode==="steer"),R())}function ot(j){if(r.dictationClickToToggle||(j.preventDefault(),Ee))return;Ee=!0;const X=j.currentTarget;if(X)try{X.setPointerCapture(j.pointerId)}catch{}c.value&&(c.value=""),Ye=r.isTurnInProgress===!0&&r.inProgressSubmitMode==="steer",window.addEventListener("pointerup",tt),window.addEventListener("pointercancel",tt),window.addEventListener("blur",tt),P()}function tt(){r.dictationClickToToggle||Ee&&(Ee=!1,window.removeEventListener("pointerup",tt),window.removeEventListener("pointercancel",tt),window.removeEventListener("blur",tt),F())}function vt(){be.value||(Ie.value=!Ie.value)}function yt(){var j;(j=W.value)==null||j.click()}function jt(){var j;(j=ce.value)==null||j.click()}function zt(){var j;(j=me.value)==null||j.click()}function kt(j){i.value=i.value.filter(X=>X.id!==j)}function Rt(j){a.value=a.value.filter(X=>X.path!==j)}function wt(j){l.value=l.value.filter(X=>X.fsPath!==j)}function Dt(j){const X=u.value.find(qe=>qe.id===j);if(!X)return;const se=new Set(X.filePaths);l.value=l.value.filter(qe=>!se.has(qe.fsPath)),u.value=u.value.filter(qe=>qe.id!==j)}function Qt(j){return j.total<=0?0:Math.round(j.processed/j.total*100)}function qt(j,X){const se=j.replace(/\\/g,"/");if(l.value.some(bn=>bn.fsPath===se))return;const qe=se.split("/").filter(Boolean),Pt=(X==null?void 0:X.trim())||qe[qe.length-1]||se;l.value=[...l.value,{label:Pt,path:se,fsPath:se}]}function xt(j){return j.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(j.name)}function Tt(j){if(!j||j.length===0)return;const X=Le.value;for(const se of Array.from(j))if(xt(se)){const qe=new FileReader;qe.onload=()=>{X===Le.value&&typeof qe.result=="string"&&i.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:se.name,url:qe.result})},qe.readAsDataURL(se)}else cu(se).then(qe=>{X===Le.value&&qe&&qt(qe)}).catch(()=>{})}async function Kt(j){if(!j||j.length===0)return;const X=Le.value,se=Array.from(j),Pt=(se[0].webkitRelativePath||se[0].name).split("/").filter(Boolean)[0]||"Folder",bn=`${Date.now()}-${Math.random().toString(36).slice(2)}`;u.value=[...u.value,{id:bn,name:Pt,total:se.length,processed:0,filePaths:[],isUploading:!0}];const _n=an=>{X===Le.value&&(u.value=u.value.map(Vt=>Vt.id===bn?an(Vt):Vt))};for(const an of se)try{const Vt=await cu(an);if(X!==Le.value)return;if(Vt){const Dn=an.webkitRelativePath||an.name;qt(Vt,Dn),_n(I=>({...I,processed:I.processed+1,filePaths:[...I.filePaths,Vt]}));continue}_n(Dn=>({...Dn,processed:Dn.processed+1}))}catch{_n(Vt=>({...Vt,processed:Vt.processed+1}))}_n(an=>({...an,isUploading:!1}))}function It(j){j&&(j.value="")}function bt(j){const X=j.target;Tt((X==null?void 0:X.files)??null),It(X),Ie.value=!1}function Jt(j){const X=j.target;Tt((X==null?void 0:X.files)??null),It(X),Ie.value=!1}function yn(j){const X=j.target;Kt((X==null?void 0:X.files)??null),It(X),Ie.value=!1}function $t(){c.value&&(c.value="");const X=o.value.startsWith("/");X!==re.value&&(re.value=X),S()}function Wt(j){if(Te.value){if(j.key==="Escape"){j.preventDefault(),_();return}if(j.key==="ArrowDown"){j.preventDefault(),Y.value.length>0&&(xe.value=(xe.value+1)%Y.value.length);return}if(j.key==="ArrowUp"){if(j.preventDefault(),Y.value.length>0){const se=Y.value.length;xe.value=(xe.value+se-1)%se}return}if(j.key==="Enter"||j.key==="Tab"){j.preventDefault();const se=Y.value[xe.value];se?O(se):_();return}}if(r.sendWithEnter!==!1?j.key==="Enter"&&!j.shiftKey:j.key==="Enter"&&(j.metaKey||j.ctrlKey)){j.preventDefault(),z(r.isTurnInProgress?q.value:"steer");return}if(re.value){if(j.key==="Escape"){j.preventDefault(),wn();return}if(j.key==="ArrowDown"||j.key==="ArrowUp"){j.preventDefault();return}}}function wn(){var j;re.value=!1,(j=ve.value)==null||j.focus()}function _(){Te.value=!1,le.value=null,we.value="",Y.value=[],xe.value=0}function S(){const j=ve.value;if(!j){_();return}const X=j.selectionStart??o.value.length,qe=o.value.slice(0,X).match(/(^|\s)(@[^\s@]*)$/);if(!qe){_();return}const Pt=qe[2]??"",bn=Pt.length,_n=X-bn;le.value=_n,we.value=Pt.slice(1),Te.value=!0,E()}async function E(){if(!Te.value)return;const j=(r.cwd??"").trim();if(!j){Y.value=[];return}Oe&&clearTimeout(Oe);const X=++Pe;Oe=setTimeout(async()=>{try{const se=await J_(j,we.value,20);if(!Te.value||X!==Pe)return;Y.value=se,xe.value=0}catch{if(!Te.value||X!==Pe)return;Y.value=[]}},120)}function O(j){const X=ve.value,se=le.value;if(se!==null&&X){const qe=X.selectionStart??o.value.length;o.value=`${o.value.slice(0,se)}${o.value.slice(qe)}`.trimEnd()}qt(j.path),_(),Yt(()=>X==null?void 0:X.focus())}function H(j){A(),_e(j),Yt(()=>{var X;return(X=ve.value)==null?void 0:X.focus()})}function oe(j){const X=j.lastIndexOf("/");return X<0?j:j.slice(X+1)}function Ce(j){const X=j.lastIndexOf("/");return X<=0?"":j.slice(0,X)}function ge(j){const X=oe(j),se=X.lastIndexOf(".");return se<=0?"":X.slice(se+1).toLowerCase()}function Ke(j){const X=ge(j);return X==="ts"?"TS":X==="tsx"?"TSX":X==="js"?"JS":X==="jsx"?"JSX":X==="json"?"{}":""}function lt(j){const X=ge(j);return X.startsWith("ts")?"ts":X.startsWith("js")?"js":X==="json"?"json":"default"}function rt(j){const X=ge(j);return X==="md"||X==="mdx"}function Nt(j){var X;a.value.some(se=>se.path===j.path)||(a.value=[...a.value,j]),o.value=o.value.startsWith("/")?"":o.value,re.value=!1,(X=ve.value)==null||X.focus()}function mn(j,X){if(X){const se=(r.skills??[]).find(qe=>qe.path===j);se&&!a.value.some(qe=>qe.path===j)&&(a.value=[...a.value,se])}else a.value=a.value.filter(se=>se.path!==j)}function Nn(j){if(!Ie.value)return;const X=B.value;if(!X)return;const se=j.target;!se||X.contains(se)||(Ie.value=!1)}return pr(()=>{document.addEventListener("click",Nn)}),t({hydrateDraft:H,hasUnsavedDraft:()=>he.value}),mr(()=>{document.removeEventListener("click",Nn),window.removeEventListener("pointerup",tt),window.removeEventListener("pointercancel",tt),window.removeEventListener("blur",tt),Oe&&clearTimeout(Oe)}),ut(()=>r.activeThreadId,()=>{A(),de()}),ut(()=>r.cwd,()=>{Te.value&&E()}),ut(()=>{var j;return(j=r.prependDraftRequest)==null?void 0:j.id},()=>{var X,se;const j=((se=(X=r.prependDraftRequest)==null?void 0:X.text)==null?void 0:se.trim())??"";j&&(o.value=o.value?`${j}
40
- ${o.value}`:j,$t(),Yt(()=>{var qe;return(qe=ve.value)==null?void 0:qe.focus()}))}),(j,X)=>(w(),T("form",{class:"thread-composer",onSubmit:X[2]||(X[2]=ct(se=>z("steer"),["prevent"]))},[V.value?(w(),T("p",Jk,ie(V.value),1)):ae("",!0),p("div",{class:it(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[i.value.length>0?(w(),T("div",Yk,[(w(!0),T(Be,null,St(i.value,se=>(w(),T("div",{key:se.id,class:"thread-composer-attachment"},[p("img",{class:"thread-composer-attachment-image",src:se.url,alt:se.name||"Selected image"},null,8,Xk),p("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${se.name||"image"}`,disabled:be.value,onClick:qe=>kt(se.id)}," x ",8,Qk)]))),128))])):ae("",!0),u.value.length>0?(w(),T("div",Zk,[(w(!0),T(Be,null,St(u.value,se=>(w(),T("span",{key:se.id,class:"thread-composer-folder-chip"},[Re(Tl,{class:"thread-composer-folder-chip-icon"}),p("span",{class:"thread-composer-folder-chip-name",title:se.name},ie(se.name),9,e0),p("span",t0,[se.isUploading?(w(),T(Be,{key:0},[no(ie(Qt(se))+"% uploading ("+ie(se.processed)+"/"+ie(se.total)+") ",1)],64)):(w(),T(Be,{key:1},[no(ie(se.filePaths.length)+" file"+ie(se.filePaths.length===1?"":"s"),1)],64))]),p("button",{class:"thread-composer-folder-chip-remove",type:"button","aria-label":`Remove folder ${se.name}`,disabled:be.value,onClick:qe=>Dt(se.id)},"×",8,n0)]))),128))])):ae("",!0),ue.value.length>0?(w(),T("div",r0,[(w(!0),T(Be,null,St(ue.value,se=>(w(),T("span",{key:se.fsPath,class:"thread-composer-file-chip"},[Re(ei,{class:"thread-composer-file-chip-icon"}),p("span",{class:"thread-composer-file-chip-name",title:se.fsPath},ie(se.label),9,s0),p("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${se.label}`,disabled:be.value,onClick:qe=>wt(se.fsPath)},"×",8,o0)]))),128))])):ae("",!0),a.value.length>0?(w(),T("div",i0,[(w(!0),T(Be,null,St(a.value,se=>(w(),T("span",{key:se.path,class:"thread-composer-skill-chip"},[p("span",a0,ie(se.name),1),p("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${se.name}`,onClick:qe=>Rt(se.path)},"×",8,l0)]))),128))])):ae("",!0),p("div",c0,[Te.value?(w(),T("div",u0,[Y.value.length>0?(w(!0),T(Be,{key:0},St(Y.value,(se,qe)=>(w(),T("button",{key:se.path,class:it(["thread-composer-file-mention-row",{"is-active":qe===xe.value}]),type:"button",onMousedown:ct(Pt=>O(se),["prevent"])},[Ke(se.path)?(w(),T("span",{key:0,class:it(["thread-composer-file-mention-icon-badge",`is-${lt(se.path)}`])},ie(Ke(se.path)),3)):rt(se.path)?(w(),T("span",f0,"↓")):(w(),ft(ei,{key:2,class:"thread-composer-file-mention-icon-file"})),p("span",h0,[p("span",p0,ie(oe(se.path)),1),Ce(se.path)?(w(),T("span",m0,ie(Ce(se.path)),1)):ae("",!0)])],42,d0))),128)):(w(),T("div",g0,"No matching files"))])):ae("",!0),cr(p("textarea",{ref_key:"inputRef",ref:ve,"onUpdate:modelValue":X[0]||(X[0]=se=>o.value=se),class:"thread-composer-input",placeholder:Q.value,disabled:be.value,onInput:$t,onKeydown:Wt},null,40,v0),[[ur,o.value]]),Re(Kk,{skills:at.value,visible:re.value,"anchor-bottom":44,"anchor-left":0,onSelect:Nt,onClose:wn},null,8,["skills","visible"])]),p("div",{class:it(["thread-composer-controls",{"thread-composer-controls--recording":G.value}])},[p("div",{ref_key:"attachMenuRootRef",ref:B,class:"thread-composer-attach"},[p("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:be.value,onClick:vt}," + ",8,y0),Ie.value?(w(),T("div",w0,[p("button",{class:"thread-composer-attach-item",type:"button",disabled:be.value,onClick:yt}," Add photos & files ",8,b0),p("button",{class:"thread-composer-attach-item",type:"button",disabled:be.value,onClick:zt}," Add folder ",8,_0),p("button",{class:"thread-composer-attach-item",type:"button",disabled:be.value,onClick:jt}," Take photo ",8,k0),X[4]||(X[4]=p("div",{class:"thread-composer-attach-separator"},null,-1)),$e.value?(w(),T("button",{key:0,class:"thread-composer-attach-setting",type:"button",role:"switch","aria-checked":e.selectedSpeedMode==="fast","aria-label":`Fast mode ${e.selectedSpeedMode==="fast"?"enabled":"disabled"}`,disabled:b.value,onClick:Fe},[p("span",S0,[X[3]||(X[3]=p("span",{class:"thread-composer-attach-setting-label"},"Fast mode",-1)),p("span",I0,ie(x.value),1)]),p("span",{class:it(["thread-composer-attach-switch",{"is-on":e.selectedSpeedMode==="fast","is-busy":e.isUpdatingSpeedMode,"is-disabled":b.value}])},null,2)],8,T0)):ae("",!0)])):ae("",!0)],512),G.value?ae("",!0):(w(),T(Be,{key:0},[Re(Ks,{class:"thread-composer-control","model-value":e.selectedModel,options:gt.value,"selected-prefix-icon":g.value?ck:null,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":Me},null,8,["model-value","options","selected-prefix-icon","disabled"]),Re(Uk,{class:"thread-composer-control",options:Xe.value,"selected-values":et.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:mn},null,8,["options","selected-values","disabled"]),Re(Ks,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:Ne,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":De},null,8,["model-value","disabled"])],64)),p("div",{class:it(["thread-composer-actions",{"thread-composer-actions--recording":G.value}])},[ye(f)==="recording"?(w(),T("div",E0,[p("canvas",{ref_key:"dictationWaveformCanvasRef",ref:U,class:"thread-composer-dictation-waveform"},null,512)])):ae("",!0),ye(f)==="recording"?(w(),T("span",C0,ie(J.value),1)):ae("",!0),ye(m)?(w(),T("button",{key:2,class:it(["thread-composer-mic",{"thread-composer-mic--active":ye(f)==="recording"}]),type:"button","aria-label":N.value,title:N.value,disabled:be.value,onClick:He,onPointerdown:ot,onPointerup:tt,onPointercancel:tt},[ye(f)==="recording"?(w(),ft(uu,{key:0,class:"thread-composer-mic-icon thread-composer-mic-icon--stop"})):(w(),ft(hk,{key:1,class:"thread-composer-mic-icon"}))],42,A0)):ae("",!0),e.isTurnInProgress?(w(),T("button",{key:3,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:Se},[Re(uu,{class:"thread-composer-stop-icon"})],8,R0)):(w(),T("button",{key:4,class:it(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&q.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&q.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${q.value}`:"Send",disabled:!K.value,onClick:X[1]||(X[1]=se=>z(e.isTurnInProgress?q.value:"steer"))},[Re(ok,{class:"thread-composer-submit-icon"})],10,P0))],2)],2)],2),p("input",{ref_key:"photoLibraryInputRef",ref:W,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:be.value,onChange:bt},null,40,x0),p("input",{ref_key:"cameraCaptureInputRef",ref:ce,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:be.value,onChange:Jt},null,40,M0),p("input",{ref_key:"folderPickerInputRef",ref:me,class:"thread-composer-hidden-input",type:"file",multiple:"",webkitdirectory:"",directory:"",disabled:be.value,onChange:yn},null,40,$0)],32))}}),du=st(O0,[["__scopeId","data-v-dab59279"]]),N0={key:0,class:"queued-messages"},D0={class:"queued-messages-inner"},L0={class:"queued-row-text"},j0={class:"queued-row-actions"},U0=["onClick"],F0=["onClick"],B0=["onClick"],H0=Ht({__name:"QueuedMessages",props:{messages:{}},emits:["edit","steer","delete"],setup(e){function t(n){var l,u,c;const r=n.text.trim();if(r)return r;const s=[],o=((l=n.imageUrls)==null?void 0:l.length)??0,i=((u=n.fileAttachments)==null?void 0:u.length)??0,a=((c=n.skills)==null?void 0:c.length)??0;return o>0&&s.push(`${o} image${o===1?"":"s"}`),i>0&&s.push(`${i} file${i===1?"":"s"}`),a>0&&s.push(`${a} skill${a===1?"":"s"}`),s.join(", ")||"(empty queued message)"}return(n,r)=>e.messages.length>0?(w(),T("div",N0,[p("div",D0,[(w(!0),T(Be,null,St(e.messages,s=>(w(),T("div",{key:s.id,class:"queued-row"},[r[1]||(r[1]=p("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),p("span",L0,ie(t(s)),1),p("div",j0,[p("button",{class:"queued-row-edit",type:"button",title:"Edit queued message",onClick:o=>n.$emit("edit",s.id)},"Edit",8,U0),p("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:o=>n.$emit("steer",s.id)},"Steer",8,F0),p("button",{class:"queued-row-delete",type:"button","aria-label":"Delete queued message",title:"Delete queued message",onClick:o=>n.$emit("delete",s.id)},[...r[0]||(r[0]=[p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7h16M10 11v6M14 11v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"})],-1)])],8,B0)])]))),128))])])):ae("",!0)}}),W0=st(H0,[["__scopeId","data-v-1394d0f8"]]),V0={key:0,class:"rate-limit-status","aria-live":"polite"},G0=["title"],z0={class:"rate-limit-card-header"},q0={class:"rate-limit-card-title"},K0={key:0,class:"rate-limit-card-plan"},J0={class:"rate-limit-card-metrics"},Y0={key:0,class:"rate-limit-card-footer"},X0=Ht({__name:"RateLimitStatus",props:{snapshots:{}},setup(e){function t(R){var A,B;return((A=R.limitId)==null?void 0:A.trim())||((B=R.limitName)==null?void 0:B.trim())||"__default__"}function n(R){var A,B;return((A=R.limitName)==null?void 0:A.trim())||((B=R.limitId)==null?void 0:B.trim())||"Rate limits"}function r(R){const A=R.trim();return A?A.replace(/[_-]+/g," ").replace(/\b\w/g,B=>B.toUpperCase()):""}function s(R){return!R||R<=0?"Window":R%1440===0?`${R/1440}d`:R%60===0?`${R/60}h`:R<60?`${R}m`:`${Math.round(R/60*10)/10}h`}function o(R){const A=Math.max(0,Math.min(100,100-R));return`${Math.round(A)}% left`}function i(R){return`${Math.round(R)}%`}function a(R,A){return{key:A,label:`${s(R.windowDurationMins)} ${o(R.usedPercent)}`}}function l(R){const A=[];return R.primary&&A.push(a(R.primary,"primary")),R.secondary&&A.push(a(R.secondary,"secondary")),A}function u(R){if(!R)return"";const A=new Date(R*1e3),B=A.getMonth()+1,W=String(A.getDate()).padStart(2,"0"),ce=String(A.getHours()).padStart(2,"0"),me=String(A.getMinutes()).padStart(2,"0");return`${B}.${W} ${ce}:${me}`}function c(R){if(!(R!=null&&R.resetsAt))return"";const A=R.resetsAt*1e3-Date.now();if(A<=0)return"Resetting now";const B=Math.round(A/6e4);if(B<60)return`Resets in ${B}m`;const W=Math.round(B/60);return W<24?`Resets in ${W}h`:`Resets in ${Math.round(W/24)}d`}function f(R){return[R.primary,R.secondary].filter(A=>A!==null)}function m(R){const A=f(R);return A.length===0?null:[...A].sort((B,W)=>{const ce=B.windowDurationMins??Number.MAX_SAFE_INTEGER,me=W.windowDurationMins??Number.MAX_SAFE_INTEGER;return ce!==me?ce-me:(B.resetsAt??Number.MAX_SAFE_INTEGER)-(W.resetsAt??Number.MAX_SAFE_INTEGER)})[0]}function k(R){const A=f(R);if(A.length===0)return"";const B=[...A].sort((ce,me)=>{const ve=ce.windowDurationMins??-1,Ie=me.windowDurationMins??-1;return ve!==Ie?Ie-ve:(me.resetsAt??-1)-(ce.resetsAt??-1)})[0],W=u(B.resetsAt);return W||""}function U(R){const A=R.credits;return A?A.unlimited?"Unlimited credits":A.balance?`Credits ${A.balance}`:A.hasCredits?"Credits available":"":""}function P(R){return[c(m(R)),k(R),U(R)].filter(A=>A.length>0)}function F(R){const A=[n(R)];for(const B of l(R))A.push(B.label);for(const B of f(R))A.push(`${s(B.windowDurationMins)} used ${i(B.usedPercent)}`);for(const B of P(R))A.push(B);return A.join(`
41
- `)}return(R,A)=>e.snapshots.length>0?(w(),T("aside",V0,[(w(!0),T(Be,null,St(e.snapshots,B=>(w(),T("div",{key:t(B),class:"rate-limit-card",title:F(B)},[p("div",z0,[p("span",q0,ie(n(B)),1),B.planType?(w(),T("span",K0,ie(r(B.planType)),1)):ae("",!0)]),p("div",J0,[(w(!0),T(Be,null,St(l(B),W=>(w(),T("span",{key:W.key,class:"rate-limit-card-metric"},ie(W.label),1))),128))]),P(B).length>0?(w(),T("div",Y0,ie(P(B).join(" | ")),1)):ae("",!0)],8,G0))),128))])):ae("",!0)}}),Q0=st(X0,[["__scopeId","data-v-df88906b"]]),Z0={class:"runtime-dropdown-trigger-label"},eT={key:0,class:"runtime-dropdown-menu-wrap"},tT={class:"runtime-dropdown-menu"},nT=["onClick"],rT={class:"runtime-dropdown-option-label"},sT={key:0,class:"runtime-dropdown-option-check"},oT=Ht({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(!1),i=[{value:"local",label:"Local project",icon:Tl},{value:"worktree",label:"New worktree",icon:Fo}],a=fe(()=>i.find(c=>c.value===n.modelValue)??i[0]);function l(c){r("update:modelValue",c),o.value=!1}function u(c){if(!o.value)return;const f=s.value;if(!f)return;const m=c.target;m instanceof Node&&(f.contains(m)||(o.value=!1))}return pr(()=>{window.addEventListener("pointerdown",u)}),mr(()=>{window.removeEventListener("pointerdown",u)}),(c,f)=>(w(),T("div",{ref_key:"rootRef",ref:s,class:"runtime-dropdown"},[p("button",{class:"runtime-dropdown-trigger",type:"button",onClick:f[0]||(f[0]=m=>o.value=!o.value)},[(w(),ft(Yo(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),p("span",Z0,ie(a.value.label),1),Re(Ti,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(w(),T("div",eT,[p("div",tT,[f[1]||(f[1]=p("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(w(),T(Be,null,St(i,m=>p("button",{key:m.value,class:it(["runtime-dropdown-option",{"is-selected":e.modelValue===m.value}]),type:"button",onClick:k=>l(m.value)},[(w(),ft(Yo(m.icon),{class:"runtime-dropdown-option-icon"})),p("span",rT,ie(m.label),1),e.modelValue===m.value?(w(),T("span",sT,"✓")):ae("",!0)],10,nT)),64))])])):ae("",!0)],512))}}),iT=st(oT,[["__scopeId","data-v-9c9b71e5"]]),aT={},lT={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function cT(e,t){return w(),T("svg",lT,[...t[0]||(t[0]=[p("circle",{cx:"11",cy:"11",r:"8"},null,-1),p("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const Ba=st(aT,[["render",cT]]),uT={class:"skill-card-top"},dT=["src","alt"],fT={key:1,class:"skill-card-avatar-fallback"},hT={class:"skill-card-info"},pT={class:"skill-card-header"},mT={class:"skill-card-name"},gT={key:0,class:"skill-card-badge-disabled"},vT={key:1,class:"skill-card-badge"},yT={class:"skill-card-owner"},wT={key:0,class:"skill-card-desc"},bT={key:1,class:"skill-card-date"},_T=Ht({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=fe(()=>{const s=t.skill.publishedAt;if(!s)return"";const o=new Date(s),a=Date.now()-s;return a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:a<2592e6?`${Math.floor(a/864e5)}d ago`:o.toLocaleDateString("en-US",{month:"short",day:"numeric"})});function r(s){const o=s.target;o.style.display="none"}return(s,o)=>(w(),T("button",{class:it(["skill-card",{"is-disabled":e.skill.installed&&e.skill.enabled===!1}]),type:"button",onClick:o[0]||(o[0]=i=>s.$emit("select",e.skill))},[p("div",uT,[e.skill.avatarUrl?(w(),T("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,dT)):(w(),T("div",fT,ie(e.skill.owner.charAt(0)),1)),p("div",hT,[p("div",pT,[p("span",mT,ie(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(w(),T("span",gT,"Disabled")):e.skill.installed?(w(),T("span",vT,"Installed")):ae("",!0)]),p("span",yT,ie(e.skill.owner),1)])]),e.skill.description?(w(),T("p",wT,ie(e.skill.description),1)):ae("",!0),n.value?(w(),T("span",bT,ie(n.value),1)):ae("",!0)],2))}}),fu=st(_T,[["__scopeId","data-v-2a1e8196"]]),kT={class:"sdm-panel"},TT={class:"sdm-header"},ST={class:"sdm-title-area"},IT=["src","alt"],ET={class:"sdm-title-col"},CT={class:"sdm-title-row"},AT={class:"sdm-title"},RT={key:0,class:"sdm-badge-disabled"},PT={class:"sdm-owner"},xT={class:"sdm-body"},MT={key:0,class:"sdm-desc"},$T={key:1,class:"sdm-readme-loading"},OT=["innerHTML"],NT=["href"],DT={class:"sdm-footer"},LT={class:"sdm-footer-actions"},jT=["disabled"],UT=["disabled"],FT=["disabled"],BT=Ht({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(""),i=D(!1),a=fe(()=>s.value??n.skill.enabled??!0),l=fe(()=>n.isInstalling===!0||n.isUninstalling===!0),u=fe(()=>{const P=o.value;if(!P)return"";const F=P.replace(/^---[\s\S]*?---\s*/,"");return c(F)});function c(P){return P.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/^### (.+)$/gm,"<h4>$1</h4>").replace(/^## (.+)$/gm,"<h3>$1</h3>").replace(/^# (.+)$/gm,"<h2>$1</h2>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.+)$/gm,"<li>$1</li>").replace(/(<li>.*<\/li>\n?)+/g,"<ul>$&</ul>").replace(/\n{2,}/g,"<br/><br/>").replace(/\n/g,"<br/>")}async function f(){if(!(!n.skill.owner||!n.skill.name)){i.value=!0,o.value="";try{const P=new URLSearchParams({owner:n.skill.owner,name:n.skill.name}),F=await fetch(`/codex-api/skills-hub/readme?${P}`);if(!F.ok)return;const R=await F.json();o.value=R.content??""}catch{}finally{i.value=!1}}}ut(()=>n.visible,P=>{P&&(s.value=null,o.value="",f())});function m(){r("install",n.skill)}function k(){r("uninstall",n.skill)}function U(){const P=!a.value;s.value=P,r("toggle-enabled",n.skill,P)}return(P,F)=>(w(),ft(Ko,{to:"body"},[e.visible?(w(),T("div",{key:0,class:"sdm-overlay",onClick:F[1]||(F[1]=ct(R=>P.$emit("close"),["self"]))},[p("div",kT,[p("div",TT,[p("div",ST,[e.skill.avatarUrl?(w(),T("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,IT)):ae("",!0),p("div",ET,[p("div",CT,[p("h3",AT,ie(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(w(),T("span",RT,"Disabled")):ae("",!0)]),p("span",PT,ie(e.skill.owner),1)])]),p("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:F[0]||(F[0]=R=>P.$emit("close"))},[Re(Sl,{class:"sdm-close-icon"})])]),p("div",xT,[e.skill.description?(w(),T("p",MT,ie(e.skill.description),1)):ae("",!0),i.value?(w(),T("div",$T,"Loading skill contents...")):o.value?(w(),T("div",{key:2,class:"sdm-readme",innerHTML:u.value},null,8,OT)):ae("",!0),p("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,NT)]),p("div",DT,[p("div",LT,[e.skill.installed?(w(),T("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:k},ie(n.isUninstalling?"Uninstalling...":"Uninstall"),9,jT)):(w(),T("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:m},ie(n.isInstalling?"Installing...":"Install"),9,UT)),e.skill.installed?(w(),T("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:U},ie(a.value?"Disable":"Enable"),9,FT)):ae("",!0)])])])])):ae("",!0)]))}}),HT=st(BT,[["__scopeId","data-v-19a385ca"]]),WT=()=>{};var hu={};/**
38
+ `}async function aa(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:D_(t,i)}];for(const f of n){const m=f.trim();m&&l.push({type:"image",url:m,image_url:m})}if(o)for(const f of o)l.push({type:"skill",name:f.name,path:f.path});const u=i.map(f=>({label:f.label,path:f.path,fsPath:f.fsPath})),c={threadId:e,input:l};u.length>0&&(c.attachments=u),typeof r=="string"&&r.length>0&&(c.model=r),typeof s=="string"&&s.length>0&&(c.effort=s),await on("turn/start",c)}catch(a){throw Ss(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function L_(e,t){const n=e.trim(),r=(t==null?void 0:t.trim())||"";if(n)try{if(!r)throw new Error("turn/interrupt requires turnId");await on("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw Ss(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function j_(e){await on("setDefaultModel",{model:e})}async function U_(e){const t=e==="fast"?"fast":"standard";await on("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 F_(){const e=await on("model/list",{}),t=[];for(const n of e.data){const r=n.id||n.model;!r||t.includes(r)||t.push(r)}return t}async function B_(){const e=await on("config/read",{}),t=e.config.model??"",n=S_(e.config.model_reasoning_effort),r=I_(e.config.service_tier);return{model:t,reasoningEffort:n,speedMode:r}}async function H_(){return await on("account/rateLimits/read")}function W_(e){const t=e&&typeof e=="object"&&!Array.isArray(e)?e:{},n=o=>{if(!Array.isArray(o))return[];const i=[];for(const a of o)typeof a=="string"&&a.length>0&&!i.includes(a)&&i.push(a);return i},r=t.labels,s={};if(r&&typeof r=="object"&&!Array.isArray(r))for(const[o,i]of Object.entries(r))typeof o=="string"&&o.length>0&&typeof i=="string"&&(s[o]=i);return{order:n(t.order),labels:s,active:n(t.active)}}async function Fa(){const e=await fetch("/codex-api/workspace-roots-state"),t=await e.json();if(!e.ok)throw new Error("Failed to load workspace roots state");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{};return W_(n.data)}async function V_(e){const t=await fetch("/codex-api/worktree/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceCwd:e})}),n=await t.json();if(!t.ok||!n.data)throw new Error(n.error||"Failed to create worktree");return n.data}async function G_(e,t){const n=await fetch("/codex-api/worktree/auto-commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e,message:t})}),r=await n.json();if(!n.ok||!r.data)throw new Error(r.error||"Failed to auto-commit worktree changes");return r.data}async function z_(e,t){const n=await fetch("/codex-api/worktree/rollback-to-message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e,message:t})}),r=await n.json();if(!n.ok||!r.data)throw new Error(r.error||"Failed to rollback worktree to message commit");return r.data}async function au(){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){if(!(await fetch("/codex-api/workspace-roots-state",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok)throw new Error("Failed to save workspace roots state")}async function lu(e,t){const n=await fetch("/codex-api/project-root",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,createIfMissing:(t==null?void 0:t.createIfMissing)===!0,label:(t==null?void 0:t.label)??""})}),r=await n.json();if(!n.ok){const a=Si(r,"Failed to open project root");throw new Error(a)}const s=r&&typeof r=="object"&&!Array.isArray(r)?r:{},o=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{};return typeof o.path=="string"?o.path.trim():""}async function K_(e){const t=new URLSearchParams({basePath:e}),n=await fetch(`/codex-api/project-root-suggestion?${t.toString()}`),r=await n.json();if(!n.ok){const i=Si(r,"Failed to suggest project name");throw new Error(i)}const s=r&&typeof r=="object"&&!Array.isArray(r)?r:{},o=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{};return{name:typeof o.name=="string"?o.name.trim():"",path:typeof o.path=="string"?o.path.trim():""}}async function J_(e,t,n=20){const r=e.trim();if(!r)return[];const s=await fetch("/codex-api/composer-file-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:r,query:t.trim(),limit:n})}),o=await s.json();if(!s.ok){const u=Si(o,"Failed to search files");throw new Error(u)}const i=o&&typeof o=="object"&&!Array.isArray(o)?o:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const u of a){if(!u||typeof u!="object"||Array.isArray(u))continue;const f=u.path,m=typeof f=="string"?f.trim():"";m&&l.push({path:m})}return l}async function Y_(e,t=200){const n=await fetch("/codex-api/thread-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,limit:t})}),r=await n.json();if(!n.ok)throw new Error(r.error||"Failed to search threads");return r.data??{threadIds:[],indexedThreadCount:0}}function X_(e){const t=e.getUTCFullYear(),n=String(e.getUTCMonth()+1).padStart(2,"0"),r=String(e.getUTCDate()).padStart(2,"0");return`${t}-${n}-${r}`}async function Q_(e,t=6){const n=Math.min(10,Math.max(1,Math.floor(t)));if(e.startsWith("search-")){const c=new Date;e==="search-daily"?c.setUTCDate(c.getUTCDate()-1):e==="search-weekly"?c.setUTCDate(c.getUTCDate()-7):c.setUTCDate(c.getUTCDate()-30);const f=new URLSearchParams({q:`created:>=${X_(c)}`,sort:"stars",order:"desc",per_page:String(n)}),m=await fetch(`https://api.github.com/search/repositories?${f.toString()}`,{headers:{Accept:"application/vnd.github+json","X-GitHub-Api-Version":"2022-11-28"}});if(!m.ok)throw new Error(`Failed to fetch GitHub search projects (${m.status})`);const T=await m.json(),U=T&&typeof T=="object"&&!Array.isArray(T)?T:{},P=Array.isArray(U.items)?U.items:[],F=[];for(const R of P){if(!R||typeof R!="object"||Array.isArray(R))continue;const A=R,B=typeof A.id=="number"?A.id:0,W=typeof A.full_name=="string"?A.full_name.trim():"",ce=typeof A.html_url=="string"?A.html_url.trim():"";if(!B||!W||!ce)continue;const[me="",ve=""]=W.split("/",2);F.push({id:B,fullName:W,owner:me,repo:ve,url:ce,description:su(W,typeof A.description=="string"?A.description:""),language:typeof A.language=="string"?A.language.trim():"",stars:typeof A.stargazers_count=="number"?A.stargazers_count:0})}return F}const r=e==="trending-daily"?"daily":e==="trending-weekly"?"weekly":"monthly",s=new URLSearchParams({since:r,limit:String(n)}),o=await fetch(`/codex-api/github-trending?${s.toString()}`),i=await o.json();if(!o.ok){const c=Si(i,"Failed to fetch GitHub trending projects");throw new Error(c)}const a=i&&typeof i=="object"&&!Array.isArray(i)?i:{},l=Array.isArray(a.data)?a.data:[],u=[];for(const c of l){if(!c||typeof c!="object"||Array.isArray(c))continue;const f=c,m=typeof f.id=="number"?f.id:0,T=typeof f.fullName=="string"?f.fullName.trim():"",U=typeof f.url=="string"?f.url.trim():"";if(!m||!T||!U)continue;const[P="",F=""]=T.split("/",2);u.push({id:m,fullName:T,owner:P,repo:F,url:U,description:su(T,typeof f.description=="string"?f.description:""),language:typeof f.language=="string"?f.language.trim():"",stars:typeof f.stars=="number"?f.stars:0})}return u}function Si(e,t){const r=(e&&typeof e=="object"&&!Array.isArray(e)?e:{}).error;return typeof r=="string"&&r.trim().length>0?r:t}async function Z_(){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 la(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 ek(e,t){var n;try{return((n=(await on("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function tk(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await on("skills/list",t),r=[],s=new Set;for(const o of n.data)for(const i of o.skills)!i.name||s.has(i.path)||(s.add(i.path),r.push({name:i.name,description:i.shortDescription||i.description||"",path:i.path,scope:i.scope,enabled:i.enabled}));return r}catch{return[]}}async function cu(e){try{const t=new FormData;t.append("file",e);const n=await fetch("/codex-api/upload-file",{method:"POST",body:t});return n.ok?(await n.json()).path??null:null}catch{return null}}const nk={},rk={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function sk(e,t){return w(),k("svg",rk,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m12 5l0 14m-6-8l6-6l6 6"},null,-1)])])}const ok=st(nk,[["render",sk]]),ik={},ak={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function lk(e,t){return w(),k("svg",ak,[...t[0]||(t[0]=[p("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 ck=st(ik,[["render",lk]]),uk={},dk={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function fk(e,t){return w(),k("svg",dk,[...t[0]||(t[0]=[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 2m0 3a3 3 0 0 1 3-3h0a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3h0a3 3 0 0 1-3-3zM5 10a7 7 0 0 0 14 0M8 21h8M12 17v4"},null,-1)])])}const hk=st(uk,[["render",fk]]),pk={},mk={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function gk(e,t){return w(),k("svg",mk,[...t[0]||(t[0]=[p("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),p("path",{fill:"currentColor",d:"M8 5a3 3 0 0 0 -3 3v8a3 3 0 0 0 3 3h8a3 3 0 0 0 3 -3v-8a3 3 0 0 0 -3 -3h-8z"},null,-1)])])}const uu=st(pk,[["render",gk]]),vk=["disabled"],yk={class:"composer-dropdown-value"},wk={class:"composer-dropdown-menu"},bk={key:0,class:"composer-dropdown-search-wrap"},_k=["placeholder","onKeydown"],kk={class:"composer-dropdown-options",role:"listbox"},Tk=["onClick"],Sk={key:0,class:"composer-dropdown-empty"},Ik={key:1,class:"composer-dropdown-add-wrap"},Ek=["placeholder","onKeydown"],Ck=Ht({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},selectedPrefixIcon:{},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},showAddAction:{type:Boolean},addActionLabel:{},defaultAddValue:{},addPlaceholder:{}},emits:["update:modelValue","add"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(null),a=D(!1),l=D(""),u=D(!1),c=D(""),f=fe(()=>{var we;const le=n.options.find(Y=>Y.value===n.modelValue);return le?le.label:((we=n.placeholder)==null?void 0:we.trim())||""}),m=fe(()=>n.openDirection??"down"),T=fe(()=>n.enableSearch===!0),U=fe(()=>n.showAddAction===!0),P=fe(()=>{var le;return((le=n.searchPlaceholder)==null?void 0:le.trim())||"Quick search projects"}),F=fe(()=>{var le;return((le=n.addActionLabel)==null?void 0:le.trim())||"Add new project"}),R=fe(()=>{var le;return((le=n.addPlaceholder)==null?void 0:le.trim())||"Project name or absolute path"}),A=fe(()=>{const le=l.value.trim().toLowerCase();return le?n.options.filter(we=>we.label.toLowerCase().includes(le)||we.value.toLowerCase().includes(le)):n.options});function B(){n.disabled||(a.value=!a.value)}function W(le){r("update:modelValue",le),a.value=!1,l.value=""}function ce(){var le;u.value=!0,c.value=((le=n.defaultAddValue)==null?void 0:le.trim())||"",Yt(()=>{var we;return(we=i.value)==null?void 0:we.focus()})}function me(){if(l.value.length>0){l.value="";return}a.value=!1}function ve(){const le=c.value.trim();le&&(r("add",le),u.value=!1,c.value="",a.value=!1,l.value="")}function Ie(){u.value=!1,c.value="",a.value=!1,l.value=""}function re(le){if(!a.value)return;const we=s.value;if(!we)return;const Y=le.target;Y instanceof Node&&(we.contains(Y)||(a.value=!1,l.value="",u.value=!1,c.value=""))}return ut(a,le=>{if(!le){u.value=!1,c.value="";return}T.value&&Yt(()=>{var we;return(we=o.value)==null?void 0:we.focus()})}),pr(()=>{window.addEventListener("pointerdown",re)}),mr(()=>{window.removeEventListener("pointerdown",re)}),(le,we)=>(w(),k("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[p("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:B},[e.selectedPrefixIcon?(w(),ft(Yo(e.selectedPrefixIcon),{key:0,class:"composer-dropdown-prefix-icon"})):ae("",!0),p("span",yk,oe(f.value),1),Re(Ti,{class:"composer-dropdown-chevron"})],8,vk),a.value?(w(),k("div",{key:0,class:it(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":m.value==="up","composer-dropdown-menu-wrap-down":m.value==="down"}])},[p("div",wk,[T.value?(w(),k("div",bk,[cr(p("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":we[0]||(we[0]=Y=>l.value=Y),class:"composer-dropdown-search-input",type:"text",placeholder:P.value,onKeydown:dn(ct(me,["prevent"]),["esc"])},null,40,_k),[[ur,l.value]])])):ae("",!0),p("ul",kk,[(w(!0),k(Fe,null,St(A.value,Y=>(w(),k("li",{key:Y.value},[p("button",{class:it(["composer-dropdown-option",{"is-selected":Y.value===e.modelValue}]),type:"button",onClick:Te=>W(Y.value)},oe(Y.label),11,Tk)]))),128)),A.value.length===0?(w(),k("li",Sk," No matching projects ")):ae("",!0)]),U.value?(w(),k("div",Ik,[u.value?(w(),k(Fe,{key:0},[cr(p("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":we[1]||(we[1]=Y=>c.value=Y),class:"composer-dropdown-add-input",type:"text",placeholder:R.value,onKeydown:[dn(ct(ve,["prevent"]),["enter"]),dn(ct(Ie,["prevent"]),["esc"])]},null,40,Ek),[[ur,c.value]]),p("div",{class:"composer-dropdown-add-actions"},[p("button",{type:"button",class:"composer-dropdown-add-btn",onClick:ve},"Open"),p("button",{type:"button",class:"composer-dropdown-add-btn",onClick:Ie},"Cancel")])],64)):(w(),k("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:ce},oe(F.value),1))])):ae("",!0)])],2)):ae("",!0)],512))}}),Ks=st(Ck,[["__scopeId","data-v-47426238"]]),Ak=["disabled"],Rk={class:"search-dropdown-value"},Pk={class:"search-dropdown-search-wrap"},xk=["placeholder","onKeydown"],Mk={key:0,class:"search-dropdown-list",role:"listbox"},$k=["onClick","onPointerenter"],Ok={class:"search-dropdown-option-check"},Nk={class:"search-dropdown-option-label"},Dk={key:0,class:"search-dropdown-option-desc"},Lk={key:1,class:"search-dropdown-empty"},jk=Ht({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(!1),a=D(""),l=D(0),u=fe(()=>n.openDirection??"down"),c=fe(()=>new Set(n.selectedValues)),f=fe(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const A=n.options.find(B=>B.value===n.selectedValues[0]);return(A==null?void 0:A.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),m=fe(()=>{const A=a.value.toLowerCase().trim();return A?n.options.filter(B=>{var W;return B.label.toLowerCase().includes(A)||(((W=B.description)==null?void 0:W.toLowerCase().includes(A))??!1)}):n.options});function T(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,Yt(()=>{var A;return(A=o.value)==null?void 0:A.focus()})))}function U(A){r("toggle",A.value,!c.value.has(A.value))}function P(A){m.value.length!==0&&(l.value=(l.value+A+m.value.length)%m.value.length)}function F(){const A=m.value[l.value];A&&U(A)}function R(A){if(!i.value)return;const B=s.value;if(!B)return;const W=A.target;W instanceof Node&&(B.contains(W)||(i.value=!1))}return ut(a,()=>{l.value=0}),pr(()=>window.addEventListener("pointerdown",R)),mr(()=>window.removeEventListener("pointerdown",R)),(A,B)=>(w(),k("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[p("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:T},[p("span",Rk,oe(f.value),1),Re(Ti,{class:"search-dropdown-chevron"})],8,Ak),i.value?(w(),k("div",{key:0,class:it(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":u.value==="up","search-dropdown-menu-wrap-down":u.value==="down"}])},[p("div",Pk,[cr(p("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":B[0]||(B[0]=W=>a.value=W),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[B[1]||(B[1]=dn(ct(W=>i.value=!1,["prevent"]),["escape"])),dn(ct(F,["prevent"]),["enter"]),B[2]||(B[2]=dn(ct(W=>P(1),["prevent"]),["arrow-down"])),B[3]||(B[3]=dn(ct(W=>P(-1),["prevent"]),["arrow-up"]))]},null,40,xk),[[ur,a.value]])]),m.value.length>0?(w(),k("ul",Mk,[(w(!0),k(Fe,null,St(m.value,(W,ce)=>(w(),k("li",{key:W.value},[p("button",{class:it(["search-dropdown-option",{"is-selected":c.value.has(W.value),"is-highlighted":ce===l.value}]),type:"button",onClick:me=>U(W),onPointerenter:me=>l.value=ce},[p("span",Ok,oe(c.value.has(W.value)?"✓":""),1),p("span",Nk,oe(W.label),1),W.description?(w(),k("span",Dk,oe(W.description),1)):ae("",!0)],42,$k)]))),128))])):(w(),k("div",Lk,"No results"))],2)):ae("",!0)],512))}}),Uk=st(jk,[["__scopeId","data-v-a0f2edd4"]]),Fk={class:"skill-picker-header"},Bk=["onKeydown"],Hk={key:0,class:"skill-picker-list",role:"listbox"},Wk=["onClick","onPointerenter"],Vk={class:"skill-picker-name"},Gk={key:0,class:"skill-picker-desc"},zk={key:1,class:"skill-picker-empty"},qk=Ht({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(null),i=D(""),a=D(0),l=fe(()=>{const m=i.value.toLowerCase().trim();return m?n.skills.filter(T=>T.name.toLowerCase().includes(m)||T.description.toLowerCase().includes(m)):n.skills}),u=fe(()=>{const m={};return n.anchorBottom!=null&&(m.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(m.left=`${n.anchorLeft}px`),m});function c(m){l.value.length!==0&&(a.value=(a.value+m+l.value.length)%l.value.length)}function f(){const m=l.value[a.value];m&&r("select",m)}return ut(()=>n.visible,m=>{m&&(i.value="",a.value=0,Yt(()=>{var T;return(T=o.value)==null?void 0:T.focus()}))}),ut(i,()=>{a.value=0}),(m,T)=>e.visible?(w(),k("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:Jr(u.value)},[p("div",Fk,[cr(p("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":T[0]||(T[0]=U=>i.value=U),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[T[1]||(T[1]=dn(ct(U=>m.$emit("close"),["prevent"]),["escape"])),dn(ct(f,["prevent"]),["enter"]),T[2]||(T[2]=dn(ct(U=>c(1),["prevent"]),["arrow-down"])),T[3]||(T[3]=dn(ct(U=>c(-1),["prevent"]),["arrow-up"]))]},null,40,Bk),[[ur,i.value]])]),l.value.length>0?(w(),k("ul",Hk,[(w(!0),k(Fe,null,St(l.value,(U,P)=>(w(),k("li",{key:U.path},[p("button",{class:it(["skill-picker-item",{"is-highlighted":P===a.value}]),type:"button",onClick:F=>m.$emit("select",U),onPointerenter:F=>a.value=P},[p("span",Vk,oe(U.name),1),U.description?(w(),k("span",Gk,oe(U.description),1)):ae("",!0)],42,Wk)]))),128))])):(w(),k("div",zk,"No skills found"))],4)):ae("",!0)}}),Kk=st(qk,[["__scopeId","data-v-ff3fb7dc"]]),Jk={key:0,class:"thread-composer-dictation-error"},Yk={key:0,class:"thread-composer-attachments"},Xk=["src","alt"],Qk=["aria-label","disabled","onClick"],Zk={key:1,class:"thread-composer-folder-chips"},e0=["title"],t0={class:"thread-composer-folder-chip-meta"},n0=["aria-label","disabled","onClick"],r0={key:2,class:"thread-composer-file-chips"},s0=["title"],o0=["aria-label","disabled","onClick"],i0={key:3,class:"thread-composer-skill-chips"},a0={class:"thread-composer-skill-chip-name"},l0=["aria-label","onClick"],c0={class:"thread-composer-input-wrap"},u0={key:0,class:"thread-composer-file-mentions"},d0=["onMousedown"],f0={key:1,class:"thread-composer-file-mention-icon-markdown"},h0={class:"thread-composer-file-mention-text"},p0={class:"thread-composer-file-mention-name"},m0={key:0,class:"thread-composer-file-mention-dir"},g0={key:1,class:"thread-composer-file-mention-empty"},v0=["placeholder","disabled"],y0=["disabled"],w0={key:0,class:"thread-composer-attach-menu"},b0=["disabled"],_0=["disabled"],k0=["disabled"],T0=["aria-checked","aria-label","disabled"],S0={class:"thread-composer-attach-setting-copy"},I0={class:"thread-composer-attach-setting-description"},E0={key:0,class:"thread-composer-dictation-waveform-wrap","aria-hidden":"true"},C0={key:1,class:"thread-composer-dictation-timer"},A0=["aria-label","title","disabled"],R0=["disabled"],P0=["aria-label","title","disabled"],x0=["disabled"],M0=["disabled"],$0=["disabled"],O0=Ht({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},models:{},selectedModel:{},selectedReasoningEffort:{},selectedSpeedMode:{},skills:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},isUpdatingSpeedMode:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{},dictationClickToToggle:{type:Boolean},prependDraftRequest:{},dictationAutoSend:{type:Boolean},dictationLanguage:{}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort","update:selected-speed-mode"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=D(""),i=D([]),a=D([]),l=D([]),u=D([]),c=D(""),{state:f,isSupported:m,recordingDurationMs:T,waveformCanvasRef:U,startRecording:P,stopRecording:F,toggleRecording:R,cancel:A}=r_({getLanguage:()=>r.dictationLanguage??"auto",onTranscript:j=>{if(o.value=o.value?`${o.value}
39
+ ${j}`:j,c.value="",r.dictationAutoSend!==!1){const X=r.isTurnInProgress?q.value:"steer";z(X,{rollbackLatestUserTurn:X==="steer"&&Ye}),Ye=!1;return}Yt(()=>{var X;return(X=ve.value)==null?void 0:X.focus()})},onEmpty:()=>{c.value=r.dictationClickToToggle?"No speech detected. Click again after speaking.":"No speech detected. Hold the mic and speak."},onError:j=>{if(j instanceof DOMException&&j.name==="NotAllowedError"){c.value="Microphone access was denied.";return}c.value=j instanceof Error?j.message:"Dictation failed."}}),B=D(null),W=D(null),ce=D(null),me=D(null),ve=D(null),Ie=D(!1),re=D(!1),le=D(null),we=D(""),Y=D([]),Te=D(!1),xe=D(0),Le=D(0);let Pe=0,Oe=null,Ee=!1,Ye=!1;const Ze=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),Ne=[{value:"none",label:"None"},{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}];function nt(j){return j.trim().replace(/^gpt/i,"GPT")}const gt=fe(()=>r.models.map(j=>({value:j,label:nt(j)}))),at=fe(()=>r.skills??[]),et=fe(()=>a.value.map(j=>j.path)),Xe=fe(()=>(r.skills??[]).map(j=>({value:j.path,label:j.name,description:j.description}))),K=fe(()=>r.disabled||r.isUpdatingSpeedMode||!r.activeThreadId?!1:o.value.trim().length>0||i.value.length>0||l.value.length>0),he=fe(()=>o.value.trim().length>0||i.value.length>0||a.value.length>0||l.value.length>0||u.value.length>0),ue=fe(()=>{const j=new Set;for(const X of u.value)for(const se of X.filePaths)j.add(se);return l.value.filter(X=>!j.has(X.fsPath))}),be=fe(()=>r.disabled||!r.activeThreadId),$e=fe(()=>r.selectedModel.trim()==="gpt-5.4"),g=fe(()=>r.selectedSpeedMode==="fast"&&$e.value),b=fe(()=>be.value||r.isUpdatingSpeedMode===!0),M=fe(()=>r.isUpdatingSpeedMode?"Saving speed setting...":r.selectedSpeedMode==="fast"?"About 1.5x faster, with credits used at 2x":"Default speed with normal credit usage"),q=fe(()=>r.inProgressSubmitMode==="steer"?"steer":"queue"),G=fe(()=>f.value==="recording"),N=fe(()=>f.value==="recording"?"Stop dictation":r.dictationClickToToggle?"Click to dictate":"Hold to dictate"),V=fe(()=>f.value==="idle"?c.value.trim():""),J=fe(()=>{const j=Math.max(0,Math.floor(T.value/1e3)),X=Math.floor(j/60),se=j%60;return`${X}:${String(se).padStart(2,"0")}`}),Q=fe(()=>r.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function z(j="steer",X){var qe;const se=o.value.trim();if(K.value){if(s("submit",{text:se,imageUrls:i.value.map(Pt=>Pt.url),fileAttachments:[...l.value],skills:a.value.map(Pt=>({name:Pt.name,path:Pt.path})),mode:j,rollbackLatestUserTurn:(X==null?void 0:X.rollbackLatestUserTurn)===!0}),de(),Ze){(qe=ve.value)==null||qe.blur();return}Yt(()=>{var Pt;return(Pt=ve.value)==null?void 0:Pt.focus()})}}function _e(j){Le.value+=1,o.value=j.text,i.value=j.imageUrls.map((X,se)=>({id:`queued-${Date.now()}-${se}-${Math.random().toString(36).slice(2,8)}`,name:`Image ${se+1}`,url:X})),a.value=j.skills.map(X=>(r.skills??[]).find(se=>se.path===X.path)??{name:X.name,description:"",path:X.path}),l.value=j.fileAttachments.map(X=>({...X})),u.value=[],c.value="",Ie.value=!1,re.value=!1,_()}function de(){_e({text:"",imageUrls:[],fileAttachments:[],skills:[]})}function Se(){s("interrupt")}function Me(j){s("update:selected-model",j)}function De(j){s("update:selected-reasoning-effort",j)}function Be(){b.value||s("update:selected-speed-mode",r.selectedSpeedMode==="fast"?"standard":"fast")}function He(){r.dictationClickToToggle&&(c.value&&(c.value=""),f.value==="idle"&&(Ye=r.isTurnInProgress===!0&&r.inProgressSubmitMode==="steer"),R())}function ot(j){if(r.dictationClickToToggle||(j.preventDefault(),Ee))return;Ee=!0;const X=j.currentTarget;if(X)try{X.setPointerCapture(j.pointerId)}catch{}c.value&&(c.value=""),Ye=r.isTurnInProgress===!0&&r.inProgressSubmitMode==="steer",window.addEventListener("pointerup",tt),window.addEventListener("pointercancel",tt),window.addEventListener("blur",tt),P()}function tt(){r.dictationClickToToggle||Ee&&(Ee=!1,window.removeEventListener("pointerup",tt),window.removeEventListener("pointercancel",tt),window.removeEventListener("blur",tt),F())}function vt(){be.value||(Ie.value=!Ie.value)}function yt(){var j;(j=W.value)==null||j.click()}function jt(){var j;(j=ce.value)==null||j.click()}function zt(){var j;(j=me.value)==null||j.click()}function kt(j){i.value=i.value.filter(X=>X.id!==j)}function Rt(j){a.value=a.value.filter(X=>X.path!==j)}function wt(j){l.value=l.value.filter(X=>X.fsPath!==j)}function Dt(j){const X=u.value.find(qe=>qe.id===j);if(!X)return;const se=new Set(X.filePaths);l.value=l.value.filter(qe=>!se.has(qe.fsPath)),u.value=u.value.filter(qe=>qe.id!==j)}function Qt(j){return j.total<=0?0:Math.round(j.processed/j.total*100)}function qt(j,X){const se=j.replace(/\\/g,"/");if(l.value.some(bn=>bn.fsPath===se))return;const qe=se.split("/").filter(Boolean),Pt=(X==null?void 0:X.trim())||qe[qe.length-1]||se;l.value=[...l.value,{label:Pt,path:se,fsPath:se}]}function xt(j){return j.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(j.name)}function Tt(j){if(!j||j.length===0)return;const X=Le.value;for(const se of Array.from(j))if(xt(se)){const qe=new FileReader;qe.onload=()=>{X===Le.value&&typeof qe.result=="string"&&i.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:se.name,url:qe.result})},qe.readAsDataURL(se)}else cu(se).then(qe=>{X===Le.value&&qe&&qt(qe)}).catch(()=>{})}async function Kt(j){if(!j||j.length===0)return;const X=Le.value,se=Array.from(j),Pt=(se[0].webkitRelativePath||se[0].name).split("/").filter(Boolean)[0]||"Folder",bn=`${Date.now()}-${Math.random().toString(36).slice(2)}`;u.value=[...u.value,{id:bn,name:Pt,total:se.length,processed:0,filePaths:[],isUploading:!0}];const _n=an=>{X===Le.value&&(u.value=u.value.map(Vt=>Vt.id===bn?an(Vt):Vt))};for(const an of se)try{const Vt=await cu(an);if(X!==Le.value)return;if(Vt){const Dn=an.webkitRelativePath||an.name;qt(Vt,Dn),_n(I=>({...I,processed:I.processed+1,filePaths:[...I.filePaths,Vt]}));continue}_n(Dn=>({...Dn,processed:Dn.processed+1}))}catch{_n(Vt=>({...Vt,processed:Vt.processed+1}))}_n(an=>({...an,isUploading:!1}))}function It(j){j&&(j.value="")}function bt(j){const X=j.target;Tt((X==null?void 0:X.files)??null),It(X),Ie.value=!1}function Jt(j){const X=j.target;Tt((X==null?void 0:X.files)??null),It(X),Ie.value=!1}function yn(j){const X=j.target;Kt((X==null?void 0:X.files)??null),It(X),Ie.value=!1}function $t(){c.value&&(c.value="");const X=o.value.startsWith("/");X!==re.value&&(re.value=X),S()}function Wt(j){if(Te.value){if(j.key==="Escape"){j.preventDefault(),_();return}if(j.key==="ArrowDown"){j.preventDefault(),Y.value.length>0&&(xe.value=(xe.value+1)%Y.value.length);return}if(j.key==="ArrowUp"){if(j.preventDefault(),Y.value.length>0){const se=Y.value.length;xe.value=(xe.value+se-1)%se}return}if(j.key==="Enter"||j.key==="Tab"){j.preventDefault();const se=Y.value[xe.value];se?O(se):_();return}}if(r.sendWithEnter!==!1?j.key==="Enter"&&!j.shiftKey:j.key==="Enter"&&(j.metaKey||j.ctrlKey)){j.preventDefault(),z(r.isTurnInProgress?q.value:"steer");return}if(re.value){if(j.key==="Escape"){j.preventDefault(),wn();return}if(j.key==="ArrowDown"||j.key==="ArrowUp"){j.preventDefault();return}}}function wn(){var j;re.value=!1,(j=ve.value)==null||j.focus()}function _(){Te.value=!1,le.value=null,we.value="",Y.value=[],xe.value=0}function S(){const j=ve.value;if(!j){_();return}const X=j.selectionStart??o.value.length,qe=o.value.slice(0,X).match(/(^|\s)(@[^\s@]*)$/);if(!qe){_();return}const Pt=qe[2]??"",bn=Pt.length,_n=X-bn;le.value=_n,we.value=Pt.slice(1),Te.value=!0,E()}async function E(){if(!Te.value)return;const j=(r.cwd??"").trim();if(!j){Y.value=[];return}Oe&&clearTimeout(Oe);const X=++Pe;Oe=setTimeout(async()=>{try{const se=await J_(j,we.value,20);if(!Te.value||X!==Pe)return;Y.value=se,xe.value=0}catch{if(!Te.value||X!==Pe)return;Y.value=[]}},120)}function O(j){const X=ve.value,se=le.value;if(se!==null&&X){const qe=X.selectionStart??o.value.length;o.value=`${o.value.slice(0,se)}${o.value.slice(qe)}`.trimEnd()}qt(j.path),_(),Yt(()=>X==null?void 0:X.focus())}function H(j){A(),_e(j),Yt(()=>{var X;return(X=ve.value)==null?void 0:X.focus()})}function ie(j){const X=j.lastIndexOf("/");return X<0?j:j.slice(X+1)}function Ce(j){const X=j.lastIndexOf("/");return X<=0?"":j.slice(0,X)}function ge(j){const X=ie(j),se=X.lastIndexOf(".");return se<=0?"":X.slice(se+1).toLowerCase()}function Ke(j){const X=ge(j);return X==="ts"?"TS":X==="tsx"?"TSX":X==="js"?"JS":X==="jsx"?"JSX":X==="json"?"{}":""}function lt(j){const X=ge(j);return X.startsWith("ts")?"ts":X.startsWith("js")?"js":X==="json"?"json":"default"}function rt(j){const X=ge(j);return X==="md"||X==="mdx"}function Nt(j){var X;a.value.some(se=>se.path===j.path)||(a.value=[...a.value,j]),o.value=o.value.startsWith("/")?"":o.value,re.value=!1,(X=ve.value)==null||X.focus()}function mn(j,X){if(X){const se=(r.skills??[]).find(qe=>qe.path===j);se&&!a.value.some(qe=>qe.path===j)&&(a.value=[...a.value,se])}else a.value=a.value.filter(se=>se.path!==j)}function Nn(j){if(!Ie.value)return;const X=B.value;if(!X)return;const se=j.target;!se||X.contains(se)||(Ie.value=!1)}return pr(()=>{document.addEventListener("click",Nn)}),t({hydrateDraft:H,hasUnsavedDraft:()=>he.value}),mr(()=>{document.removeEventListener("click",Nn),window.removeEventListener("pointerup",tt),window.removeEventListener("pointercancel",tt),window.removeEventListener("blur",tt),Oe&&clearTimeout(Oe)}),ut(()=>r.activeThreadId,()=>{A(),de()}),ut(()=>r.cwd,()=>{Te.value&&E()}),ut(()=>{var j;return(j=r.prependDraftRequest)==null?void 0:j.id},()=>{var X,se;const j=((se=(X=r.prependDraftRequest)==null?void 0:X.text)==null?void 0:se.trim())??"";j&&(o.value=o.value?`${j}
40
+ ${o.value}`:j,$t(),Yt(()=>{var qe;return(qe=ve.value)==null?void 0:qe.focus()}))}),(j,X)=>(w(),k("form",{class:"thread-composer",onSubmit:X[2]||(X[2]=ct(se=>z("steer"),["prevent"]))},[V.value?(w(),k("p",Jk,oe(V.value),1)):ae("",!0),p("div",{class:it(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[i.value.length>0?(w(),k("div",Yk,[(w(!0),k(Fe,null,St(i.value,se=>(w(),k("div",{key:se.id,class:"thread-composer-attachment"},[p("img",{class:"thread-composer-attachment-image",src:se.url,alt:se.name||"Selected image"},null,8,Xk),p("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${se.name||"image"}`,disabled:be.value,onClick:qe=>kt(se.id)}," x ",8,Qk)]))),128))])):ae("",!0),u.value.length>0?(w(),k("div",Zk,[(w(!0),k(Fe,null,St(u.value,se=>(w(),k("span",{key:se.id,class:"thread-composer-folder-chip"},[Re(Tl,{class:"thread-composer-folder-chip-icon"}),p("span",{class:"thread-composer-folder-chip-name",title:se.name},oe(se.name),9,e0),p("span",t0,[se.isUploading?(w(),k(Fe,{key:0},[no(oe(Qt(se))+"% uploading ("+oe(se.processed)+"/"+oe(se.total)+") ",1)],64)):(w(),k(Fe,{key:1},[no(oe(se.filePaths.length)+" file"+oe(se.filePaths.length===1?"":"s"),1)],64))]),p("button",{class:"thread-composer-folder-chip-remove",type:"button","aria-label":`Remove folder ${se.name}`,disabled:be.value,onClick:qe=>Dt(se.id)},"×",8,n0)]))),128))])):ae("",!0),ue.value.length>0?(w(),k("div",r0,[(w(!0),k(Fe,null,St(ue.value,se=>(w(),k("span",{key:se.fsPath,class:"thread-composer-file-chip"},[Re(ei,{class:"thread-composer-file-chip-icon"}),p("span",{class:"thread-composer-file-chip-name",title:se.fsPath},oe(se.label),9,s0),p("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${se.label}`,disabled:be.value,onClick:qe=>wt(se.fsPath)},"×",8,o0)]))),128))])):ae("",!0),a.value.length>0?(w(),k("div",i0,[(w(!0),k(Fe,null,St(a.value,se=>(w(),k("span",{key:se.path,class:"thread-composer-skill-chip"},[p("span",a0,oe(se.name),1),p("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${se.name}`,onClick:qe=>Rt(se.path)},"×",8,l0)]))),128))])):ae("",!0),p("div",c0,[Te.value?(w(),k("div",u0,[Y.value.length>0?(w(!0),k(Fe,{key:0},St(Y.value,(se,qe)=>(w(),k("button",{key:se.path,class:it(["thread-composer-file-mention-row",{"is-active":qe===xe.value}]),type:"button",onMousedown:ct(Pt=>O(se),["prevent"])},[Ke(se.path)?(w(),k("span",{key:0,class:it(["thread-composer-file-mention-icon-badge",`is-${lt(se.path)}`])},oe(Ke(se.path)),3)):rt(se.path)?(w(),k("span",f0,"↓")):(w(),ft(ei,{key:2,class:"thread-composer-file-mention-icon-file"})),p("span",h0,[p("span",p0,oe(ie(se.path)),1),Ce(se.path)?(w(),k("span",m0,oe(Ce(se.path)),1)):ae("",!0)])],42,d0))),128)):(w(),k("div",g0,"No matching files"))])):ae("",!0),cr(p("textarea",{ref_key:"inputRef",ref:ve,"onUpdate:modelValue":X[0]||(X[0]=se=>o.value=se),class:"thread-composer-input",placeholder:Q.value,disabled:be.value,onInput:$t,onKeydown:Wt},null,40,v0),[[ur,o.value]]),Re(Kk,{skills:at.value,visible:re.value,"anchor-bottom":44,"anchor-left":0,onSelect:Nt,onClose:wn},null,8,["skills","visible"])]),p("div",{class:it(["thread-composer-controls",{"thread-composer-controls--recording":G.value}])},[p("div",{ref_key:"attachMenuRootRef",ref:B,class:"thread-composer-attach"},[p("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:be.value,onClick:vt}," + ",8,y0),Ie.value?(w(),k("div",w0,[p("button",{class:"thread-composer-attach-item",type:"button",disabled:be.value,onClick:yt}," Add photos & files ",8,b0),p("button",{class:"thread-composer-attach-item",type:"button",disabled:be.value,onClick:zt}," Add folder ",8,_0),p("button",{class:"thread-composer-attach-item",type:"button",disabled:be.value,onClick:jt}," Take photo ",8,k0),X[4]||(X[4]=p("div",{class:"thread-composer-attach-separator"},null,-1)),$e.value?(w(),k("button",{key:0,class:"thread-composer-attach-setting",type:"button",role:"switch","aria-checked":e.selectedSpeedMode==="fast","aria-label":`Fast mode ${e.selectedSpeedMode==="fast"?"enabled":"disabled"}`,disabled:b.value,onClick:Be},[p("span",S0,[X[3]||(X[3]=p("span",{class:"thread-composer-attach-setting-label"},"Fast mode",-1)),p("span",I0,oe(M.value),1)]),p("span",{class:it(["thread-composer-attach-switch",{"is-on":e.selectedSpeedMode==="fast","is-busy":e.isUpdatingSpeedMode,"is-disabled":b.value}])},null,2)],8,T0)):ae("",!0)])):ae("",!0)],512),G.value?ae("",!0):(w(),k(Fe,{key:0},[Re(Ks,{class:"thread-composer-control","model-value":e.selectedModel,options:gt.value,"selected-prefix-icon":g.value?ck:null,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":Me},null,8,["model-value","options","selected-prefix-icon","disabled"]),Re(Uk,{class:"thread-composer-control",options:Xe.value,"selected-values":et.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:mn},null,8,["options","selected-values","disabled"]),Re(Ks,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:Ne,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":De},null,8,["model-value","disabled"])],64)),p("div",{class:it(["thread-composer-actions",{"thread-composer-actions--recording":G.value}])},[ye(f)==="recording"?(w(),k("div",E0,[p("canvas",{ref_key:"dictationWaveformCanvasRef",ref:U,class:"thread-composer-dictation-waveform"},null,512)])):ae("",!0),ye(f)==="recording"?(w(),k("span",C0,oe(J.value),1)):ae("",!0),ye(m)?(w(),k("button",{key:2,class:it(["thread-composer-mic",{"thread-composer-mic--active":ye(f)==="recording"}]),type:"button","aria-label":N.value,title:N.value,disabled:be.value,onClick:He,onPointerdown:ot,onPointerup:tt,onPointercancel:tt},[ye(f)==="recording"?(w(),ft(uu,{key:0,class:"thread-composer-mic-icon thread-composer-mic-icon--stop"})):(w(),ft(hk,{key:1,class:"thread-composer-mic-icon"}))],42,A0)):ae("",!0),e.isTurnInProgress?(w(),k("button",{key:3,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:Se},[Re(uu,{class:"thread-composer-stop-icon"})],8,R0)):(w(),k("button",{key:4,class:it(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&q.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&q.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${q.value}`:"Send",disabled:!K.value,onClick:X[1]||(X[1]=se=>z(e.isTurnInProgress?q.value:"steer"))},[Re(ok,{class:"thread-composer-submit-icon"})],10,P0))],2)],2)],2),p("input",{ref_key:"photoLibraryInputRef",ref:W,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:be.value,onChange:bt},null,40,x0),p("input",{ref_key:"cameraCaptureInputRef",ref:ce,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:be.value,onChange:Jt},null,40,M0),p("input",{ref_key:"folderPickerInputRef",ref:me,class:"thread-composer-hidden-input",type:"file",multiple:"",webkitdirectory:"",directory:"",disabled:be.value,onChange:yn},null,40,$0)],32))}}),du=st(O0,[["__scopeId","data-v-dab59279"]]),N0={key:0,class:"queued-messages"},D0={class:"queued-messages-inner"},L0={class:"queued-row-text"},j0={class:"queued-row-actions"},U0=["onClick"],F0=["onClick"],B0=["onClick"],H0=Ht({__name:"QueuedMessages",props:{messages:{}},emits:["edit","steer","delete"],setup(e){function t(n){var l,u,c;const r=n.text.trim();if(r)return r;const s=[],o=((l=n.imageUrls)==null?void 0:l.length)??0,i=((u=n.fileAttachments)==null?void 0:u.length)??0,a=((c=n.skills)==null?void 0:c.length)??0;return o>0&&s.push(`${o} image${o===1?"":"s"}`),i>0&&s.push(`${i} file${i===1?"":"s"}`),a>0&&s.push(`${a} skill${a===1?"":"s"}`),s.join(", ")||"(empty queued message)"}return(n,r)=>e.messages.length>0?(w(),k("div",N0,[p("div",D0,[(w(!0),k(Fe,null,St(e.messages,s=>(w(),k("div",{key:s.id,class:"queued-row"},[r[1]||(r[1]=p("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),p("span",L0,oe(t(s)),1),p("div",j0,[p("button",{class:"queued-row-edit",type:"button",title:"Edit queued message",onClick:o=>n.$emit("edit",s.id)},"Edit",8,U0),p("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:o=>n.$emit("steer",s.id)},"Steer",8,F0),p("button",{class:"queued-row-delete",type:"button","aria-label":"Delete queued message",title:"Delete queued message",onClick:o=>n.$emit("delete",s.id)},[...r[0]||(r[0]=[p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[p("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7h16M10 11v6M14 11v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"})],-1)])],8,B0)])]))),128))])])):ae("",!0)}}),W0=st(H0,[["__scopeId","data-v-1394d0f8"]]),V0={key:0,class:"rate-limit-status","aria-live":"polite"},G0=["title"],z0={class:"rate-limit-card-header"},q0={class:"rate-limit-card-title"},K0={key:0,class:"rate-limit-card-plan"},J0={class:"rate-limit-card-metrics"},Y0={key:0,class:"rate-limit-card-footer"},X0=Ht({__name:"RateLimitStatus",props:{snapshots:{}},setup(e){function t(R){var A,B;return((A=R.limitId)==null?void 0:A.trim())||((B=R.limitName)==null?void 0:B.trim())||"__default__"}function n(R){var A,B;return((A=R.limitName)==null?void 0:A.trim())||((B=R.limitId)==null?void 0:B.trim())||"Rate limits"}function r(R){const A=R.trim();return A?A.replace(/[_-]+/g," ").replace(/\b\w/g,B=>B.toUpperCase()):""}function s(R){return!R||R<=0?"Window":R%1440===0?`${R/1440}d`:R%60===0?`${R/60}h`:R<60?`${R}m`:`${Math.round(R/60*10)/10}h`}function o(R){const A=Math.max(0,Math.min(100,100-R));return`${Math.round(A)}% left`}function i(R){return`${Math.round(R)}%`}function a(R,A){return{key:A,label:`${s(R.windowDurationMins)} ${o(R.usedPercent)}`}}function l(R){const A=[];return R.primary&&A.push(a(R.primary,"primary")),R.secondary&&A.push(a(R.secondary,"secondary")),A}function u(R){if(!R)return"";const A=new Date(R*1e3),B=A.getMonth()+1,W=String(A.getDate()).padStart(2,"0"),ce=String(A.getHours()).padStart(2,"0"),me=String(A.getMinutes()).padStart(2,"0");return`${B}.${W} ${ce}:${me}`}function c(R){if(!(R!=null&&R.resetsAt))return"";const A=R.resetsAt*1e3-Date.now();if(A<=0)return"Resetting now";const B=Math.round(A/6e4);if(B<60)return`Resets in ${B}m`;const W=Math.round(B/60);return W<24?`Resets in ${W}h`:`Resets in ${Math.round(W/24)}d`}function f(R){return[R.primary,R.secondary].filter(A=>A!==null)}function m(R){const A=f(R);return A.length===0?null:[...A].sort((B,W)=>{const ce=B.windowDurationMins??Number.MAX_SAFE_INTEGER,me=W.windowDurationMins??Number.MAX_SAFE_INTEGER;return ce!==me?ce-me:(B.resetsAt??Number.MAX_SAFE_INTEGER)-(W.resetsAt??Number.MAX_SAFE_INTEGER)})[0]}function T(R){const A=f(R);if(A.length===0)return"";const B=[...A].sort((ce,me)=>{const ve=ce.windowDurationMins??-1,Ie=me.windowDurationMins??-1;return ve!==Ie?Ie-ve:(me.resetsAt??-1)-(ce.resetsAt??-1)})[0],W=u(B.resetsAt);return W||""}function U(R){const A=R.credits;return A?A.unlimited?"Unlimited credits":A.balance?`Credits ${A.balance}`:A.hasCredits?"Credits available":"":""}function P(R){return[c(m(R)),T(R),U(R)].filter(A=>A.length>0)}function F(R){const A=[n(R)];for(const B of l(R))A.push(B.label);for(const B of f(R))A.push(`${s(B.windowDurationMins)} used ${i(B.usedPercent)}`);for(const B of P(R))A.push(B);return A.join(`
41
+ `)}return(R,A)=>e.snapshots.length>0?(w(),k("aside",V0,[(w(!0),k(Fe,null,St(e.snapshots,B=>(w(),k("div",{key:t(B),class:"rate-limit-card",title:F(B)},[p("div",z0,[p("span",q0,oe(n(B)),1),B.planType?(w(),k("span",K0,oe(r(B.planType)),1)):ae("",!0)]),p("div",J0,[(w(!0),k(Fe,null,St(l(B),W=>(w(),k("span",{key:W.key,class:"rate-limit-card-metric"},oe(W.label),1))),128))]),P(B).length>0?(w(),k("div",Y0,oe(P(B).join(" | ")),1)):ae("",!0)],8,G0))),128))])):ae("",!0)}}),Q0=st(X0,[["__scopeId","data-v-df88906b"]]),Z0={class:"runtime-dropdown-trigger-label"},eT={key:0,class:"runtime-dropdown-menu-wrap"},tT={class:"runtime-dropdown-menu"},nT=["onClick"],rT={class:"runtime-dropdown-option-label"},sT={key:0,class:"runtime-dropdown-option-check"},oT=Ht({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(!1),i=[{value:"local",label:"Local project",icon:Tl},{value:"worktree",label:"New worktree",icon:Fo}],a=fe(()=>i.find(c=>c.value===n.modelValue)??i[0]);function l(c){r("update:modelValue",c),o.value=!1}function u(c){if(!o.value)return;const f=s.value;if(!f)return;const m=c.target;m instanceof Node&&(f.contains(m)||(o.value=!1))}return pr(()=>{window.addEventListener("pointerdown",u)}),mr(()=>{window.removeEventListener("pointerdown",u)}),(c,f)=>(w(),k("div",{ref_key:"rootRef",ref:s,class:"runtime-dropdown"},[p("button",{class:"runtime-dropdown-trigger",type:"button",onClick:f[0]||(f[0]=m=>o.value=!o.value)},[(w(),ft(Yo(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),p("span",Z0,oe(a.value.label),1),Re(Ti,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(w(),k("div",eT,[p("div",tT,[f[1]||(f[1]=p("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(w(),k(Fe,null,St(i,m=>p("button",{key:m.value,class:it(["runtime-dropdown-option",{"is-selected":e.modelValue===m.value}]),type:"button",onClick:T=>l(m.value)},[(w(),ft(Yo(m.icon),{class:"runtime-dropdown-option-icon"})),p("span",rT,oe(m.label),1),e.modelValue===m.value?(w(),k("span",sT,"✓")):ae("",!0)],10,nT)),64))])])):ae("",!0)],512))}}),iT=st(oT,[["__scopeId","data-v-9c9b71e5"]]),aT={},lT={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function cT(e,t){return w(),k("svg",lT,[...t[0]||(t[0]=[p("circle",{cx:"11",cy:"11",r:"8"},null,-1),p("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const Ba=st(aT,[["render",cT]]),uT={class:"skill-card-top"},dT=["src","alt"],fT={key:1,class:"skill-card-avatar-fallback"},hT={class:"skill-card-info"},pT={class:"skill-card-header"},mT={class:"skill-card-name"},gT={key:0,class:"skill-card-badge-disabled"},vT={key:1,class:"skill-card-badge"},yT={class:"skill-card-owner"},wT={key:0,class:"skill-card-desc"},bT={key:1,class:"skill-card-date"},_T=Ht({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=fe(()=>{const s=t.skill.publishedAt;if(!s)return"";const o=new Date(s),a=Date.now()-s;return a<36e5?`${Math.floor(a/6e4)}m ago`:a<864e5?`${Math.floor(a/36e5)}h ago`:a<2592e6?`${Math.floor(a/864e5)}d ago`:o.toLocaleDateString("en-US",{month:"short",day:"numeric"})});function r(s){const o=s.target;o.style.display="none"}return(s,o)=>(w(),k("button",{class:it(["skill-card",{"is-disabled":e.skill.installed&&e.skill.enabled===!1}]),type:"button",onClick:o[0]||(o[0]=i=>s.$emit("select",e.skill))},[p("div",uT,[e.skill.avatarUrl?(w(),k("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,dT)):(w(),k("div",fT,oe(e.skill.owner.charAt(0)),1)),p("div",hT,[p("div",pT,[p("span",mT,oe(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(w(),k("span",gT,"Disabled")):e.skill.installed?(w(),k("span",vT,"Installed")):ae("",!0)]),p("span",yT,oe(e.skill.owner),1)])]),e.skill.description?(w(),k("p",wT,oe(e.skill.description),1)):ae("",!0),n.value?(w(),k("span",bT,oe(n.value),1)):ae("",!0)],2))}}),fu=st(_T,[["__scopeId","data-v-2a1e8196"]]),kT={class:"sdm-panel"},TT={class:"sdm-header"},ST={class:"sdm-title-area"},IT=["src","alt"],ET={class:"sdm-title-col"},CT={class:"sdm-title-row"},AT={class:"sdm-title"},RT={key:0,class:"sdm-badge-disabled"},PT={class:"sdm-owner"},xT={class:"sdm-body"},MT={key:0,class:"sdm-desc"},$T={key:1,class:"sdm-readme-loading"},OT=["innerHTML"],NT=["href"],DT={class:"sdm-footer"},LT={class:"sdm-footer-actions"},jT=["disabled"],UT=["disabled"],FT=["disabled"],BT=Ht({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled"],setup(e,{emit:t}){const n=e,r=t,s=D(null),o=D(""),i=D(!1),a=fe(()=>s.value??n.skill.enabled??!0),l=fe(()=>n.isInstalling===!0||n.isUninstalling===!0),u=fe(()=>{const P=o.value;if(!P)return"";const F=P.replace(/^---[\s\S]*?---\s*/,"");return c(F)});function c(P){return P.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/^### (.+)$/gm,"<h4>$1</h4>").replace(/^## (.+)$/gm,"<h3>$1</h3>").replace(/^# (.+)$/gm,"<h2>$1</h2>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.+)$/gm,"<li>$1</li>").replace(/(<li>.*<\/li>\n?)+/g,"<ul>$&</ul>").replace(/\n{2,}/g,"<br/><br/>").replace(/\n/g,"<br/>")}async function f(){if(!(!n.skill.owner||!n.skill.name)){i.value=!0,o.value="";try{const P=new URLSearchParams({owner:n.skill.owner,name:n.skill.name}),F=await fetch(`/codex-api/skills-hub/readme?${P}`);if(!F.ok)return;const R=await F.json();o.value=R.content??""}catch{}finally{i.value=!1}}}ut(()=>n.visible,P=>{P&&(s.value=null,o.value="",f())});function m(){r("install",n.skill)}function T(){r("uninstall",n.skill)}function U(){const P=!a.value;s.value=P,r("toggle-enabled",n.skill,P)}return(P,F)=>(w(),ft(Ko,{to:"body"},[e.visible?(w(),k("div",{key:0,class:"sdm-overlay",onClick:F[1]||(F[1]=ct(R=>P.$emit("close"),["self"]))},[p("div",kT,[p("div",TT,[p("div",ST,[e.skill.avatarUrl?(w(),k("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,IT)):ae("",!0),p("div",ET,[p("div",CT,[p("h3",AT,oe(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(w(),k("span",RT,"Disabled")):ae("",!0)]),p("span",PT,oe(e.skill.owner),1)])]),p("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:F[0]||(F[0]=R=>P.$emit("close"))},[Re(Sl,{class:"sdm-close-icon"})])]),p("div",xT,[e.skill.description?(w(),k("p",MT,oe(e.skill.description),1)):ae("",!0),i.value?(w(),k("div",$T,"Loading skill contents...")):o.value?(w(),k("div",{key:2,class:"sdm-readme",innerHTML:u.value},null,8,OT)):ae("",!0),p("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,NT)]),p("div",DT,[p("div",LT,[e.skill.installed?(w(),k("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:T},oe(n.isUninstalling?"Uninstalling...":"Uninstall"),9,jT)):(w(),k("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:m},oe(n.isInstalling?"Installing...":"Install"),9,UT)),e.skill.installed?(w(),k("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:U},oe(a.value?"Disable":"Enable"),9,FT)):ae("",!0)])])])])):ae("",!0)]))}}),HT=st(BT,[["__scopeId","data-v-19a385ca"]]),WT=()=>{};var hu={};/**
42
42
  * @license
43
43
  * Copyright 2017 Google LLC
44
44
  *
@@ -53,7 +53,7 @@ ${o.value}`:j,$t(),Yt(()=>{var qe;return(qe=ve.value)==null?void 0:qe.focus()}))
53
53
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
54
54
  * See the License for the specific language governing permissions and
55
55
  * limitations under the License.
56
- */const $f=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):(s&64512)===55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320?(s=65536+((s&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128)}return t},VT=function(e){const t=[];let n=0,r=0;for(;n<e.length;){const s=e[n++];if(s<128)t[r++]=String.fromCharCode(s);else if(s>191&&s<224){const o=e[n++];t[r++]=String.fromCharCode((s&31)<<6|o&63)}else if(s>239&&s<365){const o=e[n++],i=e[n++],a=e[n++],l=((s&7)<<18|(o&63)<<12|(i&63)<<6|a&63)-65536;t[r++]=String.fromCharCode(55296+(l>>10)),t[r++]=String.fromCharCode(56320+(l&1023))}else{const o=e[n++],i=e[n++];t[r++]=String.fromCharCode((s&15)<<12|(o&63)<<6|i&63)}}return t.join("")},Of={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let s=0;s<e.length;s+=3){const o=e[s],i=s+1<e.length,a=i?e[s+1]:0,l=s+2<e.length,u=l?e[s+2]:0,c=o>>2,f=(o&3)<<4|a>>4;let m=(a&15)<<2|u>>6,k=u&63;l||(k=64,i||(m=64)),r.push(n[c],n[f],n[m],n[k])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray($f(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):VT(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let s=0;s<e.length;){const o=n[e.charAt(s++)],a=s<e.length?n[e.charAt(s)]:0;++s;const u=s<e.length?n[e.charAt(s)]:64;++s;const f=s<e.length?n[e.charAt(s)]:64;if(++s,o==null||a==null||u==null||f==null)throw new GT;const m=o<<2|a>>4;if(r.push(m),u!==64){const k=a<<4&240|u>>2;if(r.push(k),f!==64){const U=u<<6&192|f;r.push(U)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class GT extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const zT=function(e){const t=$f(e);return Of.encodeByteArray(t,!0)},Nf=function(e){return zT(e).replace(/\./g,"")},Df=function(e){try{return Of.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
56
+ */const $f=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):(s&64512)===55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320?(s=65536+((s&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128)}return t},VT=function(e){const t=[];let n=0,r=0;for(;n<e.length;){const s=e[n++];if(s<128)t[r++]=String.fromCharCode(s);else if(s>191&&s<224){const o=e[n++];t[r++]=String.fromCharCode((s&31)<<6|o&63)}else if(s>239&&s<365){const o=e[n++],i=e[n++],a=e[n++],l=((s&7)<<18|(o&63)<<12|(i&63)<<6|a&63)-65536;t[r++]=String.fromCharCode(55296+(l>>10)),t[r++]=String.fromCharCode(56320+(l&1023))}else{const o=e[n++],i=e[n++];t[r++]=String.fromCharCode((s&15)<<12|(o&63)<<6|i&63)}}return t.join("")},Of={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let s=0;s<e.length;s+=3){const o=e[s],i=s+1<e.length,a=i?e[s+1]:0,l=s+2<e.length,u=l?e[s+2]:0,c=o>>2,f=(o&3)<<4|a>>4;let m=(a&15)<<2|u>>6,T=u&63;l||(T=64,i||(m=64)),r.push(n[c],n[f],n[m],n[T])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray($f(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):VT(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let s=0;s<e.length;){const o=n[e.charAt(s++)],a=s<e.length?n[e.charAt(s)]:0;++s;const u=s<e.length?n[e.charAt(s)]:64;++s;const f=s<e.length?n[e.charAt(s)]:64;if(++s,o==null||a==null||u==null||f==null)throw new GT;const m=o<<2|a>>4;if(r.push(m),u!==64){const T=a<<4&240|u>>2;if(r.push(T),f!==64){const U=u<<6&192|f;r.push(U)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class GT extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const zT=function(e){const t=$f(e);return Of.encodeByteArray(t,!0)},Nf=function(e){return zT(e).replace(/\./g,"")},Df=function(e){try{return Of.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};/**
57
57
  * @license
58
58
  * Copyright 2022 Google LLC
59
59
  *
@@ -668,7 +668,7 @@ ${o.value}`:j,$t(),Yt(()=>{var qe;return(qe=ve.value)==null?void 0:qe.focus()}))
668
668
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
669
669
  * See the License for the specific language governing permissions and
670
670
  * limitations under the License.
671
- */function kr(e,t){ze(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class Cn{constructor({uid:t,auth:n,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new UI(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new Ka(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const n=await co(this,this.stsTokenManager.getToken(this.auth,t));return ze(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(t){return LI(this,t)}reload(){return FI(this)}_assign(t){this!==t&&(ze(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(n=>({...n})),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const n=new Cn({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(t){ze(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,n=!1){let r=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),r=!0),n&&await ri(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Wn(this.auth.app))return Promise.reject(Kr(this.auth));const t=await this.getIdToken();return await co(this,DI(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>({...t})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,n){const r=n.displayName??void 0,s=n.email??void 0,o=n.phoneNumber??void 0,i=n.photoURL??void 0,a=n.tenantId??void 0,l=n._redirectEventId??void 0,u=n.createdAt??void 0,c=n.lastLoginAt??void 0,{uid:f,emailVerified:m,isAnonymous:k,providerData:U,stsTokenManager:P}=n;ze(f&&P,t,"internal-error");const F=ms.fromJSON(this.name,P);ze(typeof f=="string",t,"internal-error"),kr(r,t.name),kr(s,t.name),ze(typeof m=="boolean",t,"internal-error"),ze(typeof k=="boolean",t,"internal-error"),kr(o,t.name),kr(i,t.name),kr(a,t.name),kr(l,t.name),kr(u,t.name),kr(c,t.name);const R=new Cn({uid:f,auth:t,email:s,emailVerified:m,displayName:r,isAnonymous:k,photoURL:i,phoneNumber:o,tenantId:a,stsTokenManager:F,createdAt:u,lastLoginAt:c});return U&&Array.isArray(U)&&(R.providerData=U.map(A=>({...A}))),l&&(R._redirectEventId=l),R}static async _fromIdTokenResponse(t,n,r=!1){const s=new ms;s.updateFromServerResponse(n);const o=new Cn({uid:n.localId,auth:t,stsTokenManager:s,isAnonymous:r});return await ri(o),o}static async _fromGetAccountInfoResponse(t,n,r){const s=n.users[0];ze(s.localId!==void 0,"internal-error");const o=s.providerUserInfo!==void 0?Qf(s.providerUserInfo):[],i=!(s.email&&s.passwordHash)&&!(o!=null&&o.length),a=new ms;a.updateFromIdToken(r);const l=new Cn({uid:s.localId,auth:t,stsTokenManager:a,isAnonymous:i}),u={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:o,metadata:new Ka(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(o!=null&&o.length)};return Object.assign(l,u),l}}/**
671
+ */function kr(e,t){ze(typeof e=="string"||typeof e>"u","internal-error",{appName:t})}class Cn{constructor({uid:t,auth:n,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new UI(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new Ka(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(t){const n=await co(this,this.stsTokenManager.getToken(this.auth,t));return ze(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(t){return LI(this,t)}reload(){return FI(this)}_assign(t){this!==t&&(ze(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(n=>({...n})),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const n=new Cn({...this,auth:t,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(t){ze(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(t,n=!1){let r=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),r=!0),n&&await ri(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Wn(this.auth.app))return Promise.reject(Kr(this.auth));const t=await this.getIdToken();return await co(this,DI(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>({...t})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,n){const r=n.displayName??void 0,s=n.email??void 0,o=n.phoneNumber??void 0,i=n.photoURL??void 0,a=n.tenantId??void 0,l=n._redirectEventId??void 0,u=n.createdAt??void 0,c=n.lastLoginAt??void 0,{uid:f,emailVerified:m,isAnonymous:T,providerData:U,stsTokenManager:P}=n;ze(f&&P,t,"internal-error");const F=ms.fromJSON(this.name,P);ze(typeof f=="string",t,"internal-error"),kr(r,t.name),kr(s,t.name),ze(typeof m=="boolean",t,"internal-error"),ze(typeof T=="boolean",t,"internal-error"),kr(o,t.name),kr(i,t.name),kr(a,t.name),kr(l,t.name),kr(u,t.name),kr(c,t.name);const R=new Cn({uid:f,auth:t,email:s,emailVerified:m,displayName:r,isAnonymous:T,photoURL:i,phoneNumber:o,tenantId:a,stsTokenManager:F,createdAt:u,lastLoginAt:c});return U&&Array.isArray(U)&&(R.providerData=U.map(A=>({...A}))),l&&(R._redirectEventId=l),R}static async _fromIdTokenResponse(t,n,r=!1){const s=new ms;s.updateFromServerResponse(n);const o=new Cn({uid:n.localId,auth:t,stsTokenManager:s,isAnonymous:r});return await ri(o),o}static async _fromGetAccountInfoResponse(t,n,r){const s=n.users[0];ze(s.localId!==void 0,"internal-error");const o=s.providerUserInfo!==void 0?Qf(s.providerUserInfo):[],i=!(s.email&&s.passwordHash)&&!(o!=null&&o.length),a=new ms;a.updateFromIdToken(r);const l=new Cn({uid:s.localId,auth:t,stsTokenManager:a,isAnonymous:i}),u={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:o,metadata:new Ka(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(o!=null&&o.length)};return Object.assign(l,u),l}}/**
672
672
  * @license
673
673
  * Copyright 2020 Google LLC
674
674
  *
@@ -1343,7 +1343,7 @@ ${o.value}`:j,$t(),Yt(()=>{var qe;return(qe=ve.value)==null?void 0:qe.focus()}))
1343
1343
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1344
1344
  * See the License for the specific language governing permissions and
1345
1345
  * limitations under the License.
1346
- */const rC={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},sC=500,oC=600,iC="_blank",aC="http://localhost";class Nu{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function lC(e,t,n,r=sC,s=oC){const o=Math.max((window.screen.availHeight-s)/2,0).toString(),i=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const l={...rC,width:r.toString(),height:s.toString(),top:o,left:i},u=hn().toLowerCase();n&&(a=nh(u)?iC:n),eh(u)&&(t=t||aC,l.scrollbars="yes");const c=Object.entries(l).reduce((m,[k,U])=>`${m}${k}=${U},`,"");if(VI(u)&&a!=="_self")return cC(t||"",a),new Nu(null);const f=window.open(t||"",a,c);ze(f,e,"popup-blocked");try{f.focus()}catch{}return new Nu(f)}function cC(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/**
1346
+ */const rC={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},sC=500,oC=600,iC="_blank",aC="http://localhost";class Nu{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function lC(e,t,n,r=sC,s=oC){const o=Math.max((window.screen.availHeight-s)/2,0).toString(),i=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const l={...rC,width:r.toString(),height:s.toString(),top:o,left:i},u=hn().toLowerCase();n&&(a=nh(u)?iC:n),eh(u)&&(t=t||aC,l.scrollbars="yes");const c=Object.entries(l).reduce((m,[T,U])=>`${m}${T}=${U},`,"");if(VI(u)&&a!=="_self")return cC(t||"",a),new Nu(null);const f=window.open(t||"",a,c);ze(f,e,"popup-blocked");try{f.focus()}catch{}return new Nu(f)}function cC(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/**
1347
1347
  * @license
1348
1348
  * Copyright 2021 Google LLC
1349
1349
  *
@@ -1418,11 +1418,12 @@ ${o.value}`:j,$t(),Yt(()=>{var qe;return(qe=ve.value)==null?void 0:qe.focus()}))
1418
1418
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1419
1419
  * See the License for the specific language governing permissions and
1420
1420
  * limitations under the License.
1421
- */const wC=300,bC=jf("authIdTokenMaxAge")||wC;let Uu=null;const _C=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>bC)return;const s=n==null?void 0:n.token;Uu!==s&&(Uu=s,await fetch(e,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function kC(e=Vf()){const t=Hf(e,"auth");if(t.isInitialized())return t.getImmediate();const n=tE(e,{popupRedirectResolver:mC,persistence:[EE,pE,mh]}),r=jf("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const i=_C(o.toString());dE(n,i,()=>i(n.currentUser)),uE(n,a=>i(a))}}const s=XT("auth");return s&&rE(n,`http://${s}`),n}function TC(){var e;return((e=document.getElementsByTagName("head"))==null?void 0:e[0])??document}XI({loadJS(e){return new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=s=>{const o=Pn("internal-error");o.customData=s,n(o)},r.type="text/javascript",r.charset="UTF-8",TC().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});yC("Browser");const SC={apiKey:"AIzaSyAf0CIHBZ-wEQJ8CCUUWo1Wl9P7typ_ZPI",authDomain:"gptcall-416910.firebaseapp.com",projectId:"gptcall-416910",storageBucket:"gptcall-416910.appspot.com",messagingSenderId:"99275526699",appId:"1:99275526699:web:3b623e1e2996108b52106e"};function IC(e){const t=D(null),n=D(""),r=D(""),s=D(""),o=D({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}}),i=fe(()=>s.value==="pull"),a=fe(()=>s.value==="push"),l=fe(()=>s.value!=="");async function u(){try{const P=await fetch("/codex-api/skills-sync/status");if(!P.ok)return;const F=await P.json();F.data&&(o.value=F.data)}catch{}}async function c(){try{const P=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),F=await P.json();if(!P.ok||!F.data)throw new Error("Failed to start GitHub login");t.value=F.data;const R=30,A=Math.max((F.data.interval??5)*1e3,3e3);let B=!1;for(let W=0;W<R;W++){await new Promise(ve=>setTimeout(ve,A));const ce=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:F.data.device_code})}),me=await ce.json();if(!ce.ok)throw new Error(me.error||"Failed to complete GitHub login");if(me.ok){B=!0;break}if(!me.pending)throw new Error(me.error||"Failed to complete GitHub login")}if(!B)throw new Error("GitHub login timed out. Please retry.");t.value=null,await u(),e.showToast("GitHub login successful")}catch(P){e.showToast(P instanceof Error?P.message:"Failed GitHub login","error")}}async function f(){try{const P=fI().length>0?Vf():Wf(SC),F=kC(P),R=new Vn;R.addScope("repo");const A=await xE(F,R),B=Vn.credentialFromResult(A),W=(B==null?void 0:B.accessToken)??"";if(!W)throw new Error("GitHub access token missing from Firebase login");const ce=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:W})}),me=await ce.json();if(!ce.ok||!me.ok)throw new Error(me.error||"Failed to login with GitHub token");await u(),e.showToast("GitHub login successful")}catch(P){const F=P instanceof Error?P.message:"Failed Firebase GitHub login";e.showToast(F,"error")}}async function m(){r.value="",n.value="pull-started",s.value="pull";try{const P=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),F=await P.json();if(!P.ok||!F.ok)throw new Error(F.error||"Failed to pull synced skills");await e.onPulled(),n.value="pull-success",e.showToast(o.value.loggedIn?"Pulled skills from private sync repo":"Pulled skills from upstream repo")}catch(P){const F=P instanceof Error?P.message:"Failed to pull sync";r.value=F,n.value="pull-failed",e.showToast(F,"error")}finally{s.value=""}}async function k(){r.value="",n.value="push-started",s.value="push";try{const P=await fetch("/codex-api/skills-sync/push",{method:"POST"}),F=await P.json();if(!P.ok||!F.ok)throw new Error(F.error||"Failed to push synced skills");n.value="push-success",e.showToast("Pushed skills to private sync repo")}catch(P){const F=P instanceof Error?P.message:"Failed to push sync";r.value=F,n.value="push-failed",e.showToast(F,"error")}finally{s.value=""}}async function U(){try{const P=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),F=await P.json();if(!P.ok||!F.ok)throw new Error(F.error||"Failed to logout GitHub");await u(),e.showToast("Logged out from GitHub")}catch(P){e.showToast(P instanceof Error?P.message:"Failed to logout GitHub","error")}}return{deviceLogin:t,isPullInFlight:i,isPushInFlight:a,isSyncActionInFlight:l,loadSyncStatus:u,logoutGithub:U,pullSkillsSync:m,pushSkillsSync:k,startGithubFirebaseLogin:f,startGithubLogin:c,syncActionError:r,syncActionStatus:n,syncStatus:o}}const EC={class:"skills-hub"},CC={class:"skills-sync-panel"},AC={class:"skills-sync-header"},RC={key:0,class:"skills-sync-badge"},PC={key:1,class:"skills-sync-badge"},xC={key:2,class:"skills-sync-badge"},MC={class:"skills-sync-meta"},$C={key:0,class:"skills-sync-error"},OC={key:1,class:"skills-sync-meta"},NC={key:2,class:"skills-sync-error"},DC={key:3,class:"skills-sync-device"},LC=["href"],jC={class:"skills-sync-actions"},UC=["disabled"],FC=["disabled"],BC=["disabled"],HC={key:1,class:"skills-hub-section"},WC={class:"skills-hub-section-title"},VC={key:0,class:"skills-hub-grid"},GC={class:"skills-hub-toolbar"},zC={class:"skills-hub-search-wrap"},qC={key:0,class:"skills-hub-count"},KC={class:"skills-hub-section"},JC={key:0,class:"skills-hub-loading"},YC={key:1,class:"skills-hub-error"},XC={key:0,class:"skills-hub-grid"},QC={key:1,class:"skills-hub-empty"},xo="codex-web-local.skills-hub.cache.v1",ZC=Ht({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=D(null),s=D(""),o=D("date"),i=D([]),a=D([]),l=D(0),u=D(!1),c=D(""),f=D(!0),m=D(!1),k=D(n),U=D(null),P=D(""),F=D(!1),R=D(!1);let A=null,B=null;const W=t,ce=fe(()=>o.value==="date"?"Newest":"A-Z"),me=fe(()=>{var N;return((N=U.value)==null?void 0:N.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),ve=fe(()=>`${k.value.owner}/${k.value.name}`),Ie=fe(()=>F.value&&P.value===ve.value),re=fe(()=>R.value&&P.value===ve.value),le=fe(()=>{const N=s.value.toLowerCase().trim();return N?a.value.filter(V=>V.name.toLowerCase().includes(N)||V.owner.toLowerCase().includes(N)||(V.displayName??"").toLowerCase().includes(N)):a.value});function we(N,V="success"){U.value={text:N,type:V},B&&clearTimeout(B),B=setTimeout(()=>{U.value=null},3e3)}function Y(){o.value=o.value==="date"?"name":"date",Ee(s.value)}function Te(N){return`${o.value}::${N.trim().toLowerCase()}`}function xe(N){var V;if(typeof window>"u")return null;try{const J=window.localStorage.getItem(xo);return J?((V=JSON.parse(J).byKey)==null?void 0:V[N])??null:null}catch{return null}}function Le(N,V){if(!(typeof window>"u"))try{const J=window.localStorage.getItem(xo),z=(J?JSON.parse(J):{}).byKey??{};z[N]=V,window.localStorage.setItem(xo,JSON.stringify({byKey:z}))}catch{}}function Pe(){if(!(typeof window>"u"))try{window.localStorage.removeItem(xo)}catch{}}function Oe(N){const V=N.installed??[];a.value=V;const J=new Set(V.map(Q=>Q.name));i.value=N.data.map(Q=>{if(Q.installed||J.has(Q.name)){const z=V.find(_e=>_e.name===Q.name);return{...Q,installed:!0,path:(z==null?void 0:z.path)??Q.path,enabled:(z==null?void 0:z.enabled)??Q.enabled}}return Q}).filter(Q=>!Q.installed),l.value=N.total}async function Ee(N){const V=Te(N),J=xe(V);J&&Oe(J),u.value=!J,c.value="";try{const Q=new URLSearchParams;N.trim()&&Q.set("q",N.trim()),Q.set("limit","100"),Q.set("sort",o.value);const z=await fetch(`/codex-api/skills-hub?${Q}`);if(!z.ok)throw new Error(`HTTP ${z.status}`);const _e=await z.json();Oe(_e),Le(V,_e)}catch(Q){c.value=Q instanceof Error?Q.message:"Failed to load skills"}finally{u.value=!1}}function Ye(){A&&clearTimeout(A),A=setTimeout(()=>Ee(s.value),300)}function Ze(N){k.value=N,m.value=!0}async function Ne(N){P.value=`${N.owner}/${N.name}`,F.value=!0;try{const J=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:N.owner,name:N.name})})).json();if(!J.ok)throw new Error(J.error||"Install failed");const Q={...N,installed:!0,path:J.path,enabled:!0};a.value=[...a.value,Q],i.value=i.value.filter(z=>z.name!==N.name),k.value=Q,we(`${N.displayName||N.name} skill installed`),m.value=!1,Pe(),W("skills-changed")}catch(V){we(V instanceof Error?V.message:"Failed to install skill","error")}finally{F.value=!1}}async function nt(N){P.value=`${N.owner}/${N.name}`,R.value=!0;try{const J=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:N.name,path:N.path})})).json();if(!J.ok)throw new Error(J.error||"Uninstall failed");a.value=a.value.filter(Q=>Q.name!==N.name),N.owner!=="local"&&(i.value=[...i.value,{...N,installed:!1,path:void 0,enabled:void 0}]),we(`${N.displayName||N.name} skill uninstalled`),m.value=!1,Pe(),W("skills-changed")}catch(V){we(V instanceof Error?V.message:"Failed to uninstall skill","error")}finally{R.value=!1}}async function gt(N,V){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:N.path,enabled:V}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),we(`${N.displayName||N.name} skill ${V?"enabled":"disabled"}`),await Ee(s.value)}catch(J){we(J instanceof Error?J.message:"Failed to update skill","error")}}const{deviceLogin:at,isPullInFlight:et,isPushInFlight:Xe,isSyncActionInFlight:K,loadSyncStatus:he,logoutGithub:ue,pullSkillsSync:be,pushSkillsSync:$e,startGithubFirebaseLogin:g,startGithubLogin:b,syncActionError:x,syncActionStatus:q,syncStatus:G}=IC({showToast:we,onPulled:async()=>{await Ee(s.value),W("skills-changed")}});return pr(()=>{Ee(""),he()}),(N,V)=>(w(),T("div",EC,[V[11]||(V[11]=p("div",{class:"skills-hub-header"},[p("h2",{class:"skills-hub-title"},"Skills Hub"),p("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),p("div",CC,[p("div",AC,[V[8]||(V[8]=p("strong",null,"Skills Sync (GitHub)",-1)),ye(G).configured?(w(),T("span",RC,"Connected: "+ie(ye(G).repoOwner)+"/"+ie(ye(G).repoName),1)):ye(G).loggedIn?(w(),T("span",PC,"Logged in as "+ie(ye(G).githubUsername),1)):(w(),T("span",xC,"Not connected"))]),p("div",MC,[p("span",null,"Startup: "+ie(ye(G).startup.mode),1),p("span",null,"Branch: "+ie(ye(G).startup.branch),1),p("span",null,"Action: "+ie(ye(G).startup.lastAction),1)]),ye(G).startup.lastError?(w(),T("div",$C,ie(ye(G).startup.lastError),1)):ae("",!0),ye(q)?(w(),T("div",OC,[p("span",null,"Manual sync: "+ie(ye(q)),1)])):ae("",!0),ye(x)?(w(),T("div",NC,ie(ye(x)),1)):ae("",!0),ye(at)?(w(),T("div",DC,[p("span",null,[V[9]||(V[9]=no("Open ",-1)),p("a",{href:ye(at).verification_uri,target:"_blank",rel:"noreferrer"},"GitHub device login",8,LC),V[10]||(V[10]=no(" and enter code:",-1))]),p("code",null,ie(ye(at).user_code),1)])):ae("",!0),p("div",jC,[ye(G).loggedIn?ae("",!0):(w(),T("button",{key:0,class:"skills-hub-sort",type:"button",onClick:V[0]||(V[0]=(...J)=>ye(g)&&ye(g)(...J))},"Login with GitHub")),ye(G).loggedIn?ae("",!0):(w(),T("button",{key:1,class:"skills-hub-sort",type:"button",onClick:V[1]||(V[1]=(...J)=>ye(b)&&ye(b)(...J))},"Device Login")),ye(G).loggedIn?(w(),T("button",{key:2,class:"skills-hub-sort",type:"button",onClick:V[2]||(V[2]=(...J)=>ye(ue)&&ye(ue)(...J)),disabled:ye(K)},"Logout GitHub",8,UC)):ae("",!0),p("button",{class:"skills-hub-sort",type:"button",onClick:V[3]||(V[3]=(...J)=>ye(be)&&ye(be)(...J)),disabled:ye(K)},ie(ye(et)?"Pulling...":"Pull"),9,FC),ye(G).loggedIn?(w(),T("button",{key:3,class:"skills-hub-sort",type:"button",onClick:V[4]||(V[4]=(...J)=>ye($e)&&ye($e)(...J)),disabled:!ye(G).configured||ye(K)},ie(ye(Xe)?"Pushing...":"Push"),9,BC)):ae("",!0)])]),U.value?(w(),T("div",{key:0,class:it(["skills-hub-toast",me.value])},ie(U.value.text),3)):ae("",!0),le.value.length>0?(w(),T("div",HC,[p("button",{class:"skills-hub-section-toggle",type:"button",onClick:V[5]||(V[5]=J=>f.value=!f.value)},[p("span",WC,"Installed ("+ie(le.value.length)+")",1),Re(Rf,{class:it(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(w(),T("div",VC,[(w(!0),T(Be,null,St(le.value,J=>(w(),ft(fu,{key:J.name,skill:J,onSelect:Q=>Ze(Q)},null,8,["skill","onSelect"]))),128))])):ae("",!0)])):ae("",!0),p("div",GC,[p("div",zC,[Re(Ba,{class:"skills-hub-search-icon"}),cr(p("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":V[6]||(V[6]=J=>s.value=J),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:Ye},null,544),[[ur,s.value]]),l.value>0?(w(),T("span",qC,ie(l.value)+" skills",1)):ae("",!0)]),p("button",{class:"skills-hub-sort",type:"button",onClick:Y},ie(ce.value),1)]),p("div",KC,[u.value?(w(),T("div",JC,"Loading skills...")):c.value?(w(),T("div",YC,ie(c.value),1)):(w(),T(Be,{key:2},[i.value.length>0?(w(),T("div",XC,[(w(!0),T(Be,null,St(i.value,J=>(w(),ft(fu,{key:J.url,skill:J,onSelect:Q=>Ze(Q)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(w(),T("div",QC,'No skills found for "'+ie(s.value)+'"',1)):ae("",!0)],64))]),Re(HT,{skill:k.value,visible:m.value,"is-installing":Ie.value,"is-uninstalling":re.value,onClose:V[7]||(V[7]=J=>m.value=!1),onInstall:Ne,onUninstall:nt,onToggleEnabled:gt},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),eA=st(ZC,[["__scopeId","data-v-2f6920be"]]),tA={},nA={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 rA(e,t){return w(),T("svg",nA,[...t[0]||(t[0]=[p("path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12"},null,-1),p("path",{d:"M9 4l0 16"},null,-1)])])}const sA=st(tA,[["render",rA]]),oA={},iA={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function aA(e,t){return w(),T("svg",iA,[...t[0]||(t[0]=[p("path",{d:"M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm12 -16h-8v14h8a1 1 0 0 0 1 -1v-12a1 1 0 0 0 -1 -1"},null,-1)])])}const lA=st(oA,[["render",aA]]),cA={class:"sidebar-thread-controls"},uA=["aria-label","title"],dA=Ht({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(w(),T("div",cA,[p("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",title:e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",onClick:n[0]||(n[0]=r=>t.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(w(),ft(lA,{key:0,class:"sidebar-thread-controls-icon"})):(w(),ft(sA,{key:1,class:"sidebar-thread-controls-icon"}))],8,uA),Gn(t.$slots,"default",{},void 0),e.showNewThreadButton?(w(),T("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[1]||(n[1]=r=>t.$emit("start-new-thread"))},[Re(ei,{class:"sidebar-thread-controls-icon"})])):ae("",!0)]))}}),Fu=st(dA,[["__scopeId","data-v-46a10052"]]),fA={},hA={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function pA(e,t){return w(),T("svg",hA,[...t[0]||(t[0]=[p("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[p("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065"}),p("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const mA=st(fA,[["render",pA]]);function Er(e){return e.flatMap(t=>t.threads)}const Th="codex-web-local.thread-read-state.v1",Sh="codex-web-local.thread-scroll-state.v1",Ya="codex-web-local.selected-thread-id.v1",Xa="codex-web-local.selected-model-id.v1",Ih="codex-web-local.project-order.v1",Eh="codex-web-local.project-display-name.v1",ga=220,gA=500,Bu=["none","minimal","low","medium","high","xhigh"],js="__global__",Sn="gpt-5.2-codex",vA="Auto-commit from Codex worktree chat turn";function yA(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Th);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function Hu(e){typeof window>"u"||window.localStorage.setItem(Th,JSON.stringify(e))}function Qa(e,t,n){return Math.min(Math.max(e,t),n)}function wA(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;if(typeof t.scrollTop!="number"||!Number.isFinite(t.scrollTop)||typeof t.isAtBottom!="boolean")return null;const n={scrollTop:Math.max(0,t.scrollTop),isAtBottom:t.isAtBottom};return typeof t.scrollRatio=="number"&&Number.isFinite(t.scrollRatio)&&(n.scrollRatio=Qa(t.scrollRatio,0,1)),n}function bA(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Sh);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t)){if(!r)continue;const o=wA(s);o&&(n[r]=o)}return n}catch{return{}}}function Wu(e){typeof window>"u"||window.localStorage.setItem(Sh,JSON.stringify(e))}function _A(){return typeof window>"u"?"":window.localStorage.getItem(Ya)??""}function kA(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Ya);return}window.localStorage.setItem(Ya,e)}}function TA(){var e;return typeof window>"u"?"":((e=window.localStorage.getItem(Xa))==null?void 0:e.trim())??""}function va(e){if(typeof window>"u")return;const t=e.trim();if(!t){window.localStorage.removeItem(Xa);return}window.localStorage.setItem(Xa,t)}function SA(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Ih);if(!e)return[];const t=JSON.parse(e);if(!Array.isArray(t))return[];const n=[];for(const r of t)typeof r=="string"&&r.length>0&&!n.includes(r)&&n.push(r);return n}catch{return[]}}function os(e){typeof window>"u"||window.localStorage.setItem(Ih,JSON.stringify(e))}function IA(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Eh);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t))typeof r=="string"&&r.length>0&&typeof s=="string"&&(n[r]=s);return n}catch{return{}}}function ya(e){typeof window>"u"||window.localStorage.setItem(Eh,JSON.stringify(e))}function Mo(e,t){const n=[];for(const r of e)n.includes(r)||n.push(r);for(const r of t)n.includes(r.projectName)||n.push(r.projectName);return Wr(e,n)?e:n}function wa(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>n.get(s)??null).filter(s=>s!==null&&s.threads.length>0);for(const s of e)t.includes(s.projectName)||r.push(s);return r}function Wr(e,t){const n=Array.isArray(e)?e:[],r=Array.isArray(t)?t:[];if(n.length!==r.length)return!1;for(let s=0;s<n.length;s+=1)if(n[s]!==r[s])return!1;return!0}function EA(e,t,n){if(t<0||t>=e.length||n<0||n>=e.length||t===n)return e;const r=[...e],[s]=r.splice(t,1);return r.splice(n,0,s),r}function CA(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function $o(e){if(!(e instanceof Error))return!1;const t=e.message.toLowerCase();return t.includes("not supported when using codex with a chatgpt account")||t.includes("model is not supported")}function Za(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Wr(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&CA(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function ai(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 AA(e,t,n={}){const r=new Map(e.map(c=>[c.id,c])),s=new Map(t.map(c=>[c.id,c])),o=t.map(c=>{const f=r.get(c.id);return f&&Za(f,c)?f:c});if(n.preserveMissing!==!0)return ai(e,o)?e:o;const i=e.map(c=>{const f=s.get(c.id);return!f||Za(c,f)?c:f}),a=new Set(e.map(c=>c.id)),l=o.filter(c=>!a.has(c.id)),u=[...i,...l];return ai(e,u)?e:u}function el(e){return e.replace(/\s+/gu," ").trim()}function RA(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>el(s.text)).filter(s=>s.length>0));if(n.size===0)return e;const r=e.filter(s=>{if(s.messageType!=="agentMessage.live")return!0;const o=el(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function Vu(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Za(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const Ch="worked";function Tr(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function PA(e){if(!Number.isFinite(e)||e<=0)return"<1s";const t=Math.max(1,Math.round(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),s=t%60,o=[];n>0&&o.push(`${n}h`),(r>0||n>0)&&o.push(`${r}m`);const i=s>0||o.length===0?s:0;return o.push(`${i}s`),o.join(" ")}function xA(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function MA(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 $A(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${PA(e.durationMs)}`,messageType:Ch}}function OA(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function NA(e,t){const n=$A(t),r=e.filter(i=>i.messageType!==Ch),s=OA(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function Gt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function DA(e,t){return e.id===t.id&&e.title===t.title&&e.projectName===t.projectName&&e.cwd===t.cwd&&e.createdAtIso===t.createdAtIso&&e.updatedAtIso===t.updatedAtIso&&e.preview===t.preview&&e.unread===t.unread&&e.inProgress===t.inProgress}function LA(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 jA(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 Zt(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function Oo(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>{const o=n.get(s.projectName),i=new Map((o==null?void 0:o.threads.map(l=>[l.id,l]))??[]),a=s.threads.map(l=>{const u=i.get(l.id);return u&&DA(u,l)?u:l});return o&&o.projectName===s.projectName&&LA(o.threads,a)?o:{projectName:s.projectName,threads:a}});return jA(e,r)?e:r}function UA(e,t,n){const r=new Set(Er(t).map(a=>a.id)),s=Er(e).filter(a=>n[a.id]===!0&&!r.has(a.id));if(s.length===0)return t;const o=new Map(t.map(a=>[a.projectName,a])),i=t.map(a=>({projectName:a.projectName,threads:[...a.threads]}));for(const a of s){if(o.get(a.projectName)){const u=i.findIndex(c=>c.projectName===a.projectName);u>=0&&(i[u]={projectName:i[u].projectName,threads:[a,...i[u].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function FA(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function ba(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function BA(e){const t=e.split(`
1422
- `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function HA(){const e=D([]),t=D([]),n=D(_A()),r=D({}),s=D({}),o=D({}),i=D({}),a=D({}),l=D({}),u=D({}),c=D({}),f=D([]),m=D(TA()),k=D("medium"),U=D("standard"),P=D(yA()),F=D(bA()),R=D(SA()),A=D(IA()),B=D({}),W=D({}),ce=D({}),me=D({}),ve=D({}),Ie=D({}),re=D({}),le=D({}),we=D({}),Y=D({}),Te=D([]),xe=D([]),Le=D(!1),Pe=D(!1),Oe=D(!1),Ee=D(!1),Ye=D(!1),Ze=D(!1),Ne=D(""),nt=D(!1),gt=D(!1);let at=null,et=null,Xe=null,K=null,he=!1;const ue=new Set;let be=!1,$e=!1;const g=new Map,b=new Set,x=D(!0),q=fe(()=>Er(e.value)),G=fe(()=>q.value.find(d=>d.id===n.value)??null),N=fe(()=>F.value[n.value]??null),V=fe(()=>{const d=[],h=n.value;return h&&Array.isArray(le.value[h])&&d.push(...le.value[h]),Array.isArray(le.value[js])&&d.push(...le.value[js]),d.sort((v,C)=>v.receivedAtIso.localeCompare(C.receivedAtIso))}),J=fe(()=>{var Z;const d=n.value;if(!d)return null;const h=ve.value[d],v=(o.value[d]??"").trim(),C=(((Z=Ie.value[d])==null?void 0:Z.message)??"").trim();return!h&&!v&&!C?null:{activityLabel:(h==null?void 0:h.label)||"Thinking",activityDetails:(h==null?void 0:h.details)??[],reasoningText:v,errorText:C}}),Q=fe(()=>{const d=n.value;if(!d)return[];const h=r.value[d]??[],v=s.value[d]??[],C=i.value[d]??[],Z=[...h,...C,...v],te=me.value[d];return te?NA(Z,te):Z});function z(d){n.value!==d&&(n.value=d,kA(d),$e=!1)}function _e(d){m.value=d.trim(),va(m.value)}function de(d){x.value=d}async function Se(){m.value=Sn,va(m.value),f.value.includes(Sn)||(f.value=[...f.value,Sn]);try{await j_(Sn)}catch{}}function Me(d,h){we.value={...we.value,[d]:h}}function De(d){we.value[d]&&(we.value=Gt(we.value,d))}async function Fe(d,h){if(!x.value)return;const v=h.trim();if(!v)return;const C=q.value.find(te=>te.id===d);if(!(C!=null&&C.hasWorktree))return;const Z=C.cwd.trim();Z&&(await G_(Z,v),he=!0)}async function He(d,h){var Ae;if(!x.value)return;const v=q.value.find(ke=>ke.id===d);if(!(v!=null&&v.hasWorktree))return;const C=v.cwd.trim();if(!C)return;const te=(r.value[d]??[]).find(ke=>ke.role==="user"&&ke.turnIndex===h),pe=((Ae=te==null?void 0:te.text)==null?void 0:Ae.trim())??"";if(pe){try{await z_(C,pe)}catch(ke){if((ke instanceof Error?ke.message:"").includes("No matching commit found"))return;throw ke}he=!0}}async function ot(d){if(b.has(d))return;const h=we.value[d];if(!(!h||h.fallbackRetried)){b.add(d),Me(d,{...h,fallbackRetried:!0});try{await Se();try{const v=await ou(d,1);$t(d,v),Wt(d,[]),E(d),i.value[d]&&(i.value=Gt(i.value,d))}catch{}bt(d,null),Ne.value="",xt(d,null),It(d,{label:"Thinking",details:yt(Sn,h.effort)}),Tt(d,!0),ce.value[d]!==!0&&await ia(d),await aa(d,h.text,h.imageUrls,Sn,h.effort||void 0,h.skills.length>0?h.skills:void 0,h.fileAttachments),ce.value={...ce.value,[d]:!0},kt(),ue.add(d),he=!0,await Jn()}catch(v){const C=v instanceof Error?v.message:"Unknown application error";bt(d,C),Ne.value=C,Tt(d,!1),It(d,null)}finally{b.delete(d)}}}function tt(d){d&&!Bu.includes(d)||(k.value=d)}async function vt(d){const h=d==="fast"?"fast":"standard";if(Ye.value||U.value===h)return;const v=U.value;U.value=h,Ye.value=!0,Ne.value="";try{await U_(h)}catch(C){U.value=v,Ne.value=C instanceof Error?C.message:"Failed to update Fast mode"}finally{Ye.value=!1}}function yt(d,h){const v=d.trim()||"default",C=h||"default",Z=U.value==="fast"?"Fast":"Standard";return[`Model: ${v}`,`Thinking: ${C}`,`Speed: ${Z}`]}async function jt(){try{const[d,h]=await Promise.all([F_(),B_()]);f.value=d,m.value.length>0&&d.includes(m.value)||(h.model&&d.includes(h.model)?m.value=h.model:d.length>0?m.value=d[0]:m.value="",va(m.value)),h.reasoningEffort&&Bu.includes(h.reasoningEffort)&&(k.value=h.reasoningEffort),U.value=h.speedMode}catch{}}async function zt(){if(K){await K;return}K=(async()=>{try{xe.value=lt(await H_())}catch{}finally{K=null}})(),await K}function kt(){if(typeof window>"u"){zt();return}Xe!==null&&window.clearTimeout(Xe),Xe=window.setTimeout(()=>{Xe=null,zt()},gA)}function Rt(d){const h=Y.value;return Object.keys(h).length===0?d:d.map(v=>({projectName:v.projectName,threads:v.threads.map(C=>{const Z=h[C.id];return Z?{...C,title:Z}:C})}))}function wt(){const h=Rt(t.value).map(v=>({projectName:v.projectName,threads:v.threads.map(C=>{const Z=a.value[C.id]===!0,te=n.value===C.id,pe=P.value[C.id],Ae=c.value[C.id]===!0,ke=!te&&!Z&&(Ae||pe!==C.updatedAtIso);return{...C,inProgress:Z,unread:ke}})}));e.value=Oo(e.value,h)}function Dt(d,h,v){const C=new Date().toISOString(),Z=h.trim(),te=FA(Z),pe={id:d,title:BA(v),projectName:te,cwd:Z,hasWorktree:Z.includes("/.codex/worktrees/")||Z.includes("/.git/worktrees/"),createdAtIso:C,updatedAtIso:C,preview:v,unread:!1,inProgress:!1},Ae=t.value.findIndex(y=>y.projectName===te);if(Ae>=0){const M=t.value[Ae].threads.filter(Ve=>Ve.id!==d),ne={projectName:te,threads:[pe,...M]},Ue=[...t.value];Ue.splice(Ae,1,ne),t.value=Ue}else t.value=[{projectName:te,threads:[pe]},...t.value];const ke=Mo(R.value,t.value);Wr(R.value,ke)||(R.value=ke,os(R.value)),wt()}function Qt(d){const h=new Set(d.map(te=>te.id)),v=Zt(P.value,h);v!==P.value&&(P.value=v,Hu(v));const C=Zt(F.value,h);C!==F.value&&(F.value=C,Wu(C)),W.value=Zt(W.value,h),B.value=Zt(B.value,h),ce.value=Zt(ce.value,h),r.value=Zt(r.value,h),s.value=Zt(s.value,h),o.value=Zt(o.value,h),i.value=Zt(i.value,h),me.value=Zt(me.value,h),ve.value=Zt(ve.value,h),Ie.value=Zt(Ie.value,h),re.value=Zt(re.value,h),c.value=Zt(c.value,h),a.value=Zt(a.value,h);const Z={};for(const[te,pe]of Object.entries(le.value))(te===js||h.has(te))&&(Z[te]=pe);le.value=Z}function qt(d){const h=Er(t.value).find(v=>v.id===d);h&&(P.value={...P.value,[d]:h.updatedAtIso},Hu(P.value),c.value[d]&&(c.value=Gt(c.value,d)),wt())}function xt(d,h){if(!d)return;const v=me.value[d];if(h){if(xA(v,h))return;me.value={...me.value,[d]:h}}else v&&(me.value=Gt(me.value,d))}function Tt(d,h){!d||a.value[d]===!0===h||(h?a.value={...a.value,[d]:!0}:a.value=Gt(a.value,d),wt())}function Kt(d){d&&d!==n.value&&c.value[d]!==!0&&(c.value={...c.value,[d]:!0},wt())}function It(d,h){if(!d)return;const v=ve.value[d];if(!h){v&&(ve.value=Gt(ve.value,d));return}const C=qe(h.label)||"Thinking",Z=h.details.map(Ae=>qe(Ae)).filter(Ae=>Ae.length>0&&Ae!==C),te=Array.from(new Set([...(v==null?void 0:v.details)??[],...Z])).slice(-3),pe={label:C,details:te};MA(v,pe)||(ve.value={...ve.value,[d]:pe})}function bt(d,h){if(!d)return;const v=Ie.value[d],C=h?el(h):"";if(!C){v&&(Ie.value=Gt(Ie.value,d));return}(v==null?void 0:v.message)!==C&&(Ie.value={...Ie.value,[d]:{message:C}})}function Jt(d){const h=Er(t.value).find(v=>v.id===d);return(h==null?void 0:h.updatedAtIso)??""}function yn(d,h){if(!d)return;const v={scrollTop:Math.max(0,h.scrollTop),isAtBottom:h.isAtBottom===!0};typeof h.scrollRatio=="number"&&Number.isFinite(h.scrollRatio)&&(v.scrollRatio=Qa(h.scrollRatio,0,1));const C=F.value[d];C&&C.scrollTop===v.scrollTop&&C.isAtBottom===v.isAtBottom&&C.scrollRatio===v.scrollRatio||(F.value={...F.value,[d]:v},Wu(F.value))}function $t(d,h){const v=r.value[d]??[];ai(v,h)||(r.value={...r.value,[d]:h})}function Wt(d,h){const v=s.value[d]??[];ai(v,h)||(s.value={...s.value,[d]:h})}function wn(d,h){const v=s.value[d]??[],C=Vu(v,h);Wt(d,C)}function _(d,h){if(!d)return;const v=h.trim(),C=o.value[d]??"";if(v.length===0){if(!C)return;o.value=Gt(o.value,d);return}C!==v&&(o.value={...o.value,[d]:v})}function S(d,h){if(!d)return;const v=o.value[d]??"";_(d,`${v}${h}`)}function E(d){d&&d in o.value&&(o.value=Gt(o.value,d))}function O(d){return d!==null&&typeof d=="object"&&!Array.isArray(d)?d:null}function H(d){return typeof d=="string"?d:""}function oe(d){return typeof d=="number"&&Number.isFinite(d)?d:null}function Ce(d){var h,v;return((h=d.limitId)==null?void 0:h.trim())||((v=d.limitName)==null?void 0:v.trim())||"__default__"}function ge(d){const h=O(d);return h?{usedPercent:Qa(oe(h.usedPercent)??0,0,100),windowDurationMins:oe(h.windowDurationMins),resetsAt:oe(h.resetsAt)}:null}function Ke(d){const h=O(d);if(!h)return null;const v=O(h.credits);return{limitId:H(h.limitId)||null,limitName:H(h.limitName)||null,primary:ge(h.primary),secondary:ge(h.secondary),credits:v?{hasCredits:v.hasCredits===!0,unlimited:v.unlimited===!0,balance:H(v.balance)||null}:null,planType:H(h.planType)||null}}function lt(d){const h=O(d);if(!h)return[];const v=[],C=new Set,Z=pe=>{if(!pe)return;const Ae=Ce(pe);C.has(Ae)||(C.add(Ae),v.push(pe))};Z(Ke(h.rateLimits));const te=O(h.rateLimitsByLimitId);if(te)for(const pe of Object.values(te))Z(Ke(pe));return v}function rt(d){const h=O(d.params);if(!h)return"";const v=H(h.threadId);if(v)return v;const C=H(h.thread_id);if(C)return C;const Z=H(h.conversationId);if(Z)return Z;const te=H(h.conversation_id);if(te)return te;const pe=O(h.thread),Ae=H(pe==null?void 0:pe.id);if(Ae)return Ae;const ke=O(h.turn),y=H(ke==null?void 0:ke.threadId);if(y)return y;const M=H(ke==null?void 0:ke.thread_id);return M||""}function Nt(d){if(d.method!=="turn/completed")return"";const h=O(d.params),v=O(h==null?void 0:h.turn);if(!v||v.status!=="failed")return"";const C=O(v.error);return H(C==null?void 0:C.message)}function mn(d){var v;if(d.method!=="error")return"";const h=O(d.params);return H(h==null?void 0:h.message)||H((v=O(h==null?void 0:h.error))==null?void 0:v.message)}function Nn(d){const h=O(d);if(!h)return null;const v=h.id,C=H(h.method),Z=h.params;if(typeof v!="number"||!Number.isInteger(v)||!C)return null;const te=O(Z),pe=H(te==null?void 0:te.threadId)||js,Ae=H(te==null?void 0:te.turnId),ke=H(te==null?void 0:te.itemId),y=H(h.receivedAtIso)||new Date().toISOString();return{id:v,method:C,threadId:pe,turnId:Ae,itemId:ke,receivedAtIso:y,params:Z??null}}function j(d){const h=d.threadId||js,v=le.value[h]??[],C=v.findIndex(te=>te.id===d.id),Z=[...v];C>=0?Z.splice(C,1,d):Z.push(d),le.value={...le.value,[h]:Z.sort((te,pe)=>te.receivedAtIso.localeCompare(pe.receivedAtIso))}}function X(d){const h={};for(const[v,C]of Object.entries(le.value)){const Z=C.filter(te=>te.id!==d);Z.length>0&&(h[v]=Z)}le.value=h}function se(d){if(d.method==="server/request"){const h=Nn(d.params);return h&&j(h),!0}if(d.method==="server/request/resolved"){const h=O(d.params),v=h==null?void 0:h.id;return typeof v=="number"&&Number.isInteger(v)&&X(v),!0}return!1}function qe(d){return d.replace(/\s+/gu," ").trim()}function Pt(d){const h=rt(d);if(!h)return null;if(d.method==="turn/started")return{threadId:h,activity:{label:"Thinking",details:[]}};if(d.method==="item/started"){const v=O(d.params),C=O(v==null?void 0:v.item),Z=H(C==null?void 0:C.type).toLowerCase();if(Z==="reasoning")return{threadId:h,activity:{label:"Thinking",details:[]}};if(Z==="agentmessage")return{threadId:h,activity:{label:"Writing response",details:[]}};if(Z==="commandexecution"){const te=H(C==null?void 0:C.command);return{threadId:h,activity:{label:"Running command",details:te?[te]:[]}}}}return d.method==="item/commandExecution/outputDelta"?{threadId:h,activity:{label:"Running command",details:[]}}:d.method==="item/reasoning/summaryTextDelta"||d.method==="item/reasoning/summaryPartAdded"?{threadId:h,activity:{label:"Thinking",details:[]}}:d.method==="item/agentMessage/delta"?{threadId:h,activity:{label:"Writing response",details:[]}}:null}function bn(d){if(d.method!=="turn/started")return null;const h=O(d.params);if(!h)return null;const v=rt(d);if(!v)return null;const C=O(h.turn),Z=H(C==null?void 0:C.id)||H(h.turnId)||`${v}:unknown`;if(!Z)return null;const te=Tr(H(C==null?void 0:C.startedAt))??Tr(H(h.startedAt))??Tr(d.atIso)??Date.now();return{threadId:v,turnId:Z,startedAtMs:te}}function _n(d){if(d.method!=="turn/completed")return null;const h=O(d.params);if(!h)return null;const v=rt(d);if(!v)return null;const C=O(h.turn),Z=H(C==null?void 0:C.id)||H(h.turnId)||`${v}:unknown`;if(!Z)return null;const te=Tr(H(C==null?void 0:C.completedAt))??Tr(H(h.completedAt))??Tr(d.atIso)??Date.now(),pe=Tr(H(C==null?void 0:C.startedAt))??Tr(H(h.startedAt))??void 0;return{threadId:v,turnId:Z,completedAtMs:te,startedAtMs:pe}}function an(d){return`${d}:live-reasoning`}function Vt(d){const h=O(d.params);if(!h)return"";if(d.method==="item/started"){const v=O(h.item);return!v||v.type!=="reasoning"?"":H(v.id)}return""}function Dn(d){const h=O(d.params);if(!h)return null;if(d.method==="item/reasoning/summaryTextDelta"){const v=H(h.itemId),C=H(h.delta);return!v||!C?null:{messageId:an(v),delta:C}}return null}function I(d){const h=O(d.params);if(!h)return"";if(d.method==="item/reasoning/summaryPartAdded"){const v=H(h.itemId);return v?an(v):""}return""}function $(d){const h=O(d.params);if(!h)return"";if(d.method==="item/completed"){const v=O(h.item);return!v||v.type!=="reasoning"?"":an(H(v.id))}return""}function L(d){const h=O(d.params);if(!h)return"";if(d.method==="item/started"){const v=O(h.item);return!v||v.type!=="agentMessage"?"":H(v.id)}return""}function ee(d){const h=O(d.params);if(!h)return null;if(d.method==="item/agentMessage/delta"){const v=H(h.itemId),C=H(h.delta);return!v||!C?null:{messageId:v,delta:C}}return null}function Ge(d){const h=O(d.params);if(!h)return null;if(d.method==="item/completed"){const v=O(h.item);if(!v||v.type!=="agentMessage")return null;const C=H(v.id),Z=H(v.text);return!C||!Z?null:{id:C,role:"assistant",text:Z,messageType:"agentMessage.live"}}return null}function Ut(d){if(d.method!=="item/started")return null;const h=O(d.params),v=O(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const C=H(v.id),Z=H(v.command);if(!C)return null;const te=typeof v.cwd=="string"?v.cwd:null;return{id:C,role:"system",text:Z,messageType:"commandExecution",commandExecution:{command:Z,cwd:te,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function gn(d){if(d.method!=="item/commandExecution/outputDelta")return null;const h=O(d.params);if(!h)return null;const v=H(h.itemId),C=H(h.delta);return!v||!C?null:{itemId:v,delta:C}}function Xr(d){if(d.method!=="item/completed")return null;const h=O(d.params),v=O(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const C=H(v.id),Z=H(v.command);if(!C)return null;const te=typeof v.cwd=="string"?v.cwd:null,pe=H(v.status),Ae=pe==="failed"?"failed":pe==="declined"?"declined":pe==="interrupted"?"interrupted":"completed",ke=typeof v.aggregatedOutput=="string"?v.aggregatedOutput:"",y=typeof v.exitCode=="number"?v.exitCode:null;return{id:C,role:"system",text:Z,messageType:"commandExecution",commandExecution:{command:Z,cwd:te,status:Ae,aggregatedOutput:ke,exitCode:y}}}function gr(d,h){const v=i.value[d]??[],C=Vu(v,h);C!==v&&(i.value={...i.value,[d]:C})}function kn(d,h){const v=i.value[d];if(!v||v.length===0)return;const C=new Set(h.map(te=>te.id)),Z=v.filter(te=>!C.has(te.id));Z.length!==v.length&&(Z.length===0?i.value=Gt(i.value,d):i.value={...i.value,[d]:Z})}function vr(d){if(d.method==="item/agentMessage/delta")return!0;const h=O(d.params);if(!h)return!1;if(d.method==="item/completed"){const v=O(h.item);return(v==null?void 0:v.type)==="agentMessage"}return!1}function Qr(d){var Ms,rs,Ul,Fl,Bl;if(se(d))return;if(d.method==="account/rateLimits/updated"&&kt(),d.method==="thread/name/updated"){const Qe=O(d.params),En=H(Qe==null?void 0:Qe.threadId),wr=H(Qe==null?void 0:Qe.threadName);En&&wr&&(Y.value={...Y.value,[En]:wr},wt(),la(En,wr))}const h=Pt(d);h&&It(h.threadId,h.activity);const v=bn(d);v&&(g.set(v.turnId,v),re.value={...re.value,[v.threadId]:v.turnId},xt(v.threadId,null),bt(v.threadId,null),Tt(v.threadId,!0),c.value[v.threadId]&&(c.value=Gt(c.value,v.threadId)));const C=_n(d),Z=Nt(d),pe=!!((C==null?void 0:C.threadId)??rt(d))&&!!Z&&m.value!==Sn&&$o(new Error(Z));if(C){const Qe=we.value[C.threadId],En=g.get(C.turnId);En&&g.delete(C.turnId);const wr=oe((Ms=O(d.params))==null?void 0:Ms.durationMs)??oe((Ul=O((rs=O(d.params))==null?void 0:rs.turn))==null?void 0:Ul.durationMs)??(typeof C.startedAtMs=="number"?C.completedAtMs-C.startedAtMs:null)??(En?C.completedAtMs-En.startedAtMs:null),Ah=typeof wr=="number"?Math.max(0,wr):0;if(xt(C.threadId,{turnId:C.turnId,durationMs:Ah}),re.value[C.threadId]&&(re.value=Gt(re.value,C.threadId)),Tt(C.threadId,!1),It(C.threadId,null),Kt(C.threadId),pe||(De(C.threadId),So(C.threadId)),!Z&&!pe){const Rh=((Fl=Qe==null?void 0:Qe.text)==null?void 0:Fl.trim())||vA;Fe(C.threadId,Rh).catch(()=>{})}}if(Z){const Qe=(C==null?void 0:C.threadId)||rt(d);Qe&&bt(Qe,Z),Ne.value=Z,Qe&&pe&&ot(Qe)}else C&&bt(C.threadId,null);const Ae=mn(d);if(Ae){const Qe=rt(d);Qe&&bt(Qe,Ae),Ne.value=Ae,m.value!==Sn&&$o(new Error(Ae))&&(Qe?ot(Qe):Se())}const ke=rt(d);if(!ke||ke!==n.value)return;L(d);const y=ee(d);if(y){const Qe=(s.value[ke]??[]).find(wr=>wr.id===y.messageId),En=`${(Qe==null?void 0:Qe.text)??""}${y.delta}`;wn(ke,{id:y.messageId,role:"assistant",text:En,messageType:"agentMessage.live"})}const M=Ge(d);M&&wn(ke,M),Vt(d);const ne=Dn(d);if(ne&&S(ke,ne.delta),I(d)){const Qe=o.value[ke]??"";Qe.trim().length>0&&!Qe.endsWith(`
1421
+ */const wC=300,bC=jf("authIdTokenMaxAge")||wC;let Uu=null;const _C=e=>async t=>{const n=t&&await t.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>bC)return;const s=n==null?void 0:n.token;Uu!==s&&(Uu=s,await fetch(e,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function kC(e=Vf()){const t=Hf(e,"auth");if(t.isInitialized())return t.getImmediate();const n=tE(e,{popupRedirectResolver:mC,persistence:[EE,pE,mh]}),r=jf("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const i=_C(o.toString());dE(n,i,()=>i(n.currentUser)),uE(n,a=>i(a))}}const s=XT("auth");return s&&rE(n,`http://${s}`),n}function TC(){var e;return((e=document.getElementsByTagName("head"))==null?void 0:e[0])??document}XI({loadJS(e){return new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=s=>{const o=Pn("internal-error");o.customData=s,n(o)},r.type="text/javascript",r.charset="UTF-8",TC().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});yC("Browser");const SC={apiKey:"AIzaSyAf0CIHBZ-wEQJ8CCUUWo1Wl9P7typ_ZPI",authDomain:"gptcall-416910.firebaseapp.com",projectId:"gptcall-416910",storageBucket:"gptcall-416910.appspot.com",messagingSenderId:"99275526699",appId:"1:99275526699:web:3b623e1e2996108b52106e"};function IC(e){const t=D(null),n=D(""),r=D(""),s=D(""),o=D({loggedIn:!1,githubUsername:"",repoOwner:"",repoName:"",configured:!1,startup:{inProgress:!1,mode:"idle",branch:"main",lastAction:"not-started",lastRunAtIso:"",lastSuccessAtIso:"",lastError:""}}),i=fe(()=>s.value==="pull"),a=fe(()=>s.value==="push"),l=fe(()=>s.value!=="");async function u(){try{const P=await fetch("/codex-api/skills-sync/status");if(!P.ok)return;const F=await P.json();F.data&&(o.value=F.data)}catch{}}async function c(){try{const P=await fetch("/codex-api/skills-sync/github/start-login",{method:"POST"}),F=await P.json();if(!P.ok||!F.data)throw new Error("Failed to start GitHub login");t.value=F.data;const R=30,A=Math.max((F.data.interval??5)*1e3,3e3);let B=!1;for(let W=0;W<R;W++){await new Promise(ve=>setTimeout(ve,A));const ce=await fetch("/codex-api/skills-sync/github/complete-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:F.data.device_code})}),me=await ce.json();if(!ce.ok)throw new Error(me.error||"Failed to complete GitHub login");if(me.ok){B=!0;break}if(!me.pending)throw new Error(me.error||"Failed to complete GitHub login")}if(!B)throw new Error("GitHub login timed out. Please retry.");t.value=null,await u(),e.showToast("GitHub login successful")}catch(P){e.showToast(P instanceof Error?P.message:"Failed GitHub login","error")}}async function f(){try{const P=fI().length>0?Vf():Wf(SC),F=kC(P),R=new Vn;R.addScope("repo");const A=await xE(F,R),B=Vn.credentialFromResult(A),W=(B==null?void 0:B.accessToken)??"";if(!W)throw new Error("GitHub access token missing from Firebase login");const ce=await fetch("/codex-api/skills-sync/github/token-login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:W})}),me=await ce.json();if(!ce.ok||!me.ok)throw new Error(me.error||"Failed to login with GitHub token");await u(),e.showToast("GitHub login successful")}catch(P){const F=P instanceof Error?P.message:"Failed Firebase GitHub login";e.showToast(F,"error")}}async function m(){r.value="",n.value="pull-started",s.value="pull";try{const P=await fetch("/codex-api/skills-sync/pull",{method:"POST"}),F=await P.json();if(!P.ok||!F.ok)throw new Error(F.error||"Failed to pull synced skills");await e.onPulled(),n.value="pull-success",e.showToast(o.value.loggedIn?"Pulled skills from private sync repo":"Pulled skills from upstream repo")}catch(P){const F=P instanceof Error?P.message:"Failed to pull sync";r.value=F,n.value="pull-failed",e.showToast(F,"error")}finally{s.value=""}}async function T(){r.value="",n.value="push-started",s.value="push";try{const P=await fetch("/codex-api/skills-sync/push",{method:"POST"}),F=await P.json();if(!P.ok||!F.ok)throw new Error(F.error||"Failed to push synced skills");n.value="push-success",e.showToast("Pushed skills to private sync repo")}catch(P){const F=P instanceof Error?P.message:"Failed to push sync";r.value=F,n.value="push-failed",e.showToast(F,"error")}finally{s.value=""}}async function U(){try{const P=await fetch("/codex-api/skills-sync/github/logout",{method:"POST"}),F=await P.json();if(!P.ok||!F.ok)throw new Error(F.error||"Failed to logout GitHub");await u(),e.showToast("Logged out from GitHub")}catch(P){e.showToast(P instanceof Error?P.message:"Failed to logout GitHub","error")}}return{deviceLogin:t,isPullInFlight:i,isPushInFlight:a,isSyncActionInFlight:l,loadSyncStatus:u,logoutGithub:U,pullSkillsSync:m,pushSkillsSync:T,startGithubFirebaseLogin:f,startGithubLogin:c,syncActionError:r,syncActionStatus:n,syncStatus:o}}const EC={class:"skills-hub"},CC={class:"skills-sync-panel"},AC={class:"skills-sync-header"},RC={key:0,class:"skills-sync-badge"},PC={key:1,class:"skills-sync-badge"},xC={key:2,class:"skills-sync-badge"},MC={class:"skills-sync-meta"},$C={key:0,class:"skills-sync-error"},OC={key:1,class:"skills-sync-meta"},NC={key:2,class:"skills-sync-error"},DC={key:3,class:"skills-sync-device"},LC=["href"],jC={class:"skills-sync-actions"},UC=["disabled"],FC=["disabled"],BC=["disabled"],HC={key:1,class:"skills-hub-section"},WC={class:"skills-hub-section-title"},VC={key:0,class:"skills-hub-grid"},GC={class:"skills-hub-toolbar"},zC={class:"skills-hub-search-wrap"},qC={key:0,class:"skills-hub-count"},KC={class:"skills-hub-section"},JC={key:0,class:"skills-hub-loading"},YC={key:1,class:"skills-hub-error"},XC={key:0,class:"skills-hub-grid"},QC={key:1,class:"skills-hub-empty"},xo="codex-web-local.skills-hub.cache.v1",ZC=Ht({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=D(null),s=D(""),o=D("date"),i=D([]),a=D([]),l=D(0),u=D(!1),c=D(""),f=D(!0),m=D(!1),T=D(n),U=D(null),P=D(""),F=D(!1),R=D(!1);let A=null,B=null;const W=t,ce=fe(()=>o.value==="date"?"Newest":"A-Z"),me=fe(()=>{var N;return((N=U.value)==null?void 0:N.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),ve=fe(()=>`${T.value.owner}/${T.value.name}`),Ie=fe(()=>F.value&&P.value===ve.value),re=fe(()=>R.value&&P.value===ve.value),le=fe(()=>{const N=s.value.toLowerCase().trim();return N?a.value.filter(V=>V.name.toLowerCase().includes(N)||V.owner.toLowerCase().includes(N)||(V.displayName??"").toLowerCase().includes(N)):a.value});function we(N,V="success"){U.value={text:N,type:V},B&&clearTimeout(B),B=setTimeout(()=>{U.value=null},3e3)}function Y(){o.value=o.value==="date"?"name":"date",Ee(s.value)}function Te(N){return`${o.value}::${N.trim().toLowerCase()}`}function xe(N){var V;if(typeof window>"u")return null;try{const J=window.localStorage.getItem(xo);return J?((V=JSON.parse(J).byKey)==null?void 0:V[N])??null:null}catch{return null}}function Le(N,V){if(!(typeof window>"u"))try{const J=window.localStorage.getItem(xo),z=(J?JSON.parse(J):{}).byKey??{};z[N]=V,window.localStorage.setItem(xo,JSON.stringify({byKey:z}))}catch{}}function Pe(){if(!(typeof window>"u"))try{window.localStorage.removeItem(xo)}catch{}}function Oe(N){const V=N.installed??[];a.value=V;const J=new Set(V.map(Q=>Q.name));i.value=N.data.map(Q=>{if(Q.installed||J.has(Q.name)){const z=V.find(_e=>_e.name===Q.name);return{...Q,installed:!0,path:(z==null?void 0:z.path)??Q.path,enabled:(z==null?void 0:z.enabled)??Q.enabled}}return Q}).filter(Q=>!Q.installed),l.value=N.total}async function Ee(N){const V=Te(N),J=xe(V);J&&Oe(J),u.value=!J,c.value="";try{const Q=new URLSearchParams;N.trim()&&Q.set("q",N.trim()),Q.set("limit","100"),Q.set("sort",o.value);const z=await fetch(`/codex-api/skills-hub?${Q}`);if(!z.ok)throw new Error(`HTTP ${z.status}`);const _e=await z.json();Oe(_e),Le(V,_e)}catch(Q){c.value=Q instanceof Error?Q.message:"Failed to load skills"}finally{u.value=!1}}function Ye(){A&&clearTimeout(A),A=setTimeout(()=>Ee(s.value),300)}function Ze(N){T.value=N,m.value=!0}async function Ne(N){P.value=`${N.owner}/${N.name}`,F.value=!0;try{const J=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:N.owner,name:N.name})})).json();if(!J.ok)throw new Error(J.error||"Install failed");const Q={...N,installed:!0,path:J.path,enabled:!0};a.value=[...a.value,Q],i.value=i.value.filter(z=>z.name!==N.name),T.value=Q,we(`${N.displayName||N.name} skill installed`),m.value=!1,Pe(),W("skills-changed")}catch(V){we(V instanceof Error?V.message:"Failed to install skill","error")}finally{F.value=!1}}async function nt(N){P.value=`${N.owner}/${N.name}`,R.value=!0;try{const J=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:N.name,path:N.path})})).json();if(!J.ok)throw new Error(J.error||"Uninstall failed");a.value=a.value.filter(Q=>Q.name!==N.name),N.owner!=="local"&&(i.value=[...i.value,{...N,installed:!1,path:void 0,enabled:void 0}]),we(`${N.displayName||N.name} skill uninstalled`),m.value=!1,Pe(),W("skills-changed")}catch(V){we(V instanceof Error?V.message:"Failed to uninstall skill","error")}finally{R.value=!1}}async function gt(N,V){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:N.path,enabled:V}})})).ok)throw new Error("Failed to update skill");await fetch("/codex-api/skills-sync/push",{method:"POST"}),we(`${N.displayName||N.name} skill ${V?"enabled":"disabled"}`),await Ee(s.value)}catch(J){we(J instanceof Error?J.message:"Failed to update skill","error")}}const{deviceLogin:at,isPullInFlight:et,isPushInFlight:Xe,isSyncActionInFlight:K,loadSyncStatus:he,logoutGithub:ue,pullSkillsSync:be,pushSkillsSync:$e,startGithubFirebaseLogin:g,startGithubLogin:b,syncActionError:M,syncActionStatus:q,syncStatus:G}=IC({showToast:we,onPulled:async()=>{await Ee(s.value),W("skills-changed")}});return pr(()=>{Ee(""),he()}),(N,V)=>(w(),k("div",EC,[V[11]||(V[11]=p("div",{class:"skills-hub-header"},[p("h2",{class:"skills-hub-title"},"Skills Hub"),p("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),p("div",CC,[p("div",AC,[V[8]||(V[8]=p("strong",null,"Skills Sync (GitHub)",-1)),ye(G).configured?(w(),k("span",RC,"Connected: "+oe(ye(G).repoOwner)+"/"+oe(ye(G).repoName),1)):ye(G).loggedIn?(w(),k("span",PC,"Logged in as "+oe(ye(G).githubUsername),1)):(w(),k("span",xC,"Not connected"))]),p("div",MC,[p("span",null,"Startup: "+oe(ye(G).startup.mode),1),p("span",null,"Branch: "+oe(ye(G).startup.branch),1),p("span",null,"Action: "+oe(ye(G).startup.lastAction),1)]),ye(G).startup.lastError?(w(),k("div",$C,oe(ye(G).startup.lastError),1)):ae("",!0),ye(q)?(w(),k("div",OC,[p("span",null,"Manual sync: "+oe(ye(q)),1)])):ae("",!0),ye(M)?(w(),k("div",NC,oe(ye(M)),1)):ae("",!0),ye(at)?(w(),k("div",DC,[p("span",null,[V[9]||(V[9]=no("Open ",-1)),p("a",{href:ye(at).verification_uri,target:"_blank",rel:"noreferrer"},"GitHub device login",8,LC),V[10]||(V[10]=no(" and enter code:",-1))]),p("code",null,oe(ye(at).user_code),1)])):ae("",!0),p("div",jC,[ye(G).loggedIn?ae("",!0):(w(),k("button",{key:0,class:"skills-hub-sort",type:"button",onClick:V[0]||(V[0]=(...J)=>ye(g)&&ye(g)(...J))},"Login with GitHub")),ye(G).loggedIn?ae("",!0):(w(),k("button",{key:1,class:"skills-hub-sort",type:"button",onClick:V[1]||(V[1]=(...J)=>ye(b)&&ye(b)(...J))},"Device Login")),ye(G).loggedIn?(w(),k("button",{key:2,class:"skills-hub-sort",type:"button",onClick:V[2]||(V[2]=(...J)=>ye(ue)&&ye(ue)(...J)),disabled:ye(K)},"Logout GitHub",8,UC)):ae("",!0),p("button",{class:"skills-hub-sort",type:"button",onClick:V[3]||(V[3]=(...J)=>ye(be)&&ye(be)(...J)),disabled:ye(K)},oe(ye(et)?"Pulling...":"Pull"),9,FC),ye(G).loggedIn?(w(),k("button",{key:3,class:"skills-hub-sort",type:"button",onClick:V[4]||(V[4]=(...J)=>ye($e)&&ye($e)(...J)),disabled:!ye(G).configured||ye(K)},oe(ye(Xe)?"Pushing...":"Push"),9,BC)):ae("",!0)])]),U.value?(w(),k("div",{key:0,class:it(["skills-hub-toast",me.value])},oe(U.value.text),3)):ae("",!0),le.value.length>0?(w(),k("div",HC,[p("button",{class:"skills-hub-section-toggle",type:"button",onClick:V[5]||(V[5]=J=>f.value=!f.value)},[p("span",WC,"Installed ("+oe(le.value.length)+")",1),Re(Rf,{class:it(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(w(),k("div",VC,[(w(!0),k(Fe,null,St(le.value,J=>(w(),ft(fu,{key:J.name,skill:J,onSelect:Q=>Ze(Q)},null,8,["skill","onSelect"]))),128))])):ae("",!0)])):ae("",!0),p("div",GC,[p("div",zC,[Re(Ba,{class:"skills-hub-search-icon"}),cr(p("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":V[6]||(V[6]=J=>s.value=J),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:Ye},null,544),[[ur,s.value]]),l.value>0?(w(),k("span",qC,oe(l.value)+" skills",1)):ae("",!0)]),p("button",{class:"skills-hub-sort",type:"button",onClick:Y},oe(ce.value),1)]),p("div",KC,[u.value?(w(),k("div",JC,"Loading skills...")):c.value?(w(),k("div",YC,oe(c.value),1)):(w(),k(Fe,{key:2},[i.value.length>0?(w(),k("div",XC,[(w(!0),k(Fe,null,St(i.value,J=>(w(),ft(fu,{key:J.url,skill:J,onSelect:Q=>Ze(Q)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(w(),k("div",QC,'No skills found for "'+oe(s.value)+'"',1)):ae("",!0)],64))]),Re(HT,{skill:T.value,visible:m.value,"is-installing":Ie.value,"is-uninstalling":re.value,onClose:V[7]||(V[7]=J=>m.value=!1),onInstall:Ne,onUninstall:nt,onToggleEnabled:gt},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),eA=st(ZC,[["__scopeId","data-v-2f6920be"]]),tA={},nA={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 rA(e,t){return w(),k("svg",nA,[...t[0]||(t[0]=[p("path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12"},null,-1),p("path",{d:"M9 4l0 16"},null,-1)])])}const sA=st(tA,[["render",rA]]),oA={},iA={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function aA(e,t){return w(),k("svg",iA,[...t[0]||(t[0]=[p("path",{d:"M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm12 -16h-8v14h8a1 1 0 0 0 1 -1v-12a1 1 0 0 0 -1 -1"},null,-1)])])}const lA=st(oA,[["render",aA]]),cA={class:"sidebar-thread-controls"},uA=["aria-label","title"],dA=Ht({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","start-new-thread"],setup(e){return(t,n)=>(w(),k("div",cA,[p("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",title:e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",onClick:n[0]||(n[0]=r=>t.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(w(),ft(lA,{key:0,class:"sidebar-thread-controls-icon"})):(w(),ft(sA,{key:1,class:"sidebar-thread-controls-icon"}))],8,uA),Gn(t.$slots,"default",{},void 0),e.showNewThreadButton?(w(),k("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[1]||(n[1]=r=>t.$emit("start-new-thread"))},[Re(ei,{class:"sidebar-thread-controls-icon"})])):ae("",!0)]))}}),Fu=st(dA,[["__scopeId","data-v-46a10052"]]),fA={},hA={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function pA(e,t){return w(),k("svg",hA,[...t[0]||(t[0]=[p("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[p("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065"}),p("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const mA=st(fA,[["render",pA]]);function Er(e){return e.flatMap(t=>t.threads)}const Th="codex-web-local.thread-read-state.v1",Sh="codex-web-local.thread-scroll-state.v1",Ya="codex-web-local.selected-thread-id.v1",Xa="codex-web-local.selected-model-id.v1",Ih="codex-web-local.project-order.v1",Eh="codex-web-local.project-display-name.v1",ga=220,gA=500,Bu=["none","minimal","low","medium","high","xhigh"],js="__global__",Sn="gpt-5.2-codex",vA="Auto-commit from Codex worktree chat turn";function yA(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Th);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function Hu(e){typeof window>"u"||window.localStorage.setItem(Th,JSON.stringify(e))}function Qa(e,t,n){return Math.min(Math.max(e,t),n)}function wA(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;if(typeof t.scrollTop!="number"||!Number.isFinite(t.scrollTop)||typeof t.isAtBottom!="boolean")return null;const n={scrollTop:Math.max(0,t.scrollTop),isAtBottom:t.isAtBottom};return typeof t.scrollRatio=="number"&&Number.isFinite(t.scrollRatio)&&(n.scrollRatio=Qa(t.scrollRatio,0,1)),n}function bA(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Sh);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t)){if(!r)continue;const o=wA(s);o&&(n[r]=o)}return n}catch{return{}}}function Wu(e){typeof window>"u"||window.localStorage.setItem(Sh,JSON.stringify(e))}function _A(){return typeof window>"u"?"":window.localStorage.getItem(Ya)??""}function kA(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Ya);return}window.localStorage.setItem(Ya,e)}}function TA(){var e;return typeof window>"u"?"":((e=window.localStorage.getItem(Xa))==null?void 0:e.trim())??""}function va(e){if(typeof window>"u")return;const t=e.trim();if(!t){window.localStorage.removeItem(Xa);return}window.localStorage.setItem(Xa,t)}function SA(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Ih);if(!e)return[];const t=JSON.parse(e);if(!Array.isArray(t))return[];const n=[];for(const r of t)typeof r=="string"&&r.length>0&&!n.includes(r)&&n.push(r);return n}catch{return[]}}function os(e){typeof window>"u"||window.localStorage.setItem(Ih,JSON.stringify(e))}function IA(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Eh);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t))typeof r=="string"&&r.length>0&&typeof s=="string"&&(n[r]=s);return n}catch{return{}}}function ya(e){typeof window>"u"||window.localStorage.setItem(Eh,JSON.stringify(e))}function Mo(e,t){const n=[];for(const r of e)n.includes(r)||n.push(r);for(const r of t)n.includes(r.projectName)||n.push(r.projectName);return Wr(e,n)?e:n}function wa(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>n.get(s)??null).filter(s=>s!==null&&s.threads.length>0);for(const s of e)t.includes(s.projectName)||r.push(s);return r}function Wr(e,t){const n=Array.isArray(e)?e:[],r=Array.isArray(t)?t:[];if(n.length!==r.length)return!1;for(let s=0;s<n.length;s+=1)if(n[s]!==r[s])return!1;return!0}function EA(e,t,n){if(t<0||t>=e.length||n<0||n>=e.length||t===n)return e;const r=[...e],[s]=r.splice(t,1);return r.splice(n,0,s),r}function CA(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function $o(e){if(!(e instanceof Error))return!1;const t=e.message.toLowerCase();return t.includes("not supported when using codex with a chatgpt account")||t.includes("model is not supported")}function Za(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Wr(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&CA(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function ai(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 AA(e,t,n={}){const r=new Map(e.map(c=>[c.id,c])),s=new Map(t.map(c=>[c.id,c])),o=t.map(c=>{const f=r.get(c.id);return f&&Za(f,c)?f:c});if(n.preserveMissing!==!0)return ai(e,o)?e:o;const i=e.map(c=>{const f=s.get(c.id);return!f||Za(c,f)?c:f}),a=new Set(e.map(c=>c.id)),l=o.filter(c=>!a.has(c.id)),u=[...i,...l];return ai(e,u)?e:u}function el(e){return e.replace(/\s+/gu," ").trim()}function RA(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>el(s.text)).filter(s=>s.length>0));if(n.size===0)return e;const r=e.filter(s=>{if(s.messageType!=="agentMessage.live")return!0;const o=el(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function Vu(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Za(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const Ch="worked";function Tr(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function PA(e){if(!Number.isFinite(e)||e<=0)return"<1s";const t=Math.max(1,Math.round(e/1e3)),n=Math.floor(t/3600),r=Math.floor(t%3600/60),s=t%60,o=[];n>0&&o.push(`${n}h`),(r>0||n>0)&&o.push(`${r}m`);const i=s>0||o.length===0?s:0;return o.push(`${i}s`),o.join(" ")}function xA(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function MA(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 $A(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${PA(e.durationMs)}`,messageType:Ch}}function OA(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function NA(e,t){const n=$A(t),r=e.filter(i=>i.messageType!==Ch),s=OA(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function Gt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function DA(e,t){return e.id===t.id&&e.title===t.title&&e.projectName===t.projectName&&e.cwd===t.cwd&&e.createdAtIso===t.createdAtIso&&e.updatedAtIso===t.updatedAtIso&&e.preview===t.preview&&e.unread===t.unread&&e.inProgress===t.inProgress}function LA(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 jA(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 Zt(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function Oo(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>{const o=n.get(s.projectName),i=new Map((o==null?void 0:o.threads.map(l=>[l.id,l]))??[]),a=s.threads.map(l=>{const u=i.get(l.id);return u&&DA(u,l)?u:l});return o&&o.projectName===s.projectName&&LA(o.threads,a)?o:{projectName:s.projectName,threads:a}});return jA(e,r)?e:r}function UA(e,t,n){const r=new Set(Er(t).map(a=>a.id)),s=Er(e).filter(a=>n[a.id]===!0&&!r.has(a.id));if(s.length===0)return t;const o=new Map(t.map(a=>[a.projectName,a])),i=t.map(a=>({projectName:a.projectName,threads:[...a.threads]}));for(const a of s){if(o.get(a.projectName)){const u=i.findIndex(c=>c.projectName===a.projectName);u>=0&&(i[u]={projectName:i[u].projectName,threads:[a,...i[u].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function FA(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function ba(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function BA(e){const t=e.split(`
1422
+ `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function HA(){const e=D([]),t=D([]),n=D(_A()),r=D({}),s=D({}),o=D({}),i=D({}),a=D({}),l=D({}),u=D({}),c=D({}),f=D([]),m=D(TA()),T=D("medium"),U=D("standard"),P=D(yA()),F=D(bA()),R=D(SA()),A=D(IA()),B=D({}),W=D({}),ce=D({}),me=D({}),ve=D({}),Ie=D({}),re=D({}),le=D({}),we=D({}),Y=D({}),Te=D([]),xe=D([]),Le=D(!1),Pe=D(!1),Oe=D(!1),Ee=D(!1),Ye=D(!1),Ze=D(!1),Ne=D(""),nt=D(!1),gt=D(!1);let at=null,et=null,Xe=null,K=null,he=!1;const ue=new Set;let be=!1,$e=!1;const g=new Map,b=new Set,M=D(!0),q=fe(()=>Er(e.value)),G=fe(()=>q.value.find(d=>d.id===n.value)??null),N=fe(()=>F.value[n.value]??null),V=fe(()=>{const d=[],h=n.value;return h&&Array.isArray(le.value[h])&&d.push(...le.value[h]),Array.isArray(le.value[js])&&d.push(...le.value[js]),d.sort((v,C)=>v.receivedAtIso.localeCompare(C.receivedAtIso))}),J=fe(()=>{var Z;const d=n.value;if(!d)return null;const h=ve.value[d],v=(o.value[d]??"").trim(),C=(((Z=Ie.value[d])==null?void 0:Z.message)??"").trim();return!h&&!v&&!C?null:{activityLabel:(h==null?void 0:h.label)||"Thinking",activityDetails:(h==null?void 0:h.details)??[],reasoningText:v,errorText:C}}),Q=fe(()=>{const d=n.value;if(!d)return[];const h=r.value[d]??[],v=s.value[d]??[],C=i.value[d]??[],Z=[...h,...C,...v],te=me.value[d];return te?NA(Z,te):Z});function z(d){n.value!==d&&(n.value=d,kA(d),$e=!1)}function _e(d){m.value=d.trim(),va(m.value)}function de(d){M.value=d}async function Se(){m.value=Sn,va(m.value),f.value.includes(Sn)||(f.value=[...f.value,Sn]);try{await j_(Sn)}catch{}}function Me(d,h){we.value={...we.value,[d]:h}}function De(d){we.value[d]&&(we.value=Gt(we.value,d))}async function Be(d,h){if(!M.value)return;const v=h.trim();if(!v)return;const C=q.value.find(te=>te.id===d);if(!(C!=null&&C.hasWorktree))return;const Z=C.cwd.trim();Z&&(await G_(Z,v),he=!0)}async function He(d,h){var Ae;if(!M.value)return;const v=q.value.find(ke=>ke.id===d);if(!(v!=null&&v.hasWorktree))return;const C=v.cwd.trim();if(!C)return;const te=(r.value[d]??[]).find(ke=>ke.role==="user"&&ke.turnIndex===h),pe=((Ae=te==null?void 0:te.text)==null?void 0:Ae.trim())??"";if(pe){try{await z_(C,pe)}catch(ke){if((ke instanceof Error?ke.message:"").includes("No matching commit found"))return;throw ke}he=!0}}async function ot(d){if(b.has(d))return;const h=we.value[d];if(!(!h||h.fallbackRetried)){b.add(d),Me(d,{...h,fallbackRetried:!0});try{await Se();try{const v=await ou(d,1);$t(d,v),Wt(d,[]),E(d),i.value[d]&&(i.value=Gt(i.value,d))}catch{}bt(d,null),Ne.value="",xt(d,null),It(d,{label:"Thinking",details:yt(Sn,h.effort)}),Tt(d,!0),ce.value[d]!==!0&&await ia(d),await aa(d,h.text,h.imageUrls,Sn,h.effort||void 0,h.skills.length>0?h.skills:void 0,h.fileAttachments),ce.value={...ce.value,[d]:!0},kt(),ue.add(d),he=!0,await Jn()}catch(v){const C=v instanceof Error?v.message:"Unknown application error";bt(d,C),Ne.value=C,Tt(d,!1),It(d,null)}finally{b.delete(d)}}}function tt(d){d&&!Bu.includes(d)||(T.value=d)}async function vt(d){const h=d==="fast"?"fast":"standard";if(Ye.value||U.value===h)return;const v=U.value;U.value=h,Ye.value=!0,Ne.value="";try{await U_(h)}catch(C){U.value=v,Ne.value=C instanceof Error?C.message:"Failed to update Fast mode"}finally{Ye.value=!1}}function yt(d,h){const v=d.trim()||"default",C=h||"default",Z=U.value==="fast"?"Fast":"Standard";return[`Model: ${v}`,`Thinking: ${C}`,`Speed: ${Z}`]}async function jt(){try{const[d,h]=await Promise.all([F_(),B_()]);f.value=d,m.value.length>0&&d.includes(m.value)||(h.model&&d.includes(h.model)?m.value=h.model:d.length>0?m.value=d[0]:m.value="",va(m.value)),h.reasoningEffort&&Bu.includes(h.reasoningEffort)&&(T.value=h.reasoningEffort),U.value=h.speedMode}catch{}}async function zt(){if(K){await K;return}K=(async()=>{try{xe.value=lt(await H_())}catch{}finally{K=null}})(),await K}function kt(){if(typeof window>"u"){zt();return}Xe!==null&&window.clearTimeout(Xe),Xe=window.setTimeout(()=>{Xe=null,zt()},gA)}function Rt(d){const h=Y.value;return Object.keys(h).length===0?d:d.map(v=>({projectName:v.projectName,threads:v.threads.map(C=>{const Z=h[C.id];return Z?{...C,title:Z}:C})}))}function wt(){const h=Rt(t.value).map(v=>({projectName:v.projectName,threads:v.threads.map(C=>{const Z=a.value[C.id]===!0,te=n.value===C.id,pe=P.value[C.id],Ae=c.value[C.id]===!0,ke=!te&&!Z&&(Ae||pe!==C.updatedAtIso);return{...C,inProgress:Z,unread:ke}})}));e.value=Oo(e.value,h)}function Dt(d,h,v){const C=new Date().toISOString(),Z=h.trim(),te=FA(Z),pe={id:d,title:BA(v),projectName:te,cwd:Z,hasWorktree:Z.includes("/.codex/worktrees/")||Z.includes("/.git/worktrees/"),createdAtIso:C,updatedAtIso:C,preview:v,unread:!1,inProgress:!1},Ae=t.value.findIndex(y=>y.projectName===te);if(Ae>=0){const x=t.value[Ae].threads.filter(Ve=>Ve.id!==d),ne={projectName:te,threads:[pe,...x]},Ue=[...t.value];Ue.splice(Ae,1,ne),t.value=Ue}else t.value=[{projectName:te,threads:[pe]},...t.value];const ke=Mo(R.value,t.value);Wr(R.value,ke)||(R.value=ke,os(R.value)),wt()}function Qt(d){const h=new Set(d.map(te=>te.id)),v=Zt(P.value,h);v!==P.value&&(P.value=v,Hu(v));const C=Zt(F.value,h);C!==F.value&&(F.value=C,Wu(C)),W.value=Zt(W.value,h),B.value=Zt(B.value,h),ce.value=Zt(ce.value,h),r.value=Zt(r.value,h),s.value=Zt(s.value,h),o.value=Zt(o.value,h),i.value=Zt(i.value,h),me.value=Zt(me.value,h),ve.value=Zt(ve.value,h),Ie.value=Zt(Ie.value,h),re.value=Zt(re.value,h),c.value=Zt(c.value,h),a.value=Zt(a.value,h);const Z={};for(const[te,pe]of Object.entries(le.value))(te===js||h.has(te))&&(Z[te]=pe);le.value=Z}function qt(d){const h=Er(t.value).find(v=>v.id===d);h&&(P.value={...P.value,[d]:h.updatedAtIso},Hu(P.value),c.value[d]&&(c.value=Gt(c.value,d)),wt())}function xt(d,h){if(!d)return;const v=me.value[d];if(h){if(xA(v,h))return;me.value={...me.value,[d]:h}}else v&&(me.value=Gt(me.value,d))}function Tt(d,h){!d||a.value[d]===!0===h||(h?a.value={...a.value,[d]:!0}:a.value=Gt(a.value,d),wt())}function Kt(d){d&&d!==n.value&&c.value[d]!==!0&&(c.value={...c.value,[d]:!0},wt())}function It(d,h){if(!d)return;const v=ve.value[d];if(!h){v&&(ve.value=Gt(ve.value,d));return}const C=qe(h.label)||"Thinking",Z=h.details.map(Ae=>qe(Ae)).filter(Ae=>Ae.length>0&&Ae!==C),te=Array.from(new Set([...(v==null?void 0:v.details)??[],...Z])).slice(-3),pe={label:C,details:te};MA(v,pe)||(ve.value={...ve.value,[d]:pe})}function bt(d,h){if(!d)return;const v=Ie.value[d],C=h?el(h):"";if(!C){v&&(Ie.value=Gt(Ie.value,d));return}(v==null?void 0:v.message)!==C&&(Ie.value={...Ie.value,[d]:{message:C}})}function Jt(d){const h=Er(t.value).find(v=>v.id===d);return(h==null?void 0:h.updatedAtIso)??""}function yn(d,h){if(!d)return;const v={scrollTop:Math.max(0,h.scrollTop),isAtBottom:h.isAtBottom===!0};typeof h.scrollRatio=="number"&&Number.isFinite(h.scrollRatio)&&(v.scrollRatio=Qa(h.scrollRatio,0,1));const C=F.value[d];C&&C.scrollTop===v.scrollTop&&C.isAtBottom===v.isAtBottom&&C.scrollRatio===v.scrollRatio||(F.value={...F.value,[d]:v},Wu(F.value))}function $t(d,h){const v=r.value[d]??[];ai(v,h)||(r.value={...r.value,[d]:h})}function Wt(d,h){const v=s.value[d]??[];ai(v,h)||(s.value={...s.value,[d]:h})}function wn(d,h){const v=s.value[d]??[],C=Vu(v,h);Wt(d,C)}function _(d,h){if(!d)return;const v=h.trim(),C=o.value[d]??"";if(v.length===0){if(!C)return;o.value=Gt(o.value,d);return}C!==v&&(o.value={...o.value,[d]:v})}function S(d,h){if(!d)return;const v=o.value[d]??"";_(d,`${v}${h}`)}function E(d){d&&d in o.value&&(o.value=Gt(o.value,d))}function O(d){return d!==null&&typeof d=="object"&&!Array.isArray(d)?d:null}function H(d){return typeof d=="string"?d:""}function ie(d){return typeof d=="number"&&Number.isFinite(d)?d:null}function Ce(d){var h,v;return((h=d.limitId)==null?void 0:h.trim())||((v=d.limitName)==null?void 0:v.trim())||"__default__"}function ge(d){const h=O(d);return h?{usedPercent:Qa(ie(h.usedPercent)??0,0,100),windowDurationMins:ie(h.windowDurationMins),resetsAt:ie(h.resetsAt)}:null}function Ke(d){const h=O(d);if(!h)return null;const v=O(h.credits);return{limitId:H(h.limitId)||null,limitName:H(h.limitName)||null,primary:ge(h.primary),secondary:ge(h.secondary),credits:v?{hasCredits:v.hasCredits===!0,unlimited:v.unlimited===!0,balance:H(v.balance)||null}:null,planType:H(h.planType)||null}}function lt(d){const h=O(d);if(!h)return[];const v=[],C=new Set,Z=pe=>{if(!pe)return;const Ae=Ce(pe);C.has(Ae)||(C.add(Ae),v.push(pe))};Z(Ke(h.rateLimits));const te=O(h.rateLimitsByLimitId);if(te)for(const pe of Object.values(te))Z(Ke(pe));return v}function rt(d){const h=O(d.params);if(!h)return"";const v=H(h.threadId);if(v)return v;const C=H(h.thread_id);if(C)return C;const Z=H(h.conversationId);if(Z)return Z;const te=H(h.conversation_id);if(te)return te;const pe=O(h.thread),Ae=H(pe==null?void 0:pe.id);if(Ae)return Ae;const ke=O(h.turn),y=H(ke==null?void 0:ke.threadId);if(y)return y;const x=H(ke==null?void 0:ke.thread_id);return x||""}function Nt(d){if(d.method!=="turn/completed")return"";const h=O(d.params),v=O(h==null?void 0:h.turn);if(!v||v.status!=="failed")return"";const C=O(v.error);return H(C==null?void 0:C.message)}function mn(d){var v;if(d.method!=="error")return"";const h=O(d.params);return H(h==null?void 0:h.message)||H((v=O(h==null?void 0:h.error))==null?void 0:v.message)}function Nn(d){const h=O(d);if(!h)return null;const v=h.id,C=H(h.method),Z=h.params;if(typeof v!="number"||!Number.isInteger(v)||!C)return null;const te=O(Z),pe=H(te==null?void 0:te.threadId)||js,Ae=H(te==null?void 0:te.turnId),ke=H(te==null?void 0:te.itemId),y=H(h.receivedAtIso)||new Date().toISOString();return{id:v,method:C,threadId:pe,turnId:Ae,itemId:ke,receivedAtIso:y,params:Z??null}}function j(d){const h=d.threadId||js,v=le.value[h]??[],C=v.findIndex(te=>te.id===d.id),Z=[...v];C>=0?Z.splice(C,1,d):Z.push(d),le.value={...le.value,[h]:Z.sort((te,pe)=>te.receivedAtIso.localeCompare(pe.receivedAtIso))}}function X(d){const h={};for(const[v,C]of Object.entries(le.value)){const Z=C.filter(te=>te.id!==d);Z.length>0&&(h[v]=Z)}le.value=h}function se(d){if(d.method==="server/request"){const h=Nn(d.params);return h&&j(h),!0}if(d.method==="server/request/resolved"){const h=O(d.params),v=h==null?void 0:h.id;return typeof v=="number"&&Number.isInteger(v)&&X(v),!0}return!1}function qe(d){return d.replace(/\s+/gu," ").trim()}function Pt(d){const h=rt(d);if(!h)return null;if(d.method==="turn/started")return{threadId:h,activity:{label:"Thinking",details:[]}};if(d.method==="item/started"){const v=O(d.params),C=O(v==null?void 0:v.item),Z=H(C==null?void 0:C.type).toLowerCase();if(Z==="reasoning")return{threadId:h,activity:{label:"Thinking",details:[]}};if(Z==="agentmessage")return{threadId:h,activity:{label:"Writing response",details:[]}};if(Z==="commandexecution"){const te=H(C==null?void 0:C.command);return{threadId:h,activity:{label:"Running command",details:te?[te]:[]}}}}return d.method==="item/commandExecution/outputDelta"?{threadId:h,activity:{label:"Running command",details:[]}}:d.method==="item/reasoning/summaryTextDelta"||d.method==="item/reasoning/summaryPartAdded"?{threadId:h,activity:{label:"Thinking",details:[]}}:d.method==="item/agentMessage/delta"?{threadId:h,activity:{label:"Writing response",details:[]}}:null}function bn(d){if(d.method!=="turn/started")return null;const h=O(d.params);if(!h)return null;const v=rt(d);if(!v)return null;const C=O(h.turn),Z=H(C==null?void 0:C.id)||H(h.turnId)||`${v}:unknown`;if(!Z)return null;const te=Tr(H(C==null?void 0:C.startedAt))??Tr(H(h.startedAt))??Tr(d.atIso)??Date.now();return{threadId:v,turnId:Z,startedAtMs:te}}function _n(d){if(d.method!=="turn/completed")return null;const h=O(d.params);if(!h)return null;const v=rt(d);if(!v)return null;const C=O(h.turn),Z=H(C==null?void 0:C.id)||H(h.turnId)||`${v}:unknown`;if(!Z)return null;const te=Tr(H(C==null?void 0:C.completedAt))??Tr(H(h.completedAt))??Tr(d.atIso)??Date.now(),pe=Tr(H(C==null?void 0:C.startedAt))??Tr(H(h.startedAt))??void 0;return{threadId:v,turnId:Z,completedAtMs:te,startedAtMs:pe}}function an(d){return`${d}:live-reasoning`}function Vt(d){const h=O(d.params);if(!h)return"";if(d.method==="item/started"){const v=O(h.item);return!v||v.type!=="reasoning"?"":H(v.id)}return""}function Dn(d){const h=O(d.params);if(!h)return null;if(d.method==="item/reasoning/summaryTextDelta"){const v=H(h.itemId),C=H(h.delta);return!v||!C?null:{messageId:an(v),delta:C}}return null}function I(d){const h=O(d.params);if(!h)return"";if(d.method==="item/reasoning/summaryPartAdded"){const v=H(h.itemId);return v?an(v):""}return""}function $(d){const h=O(d.params);if(!h)return"";if(d.method==="item/completed"){const v=O(h.item);return!v||v.type!=="reasoning"?"":an(H(v.id))}return""}function L(d){const h=O(d.params);if(!h)return"";if(d.method==="item/started"){const v=O(h.item);return!v||v.type!=="agentMessage"?"":H(v.id)}return""}function ee(d){const h=O(d.params);if(!h)return null;if(d.method==="item/agentMessage/delta"){const v=H(h.itemId),C=H(h.delta);return!v||!C?null:{messageId:v,delta:C}}return null}function Ge(d){const h=O(d.params);if(!h)return null;if(d.method==="item/completed"){const v=O(h.item);if(!v||v.type!=="agentMessage")return null;const C=H(v.id),Z=H(v.text);return!C||!Z?null:{id:C,role:"assistant",text:Z,messageType:"agentMessage.live"}}return null}function Ut(d){if(d.method!=="item/started")return null;const h=O(d.params),v=O(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const C=H(v.id),Z=H(v.command);if(!C)return null;const te=typeof v.cwd=="string"?v.cwd:null;return{id:C,role:"system",text:Z,messageType:"commandExecution",commandExecution:{command:Z,cwd:te,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function gn(d){if(d.method!=="item/commandExecution/outputDelta")return null;const h=O(d.params);if(!h)return null;const v=H(h.itemId),C=H(h.delta);return!v||!C?null:{itemId:v,delta:C}}function Xr(d){if(d.method!=="item/completed")return null;const h=O(d.params),v=O(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const C=H(v.id),Z=H(v.command);if(!C)return null;const te=typeof v.cwd=="string"?v.cwd:null,pe=H(v.status),Ae=pe==="failed"?"failed":pe==="declined"?"declined":pe==="interrupted"?"interrupted":"completed",ke=typeof v.aggregatedOutput=="string"?v.aggregatedOutput:"",y=typeof v.exitCode=="number"?v.exitCode:null;return{id:C,role:"system",text:Z,messageType:"commandExecution",commandExecution:{command:Z,cwd:te,status:Ae,aggregatedOutput:ke,exitCode:y}}}function gr(d,h){const v=i.value[d]??[],C=Vu(v,h);C!==v&&(i.value={...i.value,[d]:C})}function kn(d,h){const v=i.value[d];if(!v||v.length===0)return;const C=new Set(h.map(te=>te.id)),Z=v.filter(te=>!C.has(te.id));Z.length!==v.length&&(Z.length===0?i.value=Gt(i.value,d):i.value={...i.value,[d]:Z})}function vr(d){if(d.method==="item/agentMessage/delta")return!0;const h=O(d.params);if(!h)return!1;if(d.method==="item/completed"){const v=O(h.item);return(v==null?void 0:v.type)==="agentMessage"}return!1}function Qr(d){var Ms,rs,Ul,Fl,Bl;if(se(d))return;if(d.method==="account/rateLimits/updated"&&kt(),d.method==="thread/name/updated"){const Qe=O(d.params),En=H(Qe==null?void 0:Qe.threadId),wr=H(Qe==null?void 0:Qe.threadName);En&&wr&&(Y.value={...Y.value,[En]:wr},wt(),la(En,wr))}const h=Pt(d);h&&It(h.threadId,h.activity);const v=bn(d);v&&(g.set(v.turnId,v),re.value={...re.value,[v.threadId]:v.turnId},xt(v.threadId,null),bt(v.threadId,null),Tt(v.threadId,!0),c.value[v.threadId]&&(c.value=Gt(c.value,v.threadId)));const C=_n(d),Z=Nt(d),pe=!!((C==null?void 0:C.threadId)??rt(d))&&!!Z&&m.value!==Sn&&$o(new Error(Z));if(C){const Qe=we.value[C.threadId],En=g.get(C.turnId);En&&g.delete(C.turnId);const wr=ie((Ms=O(d.params))==null?void 0:Ms.durationMs)??ie((Ul=O((rs=O(d.params))==null?void 0:rs.turn))==null?void 0:Ul.durationMs)??(typeof C.startedAtMs=="number"?C.completedAtMs-C.startedAtMs:null)??(En?C.completedAtMs-En.startedAtMs:null),Ah=typeof wr=="number"?Math.max(0,wr):0;if(xt(C.threadId,{turnId:C.turnId,durationMs:Ah}),re.value[C.threadId]&&(re.value=Gt(re.value,C.threadId)),Tt(C.threadId,!1),It(C.threadId,null),Kt(C.threadId),pe||(De(C.threadId),So(C.threadId)),!Z&&!pe){const Rh=((Fl=Qe==null?void 0:Qe.text)==null?void 0:Fl.trim())||vA;Be(C.threadId,Rh).catch(()=>{})}}if(Z){const Qe=(C==null?void 0:C.threadId)||rt(d);Qe&&bt(Qe,Z),Ne.value=Z,Qe&&pe&&ot(Qe)}else C&&bt(C.threadId,null);const Ae=mn(d);if(Ae){const Qe=rt(d);Qe&&bt(Qe,Ae),Ne.value=Ae,m.value!==Sn&&$o(new Error(Ae))&&(Qe?ot(Qe):Se())}const ke=rt(d);if(!ke||ke!==n.value)return;L(d);const y=ee(d);if(y){const Qe=(s.value[ke]??[]).find(wr=>wr.id===y.messageId),En=`${(Qe==null?void 0:Qe.text)??""}${y.delta}`;wn(ke,{id:y.messageId,role:"assistant",text:En,messageType:"agentMessage.live"})}const x=Ge(d);x&&wn(ke,x),Vt(d);const ne=Dn(d);if(ne&&S(ke,ne.delta),I(d)){const Qe=o.value[ke]??"";Qe.trim().length>0&&!Qe.endsWith(`
1423
1423
 
1424
1424
  `)&&_(ke,`${Qe}
1425
1425
 
1426
- `)}$(d);const Ve=Ut(d);Ve&&(gr(ke,Ve),It(ke,{label:"Running command",details:[((Bl=Ve.commandExecution)==null?void 0:Bl.command)??""]}));const je=gn(d);if(je){const Qe=(i.value[ke]??[]).find(En=>En.id===je.itemId);Qe!=null&&Qe.commandExecution&&gr(ke,{...Qe,commandExecution:{...Qe.commandExecution,aggregatedOutput:`${Qe.commandExecution.aggregatedOutput}${je.delta}`}})}const Lt=Xr(d);if(Lt&&gr(ke,Lt),vr(d)&&($e&&n.value&&yn(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),E(ke)),d.method==="turn/completed"){$e=!1,E(ke),i.value[ke]&&(i.value=Gt(i.value,ke));const Qe=rt(d);Qe&&(Tt(Qe,!1),It(Qe,null),Kt(Qe),pe||(De(Qe),So(Qe)))}}function Cs(d){const h=rt(d);h&&ue.add(h);const v=d.method;(v.startsWith("thread/")||v.startsWith("turn/")||v.startsWith("item/"))&&(he=!0),!(et!==null||typeof window>"u")&&(et=window.setTimeout(()=>{et=null,Jn()},ga))}async function Ai(d){if(!be){be=!0;try{const h=await Fa(),v=[];for(const C of h.order){const Z=ba(C);v.includes(Z)||v.push(Z)}if(v.length>0){const C=Mo(v,d);Wr(R.value,C)||(R.value=C,os(R.value))}if(Object.keys(h.labels).length>0){const C={...A.value};let Z=!1;for(const[te,pe]of Object.entries(h.labels)){const Ae=ba(te);C[Ae]!==pe&&(C[Ae]=pe,Z=!0)}Z&&(A.value=C,ya(C))}}catch{}}}async function Zr(){if(!(Object.keys(Y.value).length>0))try{const d=await Z_();Object.keys(d.titles).length>0&&(Y.value=d.titles)}catch{}}async function bo(d,h,v){if(Y.value[d])return;const C=h.trim();if(!C)return;const Z=C.length>300?C.slice(0,300):C;try{const te=await ek(Z,v);if(!te||Y.value[d])return;Y.value={...Y.value,[d]:te},wt(),la(d,te)}catch{}}async function As(){var d;gt.value||(Le.value=!0);try{const[h]=await Promise.all([A_(),Zr()]);await Ai(h);const v=Mo(R.value,h);Wr(R.value,v)||(R.value=v,os(R.value));const C=wa(h,R.value),Z=UA(t.value,C,a.value);t.value=Oo(t.value,Z),a.value=Zt(a.value,new Set(Er(t.value).map(Ae=>Ae.id))),wt(),gt.value=!0;const te=Er(e.value);Qt(te),te.some(Ae=>Ae.id===n.value)||z(((d=te[0])==null?void 0:d.id)??"")}finally{Le.value=!1}}async function yr(d,h={}){if(!d)return;const v=W.value[d]===!0,C=h.silent!==!0&&!v;C&&(Pe.value=!0);try{ce.value[d]!==!0&&(await ia(d),ce.value={...ce.value,[d]:!0});const{messages:Z,inProgress:te}=await R_(d),pe=r.value[d]??[],Ae=AA(pe,Z,{preserveMissing:h.silent===!0});$t(d,Ae);const ke=s.value[d]??[],y=RA(ke,Z);Wt(d,y),kn(d,Z),W.value={...W.value,[d]:!0};const M=Jt(d);M&&(B.value={...B.value,[d]:M}),Tt(d,te),qt(d)}finally{C&&(Pe.value=!1)}}async function Rs(){try{const d=t.value.flatMap(h=>h.threads.map(v=>v.cwd)).filter(Boolean);Te.value=await tk(d.length>0?[...new Set(d)]:void 0)}catch{}}async function _o(){Ne.value="";try{await As(),await Promise.all([jt(),zt(),Rs()]),await yr(n.value)}catch(d){Ne.value=d instanceof Error?d.message:"Unknown application error"}}async function es(d){z(d);try{await yr(d)}catch(h){Ne.value=h instanceof Error?h.message:"Unknown application error"}}async function Ri(d){try{await $_(d),await As(),n.value===d&&await yr(n.value)}catch(h){Ne.value=h instanceof Error?h.message:"Unknown application error"}}async function ko(d,h){const v=h.trim();if(!(!d||!v))try{await O_(d,v),Y.value={...Y.value,[d]:v},wt(),la(d,v)}catch(C){Ne.value=C instanceof Error?C.message:"Unknown application error"}}async function Ps(d,h=[],v=[],C="steer",Z=[],te){if(Ye.value)return;const pe=n.value,Ae=d.trim();if(!pe||!Ae&&h.length===0&&Z.length===0)return;const ke=a.value[pe]===!0;if(ke&&C==="queue"){const y=l.value[pe]??[],M=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,ne=[...y],Ue=typeof te=="number"?Math.max(0,Math.min(te,ne.length)):ne.length;ne.splice(Ue,0,{id:M,text:Ae,imageUrls:h,skills:v,fileAttachments:Z}),l.value={...l.value,[pe]:ne};return}if(ke){$e=!0,ts(pe,Ae,h,v,Z).catch(y=>{const M=y instanceof Error?y.message:"Unknown application error";bt(pe,M),Ne.value=M});return}Ne.value="",$e=!0,xt(pe,null),It(pe,{label:"Thinking",details:yt(m.value,k.value)}),bt(pe,null),Tt(pe,!0);try{await ts(pe,Ae,h,v,Z)}catch(y){$e=!1,Tt(pe,!1),It(pe,null);const M=y instanceof Error?y.message:"Unknown application error";throw bt(pe,M),Ne.value=M,y}}async function To(d,h,v=[],C=[],Z=[]){if(Ye.value)return"";const te=d.trim(),pe=h.trim(),Ae=m.value.trim();if(!te&&v.length===0&&Z.length===0)return"";Oe.value=!0,Ne.value="";let ke="";try{try{ke=await iu(pe||void 0,Ae||void 0)}catch(Ue){if(Ae&&Ae!==Sn&&$o(Ue))await Se(),ke=await iu(pe||void 0,Sn);else throw Ue}if(!ke)return"";Dt(ke,pe,te||"[Image]"),ce.value={...ce.value,[ke]:!0},z(ke),$e=!0,xt(ke,null),It(ke,{label:"Thinking",details:yt(m.value,k.value)}),bt(ke,null),Tt(ke,!0);const y=ke,M=pe||null,ne=te;return ts(ke,te,v,C,Z).catch(Ue=>{$e=!1,Tt(ke,!1),It(ke,null);const Ve=Ue instanceof Error?Ue.message:"Unknown application error";bt(ke,Ve),Ne.value=Ve}).finally(()=>{Oe.value=!1}),bo(y,ne,M),ke}catch(y){$e=!1,ke&&(Tt(ke,!1),It(ke,null));const M=y instanceof Error?y.message:"Unknown application error";throw ke&&bt(ke,M),Ne.value=M,Oe.value=!1,y}}async function ts(d,h,v=[],C=[],Z=[]){const te=m.value.trim(),pe=k.value,Ae=h.trim(),ke=C.map(M=>({name:M.name,path:M.path})),y=Z.map(M=>({...M}));Me(d,{text:Ae,imageUrls:[...v],skills:ke,fileAttachments:y,effort:pe,fallbackRetried:!1});try{ce.value[d]!==!0&&await ia(d);try{await aa(d,h,v,te||void 0,pe||void 0,C.length>0?C:void 0,Z)}catch(M){if(te&&te!==Sn&&$o(M))await Se(),Me(d,{text:Ae,imageUrls:[...v],skills:ke,fileAttachments:y,effort:pe,fallbackRetried:!0}),await aa(d,h,v,Sn,pe||void 0,C.length>0?C:void 0,Z);else throw M}ce.value={...ce.value,[d]:!0},ue.add(d),he=!0,await Jn()}catch(M){throw M}}async function So(d){if(u.value[d]===!0)return;const h=l.value[d];if(!h||h.length===0)return;u.value={...u.value,[d]:!0};const[v,...C]=h;l.value=C.length>0?{...l.value,[d]:C}:Gt(l.value,d),Oe.value=!0,Ne.value="",$e=!0,xt(d,null),It(d,{label:"Thinking",details:yt(m.value,k.value)}),bt(d,null),Tt(d,!0);try{await ts(d,v.text,v.imageUrls,v.skills,v.fileAttachments)}catch{Tt(d,!1),It(d,null)}finally{u.value=Gt(u.value,d),Oe.value=!1}}async function Pi(){const d=n.value;if(!d||a.value[d]!==!0)return;const h=re.value[d];Ee.value=!0,Ne.value="";try{await L_(d,h),Tt(d,!1),It(d,null),bt(d,null),re.value[d]&&(re.value=Gt(re.value,d)),ue.add(d),he=!0,await Jn()}catch(v){const C=v instanceof Error?v.message:"Failed to interrupt active turn";bt(d,C),Ne.value=C}finally{Ee.value=!1}}async function xi(d){const h=n.value;if(!h||Ze.value)return;const C=(r.value[h]??[]).reduce((te,pe)=>typeof pe.turnIndex=="number"&&pe.turnIndex>te?pe.turnIndex:te,-1);if(C<0||d>C)return;const Z=C-d+1;if(!(Z<1)){Ze.value=!0,Ne.value="";try{await He(h,d);const te=await ou(h,Z);$t(h,te),Wt(h,[]),E(h),i.value[h]&&(i.value=Gt(i.value,h)),xt(h,null),It(h,null),bt(h,null),he=!0,await Jn()}catch(te){Ne.value=te instanceof Error?te.message:"Failed to rollback thread"}finally{Ze.value=!1}}}function Mi(d,h){d.length===0||(A.value[d]??"")===h||(A.value={...A.value,[d]:h},ya(A.value))}function $i(d){var Z;if(d.length===0)return;const h=R.value.filter(te=>te!==d);if(Wr(R.value,h)||(R.value=h,os(R.value)),t.value=t.value.filter(te=>te.projectName!==d),A.value[d]!==void 0){const te={...A.value};delete te[d],A.value=te,ya(te)}wt();const v=Er(e.value);Qt(v),v.some(te=>te.id===n.value)||z(((Z=v[0])==null?void 0:Z.id)??""),xs()}function ns(d,h){if(d.length===0||t.value.length===0)return;const v=t.value.map(ke=>ke.projectName),C=v.indexOf(d);if(C===-1)return;const Z=Math.max(0,Math.min(h,v.length-1)),te=EA(v,C,Z);if(te===v)return;const pe=Mo(te,t.value);R.value=pe,os(R.value);const Ae=wa(t.value,R.value);t.value=Oo(t.value,Ae),wt(),xs()}function Oi(d){const h=d.trim();if(!h)return;const v=[h,...R.value.filter(Z=>Z!==h)];if(Wr(R.value,v))return;R.value=v,os(R.value);const C=wa(t.value,R.value);t.value=Oo(t.value,C),wt(),xs()}async function xs(){var d,h;try{const v=await Fa(),C=new Map;for(const pe of v.order){const Ae=ba(pe);C.has(Ae)||C.set(Ae,pe)}for(const pe of t.value){const Ae=((h=(d=pe.threads[0])==null?void 0:d.cwd)==null?void 0:h.trim())??"";Ae&&C.set(pe.projectName,Ae)}const Z=[];for(const pe of R.value){const Ae=C.get(pe);Ae&&!Z.includes(Ae)&&Z.push(Ae)}for(const pe of v.order)Z.includes(pe)||Z.push(pe);const te=v.active.filter(pe=>Z.includes(pe));te.length===0&&Z.length>0&&te.push(Z[0]),await q_({order:Z,labels:v.labels,active:te})}catch{}}async function Jn(){if(nt.value){typeof window<"u"&&et===null&&(et=window.setTimeout(()=>{et=null,Jn()},ga));return}nt.value=!0;const d=he,h=new Set(ue);he=!1,ue.clear();try{d&&await As();const v=n.value;if(!v)return;const C=h.has(v),Z=a.value[v]===!0,te=Jt(v),pe=B.value[v]??"",Ae=te.length>0&&te!==pe;(C||Z||Ae||d)&&await yr(v,{silent:!0})}catch{}finally{nt.value=!1,(he||ue.size>0)&&typeof window<"u"&&et===null&&(et=window.setTimeout(()=>{et=null,Jn()},ga))}}function Ni(){typeof window>"u"||at||(Di(),at=P_(d=>{Qr(d),Cs(d)}))}async function Di(){try{const d=await M_();for(const h of d){const v=Nn(h);v&&j(v)}}catch{}}async function Li(d){try{await x_(d.id,{result:d.result,error:d.error}),X(d.id)}catch(h){Ne.value=h instanceof Error?h.message:"Failed to reply to server request"}}function ji(){at&&(at(),at=null),he=!1,ue.clear(),g.clear(),et!==null&&typeof window<"u"&&(window.clearTimeout(et),et=null),Xe!==null&&typeof window<"u"&&(window.clearTimeout(Xe),Xe=null),$e=!1,r.value={},s.value={},o.value={},i.value={},ve.value={},me.value={},Ie.value={},re.value={},l.value={},u.value={}}const Ui=fe(()=>{const d=n.value;return d?l.value[d]??[]:[]});function Io(d){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const C=v.filter(Z=>Z.id!==d);l.value=C.length>0?{...l.value,[h]:C}:Gt(l.value,h)}function Fi(d){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const C=v.find(Z=>Z.id===d);C&&(Io(d),Ps(C.text,C.imageUrls,C.skills,"steer",C.fileAttachments))}return{projectGroups:e,projectDisplayNameById:A,selectedThread:G,selectedThreadScrollState:N,selectedThreadServerRequests:V,selectedLiveOverlay:J,selectedThreadId:n,availableModelIds:f,selectedModelId:m,selectedReasoningEffort:k,selectedSpeedMode:U,installedSkills:Te,accountRateLimitSnapshots:xe,messages:Q,isLoadingThreads:Le,isLoadingMessages:Pe,isSendingMessage:Oe,isInterruptingTurn:Ee,isUpdatingSpeedMode:Ye,error:Ne,refreshAll:_o,refreshSkills:Rs,selectThread:es,setThreadScrollState:yn,archiveThreadById:Ri,renameThreadById:ko,sendMessageToSelectedThread:Ps,sendMessageToNewThread:To,interruptSelectedThreadTurn:Pi,rollbackSelectedThread:xi,isRollingBack:Ze,selectedThreadQueuedMessages:Ui,removeQueuedMessage:Io,steerQueuedMessage:Fi,setSelectedModelId:_e,setWorktreeGitAutomationEnabled:de,setSelectedReasoningEffort:tt,updateSelectedSpeedMode:vt,respondToPendingServerRequest:Li,renameProject:Mi,removeProject:$i,reorderProject:ns,pinProjectToTop:Oi,startPolling:Ni,stopPolling:ji}}const WA={class:"sidebar-root"},VA={class:"sidebar-scrollable"},GA=["aria-pressed"],zA={key:1,class:"sidebar-search-bar"},qA={key:0,class:"sidebar-settings-area"},KA={key:0,class:"sidebar-settings-panel"},JA=["title"],YA=["title"],XA={class:"sidebar-settings-value"},QA=["title"],ZA={class:"sidebar-settings-value"},e1=["title"],t1=["title"],n1=["title"],r1=["title"],s1={class:"sidebar-settings-rate-limits"},o1={class:"content-root"},i1={class:"content-body"},a1={key:1,class:"content-grid"},l1={class:"new-thread-empty"},c1={class:"worktree-init-status-title"},u1={class:"worktree-init-status-message"},d1={class:"new-thread-trending"},f1={class:"new-thread-trending-header"},h1={key:0,class:"new-thread-trending-empty"},p1={key:1,class:"new-thread-trending-empty"},m1={key:2,class:"new-thread-trending-list"},g1=["onClick"],v1={class:"new-thread-trending-tip-name"},y1={class:"new-thread-trending-tip-meta"},w1={class:"new-thread-trending-tip-description"},b1={key:2,class:"content-grid"},_1={class:"content-thread"},k1={class:"composer-with-queue"},T1={class:"build-badge","aria-label":"Worktree name and version"},Gu="codex-web-local.sidebar-collapsed.v1",zu="codex-web-local.send-with-enter.v1",qu="codex-web-local.in-progress-send-mode.v1",Ku="codex-web-local.dark-mode.v1",Ju="codex-web-local.dictation-click-to-toggle.v1",Yu="codex-web-local.dictation-auto-send.v1",Xu="codex-web-local.dictation-language.v1",Qu="codex-web-local.worktree-git-automation.v1",S1=Ht({__name:"App",setup(e){const t="86af",n="0.1.50",r={sendWithEnter:"When enabled, press Enter to send. When disabled, use Command+Enter to send.",inProgressSendMode:"If a turn is still running, choose whether a new prompt should steer the current turn or be queued.",appearance:"Switch between system theme, light mode, and dark mode.",dictationClickToToggle:"Use click-to-start and click-to-stop dictation instead of hold-to-talk.",dictationAutoSend:"Automatically send transcribed dictation when recording stops.",worktreeRollback:"When enabled, each message creates a Git commit. On rollback, it runs Git reset to the commit for that message.",dictationLanguage:"Choose transcription language or keep auto-detect."},s={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:i,selectedThread:a,selectedThreadScrollState:l,selectedThreadServerRequests:u,selectedLiveOverlay:c,selectedThreadId:f,availableModelIds:m,selectedModelId:k,selectedReasoningEffort:U,selectedSpeedMode:P,installedSkills:F,accountRateLimitSnapshots:R,messages:A,isLoadingThreads:B,isLoadingMessages:W,isInterruptingTurn:ce,isUpdatingSpeedMode:me,refreshAll:ve,refreshSkills:Ie,selectThread:re,setThreadScrollState:le,archiveThreadById:we,renameThreadById:Y,sendMessageToSelectedThread:Te,sendMessageToNewThread:xe,interruptSelectedThreadTurn:Le,rollbackSelectedThread:Pe,isRollingBack:Oe,selectedThreadQueuedMessages:Ee,removeQueuedMessage:Ye,steerQueuedMessage:Ze,setSelectedModelId:Ne,setWorktreeGitAutomationEnabled:nt,setSelectedReasoningEffort:gt,updateSelectedSpeedMode:at,respondToPendingServerRequest:et,renameProject:Xe,removeProject:K,reorderProject:he,pinProjectToTop:ue,startPolling:be,stopPolling:$e}=HA(),g=fv(),b=dv(),{isMobile:x}=Af(),q=D(null),G=D(null),N=D([]),V=D(!1),J=D("trending-daily"),Q=D(null),z=D(!1),_e=D(!1),de=D(""),Se=D("local"),Me=D({order:[],labels:{}}),De=D({phase:"idle",title:"",message:""}),Fe=D(C()),He=D(""),ot=D(!1),tt=D(null),vt=D(null);let yt=null;const jt=D("New Project (1)"),zt=D(""),kt=D(!1),Rt=D(ns(zu,!0)),wt=D(xs()),Dt=D(Oi()),Qt=D(ns(Ju,!1)),qt=D(null);let xt=0;const Tt=D(ns(Yu,!0)),Kt=D(Fi()),It=fe(()=>d()),bt=D(ns(Qu,!0)),Jt=fe(()=>{const y=g.params.threadId;return typeof y=="string"?y:""}),yn=fe(()=>{const y=new Set;for(const M of o.value)for(const ne of M.threads)y.add(ne.id);return y}),$t=fe(()=>g.name==="home"),Wt=fe(()=>g.name==="skills"),wn=fe(()=>{var y;return Wt.value?"Skills":$t.value?"New thread":((y=a.value)==null?void 0:y.title)??"Choose a thread"}),_=fe(()=>A.value.filter(y=>{const M=te(y.messageType,y.role);return M==="worked"?!0:!(M==="turnActivity.live"||M==="turnError.live"||M==="agentReasoning.live")})),S=fe(()=>{let y=-1;for(const M of A.value)M.role==="user"&&typeof M.turnIndex=="number"&&M.turnIndex>y&&(y=M.turnIndex);return y}),E=fe(()=>c.value),O=fe(()=>$t.value?"__new-thread__":f.value),H=fe(()=>{var y,M;return $t.value?de.value.trim():((M=(y=a.value)==null?void 0:y.cwd)==null?void 0:M.trim())??""}),oe=fe(()=>{var y;return!$t.value&&((y=a.value)==null?void 0:y.inProgress)===!0}),Ce=fe(()=>{var Ue,Ve;const y=[],M=new Set;for(const je of Me.value.order){const Lt=je.trim();!Lt||M.has(Lt)||(M.add(Lt),y.push({value:Lt,label:Me.value.labels[Lt]||es(Lt)}))}for(const je of o.value){const Lt=((Ve=(Ue=je.threads[0])==null?void 0:Ue.cwd)==null?void 0:Ve.trim())??"";!Lt||M.has(Lt)||(M.add(Lt),y.push({value:Lt,label:i.value[je.projectName]??je.projectName}))}const ne=de.value.trim();return ne&&!M.has(ne)&&y.unshift({value:ne,label:es(ne)}),y}),ge=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null,Ke=fe(()=>[{value:"search-daily",label:"Search daily"},{value:"search-weekly",label:"Search weekly"},{value:"search-monthly",label:"Search monthly"},{value:"trending-daily",label:"Trending daily"},{value:"trending-weekly",label:"Trending weekly"},{value:"trending-monthly",label:"Trending monthly"}]);pr(()=>{window.addEventListener("keydown",L),v(),ge==null||ge.addEventListener("change",v),pe(),Qr(),As(),yr(),Zr(),Rs()}),vi(()=>{window.removeEventListener("keydown",L),ge==null||ge.removeEventListener("change",v),yt&&(clearTimeout(yt),yt=null),$e()}),ut(He,y=>{const M=y.trim();if(yt&&(clearTimeout(yt),yt=null),!M){vt.value=null;return}yt=setTimeout(()=>{Y_(M,1e3).then(ne=>{He.value.trim()===M&&(vt.value=ne.threadIds)}).catch(()=>{He.value.trim()===M&&(vt.value=null)})},220)});function lt(){Ie()}function rt(){ot.value=!ot.value,ot.value?Yt(()=>{var y;return(y=tt.value)==null?void 0:y.focus()}):He.value=""}function Nt(){var y;He.value="",(y=tt.value)==null||y.focus()}function mn(y){y.key==="Escape"&&(ot.value=!1,He.value="")}function Nn(y){y&&(g.name==="thread"&&Jt.value===y||(b.push({name:"thread",params:{threadId:y}}),x.value&&$(!0)))}async function j(y){y&&(f.value!==y&&(await re(y),await b.push({name:"thread",params:{threadId:y}})),await Yt(),Pi())}function X(y){we(y)}function se(y){var Ue,Ve;const M=o.value.find(je=>je.projectName===y),ne=((Ve=(Ue=M==null?void 0:M.threads[0])==null?void 0:Ue.cwd)==null?void 0:Ve.trim())??"";ne&&(de.value=ne),x.value&&$(!0),!$t.value&&b.push({name:"home"})}function qe(y){var Ue,Ve;const M=o.value.find(je=>je.projectName===y),ne=((Ve=(Ue=M==null?void 0:M.threads[0])==null?void 0:Ue.cwd)==null?void 0:Ve.trim())??"";!ne||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(ne)}`,"_blank","noopener,noreferrer")}function Pt(){var M,ne;const y=((ne=(M=a.value)==null?void 0:M.cwd)==null?void 0:ne.trim())??"";y&&(de.value=y),x.value&&$(!0),!$t.value&&b.push({name:"home"})}function bn(y){Xe(y.projectName,y.displayName)}function _n(y){Y(y.threadId,y.title)}function an(y){K(y)}function Vt(y){he(y.projectName,y.toIndex)}function Dn(y){le(y.threadId,y.state)}function I(y){et(y)}function $(y){Fe.value!==y&&(Fe.value=y,Z(y))}function L(y){y.defaultPrevented||!y.ctrlKey&&!y.metaKey||y.shiftKey||y.altKey||y.key.toLowerCase()==="b"&&(y.preventDefault(),$(!Fe.value))}function ee(y){const M=y.text,ne=Q.value,Ue=y.mode==="queue"&&ne&&ne.threadId===f.value?ne.queueIndex:void 0;if(Q.value=null,$t.value){ke(M,y.imageUrls,y.skills,y.fileAttachments);return}if(y.rollbackLatestUserTurn===!0){gr(y);return}Te(M,y.imageUrls,y.skills,y.mode,y.fileAttachments,Ue)}function Ge(y){const M=new Intl.NumberFormat().format(y.stars);return y.language?`${y.language} · ★ ${M}`:`★ ${M}`}function Ut(y){const ne=new Set(["search-daily","search-weekly","search-monthly","trending-daily","trending-weekly","trending-monthly"]).has(y)?y:"trending-daily";J.value!==ne&&(J.value=ne)}function gn(y){const M=q.value;M&&M.hydrateDraft({text:`Clone and run github repo ${y.url}`,imageUrls:[],fileAttachments:[],skills:[]})}function Xr(y){const M=Ee.value.findIndex(je=>je.id===y),ne=M>=0?Ee.value[M]:void 0,Ue=G.value;if(!ne||!Ue||Ue.hasUnsavedDraft()&&!window.confirm("Replace the current draft with this queued message for editing?"))return;Q.value=f.value?{threadId:f.value,queueIndex:M}:null;const Ve={text:ne.text,imageUrls:[...ne.imageUrls],fileAttachments:ne.fileAttachments.map(je=>({...je})),skills:ne.skills.map(je=>({...je}))};Ue.hydrateDraft(Ve),Ye(y)}async function gr(y){oe.value&&await Le();const M=S.value;M>=0&&await Pe(M),await Te(y.text,y.imageUrls,y.skills,"steer",y.fileAttachments)}function kn(y){de.value=y.trim()}async function vr(y){const M=y.trim();if(!M)return;const ne=Ai(M),Ue=await Cs(),Ve=ne?M:Ri(Ue,M);if(Ve)try{const je=await lu(Ve,{createIfMissing:!ne,label:ne?"":M});je&&(de.value=je,ue(es(je)),yr(),Zr())}catch{}}async function Qr(){var M;if(typeof window>"u")return;const y=((M=new URLSearchParams(window.location.search).get("openProjectPath"))==null?void 0:M.trim())??"";if(y)try{const ne=await lu(y,{createIfMissing:!1,label:""});if(!ne)return;de.value=ne,ue(es(ne)),await b.replace({name:"home"}),await yr();const Ue=new URL(window.location.href);Ue.searchParams.delete("openProjectPath"),window.history.replaceState({},"",Ue.toString())}catch{}}async function Cs(){const y=bo();if(y)return y;try{const M=await au();if(M)return zt.value=M,M}catch{}return""}function Ai(y){return y?y.startsWith("~/")||y.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(y):!1}async function Zr(){const y=bo();if(!y){jt.value="New Project (1)";return}try{const M=await K_(y);jt.value=M.name||"New Project (1)"}catch{jt.value="New Project (1)"}}function bo(){var ne,Ue;const y=de.value.trim();if(y)return _o(y);const M=((Ue=(ne=Ce.value[0])==null?void 0:ne.value)==null?void 0:Ue.trim())??"";return M?_o(M):zt.value.trim()}async function As(){try{zt.value=await au()}catch{zt.value=""}}async function yr(){try{const y=await Fa();Me.value={order:[...y.order],labels:{...y.labels}}}catch{Me.value={order:[],labels:{}}}}async function Rs(){V.value=!0;try{N.value=await Q_(J.value,6)}catch{N.value=[]}finally{V.value=!1}}function _o(y){const M=y.trim().replace(/\/+$/,"");if(!M)return"";const ne=M.lastIndexOf("/");return ne<=0?"":M.slice(0,ne)}function es(y){const M=y.trim().replace(/\/+$/,"");if(!M)return"";const ne=M.lastIndexOf("/");return ne<0?M:M.slice(ne+1)}function Ri(y,M){const ne=y.trim().replace(/\/+$/,""),Ue=M.trim().replace(/^\/+/,"");return!ne||!Ue?"":`${ne}/${Ue}`}function ko(y){Ne(y)}function Ps(y){gt(y)}function To(y){at(y)}function ts(){Le()}function So(y){var ne;const M=((ne=y.prependText)==null?void 0:ne.trim())??"";M.length>0&&(xt+=1,qt.value={id:xt,text:M}),Pe(y.turnIndex)}function Pi(){if($t.value||Wt.value||typeof document>"u"||!a.value||_.value.length===0)return;const y=xi(),M=Mi(),ne=new Blob([y],{type:"text/markdown;charset=utf-8"}),Ue=URL.createObjectURL(ne),Ve=document.createElement("a");Ve.href=Ue,Ve.download=M,document.body.appendChild(Ve),Ve.click(),document.body.removeChild(Ve),window.setTimeout(()=>URL.revokeObjectURL(Ue),0)}function xi(){var ne,Ue,Ve;const y=[],M=((Ue=(ne=a.value)==null?void 0:ne.title)==null?void 0:Ue.trim())||"Untitled thread";y.push(`# ${$i(M)}`),y.push(""),y.push(`- Exported: ${new Date().toISOString()}`),y.push(`- Thread ID: ${((Ve=a.value)==null?void 0:Ve.id)??""}`),y.push(""),y.push("---"),y.push("");for(const je of _.value){const Lt=je.role?je.role.toUpperCase():"MESSAGE";y.push(`## ${Lt}`),y.push("");const Ms=je.text.trim();if(Ms&&(y.push(Ms),y.push("")),je.commandExecution&&(y.push("```text"),y.push(`command: ${je.commandExecution.command}`),y.push(`status: ${je.commandExecution.status}`),je.commandExecution.cwd&&y.push(`cwd: ${je.commandExecution.cwd}`),je.commandExecution.exitCode!==null&&y.push(`exitCode: ${je.commandExecution.exitCode}`),y.push(je.commandExecution.aggregatedOutput||"(no output)"),y.push("```"),y.push("")),je.fileAttachments&&je.fileAttachments.length>0){y.push("Attachments:");for(const rs of je.fileAttachments)y.push(`- ${rs.path}`);y.push("")}if(je.images&&je.images.length>0){y.push("Images:");for(const rs of je.images)y.push(`- ${rs}`);y.push("")}}return`${y.join(`
1426
+ `)}$(d);const Ve=Ut(d);Ve&&(gr(ke,Ve),It(ke,{label:"Running command",details:[((Bl=Ve.commandExecution)==null?void 0:Bl.command)??""]}));const je=gn(d);if(je){const Qe=(i.value[ke]??[]).find(En=>En.id===je.itemId);Qe!=null&&Qe.commandExecution&&gr(ke,{...Qe,commandExecution:{...Qe.commandExecution,aggregatedOutput:`${Qe.commandExecution.aggregatedOutput}${je.delta}`}})}const Lt=Xr(d);if(Lt&&gr(ke,Lt),vr(d)&&($e&&n.value&&yn(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),E(ke)),d.method==="turn/completed"){$e=!1,E(ke),i.value[ke]&&(i.value=Gt(i.value,ke));const Qe=rt(d);Qe&&(Tt(Qe,!1),It(Qe,null),Kt(Qe),pe||(De(Qe),So(Qe)))}}function Cs(d){const h=rt(d);h&&ue.add(h);const v=d.method;(v.startsWith("thread/")||v.startsWith("turn/")||v.startsWith("item/"))&&(he=!0),!(et!==null||typeof window>"u")&&(et=window.setTimeout(()=>{et=null,Jn()},ga))}async function Ai(d){if(!be){be=!0;try{const h=await Fa(),v=[];for(const C of h.order){const Z=ba(C);v.includes(Z)||v.push(Z)}if(v.length>0){const C=Mo(v,d);Wr(R.value,C)||(R.value=C,os(R.value))}if(Object.keys(h.labels).length>0){const C={...A.value};let Z=!1;for(const[te,pe]of Object.entries(h.labels)){const Ae=ba(te);C[Ae]!==pe&&(C[Ae]=pe,Z=!0)}Z&&(A.value=C,ya(C))}}catch{}}}async function Zr(){if(!(Object.keys(Y.value).length>0))try{const d=await Z_();Object.keys(d.titles).length>0&&(Y.value=d.titles)}catch{}}async function bo(d,h,v){if(Y.value[d])return;const C=h.trim();if(!C)return;const Z=C.length>300?C.slice(0,300):C;try{const te=await ek(Z,v);if(!te||Y.value[d])return;Y.value={...Y.value,[d]:te},wt(),la(d,te)}catch{}}async function As(){var d;gt.value||(Le.value=!0);try{const[h]=await Promise.all([A_(),Zr()]);await Ai(h);const v=Mo(R.value,h);Wr(R.value,v)||(R.value=v,os(R.value));const C=wa(h,R.value),Z=UA(t.value,C,a.value);t.value=Oo(t.value,Z),a.value=Zt(a.value,new Set(Er(t.value).map(Ae=>Ae.id))),wt(),gt.value=!0;const te=Er(e.value);Qt(te),te.some(Ae=>Ae.id===n.value)||z(((d=te[0])==null?void 0:d.id)??"")}finally{Le.value=!1}}async function yr(d,h={}){if(!d)return;const v=W.value[d]===!0,C=h.silent!==!0&&!v;C&&(Pe.value=!0);try{ce.value[d]!==!0&&(await ia(d),ce.value={...ce.value,[d]:!0});const{messages:Z,inProgress:te}=await R_(d),pe=r.value[d]??[],Ae=AA(pe,Z,{preserveMissing:h.silent===!0});$t(d,Ae);const ke=s.value[d]??[],y=RA(ke,Z);Wt(d,y),kn(d,Z),W.value={...W.value,[d]:!0};const x=Jt(d);x&&(B.value={...B.value,[d]:x}),Tt(d,te),qt(d)}finally{C&&(Pe.value=!1)}}async function Rs(){try{const d=t.value.flatMap(h=>h.threads.map(v=>v.cwd)).filter(Boolean);Te.value=await tk(d.length>0?[...new Set(d)]:void 0)}catch{}}async function _o(){Ne.value="";try{await As(),await Promise.all([jt(),zt(),Rs()]),await yr(n.value)}catch(d){Ne.value=d instanceof Error?d.message:"Unknown application error"}}async function es(d){z(d);try{await yr(d)}catch(h){Ne.value=h instanceof Error?h.message:"Unknown application error"}}async function Ri(d){try{await $_(d),await As(),n.value===d&&await yr(n.value)}catch(h){Ne.value=h instanceof Error?h.message:"Unknown application error"}}async function ko(d,h){const v=h.trim();if(!(!d||!v))try{await O_(d,v),Y.value={...Y.value,[d]:v},wt(),la(d,v)}catch(C){Ne.value=C instanceof Error?C.message:"Unknown application error"}}async function Ps(d,h=[],v=[],C="steer",Z=[],te){if(Ye.value)return;const pe=n.value,Ae=d.trim();if(!pe||!Ae&&h.length===0&&Z.length===0)return;const ke=a.value[pe]===!0;if(ke&&C==="queue"){const y=l.value[pe]??[],x=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,ne=[...y],Ue=typeof te=="number"?Math.max(0,Math.min(te,ne.length)):ne.length;ne.splice(Ue,0,{id:x,text:Ae,imageUrls:h,skills:v,fileAttachments:Z}),l.value={...l.value,[pe]:ne};return}if(ke){$e=!0,ts(pe,Ae,h,v,Z).catch(y=>{const x=y instanceof Error?y.message:"Unknown application error";bt(pe,x),Ne.value=x});return}Ne.value="",$e=!0,xt(pe,null),It(pe,{label:"Thinking",details:yt(m.value,T.value)}),bt(pe,null),Tt(pe,!0);try{await ts(pe,Ae,h,v,Z)}catch(y){$e=!1,Tt(pe,!1),It(pe,null);const x=y instanceof Error?y.message:"Unknown application error";throw bt(pe,x),Ne.value=x,y}}async function To(d,h,v=[],C=[],Z=[]){if(Ye.value)return"";const te=d.trim(),pe=h.trim(),Ae=m.value.trim();if(!te&&v.length===0&&Z.length===0)return"";Oe.value=!0,Ne.value="";let ke="";try{try{ke=await iu(pe||void 0,Ae||void 0)}catch(Ue){if(Ae&&Ae!==Sn&&$o(Ue))await Se(),ke=await iu(pe||void 0,Sn);else throw Ue}if(!ke)return"";Dt(ke,pe,te||"[Image]"),ce.value={...ce.value,[ke]:!0},z(ke),$e=!0,xt(ke,null),It(ke,{label:"Thinking",details:yt(m.value,T.value)}),bt(ke,null),Tt(ke,!0);const y=ke,x=pe||null,ne=te;return ts(ke,te,v,C,Z).catch(Ue=>{$e=!1,Tt(ke,!1),It(ke,null);const Ve=Ue instanceof Error?Ue.message:"Unknown application error";bt(ke,Ve),Ne.value=Ve}).finally(()=>{Oe.value=!1}),bo(y,ne,x),ke}catch(y){$e=!1,ke&&(Tt(ke,!1),It(ke,null));const x=y instanceof Error?y.message:"Unknown application error";throw ke&&bt(ke,x),Ne.value=x,Oe.value=!1,y}}async function ts(d,h,v=[],C=[],Z=[]){const te=m.value.trim(),pe=T.value,Ae=h.trim(),ke=C.map(x=>({name:x.name,path:x.path})),y=Z.map(x=>({...x}));Me(d,{text:Ae,imageUrls:[...v],skills:ke,fileAttachments:y,effort:pe,fallbackRetried:!1});try{ce.value[d]!==!0&&await ia(d);try{await aa(d,h,v,te||void 0,pe||void 0,C.length>0?C:void 0,Z)}catch(x){if(te&&te!==Sn&&$o(x))await Se(),Me(d,{text:Ae,imageUrls:[...v],skills:ke,fileAttachments:y,effort:pe,fallbackRetried:!0}),await aa(d,h,v,Sn,pe||void 0,C.length>0?C:void 0,Z);else throw x}ce.value={...ce.value,[d]:!0},ue.add(d),he=!0,await Jn()}catch(x){throw x}}async function So(d){if(u.value[d]===!0)return;const h=l.value[d];if(!h||h.length===0)return;u.value={...u.value,[d]:!0};const[v,...C]=h;l.value=C.length>0?{...l.value,[d]:C}:Gt(l.value,d),Oe.value=!0,Ne.value="",$e=!0,xt(d,null),It(d,{label:"Thinking",details:yt(m.value,T.value)}),bt(d,null),Tt(d,!0);try{await ts(d,v.text,v.imageUrls,v.skills,v.fileAttachments)}catch{Tt(d,!1),It(d,null)}finally{u.value=Gt(u.value,d),Oe.value=!1}}async function Pi(){const d=n.value;if(!d||a.value[d]!==!0)return;const h=re.value[d];Ee.value=!0,Ne.value="";try{await L_(d,h),Tt(d,!1),It(d,null),bt(d,null),re.value[d]&&(re.value=Gt(re.value,d)),ue.add(d),he=!0,await Jn()}catch(v){const C=v instanceof Error?v.message:"Failed to interrupt active turn";bt(d,C),Ne.value=C}finally{Ee.value=!1}}async function xi(d){const h=n.value;if(!h||Ze.value)return;const C=(r.value[h]??[]).reduce((te,pe)=>typeof pe.turnIndex=="number"&&pe.turnIndex>te?pe.turnIndex:te,-1);if(C<0||d>C)return;const Z=C-d+1;if(!(Z<1)){Ze.value=!0,Ne.value="";try{await He(h,d);const te=await ou(h,Z);$t(h,te),Wt(h,[]),E(h),i.value[h]&&(i.value=Gt(i.value,h)),xt(h,null),It(h,null),bt(h,null),he=!0,await Jn()}catch(te){Ne.value=te instanceof Error?te.message:"Failed to rollback thread"}finally{Ze.value=!1}}}function Mi(d,h){d.length===0||(A.value[d]??"")===h||(A.value={...A.value,[d]:h},ya(A.value))}function $i(d){var Z;if(d.length===0)return;const h=R.value.filter(te=>te!==d);if(Wr(R.value,h)||(R.value=h,os(R.value)),t.value=t.value.filter(te=>te.projectName!==d),A.value[d]!==void 0){const te={...A.value};delete te[d],A.value=te,ya(te)}wt();const v=Er(e.value);Qt(v),v.some(te=>te.id===n.value)||z(((Z=v[0])==null?void 0:Z.id)??""),xs()}function ns(d,h){if(d.length===0||t.value.length===0)return;const v=t.value.map(ke=>ke.projectName),C=v.indexOf(d);if(C===-1)return;const Z=Math.max(0,Math.min(h,v.length-1)),te=EA(v,C,Z);if(te===v)return;const pe=Mo(te,t.value);R.value=pe,os(R.value);const Ae=wa(t.value,R.value);t.value=Oo(t.value,Ae),wt(),xs()}function Oi(d){const h=d.trim();if(!h)return;const v=[h,...R.value.filter(Z=>Z!==h)];if(Wr(R.value,v))return;R.value=v,os(R.value);const C=wa(t.value,R.value);t.value=Oo(t.value,C),wt(),xs()}async function xs(){var d,h;try{const v=await Fa(),C=new Map;for(const pe of v.order){const Ae=ba(pe);C.has(Ae)||C.set(Ae,pe)}for(const pe of t.value){const Ae=((h=(d=pe.threads[0])==null?void 0:d.cwd)==null?void 0:h.trim())??"";Ae&&C.set(pe.projectName,Ae)}const Z=[];for(const pe of R.value){const Ae=C.get(pe);Ae&&!Z.includes(Ae)&&Z.push(Ae)}for(const pe of v.order)Z.includes(pe)||Z.push(pe);const te=v.active.filter(pe=>Z.includes(pe));te.length===0&&Z.length>0&&te.push(Z[0]),await q_({order:Z,labels:v.labels,active:te})}catch{}}async function Jn(){if(nt.value){typeof window<"u"&&et===null&&(et=window.setTimeout(()=>{et=null,Jn()},ga));return}nt.value=!0;const d=he,h=new Set(ue);he=!1,ue.clear();try{d&&await As();const v=n.value;if(!v)return;const C=h.has(v),Z=a.value[v]===!0,te=Jt(v),pe=B.value[v]??"",Ae=te.length>0&&te!==pe;(C||Z||Ae||d)&&await yr(v,{silent:!0})}catch{}finally{nt.value=!1,(he||ue.size>0)&&typeof window<"u"&&et===null&&(et=window.setTimeout(()=>{et=null,Jn()},ga))}}function Ni(){typeof window>"u"||at||(Di(),at=P_(d=>{Qr(d),Cs(d)}))}async function Di(){try{const d=await M_();for(const h of d){const v=Nn(h);v&&j(v)}}catch{}}async function Li(d){try{await x_(d.id,{result:d.result,error:d.error}),X(d.id)}catch(h){Ne.value=h instanceof Error?h.message:"Failed to reply to server request"}}function ji(){at&&(at(),at=null),he=!1,ue.clear(),g.clear(),et!==null&&typeof window<"u"&&(window.clearTimeout(et),et=null),Xe!==null&&typeof window<"u"&&(window.clearTimeout(Xe),Xe=null),$e=!1,r.value={},s.value={},o.value={},i.value={},ve.value={},me.value={},Ie.value={},re.value={},l.value={},u.value={}}const Ui=fe(()=>{const d=n.value;return d?l.value[d]??[]:[]});function Io(d){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const C=v.filter(Z=>Z.id!==d);l.value=C.length>0?{...l.value,[h]:C}:Gt(l.value,h)}function Fi(d){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const C=v.find(Z=>Z.id===d);C&&(Io(d),Ps(C.text,C.imageUrls,C.skills,"steer",C.fileAttachments))}return{projectGroups:e,projectDisplayNameById:A,selectedThread:G,selectedThreadScrollState:N,selectedThreadServerRequests:V,selectedLiveOverlay:J,selectedThreadId:n,availableModelIds:f,selectedModelId:m,selectedReasoningEffort:T,selectedSpeedMode:U,installedSkills:Te,accountRateLimitSnapshots:xe,messages:Q,isLoadingThreads:Le,isLoadingMessages:Pe,isSendingMessage:Oe,isInterruptingTurn:Ee,isUpdatingSpeedMode:Ye,error:Ne,refreshAll:_o,refreshSkills:Rs,selectThread:es,setThreadScrollState:yn,archiveThreadById:Ri,renameThreadById:ko,sendMessageToSelectedThread:Ps,sendMessageToNewThread:To,interruptSelectedThreadTurn:Pi,rollbackSelectedThread:xi,isRollingBack:Ze,selectedThreadQueuedMessages:Ui,removeQueuedMessage:Io,steerQueuedMessage:Fi,setSelectedModelId:_e,setWorktreeGitAutomationEnabled:de,setSelectedReasoningEffort:tt,updateSelectedSpeedMode:vt,respondToPendingServerRequest:Li,renameProject:Mi,removeProject:$i,reorderProject:ns,pinProjectToTop:Oi,startPolling:Ni,stopPolling:ji}}const WA={class:"sidebar-root"},VA={class:"sidebar-scrollable"},GA=["aria-pressed"],zA={key:1,class:"sidebar-search-bar"},qA={key:0,class:"sidebar-settings-area"},KA={key:0,class:"sidebar-settings-panel"},JA=["title"],YA=["title"],XA={class:"sidebar-settings-value"},QA=["title"],ZA={class:"sidebar-settings-value"},e1=["title"],t1=["title"],n1=["title"],r1=["title"],s1={class:"sidebar-settings-rate-limits"},o1={class:"content-root"},i1={class:"content-body"},a1={key:1,class:"content-grid"},l1={class:"new-thread-empty"},c1={class:"worktree-init-status-title"},u1={class:"worktree-init-status-message"},d1={class:"new-thread-trending"},f1={class:"new-thread-trending-header"},h1={key:0,class:"new-thread-trending-empty"},p1={key:1,class:"new-thread-trending-empty"},m1={key:2,class:"new-thread-trending-list"},g1=["onClick"],v1=["title"],y1={class:"new-thread-trending-tip-name-owner"},w1={class:"new-thread-trending-tip-name-repo"},b1={key:1,class:"new-thread-trending-tip-name-repo"},_1={class:"new-thread-trending-tip-meta"},k1={class:"new-thread-trending-tip-description"},T1={key:2,class:"content-grid"},S1={class:"content-thread"},I1={class:"composer-with-queue"},E1={class:"build-badge","aria-label":"Worktree name and version"},Gu="codex-web-local.sidebar-collapsed.v1",zu="codex-web-local.send-with-enter.v1",qu="codex-web-local.in-progress-send-mode.v1",Ku="codex-web-local.dark-mode.v1",Ju="codex-web-local.dictation-click-to-toggle.v1",Yu="codex-web-local.dictation-auto-send.v1",Xu="codex-web-local.dictation-language.v1",Qu="codex-web-local.worktree-git-automation.v1",C1=Ht({__name:"App",setup(e){const t="86af",n="0.1.51",r={sendWithEnter:"When enabled, press Enter to send. When disabled, use Command+Enter to send.",inProgressSendMode:"If a turn is still running, choose whether a new prompt should steer the current turn or be queued.",appearance:"Switch between system theme, light mode, and dark mode.",dictationClickToToggle:"Use click-to-start and click-to-stop dictation instead of hold-to-talk.",dictationAutoSend:"Automatically send transcribed dictation when recording stops.",worktreeRollback:"When enabled, each message creates a Git commit. On rollback, it runs Git reset to the commit for that message.",dictationLanguage:"Choose transcription language or keep auto-detect."},s={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:i,selectedThread:a,selectedThreadScrollState:l,selectedThreadServerRequests:u,selectedLiveOverlay:c,selectedThreadId:f,availableModelIds:m,selectedModelId:T,selectedReasoningEffort:U,selectedSpeedMode:P,installedSkills:F,accountRateLimitSnapshots:R,messages:A,isLoadingThreads:B,isLoadingMessages:W,isInterruptingTurn:ce,isUpdatingSpeedMode:me,refreshAll:ve,refreshSkills:Ie,selectThread:re,setThreadScrollState:le,archiveThreadById:we,renameThreadById:Y,sendMessageToSelectedThread:Te,sendMessageToNewThread:xe,interruptSelectedThreadTurn:Le,rollbackSelectedThread:Pe,isRollingBack:Oe,selectedThreadQueuedMessages:Ee,removeQueuedMessage:Ye,steerQueuedMessage:Ze,setSelectedModelId:Ne,setWorktreeGitAutomationEnabled:nt,setSelectedReasoningEffort:gt,updateSelectedSpeedMode:at,respondToPendingServerRequest:et,renameProject:Xe,removeProject:K,reorderProject:he,pinProjectToTop:ue,startPolling:be,stopPolling:$e}=HA(),g=fv(),b=dv(),{isMobile:M}=Af(),q=D(null),G=D(null),N=D([]),V=D(!1),J=D("trending-daily"),Q=D(null),z=D(!1),_e=D(!1),de=D(""),Se=D("local"),Me=D({order:[],labels:{}}),De=D({phase:"idle",title:"",message:""}),Be=D(C()),He=D(""),ot=D(!1),tt=D(null),vt=D(null);let yt=null;const jt=D("New Project (1)"),zt=D(""),kt=D(!1),Rt=D(ns(zu,!0)),wt=D(xs()),Dt=D(Oi()),Qt=D(ns(Ju,!1)),qt=D(null);let xt=0;const Tt=D(ns(Yu,!0)),Kt=D(Fi()),It=fe(()=>d()),bt=D(ns(Qu,!0)),Jt=fe(()=>{const y=g.params.threadId;return typeof y=="string"?y:""}),yn=fe(()=>{const y=new Set;for(const x of o.value)for(const ne of x.threads)y.add(ne.id);return y}),$t=fe(()=>g.name==="home"),Wt=fe(()=>g.name==="skills"),wn=fe(()=>{var y;return Wt.value?"Skills":$t.value?"New thread":((y=a.value)==null?void 0:y.title)??"Choose a thread"}),_=fe(()=>A.value.filter(y=>{const x=te(y.messageType,y.role);return x==="worked"?!0:!(x==="turnActivity.live"||x==="turnError.live"||x==="agentReasoning.live")})),S=fe(()=>{let y=-1;for(const x of A.value)x.role==="user"&&typeof x.turnIndex=="number"&&x.turnIndex>y&&(y=x.turnIndex);return y}),E=fe(()=>c.value),O=fe(()=>$t.value?"__new-thread__":f.value),H=fe(()=>{var y,x;return $t.value?de.value.trim():((x=(y=a.value)==null?void 0:y.cwd)==null?void 0:x.trim())??""}),ie=fe(()=>{var y;return!$t.value&&((y=a.value)==null?void 0:y.inProgress)===!0}),Ce=fe(()=>{var Ue,Ve;const y=[],x=new Set;for(const je of Me.value.order){const Lt=je.trim();!Lt||x.has(Lt)||(x.add(Lt),y.push({value:Lt,label:Me.value.labels[Lt]||es(Lt)}))}for(const je of o.value){const Lt=((Ve=(Ue=je.threads[0])==null?void 0:Ue.cwd)==null?void 0:Ve.trim())??"";!Lt||x.has(Lt)||(x.add(Lt),y.push({value:Lt,label:i.value[je.projectName]??je.projectName}))}const ne=de.value.trim();return ne&&!x.has(ne)&&y.unshift({value:ne,label:es(ne)}),y}),ge=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null,Ke=fe(()=>[{value:"search-daily",label:"Search daily"},{value:"search-weekly",label:"Search weekly"},{value:"search-monthly",label:"Search monthly"},{value:"trending-daily",label:"Trending daily"},{value:"trending-weekly",label:"Trending weekly"},{value:"trending-monthly",label:"Trending monthly"}]);pr(()=>{window.addEventListener("keydown",L),v(),ge==null||ge.addEventListener("change",v),pe(),Qr(),As(),yr(),Zr(),Rs()}),vi(()=>{window.removeEventListener("keydown",L),ge==null||ge.removeEventListener("change",v),yt&&(clearTimeout(yt),yt=null),$e()}),ut(He,y=>{const x=y.trim();if(yt&&(clearTimeout(yt),yt=null),!x){vt.value=null;return}yt=setTimeout(()=>{Y_(x,1e3).then(ne=>{He.value.trim()===x&&(vt.value=ne.threadIds)}).catch(()=>{He.value.trim()===x&&(vt.value=null)})},220)});function lt(){Ie()}function rt(){ot.value=!ot.value,ot.value?Yt(()=>{var y;return(y=tt.value)==null?void 0:y.focus()}):He.value=""}function Nt(){var y;He.value="",(y=tt.value)==null||y.focus()}function mn(y){y.key==="Escape"&&(ot.value=!1,He.value="")}function Nn(y){y&&(g.name==="thread"&&Jt.value===y||(b.push({name:"thread",params:{threadId:y}}),M.value&&$(!0)))}async function j(y){y&&(f.value!==y&&(await re(y),await b.push({name:"thread",params:{threadId:y}})),await Yt(),Pi())}function X(y){we(y)}function se(y){var Ue,Ve;const x=o.value.find(je=>je.projectName===y),ne=((Ve=(Ue=x==null?void 0:x.threads[0])==null?void 0:Ue.cwd)==null?void 0:Ve.trim())??"";ne&&(de.value=ne),M.value&&$(!0),!$t.value&&b.push({name:"home"})}function qe(y){var Ue,Ve;const x=o.value.find(je=>je.projectName===y),ne=((Ve=(Ue=x==null?void 0:x.threads[0])==null?void 0:Ue.cwd)==null?void 0:Ve.trim())??"";!ne||typeof window>"u"||window.open(`/codex-local-browse${encodeURI(ne)}`,"_blank","noopener,noreferrer")}function Pt(){var x,ne;const y=((ne=(x=a.value)==null?void 0:x.cwd)==null?void 0:ne.trim())??"";y&&(de.value=y),M.value&&$(!0),!$t.value&&b.push({name:"home"})}function bn(y){Xe(y.projectName,y.displayName)}function _n(y){Y(y.threadId,y.title)}function an(y){K(y)}function Vt(y){he(y.projectName,y.toIndex)}function Dn(y){le(y.threadId,y.state)}function I(y){et(y)}function $(y){Be.value!==y&&(Be.value=y,Z(y))}function L(y){y.defaultPrevented||!y.ctrlKey&&!y.metaKey||y.shiftKey||y.altKey||y.key.toLowerCase()==="b"&&(y.preventDefault(),$(!Be.value))}function ee(y){const x=y.text,ne=Q.value,Ue=y.mode==="queue"&&ne&&ne.threadId===f.value?ne.queueIndex:void 0;if(Q.value=null,$t.value){ke(x,y.imageUrls,y.skills,y.fileAttachments);return}if(y.rollbackLatestUserTurn===!0){gr(y);return}Te(x,y.imageUrls,y.skills,y.mode,y.fileAttachments,Ue)}function Ge(y){const x=new Intl.NumberFormat().format(y.stars);return y.language?`${y.language} · ★ ${x}`:`★ ${x}`}function Ut(y){const ne=new Set(["search-daily","search-weekly","search-monthly","trending-daily","trending-weekly","trending-monthly"]).has(y)?y:"trending-daily";J.value!==ne&&(J.value=ne)}function gn(y){const x=q.value;x&&x.hydrateDraft({text:`Clone this GitHub project and run it: ${y.url}
1427
+ Then explain what this project does in very simple words a 5th grader can understand.`,imageUrls:[],fileAttachments:[],skills:[]})}function Xr(y){const x=Ee.value.findIndex(je=>je.id===y),ne=x>=0?Ee.value[x]:void 0,Ue=G.value;if(!ne||!Ue||Ue.hasUnsavedDraft()&&!window.confirm("Replace the current draft with this queued message for editing?"))return;Q.value=f.value?{threadId:f.value,queueIndex:x}:null;const Ve={text:ne.text,imageUrls:[...ne.imageUrls],fileAttachments:ne.fileAttachments.map(je=>({...je})),skills:ne.skills.map(je=>({...je}))};Ue.hydrateDraft(Ve),Ye(y)}async function gr(y){ie.value&&await Le();const x=S.value;x>=0&&await Pe(x),await Te(y.text,y.imageUrls,y.skills,"steer",y.fileAttachments)}function kn(y){de.value=y.trim()}async function vr(y){const x=y.trim();if(!x)return;const ne=Ai(x),Ue=await Cs(),Ve=ne?x:Ri(Ue,x);if(Ve)try{const je=await lu(Ve,{createIfMissing:!ne,label:ne?"":x});je&&(de.value=je,ue(es(je)),yr(),Zr())}catch{}}async function Qr(){var x;if(typeof window>"u")return;const y=((x=new URLSearchParams(window.location.search).get("openProjectPath"))==null?void 0:x.trim())??"";if(y)try{const ne=await lu(y,{createIfMissing:!1,label:""});if(!ne)return;de.value=ne,ue(es(ne)),await b.replace({name:"home"}),await yr();const Ue=new URL(window.location.href);Ue.searchParams.delete("openProjectPath"),window.history.replaceState({},"",Ue.toString())}catch{}}async function Cs(){const y=bo();if(y)return y;try{const x=await au();if(x)return zt.value=x,x}catch{}return""}function Ai(y){return y?y.startsWith("~/")||y.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(y):!1}async function Zr(){const y=bo();if(!y){jt.value="New Project (1)";return}try{const x=await K_(y);jt.value=x.name||"New Project (1)"}catch{jt.value="New Project (1)"}}function bo(){var ne,Ue;const y=de.value.trim();if(y)return _o(y);const x=((Ue=(ne=Ce.value[0])==null?void 0:ne.value)==null?void 0:Ue.trim())??"";return x?_o(x):zt.value.trim()}async function As(){try{zt.value=await au()}catch{zt.value=""}}async function yr(){try{const y=await Fa();Me.value={order:[...y.order],labels:{...y.labels}}}catch{Me.value={order:[],labels:{}}}}async function Rs(){V.value=!0;try{N.value=await Q_(J.value,6)}catch{N.value=[]}finally{V.value=!1}}function _o(y){const x=y.trim().replace(/\/+$/,"");if(!x)return"";const ne=x.lastIndexOf("/");return ne<=0?"":x.slice(0,ne)}function es(y){const x=y.trim().replace(/\/+$/,"");if(!x)return"";const ne=x.lastIndexOf("/");return ne<0?x:x.slice(ne+1)}function Ri(y,x){const ne=y.trim().replace(/\/+$/,""),Ue=x.trim().replace(/^\/+/,"");return!ne||!Ue?"":`${ne}/${Ue}`}function ko(y){Ne(y)}function Ps(y){gt(y)}function To(y){at(y)}function ts(){Le()}function So(y){var ne;const x=((ne=y.prependText)==null?void 0:ne.trim())??"";x.length>0&&(xt+=1,qt.value={id:xt,text:x}),Pe(y.turnIndex)}function Pi(){if($t.value||Wt.value||typeof document>"u"||!a.value||_.value.length===0)return;const y=xi(),x=Mi(),ne=new Blob([y],{type:"text/markdown;charset=utf-8"}),Ue=URL.createObjectURL(ne),Ve=document.createElement("a");Ve.href=Ue,Ve.download=x,document.body.appendChild(Ve),Ve.click(),document.body.removeChild(Ve),window.setTimeout(()=>URL.revokeObjectURL(Ue),0)}function xi(){var ne,Ue,Ve;const y=[],x=((Ue=(ne=a.value)==null?void 0:ne.title)==null?void 0:Ue.trim())||"Untitled thread";y.push(`# ${$i(x)}`),y.push(""),y.push(`- Exported: ${new Date().toISOString()}`),y.push(`- Thread ID: ${((Ve=a.value)==null?void 0:Ve.id)??""}`),y.push(""),y.push("---"),y.push("");for(const je of _.value){const Lt=je.role?je.role.toUpperCase():"MESSAGE";y.push(`## ${Lt}`),y.push("");const Ms=je.text.trim();if(Ms&&(y.push(Ms),y.push("")),je.commandExecution&&(y.push("```text"),y.push(`command: ${je.commandExecution.command}`),y.push(`status: ${je.commandExecution.status}`),je.commandExecution.cwd&&y.push(`cwd: ${je.commandExecution.cwd}`),je.commandExecution.exitCode!==null&&y.push(`exitCode: ${je.commandExecution.exitCode}`),y.push(je.commandExecution.aggregatedOutput||"(no output)"),y.push("```"),y.push("")),je.fileAttachments&&je.fileAttachments.length>0){y.push("Attachments:");for(const rs of je.fileAttachments)y.push(`- ${rs.path}`);y.push("")}if(je.images&&je.images.length>0){y.push("Images:");for(const rs of je.images)y.push(`- ${rs}`);y.push("")}}return`${y.join(`
1427
1428
  `).trimEnd()}
1428
- `}function Mi(){var Ve,je;const ne=(((je=(Ve=a.value)==null?void 0:Ve.title)==null?void 0:je.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",Ue=new Date().toISOString().replace(/[:.]/g,"-");return`${ne}-${Ue}.md`}function $i(y){return y.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function ns(y,M){if(typeof window>"u")return M;const ne=window.localStorage.getItem(y);return ne===null?M:ne==="1"}function Oi(){if(typeof window>"u")return"system";const y=window.localStorage.getItem(Ku);return y==="light"||y==="dark"?y:"system"}function xs(){return typeof window>"u"?"steer":window.localStorage.getItem(qu)==="queue"?"queue":"steer"}function Jn(){Rt.value=!Rt.value,window.localStorage.setItem(zu,Rt.value?"1":"0")}function Ni(){wt.value=wt.value==="steer"?"queue":"steer",window.localStorage.setItem(qu,wt.value)}function Di(){const y=["system","light","dark"],M=y.indexOf(Dt.value);Dt.value=y[(M+1)%y.length],window.localStorage.setItem(Ku,Dt.value),v()}function Li(){Qt.value=!Qt.value,window.localStorage.setItem(Ju,Qt.value?"1":"0")}function ji(){Tt.value=!Tt.value,window.localStorage.setItem(Yu,Tt.value?"1":"0")}function Ui(){bt.value=!bt.value,window.localStorage.setItem(Qu,bt.value?"1":"0")}function Io(y){const ne=h(y.trim())||"auto";Kt.value=ne,window.localStorage.setItem(Xu,ne)}function Fi(){var ne;if(typeof window>"u")return"auto";const y=((ne=window.localStorage.getItem(Xu))==null?void 0:ne.trim())||"auto";return h(y)||"auto"}function d(){const y=[{value:"auto",label:"Auto-detect"}],M=new Set(["auto"]);function ne(Ve){const je=s[Ve]||Ve;return`${je.charAt(0).toUpperCase()+je.slice(1)} (${Ve})`}for(const Ve of typeof navigator<"u"?navigator.languages??[]:[]){const je=h(Ve);!je||M.has(je)||(M.add(je),y.push({value:je,label:`Preferred: ${ne(je)}`}))}for(const Ve of Object.keys(s))M.has(Ve)||(M.add(Ve),y.push({value:Ve,label:ne(Ve)}));const Ue=Kt.value.trim();return Ue&&!M.has(Ue)&&y.push({value:Ue,label:ne(Ue)}),y}function h(y){const M=y.trim().toLowerCase();if(!M||M==="auto")return"";if(M in s)return M;const ne=M.split("-")[0]??M;return ne in s?ne:""}function v(){const y=document.documentElement;if(Dt.value==="dark")y.classList.add("dark");else if(Dt.value==="light")y.classList.remove("dark");else{const M=window.matchMedia("(prefers-color-scheme: dark)").matches;y.classList.toggle("dark",M)}}function C(){return typeof window>"u"?!1:window.localStorage.getItem(Gu)==="1"}function Z(y){typeof window>"u"||window.localStorage.setItem(Gu,y?"1":"0")}function te(y,M){const ne=(y??"").trim();return ne.length>0?ne:M.trim()||"message"}async function pe(){await ve(),_e.value=!0,await Ae(),be()}async function Ae(){if(!z.value){z.value=!0;try{if(g.name==="home"||g.name==="skills"){f.value!==""&&await re("");return}if(g.name==="thread"){const y=Jt.value;if(!y)return;if(!yn.value.has(y)){await b.replace({name:"home"});return}f.value!==y&&await re(y);return}}finally{z.value=!1}}}ut(()=>[g.name,Jt.value,B.value,yn.value.has(Jt.value),f.value],async()=>{_e.value&&await Ae()}),ut(()=>f.value,async y=>{if(_e.value&&!z.value&&!($t.value||Wt.value)){if(!y){g.name!=="home"&&await b.replace({name:"home"});return}g.name==="thread"&&Jt.value===y||await b.replace({name:"thread",params:{threadId:y}})}}),ut(()=>J.value,()=>{Rs()}),ut(()=>Ce.value,y=>{if(y.length===0){de.value="";return}y.some(ne=>ne.value===de.value)||(de.value=y[0].value),Zr()},{immediate:!0}),ut(()=>de.value,()=>{De.value={phase:"idle",title:"",message:""},Zr()}),ut(()=>Se.value,y=>{y==="local"&&(De.value={phase:"idle",title:"",message:""})}),ut(()=>g.name,y=>{y!=="home"&&(De.value={phase:"idle",title:"",message:""})}),ut(()=>f.value,()=>{De.value={phase:"idle",title:"",message:""}}),ut(()=>bt.value,y=>{nt(y)},{immediate:!0}),ut(x,y=>{y&&!Fe.value&&$(!0)});async function ke(y,M=[],ne=[],Ue=[]){try{De.value={phase:"idle",title:"",message:""};let Ve=de.value;if(Se.value==="worktree"){De.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const Lt=await V_(de.value);Ve=Lt.cwd,de.value=Lt.cwd,De.value={phase:"idle",title:"",message:""}}catch{De.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const je=await xe(y,Ve,M,ne,Ue);if(!je)return;await b.replace({name:"thread",params:{threadId:je}})}catch{}}return(y,M)=>(w(),T(Be,null,[Re(yv,{"is-sidebar-collapsed":Fe.value,onCloseSidebar:M[6]||(M[6]=ne=>$(!0))},{sidebar:_t(()=>[p("section",WA,[p("div",VA,[Fe.value?ae("",!0):(w(),ft(Fu,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":Fe.value,"show-new-thread-button":!0,onToggleSidebar:M[0]||(M[0]=ne=>$(!Fe.value)),onStartNewThread:Pt},{default:_t(()=>[p("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":ot.value,"aria-label":"Search threads",title:"Search threads",onClick:rt},[Re(Ba,{class:"sidebar-search-toggle-icon"})],8,GA)]),_:1},8,["is-sidebar-collapsed"])),!Fe.value&&ot.value?(w(),T("div",zA,[Re(Ba,{class:"sidebar-search-bar-icon"}),cr(p("input",{ref_key:"sidebarSearchInputRef",ref:tt,"onUpdate:modelValue":M[1]||(M[1]=ne=>He.value=ne),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:mn},null,544),[[ur,He.value]]),He.value.length>0?(w(),T("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:Nt},[Re(Sl,{class:"sidebar-search-clear-icon"})])):ae("",!0)])):ae("",!0),Fe.value?ae("",!0):(w(),T("button",{key:2,class:it(["sidebar-skills-link",{"is-active":Wt.value}]),type:"button",onClick:M[2]||(M[2]=ne=>{ye(b).push({name:"skills"}),ye(x)&&$(!0)})}," Skills Hub ",2)),Fe.value?ae("",!0):(w(),ft(aw,{key:3,groups:ye(o),"project-display-name-by-id":ye(i),"selected-thread-id":ye(f),"is-loading":ye(B),"search-query":He.value,"search-matched-thread-ids":vt.value,onSelect:Nn,onArchive:X,onStartNewThread:se,onRenameProject:bn,onBrowseProjectFiles:qe,onRenameThread:_n,onRemoveProject:an,onReorderProject:Vt,onExportThread:j},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),Fe.value?ae("",!0):(w(),T("div",qA,[Re(mf,{name:"settings-panel"},{default:_t(()=>[kt.value?(w(),T("div",KA,[p("button",{class:"sidebar-settings-row",type:"button",title:r.sendWithEnter,onClick:Jn},[M[7]||(M[7]=p("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),p("span",{class:it(["sidebar-settings-toggle",{"is-on":!Rt.value}])},null,2)],8,JA),p("button",{class:"sidebar-settings-row",type:"button",title:r.inProgressSendMode,onClick:Ni},[M[8]||(M[8]=p("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),p("span",XA,ie(wt.value==="steer"?"Steer":"Queue"),1)],8,YA),p("button",{class:"sidebar-settings-row",type:"button",title:r.appearance,onClick:Di},[M[9]||(M[9]=p("span",{class:"sidebar-settings-label"},"Appearance",-1)),p("span",ZA,ie(Dt.value==="system"?"System":Dt.value==="dark"?"Dark":"Light"),1)],8,QA),p("button",{class:"sidebar-settings-row",type:"button",title:r.dictationClickToToggle,onClick:Li},[M[10]||(M[10]=p("span",{class:"sidebar-settings-label"},"Click to toggle dictation",-1)),p("span",{class:it(["sidebar-settings-toggle",{"is-on":Qt.value}])},null,2)],8,e1),p("button",{class:"sidebar-settings-row",type:"button",title:r.dictationAutoSend,onClick:ji},[M[11]||(M[11]=p("span",{class:"sidebar-settings-label"},"Auto send dictation",-1)),p("span",{class:it(["sidebar-settings-toggle",{"is-on":Tt.value}])},null,2)],8,t1),p("button",{class:"sidebar-settings-row",type:"button",title:r.worktreeRollback,onClick:Ui},[M[12]||(M[12]=p("span",{class:"sidebar-settings-label"},"Worktree rollback",-1)),p("span",{class:it(["sidebar-settings-toggle",{"is-on":bt.value}])},null,2)],8,n1),p("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:r.dictationLanguage},[M[13]||(M[13]=p("span",{class:"sidebar-settings-label"},"Dictation language",-1)),Re(Ks,{class:"sidebar-settings-language-dropdown","model-value":Kt.value,options:It.value,placeholder:"Auto-detect","open-direction":"up","enable-search":!0,"search-placeholder":"Search language...","onUpdate:modelValue":Io},null,8,["model-value","options"])],8,r1),p("div",s1,[Re(Q0,{snapshots:ye(R)},null,8,["snapshots"])])])):ae("",!0)]),_:1}),p("button",{class:"sidebar-settings-button",type:"button",onClick:M[3]||(M[3]=ne=>kt.value=!kt.value)},[Re(mA,{class:"sidebar-settings-icon"}),M[14]||(M[14]=p("span",null,"Settings",-1))])]))])]),content:_t(()=>[p("section",o1,[Re(hw,{title:wn.value},{leading:_t(()=>[Fe.value||ye(x)?(w(),ft(Fu,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":Fe.value,"show-new-thread-button":!0,onToggleSidebar:M[4]||(M[4]=ne=>$(!Fe.value)),onStartNewThread:Pt},null,8,["is-sidebar-collapsed"])):ae("",!0)]),_:1},8,["title"]),p("section",i1,[Wt.value?(w(),ft(eA,{key:0,onSkillsChanged:lt})):$t.value?(w(),T("div",a1,[p("div",l1,[M[16]||(M[16]=p("p",{class:"new-thread-hero"},"Let's build",-1)),Re(Ks,{class:"new-thread-folder-dropdown","model-value":de.value,options:Ce.value,placeholder:"Choose folder","enable-search":!0,"search-placeholder":"Quick search project","show-add-action":!0,"add-action-label":"+ Add new project","default-add-value":jt.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":kn,onAdd:vr},null,8,["model-value","options","default-add-value"]),Re(iT,{class:"new-thread-runtime-dropdown",modelValue:Se.value,"onUpdate:modelValue":M[5]||(M[5]=ne=>Se.value=ne)},null,8,["modelValue"]),De.value.phase!=="idle"?(w(),T("div",{key:0,class:it(["worktree-init-status",{"is-running":De.value.phase==="running","is-error":De.value.phase==="error"}])},[p("strong",c1,ie(De.value.title),1),p("span",u1,ie(De.value.message),1)],2)):ae("",!0),p("div",d1,[p("div",f1,[M[15]||(M[15]=p("p",{class:"new-thread-trending-title"},"Trending GitHub tips",-1)),Re(Ks,{class:"new-thread-trending-scope-dropdown","model-value":J.value,options:Ke.value,"onUpdate:modelValue":Ut},null,8,["model-value","options"])]),V.value?(w(),T("p",h1,"Loading trending projects...")):N.value.length===0?(w(),T("p",p1," Trending tips are unavailable right now. ")):(w(),T("div",m1,[(w(!0),T(Be,null,St(N.value,ne=>(w(),T("button",{key:ne.id,type:"button",class:"new-thread-trending-tip",onClick:Ue=>gn(ne)},[p("span",v1,ie(ne.fullName),1),p("span",y1,ie(Ge(ne)),1),p("span",w1,ie(ne.description||"No description available."),1)],8,g1))),128))]))])]),Re(du,{ref_key:"homeThreadComposerRef",ref:q,"active-thread-id":O.value,cwd:H.value,models:ye(m),"selected-model":ye(k),"selected-reasoning-effort":ye(U),"selected-speed-mode":ye(P),"is-updating-speed-mode":ye(me),skills:ye(F),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":Rt.value,"in-progress-submit-mode":wt.value,"dictation-click-to-toggle":Qt.value,"dictation-auto-send":Tt.value,"prepend-draft-request":qt.value,"dictation-language":Kt.value,onSubmit:ee,"onUpdate:selectedModel":ko,"onUpdate:selectedReasoningEffort":Ps,"onUpdate:selectedSpeedMode":To},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","selected-speed-mode","is-updating-speed-mode","skills","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","prepend-draft-request","dictation-language"])])):(w(),T("div",b1,[p("div",_1,[Re(t_,{messages:_.value,"is-loading":ye(W),"active-thread-id":O.value,cwd:H.value,"scroll-state":ye(l),"live-overlay":E.value,"pending-requests":ye(u),"is-turn-in-progress":oe.value,"is-rolling-back":ye(Oe),onUpdateScrollState:Dn,onRespondServerRequest:I,onRollback:So},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),p("div",k1,[Re(W0,{messages:ye(Ee),onEdit:Xr,onSteer:ye(Ze),onDelete:ye(Ye)},null,8,["messages","onSteer","onDelete"]),Re(du,{ref_key:"threadComposerRef",ref:G,"active-thread-id":O.value,cwd:H.value,models:ye(m),"selected-model":ye(k),"selected-reasoning-effort":ye(U),"selected-speed-mode":ye(P),"is-updating-speed-mode":ye(me),skills:ye(F),"is-turn-in-progress":oe.value,"is-interrupting-turn":ye(ce),"has-queue-above":ye(Ee).length>0,"send-with-enter":Rt.value,"in-progress-submit-mode":wt.value,"dictation-click-to-toggle":Qt.value,"dictation-auto-send":Tt.value,"prepend-draft-request":qt.value,"dictation-language":Kt.value,onSubmit:ee,"onUpdate:selectedModel":ko,"onUpdate:selectedReasoningEffort":Ps,"onUpdate:selectedSpeedMode":To,onInterrupt:ts},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","selected-speed-mode","is-updating-speed-mode","skills","is-turn-in-progress","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","prepend-draft-request","dictation-language"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),p("div",T1," WT "+ie(ye(t))+" · v"+ie(ye(n)),1)],64))}}),I1=st(S1,[["__scopeId","data-v-017ded9c"]]),_a={render:()=>null},E1=uv({history:Hg(),routes:[{path:"/",name:"home",component:_a},{path:"/thread/:threadId",name:"thread",component:_a},{path:"/skills",name:"skills",component:_a},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");tg(I1).use(E1).mount("#app");
1429
+ `}function Mi(){var Ve,je;const ne=(((je=(Ve=a.value)==null?void 0:Ve.title)==null?void 0:je.trim())||"chat").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")||"chat",Ue=new Date().toISOString().replace(/[:.]/g,"-");return`${ne}-${Ue}.md`}function $i(y){return y.replace(/([\\`*_{}\[\]()#+\-.!])/g,"\\$1")}function ns(y,x){if(typeof window>"u")return x;const ne=window.localStorage.getItem(y);return ne===null?x:ne==="1"}function Oi(){if(typeof window>"u")return"system";const y=window.localStorage.getItem(Ku);return y==="light"||y==="dark"?y:"system"}function xs(){return typeof window>"u"?"steer":window.localStorage.getItem(qu)==="queue"?"queue":"steer"}function Jn(){Rt.value=!Rt.value,window.localStorage.setItem(zu,Rt.value?"1":"0")}function Ni(){wt.value=wt.value==="steer"?"queue":"steer",window.localStorage.setItem(qu,wt.value)}function Di(){const y=["system","light","dark"],x=y.indexOf(Dt.value);Dt.value=y[(x+1)%y.length],window.localStorage.setItem(Ku,Dt.value),v()}function Li(){Qt.value=!Qt.value,window.localStorage.setItem(Ju,Qt.value?"1":"0")}function ji(){Tt.value=!Tt.value,window.localStorage.setItem(Yu,Tt.value?"1":"0")}function Ui(){bt.value=!bt.value,window.localStorage.setItem(Qu,bt.value?"1":"0")}function Io(y){const ne=h(y.trim())||"auto";Kt.value=ne,window.localStorage.setItem(Xu,ne)}function Fi(){var ne;if(typeof window>"u")return"auto";const y=((ne=window.localStorage.getItem(Xu))==null?void 0:ne.trim())||"auto";return h(y)||"auto"}function d(){const y=[{value:"auto",label:"Auto-detect"}],x=new Set(["auto"]);function ne(Ve){const je=s[Ve]||Ve;return`${je.charAt(0).toUpperCase()+je.slice(1)} (${Ve})`}for(const Ve of typeof navigator<"u"?navigator.languages??[]:[]){const je=h(Ve);!je||x.has(je)||(x.add(je),y.push({value:je,label:`Preferred: ${ne(je)}`}))}for(const Ve of Object.keys(s))x.has(Ve)||(x.add(Ve),y.push({value:Ve,label:ne(Ve)}));const Ue=Kt.value.trim();return Ue&&!x.has(Ue)&&y.push({value:Ue,label:ne(Ue)}),y}function h(y){const x=y.trim().toLowerCase();if(!x||x==="auto")return"";if(x in s)return x;const ne=x.split("-")[0]??x;return ne in s?ne:""}function v(){const y=document.documentElement;if(Dt.value==="dark")y.classList.add("dark");else if(Dt.value==="light")y.classList.remove("dark");else{const x=window.matchMedia("(prefers-color-scheme: dark)").matches;y.classList.toggle("dark",x)}}function C(){return typeof window>"u"?!1:window.localStorage.getItem(Gu)==="1"}function Z(y){typeof window>"u"||window.localStorage.setItem(Gu,y?"1":"0")}function te(y,x){const ne=(y??"").trim();return ne.length>0?ne:x.trim()||"message"}async function pe(){await ve(),_e.value=!0,await Ae(),be()}async function Ae(){if(!z.value){z.value=!0;try{if(g.name==="home"||g.name==="skills"){f.value!==""&&await re("");return}if(g.name==="thread"){const y=Jt.value;if(!y)return;if(!yn.value.has(y)){await b.replace({name:"home"});return}f.value!==y&&await re(y);return}}finally{z.value=!1}}}ut(()=>[g.name,Jt.value,B.value,yn.value.has(Jt.value),f.value],async()=>{_e.value&&await Ae()}),ut(()=>f.value,async y=>{if(_e.value&&!z.value&&!($t.value||Wt.value)){if(!y){g.name!=="home"&&await b.replace({name:"home"});return}g.name==="thread"&&Jt.value===y||await b.replace({name:"thread",params:{threadId:y}})}}),ut(()=>J.value,()=>{Rs()}),ut(()=>Ce.value,y=>{if(y.length===0){de.value="";return}y.some(ne=>ne.value===de.value)||(de.value=y[0].value),Zr()},{immediate:!0}),ut(()=>de.value,()=>{De.value={phase:"idle",title:"",message:""},Zr()}),ut(()=>Se.value,y=>{y==="local"&&(De.value={phase:"idle",title:"",message:""})}),ut(()=>g.name,y=>{y!=="home"&&(De.value={phase:"idle",title:"",message:""})}),ut(()=>f.value,()=>{De.value={phase:"idle",title:"",message:""}}),ut(()=>bt.value,y=>{nt(y)},{immediate:!0}),ut(M,y=>{y&&!Be.value&&$(!0)});async function ke(y,x=[],ne=[],Ue=[]){try{De.value={phase:"idle",title:"",message:""};let Ve=de.value;if(Se.value==="worktree"){De.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const Lt=await V_(de.value);Ve=Lt.cwd,de.value=Lt.cwd,De.value={phase:"idle",title:"",message:""}}catch{De.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const je=await xe(y,Ve,x,ne,Ue);if(!je)return;await b.replace({name:"thread",params:{threadId:je}})}catch{}}return(y,x)=>(w(),k(Fe,null,[Re(yv,{"is-sidebar-collapsed":Be.value,onCloseSidebar:x[6]||(x[6]=ne=>$(!0))},{sidebar:_t(()=>[p("section",WA,[p("div",VA,[Be.value?ae("",!0):(w(),ft(Fu,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":Be.value,"show-new-thread-button":!0,onToggleSidebar:x[0]||(x[0]=ne=>$(!Be.value)),onStartNewThread:Pt},{default:_t(()=>[p("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":ot.value,"aria-label":"Search threads",title:"Search threads",onClick:rt},[Re(Ba,{class:"sidebar-search-toggle-icon"})],8,GA)]),_:1},8,["is-sidebar-collapsed"])),!Be.value&&ot.value?(w(),k("div",zA,[Re(Ba,{class:"sidebar-search-bar-icon"}),cr(p("input",{ref_key:"sidebarSearchInputRef",ref:tt,"onUpdate:modelValue":x[1]||(x[1]=ne=>He.value=ne),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:mn},null,544),[[ur,He.value]]),He.value.length>0?(w(),k("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:Nt},[Re(Sl,{class:"sidebar-search-clear-icon"})])):ae("",!0)])):ae("",!0),Be.value?ae("",!0):(w(),k("button",{key:2,class:it(["sidebar-skills-link",{"is-active":Wt.value}]),type:"button",onClick:x[2]||(x[2]=ne=>{ye(b).push({name:"skills"}),ye(M)&&$(!0)})}," Skills Hub ",2)),Be.value?ae("",!0):(w(),ft(aw,{key:3,groups:ye(o),"project-display-name-by-id":ye(i),"selected-thread-id":ye(f),"is-loading":ye(B),"search-query":He.value,"search-matched-thread-ids":vt.value,onSelect:Nn,onArchive:X,onStartNewThread:se,onRenameProject:bn,onBrowseProjectFiles:qe,onRenameThread:_n,onRemoveProject:an,onReorderProject:Vt,onExportThread:j},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),Be.value?ae("",!0):(w(),k("div",qA,[Re(mf,{name:"settings-panel"},{default:_t(()=>[kt.value?(w(),k("div",KA,[p("button",{class:"sidebar-settings-row",type:"button",title:r.sendWithEnter,onClick:Jn},[x[7]||(x[7]=p("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),p("span",{class:it(["sidebar-settings-toggle",{"is-on":!Rt.value}])},null,2)],8,JA),p("button",{class:"sidebar-settings-row",type:"button",title:r.inProgressSendMode,onClick:Ni},[x[8]||(x[8]=p("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),p("span",XA,oe(wt.value==="steer"?"Steer":"Queue"),1)],8,YA),p("button",{class:"sidebar-settings-row",type:"button",title:r.appearance,onClick:Di},[x[9]||(x[9]=p("span",{class:"sidebar-settings-label"},"Appearance",-1)),p("span",ZA,oe(Dt.value==="system"?"System":Dt.value==="dark"?"Dark":"Light"),1)],8,QA),p("button",{class:"sidebar-settings-row",type:"button",title:r.dictationClickToToggle,onClick:Li},[x[10]||(x[10]=p("span",{class:"sidebar-settings-label"},"Click to toggle dictation",-1)),p("span",{class:it(["sidebar-settings-toggle",{"is-on":Qt.value}])},null,2)],8,e1),p("button",{class:"sidebar-settings-row",type:"button",title:r.dictationAutoSend,onClick:ji},[x[11]||(x[11]=p("span",{class:"sidebar-settings-label"},"Auto send dictation",-1)),p("span",{class:it(["sidebar-settings-toggle",{"is-on":Tt.value}])},null,2)],8,t1),p("button",{class:"sidebar-settings-row",type:"button",title:r.worktreeRollback,onClick:Ui},[x[12]||(x[12]=p("span",{class:"sidebar-settings-label"},"Worktree rollback",-1)),p("span",{class:it(["sidebar-settings-toggle",{"is-on":bt.value}])},null,2)],8,n1),p("div",{class:"sidebar-settings-row sidebar-settings-row--select",title:r.dictationLanguage},[x[13]||(x[13]=p("span",{class:"sidebar-settings-label"},"Dictation language",-1)),Re(Ks,{class:"sidebar-settings-language-dropdown","model-value":Kt.value,options:It.value,placeholder:"Auto-detect","open-direction":"up","enable-search":!0,"search-placeholder":"Search language...","onUpdate:modelValue":Io},null,8,["model-value","options"])],8,r1),p("div",s1,[Re(Q0,{snapshots:ye(R)},null,8,["snapshots"])])])):ae("",!0)]),_:1}),p("button",{class:"sidebar-settings-button",type:"button",onClick:x[3]||(x[3]=ne=>kt.value=!kt.value)},[Re(mA,{class:"sidebar-settings-icon"}),x[14]||(x[14]=p("span",null,"Settings",-1))])]))])]),content:_t(()=>[p("section",o1,[Re(hw,{title:wn.value},{leading:_t(()=>[Be.value||ye(M)?(w(),ft(Fu,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":Be.value,"show-new-thread-button":!0,onToggleSidebar:x[4]||(x[4]=ne=>$(!Be.value)),onStartNewThread:Pt},null,8,["is-sidebar-collapsed"])):ae("",!0)]),_:1},8,["title"]),p("section",i1,[Wt.value?(w(),ft(eA,{key:0,onSkillsChanged:lt})):$t.value?(w(),k("div",a1,[p("div",l1,[x[17]||(x[17]=p("p",{class:"new-thread-hero"},"Let's build",-1)),Re(Ks,{class:"new-thread-folder-dropdown","model-value":de.value,options:Ce.value,placeholder:"Choose folder","enable-search":!0,"search-placeholder":"Quick search project","show-add-action":!0,"add-action-label":"+ Add new project","default-add-value":jt.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":kn,onAdd:vr},null,8,["model-value","options","default-add-value"]),Re(iT,{class:"new-thread-runtime-dropdown",modelValue:Se.value,"onUpdate:modelValue":x[5]||(x[5]=ne=>Se.value=ne)},null,8,["modelValue"]),De.value.phase!=="idle"?(w(),k("div",{key:0,class:it(["worktree-init-status",{"is-running":De.value.phase==="running","is-error":De.value.phase==="error"}])},[p("strong",c1,oe(De.value.title),1),p("span",u1,oe(De.value.message),1)],2)):ae("",!0),p("div",d1,[p("div",f1,[x[15]||(x[15]=p("p",{class:"new-thread-trending-title"},"Trending GitHub projects",-1)),Re(Ks,{class:"new-thread-trending-scope-dropdown","model-value":J.value,options:Ke.value,"onUpdate:modelValue":Ut},null,8,["model-value","options"])]),V.value?(w(),k("p",h1,"Loading trending projects...")):N.value.length===0?(w(),k("p",p1," Trending repos are unavailable right now. ")):(w(),k("div",m1,[(w(!0),k(Fe,null,St(N.value,ne=>(w(),k("button",{key:ne.id,type:"button",class:"new-thread-trending-tip",onClick:Ue=>gn(ne)},[p("span",{class:"new-thread-trending-tip-name",title:ne.fullName},[ne.owner&&ne.repo?(w(),k(Fe,{key:0},[p("span",y1,oe(ne.owner),1),x[16]||(x[16]=p("span",{class:"new-thread-trending-tip-name-slash"},"/",-1)),p("span",w1,oe(ne.repo),1)],64)):(w(),k("span",b1,oe(ne.fullName),1))],8,v1),p("span",_1,oe(Ge(ne)),1),p("span",k1,oe(ne.description||"No description available."),1)],8,g1))),128))]))])]),Re(du,{ref_key:"homeThreadComposerRef",ref:q,"active-thread-id":O.value,cwd:H.value,models:ye(m),"selected-model":ye(T),"selected-reasoning-effort":ye(U),"selected-speed-mode":ye(P),"is-updating-speed-mode":ye(me),skills:ye(F),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":Rt.value,"in-progress-submit-mode":wt.value,"dictation-click-to-toggle":Qt.value,"dictation-auto-send":Tt.value,"prepend-draft-request":qt.value,"dictation-language":Kt.value,onSubmit:ee,"onUpdate:selectedModel":ko,"onUpdate:selectedReasoningEffort":Ps,"onUpdate:selectedSpeedMode":To},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","selected-speed-mode","is-updating-speed-mode","skills","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","prepend-draft-request","dictation-language"])])):(w(),k("div",T1,[p("div",S1,[Re(t_,{messages:_.value,"is-loading":ye(W),"active-thread-id":O.value,cwd:H.value,"scroll-state":ye(l),"live-overlay":E.value,"pending-requests":ye(u),"is-turn-in-progress":ie.value,"is-rolling-back":ye(Oe),onUpdateScrollState:Dn,onRespondServerRequest:I,onRollback:So},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),p("div",I1,[Re(W0,{messages:ye(Ee),onEdit:Xr,onSteer:ye(Ze),onDelete:ye(Ye)},null,8,["messages","onSteer","onDelete"]),Re(du,{ref_key:"threadComposerRef",ref:G,"active-thread-id":O.value,cwd:H.value,models:ye(m),"selected-model":ye(T),"selected-reasoning-effort":ye(U),"selected-speed-mode":ye(P),"is-updating-speed-mode":ye(me),skills:ye(F),"is-turn-in-progress":ie.value,"is-interrupting-turn":ye(ce),"has-queue-above":ye(Ee).length>0,"send-with-enter":Rt.value,"in-progress-submit-mode":wt.value,"dictation-click-to-toggle":Qt.value,"dictation-auto-send":Tt.value,"prepend-draft-request":qt.value,"dictation-language":Kt.value,onSubmit:ee,"onUpdate:selectedModel":ko,"onUpdate:selectedReasoningEffort":Ps,"onUpdate:selectedSpeedMode":To,onInterrupt:ts},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","selected-speed-mode","is-updating-speed-mode","skills","is-turn-in-progress","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode","dictation-click-to-toggle","dictation-auto-send","prepend-draft-request","dictation-language"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),p("div",E1," WT "+oe(ye(t))+" · v"+oe(ye(n)),1)],64))}}),A1=st(C1,[["__scopeId","data-v-26931ac2"]]),_a={render:()=>null},R1=uv({history:Hg(),routes:[{path:"/",name:"home",component:_a},{path:"/thread/:threadId",name:"thread",component:_a},{path:"/skills",name:"skills",component:_a},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");tg(A1).use(R1).mount("#app");