codexapp 0.1.31 → 0.1.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,48 @@
1
+ (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();/**
2
+ * @vue/shared v3.5.30
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/function li(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const mt={},Mr=[],wn=()=>{},gl=()=>!1,Gs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ci=e=>e.startsWith("onUpdate:"),Ct=Object.assign,ui=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},du=Object.prototype.hasOwnProperty,lt=(e,t)=>du.call(e,t),Le=Array.isArray,Pr=e=>ws(e)==="[object Map]",vl=e=>ws(e)==="[object Set]",Hi=e=>ws(e)==="[object Date]",Ue=e=>typeof e=="function",_t=e=>typeof e=="string",an=e=>typeof e=="symbol",ct=e=>e!==null&&typeof e=="object",yl=e=>(ct(e)||Ue(e))&&Ue(e.then)&&Ue(e.catch),wl=Object.prototype.toString,ws=e=>wl.call(e),fu=e=>ws(e).slice(8,-1),bl=e=>ws(e)==="[object Object]",di=e=>_t(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ns=li(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),zs=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},hu=/-\w/g,Wt=zs(e=>e.replace(hu,t=>t.slice(1).toUpperCase())),pu=/\B([A-Z])/g,tr=zs(e=>e.replace(pu,"-$1").toLowerCase()),Ys=zs(e=>e.charAt(0).toUpperCase()+e.slice(1)),uo=zs(e=>e?`on${Ys(e)}`:""),vn=(e,t)=>!Object.is(e,t),$s=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},_l=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},fi=e=>{const t=parseFloat(e);return isNaN(t)?e:t},mu=e=>{const t=_t(e)?Number(e):NaN;return isNaN(t)?e:t};let Ui;const Js=()=>Ui||(Ui=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function wr(e){if(Le(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=_t(r)?wu(r):wr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(_t(e)||ct(e))return e}const gu=/;(?![^(]*\))/g,vu=/:([^]+)/,yu=/\/\*[^]*?\*\//g;function wu(e){const t={};return e.replace(yu,"").split(gu).forEach(n=>{if(n){const r=n.split(vu);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function ht(e){let t="";if(_t(e))t=e;else if(Le(e))for(let n=0;n<e.length;n++){const r=ht(e[n]);r&&(t+=r+" ")}else if(ct(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const bu="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",_u=li(bu);function kl(e){return!!e||e===""}function ku(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=hi(e[r],t[r]);return n}function hi(e,t){if(e===t)return!0;let n=Hi(e),r=Hi(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=an(e),r=an(t),n||r)return e===t;if(n=Le(e),r=Le(t),n||r)return n&&r?ku(e,t):!1;if(n=ct(e),r=ct(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||!hi(e[i],t[i]))return!1}}return String(e)===String(t)}const Tl=e=>!!(e&&e.__v_isRef===!0),he=e=>_t(e)?e:e==null?"":Le(e)||ct(e)&&(e.toString===wl||!Ue(e.toString))?Tl(e)?he(e.value):JSON.stringify(e,Sl,2):String(e),Sl=(e,t)=>Tl(t)?Sl(e,t.value):Pr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[fo(r,o)+" =>"]=s,n),{})}:vl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>fo(n))}:an(t)?fo(t):ct(t)&&!Le(t)&&!bl(t)?String(t):t,fo=(e,t="")=>{var n;return an(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
6
+ * @vue/reactivity v3.5.30
7
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
+ * @license MIT
9
+ **/let Gt;class Tu{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=Gt,!t&&Gt&&(this.index=(Gt.scopes||(Gt.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=Gt;try{return Gt=this,t()}finally{Gt=n}}}on(){++this._on===1&&(this.prevScope=Gt,Gt=this)}off(){this._on>0&&--this._on===0&&(Gt=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 Su(){return Gt}let gt;const ho=new WeakSet;class xl{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,Gt&&Gt.active&&Gt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ho.has(this)&&(ho.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||El(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Vi(this),Al(this);const t=gt,n=sn;gt=this,sn=!0;try{return this.fn()}finally{Il(this),gt=t,sn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)gi(t);this.deps=this.depsTail=void 0,Vi(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ho.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Do(this)&&this.run()}get dirty(){return Do(this)}}let Cl=0,rs,ss;function El(e,t=!1){if(e.flags|=8,t){e.next=ss,ss=e;return}e.next=rs,rs=e}function pi(){Cl++}function mi(){if(--Cl>0)return;if(ss){let t=ss;for(ss=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;rs;){let t=rs;for(rs=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 Al(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Il(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),gi(r),xu(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function Do(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Rl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Rl(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===us)||(e.globalVersion=us,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Do(e))))return;e.flags|=2;const t=e.dep,n=gt,r=sn;gt=e,sn=!0;try{Al(e);const s=e.fn(e._value);(t.version===0||vn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{gt=n,sn=r,Il(e),e.flags&=-3}}function gi(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)gi(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function xu(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let sn=!0;const $l=[];function Nn(){$l.push(sn),sn=!1}function jn(){const e=$l.pop();sn=e===void 0?!0:e}function Vi(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=gt;gt=void 0;try{t()}finally{gt=n}}}let us=0;class Cu{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 vi{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!gt||!sn||gt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==gt)n=this.activeLink=new Cu(gt,this),gt.deps?(n.prevDep=gt.depsTail,gt.depsTail.nextDep=n,gt.depsTail=n):gt.deps=gt.depsTail=n,Ml(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=gt.depsTail,n.nextDep=void 0,gt.depsTail.nextDep=n,gt.depsTail=n,gt.deps===n&&(gt.deps=r)}return n}trigger(t){this.version++,us++,this.notify(t)}notify(t){pi();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{mi()}}}function Ml(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)Ml(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Lo=new WeakMap,vr=Symbol(""),Bo=Symbol(""),ds=Symbol("");function jt(e,t,n){if(sn&&gt){let r=Lo.get(e);r||Lo.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new vi),s.map=r,s.key=n),s.track()}}function Mn(e,t,n,r,s,o){const i=Lo.get(e);if(!i){us++;return}const a=l=>{l&&l.trigger()};if(pi(),t==="clear")i.forEach(a);else{const l=Le(e),d=l&&di(n);if(l&&n==="length"){const u=Number(r);i.forEach((f,m)=>{(m==="length"||m===ds||!an(m)&&m>=u)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),d&&a(i.get(ds)),t){case"add":l?d&&a(i.get("length")):(a(i.get(vr)),Pr(e)&&a(i.get(Bo)));break;case"delete":l||(a(i.get(vr)),Pr(e)&&a(i.get(Bo)));break;case"set":Pr(e)&&a(i.get(vr));break}}mi()}function Er(e){const t=st(e);return t===e?t:(jt(t,"iterate",ds),rn(e)?t:t.map(ln))}function Qs(e){return jt(e=st(e),"iterate",ds),e}function mn(e,t){return Dn(e)?Dr(yr(e)?ln(t):t):ln(t)}const Eu={__proto__:null,[Symbol.iterator](){return po(this,Symbol.iterator,e=>mn(this,e))},concat(...e){return Er(this).concat(...e.map(t=>Le(t)?Er(t):t))},entries(){return po(this,"entries",e=>(e[1]=mn(this,e[1]),e))},every(e,t){return En(this,"every",e,t,void 0,arguments)},filter(e,t){return En(this,"filter",e,t,n=>n.map(r=>mn(this,r)),arguments)},find(e,t){return En(this,"find",e,t,n=>mn(this,n),arguments)},findIndex(e,t){return En(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return En(this,"findLast",e,t,n=>mn(this,n),arguments)},findLastIndex(e,t){return En(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return En(this,"forEach",e,t,void 0,arguments)},includes(...e){return mo(this,"includes",e)},indexOf(...e){return mo(this,"indexOf",e)},join(e){return Er(this).join(e)},lastIndexOf(...e){return mo(this,"lastIndexOf",e)},map(e,t){return En(this,"map",e,t,void 0,arguments)},pop(){return zr(this,"pop")},push(...e){return zr(this,"push",e)},reduce(e,...t){return Wi(this,"reduce",e,t)},reduceRight(e,...t){return Wi(this,"reduceRight",e,t)},shift(){return zr(this,"shift")},some(e,t){return En(this,"some",e,t,void 0,arguments)},splice(...e){return zr(this,"splice",e)},toReversed(){return Er(this).toReversed()},toSorted(e){return Er(this).toSorted(e)},toSpliced(...e){return Er(this).toSpliced(...e)},unshift(...e){return zr(this,"unshift",e)},values(){return po(this,"values",e=>mn(this,e))}};function po(e,t,n){const r=Qs(e),s=r[t]();return r!==e&&!rn(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const Au=Array.prototype;function En(e,t,n,r,s,o){const i=Qs(e),a=i!==e&&!rn(e),l=i[t];if(l!==Au[t]){const f=l.apply(e,o);return a?ln(f):f}let d=n;i!==e&&(a?d=function(f,m){return n.call(this,mn(e,f),m,e)}:n.length>2&&(d=function(f,m){return n.call(this,f,m,e)}));const u=l.call(i,d,r);return a&&s?s(u):u}function Wi(e,t,n,r){const s=Qs(e),o=s!==e&&!rn(e);let i=n,a=!1;s!==e&&(o?(a=r.length===0,i=function(d,u,f){return a&&(a=!1,d=mn(e,d)),n.call(this,d,mn(e,u),f,e)}):n.length>3&&(i=function(d,u,f){return n.call(this,d,u,f,e)}));const l=s[t](i,...r);return a?mn(e,l):l}function mo(e,t,n){const r=st(e);jt(r,"iterate",ds);const s=r[t](...n);return(s===-1||s===!1)&&bi(n[0])?(n[0]=st(n[0]),r[t](...n)):s}function zr(e,t,n=[]){Nn(),pi();const r=st(e)[t].apply(e,n);return mi(),jn(),r}const Iu=li("__proto__,__v_isRef,__isVue"),Pl=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(an));function Ru(e){an(e)||(e=String(e));const t=st(this);return jt(t,"has",e),t.hasOwnProperty(e)}class Ol{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?Fu:Ll:o?Dl:jl).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Le(t);if(!s){let l;if(i&&(l=Eu[n]))return l;if(n==="hasOwnProperty")return Ru}const a=Reflect.get(t,n,Bt(t)?t:r);if((an(n)?Pl.has(n):Iu(n))||(s||jt(t,"get",n),o))return a;if(Bt(a)){const l=i&&di(n)?a:a.value;return s&&ct(l)?Ho(l):l}return ct(a)?s?Ho(a):Xs(a):a}}class Nl extends Ol{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Le(t)&&di(n);if(!this._isShallow){const d=Dn(o);if(!rn(r)&&!Dn(r)&&(o=st(o),r=st(r)),!i&&Bt(o)&&!Bt(r))return d||(o.value=r),!0}const a=i?Number(n)<t.length:lt(t,n),l=Reflect.set(t,n,r,Bt(t)?t:s);return t===st(s)&&(a?vn(r,o)&&Mn(t,"set",n,r):Mn(t,"add",n,r)),l}deleteProperty(t,n){const r=lt(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&Mn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!an(n)||!Pl.has(n))&&jt(t,"has",n),r}ownKeys(t){return jt(t,"iterate",Le(t)?"length":vr),Reflect.ownKeys(t)}}class $u extends Ol{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Mu=new Nl,Pu=new $u,Ou=new Nl(!0);const Fo=e=>e,Ts=e=>Reflect.getPrototypeOf(e);function Nu(e,t,n){return function(...r){const s=this.__v_raw,o=st(s),i=Pr(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,d=s[e](...r),u=n?Fo:t?Dr:ln;return!t&&jt(o,"iterate",l?Bo:vr),Ct(Object.create(d),{next(){const{value:f,done:m}=d.next();return m?{value:f,done:m}:{value:a?[u(f[0]),u(f[1])]:u(f),done:m}}})}}function Ss(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function ju(e,t){const n={get(s){const o=this.__v_raw,i=st(o),a=st(s);e||(vn(s,a)&&jt(i,"get",s),jt(i,"get",a));const{has:l}=Ts(i),d=t?Fo:e?Dr:ln;if(l.call(i,s))return d(o.get(s));if(l.call(i,a))return d(o.get(a));o!==i&&o.get(s)},get size(){const s=this.__v_raw;return!e&&jt(st(s),"iterate",vr),s.size},has(s){const o=this.__v_raw,i=st(o),a=st(s);return e||(vn(s,a)&&jt(i,"has",s),jt(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=st(a),d=t?Fo:e?Dr:ln;return!e&&jt(l,"iterate",vr),a.forEach((u,f)=>s.call(o,d(u),d(f),i))}};return Ct(n,e?{add:Ss("add"),set:Ss("set"),delete:Ss("delete"),clear:Ss("clear")}:{add(s){const o=st(this),i=Ts(o),a=st(s),l=!t&&!rn(s)&&!Dn(s)?a:s;return i.has.call(o,l)||vn(s,l)&&i.has.call(o,s)||vn(a,l)&&i.has.call(o,a)||(o.add(l),Mn(o,"add",l,l)),this},set(s,o){!t&&!rn(o)&&!Dn(o)&&(o=st(o));const i=st(this),{has:a,get:l}=Ts(i);let d=a.call(i,s);d||(s=st(s),d=a.call(i,s));const u=l.call(i,s);return i.set(s,o),d?vn(o,u)&&Mn(i,"set",s,o):Mn(i,"add",s,o),this},delete(s){const o=st(this),{has:i,get:a}=Ts(o);let l=i.call(o,s);l||(s=st(s),l=i.call(o,s)),a&&a.call(o,s);const d=o.delete(s);return l&&Mn(o,"delete",s,void 0),d},clear(){const s=st(this),o=s.size!==0,i=s.clear();return o&&Mn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Nu(s,e,t)}),n}function yi(e,t){const n=ju(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(lt(n,s)&&s in r?n:r,s,o)}const Du={get:yi(!1,!1)},Lu={get:yi(!1,!0)},Bu={get:yi(!0,!1)};const jl=new WeakMap,Dl=new WeakMap,Ll=new WeakMap,Fu=new WeakMap;function Hu(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Uu(e){return e.__v_skip||!Object.isExtensible(e)?0:Hu(fu(e))}function Xs(e){return Dn(e)?e:wi(e,!1,Mu,Du,jl)}function Bl(e){return wi(e,!1,Ou,Lu,Dl)}function Ho(e){return wi(e,!0,Pu,Bu,Ll)}function wi(e,t,n,r,s){if(!ct(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Uu(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 yr(e){return Dn(e)?yr(e.__v_raw):!!(e&&e.__v_isReactive)}function Dn(e){return!!(e&&e.__v_isReadonly)}function rn(e){return!!(e&&e.__v_isShallow)}function bi(e){return e?!!e.__v_raw:!1}function st(e){const t=e&&e.__v_raw;return t?st(t):e}function Vu(e){return!lt(e,"__v_skip")&&Object.isExtensible(e)&&_l(e,"__v_skip",!0),e}const ln=e=>ct(e)?Xs(e):e,Dr=e=>ct(e)?Ho(e):e;function Bt(e){return e?e.__v_isRef===!0:!1}function P(e){return Fl(e,!1)}function Wu(e){return Fl(e,!0)}function Fl(e,t){return Bt(e)?e:new qu(e,t)}class qu{constructor(t,n){this.dep=new vi,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:st(t),this._value=n?t:ln(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||rn(t)||Dn(t);t=r?t:st(t),vn(t,n)&&(this._rawValue=t,this._value=r?t:ln(t),this.dep.trigger())}}function je(e){return Bt(e)?e.value:e}const Ku={get:(e,t,n)=>t==="__v_raw"?e:je(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return Bt(s)&&!Bt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Hl(e){return yr(e)?e:new Proxy(e,Ku)}class Gu{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new vi(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=us-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&gt!==this)return El(this,!0),!0}get value(){const t=this.dep.track();return Rl(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function zu(e,t,n=!1){let r,s;return Ue(e)?r=e:(r=e.get,s=e.set),new Gu(r,s,n)}const xs={},Ds=new WeakMap;let hr;function Yu(e,t=!1,n=hr){if(n){let r=Ds.get(n);r||Ds.set(n,r=[]),r.push(e)}}function Ju(e,t,n=mt){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,d=L=>s?L:rn(L)||s===!1||s===0?Pn(L,1):Pn(L);let u,f,m,b,N=!1,I=!1;if(Bt(e)?(f=()=>e.value,N=rn(e)):yr(e)?(f=()=>d(e),N=!0):Le(e)?(I=!0,N=e.some(L=>yr(L)||rn(L)),f=()=>e.map(L=>{if(Bt(L))return L.value;if(yr(L))return d(L);if(Ue(L))return l?l(L,2):L()})):Ue(e)?t?f=l?()=>l(e,2):e:f=()=>{if(m){Nn();try{m()}finally{jn()}}const L=hr;hr=u;try{return l?l(e,3,[b]):e(b)}finally{hr=L}}:f=wn,t&&s){const L=f,ce=s===!0?1/0:s;f=()=>Pn(L(),ce)}const H=Su(),J=()=>{u.stop(),H&&H.active&&ui(H.effects,u)};if(o&&t){const L=t;t=(...ce)=>{L(...ce),J()}}let O=I?new Array(e.length).fill(xs):xs;const U=L=>{if(!(!(u.flags&1)||!u.dirty&&!L))if(t){const ce=u.run();if(s||N||(I?ce.some((fe,pe)=>vn(fe,O[pe])):vn(ce,O))){m&&m();const fe=hr;hr=u;try{const pe=[ce,O===xs?void 0:I&&O[0]===xs?[]:O,b];O=ce,l?l(t,3,pe):t(...pe)}finally{hr=fe}}}else u.run()};return a&&a(U),u=new xl(f),u.scheduler=i?()=>i(U,!1):U,b=L=>Yu(L,!1,u),m=u.onStop=()=>{const L=Ds.get(u);if(L){if(l)l(L,4);else for(const ce of L)ce();Ds.delete(u)}},t?r?U(!0):O=u.run():i?i(U.bind(null,!0),!0):u.run(),J.pause=u.pause.bind(u),J.resume=u.resume.bind(u),J.stop=J,J}function Pn(e,t=1/0,n){if(t<=0||!ct(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Bt(e))Pn(e.value,t,n);else if(Le(e))for(let r=0;r<e.length;r++)Pn(e[r],t,n);else if(vl(e)||Pr(e))e.forEach(r=>{Pn(r,t,n)});else if(bl(e)){for(const r in e)Pn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Pn(e[r],t,n)}return e}/**
10
+ * @vue/runtime-core v3.5.30
11
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
+ * @license MIT
13
+ **/function bs(e,t,n,r){try{return r?e(...r):e()}catch(s){Zs(s,t,n)}}function cn(e,t,n,r){if(Ue(e)){const s=bs(e,t,n,r);return s&&yl(s)&&s.catch(o=>{Zs(o,t,n)}),s}if(Le(e)){const s=[];for(let o=0;o<e.length;o++)s.push(cn(e[o],t,n,r));return s}}function Zs(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||mt;if(t){let a=t.parent;const l=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const u=a.ec;if(u){for(let f=0;f<u.length;f++)if(u[f](e,l,d)===!1)return}a=a.parent}if(o){Nn(),bs(o,null,10,[e,l,d]),jn();return}}Qu(e,n,s,r,i)}function Qu(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Ut=[];let hn=-1;const Or=[];let Qn=null,Ir=0;const Ul=Promise.resolve();let Ls=null;function Zt(e){const t=Ls||Ul;return e?t.then(this?e.bind(this):e):t}function Xu(e){let t=hn+1,n=Ut.length;for(;t<n;){const r=t+n>>>1,s=Ut[r],o=fs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function _i(e){if(!(e.flags&1)){const t=fs(e),n=Ut[Ut.length-1];!n||!(e.flags&2)&&t>=fs(n)?Ut.push(e):Ut.splice(Xu(t),0,e),e.flags|=1,Vl()}}function Vl(){Ls||(Ls=Ul.then(ql))}function Zu(e){Le(e)?Or.push(...e):Qn&&e.id===-1?Qn.splice(Ir+1,0,e):e.flags&1||(Or.push(e),e.flags|=1),Vl()}function qi(e,t,n=hn+1){for(;n<Ut.length;n++){const r=Ut[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Ut.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Wl(e){if(Or.length){const t=[...new Set(Or)].sort((n,r)=>fs(n)-fs(r));if(Or.length=0,Qn){Qn.push(...t);return}for(Qn=t,Ir=0;Ir<Qn.length;Ir++){const n=Qn[Ir];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Qn=null,Ir=0}}const fs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ql(e){try{for(hn=0;hn<Ut.length;hn++){const t=Ut[hn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),bs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;hn<Ut.length;hn++){const t=Ut[hn];t&&(t.flags&=-2)}hn=-1,Ut.length=0,Wl(),Ls=null,(Ut.length||Or.length)&&ql()}}let $t=null,Kl=null;function Bs(e){const t=$t;return $t=e,Kl=e&&e.type.__scopeId||null,t}function dt(e,t=$t,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&Vs(-1);const o=Bs(t);let i;try{i=e(...s)}finally{Bs(o),r._d&&Vs(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Ln(e,t){if($t===null)return e;const n=oo($t),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=mt]=t[s];o&&(Ue(o)&&(o={mounted:o,updated:o}),o.deep&&Pn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function lr(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&&(Nn(),cn(l,n,8,[e.el,a,e,t]),jn())}}function Ms(e,t){if(Lt){let n=Lt.provides;const r=Lt.parent&&Lt.parent.provides;r===n&&(n=Lt.provides=Object.create(r)),n[e]=t}}function on(e,t,n=!1){const r=Ci();if(r||jr){let s=jr?jr._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&&Ue(t)?t.call(r&&r.proxy):t}}const ed=Symbol.for("v-scx"),td=()=>on(ed);function ft(e,t,n){return Gl(e,t,n)}function Gl(e,t,n=mt){const{immediate:r,deep:s,flush:o,once:i}=n,a=Ct({},n),l=t&&r||!t&&o!=="post";let d;if(gs){if(o==="sync"){const b=td();d=b.__watcherHandles||(b.__watcherHandles=[])}else if(!l){const b=()=>{};return b.stop=wn,b.resume=wn,b.pause=wn,b}}const u=Lt;a.call=(b,N,I)=>cn(b,u,N,I);let f=!1;o==="post"?a.scheduler=b=>{Nt(b,u&&u.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(b,N)=>{N?b():_i(b)}),a.augmentJob=b=>{t&&(b.flags|=4),f&&(b.flags|=2,u&&(b.id=u.uid,b.i=u))};const m=Ju(e,t,a);return gs&&(d?d.push(m):l&&m()),m}function nd(e,t,n){const r=this.proxy,s=_t(e)?e.includes(".")?zl(r,e):()=>r[e]:e.bind(r,r);let o;Ue(t)?o=t:(o=t.handler,n=t);const i=_s(this),a=Gl(s,o.bind(r),n);return i(),a}function zl(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 Yl=Symbol("_vte"),Jl=e=>e.__isTeleport,os=e=>e&&(e.disabled||e.disabled===""),Ki=e=>e&&(e.defer||e.defer===""),Gi=e=>typeof SVGElement<"u"&&e instanceof SVGElement,zi=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Uo=(e,t)=>{const n=e&&e.to;return _t(n)?t?t(n):null:n},Ql={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,d){const{mc:u,pc:f,pbc:m,o:{insert:b,querySelector:N,createText:I,createComment:H}}=d,J=os(t.props);let{shapeFlag:O,children:U,dynamicChildren:L}=t;if(e==null){const ce=t.el=I(""),fe=t.anchor=I("");b(ce,n,r),b(fe,n,r);const pe=(ae,re)=>{O&16&&u(U,ae,re,s,o,i,a,l)},Se=()=>{const ae=t.target=Uo(t.props,N),re=Vo(ae,t,I,b);ae&&(i!=="svg"&&Gi(ae)?i="svg":i!=="mathml"&&zi(ae)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(ae),J||(pe(ae,re),Ps(t,!1)))};J&&(pe(n,fe),Ps(t,!0)),Ki(t.props)?(t.el.__isMounted=!1,Nt(()=>{Se(),delete t.el.__isMounted},o)):Se()}else{if(Ki(t.props)&&e.el.__isMounted===!1){Nt(()=>{Ql.process(e,t,n,r,s,o,i,a,l,d)},o);return}t.el=e.el,t.targetStart=e.targetStart;const ce=t.anchor=e.anchor,fe=t.target=e.target,pe=t.targetAnchor=e.targetAnchor,Se=os(e.props),ae=Se?n:fe,re=Se?ce:pe;if(i==="svg"||Gi(fe)?i="svg":(i==="mathml"||zi(fe))&&(i="mathml"),L?(m(e.dynamicChildren,L,ae,s,o,i,a),Si(e,t,!0)):l||f(e,t,ae,re,s,o,i,a,!1),J)Se?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Cs(t,n,ce,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const ye=t.target=Uo(t.props,N);ye&&Cs(t,ye,null,d,0)}else Se&&Cs(t,fe,pe,d,1);Ps(t,J)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:d,targetAnchor:u,target:f,props:m}=e;if(f&&(s(d),s(u)),o&&s(l),i&16){const b=o||!os(m);for(let N=0;N<a.length;N++){const I=a[N];r(I,t,n,b,!!I.dynamicChildren)}}},move:Cs,hydrate:rd};function Cs(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:d,props:u}=e,f=o===2;if(f&&r(i,t,n),(!f||os(u))&&l&16)for(let m=0;m<d.length;m++)s(d[m],t,n,2);f&&r(a,t,n)}function rd(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:d,createText:u}},f){function m(H,J){let O=J;for(;O;){if(O&&O.nodeType===8){if(O.data==="teleport start anchor")t.targetStart=O;else if(O.data==="teleport anchor"){t.targetAnchor=O,H._lpa=t.targetAnchor&&i(t.targetAnchor);break}}O=i(O)}}function b(H,J){J.anchor=f(i(H),J,a(H),n,r,s,o)}const N=t.target=Uo(t.props,l),I=os(t.props);if(N){const H=N._lpa||N.firstChild;t.shapeFlag&16&&(I?(b(e,t),m(N,H),t.targetAnchor||Vo(N,t,u,d,a(e)===N?e:null)):(t.anchor=i(e),m(N,H),t.targetAnchor||Vo(N,t,u,d),f(H&&i(H),t,N,n,r,s,o))),Ps(t,I)}else I&&t.shapeFlag&16&&(b(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Fs=Ql;function Ps(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 Vo(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Yl]=i,e&&(r(o,e,s),r(i,e,s)),i}const pn=Symbol("_leaveCb"),Yr=Symbol("_enterCb");function sd(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Hn(()=>{e.isMounted=!0}),Un(()=>{e.isUnmounting=!0}),e}const tn=[Function,Array],Xl={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},Zl=e=>{const t=e.subTree;return t.component?Zl(t.component):t},od={name:"BaseTransition",props:Xl,setup(e,{slots:t}){const n=Ci(),r=sd();return()=>{const s=t.default&&nc(t.default(),!0);if(!s||!s.length)return;const o=ec(s),i=st(e),{mode:a}=i;if(r.isLeaving)return go(o);const l=Yi(o);if(!l)return go(o);let d=Wo(l,i,r,n,f=>d=f);l.type!==Dt&&hs(l,d);let u=n.subTree&&Yi(n.subTree);if(u&&u.type!==Dt&&!pr(u,l)&&Zl(n).type!==Dt){let f=Wo(u,i,r,n);if(hs(u,f),a==="out-in"&&l.type!==Dt)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,u=void 0},go(o);a==="in-out"&&l.type!==Dt?f.delayLeave=(m,b,N)=>{const I=tc(r,u);I[String(u.key)]=u,m[pn]=()=>{b(),m[pn]=void 0,delete d.delayedLeave,u=void 0},d.delayedLeave=()=>{N(),delete d.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return o}}};function ec(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Dt){t=n;break}}return t}const id=od;function tc(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 Wo(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:d,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:m,onLeave:b,onAfterLeave:N,onLeaveCancelled:I,onBeforeAppear:H,onAppear:J,onAfterAppear:O,onAppearCancelled:U}=t,L=String(e.key),ce=tc(n,e),fe=(ae,re)=>{ae&&cn(ae,r,9,re)},pe=(ae,re)=>{const ye=re[1];fe(ae,re),Le(ae)?ae.every(oe=>oe.length<=1)&&ye():ae.length<=1&&ye()},Se={mode:i,persisted:a,beforeEnter(ae){let re=l;if(!n.isMounted)if(o)re=H||l;else return;ae[pn]&&ae[pn](!0);const ye=ce[L];ye&&pr(e,ye)&&ye.el[pn]&&ye.el[pn](),fe(re,[ae])},enter(ae){if(ce[L]===e)return;let re=d,ye=u,oe=f;if(!n.isMounted)if(o)re=J||d,ye=O||u,oe=U||f;else return;let Be=!1;ae[Yr]=Ke=>{Be||(Be=!0,Ke?fe(oe,[ae]):fe(ye,[ae]),Se.delayedLeave&&Se.delayedLeave(),ae[Yr]=void 0)};const Fe=ae[Yr].bind(null,!1);re?pe(re,[ae,Fe]):Fe()},leave(ae,re){const ye=String(e.key);if(ae[Yr]&&ae[Yr](!0),n.isUnmounting)return re();fe(m,[ae]);let oe=!1;ae[pn]=Fe=>{oe||(oe=!0,re(),Fe?fe(I,[ae]):fe(N,[ae]),ae[pn]=void 0,ce[ye]===e&&delete ce[ye])};const Be=ae[pn].bind(null,!1);ce[ye]=e,b?pe(b,[ae,Be]):Be()},clone(ae){const re=Wo(ae,t,n,r,s);return s&&s(re),re}};return Se}function go(e){if(eo(e))return e=er(e),e.children=null,e}function Yi(e){if(!eo(e))return Jl(e.type)&&e.children?ec(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&&Ue(n.default))return n.default()}}function hs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,hs(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function nc(e,t=!1,n){let r=[],s=0;for(let o=0;o<e.length;o++){let i=e[o];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:o);i.type===He?(i.patchFlag&128&&s++,r=r.concat(nc(i.children,t,a))):(t||i.type!==Dt)&&r.push(a!=null?er(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function It(e,t){return Ue(e)?Ct({name:e.name},t,{setup:e}):e}function rc(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Ji(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Hs=new WeakMap;function is(e,t,n,r,s=!1){if(Le(e)){e.forEach((I,H)=>is(I,t&&(Le(t)?t[H]:t),n,r,s));return}if(Nr(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&is(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?oo(r.component):r.el,i=s?null:o,{i:a,r:l}=e,d=t&&t.r,u=a.refs===mt?a.refs={}:a.refs,f=a.setupState,m=st(f),b=f===mt?gl:I=>Ji(u,I)?!1:lt(m,I),N=(I,H)=>!(H&&Ji(u,H));if(d!=null&&d!==l){if(Qi(t),_t(d))u[d]=null,b(d)&&(f[d]=null);else if(Bt(d)){const I=t;N(d,I.k)&&(d.value=null),I.k&&(u[I.k]=null)}}if(Ue(l))bs(l,a,12,[i,u]);else{const I=_t(l),H=Bt(l);if(I||H){const J=()=>{if(e.f){const O=I?b(l)?f[l]:u[l]:N()||!e.k?l.value:u[e.k];if(s)Le(O)&&ui(O,o);else if(Le(O))O.includes(o)||O.push(o);else if(I)u[l]=[o],b(l)&&(f[l]=u[l]);else{const U=[o];N(l,e.k)&&(l.value=U),e.k&&(u[e.k]=U)}}else I?(u[l]=i,b(l)&&(f[l]=i)):H&&(N(l,e.k)&&(l.value=i),e.k&&(u[e.k]=i))};if(i){const O=()=>{J(),Hs.delete(e)};O.id=-1,Hs.set(e,O),Nt(O,n)}else Qi(e),J()}}}function Qi(e){const t=Hs.get(e);t&&(t.flags|=8,Hs.delete(e))}Js().requestIdleCallback;Js().cancelIdleCallback;const Nr=e=>!!e.type.__asyncLoader,eo=e=>e.type.__isKeepAlive;function ad(e,t){sc(e,"a",t)}function ld(e,t){sc(e,"da",t)}function sc(e,t,n=Lt){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(to(t,r,n),n){let s=n.parent;for(;s&&s.parent;)eo(s.parent.vnode)&&cd(r,t,n,s),s=s.parent}}function cd(e,t,n,r){const s=to(t,e,r,!0);no(()=>{ui(r[t],s)},n)}function to(e,t,n=Lt,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{Nn();const a=_s(n),l=cn(t,n,e,i);return a(),jn(),l});return r?s.unshift(o):s.push(o),o}}const Fn=e=>(t,n=Lt)=>{(!gs||e==="sp")&&to(e,(...r)=>t(...r),n)},ud=Fn("bm"),Hn=Fn("m"),dd=Fn("bu"),fd=Fn("u"),Un=Fn("bum"),no=Fn("um"),hd=Fn("sp"),pd=Fn("rtg"),md=Fn("rtc");function gd(e,t=Lt){to("ec",e,t)}const vd="components",oc=Symbol.for("v-ndc");function qo(e){return _t(e)?yd(vd,e,!1)||e:e||oc}function yd(e,t,n=!0,r=!1){const s=$t||Lt;if(s){const o=s.type;{const a=rf(o,!1);if(a&&(a===t||a===Wt(t)||a===Ys(Wt(t))))return o}const i=Xi(s[e]||o[e],t)||Xi(s.appContext[e],t);return!i&&r?o:i}}function Xi(e,t){return e&&(e[t]||e[Wt(t)]||e[Ys(Wt(t))])}function wt(e,t,n,r){let s;const o=n,i=Le(e);if(i||_t(e)){const a=i&&yr(e);let l=!1,d=!1;a&&(l=!rn(e),d=Dn(e),e=Qs(e)),s=new Array(e.length);for(let u=0,f=e.length;u<f;u++)s[u]=t(l?d?Dr(ln(e[u])):ln(e[u]):e[u],u,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(ct(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,d=a.length;l<d;l++){const u=a[l];s[l]=t(e[u],u,l,o)}}else s=[];return s}function yn(e,t,n={},r,s){if($t.ce||$t.parent&&Nr($t.parent)&&$t.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),pt(He,null,[Ce("slot",n,r)],d?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),w();const i=o&&ic(o(n)),a=n.key||i&&i.key,l=pt(He,{key:(a&&!an(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function ic(e){return e.some(t=>ms(t)?!(t.type===Dt||t.type===He&&!ic(t.children)):!0)?e:null}const Ko=e=>e?Cc(e)?oo(e):Ko(e.parent):null,as=Ct(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=>Ko(e.parent),$root:e=>Ko(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>lc(e),$forceUpdate:e=>e.f||(e.f=()=>{_i(e.update)}),$nextTick:e=>e.n||(e.n=Zt.bind(e.proxy)),$watch:e=>nd.bind(e)}),vo=(e,t)=>e!==mt&&!e.__isScriptSetup&&lt(e,t),wd={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(vo(r,t))return i[t]=1,r[t];if(s!==mt&&lt(s,t))return i[t]=2,s[t];if(lt(o,t))return i[t]=3,o[t];if(n!==mt&&lt(n,t))return i[t]=4,n[t];Go&&(i[t]=0)}}const d=as[t];let u,f;if(d)return t==="$attrs"&&jt(e.attrs,"get",""),d(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==mt&&lt(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,lt(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return vo(s,t)?(s[t]=n,!0):r!==mt&&lt(r,t)?(r[t]=n,!0):lt(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!==mt&&a[0]!=="$"&&lt(e,a)||vo(t,a)||lt(o,a)||lt(r,a)||lt(as,a)||lt(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:lt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function bd(){return _d().slots}function _d(e){const t=Ci();return t.setupContext||(t.setupContext=Ac(t))}function Zi(e){return Le(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Go=!0;function kd(e){const t=lc(e),n=e.proxy,r=e.ctx;Go=!1,t.beforeCreate&&ea(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:d,created:u,beforeMount:f,mounted:m,beforeUpdate:b,updated:N,activated:I,deactivated:H,beforeDestroy:J,beforeUnmount:O,destroyed:U,unmounted:L,render:ce,renderTracked:fe,renderTriggered:pe,errorCaptured:Se,serverPrefetch:ae,expose:re,inheritAttrs:ye,components:oe,directives:Be,filters:Fe}=t;if(d&&Td(d,r,null),i)for(const ke in i){const Me=i[ke];Ue(Me)&&(r[ke]=Me.bind(n))}if(s){const ke=s.call(n,n);ct(ke)&&(e.data=Xs(ke))}if(Go=!0,o)for(const ke in o){const Me=o[ke],vt=Ue(Me)?Me.bind(n,n):Ue(Me.get)?Me.get.bind(n,n):wn,nt=!Ue(Me)&&Ue(Me.set)?Me.set.bind(n):wn,ot=de({get:vt,set:nt});Object.defineProperty(r,ke,{enumerable:!0,configurable:!0,get:()=>ot.value,set:rt=>ot.value=rt})}if(a)for(const ke in a)ac(a[ke],r,n,ke);if(l){const ke=Ue(l)?l.call(n):l;Reflect.ownKeys(ke).forEach(Me=>{Ms(Me,ke[Me])})}u&&ea(u,e,"c");function Ie(ke,Me){Le(Me)?Me.forEach(vt=>ke(vt.bind(n))):Me&&ke(Me.bind(n))}if(Ie(ud,f),Ie(Hn,m),Ie(dd,b),Ie(fd,N),Ie(ad,I),Ie(ld,H),Ie(gd,Se),Ie(md,fe),Ie(pd,pe),Ie(Un,O),Ie(no,L),Ie(hd,ae),Le(re))if(re.length){const ke=e.exposed||(e.exposed={});re.forEach(Me=>{Object.defineProperty(ke,Me,{get:()=>n[Me],set:vt=>n[Me]=vt,enumerable:!0})})}else e.exposed||(e.exposed={});ce&&e.render===wn&&(e.render=ce),ye!=null&&(e.inheritAttrs=ye),oe&&(e.components=oe),Be&&(e.directives=Be),ae&&rc(e)}function Td(e,t,n=wn){Le(e)&&(e=zo(e));for(const r in e){const s=e[r];let o;ct(s)?"default"in s?o=on(s.from||r,s.default,!0):o=on(s.from||r):o=on(s),Bt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function ea(e,t,n){cn(Le(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function ac(e,t,n,r){let s=r.includes(".")?zl(n,r):()=>n[r];if(_t(e)){const o=t[e];Ue(o)&&ft(s,o)}else if(Ue(e))ft(s,e.bind(n));else if(ct(e))if(Le(e))e.forEach(o=>ac(o,t,n,r));else{const o=Ue(e.handler)?e.handler.bind(n):t[e.handler];Ue(o)&&ft(s,o,e)}}function lc(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(d=>Us(l,d,i,!0)),Us(l,t,i)),ct(t)&&o.set(t,l),l}function Us(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Us(e,o,n,!0),s&&s.forEach(i=>Us(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=Sd[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const Sd={data:ta,props:na,emits:na,methods:ts,computed:ts,beforeCreate:Ft,created:Ft,beforeMount:Ft,mounted:Ft,beforeUpdate:Ft,updated:Ft,beforeDestroy:Ft,beforeUnmount:Ft,destroyed:Ft,unmounted:Ft,activated:Ft,deactivated:Ft,errorCaptured:Ft,serverPrefetch:Ft,components:ts,directives:ts,watch:Cd,provide:ta,inject:xd};function ta(e,t){return t?e?function(){return Ct(Ue(e)?e.call(this,this):e,Ue(t)?t.call(this,this):t)}:t:e}function xd(e,t){return ts(zo(e),zo(t))}function zo(e){if(Le(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Ft(e,t){return e?[...new Set([].concat(e,t))]:t}function ts(e,t){return e?Ct(Object.create(null),e,t):t}function na(e,t){return e?Le(e)&&Le(t)?[...new Set([...e,...t])]:Ct(Object.create(null),Zi(e),Zi(t??{})):t}function Cd(e,t){if(!e)return t;if(!t)return e;const n=Ct(Object.create(null),e);for(const r in t)n[r]=Ft(e[r],t[r]);return n}function cc(){return{app:null,config:{isNativeTag:gl,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 Ed=0;function Ad(e,t){return function(r,s=null){Ue(r)||(r=Ct({},r)),s!=null&&!ct(s)&&(s=null);const o=cc(),i=new WeakSet,a=[];let l=!1;const d=o.app={_uid:Ed++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:of,get config(){return o.config},set config(u){},use(u,...f){return i.has(u)||(u&&Ue(u.install)?(i.add(u),u.install(d,...f)):Ue(u)&&(i.add(u),u(d,...f))),d},mixin(u){return o.mixins.includes(u)||o.mixins.push(u),d},component(u,f){return f?(o.components[u]=f,d):o.components[u]},directive(u,f){return f?(o.directives[u]=f,d):o.directives[u]},mount(u,f,m){if(!l){const b=d._ceVNode||Ce(r,s);return b.appContext=o,m===!0?m="svg":m===!1&&(m=void 0),e(b,u,m),l=!0,d._container=u,u.__vue_app__=d,oo(b.component)}},onUnmount(u){a.push(u)},unmount(){l&&(cn(a,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(u,f){return o.provides[u]=f,d},runWithContext(u){const f=jr;jr=d;try{return u()}finally{jr=f}}};return d}}let jr=null;const Id=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Wt(t)}Modifiers`]||e[`${tr(t)}Modifiers`];function Rd(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||mt;let s=n;const o=t.startsWith("update:"),i=o&&Id(r,t.slice(7));i&&(i.trim&&(s=n.map(u=>_t(u)?u.trim():u)),i.number&&(s=n.map(fi)));let a,l=r[a=uo(t)]||r[a=uo(Wt(t))];!l&&o&&(l=r[a=uo(tr(t))]),l&&cn(l,e,6,s);const d=r[a+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,cn(d,e,6,s)}}const $d=new WeakMap;function uc(e,t,n=!1){const r=n?$d:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!Ue(e)){const l=d=>{const u=uc(d,t,!0);u&&(a=!0,Ct(i,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(ct(e)&&r.set(e,null),null):(Le(o)?o.forEach(l=>i[l]=null):Ct(i,o),ct(e)&&r.set(e,i),i)}function ro(e,t){return!e||!Gs(t)?!1:(t=t.slice(2).replace(/Once$/,""),lt(e,t[0].toLowerCase()+t.slice(1))||lt(e,tr(t))||lt(e,t))}function ra(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:d,renderCache:u,props:f,data:m,setupState:b,ctx:N,inheritAttrs:I}=e,H=Bs(e);let J,O;try{if(n.shapeFlag&4){const L=s||r,ce=L;J=gn(d.call(ce,L,u,f,b,m,N)),O=a}else{const L=t;J=gn(L.length>1?L(f,{attrs:a,slots:i,emit:l}):L(f,null)),O=t.props?a:Md(a)}}catch(L){ls.length=0,Zs(L,e,1),J=Ce(Dt)}let U=J;if(O&&I!==!1){const L=Object.keys(O),{shapeFlag:ce}=U;L.length&&ce&7&&(o&&L.some(ci)&&(O=Pd(O,o)),U=er(U,O,!1,!0))}return n.dirs&&(U=er(U,null,!1,!0),U.dirs=U.dirs?U.dirs.concat(n.dirs):n.dirs),n.transition&&hs(U,n.transition),J=U,Bs(H),J}const Md=e=>{let t;for(const n in e)(n==="class"||n==="style"||Gs(n))&&((t||(t={}))[n]=e[n]);return t},Pd=(e,t)=>{const n={};for(const r in e)(!ci(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Od(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:a,patchFlag:l}=t,d=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?sa(r,i,d):!!i;if(l&8){const u=t.dynamicProps;for(let f=0;f<u.length;f++){const m=u[f];if(dc(i,r,m)&&!ro(d,m))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?sa(r,i,d):!0:!!i;return!1}function sa(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(dc(t,e,o)&&!ro(n,o))return!0}return!1}function dc(e,t,n){const r=e[n],s=t[n];return n==="style"&&ct(r)&&ct(s)?!hi(r,s):r!==s}function Nd({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 fc={},hc=()=>Object.create(fc),pc=e=>Object.getPrototypeOf(e)===fc;function jd(e,t,n,r=!1){const s={},o=hc();e.propsDefaults=Object.create(null),mc(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:Bl(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function Dd(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=st(s),[l]=e.propsOptions;let d=!1;if((r||i>0)&&!(i&16)){if(i&8){const u=e.vnode.dynamicProps;for(let f=0;f<u.length;f++){let m=u[f];if(ro(e.emitsOptions,m))continue;const b=t[m];if(l)if(lt(o,m))b!==o[m]&&(o[m]=b,d=!0);else{const N=Wt(m);s[N]=Yo(l,a,N,b,e,!1)}else b!==o[m]&&(o[m]=b,d=!0)}}}else{mc(e,t,s,o)&&(d=!0);let u;for(const f in a)(!t||!lt(t,f)&&((u=tr(f))===f||!lt(t,u)))&&(l?n&&(n[f]!==void 0||n[u]!==void 0)&&(s[f]=Yo(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!lt(t,f))&&(delete o[f],d=!0)}d&&Mn(e.attrs,"set","")}function mc(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(ns(l))continue;const d=t[l];let u;s&&lt(s,u=Wt(l))?!o||!o.includes(u)?n[u]=d:(a||(a={}))[u]=d:ro(e.emitsOptions,l)||(!(l in r)||d!==r[l])&&(r[l]=d,i=!0)}if(o){const l=st(n),d=a||mt;for(let u=0;u<o.length;u++){const f=o[u];n[f]=Yo(s,l,f,d[f],e,!lt(d,f))}}return i}function Yo(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=lt(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&Ue(l)){const{propsDefaults:d}=s;if(n in d)r=d[n];else{const u=_s(s);r=d[n]=l.call(null,t),u()}}else r=l;s.ce&&s.ce._setProp(n,r)}i[0]&&(o&&!a?r=!1:i[1]&&(r===""||r===tr(n))&&(r=!0))}return r}const Ld=new WeakMap;function gc(e,t,n=!1){const r=n?Ld:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!Ue(e)){const u=f=>{l=!0;const[m,b]=gc(f,t,!0);Ct(i,m),b&&a.push(...b)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!o&&!l)return ct(e)&&r.set(e,Mr),Mr;if(Le(o))for(let u=0;u<o.length;u++){const f=Wt(o[u]);oa(f)&&(i[f]=mt)}else if(o)for(const u in o){const f=Wt(u);if(oa(f)){const m=o[u],b=i[f]=Le(m)||Ue(m)?{type:m}:Ct({},m),N=b.type;let I=!1,H=!0;if(Le(N))for(let J=0;J<N.length;++J){const O=N[J],U=Ue(O)&&O.name;if(U==="Boolean"){I=!0;break}else U==="String"&&(H=!1)}else I=Ue(N)&&N.name==="Boolean";b[0]=I,b[1]=H,(I||lt(b,"default"))&&a.push(f)}}const d=[i,a];return ct(e)&&r.set(e,d),d}function oa(e){return e[0]!=="$"&&!ns(e)}const ki=e=>e==="_"||e==="_ctx"||e==="$stable",Ti=e=>Le(e)?e.map(gn):[gn(e)],Bd=(e,t,n)=>{if(t._n)return t;const r=dt((...s)=>Ti(t(...s)),n);return r._c=!1,r},vc=(e,t,n)=>{const r=e._ctx;for(const s in e){if(ki(s))continue;const o=e[s];if(Ue(o))t[s]=Bd(s,o,r);else if(o!=null){const i=Ti(o);t[s]=()=>i}}},yc=(e,t)=>{const n=Ti(t);e.slots.default=()=>n},wc=(e,t,n)=>{for(const r in t)(n||!ki(r))&&(e[r]=t[r])},Fd=(e,t,n)=>{const r=e.slots=hc();if(e.vnode.shapeFlag&32){const s=t._;s?(wc(r,t,n),n&&_l(r,"_",s,!0)):vc(t,r)}else t&&yc(e,t)},Hd=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=mt;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:wc(s,t,n):(o=!t.$stable,vc(t,s)),i=t}else t&&(yc(e,t),i={default:1});if(o)for(const a in s)!ki(a)&&i[a]==null&&delete s[a]},Nt=Kd;function Ud(e){return Vd(e)}function Vd(e,t){const n=Js();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:d,setElementText:u,parentNode:f,nextSibling:m,setScopeId:b=wn,insertStaticContent:N}=e,I=(g,y,x,D=null,F=null,j=null,te=void 0,ie=null,ne=!!y.dynamicChildren)=>{if(g===y)return;g&&!pr(g,y)&&(D=R(g),rt(g,F,j,!0),g=null),y.patchFlag===-2&&(ne=!1,y.dynamicChildren=null);const{type:W,ref:we,shapeFlag:le}=y;switch(W){case so:H(g,y,x,D);break;case Dt:J(g,y,x,D);break;case wo:g==null&&O(y,x,D,te);break;case He:oe(g,y,x,D,F,j,te,ie,ne);break;default:le&1?ce(g,y,x,D,F,j,te,ie,ne):le&6?Be(g,y,x,D,F,j,te,ie,ne):(le&64||le&128)&&W.process(g,y,x,D,F,j,te,ie,ne,me)}we!=null&&F?is(we,g&&g.ref,j,y||g,!y):we==null&&g&&g.ref!=null&&is(g.ref,null,j,g,!0)},H=(g,y,x,D)=>{if(g==null)r(y.el=a(y.children),x,D);else{const F=y.el=g.el;y.children!==g.children&&d(F,y.children)}},J=(g,y,x,D)=>{g==null?r(y.el=l(y.children||""),x,D):y.el=g.el},O=(g,y,x,D)=>{[g.el,g.anchor]=N(g.children,y,x,D,g.el,g.anchor)},U=({el:g,anchor:y},x,D)=>{let F;for(;g&&g!==y;)F=m(g),r(g,x,D),g=F;r(y,x,D)},L=({el:g,anchor:y})=>{let x;for(;g&&g!==y;)x=m(g),s(g),g=x;s(y)},ce=(g,y,x,D,F,j,te,ie,ne)=>{if(y.type==="svg"?te="svg":y.type==="math"&&(te="mathml"),g==null)fe(y,x,D,F,j,te,ie,ne);else{const W=g.el&&g.el._isVueCE?g.el:null;try{W&&W._beginPatch(),ae(g,y,F,j,te,ie,ne)}finally{W&&W._endPatch()}}},fe=(g,y,x,D,F,j,te,ie)=>{let ne,W;const{props:we,shapeFlag:le,transition:be,dirs:xe}=g;if(ne=g.el=i(g.type,j,we&&we.is,we),le&8?u(ne,g.children):le&16&&Se(g.children,ne,null,D,F,yo(g,j),te,ie),xe&&lr(g,null,D,"created"),pe(ne,g,g.scopeId,te,D),we){for(const Ve in we)Ve!=="value"&&!ns(Ve)&&o(ne,Ve,null,we[Ve],j,D);"value"in we&&o(ne,"value",null,we.value,j),(W=we.onVnodeBeforeMount)&&fn(W,D,g)}xe&&lr(g,null,D,"beforeMount");const Oe=Wd(F,be);Oe&&be.beforeEnter(ne),r(ne,y,x),((W=we&&we.onVnodeMounted)||Oe||xe)&&Nt(()=>{W&&fn(W,D,g),Oe&&be.enter(ne),xe&&lr(g,null,D,"mounted")},F)},pe=(g,y,x,D,F)=>{if(x&&b(g,x),D)for(let j=0;j<D.length;j++)b(g,D[j]);if(F){let j=F.subTree;if(y===j||kc(j.type)&&(j.ssContent===y||j.ssFallback===y)){const te=F.vnode;pe(g,te,te.scopeId,te.slotScopeIds,F.parent)}}},Se=(g,y,x,D,F,j,te,ie,ne=0)=>{for(let W=ne;W<g.length;W++){const we=g[W]=ie?$n(g[W]):gn(g[W]);I(null,we,y,x,D,F,j,te,ie)}},ae=(g,y,x,D,F,j,te)=>{const ie=y.el=g.el;let{patchFlag:ne,dynamicChildren:W,dirs:we}=y;ne|=g.patchFlag&16;const le=g.props||mt,be=y.props||mt;let xe;if(x&&cr(x,!1),(xe=be.onVnodeBeforeUpdate)&&fn(xe,x,y,g),we&&lr(y,g,x,"beforeUpdate"),x&&cr(x,!0),(le.innerHTML&&be.innerHTML==null||le.textContent&&be.textContent==null)&&u(ie,""),W?re(g.dynamicChildren,W,ie,x,D,yo(y,F),j):te||Me(g,y,ie,null,x,D,yo(y,F),j,!1),ne>0){if(ne&16)ye(ie,le,be,x,F);else if(ne&2&&le.class!==be.class&&o(ie,"class",null,be.class,F),ne&4&&o(ie,"style",le.style,be.style,F),ne&8){const Oe=y.dynamicProps;for(let Ve=0;Ve<Oe.length;Ve++){const Ee=Oe[Ve],ut=le[Ee],Qe=be[Ee];(Qe!==ut||Ee==="value")&&o(ie,Ee,ut,Qe,F,x)}}ne&1&&g.children!==y.children&&u(ie,y.children)}else!te&&W==null&&ye(ie,le,be,x,F);((xe=be.onVnodeUpdated)||we)&&Nt(()=>{xe&&fn(xe,x,y,g),we&&lr(y,g,x,"updated")},D)},re=(g,y,x,D,F,j,te)=>{for(let ie=0;ie<y.length;ie++){const ne=g[ie],W=y[ie],we=ne.el&&(ne.type===He||!pr(ne,W)||ne.shapeFlag&198)?f(ne.el):x;I(ne,W,we,null,D,F,j,te,!0)}},ye=(g,y,x,D,F)=>{if(y!==x){if(y!==mt)for(const j in y)!ns(j)&&!(j in x)&&o(g,j,y[j],null,F,D);for(const j in x){if(ns(j))continue;const te=x[j],ie=y[j];te!==ie&&j!=="value"&&o(g,j,ie,te,F,D)}"value"in x&&o(g,"value",y.value,x.value,F)}},oe=(g,y,x,D,F,j,te,ie,ne)=>{const W=y.el=g?g.el:a(""),we=y.anchor=g?g.anchor:a("");let{patchFlag:le,dynamicChildren:be,slotScopeIds:xe}=y;xe&&(ie=ie?ie.concat(xe):xe),g==null?(r(W,x,D),r(we,x,D),Se(y.children||[],x,we,F,j,te,ie,ne)):le>0&&le&64&&be&&g.dynamicChildren&&g.dynamicChildren.length===be.length?(re(g.dynamicChildren,be,x,F,j,te,ie),(y.key!=null||F&&y===F.subTree)&&Si(g,y,!0)):Me(g,y,x,we,F,j,te,ie,ne)},Be=(g,y,x,D,F,j,te,ie,ne)=>{y.slotScopeIds=ie,g==null?y.shapeFlag&512?F.ctx.activate(y,x,D,te,ne):Fe(y,x,D,F,j,te,ne):Ke(g,y,ne)},Fe=(g,y,x,D,F,j,te)=>{const ie=g.component=Zd(g,D,F);if(eo(g)&&(ie.ctx.renderer=me),ef(ie,!1,te),ie.asyncDep){if(F&&F.registerDep(ie,Ie,te),!g.el){const ne=ie.subTree=Ce(Dt);J(null,ne,y,x),g.placeholder=ne.el}}else Ie(ie,g,y,x,F,j,te)},Ke=(g,y,x)=>{const D=y.component=g.component;if(Od(g,y,x))if(D.asyncDep&&!D.asyncResolved){ke(D,y,x);return}else D.next=y,D.update();else y.el=g.el,D.vnode=y},Ie=(g,y,x,D,F,j,te)=>{const ie=()=>{if(g.isMounted){let{next:le,bu:be,u:xe,parent:Oe,vnode:Ve}=g;{const V=bc(g);if(V){le&&(le.el=Ve.el,ke(g,le,te)),V.asyncDep.then(()=>{Nt(()=>{g.isUnmounted||W()},F)});return}}let Ee=le,ut;cr(g,!1),le?(le.el=Ve.el,ke(g,le,te)):le=Ve,be&&$s(be),(ut=le.props&&le.props.onVnodeBeforeUpdate)&&fn(ut,Oe,le,Ve),cr(g,!0);const Qe=ra(g),B=g.subTree;g.subTree=Qe,I(B,Qe,f(B.el),R(B),g,F,j),le.el=Qe.el,Ee===null&&Nd(g,Qe.el),xe&&Nt(xe,F),(ut=le.props&&le.props.onVnodeUpdated)&&Nt(()=>fn(ut,Oe,le,Ve),F)}else{let le;const{el:be,props:xe}=y,{bm:Oe,m:Ve,parent:Ee,root:ut,type:Qe}=g,B=Nr(y);cr(g,!1),Oe&&$s(Oe),!B&&(le=xe&&xe.onVnodeBeforeMount)&&fn(le,Ee,y),cr(g,!0);{ut.ce&&ut.ce._hasShadowRoot()&&ut.ce._injectChildStyle(Qe,g.parent?g.parent.type:void 0);const V=g.subTree=ra(g);I(null,V,x,D,g,F,j),y.el=V.el}if(Ve&&Nt(Ve,F),!B&&(le=xe&&xe.onVnodeMounted)){const V=y;Nt(()=>fn(le,Ee,V),F)}(y.shapeFlag&256||Ee&&Nr(Ee.vnode)&&Ee.vnode.shapeFlag&256)&&g.a&&Nt(g.a,F),g.isMounted=!0,y=x=D=null}};g.scope.on();const ne=g.effect=new xl(ie);g.scope.off();const W=g.update=ne.run.bind(ne),we=g.job=ne.runIfDirty.bind(ne);we.i=g,we.id=g.uid,ne.scheduler=()=>_i(we),cr(g,!0),W()},ke=(g,y,x)=>{y.component=g;const D=g.vnode.props;g.vnode=y,g.next=null,Dd(g,y.props,D,x),Hd(g,y.children,x),Nn(),qi(g),jn()},Me=(g,y,x,D,F,j,te,ie,ne=!1)=>{const W=g&&g.children,we=g?g.shapeFlag:0,le=y.children,{patchFlag:be,shapeFlag:xe}=y;if(be>0){if(be&128){nt(W,le,x,D,F,j,te,ie,ne);return}else if(be&256){vt(W,le,x,D,F,j,te,ie,ne);return}}xe&8?(we&16&&Te(W,F,j),le!==W&&u(x,le)):we&16?xe&16?nt(W,le,x,D,F,j,te,ie,ne):Te(W,F,j,!0):(we&8&&u(x,""),xe&16&&Se(le,x,D,F,j,te,ie,ne))},vt=(g,y,x,D,F,j,te,ie,ne)=>{g=g||Mr,y=y||Mr;const W=g.length,we=y.length,le=Math.min(W,we);let be;for(be=0;be<le;be++){const xe=y[be]=ne?$n(y[be]):gn(y[be]);I(g[be],xe,x,null,F,j,te,ie,ne)}W>we?Te(g,F,j,!0,!1,le):Se(y,x,D,F,j,te,ie,ne,le)},nt=(g,y,x,D,F,j,te,ie,ne)=>{let W=0;const we=y.length;let le=g.length-1,be=we-1;for(;W<=le&&W<=be;){const xe=g[W],Oe=y[W]=ne?$n(y[W]):gn(y[W]);if(pr(xe,Oe))I(xe,Oe,x,null,F,j,te,ie,ne);else break;W++}for(;W<=le&&W<=be;){const xe=g[le],Oe=y[be]=ne?$n(y[be]):gn(y[be]);if(pr(xe,Oe))I(xe,Oe,x,null,F,j,te,ie,ne);else break;le--,be--}if(W>le){if(W<=be){const xe=be+1,Oe=xe<we?y[xe].el:D;for(;W<=be;)I(null,y[W]=ne?$n(y[W]):gn(y[W]),x,Oe,F,j,te,ie,ne),W++}}else if(W>be)for(;W<=le;)rt(g[W],F,j,!0),W++;else{const xe=W,Oe=W,Ve=new Map;for(W=Oe;W<=be;W++){const We=y[W]=ne?$n(y[W]):gn(y[W]);We.key!=null&&Ve.set(We.key,W)}let Ee,ut=0;const Qe=be-Oe+1;let B=!1,V=0;const Z=new Array(Qe);for(W=0;W<Qe;W++)Z[W]=0;for(W=xe;W<=le;W++){const We=g[W];if(ut>=Qe){rt(We,F,j,!0);continue}let Ye;if(We.key!=null)Ye=Ve.get(We.key);else for(Ee=Oe;Ee<=be;Ee++)if(Z[Ee-Oe]===0&&pr(We,y[Ee])){Ye=Ee;break}Ye===void 0?rt(We,F,j,!0):(Z[Ye-Oe]=W+1,Ye>=V?V=Ye:B=!0,I(We,y[Ye],x,null,F,j,te,ie,ne),ut++)}const ze=B?qd(Z):Mr;for(Ee=ze.length-1,W=Qe-1;W>=0;W--){const We=Oe+W,Ye=y[We],Mt=y[We+1],Yt=We+1<we?Mt.el||_c(Mt):D;Z[W]===0?I(null,Ye,x,Yt,F,j,te,ie,ne):B&&(Ee<0||W!==ze[Ee]?ot(Ye,x,Yt,2):Ee--)}}},ot=(g,y,x,D,F=null)=>{const{el:j,type:te,transition:ie,children:ne,shapeFlag:W}=g;if(W&6){ot(g.component.subTree,y,x,D);return}if(W&128){g.suspense.move(y,x,D);return}if(W&64){te.move(g,y,x,me);return}if(te===He){r(j,y,x);for(let le=0;le<ne.length;le++)ot(ne[le],y,x,D);r(g.anchor,y,x);return}if(te===wo){U(g,y,x);return}if(D!==2&&W&1&&ie)if(D===0)ie.beforeEnter(j),r(j,y,x),Nt(()=>ie.enter(j),F);else{const{leave:le,delayLeave:be,afterLeave:xe}=ie,Oe=()=>{g.ctx.isUnmounted?s(j):r(j,y,x)},Ve=()=>{j._isLeaving&&j[pn](!0),le(j,()=>{Oe(),xe&&xe()})};be?be(j,Oe,Ve):Ve()}else r(j,y,x)},rt=(g,y,x,D=!1,F=!1)=>{const{type:j,props:te,ref:ie,children:ne,dynamicChildren:W,shapeFlag:we,patchFlag:le,dirs:be,cacheIndex:xe}=g;if(le===-2&&(F=!1),ie!=null&&(Nn(),is(ie,null,x,g,!0),jn()),xe!=null&&(y.renderCache[xe]=void 0),we&256){y.ctx.deactivate(g);return}const Oe=we&1&&be,Ve=!Nr(g);let Ee;if(Ve&&(Ee=te&&te.onVnodeBeforeUnmount)&&fn(Ee,y,g),we&6)Ae(g.component,x,D);else{if(we&128){g.suspense.unmount(x,D);return}Oe&&lr(g,null,y,"beforeUnmount"),we&64?g.type.remove(g,y,x,me,D):W&&!W.hasOnce&&(j!==He||le>0&&le&64)?Te(W,y,x,!1,!0):(j===He&&le&384||!F&&we&16)&&Te(ne,y,x),D&&Ze(g)}(Ve&&(Ee=te&&te.onVnodeUnmounted)||Oe)&&Nt(()=>{Ee&&fn(Ee,y,g),Oe&&lr(g,null,y,"unmounted")},x)},Ze=g=>{const{type:y,el:x,anchor:D,transition:F}=g;if(y===He){ge(x,D);return}if(y===wo){L(g);return}const j=()=>{s(x),F&&!F.persisted&&F.afterLeave&&F.afterLeave()};if(g.shapeFlag&1&&F&&!F.persisted){const{leave:te,delayLeave:ie}=F,ne=()=>te(x,j);ie?ie(g.el,j,ne):ne()}else j()},ge=(g,y)=>{let x;for(;g!==y;)x=m(g),s(g),g=x;s(y)},Ae=(g,y,x)=>{const{bum:D,scope:F,job:j,subTree:te,um:ie,m:ne,a:W}=g;ia(ne),ia(W),D&&$s(D),F.stop(),j&&(j.flags|=8,rt(te,g,y,x)),ie&&Nt(ie,y),Nt(()=>{g.isUnmounted=!0},y)},Te=(g,y,x,D=!1,F=!1,j=0)=>{for(let te=j;te<g.length;te++)rt(g[te],y,x,D,F)},R=g=>{if(g.shapeFlag&6)return R(g.component.subTree);if(g.shapeFlag&128)return g.suspense.next();const y=m(g.anchor||g.el),x=y&&y[Yl];return x?m(x):y};let ee=!1;const Q=(g,y,x)=>{let D;g==null?y._vnode&&(rt(y._vnode,null,null,!0),D=y._vnode.component):I(y._vnode||null,g,y,null,null,null,x),y._vnode=g,ee||(ee=!0,qi(D),Wl(),ee=!1)},me={p:I,um:rt,m:ot,r:Ze,mt:Fe,mc:Se,pc:Me,pbc:re,n:R,o:e};return{render:Q,hydrate:void 0,createApp:Ad(Q)}}function yo({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 cr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Wd(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Si(e,t,n=!1){const r=e.children,s=t.children;if(Le(r)&&Le(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]=$n(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&Si(i,a)),a.type===so&&(a.patchFlag===-1&&(a=s[o]=$n(a)),a.el=i.el),a.type===Dt&&!a.el&&(a.el=i.el)}}function qd(e){const t=e.slice(),n=[0];let r,s,o,i,a;const l=e.length;for(r=0;r<l;r++){const d=e[r];if(d!==0){if(s=n[n.length-1],e[s]<d){t[r]=s,n.push(r);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,e[n[a]]<d?o=a+1:i=a;d<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 bc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:bc(t)}function ia(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function _c(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?_c(t.subTree):null}const kc=e=>e.__isSuspense;function Kd(e,t){t&&t.pendingBranch?Le(e)?t.effects.push(...e):t.effects.push(e):Zu(e)}const He=Symbol.for("v-fgt"),so=Symbol.for("v-txt"),Dt=Symbol.for("v-cmt"),wo=Symbol.for("v-stc"),ls=[];let Xt=null;function w(e=!1){ls.push(Xt=e?null:[])}function Gd(){ls.pop(),Xt=ls[ls.length-1]||null}let ps=1;function Vs(e,t=!1){ps+=e,e<0&&Xt&&t&&(Xt.hasOnce=!0)}function Tc(e){return e.dynamicChildren=ps>0?Xt||Mr:null,Gd(),ps>0&&Xt&&Xt.push(e),e}function S(e,t,n,r,s,o){return Tc(p(e,t,n,r,s,o,!0))}function pt(e,t,n,r,s){return Tc(Ce(e,t,n,r,s,!0))}function ms(e){return e?e.__v_isVNode===!0:!1}function pr(e,t){return e.type===t.type&&e.key===t.key}const Sc=({key:e})=>e??null,Os=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?_t(e)||Bt(e)||Ue(e)?{i:$t,r:e,k:t,f:!!n}:e:null);function p(e,t=null,n=null,r=0,s=null,o=e===He?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Sc(t),ref:t&&Os(t),scopeId:Kl,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:$t};return a?(xi(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=_t(n)?8:16),ps>0&&!i&&Xt&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Xt.push(l),l}const Ce=zd;function zd(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===oc)&&(e=Dt),ms(e)){const a=er(e,t,!0);return n&&xi(a,n),ps>0&&!o&&Xt&&(a.shapeFlag&6?Xt[Xt.indexOf(e)]=a:Xt.push(a)),a.patchFlag=-2,a}if(sf(e)&&(e=e.__vccOpts),t){t=Yd(t);let{class:a,style:l}=t;a&&!_t(a)&&(t.class=ht(a)),ct(l)&&(bi(l)&&!Le(l)&&(l=Ct({},l)),t.style=wr(l))}const i=_t(e)?1:kc(e)?128:Jl(e)?64:ct(e)?4:Ue(e)?2:0;return p(e,t,n,r,s,i,o,!0)}function Yd(e){return e?bi(e)||pc(e)?Ct({},e):e:null}function er(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,d=t?xc(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Sc(d),ref:t&&t.ref?n&&o?Le(o)?o.concat(Os(t)):[o,Os(t)]:Os(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==He?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&er(e.ssContent),ssFallback:e.ssFallback&&er(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&hs(u,l.clone(u)),u}function Jd(e=" ",t=0){return Ce(so,null,e,t)}function ue(e="",t=!1){return t?(w(),pt(Dt,null,e)):Ce(Dt,null,e)}function gn(e){return e==null||typeof e=="boolean"?Ce(Dt):Le(e)?Ce(He,null,e.slice()):ms(e)?$n(e):Ce(so,null,String(e))}function $n(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:er(e)}function xi(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Le(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),xi(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!pc(t)?t._ctx=$t:s===3&&$t&&($t.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ue(t)?(t={default:t,_ctx:$t},n=32):(t=String(t),r&64?(n=16,t=[Jd(t)]):n=8);e.children=t,e.shapeFlag|=n}function xc(...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=ht([t.class,r.class]));else if(s==="style")t.style=wr([t.style,r.style]);else if(Gs(s)){const o=t[s],i=r[s];i&&o!==i&&!(Le(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function fn(e,t,n,r=null){cn(e,t,7,[n,r])}const Qd=cc();let Xd=0;function Zd(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||Qd,o={uid:Xd++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Tu(!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:gc(r,s),emitsOptions:uc(r,s),emit:null,emitted:null,propsDefaults:mt,inheritAttrs:r.inheritAttrs,ctx:mt,data:mt,props:mt,attrs:mt,slots:mt,refs:mt,setupState:mt,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=Rd.bind(null,o),e.ce&&e.ce(o),o}let Lt=null;const Ci=()=>Lt||$t;let Ws,Jo;{const e=Js(),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)}};Ws=t("__VUE_INSTANCE_SETTERS__",n=>Lt=n),Jo=t("__VUE_SSR_SETTERS__",n=>gs=n)}const _s=e=>{const t=Lt;return Ws(e),e.scope.on(),()=>{e.scope.off(),Ws(t)}},aa=()=>{Lt&&Lt.scope.off(),Ws(null)};function Cc(e){return e.vnode.shapeFlag&4}let gs=!1;function ef(e,t=!1,n=!1){t&&Jo(t);const{props:r,children:s}=e.vnode,o=Cc(e);jd(e,r,o,t),Fd(e,s,n||t);const i=o?tf(e,t):void 0;return t&&Jo(!1),i}function tf(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,wd);const{setup:r}=n;if(r){Nn();const s=e.setupContext=r.length>1?Ac(e):null,o=_s(e),i=bs(r,e,0,[e.props,s]),a=yl(i);if(jn(),o(),(a||e.sp)&&!Nr(e)&&rc(e),a){if(i.then(aa,aa),t)return i.then(l=>{la(e,l)}).catch(l=>{Zs(l,e,0)});e.asyncDep=i}else la(e,i)}else Ec(e)}function la(e,t,n){Ue(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ct(t)&&(e.setupState=Hl(t)),Ec(e)}function Ec(e,t,n){const r=e.type;e.render||(e.render=r.render||wn);{const s=_s(e);Nn();try{kd(e)}finally{jn(),s()}}}const nf={get(e,t){return jt(e,"get",""),e[t]}};function Ac(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,nf),slots:e.slots,emit:e.emit,expose:t}}function oo(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Hl(Vu(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in as)return as[n](e)},has(t,n){return n in t||n in as}})):e.proxy}function rf(e,t=!0){return Ue(e)?e.displayName||e.name:e.name||t&&e.__name}function sf(e){return Ue(e)&&"__vccOpts"in e}const de=(e,t)=>zu(e,t,gs);function Ei(e,t,n){try{Vs(-1);const r=arguments.length;return r===2?ct(t)&&!Le(t)?ms(t)?Ce(e,null,[t]):Ce(e,t):Ce(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ms(n)&&(n=[n]),Ce(e,t,n))}finally{Vs(1)}}const of="3.5.30";/**
14
+ * @vue/runtime-dom v3.5.30
15
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
+ * @license MIT
17
+ **/let Qo;const ca=typeof window<"u"&&window.trustedTypes;if(ca)try{Qo=ca.createPolicy("vue",{createHTML:e=>e})}catch{}const Ic=Qo?e=>Qo.createHTML(e):e=>e,af="http://www.w3.org/2000/svg",lf="http://www.w3.org/1998/Math/MathML",Rn=typeof document<"u"?document:null,ua=Rn&&Rn.createElement("template"),cf={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"?Rn.createElementNS(af,e):t==="mathml"?Rn.createElementNS(lf,e):n?Rn.createElement(e,{is:n}):Rn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>Rn.createTextNode(e),createComment:e=>Rn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Rn.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{ua.innerHTML=Ic(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=ua.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]}},zn="transition",Jr="animation",vs=Symbol("_vtc"),Rc={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},uf=Ct({},Xl,Rc),df=e=>(e.displayName="Transition",e.props=uf,e),$c=df((e,{slots:t})=>Ei(id,ff(e),t)),ur=(e,t=[])=>{Le(e)?e.forEach(n=>n(...t)):e&&e(...t)},da=e=>e?Le(e)?e.some(t=>t.length>1):e.length>1:!1;function ff(e){const t={};for(const oe in e)oe in Rc||(t[oe]=e[oe]);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:d=i,appearToClass:u=a,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:m=`${n}-leave-active`,leaveToClass:b=`${n}-leave-to`}=e,N=hf(s),I=N&&N[0],H=N&&N[1],{onBeforeEnter:J,onEnter:O,onEnterCancelled:U,onLeave:L,onLeaveCancelled:ce,onBeforeAppear:fe=J,onAppear:pe=O,onAppearCancelled:Se=U}=t,ae=(oe,Be,Fe,Ke)=>{oe._enterCancelled=Ke,dr(oe,Be?u:a),dr(oe,Be?d:i),Fe&&Fe()},re=(oe,Be)=>{oe._isLeaving=!1,dr(oe,f),dr(oe,b),dr(oe,m),Be&&Be()},ye=oe=>(Be,Fe)=>{const Ke=oe?pe:O,Ie=()=>ae(Be,oe,Fe);ur(Ke,[Be,Ie]),fa(()=>{dr(Be,oe?l:o),An(Be,oe?u:a),da(Ke)||ha(Be,r,I,Ie)})};return Ct(t,{onBeforeEnter(oe){ur(J,[oe]),An(oe,o),An(oe,i)},onBeforeAppear(oe){ur(fe,[oe]),An(oe,l),An(oe,d)},onEnter:ye(!1),onAppear:ye(!0),onLeave(oe,Be){oe._isLeaving=!0;const Fe=()=>re(oe,Be);An(oe,f),oe._enterCancelled?(An(oe,m),ga(oe)):(ga(oe),An(oe,m)),fa(()=>{oe._isLeaving&&(dr(oe,f),An(oe,b),da(L)||ha(oe,r,H,Fe))}),ur(L,[oe,Fe])},onEnterCancelled(oe){ae(oe,!1,void 0,!0),ur(U,[oe])},onAppearCancelled(oe){ae(oe,!0,void 0,!0),ur(Se,[oe])},onLeaveCancelled(oe){re(oe),ur(ce,[oe])}})}function hf(e){if(e==null)return null;if(ct(e))return[bo(e.enter),bo(e.leave)];{const t=bo(e);return[t,t]}}function bo(e){return mu(e)}function An(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[vs]||(e[vs]=new Set)).add(t)}function dr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[vs];n&&(n.delete(t),n.size||(e[vs]=void 0))}function fa(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let pf=0;function ha(e,t,n,r){const s=e._endId=++pf,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=mf(e,t);if(!i)return r();const d=i+"end";let u=0;const f=()=>{e.removeEventListener(d,m),o()},m=b=>{b.target===e&&++u>=l&&f()};setTimeout(()=>{u<l&&f()},a+1),e.addEventListener(d,m)}function mf(e,t){const n=window.getComputedStyle(e),r=N=>(n[N]||"").split(", "),s=r(`${zn}Delay`),o=r(`${zn}Duration`),i=pa(s,o),a=r(`${Jr}Delay`),l=r(`${Jr}Duration`),d=pa(a,l);let u=null,f=0,m=0;t===zn?i>0&&(u=zn,f=i,m=o.length):t===Jr?d>0&&(u=Jr,f=d,m=l.length):(f=Math.max(i,d),u=f>0?i>d?zn:Jr:null,m=u?u===zn?o.length:l.length:0);const b=u===zn&&/\b(?:transform|all)(?:,|$)/.test(r(`${zn}Property`).toString());return{type:u,timeout:f,propCount:m,hasTransform:b}}function pa(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>ma(n)+ma(e[r])))}function ma(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function ga(e){return(e?e.ownerDocument:document).body.offsetHeight}function gf(e,t,n){const r=e[vs];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const va=Symbol("_vod"),vf=Symbol("_vsh"),yf=Symbol(""),wf=/(?:^|;)\s*display\s*:/;function bf(e,t,n){const r=e.style,s=_t(n);let o=!1;if(n&&!s){if(t)if(_t(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Ns(r,a,"")}else for(const i in t)n[i]==null&&Ns(r,i,"");for(const i in n)i==="display"&&(o=!0),Ns(r,i,n[i])}else if(s){if(t!==n){const i=r[yf];i&&(n+=";"+i),r.cssText=n,o=wf.test(n)}}else t&&e.removeAttribute("style");va in e&&(e[va]=o?r.display:"",e[vf]&&(r.display="none"))}const ya=/\s*!important$/;function Ns(e,t,n){if(Le(n))n.forEach(r=>Ns(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=_f(e,t);ya.test(n)?e.setProperty(tr(r),n.replace(ya,""),"important"):e[r]=n}}const wa=["Webkit","Moz","ms"],_o={};function _f(e,t){const n=_o[t];if(n)return n;let r=Wt(t);if(r!=="filter"&&r in e)return _o[t]=r;r=Ys(r);for(let s=0;s<wa.length;s++){const o=wa[s]+r;if(o in e)return _o[t]=o}return t}const ba="http://www.w3.org/1999/xlink";function _a(e,t,n,r,s,o=_u(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ba,t.slice(6,t.length)):e.setAttributeNS(ba,t,n):n==null||o&&!kl(n)?e.removeAttribute(t):e.setAttribute(t,o?"":an(n)?String(n):n)}function ka(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Ic(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=kl(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 Rr(e,t,n,r){e.addEventListener(t,n,r)}function kf(e,t,n,r){e.removeEventListener(t,n,r)}const Ta=Symbol("_vei");function Tf(e,t,n,r,s=null){const o=e[Ta]||(e[Ta]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=Sf(t);if(r){const d=o[t]=Ef(r,s);Rr(e,a,d,l)}else i&&(kf(e,a,i,l),o[t]=void 0)}}const Sa=/(?:Once|Passive|Capture)$/;function Sf(e){let t;if(Sa.test(e)){t={};let r;for(;r=e.match(Sa);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):tr(e.slice(2)),t]}let ko=0;const xf=Promise.resolve(),Cf=()=>ko||(xf.then(()=>ko=0),ko=Date.now());function Ef(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;cn(Af(r,n.value),t,5,[r])};return n.value=e,n.attached=Cf(),n}function Af(e,t){if(Le(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 xa=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,If=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?gf(e,r,i):t==="style"?bf(e,n,r):Gs(t)?ci(t)||Tf(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Rf(e,t,r,i))?(ka(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&_a(e,t,r,i,o,t!=="value")):e._isVueCE&&($f(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!_t(r)))?ka(e,Wt(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),_a(e,t,r,i))};function Rf(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&xa(t)&&Ue(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 xa(t)&&_t(n)?!1:t in e}function $f(e,t){const n=e._def.props;if(!n)return!1;const r=Wt(t);return Array.isArray(n)?n.some(s=>Wt(s)===r):Object.keys(n).some(s=>Wt(s)===r)}const Ca=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Le(t)?n=>$s(t,n):t};function Mf(e){e.target.composing=!0}function Ea(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const To=Symbol("_assign");function Aa(e,t,n){return t&&(e=e.trim()),n&&(e=fi(e)),e}const Bn={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[To]=Ca(s);const o=r||s.props&&s.props.type==="number";Rr(e,t?"change":"input",i=>{i.target.composing||e[To](Aa(e.value,n,o))}),(n||o)&&Rr(e,"change",()=>{e.value=Aa(e.value,n,o)}),t||(Rr(e,"compositionstart",Mf),Rr(e,"compositionend",Ea),Rr(e,"change",Ea))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[To]=Ca(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?fi(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))}},Pf=["ctrl","shift","alt","meta"],Of={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)=>Pf.some(n=>e[`${n}Key`]&&!t.includes(n))},Xe=(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=Of[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},Nf={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Vt=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=tr(s.key);if(t.some(i=>i===o||Nf[i]===o))return e(s)}))},jf=Ct({patchProp:If},cf);let Ia;function Df(){return Ia||(Ia=Ud(jf))}const Lf=((...e)=>{const t=Df().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Ff(r);if(!s)return;const o=t._component;!Ue(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Bf(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Bf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ff(e){return _t(e)?document.querySelector(e):e}/*!
18
+ * vue-router v4.6.4
19
+ * (c) 2025 Eduardo San Martin Morote
20
+ * @license MIT
21
+ */const $r=typeof document<"u";function Mc(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Hf(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Mc(e.default)}const at=Object.assign;function So(e,t){const n={};for(const r in t){const s=t[r];n[r]=un(s)?s.map(e):e(s)}return n}const cs=()=>{},un=Array.isArray;function Ra(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Pc=/#/g,Uf=/&/g,Vf=/\//g,Wf=/=/g,qf=/\?/g,Oc=/\+/g,Kf=/%5B/g,Gf=/%5D/g,Nc=/%5E/g,zf=/%60/g,jc=/%7B/g,Yf=/%7C/g,Dc=/%7D/g,Jf=/%20/g;function Ai(e){return e==null?"":encodeURI(""+e).replace(Yf,"|").replace(Kf,"[").replace(Gf,"]")}function Qf(e){return Ai(e).replace(jc,"{").replace(Dc,"}").replace(Nc,"^")}function Xo(e){return Ai(e).replace(Oc,"%2B").replace(Jf,"+").replace(Pc,"%23").replace(Uf,"%26").replace(zf,"`").replace(jc,"{").replace(Dc,"}").replace(Nc,"^")}function Xf(e){return Xo(e).replace(Wf,"%3D")}function Zf(e){return Ai(e).replace(Pc,"%23").replace(qf,"%3F")}function eh(e){return Zf(e).replace(Vf,"%2F")}function ys(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const th=/\/$/,nh=e=>e.replace(th,"");function xo(e,t,n="/"){let r,s={},o="",i="";const a=t.indexOf("#");let l=t.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(r=t.slice(0,l),o=t.slice(l,a>0?a:t.length),s=e(o.slice(1))),a>=0&&(r=r||t.slice(0,a),i=t.slice(a,t.length)),r=ih(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:ys(i)}}function rh(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function $a(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function sh(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&Lr(t.matched[r],n.matched[s])&&Lc(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Lr(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Lc(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!oh(e[n],t[n]))return!1;return!0}function oh(e,t){return un(e)?Ma(e,t):un(t)?Ma(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Ma(e,t){return un(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function ih(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let o=n.length-1,i,a;for(i=0;i<r.length;i++)if(a=r[i],a!==".")if(a==="..")o>1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(i).join("/")}const Yn={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Zo=(function(e){return e.pop="pop",e.push="push",e})({}),Co=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function ah(e){if(!e)if($r){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),nh(e)}const lh=/^[^#]+#/;function ch(e,t){return e.replace(lh,"#")+t}function uh(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const io=()=>({left:window.scrollX,top:window.scrollY});function dh(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;t=uh(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Pa(e,t){return(history.state?history.state.position-t:-1)+e}const ei=new Map;function fh(e,t){ei.set(e,t)}function hh(e){const t=ei.get(e);return ei.delete(e),t}function ph(e){return typeof e=="string"||e&&typeof e=="object"}function Bc(e){return typeof e=="string"||typeof e=="symbol"}let kt=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const Fc=Symbol("");kt.MATCHER_NOT_FOUND+"",kt.NAVIGATION_GUARD_REDIRECT+"",kt.NAVIGATION_ABORTED+"",kt.NAVIGATION_CANCELLED+"",kt.NAVIGATION_DUPLICATED+"";function Br(e,t){return at(new Error,{type:e,[Fc]:!0},t)}function In(e,t){return e instanceof Error&&Fc in e&&(t==null||!!(e.type&t))}const mh=["params","query","hash"];function gh(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of mh)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function vh(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<n.length;++r){const s=n[r].replace(Oc," "),o=s.indexOf("="),i=ys(o<0?s:s.slice(0,o)),a=o<0?null:ys(s.slice(o+1));if(i in t){let l=t[i];un(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function Oa(e){let t="";for(let n in e){const r=e[n];if(n=Xf(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(un(r)?r.map(s=>s&&Xo(s)):[r&&Xo(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function yh(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=un(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const wh=Symbol(""),Na=Symbol(""),ao=Symbol(""),Ii=Symbol(""),ti=Symbol("");function Qr(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Xn(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const d=m=>{m===!1?l(Br(kt.NAVIGATION_ABORTED,{from:n,to:t})):m instanceof Error?l(m):ph(m)?l(Br(kt.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(i&&r.enterCallbacks[s]===i&&typeof m=="function"&&i.push(m),a())},u=o(()=>e.call(r&&r.instances[s],t,n,d));let f=Promise.resolve(u);e.length<3&&(f=f.then(d)),f.catch(m=>l(m))})}function Eo(e,t,n,r,s=o=>o()){const o=[];for(const i of e)for(const a in i.components){let l=i.components[a];if(!(t!=="beforeRouteEnter"&&!i.instances[a]))if(Mc(l)){const d=(l.__vccOpts||l)[t];d&&o.push(Xn(d,n,r,i,a,s))}else{let d=l();o.push(()=>d.then(u=>{if(!u)throw new Error(`Couldn't resolve component "${a}" at "${i.path}"`);const f=Hf(u)?u.default:u;i.mods[a]=u,i.components[a]=f;const m=(f.__vccOpts||f)[t];return m&&Xn(m,n,r,i,a,s)()}))}}return o}function bh(e,t){const n=[],r=[],s=[],o=Math.max(t.matched.length,e.matched.length);for(let i=0;i<o;i++){const a=t.matched[i];a&&(e.matched.find(d=>Lr(d,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(d=>Lr(d,l))||s.push(l))}return[n,r,s]}/*!
22
+ * vue-router v4.6.4
23
+ * (c) 2025 Eduardo San Martin Morote
24
+ * @license MIT
25
+ */let _h=()=>location.protocol+"//"+location.host;function Hc(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),$a(a,"")}return $a(n,e)+r+s}function kh(e,t,n,r){let s=[],o=[],i=null;const a=({state:m})=>{const b=Hc(e,location),N=n.value,I=t.value;let H=0;if(m){if(n.value=b,t.value=m,i&&i===N){i=null;return}H=I?m.position-I.position:0}else r(b);s.forEach(J=>{J(n.value,N,{delta:H,type:Zo.pop,direction:H?H>0?Co.forward:Co.back:Co.unknown})})};function l(){i=n.value}function d(m){s.push(m);const b=()=>{const N=s.indexOf(m);N>-1&&s.splice(N,1)};return o.push(b),b}function u(){if(document.visibilityState==="hidden"){const{history:m}=window;if(!m.state)return;m.replaceState(at({},m.state,{scroll:io()}),"")}}function f(){for(const m of o)m();o=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",u),document.removeEventListener("visibilitychange",u)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",u),document.addEventListener("visibilitychange",u),{pauseListeners:l,listen:d,destroy:f}}function ja(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?io():null}}function Th(e){const{history:t,location:n}=window,r={value:Hc(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,d,u){const f=e.indexOf("#"),m=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:_h()+e+l;try{t[u?"replaceState":"pushState"](d,"",m),s.value=d}catch(b){console.error(b),n[u?"replace":"assign"](m)}}function i(l,d){o(l,at({},t.state,ja(s.value.back,l,s.value.forward,!0),d,{position:s.value.position}),!0),r.value=l}function a(l,d){const u=at({},s.value,t.state,{forward:l,scroll:io()});o(u.current,u,!0),o(l,at({},ja(r.value,l,null),{position:u.position+1},d),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function Sh(e){e=ah(e);const t=Th(e),n=kh(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=at({location:"",base:e,go:r,createHref:ch.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 xh(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),Sh(e)}let gr=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var xt=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e})(xt||{});const Ch={type:gr.Static,value:""},Eh=/[a-zA-Z0-9_]/;function Ah(e){if(!e)return[[]];if(e==="/")return[[Ch]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(b){throw new Error(`ERR (${n})/"${d}": ${b}`)}let n=xt.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,d="",u="";function f(){d&&(n===xt.Static?o.push({type:gr.Static,value:d}):n===xt.Param||n===xt.ParamRegExp||n===xt.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),o.push({type:gr.Param,value:d,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),d="")}function m(){d+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==xt.ParamRegExp){r=n,n=xt.EscapeNext;continue}switch(n){case xt.Static:l==="/"?(d&&f(),i()):l===":"?(f(),n=xt.Param):m();break;case xt.EscapeNext:m(),n=r;break;case xt.Param:l==="("?n=xt.ParamRegExp:Eh.test(l)?m():(f(),n=xt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case xt.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=xt.ParamRegExpEnd:u+=l;break;case xt.ParamRegExpEnd:f(),n=xt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===xt.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),f(),i(),s}const Da="[^/]+?",Ih={sensitive:!1,strict:!1,start:!0,end:!0};var Ht=(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})(Ht||{});const Rh=/[.+*?^${}()[\]/\\]/g;function $h(e,t){const n=at({},Ih,t),r=[];let s=n.start?"^":"";const o=[];for(const d of e){const u=d.length?[]:[Ht.Root];n.strict&&!d.length&&(s+="/");for(let f=0;f<d.length;f++){const m=d[f];let b=Ht.Segment+(n.sensitive?Ht.BonusCaseSensitive:0);if(m.type===gr.Static)f||(s+="/"),s+=m.value.replace(Rh,"\\$&"),b+=Ht.Static;else if(m.type===gr.Param){const{value:N,repeatable:I,optional:H,regexp:J}=m;o.push({name:N,repeatable:I,optional:H});const O=J||Da;if(O!==Da){b+=Ht.BonusCustomRegExp;try{`${O}`}catch(L){throw new Error(`Invalid custom RegExp for param "${N}" (${O}): `+L.message)}}let U=I?`((?:${O})(?:/(?:${O}))*)`:`(${O})`;f||(U=H&&d.length<2?`(?:/${U})`:"/"+U),H&&(U+="?"),s+=U,b+=Ht.Dynamic,H&&(b+=Ht.BonusOptional),I&&(b+=Ht.BonusRepeatable),O===".*"&&(b+=Ht.BonusWildcard)}u.push(b)}r.push(u)}if(n.strict&&n.end){const d=r.length-1;r[d][r[d].length-1]+=Ht.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const i=new RegExp(s,n.sensitive?"":"i");function a(d){const u=d.match(i),f={};if(!u)return null;for(let m=1;m<u.length;m++){const b=u[m]||"",N=o[m-1];f[N.name]=b&&N.repeatable?b.split("/"):b}return f}function l(d){let u="",f=!1;for(const m of e){(!f||!u.endsWith("/"))&&(u+="/"),f=!1;for(const b of m)if(b.type===gr.Static)u+=b.value;else if(b.type===gr.Param){const{value:N,repeatable:I,optional:H}=b,J=N in d?d[N]:"";if(un(J)&&!I)throw new Error(`Provided param "${N}" is an array but it is not repeatable (* or + modifiers)`);const O=un(J)?J.join("/"):J;if(!O)if(H)m.length<2&&(u.endsWith("/")?u=u.slice(0,-1):f=!0);else throw new Error(`Missing required param "${N}"`);u+=O}}return u||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function Mh(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]===Ht.Static+Ht.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Ht.Static+Ht.Segment?1:-1:0}function Uc(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=Mh(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(La(r))return 1;if(La(s))return-1}return s.length-r.length}function La(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Ph={strict:!1,end:!0,sensitive:!1};function Oh(e,t,n){const r=$h(Ah(e.path),n),s=at(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function Nh(e,t){const n=[],r=new Map;t=Ra(Ph,t);function s(f){return r.get(f)}function o(f,m,b){const N=!b,I=Fa(f);I.aliasOf=b&&b.record;const H=Ra(t,f),J=[I];if("alias"in f){const L=typeof f.alias=="string"?[f.alias]:f.alias;for(const ce of L)J.push(Fa(at({},I,{components:b?b.record.components:I.components,path:ce,aliasOf:b?b.record:I})))}let O,U;for(const L of J){const{path:ce}=L;if(m&&ce[0]!=="/"){const fe=m.record.path,pe=fe[fe.length-1]==="/"?"":"/";L.path=m.record.path+(ce&&pe+ce)}if(O=Oh(L,m,H),b?b.alias.push(O):(U=U||O,U!==O&&U.alias.push(O),N&&f.name&&!Ha(O)&&i(f.name)),Vc(O)&&l(O),I.children){const fe=I.children;for(let pe=0;pe<fe.length;pe++)o(fe[pe],O,b&&b.children[pe])}b=b||O}return U?()=>{i(U)}:cs}function i(f){if(Bc(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=Lh(f,n);n.splice(m,0,f),f.record.name&&!Ha(f)&&r.set(f.record.name,f)}function d(f,m){let b,N={},I,H;if("name"in f&&f.name){if(b=r.get(f.name),!b)throw Br(kt.MATCHER_NOT_FOUND,{location:f});H=b.record.name,N=at(Ba(m.params,b.keys.filter(U=>!U.optional).concat(b.parent?b.parent.keys.filter(U=>U.optional):[]).map(U=>U.name)),f.params&&Ba(f.params,b.keys.map(U=>U.name))),I=b.stringify(N)}else if(f.path!=null)I=f.path,b=n.find(U=>U.re.test(I)),b&&(N=b.parse(I),H=b.record.name);else{if(b=m.name?r.get(m.name):n.find(U=>U.re.test(m.path)),!b)throw Br(kt.MATCHER_NOT_FOUND,{location:f,currentLocation:m});H=b.record.name,N=at({},m.params,f.params),I=b.stringify(N)}const J=[];let O=b;for(;O;)J.unshift(O.record),O=O.parent;return{name:H,path:I,params:N,matched:J,meta:Dh(J)}}e.forEach(f=>o(f));function u(){n.length=0,r.clear()}return{addRoute:o,resolve:d,removeRoute:i,clearRoutes:u,getRoutes:a,getRecordMatcher:s}}function Ba(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Fa(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:jh(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 jh(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 Ha(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Dh(e){return e.reduce((t,n)=>at(t,n.meta),{})}function Lh(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;Uc(e,t[o])<0?r=o:n=o+1}const s=Bh(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Bh(e){let t=e;for(;t=t.parent;)if(Vc(t)&&Uc(e,t)===0)return t}function Vc({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ua(e){const t=on(ao),n=on(Ii),r=de(()=>{const l=je(e.to);return t.resolve(l)}),s=de(()=>{const{matched:l}=r.value,{length:d}=l,u=l[d-1],f=n.matched;if(!u||!f.length)return-1;const m=f.findIndex(Lr.bind(null,u));if(m>-1)return m;const b=Va(l[d-2]);return d>1&&Va(u)===b&&f[f.length-1].path!==b?f.findIndex(Lr.bind(null,l[d-2])):m}),o=de(()=>s.value>-1&&Wh(n.params,r.value.params)),i=de(()=>s.value>-1&&s.value===n.matched.length-1&&Lc(n.params,r.value.params));function a(l={}){if(Vh(l)){const d=t[je(e.replace)?"replace":"push"](je(e.to)).catch(cs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:r,href:de(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function Fh(e){return e.length===1?e[0]:e}const Hh=It({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:Ua,setup(e,{slots:t}){const n=Xs(Ua(e)),{options:r}=on(ao),s=de(()=>({[Wa(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Wa(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Fh(t.default(n));return e.custom?o:Ei("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},o)}}}),Uh=Hh;function Vh(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 Wh(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(!un(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function Va(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Wa=(e,t,n)=>e??t??n,qh=It({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=on(ti),s=de(()=>e.route||r.value),o=on(Na,0),i=de(()=>{let d=je(o);const{matched:u}=s.value;let f;for(;(f=u[d])&&!f.components;)d++;return d}),a=de(()=>s.value.matched[i.value]);Ms(Na,de(()=>i.value+1)),Ms(wh,a),Ms(ti,s);const l=P();return ft(()=>[l.value,a.value,e.name],([d,u,f],[m,b,N])=>{u&&(u.instances[f]=d,b&&b!==u&&d&&d===m&&(u.leaveGuards.size||(u.leaveGuards=b.leaveGuards),u.updateGuards.size||(u.updateGuards=b.updateGuards))),d&&u&&(!b||!Lr(u,b)||!m)&&(u.enterCallbacks[f]||[]).forEach(I=>I(d))},{flush:"post"}),()=>{const d=s.value,u=e.name,f=a.value,m=f&&f.components[u];if(!m)return qa(n.default,{Component:m,route:d});const b=f.props[u],N=b?b===!0?d.params:typeof b=="function"?b(d):b:null,H=Ei(m,at({},N,t,{onVnodeUnmounted:J=>{J.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return qa(n.default,{Component:H,route:d})||H}}});function qa(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Kh=qh;function Gh(e){const t=Nh(e.routes,e),n=e.parseQuery||vh,r=e.stringifyQuery||Oa,s=e.history,o=Qr(),i=Qr(),a=Qr(),l=Wu(Yn);let d=Yn;$r&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=So.bind(null,R=>""+R),f=So.bind(null,eh),m=So.bind(null,ys);function b(R,ee){let Q,me;return Bc(R)?(Q=t.getRecordMatcher(R),me=ee):me=R,t.addRoute(me,Q)}function N(R){const ee=t.getRecordMatcher(R);ee&&t.removeRoute(ee)}function I(){return t.getRoutes().map(R=>R.record)}function H(R){return!!t.getRecordMatcher(R)}function J(R,ee){if(ee=at({},ee||l.value),typeof R=="string"){const x=xo(n,R,ee.path),D=t.resolve({path:x.path},ee),F=s.createHref(x.fullPath);return at(x,D,{params:m(D.params),hash:ys(x.hash),redirectedFrom:void 0,href:F})}let Q;if(R.path!=null)Q=at({},R,{path:xo(n,R.path,ee.path).path});else{const x=at({},R.params);for(const D in x)x[D]==null&&delete x[D];Q=at({},R,{params:f(x)}),ee.params=f(ee.params)}const me=t.resolve(Q,ee),Pe=R.hash||"";me.params=u(m(me.params));const g=rh(r,at({},R,{hash:Qf(Pe),path:me.path})),y=s.createHref(g);return at({fullPath:g,hash:Pe,query:r===Oa?yh(R.query):R.query||{}},me,{redirectedFrom:void 0,href:y})}function O(R){return typeof R=="string"?xo(n,R,l.value.path):at({},R)}function U(R,ee){if(d!==R)return Br(kt.NAVIGATION_CANCELLED,{from:ee,to:R})}function L(R){return pe(R)}function ce(R){return L(at(O(R),{replace:!0}))}function fe(R,ee){const Q=R.matched[R.matched.length-1];if(Q&&Q.redirect){const{redirect:me}=Q;let Pe=typeof me=="function"?me(R,ee):me;return typeof Pe=="string"&&(Pe=Pe.includes("?")||Pe.includes("#")?Pe=O(Pe):{path:Pe},Pe.params={}),at({query:R.query,hash:R.hash,params:Pe.path!=null?{}:R.params},Pe)}}function pe(R,ee){const Q=d=J(R),me=l.value,Pe=R.state,g=R.force,y=R.replace===!0,x=fe(Q,me);if(x)return pe(at(O(x),{state:typeof x=="object"?at({},Pe,x.state):Pe,force:g,replace:y}),ee||Q);const D=Q;D.redirectedFrom=ee;let F;return!g&&sh(r,me,Q)&&(F=Br(kt.NAVIGATION_DUPLICATED,{to:D,from:me}),ot(me,me,!0,!1)),(F?Promise.resolve(F):re(D,me)).catch(j=>In(j)?In(j,kt.NAVIGATION_GUARD_REDIRECT)?j:nt(j):Me(j,D,me)).then(j=>{if(j){if(In(j,kt.NAVIGATION_GUARD_REDIRECT))return pe(at({replace:y},O(j.to),{state:typeof j.to=="object"?at({},Pe,j.to.state):Pe,force:g}),ee||D)}else j=oe(D,me,!0,y,Pe);return ye(D,me,j),j})}function Se(R,ee){const Q=U(R,ee);return Q?Promise.reject(Q):Promise.resolve()}function ae(R){const ee=ge.values().next().value;return ee&&typeof ee.runWithContext=="function"?ee.runWithContext(R):R()}function re(R,ee){let Q;const[me,Pe,g]=bh(R,ee);Q=Eo(me.reverse(),"beforeRouteLeave",R,ee);for(const x of me)x.leaveGuards.forEach(D=>{Q.push(Xn(D,R,ee))});const y=Se.bind(null,R,ee);return Q.push(y),Te(Q).then(()=>{Q=[];for(const x of o.list())Q.push(Xn(x,R,ee));return Q.push(y),Te(Q)}).then(()=>{Q=Eo(Pe,"beforeRouteUpdate",R,ee);for(const x of Pe)x.updateGuards.forEach(D=>{Q.push(Xn(D,R,ee))});return Q.push(y),Te(Q)}).then(()=>{Q=[];for(const x of g)if(x.beforeEnter)if(un(x.beforeEnter))for(const D of x.beforeEnter)Q.push(Xn(D,R,ee));else Q.push(Xn(x.beforeEnter,R,ee));return Q.push(y),Te(Q)}).then(()=>(R.matched.forEach(x=>x.enterCallbacks={}),Q=Eo(g,"beforeRouteEnter",R,ee,ae),Q.push(y),Te(Q))).then(()=>{Q=[];for(const x of i.list())Q.push(Xn(x,R,ee));return Q.push(y),Te(Q)}).catch(x=>In(x,kt.NAVIGATION_CANCELLED)?x:Promise.reject(x))}function ye(R,ee,Q){a.list().forEach(me=>ae(()=>me(R,ee,Q)))}function oe(R,ee,Q,me,Pe){const g=U(R,ee);if(g)return g;const y=ee===Yn,x=$r?history.state:{};Q&&(me||y?s.replace(R.fullPath,at({scroll:y&&x&&x.scroll},Pe)):s.push(R.fullPath,Pe)),l.value=R,ot(R,ee,Q,y),nt()}let Be;function Fe(){Be||(Be=s.listen((R,ee,Q)=>{if(!Ae.listening)return;const me=J(R),Pe=fe(me,Ae.currentRoute.value);if(Pe){pe(at(Pe,{replace:!0,force:!0}),me).catch(cs);return}d=me;const g=l.value;$r&&fh(Pa(g.fullPath,Q.delta),io()),re(me,g).catch(y=>In(y,kt.NAVIGATION_ABORTED|kt.NAVIGATION_CANCELLED)?y:In(y,kt.NAVIGATION_GUARD_REDIRECT)?(pe(at(O(y.to),{force:!0}),me).then(x=>{In(x,kt.NAVIGATION_ABORTED|kt.NAVIGATION_DUPLICATED)&&!Q.delta&&Q.type===Zo.pop&&s.go(-1,!1)}).catch(cs),Promise.reject()):(Q.delta&&s.go(-Q.delta,!1),Me(y,me,g))).then(y=>{y=y||oe(me,g,!1),y&&(Q.delta&&!In(y,kt.NAVIGATION_CANCELLED)?s.go(-Q.delta,!1):Q.type===Zo.pop&&In(y,kt.NAVIGATION_ABORTED|kt.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),ye(me,g,y)}).catch(cs)}))}let Ke=Qr(),Ie=Qr(),ke;function Me(R,ee,Q){nt(R);const me=Ie.list();return me.length?me.forEach(Pe=>Pe(R,ee,Q)):console.error(R),Promise.reject(R)}function vt(){return ke&&l.value!==Yn?Promise.resolve():new Promise((R,ee)=>{Ke.add([R,ee])})}function nt(R){return ke||(ke=!R,Fe(),Ke.list().forEach(([ee,Q])=>R?Q(R):ee()),Ke.reset()),R}function ot(R,ee,Q,me){const{scrollBehavior:Pe}=e;if(!$r||!Pe)return Promise.resolve();const g=!Q&&hh(Pa(R.fullPath,0))||(me||!Q)&&history.state&&history.state.scroll||null;return Zt().then(()=>Pe(R,ee,g)).then(y=>y&&dh(y)).catch(y=>Me(y,R,ee))}const rt=R=>s.go(R);let Ze;const ge=new Set,Ae={currentRoute:l,listening:!0,addRoute:b,removeRoute:N,clearRoutes:t.clearRoutes,hasRoute:H,getRoutes:I,resolve:J,options:e,push:L,replace:ce,go:rt,back:()=>rt(-1),forward:()=>rt(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Ie.add,isReady:vt,install(R){R.component("RouterLink",Uh),R.component("RouterView",Kh),R.config.globalProperties.$router=Ae,Object.defineProperty(R.config.globalProperties,"$route",{enumerable:!0,get:()=>je(l)}),$r&&!Ze&&l.value===Yn&&(Ze=!0,L(s.location).catch(me=>{}));const ee={};for(const me in Yn)Object.defineProperty(ee,me,{get:()=>l.value[me],enumerable:!0});R.provide(ao,Ae),R.provide(Ii,Bl(ee)),R.provide(ti,l);const Q=R.unmount;ge.add(R),R.unmount=function(){ge.delete(R),ge.size<1&&(d=Yn,Be&&Be(),Be=null,l.value=Yn,Ze=!1,ke=!1),Q()}}};function Te(R){return R.reduce((ee,Q)=>ee.then(()=>ae(Q)),Promise.resolve())}return Ae}function zh(){return on(ao)}function Yh(e){return on(Ii)}const Ka=768;function Wc(){const e=P(typeof window<"u"?window.innerWidth<Ka:!1);let t=null;function n(r){e.value=r.matches}return Hn(()=>{t=window.matchMedia(`(max-width: ${Ka-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),no(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Jh={key:0,class:"desktop-sidebar"},Qh={class:"desktop-main"},Ga="codex-web-local.sidebar-width.v1",Xh=260,Zh=620,za=320,ep=It({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Wc();function r(d){return Math.min(Zh,Math.max(Xh,d))}function s(){if(typeof window>"u")return za;const d=window.localStorage.getItem(Ga),u=Number(d);return Number.isFinite(u)?r(u):za}const o=P(s()),i=de(()=>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(d){typeof window>"u"||window.localStorage.setItem(Ga,String(d))}function l(d){d.preventDefault();const u=d.clientX,f=o.value,m=N=>{const I=N.clientX-u;o.value=r(f+I)},b=()=>{a(o.value),window.removeEventListener("mousemove",m),window.removeEventListener("mouseup",b)};window.addEventListener("mousemove",m),window.addEventListener("mouseup",b)}return(d,u)=>(w(),S("div",{class:ht(["desktop-layout",{"is-mobile":je(n)}]),style:wr(i.value)},[je(n)?(w(),pt(Fs,{key:0,to:"body"},[Ce($c,{name:"drawer"},{default:dt(()=>[e.isSidebarCollapsed?ue("",!0):(w(),S("div",{key:0,class:"mobile-drawer-backdrop",onClick:u[1]||(u[1]=f=>d.$emit("close-sidebar"))},[p("aside",{class:"mobile-drawer",onClick:u[0]||(u[0]=Xe(()=>{},["stop"]))},[yn(d.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):ue("",!0),je(n)?ue("",!0):(w(),S(He,{key:1},[e.isSidebarCollapsed?ue("",!0):(w(),S("aside",Jh,[yn(d.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?ue("",!0):(w(),S("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),p("section",Qh,[yn(d.$slots,"content",{},void 0)])],6))}}),et=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},tp=et(ep,[["__scopeId","data-v-df29c633"]]),np={},rp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function sp(e,t){return w(),S("svg",rp,[...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 lo=et(np,[["render",sp]]),op={},ip={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ap(e,t){return w(),S("svg",ip,[...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 qc=et(op,[["render",ap]]),lp={},cp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function up(e,t){return w(),S("svg",cp,[...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 Xr=et(lp,[["render",up]]),dp={},fp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function hp(e,t){return w(),S("svg",fp,[...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 qs=et(dp,[["render",hp]]),pp={},mp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function gp(e,t){return w(),S("svg",mp,[...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 Kc=et(pp,[["render",gp]]),vp={},yp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function wp(e,t){return w(),S("svg",yp,[...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 bp=et(vp,[["render",wp]]),_p={},kp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Tp(e,t){return w(),S("svg",kp,[...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 js=et(_p,[["render",Tp]]),Sp={},xp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Cp(e,t){return w(),S("svg",xp,[...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 Ao=et(Sp,[["render",Cp]]),Ep={key:0,class:"sidebar-menu-row-left"},Ap={class:"sidebar-menu-row-main"},Ip={key:1,class:"sidebar-menu-row-right"},Rp={key:0,class:"sidebar-menu-row-right-default"},$p={key:1,class:"sidebar-menu-row-right-hover"},Mp=It({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=bd(),r=de(()=>!!n.left),s=de(()=>!!n.right),o=de(()=>!!n["right-hover"]),i=de(()=>s.value||o.value);return(a,l)=>(w(),pt(qo(t.as),xc({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:dt(()=>[r.value?(w(),S("span",Ep,[yn(a.$slots,"left",{},void 0,!0)])):ue("",!0),p("span",Ap,[yn(a.$slots,"default",{},void 0,!0)]),i.value?(w(),S("span",Ip,[s.value?(w(),S("span",Rp,[yn(a.$slots,"right",{},void 0,!0)])):ue("",!0),o.value?(w(),S("span",$p,[yn(a.$slots,"right-hover",{},void 0,!0)])):ue("",!0)])):ue("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),fr=et(Mp,[["__scopeId","data-v-daeca4df"]]),Pp={class:"thread-tree-root"},Op={key:0,class:"pinned-section"},Np={class:"thread-list"},jp={class:"thread-left-stack"},Dp=["data-state"],Lp=["onClick"],Bp=["onClick"],Fp={class:"thread-row-title-wrap"},Hp={class:"thread-row-title"},Up={class:"thread-row-time"},Vp=["onClick"],Wp=["onClick"],qp=["onClick"],Kp=["aria-expanded"],Gp=["data-active"],zp={key:0},Yp=["data-active"],Jp={key:0},Qp={key:1,class:"thread-tree-no-results"},Xp={key:2,class:"thread-tree-loading"},Zp={key:3,class:"thread-list thread-list-global"},em={class:"thread-left-stack"},tm=["data-state"],nm=["onClick"],rm=["onClick"],sm={class:"thread-row-title-wrap"},om={class:"thread-row-title"},im={class:"thread-row-time"},am=["onClick"],lm=["onClick"],cm=["onClick"],um=["data-project-name","data-expanded","data-dragging"],dm={class:"project-icon-stack"},fm={class:"project-icon-folder"},hm={class:"project-icon-chevron"},pm=["data-dragging-handle","onMousedown"],mm={class:"project-title"},gm={class:"project-hover-controls"},vm=["onClick"],ym=["onClick"],wm=["onClick"],bm=["onClick"],_m=["onInput"],km=["aria-label","title","onClick"],Tm={key:0,class:"thread-list"},Sm={class:"thread-left-stack"},xm=["data-state"],Cm=["onClick"],Em=["onClick"],Am={class:"thread-row-title-wrap"},Im={class:"thread-row-title"},Rm={class:"thread-row-time"},$m=["onClick"],Mm=["onClick"],Pm=["onClick"],Om=["onClick"],Nm={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},jm=["onKeydown"],Dm={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},Lm={class:"rename-thread-subtitle"},Bm=4,Ya=6,Ja="codex-web-local.thread-view-mode.v1",Qa="codex-web-local.collapsed-projects.v1",Fm=It({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-project-files","rename-project","rename-thread","remove-project","reorder-project"],setup(e,{emit:t}){const n=e,r=t,s=P({}),o=P({}),i=P([]),a=P(""),l=P(""),d=P("actions"),u=P(""),f=P(!1),m=P(""),b=P(""),N=P(null),I=P(!1),H=P(""),J=P(""),O=P(null),U=P(null),L=P(null);let ce=null,fe=null;const pe=P(""),Se=P({}),ae=new Map,re=new Map,ye=new Map,oe=new WeakMap,Be=P(null),Fe=P(!1),Ke=P(Me()),Ie=typeof window<"u"?new ResizeObserver(_=>{for(const C of _){const $=C.target,q=oe.get($);q&&_n(q,$)}}):null;function ke(){if(typeof window>"u")return{};try{const _=window.localStorage.getItem(Qa);if(!_)return{};const C=JSON.parse(_);return!C||typeof C!="object"||Array.isArray(C)?{}:C}catch{return{}}}function Me(){return typeof window>"u"?"project":window.localStorage.getItem(Ja)==="chronological"?"chronological":"project"}o.value=ke(),ft(o,_=>{typeof window>"u"||window.localStorage.setItem(Qa,JSON.stringify(_))},{deep:!0}),ft(Ke,_=>{typeof window>"u"||window.localStorage.setItem(Ja,_)});const vt=de(()=>n.searchQuery.trim().toLowerCase()),nt=de(()=>vt.value.length>0),ot=de(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function rt(_){if(!nt.value)return!0;if(ot.value)return ot.value.has(_.id);const C=vt.value;return _.title.toLowerCase().includes(C)||_.preview.toLowerCase().includes(C)}const Ze=de(()=>nt.value?n.groups.map(_=>({..._,threads:_.threads.filter(rt)})).filter(_=>_.threads.length>0):n.groups),ge=de(()=>Ke.value==="chronological"),Ae=de(()=>{const _=Ze.value,C=[];for(const $ of _)for(const q of $.threads)y(q.id)||C.push(q);return C.sort(($,q)=>{const De=new Date($.updatedAtIso||$.createdAtIso).getTime();return new Date(q.updatedAtIso||q.createdAtIso).getTime()-De})}),Te=de(()=>{const _=new Map;for(const C of n.groups)for(const $ of C.threads)_.set($.id,$);return _}),R=de(()=>i.value.map(_=>Te.value.get(_)??null).filter(_=>_!==null).filter(rt)),ee=de(()=>{const _=L.value;if(!_||_.dropTargetIndexFull===null||n.groups.length===0)return null;const C=Math.max(0,Math.min(_.dropTargetIndexFull,n.groups.length)),$=C>_.fromIndex?C-1:C,q=Math.max(0,Math.min($,n.groups.length-1));return q===_.fromIndex?null:q}),Q=de(()=>{const C=(nt.value?Ze.value:n.groups).map(Kt=>Kt.projectName),$=L.value,q=ee.value;if(!$||q===null)return C;const De=[...C],[bt]=De.splice($.fromIndex,1);return bt?(De.splice(q,0,bt),De):C}),me=de(()=>{const _={};let C=0;for(const $ of Q.value)_[$]=C,C+=E($);return _}),Pe=de(()=>{let _=0;for(const C of Q.value)_+=E(C);return{height:`${Math.max(0,_)}px`}});function g(_){const C=new Date(_).getTime();if(Number.isNaN(C))return"n/a";const $=Math.abs(Date.now()-C);if($<6e4)return"now";const q=Math.floor($/6e4);if(q<60)return`${q}m`;const De=Math.floor(q/60);return De<24?`${De}h`:`${Math.floor(De/24)}d`}function y(_){return i.value.includes(_)}function x(_){if(y(_)){i.value=i.value.filter(C=>C!==_);return}i.value=[_,...i.value]}function D(_){r("select",_)}function F(_){return`start new thread ${Ee(_)}`}function j(_){r("start-new-thread",_)}function te(_){l.value===_&&ne()}function ie(_){return l.value===_}function ne(){l.value=""}function W(_){if(l.value===_){ne();return}l.value=_}function we(_,C){m.value=_,b.value=C,f.value=!0,ne(),Zt(()=>{var $,q;($=N.value)==null||$.focus(),(q=N.value)==null||q.select()})}function le(){f.value=!1,m.value="",b.value=""}function be(){const _=m.value,C=b.value.trim();!_||!C||(r("rename-thread",{threadId:_,title:C}),le())}function xe(_,C){H.value=_,J.value=C,I.value=!0,ne()}function Oe(){I.value=!1,H.value="",J.value=""}function Ve(){const _=H.value;_&&(i.value=i.value.filter(C=>C!==_),r("archive",_),Oe())}function Ee(_){return n.projectDisplayNameById[_]??_}function ut(_){return a.value===_}function Qe(){a.value="",d.value="actions",u.value=""}function B(){Fe.value=!Fe.value}function V(_){Ke.value=_,Fe.value=!1}function Z(_){if(a.value===_){Qe();return}a.value=_,d.value="actions",u.value=Ee(_)}function ze(_){a.value=_,d.value="rename",u.value=Ee(_)}function We(_){r("rename-project",{projectName:_,displayName:u.value})}function Ye(_){r("remove-project",_),Qe()}function Mt(_){r("browse-project-files",_),Qe()}function Yt(_,C){if(!_.altKey||_.key!=="ArrowUp"&&_.key!=="ArrowDown")return;const $=n.groups.findIndex(bt=>bt.projectName===C);if($<0)return;const q=_.key==="ArrowUp"?-1:1,De=Math.max(0,Math.min($+q,n.groups.length-1));De!==$&&(_.preventDefault(),r("reorder-project",{projectName:C,toIndex:De}))}function Jt(_){return s.value[_]===!0}function St(_){return o.value[_]===!0}function k(_){s.value={...s.value,[_]:!Jt(_)}}function A(_){if(pe.value===_){pe.value="";return}o.value={...o.value,[_]:!St(_)}}function E(_){const C=Se.value[_]??0,$=L.value,De=(($==null?void 0:$.projectName)===_?$.groupHeight:null)??C,bt=St(_)?0:Ya;return Math.max(0,De+bt)}function X(_,C){const $=C instanceof HTMLElement?C:C&&"$el"in C&&C.$el instanceof HTMLElement?C.$el:null;if($){re.set(_,$);return}re.delete(_)}function Y(_,C){const $=C instanceof HTMLElement?C:C&&"$el"in C&&C.$el instanceof HTMLElement?C.$el:null;if($){ye.set(_,$);return}ye.delete(_)}function z(_){const C=a.value;if(!C)return!1;const $=re.get(C);if(!$)return!1;if((typeof _.composedPath=="function"?_.composedPath():[]).includes($))return!0;const De=_.target;return De instanceof Node?$.contains(De):!1}function Ge(_){const C=l.value;if(!C)return!1;const $=ye.get(C);if(!$)return!1;if((typeof _.composedPath=="function"?_.composedPath():[]).includes($))return!0;const De=_.target;return De instanceof Node?$.contains(De):!1}function Ne(_){if(Fe.value){const C=Be.value,$=typeof _.composedPath=="function"?_.composedPath():[];!!C&&($.includes(C)||_.target instanceof Node&&C.contains(_.target))||(Fe.value=!1)}a.value&&(z(_)||Qe(),l.value&&(Ge(_)||ne()))}function Je(_){a.value&&!z(_)&&Qe(),l.value&&!Ge(_)&&ne()}function it(){Fe.value&&(Fe.value=!1),a.value&&Qe(),l.value&&ne()}function Qt(){window.addEventListener("pointerdown",Ne,{capture:!0}),window.addEventListener("focusin",Je,{capture:!0}),window.addEventListener("blur",it)}function bn(){window.removeEventListener("pointerdown",Ne,{capture:!0}),window.removeEventListener("focusin",Je,{capture:!0}),window.removeEventListener("blur",it)}function _n(_,C){const $=C.getBoundingClientRect().height;if(!Number.isFinite($)||$<=0)return;const q=Se.value[_];q!==void 0&&Math.abs(q-$)<.5||(Se.value={...Se.value,[_]:$})}function Hr(_,C){const $=ae.get(_);$&&$!==C&&Ie&&Ie.unobserve($);const q=C instanceof HTMLElement?C:C&&"$el"in C&&C.$el instanceof HTMLElement?C.$el:null;if(q){ae.set(_,q),oe.set(q,_),_n(_,q),Ie==null||Ie.observe(q);return}$&&(Ie==null||Ie.unobserve($)),ae.delete(_)}function br(_,C){if(_.button!==0||U.value||L.value)return;const $=n.groups.findIndex(Kt=>Kt.projectName===C),q=ae.get(C);if($<0||!q)return;const De=q.getBoundingClientRect(),bt=St(C)?0:Ya;U.value={projectName:C,fromIndex:$,startClientX:_.clientX,startClientY:_.clientY,pointerOffsetY:_.clientY-De.top,groupLeft:De.left,groupWidth:De.width,groupHeight:De.height,groupOuterHeight:De.height+bt},_.preventDefault(),Ur()}function Ur(){window.addEventListener("mousemove",qt),window.addEventListener("mouseup",kn),window.addEventListener("keydown",nr)}function _r(){window.removeEventListener("mousemove",qt),window.removeEventListener("mouseup",kn),window.removeEventListener("keydown",nr)}function qt(_){ce={clientX:_.clientX,clientY:_.clientY},Vr()}function kn(_){kr({clientX:_.clientX,clientY:_.clientY});const C=L.value;if(C&&ee.value!==null){const $=n.groups.findIndex(q=>q.projectName===C.projectName);if($>=0){const q=ee.value;q!==$&&r("reorder-project",{projectName:C.projectName,toIndex:q})}}Vn()}function nr(_){_.key==="Escape"&&(!U.value&&!L.value||(_.preventDefault(),Vn()))}function Vn(){fe!==null&&(window.cancelAnimationFrame(fe),fe=null),ce=null,U.value=null,L.value=null,pe.value="",_r()}function Vr(){fe===null&&(fe=window.requestAnimationFrame(()=>{if(fe=null,!ce)return;const _=ce;ce=null,kr(_)}))}function kr(_){const C=U.value;if(!L.value&&C){const $=_.clientX-C.startClientX,q=_.clientY-C.startClientY;if(Math.hypot($,q)<Bm)return;Qe(),pe.value=C.projectName,L.value={projectName:C.projectName,fromIndex:C.fromIndex,pointerOffsetY:C.pointerOffsetY,groupLeft:C.groupLeft,groupWidth:C.groupWidth,groupHeight:C.groupHeight,groupOuterHeight:C.groupOuterHeight,ghostTop:_.clientY-C.pointerOffsetY,dropTargetIndexFull:null}}L.value&&Wr(_)}function Wr(_){const C=L.value;if(!C)return;if(C.ghostTop=_.clientY-C.pointerOffsetY,!Wn(_)){C.dropTargetIndexFull=null;return}const $=_.clientY,q=O.value;if(!q){C.dropTargetIndexFull=null;return}const De=q.getBoundingClientRect(),bt=new Map(n.groups.map((en,Kn)=>[en.projectName,Kn])),Kt=n.groups.map(en=>en.projectName).filter(en=>en!==C.projectName);let xr=0,xn=n.groups.length;for(const en of Kt){const Kn=bt.get(en);if(Kn===void 0)continue;const sr=E(en),Gr=De.top+xr+sr/2;if($<Gr){xn=Kn;break}xr+=sr}C.dropTargetIndexFull=xn}function Wn(_){const C=O.value;if(!C)return!1;const $=C.getBoundingClientRect(),q=_.clientX>=$.left&&_.clientX<=$.right,De=_.clientY>=$.top-32&&_.clientY<=$.bottom+32;return q&&De}function rr(_){var C;return((C=L.value)==null?void 0:C.projectName)===_}function qr(_){const C=L.value,$=me.value[_]??0,q=a.value===_;return!C||C.projectName!==_?{position:"absolute",top:"0",left:"0",right:"0",zIndex:q?"40":"1",transform:`translate3d(0, ${$}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${C.groupLeft}px`,width:`${C.groupWidth}px`,height:`${C.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${C.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function Tn(_){return _.threads.filter(C=>!y(C.id))}function Tr(_){if(nt.value)return Tn(_);if(St(_.projectName))return[];const C=Tn(_);return Jt(_.projectName)?C:C.slice(0,10)}function Sn(_){return nt.value?!1:!St(_.projectName)&&Tn(_).length>10}function Kr(_){return Tn(_).length>0}function qn(_){return _.inProgress?"working":_.unread?"unread":"idle"}ft(()=>n.groups.map(_=>_.projectName),_=>{var De,bt;const C=((De=L.value)==null?void 0:De.projectName)??((bt=U.value)==null?void 0:bt.projectName)??"";C&&!n.groups.some(Kt=>Kt.projectName===C)&&Vn();const $=new Set(_),q=Object.fromEntries(Object.entries(Se.value).filter(([Kt])=>$.has(Kt)));Object.keys(q).length!==Object.keys(Se.value).length&&(Se.value=q)});const Sr=de(()=>Fe.value||a.value!=="");return ft(Sr,_=>{if(_){Qt();return}bn()}),Un(()=>{for(const _ of ae.values())Ie==null||Ie.unobserve(_);ae.clear(),re.clear(),bn(),Vn()}),(_,C)=>(w(),S("section",Pp,[R.value.length>0?(w(),S("section",Op,[p("ul",Np,[(w(!0),S(He,null,wt(R.value,$=>(w(),S("li",{key:$.id,class:"thread-row-item"},[Ce(fr,{class:"thread-row","data-active":$.id===e.selectedThreadId,"data-pinned":y($.id),onMouseleave:q=>te($.id)},{left:dt(()=>[p("span",jp,[$.inProgress||$.unread?(w(),S("span",{key:0,class:"thread-status-indicator","data-state":qn($)},null,8,Dp)):ue("",!0),p("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:q=>x($.id)},[Ce(Ao,{class:"thread-icon"})],8,Lp)])]),right:dt(()=>[p("span",Up,he(g($.createdAtIso||$.updatedAtIso)),1)]),"right-hover":dt(()=>[p("div",{ref_for:!0,ref:q=>Y($.id,q),class:"thread-menu-wrap"},[p("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Xe(q=>W($.id),["stop"])},[Ce(Xr,{class:"thread-icon"})],8,Vp),ie($.id)?(w(),S("div",{key:0,class:"thread-menu-panel",onClick:C[0]||(C[0]=Xe(()=>{},["stop"]))},[p("button",{class:"thread-menu-item",type:"button",onClick:q=>we($.id,$.title)}," Rename thread ",8,Wp),p("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:q=>xe($.id,$.title)}," Delete thread ",8,qp)])):ue("",!0)],512)]),default:dt(()=>[p("button",{class:"thread-main-button",type:"button",onClick:q=>D($.id)},[p("span",Fp,[p("span",Hp,he($.title),1),$.hasWorktree?(w(),pt(js,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ue("",!0)])],8,Bp)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):ue("",!0),Ce(fr,{as:"header",class:"thread-tree-header-row"},{right:dt(()=>[p("div",{ref_key:"organizeMenuWrapRef",ref:Be,class:"organize-menu-wrap"},[p("button",{class:"organize-menu-trigger",type:"button","aria-expanded":Fe.value,"aria-label":"Organize threads",title:"Organize threads",onClick:B},[Ce(Xr,{class:"thread-icon"})],8,Kp),Fe.value?(w(),S("div",{key:0,class:"organize-menu-panel",onClick:C[3]||(C[3]=Xe(()=>{},["stop"]))},[C[11]||(C[11]=p("p",{class:"organize-menu-title"},"Organize",-1)),p("button",{class:"organize-menu-item","data-active":Ke.value==="project",type:"button",onClick:C[1]||(C[1]=$=>V("project"))},[C[9]||(C[9]=p("span",null,"By project",-1)),Ke.value==="project"?(w(),S("span",zp,"✓")):ue("",!0)],8,Gp),p("button",{class:"organize-menu-item","data-active":Ke.value==="chronological",type:"button",onClick:C[2]||(C[2]=$=>V("chronological"))},[C[10]||(C[10]=p("span",null,"Chronological list",-1)),Ke.value==="chronological"?(w(),S("span",Jp,"✓")):ue("",!0)],8,Yp)])):ue("",!0)],512)]),default:dt(()=>[C[12]||(C[12]=p("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),nt.value&&Ze.value.length===0?(w(),S("p",Qp,"No matching threads")):e.isLoading&&e.groups.length===0?(w(),S("p",Xp,"Loading threads...")):ge.value?(w(),S("ul",Zp,[(w(!0),S(He,null,wt(Ae.value,$=>(w(),S("li",{key:$.id,class:"thread-row-item"},[Ce(fr,{class:"thread-row","data-active":$.id===e.selectedThreadId,"data-pinned":y($.id),onMouseleave:q=>te($.id)},{left:dt(()=>[p("span",em,[$.inProgress||$.unread?(w(),S("span",{key:0,class:"thread-status-indicator","data-state":qn($)},null,8,tm)):ue("",!0),p("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:q=>x($.id)},[Ce(Ao,{class:"thread-icon"})],8,nm)])]),right:dt(()=>[p("span",im,he(g($.createdAtIso||$.updatedAtIso)),1)]),"right-hover":dt(()=>[p("div",{ref_for:!0,ref:q=>Y($.id,q),class:"thread-menu-wrap"},[p("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Xe(q=>W($.id),["stop"])},[Ce(Xr,{class:"thread-icon"})],8,am),ie($.id)?(w(),S("div",{key:0,class:"thread-menu-panel",onClick:C[4]||(C[4]=Xe(()=>{},["stop"]))},[p("button",{class:"thread-menu-item",type:"button",onClick:q=>we($.id,$.title)}," Rename thread ",8,lm),p("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:q=>xe($.id,$.title)}," Delete thread ",8,cm)])):ue("",!0)],512)]),default:dt(()=>[p("button",{class:"thread-main-button",type:"button",onClick:q=>D($.id)},[p("span",sm,[p("span",om,he($.title),1),$.hasWorktree?(w(),pt(js,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ue("",!0)])],8,rm)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),S("div",{key:4,ref_key:"groupsContainerRef",ref:O,class:"thread-tree-groups",style:wr(Pe.value)},[(w(!0),S(He,null,wt(Ze.value,$=>(w(),S("article",{key:$.projectName,ref_for:!0,ref:q=>Hr($.projectName,q),class:"project-group","data-project-name":$.projectName,"data-expanded":!St($.projectName),"data-dragging":rr($.projectName),style:wr(qr($.projectName))},[Ce(fr,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:q=>A($.projectName),onKeydown:[q=>Yt(q,$.projectName),Vt(Xe(q=>A($.projectName),["prevent"]),["enter"]),Vt(Xe(q=>A($.projectName),["prevent"]),["space"])]},{left:dt(()=>[p("span",dm,[p("span",fm,[St($.projectName)?(w(),pt(Kc,{key:0,class:"thread-icon"})):(w(),pt(bp,{key:1,class:"thread-icon"}))]),p("span",hm,[St($.projectName)?(w(),pt(qc,{key:0,class:"thread-icon"})):(w(),pt(lo,{key:1,class:"thread-icon"}))])])]),right:dt(()=>[p("div",gm,[p("div",{ref_for:!0,ref:q=>X($.projectName,q),class:"project-menu-wrap"},[p("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:Xe(q=>Z($.projectName),["stop"])},[Ce(Xr,{class:"thread-icon"})],8,vm),ut($.projectName)?(w(),S("div",{key:0,class:"project-menu-panel",onClick:C[6]||(C[6]=Xe(()=>{},["stop"]))},[d.value==="actions"?(w(),S(He,{key:0},[p("button",{class:"project-menu-item",type:"button",onClick:q=>Mt($.projectName)}," Browse files ",8,ym),p("button",{class:"project-menu-item",type:"button",onClick:q=>ze($.projectName)}," Edit name ",8,wm),p("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:q=>Ye($.projectName)}," Remove ",8,bm)],64)):(w(),S(He,{key:1},[C[13]||(C[13]=p("label",{class:"project-menu-label"},"Project name",-1)),Ln(p("input",{"onUpdate:modelValue":C[5]||(C[5]=q=>u.value=q),class:"project-menu-input",type:"text",onInput:q=>We($.projectName)},null,40,_m),[[Bn,u.value]])],64))])):ue("",!0)],512),p("button",{class:"thread-start-button",type:"button","aria-label":F($.projectName),title:F($.projectName),onClick:Xe(q=>j($.projectName),["stop"])},[Ce(qs,{class:"thread-icon"})],8,km)])]),default:dt(()=>[p("span",{class:"project-main-button","data-dragging-handle":rr($.projectName),onMousedown:Xe(q=>br(q,$.projectName),["left"])},[p("span",mm,he(Ee($.projectName)),1)],40,pm)]),_:2},1032,["onClick","onKeydown"]),Kr($)?(w(),S("ul",Tm,[(w(!0),S(He,null,wt(Tr($),q=>(w(),S("li",{key:q.id,class:"thread-row-item"},[Ce(fr,{class:"thread-row","data-active":q.id===e.selectedThreadId,"data-pinned":y(q.id),onMouseleave:De=>te(q.id)},{left:dt(()=>[p("span",Sm,[q.inProgress||q.unread?(w(),S("span",{key:0,class:"thread-status-indicator","data-state":qn(q)},null,8,xm)):ue("",!0),p("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:De=>x(q.id)},[Ce(Ao,{class:"thread-icon"})],8,Cm)])]),right:dt(()=>[p("span",Rm,he(g(q.createdAtIso||q.updatedAtIso)),1)]),"right-hover":dt(()=>[p("div",{ref_for:!0,ref:De=>Y(q.id,De),class:"thread-menu-wrap"},[p("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Xe(De=>W(q.id),["stop"])},[Ce(Xr,{class:"thread-icon"})],8,$m),ie(q.id)?(w(),S("div",{key:0,class:"thread-menu-panel",onClick:C[7]||(C[7]=Xe(()=>{},["stop"]))},[p("button",{class:"thread-menu-item",type:"button",onClick:De=>we(q.id,q.title)}," Rename thread ",8,Mm),p("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:De=>xe(q.id,q.title)}," Delete thread ",8,Pm)])):ue("",!0)],512)]),default:dt(()=>[p("button",{class:"thread-main-button",type:"button",onClick:De=>D(q.id)},[p("span",Am,[p("span",Im,he(q.title),1),q.hasWorktree?(w(),pt(js,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):ue("",!0)])],8,Em)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),pt(fr,{key:1,as:"p",class:"project-empty-row"},{left:dt(()=>[...C[14]||(C[14]=[p("span",{class:"project-empty-spacer"},null,-1)])]),default:dt(()=>[C[15]||(C[15]=p("span",{class:"project-empty"},"No threads",-1))]),_:1})),Sn($)?(w(),pt(fr,{key:2,class:"thread-show-more-row"},{left:dt(()=>[...C[16]||(C[16]=[p("span",{class:"thread-show-more-spacer"},null,-1)])]),default:dt(()=>[p("button",{class:"thread-show-more-button",type:"button",onClick:q=>k($.projectName)},he(Jt($.projectName)?"Show less":"Show more"),9,Om)]),_:2},1024)):ue("",!0)],12,um))),128))],4)),(w(),pt(Fs,{to:"body"},[f.value?(w(),S("div",{key:0,class:"rename-thread-overlay",onClick:Xe(le,["self"])},[p("div",Nm,[C[17]||(C[17]=p("h3",{class:"rename-thread-title"},"Rename thread",-1)),C[18]||(C[18]=p("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),Ln(p("input",{ref_key:"renameThreadInputRef",ref:N,"onUpdate:modelValue":C[8]||(C[8]=$=>b.value=$),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Vt(Xe(be,["prevent"]),["enter"]),Vt(Xe(le,["prevent"]),["esc"])]},null,40,jm),[[Bn,b.value]]),p("div",{class:"rename-thread-actions"},[p("button",{class:"rename-thread-button",type:"button",onClick:le},"Cancel"),p("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:be},"Save")])])])):ue("",!0)])),(w(),pt(Fs,{to:"body"},[I.value?(w(),S("div",{key:0,class:"rename-thread-overlay",onClick:Xe(Oe,["self"])},[p("div",Dm,[C[19]||(C[19]=p("h3",{class:"rename-thread-title"},"Delete thread?",-1)),p("p",Lm,' This will archive the thread "'+he(J.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:Oe},"Cancel"),p("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:Ve},"Delete")])])])):ue("",!0)]))]))}}),Hm=et(Fm,[["__scopeId","data-v-7c022821"]]),Um={class:"content-header"},Vm={class:"content-leading"},Wm={class:"content-title"},qm={class:"content-actions"},Km=It({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(w(),S("header",Um,[p("div",Vm,[yn(t.$slots,"leading",{},void 0)]),p("h1",Wm,he(e.title),1),p("div",qm,[yn(t.$slots,"actions",{},void 0)])]))}}),Gm=et(Km,[["__scopeId","data-v-66ee223c"]]),zm={},Ym={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Jm(e,t){return w(),S("svg",Ym,[...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 Ri=et(zm,[["render",Jm]]),Qm={},Xm={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Zm(e,t){return w(),S("svg",Xm,[...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 eg=et(Qm,[["render",Zm]]),tg={class:"conversation-root"},ng={key:0,class:"conversation-loading"},rg={key:1,class:"conversation-empty"},sg={class:"message-row"},og={class:"message-stack"},ig={class:"request-card"},ag={class:"request-title"},lg={class:"request-meta"},cg={key:0,class:"request-reason"},ug={key:1,class:"request-actions"},dg=["onClick"],fg=["onClick"],hg=["onClick"],pg=["onClick"],mg={key:2,class:"request-actions"},gg=["onClick"],vg=["onClick"],yg=["onClick"],wg=["onClick"],bg={key:3,class:"request-user-input"},_g={class:"request-question-title"},kg={key:0,class:"request-question-text"},Tg=["value","onChange"],Sg=["value"],xg=["value","onInput"],Cg=["onClick"],Eg={key:4,class:"request-actions"},Ag=["onClick"],Ig=["onClick"],Rg={key:5,class:"request-actions"},$g=["onClick"],Mg=["onClick"],Pg=["data-role","data-message-type"],Og={key:0,class:"message-row","data-role":"system"},Ng={class:"message-stack","data-role":"system"},jg=["onClick"],Dg={class:"cmd-label"},Lg={class:"cmd-status"},Bg={class:"cmd-output-inner"},Fg={class:"cmd-output"},Hg=["data-role","data-message-type"],Ug=["data-role"],Vg=["data-role"],Wg=["data-role"],qg=["onClick"],Kg=["src"],Gg={key:1,class:"message-file-attachments"},zg=["href","title"],Yg=["data-role"],Jg={key:0,class:"worked-separator-wrap","aria-live":"polite"},Qg=["onClick"],Xg={class:"worked-separator-text"},Zg={key:0,class:"worked-details"},ev=["onClick"],tv={class:"cmd-label"},nv={class:"cmd-status"},rv={class:"cmd-output-inner"},sv={class:"cmd-output"},ov={key:1,class:"message-text-flow"},iv={key:0,class:"message-text"},av={key:0},lv=["href","title"],cv={key:2,class:"message-inline-code"},uv={key:1,class:"message-text"},dv=["onClick"],fv=["src","alt","onError"],hv=["onClick"],pv={key:0,class:"conversation-item conversation-item-overlay"},mv={class:"message-row"},gv={class:"message-stack"},vv={class:"live-overlay-inline","aria-live":"polite"},yv={class:"live-overlay-label"},wv={key:1,class:"live-overlay-error"},bv=["src"],_v=16,kv=It({__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=P(new Set),r=P(new Set),s=P(new Set),o=P({});function i(k){return k.messageType==="commandExecution"&&!!k.commandExecution}function a(k){var A;return((A=k.commandExecution)==null?void 0:A.status)==="inProgress"||r.value.has(k.id)?!0:n.value.has(k.id)}function l(k){return r.value.has(k.id)}function d(k){var E;if(((E=k.commandExecution)==null?void 0:E.status)==="inProgress")return;const A=new Set(n.value);A.has(k.id)?A.delete(k.id):A.add(k.id),n.value=A}function u(k){const A=new Set(s.value);A.has(k.id)?A.delete(k.id):A.add(k.id),s.value=A}function f(k){return s.value.has(k.id)}function m(k){const A=k.commandExecution;if(!A)return"";switch(A.status){case"inProgress":return"⟳ Running";case"completed":return A.exitCode===0?"✓ Completed":`✗ Exit ${A.exitCode??"?"}`;case"failed":return"✗ Failed";case"declined":return"⊘ Declined";case"interrupted":return"⊘ Interrupted";default:return""}}function b(k){var E,X;const A=(E=k.commandExecution)==null?void 0:E.status;return A==="inProgress"?"cmd-status-running":A==="completed"&&((X=k.commandExecution)==null?void 0:X.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function N(k){const A=new Set(r.value);A.add(k),r.value=A,setTimeout(()=>{const E=new Set(r.value);E.delete(k),r.value=E},1e3)}function I(k,A){const E=[];for(let X=A-1;X>=0;X--){const Y=k[X];if(Y.messageType==="commandExecution")E.unshift(Y);else if(Y.role==="user"||Y.messageType==="worked")break}return E}const H=e,J=t,O=P(null),U=P(null),L=P(null),ce=P(""),fe=P({}),pe=P({});let Se=0,ae=0,re=0;const ye=new WeakSet,oe=P(new Set);function Be(k){if(!k||/\s/u.test(k)||k.endsWith("/")||k.endsWith("\\"))return!1;if(k.startsWith("file://"))return!0;if(/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(k))return!1;const A=k.startsWith("/"),E=/^[A-Za-z]:[\\/]/u.test(k),X=k.startsWith("./")||k.startsWith("../")||k.startsWith("~/"),Y=k.includes("/")||k.includes("\\");return A||E||X||Y}function Fe(k){return k.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||k}function Ke(k){return k.replace(/\\/gu,"/")}function Ie(k){if(!k.startsWith("file://"))return k;let A=k.replace(/^file:\/\//u,"");try{A=decodeURIComponent(A)}catch{}return/^\/[A-Za-z]:\//u.test(A)&&(A=A.slice(1)),A}function ke(k){const A=Ke(k),E=A.match(/^\/Users\/([^/]+)/u);if(E)return`/Users/${E[1]}`;const X=A.match(/^\/home\/([^/]+)/u);return X?`/home/${X[1]}`:""}function Me(k){const A=Ke(k);if(!A)return A;let E="",X=A;const Y=X.match(/^([A-Za-z]:)(\/.*)?$/u);Y?(E=`${Y[1]}/`,X=(Y[2]??"").replace(/^\/+/u,"")):X.startsWith("/")&&(E="/",X=X.slice(1));const z=X.split("/").filter(Boolean),Ge=[];for(const Je of z)if(Je!=="."){if(Je===".."){Ge.length>0&&Ge.pop();continue}Ge.push(Je)}const Ne=Ge.join("/");return E?`${E}${Ne}`.replace(/\/+$/u,"")||E:Ne||A}function vt(k,A){const E=Ke(Ie(k.trim()));if(!E)return"";if(E.startsWith("/")||/^[A-Za-z]:\//u.test(E))return Me(E);if(E.startsWith("~/")){const z=ke(A);if(z)return Me(`${z}/${E.slice(2)}`)}const Y=Ke(A.trim());return Me(Y?`${Y.replace(/\/+$/u,"")}/${E}`:E)}function nt(k){if(!k)return null;let A=k,E=null;const X=A.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(X)A=X[1],E=Number(X[2]);else{const Y=A.match(/^(.*):(\d+)(?::\d+)?$/u);Y&&(A=Y[1],E=Number(Y[2]))}return A=Ie(A),Be(A)?{path:A,line:E}:null}function ot(k){const A=[],E=/file:\/\/[^\s`]+/gu;let X=0;for(const Y of k.matchAll(E)){if(typeof Y.index!="number")continue;const z=Y.index,Ge=z+Y[0].length;z>X&&A.push({kind:"text",value:k.slice(X,z)});let Ne=Y[0],Je="";for(;/[.,;:)\]]$/u.test(Ne);)Je=Ne.slice(-1)+Je,Ne=Ne.slice(0,-1);const it=nt(Ne);it?(A.push({kind:"file",value:Ne,path:it.path,displayPath:Ne,downloadName:Fe(it.path)}),Je&&A.push({kind:"text",value:Je})):A.push({kind:"text",value:Y[0]}),X=Ge}return X<k.length&&A.push({kind:"text",value:k.slice(X)}),A}function rt(k){if(!k.includes("`"))return ot(k);const A=[];let E=0,X=0;for(;E<k.length;){if(k[E]!=="`"){E+=1;continue}let Y=1;for(;E+Y<k.length&&k[E+Y]==="`";)Y+=1;const z="`".repeat(Y);let Ge=E+Y,Ne=-1;for(;Ge<k.length;){const it=k.indexOf(z,Ge);if(it<0)break;const Qt=it>0&&k[it-1]==="`",bn=it+Y<k.length&&k[it+Y]==="`",_n=k.slice(E+Y,it).includes(`
26
+ `);if(!Qt&&!bn&&!_n){Ne=it;break}Ge=it+1}if(Ne<0){E+=Y;continue}E>X&&A.push(...ot(k.slice(X,E)));const Je=k.slice(E+Y,Ne);if(Je.length>0){const it=nt(Je);if(it){const Qt=it.line?`${it.path}:${String(it.line)}`:it.path;A.push({kind:"file",value:Je,path:it.path,displayPath:Qt,downloadName:Fe(it.path)})}else A.push({kind:"code",value:Je})}else A.push({kind:"text",value:`${z}${z}`});E=Ne+Y,X=E}return X<k.length&&A.push(...ot(k.slice(X))),A}function Ze(k){const A=k.trim();if(!A)return"";if(A.startsWith("data:")||A.startsWith("blob:")||A.startsWith("http://")||A.startsWith("https://")||A.startsWith("/codex-local-image?"))return A;if(A.startsWith("file://"))return`/codex-local-image?path=${encodeURIComponent(A)}`;const E=A.startsWith("/"),X=/^[A-Za-z]:[\\/]/u.test(A);return E||X?`/codex-local-image?path=${encodeURIComponent(A)}`:A}function ge(k){const A=k.trim();if(!A)return"#";const E=Ge=>Ge.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(Ge),X=nt(A),Y=(X==null?void 0:X.path)??A,z=vt(Y,H.cwd);return E(z)?`/codex-local-browse${encodeURI(z)}`:"#"}function Ae(k){if(!k.includes("![")||!k.includes("]("))return[{kind:"text",value:k}];const A=[],E=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let X=0;for(const Y of k.matchAll(E)){const[z,Ge,Ne]=Y;if(typeof Y.index!="number")continue;const Je=Y.index,it=Je+z.length,Qt=Ze(Ne.trim());Qt&&(Je>X&&A.push({kind:"text",value:k.slice(X,Je)}),A.push({kind:"image",url:Qt,alt:Ge.trim(),markdown:z}),X=it)}return X<k.length&&A.push({kind:"text",value:k.slice(X)}),A.length>0?A:[{kind:"text",value:k}]}function Te(k){return k!==null&&typeof k=="object"&&!Array.isArray(k)?k:null}function R(k){const A=new Date(k);return Number.isNaN(A.getTime())?k:A.toLocaleTimeString()}function ee(k){const A=Te(k.params),E=A==null?void 0:A.reason;return typeof E=="string"?E.trim():""}function Q(k,A){return`${String(k)}:${A}`}function me(k){const A=Te(k.params),E=Array.isArray(A==null?void 0:A.questions)?A.questions:[],X=[];for(const Y of E){const z=Te(Y);if(!z)continue;const Ge=typeof z.id=="string"?z.id:"";if(!Ge)continue;const Ne=Array.isArray(z.options)?z.options.map(Je=>Te(Je)).map(Je=>Je==null?void 0:Je.label).filter(Je=>typeof Je=="string"&&Je.length>0):[];X.push({id:Ge,header:typeof z.header=="string"?z.header:"",question:typeof z.question=="string"?z.question:"",isOther:z.isOther===!0,options:Ne})}return X}function Pe(k,A,E){const X=Q(k,A),Y=fe.value[X];return typeof Y=="string"&&Y.length>0?Y:E}function g(k,A){const E=Q(k,A);return pe.value[E]??""}function y(k,A,E){const X=E.target;if(!(X instanceof HTMLSelectElement))return;const Y=Q(k,A);fe.value={...fe.value,[Y]:X.value}}function x(k,A,E){const X=E.target;if(!(X instanceof HTMLInputElement))return;const Y=Q(k,A);pe.value={...pe.value,[Y]:X.value}}function D(k,A){J("respondServerRequest",{id:k,result:{decision:A}})}function F(k){const A=me(k),E={};for(const X of A){const Y=Pe(k.id,X.id,X.options[0]||""),z=g(k.id,X.id).trim(),Ge=[Y,z].map(Ne=>Ne.trim()).filter(Ne=>Ne.length>0);E[X.id]={answers:Ge}}J("respondServerRequest",{id:k.id,result:{answers:E}})}function j(k){J("respondServerRequest",{id:k,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function te(k){J("respondServerRequest",{id:k,result:{success:!0,contentItems:[]}})}function ie(k){J("respondServerRequest",{id:k,result:{}})}function ne(k){J("respondServerRequest",{id:k,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function W(k){return!(k.role!=="user"&&k.role!=="assistant"||typeof k.turnIndex!="number"||H.isTurnInProgress||H.isRollingBack)}function we(k){W(k)&&J("rollback",{turnIndex:k.turnIndex})}function le(){const k=O.value,A=U.value;!k||!A||(k.scrollTop=k.scrollHeight,A.scrollIntoView({block:"end"}))}function be(k){return k.scrollHeight-(k.scrollTop+k.clientHeight)<=_v}function xe(k){if(!H.activeThreadId)return;const A=Math.max(k.scrollHeight-k.clientHeight,0),E=A>0?Math.min(Math.max(k.scrollTop/A,0),1):1;J("updateScrollState",{threadId:H.activeThreadId,state:{scrollTop:k.scrollTop,isAtBottom:be(k),scrollRatio:E}})}function Oe(){const k=O.value;if(!k)return;const A=H.scrollState;if(!A||A.isAtBottom){Ve();return}const E=Math.max(k.scrollHeight-k.clientHeight,0),X=typeof A.scrollRatio=="number"?A.scrollRatio*E:A.scrollTop;k.scrollTop=Math.min(Math.max(X,0),E),xe(k)}function Ve(){const k=O.value;k&&(le(),xe(k))}function Ee(){const k=H.scrollState;return!k||k.isAtBottom===!0}function ut(){if(!Ee()){re=0,ae=0;return}if(Ve(),re-=1,re<=0){ae=0;return}ae=requestAnimationFrame(ut)}function Qe(k=6){Ee()&&(ae&&(cancelAnimationFrame(ae),ae=0),re=Math.max(k,1),ae=requestAnimationFrame(ut))}function B(){Qe(3)}function V(){if(!Ee())return;const k=O.value;if(!k)return;const A=k.querySelectorAll("img.message-image-preview");for(const E of A)E.complete||ye.has(E)||(ye.add(E),E.addEventListener("load",B,{once:!0}),E.addEventListener("error",B,{once:!0}))}async function Z(){await Zt(),Se&&cancelAnimationFrame(Se),Se=requestAnimationFrame(()=>{Se=0,Oe(),V(),Qe()})}ft(()=>H.messages,async k=>{if(!H.isLoading){for(const A of k){if(A.messageType!=="commandExecution"||!A.commandExecution)continue;const E=o.value[A.id],X=A.commandExecution.status;E==="inProgress"&&X!=="inProgress"&&N(A.id),o.value[A.id]=X}await Z()}}),ft(()=>H.liveOverlay,async k=>{k&&(await Zt(),Ve(),Qe(8))},{deep:!0}),ft(()=>H.isLoading,async k=>{k||await Z()}),ft(()=>H.activeThreadId,()=>{ce.value="",oe.value=new Set},{flush:"post"});function ze(){const k=O.value;!k||H.isLoading||xe(k)}function We(k){ce.value=Ze(k)}function Ye(k,A){return`${k}:${String(A)}`}function Mt(k,A){const E=new Set(oe.value);E.add(Ye(k,A)),oe.value=E}function Yt(k,A){return oe.value.has(Ye(k,A))}function Jt(){ce.value=""}function St(){const k=L.value;k&&(k.scrollTop=k.scrollHeight)}return ft(()=>{var k;return(k=H.liveOverlay)==null?void 0:k.reasoningText},async k=>{k&&(await Zt(),St())}),Un(()=>{Se&&cancelAnimationFrame(Se),ae&&cancelAnimationFrame(ae)}),(k,A)=>(w(),S("section",tg,[e.isLoading?(w(),S("p",ng,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(w(),S("p",rg," No messages in this thread yet. ")):(w(),S("ul",{key:2,ref_key:"conversationListRef",ref:O,class:"conversation-list",onScroll:ze},[(w(!0),S(He,null,wt(e.pendingRequests,E=>(w(),S("li",{key:`server-request:${E.id}`,class:"conversation-item conversation-item-request"},[p("div",sg,[p("div",og,[p("article",ig,[p("p",ag,he(E.method),1),p("p",lg,"Request #"+he(E.id)+" · "+he(R(E.receivedAtIso)),1),ee(E)?(w(),S("p",cg,he(ee(E)),1)):ue("",!0),E.method==="item/commandExecution/requestApproval"?(w(),S("section",ug,[p("button",{type:"button",class:"request-button request-button-primary",onClick:X=>D(E.id,"accept")},"Accept",8,dg),p("button",{type:"button",class:"request-button",onClick:X=>D(E.id,"acceptForSession")},"Accept for Session",8,fg),p("button",{type:"button",class:"request-button",onClick:X=>D(E.id,"decline")},"Decline",8,hg),p("button",{type:"button",class:"request-button",onClick:X=>D(E.id,"cancel")},"Cancel",8,pg)])):E.method==="item/fileChange/requestApproval"?(w(),S("section",mg,[p("button",{type:"button",class:"request-button request-button-primary",onClick:X=>D(E.id,"accept")},"Accept",8,gg),p("button",{type:"button",class:"request-button",onClick:X=>D(E.id,"acceptForSession")},"Accept for Session",8,vg),p("button",{type:"button",class:"request-button",onClick:X=>D(E.id,"decline")},"Decline",8,yg),p("button",{type:"button",class:"request-button",onClick:X=>D(E.id,"cancel")},"Cancel",8,wg)])):E.method==="item/tool/requestUserInput"?(w(),S("section",bg,[(w(!0),S(He,null,wt(me(E),X=>(w(),S("div",{key:`${E.id}:${X.id}`,class:"request-question"},[p("p",_g,he(X.header||X.question),1),X.header&&X.question?(w(),S("p",kg,he(X.question),1)):ue("",!0),p("select",{class:"request-select",value:Pe(E.id,X.id,X.options[0]||""),onChange:Y=>y(E.id,X.id,Y)},[(w(!0),S(He,null,wt(X.options,Y=>(w(),S("option",{key:`${E.id}:${X.id}:${Y}`,value:Y},he(Y),9,Sg))),128))],40,Tg),X.isOther?(w(),S("input",{key:1,class:"request-input",type:"text",value:g(E.id,X.id),placeholder:"Other answer",onInput:Y=>x(E.id,X.id,Y)},null,40,xg)):ue("",!0)]))),128)),p("button",{type:"button",class:"request-button request-button-primary",onClick:X=>F(E)}," Submit Answers ",8,Cg)])):E.method==="item/tool/call"?(w(),S("section",Eg,[p("button",{type:"button",class:"request-button request-button-primary",onClick:X=>j(E.id)},"Fail Tool Call",8,Ag),p("button",{type:"button",class:"request-button",onClick:X=>te(E.id)},"Success (Empty)",8,Ig)])):(w(),S("section",Rg,[p("button",{type:"button",class:"request-button request-button-primary",onClick:X=>ie(E.id)},"Return Empty Result",8,$g),p("button",{type:"button",class:"request-button",onClick:X=>ne(E.id)},"Reject Request",8,Mg)]))])])])]))),128)),(w(!0),S(He,null,wt(e.messages,E=>{var X,Y;return w(),S("li",{key:E.id,class:ht(["conversation-item",{"conversation-item-rollbackable":W(E)}]),"data-role":E.role,"data-message-type":E.messageType||""},[i(E)?(w(),S("div",Og,[p("div",Ng,[p("button",{type:"button",class:ht(["cmd-row",[b(E),{"cmd-expanded":a(E)}]]),onClick:z=>d(E)},[p("span",{class:ht(["cmd-chevron",{"cmd-chevron-open":a(E)}])},"▶",2),p("code",Dg,he(((X=E.commandExecution)==null?void 0:X.command)||"(command)"),1),p("span",Lg,he(m(E)),1)],10,jg),p("div",{class:ht(["cmd-output-wrap",{"cmd-output-visible":a(E),"cmd-output-collapsing":l(E)}])},[p("div",Bg,[p("pre",Fg,he(((Y=E.commandExecution)==null?void 0:Y.aggregatedOutput)||"(no output)"),1)])],2)])])):(w(),S("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(),S("ul",{key:0,class:"message-image-list","data-role":E.role},[(w(!0),S(He,null,wt(E.images,z=>(w(),S("li",{key:z,class:"message-image-item"},[p("button",{class:"message-image-button",type:"button",onClick:Ge=>We(z)},[p("img",{class:"message-image-preview",src:Ze(z),alt:"Message image preview",loading:"lazy"},null,8,Kg)],8,qg)]))),128))],8,Wg)):ue("",!0),E.fileAttachments&&E.fileAttachments.length>0?(w(),S("div",Gg,[(w(!0),S(He,null,wt(E.fileAttachments,z=>(w(),S("span",{key:z.path,class:"message-file-chip"},[A[1]||(A[1]=p("span",{class:"message-file-chip-icon"},"📄",-1)),p("a",{class:"message-file-link message-file-chip-name",href:ge(z.path),target:"_blank",rel:"noopener noreferrer",title:z.path},he(z.path),9,zg)]))),128))])):ue("",!0),E.text.length>0?(w(),S("article",{key:2,class:"message-card","data-role":E.role},[E.messageType==="worked"?(w(),S("div",Jg,[p("button",{type:"button",class:"worked-separator",onClick:z=>u(E)},[A[2]||(A[2]=p("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),p("span",{class:ht(["worked-chevron",{"worked-chevron-open":f(E)}])},"▶",2),p("p",Xg,he(E.text),1),A[3]||(A[3]=p("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Qg),f(E)?(w(),S("div",Zg,[(w(!0),S(He,null,wt(I(e.messages,e.messages.indexOf(E)),z=>{var Ge,Ne;return w(),S("div",{key:`worked-cmd-${z.id}`,class:"worked-cmd-item"},[p("button",{type:"button",class:ht(["cmd-row",[b(z),{"cmd-expanded":a(z)}]]),onClick:Je=>d(z)},[p("span",{class:ht(["cmd-chevron",{"cmd-chevron-open":a(z)}])},"▶",2),p("code",tv,he(((Ge=z.commandExecution)==null?void 0:Ge.command)||"(command)"),1),p("span",nv,he(m(z)),1)],10,ev),p("div",{class:ht(["cmd-output-wrap",{"cmd-output-visible":a(z),"cmd-output-collapsing":l(z)}])},[p("div",rv,[p("pre",sv,he(((Ne=z.commandExecution)==null?void 0:Ne.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):ue("",!0)])):(w(),S("div",ov,[(w(!0),S(He,null,wt(Ae(E.text),(z,Ge)=>(w(),S(He,{key:`block-${Ge}`},[z.kind==="text"?(w(),S("p",iv,[(w(!0),S(He,null,wt(rt(z.value),(Ne,Je)=>(w(),S(He,{key:`seg-${Ge}-${Je}`},[Ne.kind==="text"?(w(),S("span",av,he(Ne.value),1)):Ne.kind==="file"?(w(),S("a",{key:1,class:"message-file-link",href:ge(Ne.path),target:"_blank",rel:"noopener noreferrer",title:Ne.path},he(Ne.displayPath),9,lv)):(w(),S("code",cv,he(Ne.value),1))],64))),128))])):Yt(E.id,Ge)?(w(),S("p",uv,he(z.markdown),1)):(w(),S("button",{key:2,class:"message-image-button",type:"button",onClick:Ne=>We(z.url)},[p("img",{class:"message-image-preview message-markdown-image",src:z.url,alt:z.alt||"Embedded message image",loading:"lazy",onError:Ne=>Mt(E.id,Ge)},null,40,fv)],8,dv))],64))),128))]))],8,Yg)):ue("",!0)],8,Vg),W(E)?(w(),S("button",{key:0,class:"rollback-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:z=>we(E)},[Ce(eg,{class:"rollback-icon"}),A[4]||(A[4]=p("span",{class:"rollback-label"},"Rollback",-1))],8,hv)):ue("",!0)],8,Ug)],8,Hg))],10,Pg)}),128)),e.liveOverlay?(w(),S("li",pv,[p("div",mv,[p("div",gv,[p("article",vv,[p("p",yv,he(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(w(),S("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:L},he(e.liveOverlay.reasoningText),513)):ue("",!0),e.liveOverlay.errorText?(w(),S("p",wv,he(e.liveOverlay.errorText),1)):ue("",!0)])])])])):ue("",!0),p("li",{ref_key:"bottomAnchorRef",ref:U,class:"conversation-bottom-anchor"},null,512)],544)),ce.value.length>0?(w(),S("div",{key:3,class:"image-modal-backdrop",onClick:Jt},[p("div",{class:"image-modal-content",onClick:A[0]||(A[0]=Xe(()=>{},["stop"]))},[p("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:Jt},[Ce(Ri,{class:"icon-svg"})]),p("img",{class:"image-modal-image",src:ce.value,alt:"Expanded message image"},null,8,bv)])])):ue("",!0)]))}}),Tv=et(kv,[["__scopeId","data-v-4b5665ad"]]);function Sv(e){var u;const t=P("idle"),n=P(typeof navigator<"u"&&!!((u=navigator.mediaDevices)!=null&&u.getUserMedia));let r=null,s=null,o=[];async function i(){var f;if(!(t.value!=="idle"||!n.value))try{s=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),o=[],r=new MediaRecorder(s),r.ondataavailable=m=>{m.data.size>0&&o.push(m.data)},r.onstop=()=>{var N;const m=o,b=(r==null?void 0:r.mimeType)||((N=m[0])==null?void 0:N.type)||"audio/webm";d(),t.value="idle",l(m,b)},r.start(),t.value="recording"}catch(m){d(),(f=e.onError)==null||f.call(e,m)}}function a(){t.value!=="recording"||!r||r.state!=="inactive"&&r.stop()}async function l(f,m){var N;if(f.length===0)return;const b=new Blob(f,{type:m});try{const I=m.split(/[/;]/)[1]??"webm",H=`----codex-transcribe-${crypto.randomUUID()}`,J=new Uint8Array(await b.arrayBuffer()),O=new TextEncoder,U=[];U.push(O.encode(`--${H}\r
27
+ `)),U.push(O.encode(`Content-Disposition: form-data; name="file"; filename="codex.${I}"\r
28
+ `)),U.push(O.encode(`Content-Type: ${m}\r
29
+ \r
30
+ `)),U.push(J),U.push(O.encode(`\r
31
+ --${H}--\r
32
+ `));let L=0;for(const re of U)L+=re.byteLength;const ce=new Uint8Array(L);let fe=0;for(const re of U)ce.set(re,fe),fe+=re.byteLength;const pe=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${H}`},body:ce});if(!pe.ok)throw new Error(`Transcription failed: ${pe.status}`);const ae=((await pe.json()).text??"").trim();ae.length>0&&e.onTranscript(ae)}catch(I){(N=e.onError)==null||N.call(e,I)}finally{t.value!=="recording"&&(t.value="idle")}}function d(){r&&(r.ondataavailable=null,r.onstop=null,r=null),s&&(s.getTracks().forEach(f=>f.stop()),s=null),o=[]}return Un(d),{state:t,isSupported:n,startRecording:i,stopRecording:a}}function Xa(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class On extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function $i(e,t){const n=Xa(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=Xa(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function Fr(e,t,n){return e instanceof On?e:e instanceof Error?new On(e.message||t,{code:"unknown_error",method:n}):new On(t,{code:"unknown_error",method:n})}function Gc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function xv(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 On(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 On($i(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 On(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function Za(e){const t=Gc(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 Cv(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=Za(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 d=JSON.parse(String(l.data)),u=Za(d);u&&e(u)}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 Ev(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 On(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 On($i(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function Av(){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 On($i(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Gc(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function el(e){return new Date(e*1e3).toISOString()}function Iv(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Rv(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const $v=/^##\s+(.+?):\s+(.+?)\s*$/,Mv=/^#\s*files mentioned by the user\s*:?\s*$/i;function Pv(e){var s,o;const t=e.split(`
33
+ `).findIndex(i=>Mv.test(i.trim()));if(t<0)return[];const n=e.split(`
34
+ `).slice(t+1),r=[];for(const i of n){const a=i.trim();if(!a)continue;const l=a.match($v);if(!l)break;const d=(s=l[1])==null?void 0:s.trim(),u=(o=l[2])==null?void 0:o.trim().replace(/\s+\((?:lines?\s+\d+(?:-\d+)?)\)\s*$/,"");d&&u&&r.push({label:d,path:u})}return r}function Ov(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 Nv(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:Rv(l),isUnhandled:!0});const o=n.join(`
35
+ `),i=Pv(o);return{text:Ov(o),images:r,fileAttachments:i,rawBlocks:s}}function jv(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=Nv(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=Dv(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 Dv(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function Lv(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function Bv(e){const t=Lv(e);return t.length>0?t:"Untitled thread"}function zc(e){return(e==null?void 0:e.status)==="inProgress"}function Fv(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 zc(r)}function Hv(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:Bv(e),projectName:Iv(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:el(e.createdAt),updatedAtIso:el(e.updatedAt),preview:e.preview,unread:!1,inProgress:Fv(e)}}function Uv(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 Vv(e){const t=e.data.map(Hv);return Uv(t)}function Yc(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 jv(i))n.push({...a,turnIndex:r})}return n}function Wv(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return zc(t.at(-1))}async function zt(e,t){try{return await xv(e,t)}catch(n){throw Fr(n,`RPC ${e} failed`,e)}}function qv(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function Kv(){const e=await zt("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return Vv(e)}async function Gv(e){const t=await zt("thread/read",{threadId:e,includeTurns:!0});return{messages:Yc(t),inProgress:Wv(t)}}async function zv(){try{return await Kv()}catch(e){throw Fr(e,"Failed to load thread groups","thread/list")}}async function Yv(e){try{return await Gv(e)}catch(t){throw Fr(t,`Failed to load thread ${e}`,"thread/read")}}function Jv(e){return Cv(e)}async function Qv(e,t){await Ev({id:e,...t})}async function Xv(){return Av()}async function Io(e){await zt("thread/resume",{threadId:e})}async function Zv(e){await zt("thread/archive",{threadId:e})}async function ey(e,t){await zt("thread/name/set",{threadId:e,name:t})}async function tl(e,t){const n=await zt("thread/rollback",{threadId:e,numTurns:t});return Yc(n)}function ty(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 nl(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 zt("thread/start",n),s=ty(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw Fr(n,"Failed to start a new thread","thread/start")}}function ny(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
36
+ `;for(const r of t)n+=`
37
+ ## ${r.label}: ${r.path}
38
+ `;return`${n}
39
+ ## My request for Codex:
40
+
41
+ ${e}
42
+ `}async function Ro(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:ny(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 d=i.map(f=>({label:f.label,path:f.path,fsPath:f.fsPath})),u={threadId:e,input:l};d.length>0&&(u.attachments=d),typeof r=="string"&&r.length>0&&(u.model=r),typeof s=="string"&&s.length>0&&(u.effort=s),await zt("turn/start",u)}catch(a){throw Fr(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function ry(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 zt("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw Fr(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function sy(e){await zt("setDefaultModel",{model:e})}async function oy(){const e=await zt("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 iy(){const e=await zt("config/read",{}),t=e.config.model??"",n=qv(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function ay(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 ni(){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 ay(n.data)}async function ly(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 rl(){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 cy(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 uy(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=Mi(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 dy(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=Mi(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 fy(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 d=Mi(o,"Failed to search files");throw new Error(d)}const i=o&&typeof o=="object"&&!Array.isArray(o)?o:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const d of a){if(!d||typeof d!="object"||Array.isArray(d))continue;const f=d.path,m=typeof f=="string"?f.trim():"";m&&l.push({path:m})}return l}async function hy(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 Mi(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 py(){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 $o(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 my(e,t){var n;try{return((n=(await zt("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function gy(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await zt("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 vy(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 yy={},wy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function by(e,t){return w(),S("svg",wy,[...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 _y=et(yy,[["render",by]]),ky={},Ty={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Sy(e,t){return w(),S("svg",Ty,[...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 xy=et(ky,[["render",Sy]]),Cy={},Ey={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ay(e,t){return w(),S("svg",Ey,[...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 Iy=et(Cy,[["render",Ay]]),Ry=["disabled"],$y={class:"composer-dropdown-value"},My={class:"composer-dropdown-menu"},Py={key:0,class:"composer-dropdown-search-wrap"},Oy=["placeholder","onKeydown"],Ny={class:"composer-dropdown-options",role:"listbox"},jy=["onClick"],Dy={key:0,class:"composer-dropdown-empty"},Ly={key:1,class:"composer-dropdown-add-wrap"},By=["placeholder","onKeydown"],Fy=It({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},showAddAction:{type:Boolean},addActionLabel:{},defaultAddValue:{},addPlaceholder:{}},emits:["update:modelValue","add"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(null),i=P(null),a=P(!1),l=P(""),d=P(!1),u=P(""),f=de(()=>{var ye;const re=n.options.find(oe=>oe.value===n.modelValue);return re?re.label:((ye=n.placeholder)==null?void 0:ye.trim())||""}),m=de(()=>n.openDirection??"down"),b=de(()=>n.enableSearch===!0),N=de(()=>n.showAddAction===!0),I=de(()=>{var re;return((re=n.searchPlaceholder)==null?void 0:re.trim())||"Quick search projects"}),H=de(()=>{var re;return((re=n.addActionLabel)==null?void 0:re.trim())||"Add new project"}),J=de(()=>{var re;return((re=n.addPlaceholder)==null?void 0:re.trim())||"Project name or absolute path"}),O=de(()=>{const re=l.value.trim().toLowerCase();return re?n.options.filter(ye=>ye.label.toLowerCase().includes(re)||ye.value.toLowerCase().includes(re)):n.options});function U(){n.disabled||(a.value=!a.value)}function L(re){r("update:modelValue",re),a.value=!1,l.value=""}function ce(){var re;d.value=!0,u.value=((re=n.defaultAddValue)==null?void 0:re.trim())||"",Zt(()=>{var ye;return(ye=i.value)==null?void 0:ye.focus()})}function fe(){if(l.value.length>0){l.value="";return}a.value=!1}function pe(){const re=u.value.trim();re&&(r("add",re),d.value=!1,u.value="",a.value=!1,l.value="")}function Se(){d.value=!1,u.value="",a.value=!1,l.value=""}function ae(re){if(!a.value)return;const ye=s.value;if(!ye)return;const oe=re.target;oe instanceof Node&&(ye.contains(oe)||(a.value=!1,l.value="",d.value=!1,u.value=""))}return ft(a,re=>{if(!re){d.value=!1,u.value="";return}b.value&&Zt(()=>{var ye;return(ye=o.value)==null?void 0:ye.focus()})}),Hn(()=>{window.addEventListener("pointerdown",ae)}),Un(()=>{window.removeEventListener("pointerdown",ae)}),(re,ye)=>(w(),S("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[p("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:U},[p("span",$y,he(f.value),1),Ce(lo,{class:"composer-dropdown-chevron"})],8,Ry),a.value?(w(),S("div",{key:0,class:ht(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":m.value==="up","composer-dropdown-menu-wrap-down":m.value==="down"}])},[p("div",My,[b.value?(w(),S("div",Py,[Ln(p("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":ye[0]||(ye[0]=oe=>l.value=oe),class:"composer-dropdown-search-input",type:"text",placeholder:I.value,onKeydown:Vt(Xe(fe,["prevent"]),["esc"])},null,40,Oy),[[Bn,l.value]])])):ue("",!0),p("ul",Ny,[(w(!0),S(He,null,wt(O.value,oe=>(w(),S("li",{key:oe.value},[p("button",{class:ht(["composer-dropdown-option",{"is-selected":oe.value===e.modelValue}]),type:"button",onClick:Be=>L(oe.value)},he(oe.label),11,jy)]))),128)),O.value.length===0?(w(),S("li",Dy," No matching projects ")):ue("",!0)]),N.value?(w(),S("div",Ly,[d.value?(w(),S(He,{key:0},[Ln(p("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":ye[1]||(ye[1]=oe=>u.value=oe),class:"composer-dropdown-add-input",type:"text",placeholder:J.value,onKeydown:[Vt(Xe(pe,["prevent"]),["enter"]),Vt(Xe(Se,["prevent"]),["esc"])]},null,40,By),[[Bn,u.value]]),p("div",{class:"composer-dropdown-add-actions"},[p("button",{type:"button",class:"composer-dropdown-add-btn",onClick:pe},"Open"),p("button",{type:"button",class:"composer-dropdown-add-btn",onClick:Se},"Cancel")])],64)):(w(),S("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:ce},he(H.value),1))])):ue("",!0)])],2)):ue("",!0)],512))}}),ri=et(Fy,[["__scopeId","data-v-7cfa2012"]]),Hy=["disabled"],Uy={class:"search-dropdown-value"},Vy={class:"search-dropdown-search-wrap"},Wy=["placeholder","onKeydown"],qy={key:0,class:"search-dropdown-list",role:"listbox"},Ky=["onClick","onPointerenter"],Gy={class:"search-dropdown-option-check"},zy={class:"search-dropdown-option-label"},Yy={key:0,class:"search-dropdown-option-desc"},Jy={key:1,class:"search-dropdown-empty"},Qy=It({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(null),i=P(!1),a=P(""),l=P(0),d=de(()=>n.openDirection??"down"),u=de(()=>new Set(n.selectedValues)),f=de(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const O=n.options.find(U=>U.value===n.selectedValues[0]);return(O==null?void 0:O.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),m=de(()=>{const O=a.value.toLowerCase().trim();return O?n.options.filter(U=>{var L;return U.label.toLowerCase().includes(O)||(((L=U.description)==null?void 0:L.toLowerCase().includes(O))??!1)}):n.options});function b(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,Zt(()=>{var O;return(O=o.value)==null?void 0:O.focus()})))}function N(O){r("toggle",O.value,!u.value.has(O.value))}function I(O){m.value.length!==0&&(l.value=(l.value+O+m.value.length)%m.value.length)}function H(){const O=m.value[l.value];O&&N(O)}function J(O){if(!i.value)return;const U=s.value;if(!U)return;const L=O.target;L instanceof Node&&(U.contains(L)||(i.value=!1))}return ft(a,()=>{l.value=0}),Hn(()=>window.addEventListener("pointerdown",J)),Un(()=>window.removeEventListener("pointerdown",J)),(O,U)=>(w(),S("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[p("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:b},[p("span",Uy,he(f.value),1),Ce(lo,{class:"search-dropdown-chevron"})],8,Hy),i.value?(w(),S("div",{key:0,class:ht(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":d.value==="up","search-dropdown-menu-wrap-down":d.value==="down"}])},[p("div",Vy,[Ln(p("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":U[0]||(U[0]=L=>a.value=L),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[U[1]||(U[1]=Vt(Xe(L=>i.value=!1,["prevent"]),["escape"])),Vt(Xe(H,["prevent"]),["enter"]),U[2]||(U[2]=Vt(Xe(L=>I(1),["prevent"]),["arrow-down"])),U[3]||(U[3]=Vt(Xe(L=>I(-1),["prevent"]),["arrow-up"]))]},null,40,Wy),[[Bn,a.value]])]),m.value.length>0?(w(),S("ul",qy,[(w(!0),S(He,null,wt(m.value,(L,ce)=>(w(),S("li",{key:L.value},[p("button",{class:ht(["search-dropdown-option",{"is-selected":u.value.has(L.value),"is-highlighted":ce===l.value}]),type:"button",onClick:fe=>N(L),onPointerenter:fe=>l.value=ce},[p("span",Gy,he(u.value.has(L.value)?"✓":""),1),p("span",zy,he(L.label),1),L.description?(w(),S("span",Yy,he(L.description),1)):ue("",!0)],42,Ky)]))),128))])):(w(),S("div",Jy,"No results"))],2)):ue("",!0)],512))}}),Xy=et(Qy,[["__scopeId","data-v-a0f2edd4"]]),Zy={class:"skill-picker-header"},ew=["onKeydown"],tw={key:0,class:"skill-picker-list",role:"listbox"},nw=["onClick","onPointerenter"],rw={class:"skill-picker-name"},sw={key:0,class:"skill-picker-desc"},ow={key:1,class:"skill-picker-empty"},iw=It({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(null),i=P(""),a=P(0),l=de(()=>{const m=i.value.toLowerCase().trim();return m?n.skills.filter(b=>b.name.toLowerCase().includes(m)||b.description.toLowerCase().includes(m)):n.skills}),d=de(()=>{const m={};return n.anchorBottom!=null&&(m.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(m.left=`${n.anchorLeft}px`),m});function u(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 ft(()=>n.visible,m=>{m&&(i.value="",a.value=0,Zt(()=>{var b;return(b=o.value)==null?void 0:b.focus()}))}),ft(i,()=>{a.value=0}),(m,b)=>e.visible?(w(),S("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:wr(d.value)},[p("div",Zy,[Ln(p("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":b[0]||(b[0]=N=>i.value=N),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[b[1]||(b[1]=Vt(Xe(N=>m.$emit("close"),["prevent"]),["escape"])),Vt(Xe(f,["prevent"]),["enter"]),b[2]||(b[2]=Vt(Xe(N=>u(1),["prevent"]),["arrow-down"])),b[3]||(b[3]=Vt(Xe(N=>u(-1),["prevent"]),["arrow-up"]))]},null,40,ew),[[Bn,i.value]])]),l.value.length>0?(w(),S("ul",tw,[(w(!0),S(He,null,wt(l.value,(N,I)=>(w(),S("li",{key:N.path},[p("button",{class:ht(["skill-picker-item",{"is-highlighted":I===a.value}]),type:"button",onClick:H=>m.$emit("select",N),onPointerenter:H=>a.value=I},[p("span",rw,he(N.name),1),N.description?(w(),S("span",sw,he(N.description),1)):ue("",!0)],42,nw)]))),128))])):(w(),S("div",ow,"No skills found"))],4)):ue("",!0)}}),aw=et(iw,[["__scopeId","data-v-d6a08788"]]),lw={key:0,class:"thread-composer-attachments"},cw=["src","alt"],uw=["aria-label","disabled","onClick"],dw={key:1,class:"thread-composer-file-chips"},fw=["title"],hw=["aria-label","disabled","onClick"],pw={key:2,class:"thread-composer-skill-chips"},mw={class:"thread-composer-skill-chip-name"},gw=["aria-label","onClick"],vw={class:"thread-composer-input-wrap"},yw={key:0,class:"thread-composer-file-mentions"},ww=["onMousedown"],bw={key:1,class:"thread-composer-file-mention-icon-markdown"},_w={class:"thread-composer-file-mention-text"},kw={class:"thread-composer-file-mention-name"},Tw={key:0,class:"thread-composer-file-mention-dir"},Sw={key:1,class:"thread-composer-file-mention-empty"},xw=["placeholder","disabled"],Cw={class:"thread-composer-controls"},Ew=["disabled"],Aw={key:0,class:"thread-composer-attach-menu"},Iw=["disabled"],Rw=["disabled"],$w={class:"thread-composer-actions"},Mw=["aria-label","title","disabled"],Pw=["disabled"],Ow=["aria-label","title","disabled"],Nw=["disabled"],jw=["disabled"],Dw=It({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},models:{},selectedModel:{},selectedReasoningEffort:{},skills:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(e,{emit:t}){const n=e,r=t,s=P(""),o=P([]),i=P([]),a=P([]),{state:l,isSupported:d,startRecording:u,stopRecording:f}=Sv({onTranscript:B=>{s.value=s.value?`${s.value}
43
+ ${B}`:B}}),m=P(null),b=P(null),N=P(null),I=P(null),H=P(!1),J=P(!1),O=P(null),U=P(""),L=P([]),ce=P(!1),fe=P(0);let pe=0,Se=null;const ae=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),re=[{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"}],ye=de(()=>n.models.map(B=>({value:B,label:B}))),oe=de(()=>n.skills??[]),Be=de(()=>i.value.map(B=>B.path)),Fe=de(()=>(n.skills??[]).map(B=>({value:B.path,label:B.name,description:B.description}))),Ke=de(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),Ie=de(()=>n.disabled||!n.activeThreadId),ke=de(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),Me=de(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function vt(B="steer"){var Z;const V=s.value.trim();if(Ke.value){if(r("submit",{text:V,imageUrls:o.value.map(ze=>ze.url),fileAttachments:[...a.value],skills:i.value.map(ze=>({name:ze.name,path:ze.path})),mode:B}),s.value="",o.value=[],i.value=[],a.value=[],H.value=!1,J.value=!1,te(),ae){(Z=I.value)==null||Z.blur();return}Zt(()=>{var ze;return(ze=I.value)==null?void 0:ze.focus()})}}function nt(){r("interrupt")}function ot(B){r("update:selected-model",B)}function rt(B){r("update:selected-reasoning-effort",B)}function Ze(){Ie.value||(H.value=!H.value)}function ge(){var B;(B=b.value)==null||B.click()}function Ae(){var B;(B=N.value)==null||B.click()}function Te(B){o.value=o.value.filter(V=>V.id!==B)}function R(B){i.value=i.value.filter(V=>V.path!==B)}function ee(B){a.value=a.value.filter(V=>V.fsPath!==B)}function Q(B){const V=B.replace(/\\/g,"/");if(a.value.some(We=>We.fsPath===V))return;const Z=V.split("/").filter(Boolean),ze=Z[Z.length-1]??V;a.value=[...a.value,{label:ze,path:V,fsPath:V}]}function me(B){return B.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(B.name)}function Pe(B){if(!(!B||B.length===0))for(const V of Array.from(B))if(me(V)){const Z=new FileReader;Z.onload=()=>{typeof Z.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:V.name,url:Z.result})},Z.readAsDataURL(V)}else vy(V).then(Z=>{Z&&Q(Z)}).catch(()=>{})}function g(B){B&&(B.value="")}function y(B){const V=B.target;Pe((V==null?void 0:V.files)??null),g(V),H.value=!1}function x(B){const V=B.target;Pe((V==null?void 0:V.files)??null),g(V),H.value=!1}function D(){const V=s.value.startsWith("/");V!==J.value&&(J.value=V),ie()}function F(B){if(ce.value){if(B.key==="Escape"){B.preventDefault(),te();return}if(B.key==="ArrowDown"){B.preventDefault(),L.value.length>0&&(fe.value=(fe.value+1)%L.value.length);return}if(B.key==="ArrowUp"){if(B.preventDefault(),L.value.length>0){const Z=L.value.length;fe.value=(fe.value+Z-1)%Z}return}if(B.key==="Enter"||B.key==="Tab"){B.preventDefault();const Z=L.value[fe.value];Z?W(Z):te();return}}if(n.sendWithEnter!==!1?B.key==="Enter"&&!B.shiftKey:B.key==="Enter"&&(B.metaKey||B.ctrlKey)){B.preventDefault(),vt(n.isTurnInProgress?ke.value:"steer");return}if(J.value){if(B.key==="Escape"){B.preventDefault(),j();return}if(B.key==="ArrowDown"||B.key==="ArrowUp"){B.preventDefault();return}}}function j(){var B;J.value=!1,(B=I.value)==null||B.focus()}function te(){ce.value=!1,O.value=null,U.value="",L.value=[],fe.value=0}function ie(){const B=I.value;if(!B){te();return}const V=B.selectionStart??s.value.length,ze=s.value.slice(0,V).match(/(^|\s)(@[^\s@]*)$/);if(!ze){te();return}const We=ze[2]??"",Ye=We.length,Mt=V-Ye;O.value=Mt,U.value=We.slice(1),ce.value=!0,ne()}async function ne(){if(!ce.value)return;const B=(n.cwd??"").trim();if(!B){L.value=[];return}Se&&clearTimeout(Se);const V=++pe;Se=setTimeout(async()=>{try{const Z=await fy(B,U.value,20);if(!ce.value||V!==pe)return;L.value=Z,fe.value=0}catch{if(!ce.value||V!==pe)return;L.value=[]}},120)}function W(B){const V=I.value,Z=O.value;if(Z!==null&&V){const ze=V.selectionStart??s.value.length;s.value=`${s.value.slice(0,Z)}${s.value.slice(ze)}`.trimEnd()}Q(B.path),te(),Zt(()=>V==null?void 0:V.focus())}function we(B){const V=B.lastIndexOf("/");return V<0?B:B.slice(V+1)}function le(B){const V=B.lastIndexOf("/");return V<=0?"":B.slice(0,V)}function be(B){const V=we(B),Z=V.lastIndexOf(".");return Z<=0?"":V.slice(Z+1).toLowerCase()}function xe(B){const V=be(B);return V==="ts"?"TS":V==="tsx"?"TSX":V==="js"?"JS":V==="jsx"?"JSX":V==="json"?"{}":""}function Oe(B){const V=be(B);return V.startsWith("ts")?"ts":V.startsWith("js")?"js":V==="json"?"json":"default"}function Ve(B){const V=be(B);return V==="md"||V==="mdx"}function Ee(B){var V;i.value.some(Z=>Z.path===B.path)||(i.value=[...i.value,B]),s.value=s.value.startsWith("/")?"":s.value,J.value=!1,(V=I.value)==null||V.focus()}function ut(B,V){if(V){const Z=(n.skills??[]).find(ze=>ze.path===B);Z&&!i.value.some(ze=>ze.path===B)&&(i.value=[...i.value,Z])}else i.value=i.value.filter(Z=>Z.path!==B)}function Qe(B){if(!H.value)return;const V=m.value;if(!V)return;const Z=B.target;!Z||V.contains(Z)||(H.value=!1)}return Hn(()=>{document.addEventListener("click",Qe)}),Un(()=>{document.removeEventListener("click",Qe),Se&&clearTimeout(Se)}),ft(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],H.value=!1,J.value=!1,te()}),ft(()=>n.cwd,()=>{ce.value&&ne()}),(B,V)=>(w(),S("form",{class:"thread-composer",onSubmit:V[7]||(V[7]=Xe(Z=>vt("steer"),["prevent"]))},[p("div",{class:ht(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(w(),S("div",lw,[(w(!0),S(He,null,wt(o.value,Z=>(w(),S("div",{key:Z.id,class:"thread-composer-attachment"},[p("img",{class:"thread-composer-attachment-image",src:Z.url,alt:Z.name||"Selected image"},null,8,cw),p("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${Z.name||"image"}`,disabled:Ie.value,onClick:ze=>Te(Z.id)}," x ",8,uw)]))),128))])):ue("",!0),a.value.length>0?(w(),S("div",dw,[(w(!0),S(He,null,wt(a.value,Z=>(w(),S("span",{key:Z.fsPath,class:"thread-composer-file-chip"},[Ce(qs,{class:"thread-composer-file-chip-icon"}),p("span",{class:"thread-composer-file-chip-name",title:Z.fsPath},he(Z.label),9,fw),p("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${Z.label}`,disabled:Ie.value,onClick:ze=>ee(Z.fsPath)},"×",8,hw)]))),128))])):ue("",!0),i.value.length>0?(w(),S("div",pw,[(w(!0),S(He,null,wt(i.value,Z=>(w(),S("span",{key:Z.path,class:"thread-composer-skill-chip"},[p("span",mw,he(Z.name),1),p("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${Z.name}`,onClick:ze=>R(Z.path)},"×",8,gw)]))),128))])):ue("",!0),p("div",vw,[ce.value?(w(),S("div",yw,[L.value.length>0?(w(!0),S(He,{key:0},wt(L.value,(Z,ze)=>(w(),S("button",{key:Z.path,class:ht(["thread-composer-file-mention-row",{"is-active":ze===fe.value}]),type:"button",onMousedown:Xe(We=>W(Z),["prevent"])},[xe(Z.path)?(w(),S("span",{key:0,class:ht(["thread-composer-file-mention-icon-badge",`is-${Oe(Z.path)}`])},he(xe(Z.path)),3)):Ve(Z.path)?(w(),S("span",bw,"↓")):(w(),pt(qs,{key:2,class:"thread-composer-file-mention-icon-file"})),p("span",_w,[p("span",kw,he(we(Z.path)),1),le(Z.path)?(w(),S("span",Tw,he(le(Z.path)),1)):ue("",!0)])],42,ww))),128)):(w(),S("div",Sw,"No matching files"))])):ue("",!0),Ln(p("textarea",{ref_key:"inputRef",ref:I,"onUpdate:modelValue":V[0]||(V[0]=Z=>s.value=Z),class:"thread-composer-input",placeholder:Me.value,disabled:Ie.value,onInput:D,onKeydown:F},null,40,xw),[[Bn,s.value]]),Ce(aw,{skills:oe.value,visible:J.value,"anchor-bottom":44,"anchor-left":0,onSelect:Ee,onClose:j},null,8,["skills","visible"])]),p("div",Cw,[p("div",{ref_key:"attachMenuRootRef",ref:m,class:"thread-composer-attach"},[p("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:Ie.value,onClick:Ze}," + ",8,Ew),H.value?(w(),S("div",Aw,[p("button",{class:"thread-composer-attach-item",type:"button",disabled:Ie.value,onClick:ge}," Add photos & files ",8,Iw),p("button",{class:"thread-composer-attach-item",type:"button",disabled:Ie.value,onClick:Ae}," Take photo ",8,Rw)])):ue("",!0)],512),Ce(ri,{class:"thread-composer-control","model-value":e.selectedModel,options:ye.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":ot},null,8,["model-value","options","disabled"]),Ce(Xy,{class:"thread-composer-control",options:Fe.value,"selected-values":Be.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:ut},null,8,["options","selected-values","disabled"]),Ce(ri,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:re,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":rt},null,8,["model-value","disabled"]),p("div",$w,[je(d)&&!e.isTurnInProgress?(w(),S("button",{key:0,class:ht(["thread-composer-mic",{"thread-composer-mic--active":je(l)!=="idle"}]),type:"button","aria-label":je(l)==="recording"?"Stop dictation":"Hold to dictate",title:je(l)==="recording"?"Release to transcribe":"Hold to dictate",disabled:Ie.value,onMousedown:V[1]||(V[1]=Xe((...Z)=>je(u)&&je(u)(...Z),["prevent"])),onMouseup:V[2]||(V[2]=(...Z)=>je(f)&&je(f)(...Z)),onMouseleave:V[3]||(V[3]=Z=>je(l)==="recording"&&je(f)()),onTouchstart:V[4]||(V[4]=Xe((...Z)=>je(u)&&je(u)(...Z),["prevent"])),onTouchend:V[5]||(V[5]=(...Z)=>je(f)&&je(f)(...Z))},[Ce(xy,{class:"thread-composer-mic-icon"})],42,Mw)):ue("",!0),e.isTurnInProgress?(w(),S("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:nt},[Ce(Iy,{class:"thread-composer-stop-icon"})],8,Pw)):ue("",!0),p("button",{class:ht(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&ke.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&ke.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${ke.value}`:"Send",disabled:!Ke.value,onClick:V[6]||(V[6]=Z=>vt(e.isTurnInProgress?ke.value:"steer"))},[Ce(_y,{class:"thread-composer-submit-icon"})],10,Ow)])])],2),p("input",{ref_key:"photoLibraryInputRef",ref:b,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:Ie.value,onChange:y},null,40,Nw),p("input",{ref_key:"cameraCaptureInputRef",ref:N,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:Ie.value,onChange:x},null,40,jw)],32))}}),sl=et(Dw,[["__scopeId","data-v-983e7906"]]),Lw={key:0,class:"queued-messages"},Bw={class:"queued-messages-inner"},Fw={class:"queued-row-text"},Hw={class:"queued-row-actions"},Uw=["onClick"],Vw=["onClick"],Ww=It({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(w(),S("div",Lw,[p("div",Bw,[(w(!0),S(He,null,wt(e.messages,r=>(w(),S("div",{key:r.id,class:"queued-row"},[n[1]||(n[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",Fw,he(r.text),1),p("div",Hw,[p("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,Uw),p("button",{class:"queued-row-delete",type:"button","aria-label":"Delete queued message",title:"Delete queued message",onClick:s=>t.$emit("delete",r.id)},[...n[0]||(n[0]=[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,Vw)])]))),128))])])):ue("",!0)}}),qw=et(Ww,[["__scopeId","data-v-ea583733"]]),Kw={class:"runtime-dropdown-trigger-label"},Gw={key:0,class:"runtime-dropdown-menu-wrap"},zw={class:"runtime-dropdown-menu"},Yw=["onClick"],Jw={class:"runtime-dropdown-option-label"},Qw={key:0,class:"runtime-dropdown-option-check"},Xw=It({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(!1),i=[{value:"local",label:"Local project",icon:Kc},{value:"worktree",label:"New worktree",icon:js}],a=de(()=>i.find(u=>u.value===n.modelValue)??i[0]);function l(u){r("update:modelValue",u),o.value=!1}function d(u){if(!o.value)return;const f=s.value;if(!f)return;const m=u.target;m instanceof Node&&(f.contains(m)||(o.value=!1))}return Hn(()=>{window.addEventListener("pointerdown",d)}),Un(()=>{window.removeEventListener("pointerdown",d)}),(u,f)=>(w(),S("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(),pt(qo(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),p("span",Kw,he(a.value.label),1),Ce(lo,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(w(),S("div",Gw,[p("div",zw,[f[1]||(f[1]=p("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(w(),S(He,null,wt(i,m=>p("button",{key:m.value,class:ht(["runtime-dropdown-option",{"is-selected":e.modelValue===m.value}]),type:"button",onClick:b=>l(m.value)},[(w(),pt(qo(m.icon),{class:"runtime-dropdown-option-icon"})),p("span",Jw,he(m.label),1),e.modelValue===m.value?(w(),S("span",Qw,"✓")):ue("",!0)],10,Yw)),64))])])):ue("",!0)],512))}}),Zw=et(Xw,[["__scopeId","data-v-9c9b71e5"]]),eb={},tb={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function nb(e,t){return w(),S("svg",tb,[...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 si=et(eb,[["render",nb]]),rb={class:"skill-card-top"},sb=["src","alt"],ob={key:1,class:"skill-card-avatar-fallback"},ib={class:"skill-card-info"},ab={class:"skill-card-header"},lb={class:"skill-card-name"},cb={key:0,class:"skill-card-badge-disabled"},ub={key:1,class:"skill-card-badge"},db={class:"skill-card-owner"},fb={key:0,class:"skill-card-desc"},hb={key:1,class:"skill-card-date"},pb=It({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=de(()=>{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(),S("button",{class:ht(["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",rb,[e.skill.avatarUrl?(w(),S("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,sb)):(w(),S("div",ob,he(e.skill.owner.charAt(0)),1)),p("div",ib,[p("div",ab,[p("span",lb,he(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(w(),S("span",cb,"Disabled")):e.skill.installed?(w(),S("span",ub,"Installed")):ue("",!0)]),p("span",db,he(e.skill.owner),1)])]),e.skill.description?(w(),S("p",fb,he(e.skill.description),1)):ue("",!0),n.value?(w(),S("span",hb,he(n.value),1)):ue("",!0)],2))}}),ol=et(pb,[["__scopeId","data-v-2a1e8196"]]),mb={class:"sdm-panel"},gb={class:"sdm-header"},vb={class:"sdm-title-area"},yb=["src","alt"],wb={class:"sdm-title-col"},bb={class:"sdm-title-row"},_b={class:"sdm-title"},kb={key:0,class:"sdm-badge-disabled"},Tb={class:"sdm-owner"},Sb={class:"sdm-body"},xb={key:0,class:"sdm-desc"},Cb={key:1,class:"sdm-readme-loading"},Eb=["innerHTML"],Ab=["href"],Ib={class:"sdm-footer"},Rb={class:"sdm-footer-actions"},$b=["disabled"],Mb=["disabled"],Pb=["disabled"],Ob=It({__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=P(null),o=P(""),i=P(!1),a=de(()=>s.value??n.skill.enabled??!0),l=de(()=>n.isInstalling===!0||n.isUninstalling===!0),d=de(()=>{const I=o.value;if(!I)return"";const H=I.replace(/^---[\s\S]*?---\s*/,"");return u(H)});function u(I){return I.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 I=new URLSearchParams({owner:n.skill.owner,name:n.skill.name}),H=await fetch(`/codex-api/skills-hub/readme?${I}`);if(!H.ok)return;const J=await H.json();o.value=J.content??""}catch{}finally{i.value=!1}}}ft(()=>n.visible,I=>{I&&(s.value=null,o.value="",f())});function m(){r("install",n.skill)}function b(){r("uninstall",n.skill)}function N(){const I=!a.value;s.value=I,r("toggle-enabled",n.skill,I)}return(I,H)=>(w(),pt(Fs,{to:"body"},[e.visible?(w(),S("div",{key:0,class:"sdm-overlay",onClick:H[1]||(H[1]=Xe(J=>I.$emit("close"),["self"]))},[p("div",mb,[p("div",gb,[p("div",vb,[e.skill.avatarUrl?(w(),S("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,yb)):ue("",!0),p("div",wb,[p("div",bb,[p("h3",_b,he(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(w(),S("span",kb,"Disabled")):ue("",!0)]),p("span",Tb,he(e.skill.owner),1)])]),p("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:H[0]||(H[0]=J=>I.$emit("close"))},[Ce(Ri,{class:"sdm-close-icon"})])]),p("div",Sb,[e.skill.description?(w(),S("p",xb,he(e.skill.description),1)):ue("",!0),i.value?(w(),S("div",Cb,"Loading skill contents...")):o.value?(w(),S("div",{key:2,class:"sdm-readme",innerHTML:d.value},null,8,Eb)):ue("",!0),p("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,Ab)]),p("div",Ib,[p("div",Rb,[e.skill.installed?(w(),S("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:b},he(n.isUninstalling?"Uninstalling...":"Uninstall"),9,$b)):(w(),S("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:m},he(n.isInstalling?"Installing...":"Install"),9,Mb)),e.skill.installed?(w(),S("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:N},he(a.value?"Disable":"Enable"),9,Pb)):ue("",!0)])])])])):ue("",!0)]))}}),Nb=et(Ob,[["__scopeId","data-v-19a385ca"]]),jb={class:"skills-hub"},Db={class:"skills-hub-toolbar"},Lb={class:"skills-hub-search-wrap"},Bb={key:0,class:"skills-hub-count"},Fb={key:1,class:"skills-hub-section"},Hb={class:"skills-hub-section-title"},Ub={key:0,class:"skills-hub-grid"},Vb={class:"skills-hub-section"},Wb={key:0,class:"skills-hub-loading"},qb={key:1,class:"skills-hub-error"},Kb={key:0,class:"skills-hub-grid"},Gb={key:1,class:"skills-hub-empty"},Es="codex-web-local.skills-hub.cache.v1",zb=It({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=P(null),s=P(""),o=P("date"),i=P([]),a=P([]),l=P(0),d=P(!1),u=P(""),f=P(!0),m=P(!1),b=P(n),N=P(null),I=P(""),H=P(!1),J=P(!1);let O=null,U=null;const L=t,ce=de(()=>o.value==="date"?"Newest":"A-Z"),fe=de(()=>{var ge;return((ge=N.value)==null?void 0:ge.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),pe=de(()=>`${b.value.owner}/${b.value.name}`),Se=de(()=>H.value&&I.value===pe.value),ae=de(()=>J.value&&I.value===pe.value),re=de(()=>{const ge=s.value.toLowerCase().trim();return ge?a.value.filter(Ae=>Ae.name.toLowerCase().includes(ge)||Ae.owner.toLowerCase().includes(ge)||(Ae.displayName??"").toLowerCase().includes(ge)):a.value});function ye(ge,Ae="success"){N.value={text:ge,type:Ae},U&&clearTimeout(U),U=setTimeout(()=>{N.value=null},3e3)}function oe(){o.value=o.value==="date"?"name":"date",Me(s.value)}function Be(ge){return`${o.value}::${ge.trim().toLowerCase()}`}function Fe(ge){var Ae;if(typeof window>"u")return null;try{const Te=window.localStorage.getItem(Es);return Te?((Ae=JSON.parse(Te).byKey)==null?void 0:Ae[ge])??null:null}catch{return null}}function Ke(ge,Ae){if(!(typeof window>"u"))try{const Te=window.localStorage.getItem(Es),ee=(Te?JSON.parse(Te):{}).byKey??{};ee[ge]=Ae,window.localStorage.setItem(Es,JSON.stringify({byKey:ee}))}catch{}}function Ie(){if(!(typeof window>"u"))try{window.localStorage.removeItem(Es)}catch{}}function ke(ge){const Ae=ge.installed??[];a.value=Ae;const Te=new Set(Ae.map(R=>R.name));i.value=ge.data.map(R=>{if(R.installed||Te.has(R.name)){const ee=Ae.find(Q=>Q.name===R.name);return{...R,installed:!0,path:(ee==null?void 0:ee.path)??R.path,enabled:(ee==null?void 0:ee.enabled)??R.enabled}}return R}).filter(R=>!R.installed),l.value=ge.total}async function Me(ge){const Ae=Be(ge),Te=Fe(Ae);Te&&ke(Te),d.value=!Te,u.value="";try{const R=new URLSearchParams;ge.trim()&&R.set("q",ge.trim()),R.set("limit","100"),R.set("sort",o.value);const ee=await fetch(`/codex-api/skills-hub?${R}`);if(!ee.ok)throw new Error(`HTTP ${ee.status}`);const Q=await ee.json();ke(Q),Ke(Ae,Q)}catch(R){u.value=R instanceof Error?R.message:"Failed to load skills"}finally{d.value=!1}}function vt(){O&&clearTimeout(O),O=setTimeout(()=>Me(s.value),300)}function nt(ge){b.value=ge,m.value=!0}async function ot(ge){I.value=`${ge.owner}/${ge.name}`,H.value=!0;try{const Te=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:ge.owner,name:ge.name})})).json();if(!Te.ok)throw new Error(Te.error||"Install failed");const R={...ge,installed:!0,path:Te.path,enabled:!0};a.value=[...a.value,R],i.value=i.value.filter(ee=>ee.name!==ge.name),b.value=R,ye(`${ge.displayName||ge.name} skill installed`),m.value=!1,Ie(),L("skills-changed")}catch(Ae){ye(Ae instanceof Error?Ae.message:"Failed to install skill","error")}finally{H.value=!1}}async function rt(ge){I.value=`${ge.owner}/${ge.name}`,J.value=!0;try{const Te=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ge.name,path:ge.path})})).json();if(!Te.ok)throw new Error(Te.error||"Uninstall failed");a.value=a.value.filter(R=>R.name!==ge.name),ge.owner!=="local"&&(i.value=[...i.value,{...ge,installed:!1,path:void 0,enabled:void 0}]),ye(`${ge.displayName||ge.name} skill uninstalled`),m.value=!1,Ie(),L("skills-changed")}catch(Ae){ye(Ae instanceof Error?Ae.message:"Failed to uninstall skill","error")}finally{J.value=!1}}async function Ze(ge,Ae){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:ge.path,enabled:Ae}})})).ok)throw new Error("Failed to update skill");ye(`${ge.displayName||ge.name} skill ${Ae?"enabled":"disabled"}`),await Me(s.value)}catch(Te){ye(Te instanceof Error?Te.message:"Failed to update skill","error")}}return Hn(()=>{Me("")}),(ge,Ae)=>(w(),S("div",jb,[Ae[3]||(Ae[3]=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",Db,[p("div",Lb,[Ce(si,{class:"skills-hub-search-icon"}),Ln(p("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":Ae[0]||(Ae[0]=Te=>s.value=Te),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:vt},null,544),[[Bn,s.value]]),l.value>0?(w(),S("span",Bb,he(l.value)+" skills",1)):ue("",!0)]),p("button",{class:"skills-hub-sort",type:"button",onClick:oe},he(ce.value),1)]),N.value?(w(),S("div",{key:0,class:ht(["skills-hub-toast",fe.value])},he(N.value.text),3)):ue("",!0),re.value.length>0?(w(),S("div",Fb,[p("button",{class:"skills-hub-section-toggle",type:"button",onClick:Ae[1]||(Ae[1]=Te=>f.value=!f.value)},[p("span",Hb,"Installed ("+he(re.value.length)+")",1),Ce(qc,{class:ht(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(w(),S("div",Ub,[(w(!0),S(He,null,wt(re.value,Te=>(w(),pt(ol,{key:Te.name,skill:Te,onSelect:R=>nt(R)},null,8,["skill","onSelect"]))),128))])):ue("",!0)])):ue("",!0),p("div",Vb,[d.value?(w(),S("div",Wb,"Loading skills...")):u.value?(w(),S("div",qb,he(u.value),1)):(w(),S(He,{key:2},[i.value.length>0?(w(),S("div",Kb,[(w(!0),S(He,null,wt(i.value,Te=>(w(),pt(ol,{key:Te.url,skill:Te,onSelect:R=>nt(R)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(w(),S("div",Gb,'No skills found for "'+he(s.value)+'"',1)):ue("",!0)],64))]),Ce(Nb,{skill:b.value,visible:m.value,"is-installing":Se.value,"is-uninstalling":ae.value,onClose:Ae[2]||(Ae[2]=Te=>m.value=!1),onInstall:ot,onUninstall:rt,onToggleEnabled:Ze},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),Yb=et(zb,[["__scopeId","data-v-1967b404"]]),Jb={},Qb={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 Xb(e,t){return w(),S("svg",Qb,[...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 Zb=et(Jb,[["render",Xb]]),e0={},t0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function n0(e,t){return w(),S("svg",t0,[...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 r0=et(e0,[["render",n0]]),s0={},o0={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function i0(e,t){return w(),S("svg",o0,[...t[0]||(t[0]=[p("path",{d:"M20 11a8.1 8.1 0 0 0-15.5-2m-.5-4v4h4"},null,-1),p("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null,-1)])])}const a0=et(s0,[["render",i0]]),l0={class:"sidebar-thread-controls"},c0=["aria-label","title"],u0=["aria-pressed","aria-label","title"],d0=It({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},isAutoRefreshEnabled:{type:Boolean},autoRefreshButtonLabel:{},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","toggle-auto-refresh","start-new-thread"],setup(e){return(t,n)=>(w(),S("div",l0,[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(),pt(r0,{key:0,class:"sidebar-thread-controls-icon"})):(w(),pt(Zb,{key:1,class:"sidebar-thread-controls-icon"}))],8,c0),p("button",{class:"sidebar-thread-controls-button",type:"button","aria-pressed":e.isAutoRefreshEnabled,"aria-label":e.autoRefreshButtonLabel,title:e.autoRefreshButtonLabel,onClick:n[1]||(n[1]=r=>t.$emit("toggle-auto-refresh"))},[Ce(a0,{class:"sidebar-thread-controls-icon"})],8,u0),yn(t.$slots,"default",{},void 0),e.showNewThreadButton?(w(),S("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[2]||(n[2]=r=>t.$emit("start-new-thread"))},[Ce(qs,{class:"sidebar-thread-controls-icon"})])):ue("",!0)]))}}),il=et(d0,[["__scopeId","data-v-57866500"]]),f0={},h0={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function p0(e,t){return w(),S("svg",h0,[...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 m0=et(f0,[["render",p0]]);function Zn(e){return e.flatMap(t=>t.threads)}const Jc="codex-web-local.thread-read-state.v1",Qc="codex-web-local.thread-scroll-state.v1",oi="codex-web-local.selected-thread-id.v1",Xc="codex-web-local.project-order.v1",Zc="codex-web-local.project-display-name.v1",eu="codex-web-local.auto-refresh-enabled.v1",Mo=220,Zr=4e3,al=["none","minimal","low","medium","high","xhigh"],es="__global__",nn="gpt-5.2-codex";function g0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Jc);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function ll(e){typeof window>"u"||window.localStorage.setItem(Jc,JSON.stringify(e))}function v0(){return typeof window>"u"?!1:window.localStorage.getItem(eu)==="1"}function cl(e){typeof window>"u"||window.localStorage.setItem(eu,e?"1":"0")}function tu(e,t,n){return Math.min(Math.max(e,t),n)}function y0(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=tu(t.scrollRatio,0,1)),n}function w0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Qc);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=y0(s);o&&(n[r]=o)}return n}catch{return{}}}function ul(e){typeof window>"u"||window.localStorage.setItem(Qc,JSON.stringify(e))}function b0(){return typeof window>"u"?"":window.localStorage.getItem(oi)??""}function _0(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(oi);return}window.localStorage.setItem(oi,e)}}function k0(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Xc);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 Ar(e){typeof window>"u"||window.localStorage.setItem(Xc,JSON.stringify(e))}function T0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Zc);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 Po(e){typeof window>"u"||window.localStorage.setItem(Zc,JSON.stringify(e))}function As(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 mr(e,n)?e:n}function Oo(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>n.get(s)??{projectName:s,threads:[]});for(const s of e)t.includes(s.projectName)||r.push(s);return r}function mr(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 S0(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 x0(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function Is(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 ii(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&mr(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&x0(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function Ks(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 C0(e,t,n={}){const r=new Map(e.map(u=>[u.id,u])),s=new Map(t.map(u=>[u.id,u])),o=t.map(u=>{const f=r.get(u.id);return f&&ii(f,u)?f:u});if(n.preserveMissing!==!0)return Ks(e,o)?e:o;const i=e.map(u=>{const f=s.get(u.id);return!f||ii(u,f)?u:f}),a=new Set(e.map(u=>u.id)),l=o.filter(u=>!a.has(u.id)),d=[...i,...l];return Ks(e,d)?e:d}function ai(e){return e.replace(/\s+/gu," ").trim()}function E0(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>ai(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=ai(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function dl(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(ii(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const nu="worked";function Jn(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function A0(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 I0(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function R0(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 $0(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${A0(e.durationMs)}`,messageType:nu}}function M0(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function P0(e,t){const n=$0(t),r=e.filter(i=>i.messageType!==nu),s=M0(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function Rt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function O0(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 N0(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 j0(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 Ot(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function Rs(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 d=i.get(l.id);return d&&O0(d,l)?d:l});return o&&o.projectName===s.projectName&&N0(o.threads,a)?o:{projectName:s.projectName,threads:a}});return j0(e,r)?e:r}function D0(e,t,n){const r=new Set(Zn(t).map(a=>a.id)),s=Zn(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 d=i.findIndex(u=>u.projectName===a.projectName);d>=0&&(i[d]={projectName:i[d].projectName,threads:[a,...i[d].threads]});continue}i.push({projectName:a.projectName,threads:[a]})}return i}function L0(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function No(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function B0(e){const t=e.split(`
44
+ `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function F0(){const e=P([]),t=P([]),n=P(b0()),r=P({}),s=P({}),o=P({}),i=P({}),a=P({}),l=P({}),d=P({}),u=P([]),f=P(""),m=P("medium"),b=P(g0()),N=P(w0()),I=P(k0()),H=P(T0()),J=P({}),O=P({}),U=P({}),L=P({}),ce=P({}),fe=P({}),pe=P({}),Se=P({}),ae=P({}),re=P({}),ye=P([]),oe=P(!1),Be=P(!1),Fe=P(!1),Ke=P(!1),Ie=P(!1),ke=P(""),Me=P(!1),vt=P(!1),nt=P(v0()),ot=P(Math.floor(Zr/1e3));let rt=null,Ze=null,ge=null,Ae=null,Te=!1;const R=new Set;let ee=!1,Q=!1;const me=new Map,Pe=new Set,g=de(()=>Zn(e.value)),y=de(()=>g.value.find(c=>c.id===n.value)??null),x=de(()=>N.value[n.value]??null),D=de(()=>{const c=[],h=n.value;return h&&Array.isArray(Se.value[h])&&c.push(...Se.value[h]),Array.isArray(Se.value[es])&&c.push(...Se.value[es]),c.sort((v,T)=>v.receivedAtIso.localeCompare(T.receivedAtIso))}),F=de(()=>{var G;const c=n.value;if(!c)return null;const h=ce.value[c],v=(o.value[c]??"").trim(),T=(((G=fe.value[c])==null?void 0:G.message)??"").trim();return!h&&!v&&!T?null:{activityLabel:(h==null?void 0:h.label)||"Thinking",activityDetails:(h==null?void 0:h.details)??[],reasoningText:v,errorText:T}}),j=de(()=>{const c=n.value;if(!c)return[];const h=r.value[c]??[],v=s.value[c]??[],T=i.value[c]??[],G=[...h,...T,...v],K=L.value[c];return K?P0(G,K):G});function te(c){n.value!==c&&(n.value=c,_0(c),Q=!1)}function ie(c){f.value=c.trim()}async function ne(){f.value=nn,u.value.includes(nn)||(u.value=[...u.value,nn]);try{await sy(nn)}catch{}}function W(c,h){ae.value={...ae.value,[c]:h}}function we(c){ae.value[c]&&(ae.value=Rt(ae.value,c))}async function le(c){if(Pe.has(c))return;const h=ae.value[c];if(!(!h||h.fallbackRetried)){Pe.add(c),W(c,{...h,fallbackRetried:!0});try{await ne();try{const v=await tl(c,1);Jt(c,v),St(c,[]),X(c),i.value[c]&&(i.value=Rt(i.value,c))}catch{}Ye(c,null),ke.value="",V(c,null),We(c,{label:"Thinking",details:xe(nn,h.effort)}),Z(c,!0),U.value[c]!==!0&&await Io(c),await Ro(c,h.text,h.imageUrls,nn,h.effort||void 0,h.skills.length>0?h.skills:void 0,h.fileAttachments),U.value={...U.value,[c]:!0},R.add(c),Te=!0,await ir()}catch(v){const T=v instanceof Error?v.message:"Unknown application error";Ye(c,T),ke.value=T,Z(c,!1),We(c,null)}finally{Pe.delete(c)}}}function be(c){c&&!al.includes(c)||(m.value=c)}function xe(c,h){const v=c.trim()||"default",T=h||"default";return[`Model: ${v}`,`Thinking: ${T}`]}async function Oe(){try{const[c,h]=await Promise.all([oy(),iy()]);u.value=c,f.value.length>0&&c.includes(f.value)||(h.model&&c.includes(h.model)?f.value=h.model:c.length>0?f.value=c[0]:f.value=""),h.reasoningEffort&&al.includes(h.reasoningEffort)&&(m.value=h.reasoningEffort)}catch{}}function Ve(c){const h=re.value;return Object.keys(h).length===0?c:c.map(v=>({projectName:v.projectName,threads:v.threads.map(T=>{const G=h[T.id];return G?{...T,title:G}:T})}))}function Ee(){const h=Ve(t.value).map(v=>({projectName:v.projectName,threads:v.threads.map(T=>{const G=a.value[T.id]===!0,K=n.value===T.id,_e=b.value[T.id],Re=d.value[T.id]===!0,ve=!K&&!G&&(Re||_e!==T.updatedAtIso);return{...T,inProgress:G,unread:ve}})}));e.value=Rs(e.value,h)}function ut(c,h,v){const T=new Date().toISOString(),G=h.trim(),K=L0(G),_e={id:c,title:B0(v),projectName:K,cwd:G,hasWorktree:G.includes("/.codex/worktrees/")||G.includes("/.git/worktrees/"),createdAtIso:T,updatedAtIso:T,preview:v,unread:!1,inProgress:!1},Re=t.value.findIndex(tt=>tt.projectName===K);if(Re>=0){const yt=t.value[Re].threads.filter(Gn=>Gn.id!==c),Cr={projectName:K,threads:[_e,...yt]},Cn=[...t.value];Cn.splice(Re,1,Cr),t.value=Cn}else t.value=[{projectName:K,threads:[_e]},...t.value];const ve=As(I.value,t.value);mr(I.value,ve)||(I.value=ve,Ar(I.value)),Ee()}function Qe(c){const h=new Set(c.map(K=>K.id)),v=Ot(b.value,h);v!==b.value&&(b.value=v,ll(v));const T=Ot(N.value,h);T!==N.value&&(N.value=T,ul(T)),O.value=Ot(O.value,h),J.value=Ot(J.value,h),U.value=Ot(U.value,h),r.value=Ot(r.value,h),s.value=Ot(s.value,h),o.value=Ot(o.value,h),i.value=Ot(i.value,h),L.value=Ot(L.value,h),ce.value=Ot(ce.value,h),fe.value=Ot(fe.value,h),pe.value=Ot(pe.value,h),d.value=Ot(d.value,h),a.value=Ot(a.value,h);const G={};for(const[K,_e]of Object.entries(Se.value))(K===es||h.has(K))&&(G[K]=_e);Se.value=G}function B(c){const h=Zn(t.value).find(v=>v.id===c);h&&(b.value={...b.value,[c]:h.updatedAtIso},ll(b.value),d.value[c]&&(d.value=Rt(d.value,c)),Ee())}function V(c,h){if(!c)return;const v=L.value[c];if(h){if(I0(v,h))return;L.value={...L.value,[c]:h}}else v&&(L.value=Rt(L.value,c))}function Z(c,h){!c||a.value[c]===!0===h||(h?a.value={...a.value,[c]:!0}:a.value=Rt(a.value,c),Ee())}function ze(c){c&&c!==n.value&&d.value[c]!==!0&&(d.value={...d.value,[c]:!0},Ee())}function We(c,h){if(!c)return;const v=ce.value[c];if(!h){v&&(ce.value=Rt(ce.value,c));return}const T=br(h.label)||"Thinking",G=h.details.map(Re=>br(Re)).filter(Re=>Re.length>0&&Re!==T),K=Array.from(new Set([...(v==null?void 0:v.details)??[],...G])).slice(-3),_e={label:T,details:K};R0(v,_e)||(ce.value={...ce.value,[c]:_e})}function Ye(c,h){if(!c)return;const v=fe.value[c],T=h?ai(h):"";if(!T){v&&(fe.value=Rt(fe.value,c));return}(v==null?void 0:v.message)!==T&&(fe.value={...fe.value,[c]:{message:T}})}function Mt(c){const h=Zn(t.value).find(v=>v.id===c);return(h==null?void 0:h.updatedAtIso)??""}function Yt(c,h){if(!c)return;const v={scrollTop:Math.max(0,h.scrollTop),isAtBottom:h.isAtBottom===!0};typeof h.scrollRatio=="number"&&Number.isFinite(h.scrollRatio)&&(v.scrollRatio=tu(h.scrollRatio,0,1));const T=N.value[c];T&&T.scrollTop===v.scrollTop&&T.isAtBottom===v.isAtBottom&&T.scrollRatio===v.scrollRatio||(N.value={...N.value,[c]:v},ul(N.value))}function Jt(c,h){const v=r.value[c]??[];Ks(v,h)||(r.value={...r.value,[c]:h})}function St(c,h){const v=s.value[c]??[];Ks(v,h)||(s.value={...s.value,[c]:h})}function k(c,h){const v=s.value[c]??[],T=dl(v,h);St(c,T)}function A(c,h){if(!c)return;const v=h.trim(),T=o.value[c]??"";if(v.length===0){if(!T)return;o.value=Rt(o.value,c);return}T!==v&&(o.value={...o.value,[c]:v})}function E(c,h){if(!c)return;const v=o.value[c]??"";A(c,`${v}${h}`)}function X(c){c&&c in o.value&&(o.value=Rt(o.value,c))}function Y(c){return c!==null&&typeof c=="object"&&!Array.isArray(c)?c:null}function z(c){return typeof c=="string"?c:""}function Ge(c){return typeof c=="number"&&Number.isFinite(c)?c:null}function Ne(c){const h=Y(c.params);if(!h)return"";const v=z(h.threadId);if(v)return v;const T=z(h.thread_id);if(T)return T;const G=z(h.conversationId);if(G)return G;const K=z(h.conversation_id);if(K)return K;const _e=Y(h.thread),Re=z(_e==null?void 0:_e.id);if(Re)return Re;const ve=Y(h.turn),tt=z(ve==null?void 0:ve.threadId);if(tt)return tt;const yt=z(ve==null?void 0:ve.thread_id);return yt||""}function Je(c){if(c.method!=="turn/completed")return"";const h=Y(c.params),v=Y(h==null?void 0:h.turn);if(!v||v.status!=="failed")return"";const T=Y(v.error);return z(T==null?void 0:T.message)}function it(c){var v;if(c.method!=="error")return"";const h=Y(c.params);return z(h==null?void 0:h.message)||z((v=Y(h==null?void 0:h.error))==null?void 0:v.message)}function Qt(c){const h=Y(c);if(!h)return null;const v=h.id,T=z(h.method),G=h.params;if(typeof v!="number"||!Number.isInteger(v)||!T)return null;const K=Y(G),_e=z(K==null?void 0:K.threadId)||es,Re=z(K==null?void 0:K.turnId),ve=z(K==null?void 0:K.itemId),tt=z(h.receivedAtIso)||new Date().toISOString();return{id:v,method:T,threadId:_e,turnId:Re,itemId:ve,receivedAtIso:tt,params:G??null}}function bn(c){const h=c.threadId||es,v=Se.value[h]??[],T=v.findIndex(K=>K.id===c.id),G=[...v];T>=0?G.splice(T,1,c):G.push(c),Se.value={...Se.value,[h]:G.sort((K,_e)=>K.receivedAtIso.localeCompare(_e.receivedAtIso))}}function _n(c){const h={};for(const[v,T]of Object.entries(Se.value)){const G=T.filter(K=>K.id!==c);G.length>0&&(h[v]=G)}Se.value=h}function Hr(c){if(c.method==="server/request"){const h=Qt(c.params);return h&&bn(h),!0}if(c.method==="server/request/resolved"){const h=Y(c.params),v=h==null?void 0:h.id;return typeof v=="number"&&Number.isInteger(v)&&_n(v),!0}return!1}function br(c){return c.replace(/\s+/gu," ").trim()}function Ur(c){const h=Ne(c);if(!h)return null;if(c.method==="turn/started")return{threadId:h,activity:{label:"Thinking",details:[]}};if(c.method==="item/started"){const v=Y(c.params),T=Y(v==null?void 0:v.item),G=z(T==null?void 0:T.type).toLowerCase();if(G==="reasoning")return{threadId:h,activity:{label:"Thinking",details:[]}};if(G==="agentmessage")return{threadId:h,activity:{label:"Writing response",details:[]}};if(G==="commandexecution"){const K=z(T==null?void 0:T.command);return{threadId:h,activity:{label:"Running command",details:K?[K]:[]}}}}return c.method==="item/commandExecution/outputDelta"?{threadId:h,activity:{label:"Running command",details:[]}}:c.method==="item/reasoning/summaryTextDelta"||c.method==="item/reasoning/summaryPartAdded"?{threadId:h,activity:{label:"Thinking",details:[]}}:c.method==="item/agentMessage/delta"?{threadId:h,activity:{label:"Writing response",details:[]}}:null}function _r(c){if(c.method!=="turn/started")return null;const h=Y(c.params);if(!h)return null;const v=Ne(c);if(!v)return null;const T=Y(h.turn),G=z(T==null?void 0:T.id)||z(h.turnId)||`${v}:unknown`;if(!G)return null;const K=Jn(z(T==null?void 0:T.startedAt))??Jn(z(h.startedAt))??Jn(c.atIso)??Date.now();return{threadId:v,turnId:G,startedAtMs:K}}function qt(c){if(c.method!=="turn/completed")return null;const h=Y(c.params);if(!h)return null;const v=Ne(c);if(!v)return null;const T=Y(h.turn),G=z(T==null?void 0:T.id)||z(h.turnId)||`${v}:unknown`;if(!G)return null;const K=Jn(z(T==null?void 0:T.completedAt))??Jn(z(h.completedAt))??Jn(c.atIso)??Date.now(),_e=Jn(z(T==null?void 0:T.startedAt))??Jn(z(h.startedAt))??void 0;return{threadId:v,turnId:G,completedAtMs:K,startedAtMs:_e}}function kn(c){return`${c}:live-reasoning`}function nr(c){const h=Y(c.params);if(!h)return"";if(c.method==="item/started"){const v=Y(h.item);return!v||v.type!=="reasoning"?"":z(v.id)}return""}function Vn(c){const h=Y(c.params);if(!h)return null;if(c.method==="item/reasoning/summaryTextDelta"){const v=z(h.itemId),T=z(h.delta);return!v||!T?null:{messageId:kn(v),delta:T}}return null}function Vr(c){const h=Y(c.params);if(!h)return"";if(c.method==="item/reasoning/summaryPartAdded"){const v=z(h.itemId);return v?kn(v):""}return""}function kr(c){const h=Y(c.params);if(!h)return"";if(c.method==="item/completed"){const v=Y(h.item);return!v||v.type!=="reasoning"?"":kn(z(v.id))}return""}function Wr(c){const h=Y(c.params);if(!h)return"";if(c.method==="item/started"){const v=Y(h.item);return!v||v.type!=="agentMessage"?"":z(v.id)}return""}function Wn(c){const h=Y(c.params);if(!h)return null;if(c.method==="item/agentMessage/delta"){const v=z(h.itemId),T=z(h.delta);return!v||!T?null:{messageId:v,delta:T}}return null}function rr(c){const h=Y(c.params);if(!h)return null;if(c.method==="item/completed"){const v=Y(h.item);if(!v||v.type!=="agentMessage")return null;const T=z(v.id),G=z(v.text);return!T||!G?null:{id:T,role:"assistant",text:G,messageType:"agentMessage.live"}}return null}function qr(c){if(c.method!=="item/started")return null;const h=Y(c.params),v=Y(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const T=z(v.id),G=z(v.command);if(!T)return null;const K=typeof v.cwd=="string"?v.cwd:null;return{id:T,role:"system",text:G,messageType:"commandExecution",commandExecution:{command:G,cwd:K,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function Tn(c){if(c.method!=="item/commandExecution/outputDelta")return null;const h=Y(c.params);if(!h)return null;const v=z(h.itemId),T=z(h.delta);return!v||!T?null:{itemId:v,delta:T}}function Tr(c){if(c.method!=="item/completed")return null;const h=Y(c.params),v=Y(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const T=z(v.id),G=z(v.command);if(!T)return null;const K=typeof v.cwd=="string"?v.cwd:null,_e=z(v.status),Re=_e==="failed"?"failed":_e==="declined"?"declined":_e==="interrupted"?"interrupted":"completed",ve=typeof v.aggregatedOutput=="string"?v.aggregatedOutput:"",tt=typeof v.exitCode=="number"?v.exitCode:null;return{id:T,role:"system",text:G,messageType:"commandExecution",commandExecution:{command:G,cwd:K,status:Re,aggregatedOutput:ve,exitCode:tt}}}function Sn(c,h){const v=i.value[c]??[],T=dl(v,h);T!==v&&(i.value={...i.value,[c]:T})}function Kr(c,h){const v=i.value[c];if(!v||v.length===0)return;const T=new Set(h.map(K=>K.id)),G=v.filter(K=>!T.has(K.id));G.length!==v.length&&(G.length===0?i.value=Rt(i.value,c):i.value={...i.value,[c]:G})}function qn(c){if(c.method==="item/agentMessage/delta")return!0;const h=Y(c.params);if(!h)return!1;if(c.method==="item/completed"){const v=Y(h.item);return(v==null?void 0:v.type)==="agentMessage"}return!1}function Sr(c){var Di,Li,Bi,Fi;if(Hr(c))return;if(c.method==="thread/name/updated"){const qe=Y(c.params),dn=z(qe==null?void 0:qe.threadId),ar=z(qe==null?void 0:qe.threadName);dn&&ar&&(re.value={...re.value,[dn]:ar},Ee(),$o(dn,ar))}const h=Ur(c);h&&We(h.threadId,h.activity);const v=_r(c);v&&(me.set(v.turnId,v),pe.value={...pe.value,[v.threadId]:v.turnId},V(v.threadId,null),Ye(v.threadId,null),Z(v.threadId,!0),d.value[v.threadId]&&(d.value=Rt(d.value,v.threadId)));const T=qt(c),G=Je(c),_e=!!((T==null?void 0:T.threadId)??Ne(c))&&!!G&&f.value!==nn&&Is(new Error(G));if(T){const qe=me.get(T.turnId);qe&&me.delete(T.turnId);const dn=Ge((Di=Y(c.params))==null?void 0:Di.durationMs)??Ge((Bi=Y((Li=Y(c.params))==null?void 0:Li.turn))==null?void 0:Bi.durationMs)??(typeof T.startedAtMs=="number"?T.completedAtMs-T.startedAtMs:null)??(qe?T.completedAtMs-qe.startedAtMs:null),ar=typeof dn=="number"?Math.max(0,dn):0;V(T.threadId,{turnId:T.turnId,durationMs:ar}),pe.value[T.threadId]&&(pe.value=Rt(pe.value,T.threadId)),Z(T.threadId,!1),We(T.threadId,null),ze(T.threadId),_e||(we(T.threadId),ks(T.threadId))}if(G){const qe=(T==null?void 0:T.threadId)||Ne(c);qe&&Ye(qe,G),ke.value=G,qe&&_e&&le(qe)}else T&&Ye(T.threadId,null);const Re=it(c);if(Re){const qe=Ne(c);qe&&Ye(qe,Re),ke.value=Re,f.value!==nn&&Is(new Error(Re))&&(qe?le(qe):ne())}const ve=Ne(c);if(!ve||ve!==n.value)return;Wr(c);const tt=Wn(c);if(tt){const qe=(s.value[ve]??[]).find(ar=>ar.id===tt.messageId),dn=`${(qe==null?void 0:qe.text)??""}${tt.delta}`;k(ve,{id:tt.messageId,role:"assistant",text:dn,messageType:"agentMessage.live"})}const yt=rr(c);yt&&k(ve,yt),nr(c);const Cr=Vn(c);if(Cr&&E(ve,Cr.delta),Vr(c)){const qe=o.value[ve]??"";qe.trim().length>0&&!qe.endsWith(`
45
+
46
+ `)&&A(ve,`${qe}
47
+
48
+ `)}kr(c);const Gn=qr(c);Gn&&(Sn(ve,Gn),We(ve,{label:"Running command",details:[((Fi=Gn.commandExecution)==null?void 0:Fi.command)??""]}));const co=Tn(c);if(co){const qe=(i.value[ve]??[]).find(dn=>dn.id===co.itemId);qe!=null&&qe.commandExecution&&Sn(ve,{...qe,commandExecution:{...qe.commandExecution,aggregatedOutput:`${qe.commandExecution.aggregatedOutput}${co.delta}`}})}const ji=Tr(c);if(ji&&Sn(ve,ji),qn(c)&&(Q&&n.value&&Yt(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),X(ve)),c.method==="turn/completed"){Q=!1,X(ve),i.value[ve]&&(i.value=Rt(i.value,ve));const qe=Ne(c);qe&&(Z(qe,!1),We(qe,null),ze(qe),_e||(we(qe),ks(qe)))}}function _(c){const h=Ne(c);h&&R.add(h);const v=c.method;(v.startsWith("thread/")||v.startsWith("turn/")||v.startsWith("item/"))&&(Te=!0),!(Ze!==null||typeof window>"u")&&(Ze=window.setTimeout(()=>{Ze=null,ir()},Mo))}async function C(c){if(!ee){ee=!0;try{const h=await ni(),v=[];for(const T of h.order){const G=No(T);v.includes(G)||v.push(G)}if(v.length>0){const T=As(v,c);mr(I.value,T)||(I.value=T,Ar(I.value))}if(Object.keys(h.labels).length>0){const T={...H.value};let G=!1;for(const[K,_e]of Object.entries(h.labels)){const Re=No(K);T[Re]!==_e&&(T[Re]=_e,G=!0)}G&&(H.value=T,Po(T))}}catch{}}}async function $(){if(!(Object.keys(re.value).length>0))try{const c=await py();Object.keys(c.titles).length>0&&(re.value=c.titles)}catch{}}async function q(c,h,v){if(re.value[c])return;const T=h.trim();if(!T)return;const G=T.length>300?T.slice(0,300):T;try{const K=await my(G,v);if(!K||re.value[c])return;re.value={...re.value,[c]:K},Ee(),$o(c,K)}catch{}}async function De(){var c;vt.value||(oe.value=!0);try{const[h]=await Promise.all([zv(),$()]);await C(h);const v=As(I.value,h);mr(I.value,v)||(I.value=v,Ar(I.value));const T=Oo(h,I.value),G=D0(t.value,T,a.value);t.value=Rs(t.value,G),a.value=Ot(a.value,new Set(Zn(t.value).map(Re=>Re.id))),Ee(),vt.value=!0;const K=Zn(e.value);Qe(K),K.some(Re=>Re.id===n.value)||te(((c=K[0])==null?void 0:c.id)??"")}finally{oe.value=!1}}async function bt(c,h={}){if(!c)return;const v=O.value[c]===!0,T=h.silent!==!0&&!v;T&&(Be.value=!0);try{U.value[c]!==!0&&(await Io(c),U.value={...U.value,[c]:!0});const{messages:G,inProgress:K}=await Yv(c),_e=r.value[c]??[],Re=C0(_e,G,{preserveMissing:h.silent===!0});Jt(c,Re);const ve=s.value[c]??[],tt=E0(ve,G);St(c,tt),Kr(c,G),O.value={...O.value,[c]:!0};const yt=Mt(c);yt&&(J.value={...J.value,[c]:yt}),Z(c,K),B(c)}finally{T&&(Be.value=!1)}}async function Kt(){try{const c=t.value.flatMap(h=>h.threads.map(v=>v.cwd)).filter(Boolean);ye.value=await gy(c.length>0?[...new Set(c)]:void 0)}catch{}}async function xr(){ke.value="";try{await De(),await Promise.all([Oe(),Kt()]),await bt(n.value)}catch(c){ke.value=c instanceof Error?c.message:"Unknown application error"}}async function xn(c){te(c);try{await bt(c)}catch(h){ke.value=h instanceof Error?h.message:"Unknown application error"}}async function en(c){try{await Zv(c),await De(),n.value===c&&await bt(n.value)}catch(h){ke.value=h instanceof Error?h.message:"Unknown application error"}}async function Kn(c,h){const v=h.trim();if(!(!c||!v))try{await ey(c,v),re.value={...re.value,[c]:v},Ee(),$o(c,v)}catch(T){ke.value=T instanceof Error?T.message:"Unknown application error"}}async function sr(c,h=[],v=[],T="steer",G=[]){const K=n.value,_e=c.trim();if(!K||!_e&&h.length===0&&G.length===0)return;const Re=a.value[K]===!0;if(Re&&T==="queue"){const ve=l.value[K]??[],tt=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[K]:[...ve,{id:tt,text:_e,imageUrls:h,skills:v,fileAttachments:G}]};return}if(Re){Q=!0,or(K,_e,h,v,G).catch(ve=>{const tt=ve instanceof Error?ve.message:"Unknown application error";Ye(K,tt),ke.value=tt});return}ke.value="",Q=!0,V(K,null),We(K,{label:"Thinking",details:xe(f.value,m.value)}),Ye(K,null),Z(K,!0);try{await or(K,_e,h,v,G)}catch(ve){Q=!1,Z(K,!1),We(K,null);const tt=ve instanceof Error?ve.message:"Unknown application error";throw Ye(K,tt),ke.value=tt,ve}}async function Gr(c,h,v=[],T=[],G=[]){const K=c.trim(),_e=h.trim(),Re=f.value.trim();if(!K&&v.length===0&&G.length===0)return"";Fe.value=!0,ke.value="";let ve="";try{try{ve=await nl(_e||void 0,Re||void 0)}catch(Cn){if(Re&&Re!==nn&&Is(Cn))await ne(),ve=await nl(_e||void 0,nn);else throw Cn}if(!ve)return"";ut(ve,_e,K||"[Image]"),U.value={...U.value,[ve]:!0},te(ve),Q=!0,V(ve,null),We(ve,{label:"Thinking",details:xe(f.value,m.value)}),Ye(ve,null),Z(ve,!0);const tt=ve,yt=_e||null,Cr=K;return or(ve,K,v,T,G).catch(Cn=>{Q=!1,Z(ve,!1),We(ve,null);const Gn=Cn instanceof Error?Cn.message:"Unknown application error";Ye(ve,Gn),ke.value=Gn}).finally(()=>{Fe.value=!1}),q(tt,Cr,yt),ve}catch(tt){Q=!1,ve&&(Z(ve,!1),We(ve,null));const yt=tt instanceof Error?tt.message:"Unknown application error";throw ve&&Ye(ve,yt),ke.value=yt,Fe.value=!1,tt}}async function or(c,h,v=[],T=[],G=[]){const K=f.value.trim(),_e=m.value,Re=h.trim(),ve=T.map(yt=>({name:yt.name,path:yt.path})),tt=G.map(yt=>({...yt}));W(c,{text:Re,imageUrls:[...v],skills:ve,fileAttachments:tt,effort:_e,fallbackRetried:!1});try{U.value[c]!==!0&&await Io(c);try{await Ro(c,h,v,K||void 0,_e||void 0,T.length>0?T:void 0,G)}catch(yt){if(K&&K!==nn&&Is(yt))await ne(),W(c,{text:Re,imageUrls:[...v],skills:ve,fileAttachments:tt,effort:_e,fallbackRetried:!0}),await Ro(c,h,v,nn,_e||void 0,T.length>0?T:void 0,G);else throw yt}U.value={...U.value,[c]:!0},R.add(c),Te=!0,await ir()}catch(yt){throw yt}}async function ks(c){const h=l.value[c];if(!h||h.length===0)return;const[v,...T]=h;l.value=T.length>0?{...l.value,[c]:T}:Rt(l.value,c),Fe.value=!0,ke.value="",Q=!0,V(c,null),We(c,{label:"Thinking",details:xe(f.value,m.value)}),Ye(c,null),Z(c,!0);try{await or(c,v.text,v.imageUrls,v.skills,v.fileAttachments)}catch{Z(c,!1),We(c,null)}finally{Fe.value=!1}}async function M(){const c=n.value;if(!c||a.value[c]!==!0)return;const h=pe.value[c];Ke.value=!0,ke.value="";try{await ry(c,h),Z(c,!1),We(c,null),Ye(c,null),pe.value[c]&&(pe.value=Rt(pe.value,c)),R.add(c),Te=!0,await ir()}catch(v){const T=v instanceof Error?v.message:"Failed to interrupt active turn";Ye(c,T),ke.value=T}finally{Ke.value=!1}}async function se(c){const h=n.value;if(!h||Ie.value)return;const T=(r.value[h]??[]).reduce((K,_e)=>typeof _e.turnIndex=="number"&&_e.turnIndex>K?_e.turnIndex:K,-1);if(T<0||c>T)return;const G=T-c+1;if(!(G<1)){Ie.value=!0,ke.value="";try{const K=await tl(h,G);Jt(h,K),St(h,[]),X(h),i.value[h]&&(i.value=Rt(i.value,h)),V(h,null),We(h,null),Ye(h,null),Te=!0,await ir()}catch(K){ke.value=K instanceof Error?K.message:"Failed to rollback thread"}finally{Ie.value=!1}}}function $e(c,h){c.length===0||(H.value[c]??"")===h||(H.value={...H.value,[c]:h},Po(H.value))}function Tt(c){var G;if(c.length===0)return;const h=I.value.filter(K=>K!==c);if(mr(I.value,h)||(I.value=h,Ar(I.value)),t.value=t.value.filter(K=>K.projectName!==c),H.value[c]!==void 0){const K={...H.value};delete K[c],H.value=K,Po(K)}Ee();const v=Zn(e.value);Qe(v),v.some(K=>K.id===n.value)||te(((G=v[0])==null?void 0:G.id)??""),At()}function Pt(c,h){if(c.length===0||t.value.length===0)return;const v=t.value.map(ve=>ve.projectName),T=v.indexOf(c);if(T===-1)return;const G=Math.max(0,Math.min(h,v.length-1)),K=S0(v,T,G);if(K===v)return;const _e=As(K,t.value);I.value=_e,Ar(I.value);const Re=Oo(t.value,I.value);t.value=Rs(t.value,Re),Ee(),At()}function Et(c){const h=c.trim();if(!h)return;const v=[h,...I.value.filter(G=>G!==h)];if(mr(I.value,v))return;I.value=v,Ar(I.value);const T=Oo(t.value,I.value);t.value=Rs(t.value,T),Ee(),At()}async function At(){var c,h;try{const v=await ni(),T=new Map;for(const _e of v.order){const Re=No(_e);T.has(Re)||T.set(Re,_e)}for(const _e of t.value){const Re=((h=(c=_e.threads[0])==null?void 0:c.cwd)==null?void 0:h.trim())??"";Re&&T.set(_e.projectName,Re)}const G=[];for(const _e of I.value){const Re=T.get(_e);Re&&!G.includes(Re)&&G.push(Re)}for(const _e of v.order)G.includes(_e)||G.push(_e);const K=v.active.filter(_e=>G.includes(_e));K.length===0&&G.length>0&&K.push(G[0]),await cy({order:G,labels:v.labels,active:K})}catch{}}async function ru(){if(!Me.value){Me.value=!0;try{if(await De(),!n.value)return;const c=n.value,h=Mt(c),v=J.value[c]??"",T=h.length>0&&h!==v;(a.value[c]===!0||T)&&await bt(c,{silent:!0})}catch{}finally{Me.value=!1}}}async function ir(){if(Me.value){typeof window<"u"&&Ze===null&&(Ze=window.setTimeout(()=>{Ze=null,ir()},Mo));return}Me.value=!0;const c=Te,h=new Set(R);Te=!1,R.clear();try{c&&await De();const v=n.value;if(!v)return;const T=h.has(v),G=a.value[v]===!0,K=Mt(v),_e=J.value[v]??"",Re=K.length>0&&K!==_e;(T||G||Re||c)&&await bt(v,{silent:!0})}catch{}finally{Me.value=!1,(Te||R.size>0)&&typeof window<"u"&&Ze===null&&(Ze=window.setTimeout(()=>{Ze=null,ir()},Mo))}}function su(){typeof window>"u"||rt||(nt.value&&Oi(),ou(),rt=Jv(c=>{Sr(c),_(c)}))}async function ou(){try{const c=await Xv();for(const h of c){const v=Qt(h);v&&bn(v)}}catch{}}async function iu(c){try{await Qv(c.id,{result:c.result,error:c.error}),_n(c.id)}catch(h){ke.value=h instanceof Error?h.message:"Failed to reply to server request"}}function Pi(c={}){const h=c.updatePreference??!0;ge!==null&&typeof window<"u"&&(window.clearInterval(ge),ge=null),Ae!==null&&typeof window<"u"&&(window.clearInterval(Ae),Ae=null),h&&(nt.value=!1,cl(!1)),ot.value=Math.floor(Zr/1e3)}function Oi(){typeof window>"u"||ge!==null||Ae!==null||(nt.value=!0,cl(!0),ot.value=Math.floor(Zr/1e3),ge=window.setInterval(()=>{ot.value=Math.floor(Zr/1e3),ru()},Zr),Ae=window.setInterval(()=>{ot.value=Math.max(0,ot.value-1)},1e3))}function au(){if(nt.value){Pi();return}Oi()}function lu(){Pi({updatePreference:!1}),rt&&(rt(),rt=null),Te=!1,R.clear(),me.clear(),Ze!==null&&typeof window<"u"&&(window.clearTimeout(Ze),Ze=null),Q=!1,r.value={},s.value={},o.value={},i.value={},ce.value={},L.value={},fe.value={},pe.value={},l.value={}}const cu=de(()=>{const c=n.value;return c?l.value[c]??[]:[]});function Ni(c){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const T=v.filter(G=>G.id!==c);l.value=T.length>0?{...l.value,[h]:T}:Rt(l.value,h)}function uu(c){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const T=v.find(G=>G.id===c);T&&(Ni(c),sr(T.text,T.imageUrls,T.skills,"steer",T.fileAttachments))}return{projectGroups:e,projectDisplayNameById:H,selectedThread:y,selectedThreadScrollState:x,selectedThreadServerRequests:D,selectedLiveOverlay:F,selectedThreadId:n,availableModelIds:u,selectedModelId:f,selectedReasoningEffort:m,installedSkills:ye,messages:j,isLoadingThreads:oe,isLoadingMessages:Be,isSendingMessage:Fe,isInterruptingTurn:Ke,isAutoRefreshEnabled:nt,autoRefreshSecondsLeft:ot,error:ke,refreshAll:xr,refreshSkills:Kt,selectThread:xn,setThreadScrollState:Yt,archiveThreadById:en,renameThreadById:Kn,sendMessageToSelectedThread:sr,sendMessageToNewThread:Gr,interruptSelectedThreadTurn:M,rollbackSelectedThread:se,isRollingBack:Ie,selectedThreadQueuedMessages:cu,removeQueuedMessage:Ni,steerQueuedMessage:uu,setSelectedModelId:ie,setSelectedReasoningEffort:be,respondToPendingServerRequest:iu,renameProject:$e,removeProject:Tt,reorderProject:Pt,pinProjectToTop:Et,toggleAutoRefreshTimer:au,startPolling:su,stopPolling:lu}}const H0={class:"sidebar-root"},U0={class:"sidebar-scrollable"},V0=["aria-pressed"],W0={key:1,class:"sidebar-search-bar"},q0={key:0,class:"sidebar-settings-area"},K0={key:0,class:"sidebar-settings-panel"},G0={class:"sidebar-settings-value"},z0={class:"sidebar-settings-value"},Y0={class:"content-root"},J0={class:"content-body"},Q0={key:1,class:"content-grid"},X0={class:"new-thread-empty"},Z0={class:"worktree-init-status-title"},e_={class:"worktree-init-status-message"},t_={key:2,class:"content-grid"},n_={class:"content-thread"},r_={class:"composer-with-queue"},s_={class:"build-badge","aria-label":"Worktree name and version"},fl="codex-web-local.sidebar-collapsed.v1",hl="codex-web-local.send-with-enter.v1",pl="codex-web-local.in-progress-send-mode.v1",ml="codex-web-local.dark-mode.v1",o_=It({__name:"App",setup(e){const t="63ac",n="0.1.32",{projectGroups:r,projectDisplayNameById:s,selectedThread:o,selectedThreadScrollState:i,selectedThreadServerRequests:a,selectedLiveOverlay:l,selectedThreadId:d,availableModelIds:u,selectedModelId:f,selectedReasoningEffort:m,installedSkills:b,messages:N,isLoadingThreads:I,isLoadingMessages:H,isInterruptingTurn:J,isAutoRefreshEnabled:O,autoRefreshSecondsLeft:U,refreshAll:L,refreshSkills:ce,selectThread:fe,setThreadScrollState:pe,archiveThreadById:Se,renameThreadById:ae,sendMessageToSelectedThread:re,sendMessageToNewThread:ye,interruptSelectedThreadTurn:oe,rollbackSelectedThread:Be,isRollingBack:Fe,selectedThreadQueuedMessages:Ke,removeQueuedMessage:Ie,steerQueuedMessage:ke,setSelectedModelId:Me,setSelectedReasoningEffort:vt,respondToPendingServerRequest:nt,renameProject:ot,removeProject:rt,reorderProject:Ze,pinProjectToTop:ge,toggleAutoRefreshTimer:Ae,startPolling:Te,stopPolling:R}=F0(),ee=Yh(),Q=zh(),{isMobile:me}=Wc(),Pe=P(!1),g=P(!1),y=P(""),x=P("local"),D=P({order:[],labels:{}}),F=P({phase:"idle",title:"",message:""}),j=P(en()),te=P(""),ie=P(!1),ne=P(null),W=P(null);let we=null;const le=P("New Project (1)"),be=P(""),xe=P(!1),Oe=P($(hl,!0)),Ve=P(De()),Ee=P(q()),ut=de(()=>{const M=ee.params.threadId;return typeof M=="string"?M:""}),Qe=de(()=>{const M=new Set;for(const se of r.value)for(const $e of se.threads)M.add($e.id);return M}),B=de(()=>ee.name==="home"),V=de(()=>ee.name==="skills"),Z=de(()=>{var M;return V.value?"Skills":B.value?"New thread":((M=o.value)==null?void 0:M.title)??"Choose a thread"}),ze=de(()=>O.value?`Auto refresh in ${String(U.value)}s`:"Enable 4s refresh"),We=de(()=>N.value.filter(M=>{const se=sr(M.messageType,M.role);return se==="worked"?!0:!(se==="turnActivity.live"||se==="turnError.live"||se==="agentReasoning.live")})),Ye=de(()=>l.value),Mt=de(()=>B.value?"__new-thread__":d.value),Yt=de(()=>{var M,se;return B.value?y.value.trim():((se=(M=o.value)==null?void 0:M.cwd)==null?void 0:se.trim())??""}),Jt=de(()=>{var M;return!B.value&&((M=o.value)==null?void 0:M.inProgress)===!0}),St=de(()=>{var Tt,Pt;const M=[],se=new Set;for(const Et of D.value.order){const At=Et.trim();!At||se.has(At)||(se.add(At),M.push({value:At,label:D.value.labels[At]||Sn(At)}))}for(const Et of r.value){const At=((Pt=(Tt=Et.threads[0])==null?void 0:Tt.cwd)==null?void 0:Pt.trim())??"";!At||se.has(At)||(se.add(At),M.push({value:At,label:s.value[Et.projectName]??Et.projectName}))}const $e=y.value.trim();return $e&&!se.has($e)&&M.unshift({value:$e,label:Sn($e)}),M}),k=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;Hn(()=>{window.addEventListener("keydown",kn),xn(),k==null||k.addEventListener("change",xn),Gr(),qr(),Tn(),Wn()}),no(()=>{window.removeEventListener("keydown",kn),k==null||k.removeEventListener("change",xn),we&&(clearTimeout(we),we=null),R()}),ft(te,M=>{const se=M.trim();if(we&&(clearTimeout(we),we=null),!se){W.value=null;return}we=setTimeout(()=>{hy(se,1e3).then($e=>{te.value.trim()===se&&(W.value=$e.threadIds)}).catch(()=>{te.value.trim()===se&&(W.value=null)})},220)});function A(){ce()}function E(){ie.value=!ie.value,ie.value?Zt(()=>{var M;return(M=ne.value)==null?void 0:M.focus()}):te.value=""}function X(){var M;te.value="",(M=ne.value)==null||M.focus()}function Y(M){M.key==="Escape"&&(ie.value=!1,te.value="")}function z(M){M&&(ee.name==="thread"&&ut.value===M||(Q.push({name:"thread",params:{threadId:M}}),me.value&&qt(!0)))}function Ge(M){Se(M)}function Ne(M){var Tt,Pt;const se=r.value.find(Et=>Et.projectName===M),$e=((Pt=(Tt=se==null?void 0:se.threads[0])==null?void 0:Tt.cwd)==null?void 0:Pt.trim())??"";$e&&(y.value=$e),me.value&&qt(!0),!B.value&&Q.push({name:"home"})}function Je(M){var Tt,Pt;const se=r.value.find(Et=>Et.projectName===M),$e=((Pt=(Tt=se==null?void 0:se.threads[0])==null?void 0:Tt.cwd)==null?void 0:Pt.trim())??"";!$e||typeof window>"u"||window.open(`/codex-local-browse${encodeURI($e)}`,"_blank","noopener,noreferrer")}function it(){var se,$e;const M=(($e=(se=o.value)==null?void 0:se.cwd)==null?void 0:$e.trim())??"";M&&(y.value=M),me.value&&qt(!0),!B.value&&Q.push({name:"home"})}function Qt(M){ot(M.projectName,M.displayName)}function bn(M){ae(M.threadId,M.title)}function _n(M){rt(M)}function Hr(M){Ze(M.projectName,M.toIndex)}function br(M){pe(M.threadId,M.state)}function Ur(M){nt(M)}function _r(){Ae()}function qt(M){j.value!==M&&(j.value=M,Kn(M))}function kn(M){M.defaultPrevented||!M.ctrlKey&&!M.metaKey||M.shiftKey||M.altKey||M.key.toLowerCase()==="b"&&(M.preventDefault(),qt(!j.value))}function nr(M){const se=M.text;if(B.value){ks(se,M.imageUrls,M.skills,M.fileAttachments);return}re(se,M.imageUrls,M.skills,M.mode,M.fileAttachments)}function Vn(M){y.value=M.trim()}async function Vr(M){const se=M.trim();if(!se)return;const $e=Wr(se),Tt=await kr(),Pt=$e?se:Kr(Tt,se);if(Pt)try{const Et=await uy(Pt,{createIfMissing:!$e,label:$e?"":se});Et&&(y.value=Et,ge(Sn(Et)),Tn(),Wn())}catch{}}async function kr(){const M=rr();if(M)return M;try{const se=await rl();if(se)return be.value=se,se}catch{}return""}function Wr(M){return M?M.startsWith("~/")||M.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(M):!1}async function Wn(){const M=rr();if(!M){le.value="New Project (1)";return}try{const se=await dy(M);le.value=se.name||"New Project (1)"}catch{le.value="New Project (1)"}}function rr(){var $e,Tt;const M=y.value.trim();if(M)return Tr(M);const se=((Tt=($e=St.value[0])==null?void 0:$e.value)==null?void 0:Tt.trim())??"";return se?Tr(se):be.value.trim()}async function qr(){try{be.value=await rl()}catch{be.value=""}}async function Tn(){try{const M=await ni();D.value={order:[...M.order],labels:{...M.labels}}}catch{D.value={order:[],labels:{}}}}function Tr(M){const se=M.trim().replace(/\/+$/,"");if(!se)return"";const $e=se.lastIndexOf("/");return $e<=0?"":se.slice(0,$e)}function Sn(M){const se=M.trim().replace(/\/+$/,"");if(!se)return"";const $e=se.lastIndexOf("/");return $e<0?se:se.slice($e+1)}function Kr(M,se){const $e=M.trim().replace(/\/+$/,""),Tt=se.trim().replace(/^\/+/,"");return!$e||!Tt?"":`${$e}/${Tt}`}function qn(M){Me(M)}function Sr(M){vt(M)}function _(){oe()}function C(M){Be(M.turnIndex)}function $(M,se){if(typeof window>"u")return se;const $e=window.localStorage.getItem(M);return $e===null?se:$e==="1"}function q(){if(typeof window>"u")return"system";const M=window.localStorage.getItem(ml);return M==="light"||M==="dark"?M:"system"}function De(){return typeof window>"u"?"queue":window.localStorage.getItem(pl)==="steer"?"steer":"queue"}function bt(){Oe.value=!Oe.value,window.localStorage.setItem(hl,Oe.value?"1":"0")}function Kt(){Ve.value=Ve.value==="steer"?"queue":"steer",window.localStorage.setItem(pl,Ve.value)}function xr(){const M=["system","light","dark"],se=M.indexOf(Ee.value);Ee.value=M[(se+1)%M.length],window.localStorage.setItem(ml,Ee.value),xn()}function xn(){const M=document.documentElement;if(Ee.value==="dark")M.classList.add("dark");else if(Ee.value==="light")M.classList.remove("dark");else{const se=window.matchMedia("(prefers-color-scheme: dark)").matches;M.classList.toggle("dark",se)}}function en(){return typeof window>"u"?!1:window.localStorage.getItem(fl)==="1"}function Kn(M){typeof window>"u"||window.localStorage.setItem(fl,M?"1":"0")}function sr(M,se){const $e=(M??"").trim();return $e.length>0?$e:se.trim()||"message"}async function Gr(){await L(),g.value=!0,await or(),Te()}async function or(){if(!Pe.value){Pe.value=!0;try{if(ee.name==="home"||ee.name==="skills"){d.value!==""&&await fe("");return}if(ee.name==="thread"){const M=ut.value;if(!M)return;if(!Qe.value.has(M)){await Q.replace({name:"home"});return}d.value!==M&&await fe(M);return}}finally{Pe.value=!1}}}ft(()=>[ee.name,ut.value,I.value,Qe.value.has(ut.value),d.value],async()=>{g.value&&await or()}),ft(()=>d.value,async M=>{if(g.value&&!Pe.value&&!(B.value||V.value)){if(!M){ee.name!=="home"&&await Q.replace({name:"home"});return}ee.name==="thread"&&ut.value===M||await Q.replace({name:"thread",params:{threadId:M}})}}),ft(()=>St.value,M=>{if(M.length===0){y.value="";return}M.some($e=>$e.value===y.value)||(y.value=M[0].value),Wn()},{immediate:!0}),ft(()=>y.value,()=>{F.value={phase:"idle",title:"",message:""},Wn()}),ft(()=>x.value,M=>{M==="local"&&(F.value={phase:"idle",title:"",message:""})}),ft(()=>ee.name,M=>{M!=="home"&&(F.value={phase:"idle",title:"",message:""})}),ft(()=>d.value,()=>{F.value={phase:"idle",title:"",message:""}}),ft(me,M=>{M&&!j.value&&qt(!0)});async function ks(M,se=[],$e=[],Tt=[]){try{F.value={phase:"idle",title:"",message:""};let Pt=y.value;if(x.value==="worktree"){F.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const At=await ly(y.value);Pt=At.cwd,y.value=At.cwd,F.value={phase:"idle",title:"",message:""}}catch{F.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const Et=await ye(M,Pt,se,$e,Tt);if(!Et)return;await Q.replace({name:"thread",params:{threadId:Et}})}catch{}}return(M,se)=>(w(),S(He,null,[Ce(tp,{"is-sidebar-collapsed":j.value,onCloseSidebar:se[6]||(se[6]=$e=>qt(!0))},{sidebar:dt(()=>[p("section",H0,[p("div",U0,[j.value?ue("",!0):(w(),pt(il,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":j.value,"is-auto-refresh-enabled":je(O),"auto-refresh-button-label":ze.value,"show-new-thread-button":!0,onToggleSidebar:se[0]||(se[0]=$e=>qt(!j.value)),onToggleAutoRefresh:_r,onStartNewThread:it},{default:dt(()=>[p("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":ie.value,"aria-label":"Search threads",title:"Search threads",onClick:E},[Ce(si,{class:"sidebar-search-toggle-icon"})],8,V0)]),_:1},8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])),!j.value&&ie.value?(w(),S("div",W0,[Ce(si,{class:"sidebar-search-bar-icon"}),Ln(p("input",{ref_key:"sidebarSearchInputRef",ref:ne,"onUpdate:modelValue":se[1]||(se[1]=$e=>te.value=$e),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:Y},null,544),[[Bn,te.value]]),te.value.length>0?(w(),S("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:X},[Ce(Ri,{class:"sidebar-search-clear-icon"})])):ue("",!0)])):ue("",!0),j.value?ue("",!0):(w(),S("button",{key:2,class:ht(["sidebar-skills-link",{"is-active":V.value}]),type:"button",onClick:se[2]||(se[2]=$e=>{je(Q).push({name:"skills"}),je(me)&&qt(!0)})}," Skills Hub ",2)),j.value?ue("",!0):(w(),pt(Hm,{key:3,groups:je(r),"project-display-name-by-id":je(s),"selected-thread-id":je(d),"is-loading":je(I),"search-query":te.value,"search-matched-thread-ids":W.value,onSelect:z,onArchive:Ge,onStartNewThread:Ne,onRenameProject:Qt,onBrowseProjectFiles:Je,onRenameThread:bn,onRemoveProject:_n,onReorderProject:Hr},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),j.value?ue("",!0):(w(),S("div",q0,[Ce($c,{name:"settings-panel"},{default:dt(()=>[xe.value?(w(),S("div",K0,[p("button",{class:"sidebar-settings-row",type:"button",onClick:bt},[se[7]||(se[7]=p("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),p("span",{class:ht(["sidebar-settings-toggle",{"is-on":!Oe.value}])},null,2)]),p("button",{class:"sidebar-settings-row",type:"button",onClick:Kt},[se[8]||(se[8]=p("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),p("span",G0,he(Ve.value==="steer"?"Steer":"Queue"),1)]),p("button",{class:"sidebar-settings-row",type:"button",onClick:xr},[se[9]||(se[9]=p("span",{class:"sidebar-settings-label"},"Appearance",-1)),p("span",z0,he(Ee.value==="system"?"System":Ee.value==="dark"?"Dark":"Light"),1)])])):ue("",!0)]),_:1}),p("button",{class:"sidebar-settings-button",type:"button",onClick:se[3]||(se[3]=$e=>xe.value=!xe.value)},[Ce(m0,{class:"sidebar-settings-icon"}),se[10]||(se[10]=p("span",null,"Settings",-1))])]))])]),content:dt(()=>[p("section",Y0,[Ce(Gm,{title:Z.value},{leading:dt(()=>[j.value||je(me)?(w(),pt(il,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":j.value,"is-auto-refresh-enabled":je(O),"auto-refresh-button-label":ze.value,"show-new-thread-button":!0,onToggleSidebar:se[4]||(se[4]=$e=>qt(!j.value)),onToggleAutoRefresh:_r,onStartNewThread:it},null,8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])):ue("",!0)]),_:1},8,["title"]),p("section",J0,[V.value?(w(),pt(Yb,{key:0,onSkillsChanged:A})):B.value?(w(),S("div",Q0,[p("div",X0,[se[11]||(se[11]=p("p",{class:"new-thread-hero"},"Let's build",-1)),Ce(ri,{class:"new-thread-folder-dropdown","model-value":y.value,options:St.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":le.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":Vn,onAdd:Vr},null,8,["model-value","options","default-add-value"]),Ce(Zw,{class:"new-thread-runtime-dropdown",modelValue:x.value,"onUpdate:modelValue":se[5]||(se[5]=$e=>x.value=$e)},null,8,["modelValue"]),F.value.phase!=="idle"?(w(),S("div",{key:0,class:ht(["worktree-init-status",{"is-running":F.value.phase==="running","is-error":F.value.phase==="error"}])},[p("strong",Z0,he(F.value.title),1),p("span",e_,he(F.value.message),1)],2)):ue("",!0)]),Ce(sl,{"active-thread-id":Mt.value,cwd:Yt.value,models:je(u),"selected-model":je(f),"selected-reasoning-effort":je(m),skills:je(b),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":Oe.value,"in-progress-submit-mode":Ve.value,onSubmit:nr,"onUpdate:selectedModel":qn,"onUpdate:selectedReasoningEffort":Sr},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode"])])):(w(),S("div",t_,[p("div",n_,[Ce(Tv,{messages:We.value,"is-loading":je(H),"active-thread-id":Mt.value,cwd:Yt.value,"scroll-state":je(i),"live-overlay":Ye.value,"pending-requests":je(a),"is-turn-in-progress":Jt.value,"is-rolling-back":je(Fe),onUpdateScrollState:br,onRespondServerRequest:Ur,onRollback:C},null,8,["messages","is-loading","active-thread-id","cwd","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),p("div",r_,[Ce(qw,{messages:je(Ke),onSteer:je(ke),onDelete:je(Ie)},null,8,["messages","onSteer","onDelete"]),Ce(sl,{"active-thread-id":Mt.value,cwd:Yt.value,models:je(u),"selected-model":je(f),"selected-reasoning-effort":je(m),skills:je(b),"is-turn-in-progress":Jt.value,"is-interrupting-turn":je(J),"has-queue-above":je(Ke).length>0,"send-with-enter":Oe.value,"in-progress-submit-mode":Ve.value,onSubmit:nr,"onUpdate:selectedModel":qn,"onUpdate:selectedReasoningEffort":Sr,onInterrupt:_},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","is-turn-in-progress","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),p("div",s_," WT "+he(je(t))+" · v"+he(je(n)),1)],64))}}),i_=et(o_,[["__scopeId","data-v-8f56bd79"]]),jo={render:()=>null},a_=Gh({history:xh(),routes:[{path:"/",name:"home",component:jo},{path:"/thread/:threadId",name:"thread",component:jo},{path:"/skills",name:"skills",component:jo},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Lf(i_).use(a_).mount("#app");