codexapp 0.1.14 → 0.1.15

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.
@@ -1,47 +0,0 @@
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.29
3
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
- * @license MIT
5
- **/function Oo(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const it={},hr=[],ln=()=>{},qa=()=>!1,ks=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),jo=e=>e.startsWith("onUpdate:"),bt=Object.assign,Lo=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},zc=Object.prototype.hasOwnProperty,Xe=(e,t)=>zc.call(e,t),Oe=Array.isArray,pr=e=>Jr(e)==="[object Map]",Wa=e=>Jr(e)==="[object Set]",mi=e=>Jr(e)==="[object Date]",He=e=>typeof e=="function",pt=e=>typeof e=="string",Yt=e=>typeof e=="symbol",Ze=e=>e!==null&&typeof e=="object",Ka=e=>(Ze(e)||He(e))&&He(e.then)&&He(e.catch),Ga=Object.prototype.toString,Jr=e=>Ga.call(e),Yc=e=>Jr(e).slice(8,-1),za=e=>Jr(e)==="[object Object]",Do=e=>pt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Pr=Oo(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ts=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Jc=/-\w/g,qt=Ts(e=>e.replace(Jc,t=>t.slice(1).toUpperCase())),Qc=/\B([A-Z])/g,Ln=Ts(e=>e.replace(Qc,"-$1").toLowerCase()),Ss=Ts(e=>e.charAt(0).toUpperCase()+e.slice(1)),Fs=Ts(e=>e?`on${Ss(e)}`:""),Pn=(e,t)=>!Object.is(e,t),ls=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Ya=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Bo=e=>{const t=parseFloat(e);return isNaN(t)?e:t},Xc=e=>{const t=pt(e)?Number(e):NaN;return isNaN(t)?e:t};let gi;const xs=()=>gi||(gi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function nr(e){if(Oe(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=pt(r)?nu(r):nr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(pt(e)||Ze(e))return e}const Zc=/;(?![^(]*\))/g,eu=/:([^]+)/,tu=/\/\*[^]*?\*\//g;function nu(e){const t={};return e.replace(tu,"").split(Zc).forEach(n=>{if(n){const r=n.split(eu);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function lt(e){let t="";if(pt(e))t=e;else if(Oe(e))for(let n=0;n<e.length;n++){const r=lt(e[n]);r&&(t+=r+" ")}else if(Ze(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const ru="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",su=Oo(ru);function Ja(e){return!!e||e===""}function ou(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=Fo(e[r],t[r]);return n}function Fo(e,t){if(e===t)return!0;let n=mi(e),r=mi(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=Yt(e),r=Yt(t),n||r)return e===t;if(n=Oe(e),r=Oe(t),n||r)return n&&r?ou(e,t):!1;if(n=Ze(e),r=Ze(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||!Fo(e[i],t[i]))return!1}}return String(e)===String(t)}const Qa=e=>!!(e&&e.__v_isRef===!0),_e=e=>pt(e)?e:e==null?"":Oe(e)||Ze(e)&&(e.toString===Ga||!He(e.toString))?Qa(e)?_e(e.value):JSON.stringify(e,Xa,2):String(e),Xa=(e,t)=>Qa(t)?Xa(e,t.value):pr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[Hs(r,o)+" =>"]=s,n),{})}:Wa(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Hs(n))}:Yt(t)?Hs(t):Ze(t)&&!Oe(t)&&!za(t)?String(t):t,Hs=(e,t="")=>{var n;return Yt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
6
- * @vue/reactivity v3.5.29
7
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
- * @license MIT
9
- **/let Lt;class iu{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=Lt,!t&&Lt&&(this.index=(Lt.scopes||(Lt.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=Lt;try{return Lt=this,t()}finally{Lt=n}}}on(){++this._on===1&&(this.prevScope=Lt,Lt=this)}off(){this._on>0&&--this._on===0&&(Lt=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 au(){return Lt}let at;const Us=new WeakSet;class Za{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,Lt&&Lt.active&&Lt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Us.has(this)&&(Us.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||tl(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,vi(this),nl(this);const t=at,n=Gt;at=this,Gt=!0;try{return this.fn()}finally{rl(this),at=t,Gt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Vo(t);this.deps=this.depsTail=void 0,vi(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Us.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){fo(this)&&this.run()}get dirty(){return fo(this)}}let el=0,Nr,Or;function tl(e,t=!1){if(e.flags|=8,t){e.next=Or,Or=e;return}e.next=Nr,Nr=e}function Ho(){el++}function Uo(){if(--el>0)return;if(Or){let t=Or;for(Or=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Nr;){let t=Nr;for(Nr=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 nl(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function rl(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),Vo(r),lu(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function fo(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(sl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function sl(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Hr)||(e.globalVersion=Hr,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!fo(e))))return;e.flags|=2;const t=e.dep,n=at,r=Gt;at=e,Gt=!0;try{nl(e);const s=e.fn(e._value);(t.version===0||Pn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{at=n,Gt=r,rl(e),e.flags&=-3}}function Vo(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)Vo(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function lu(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Gt=!0;const ol=[];function yn(){ol.push(Gt),Gt=!1}function wn(){const e=ol.pop();Gt=e===void 0?!0:e}function vi(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=at;at=void 0;try{t()}finally{at=n}}}let Hr=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 qo{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!at||!Gt||at===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==at)n=this.activeLink=new cu(at,this),at.deps?(n.prevDep=at.depsTail,at.depsTail.nextDep=n,at.depsTail=n):at.deps=at.depsTail=n,il(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=at.depsTail,n.nextDep=void 0,at.depsTail.nextDep=n,at.depsTail=n,at.deps===n&&(at.deps=r)}return n}trigger(t){this.version++,Hr++,this.notify(t)}notify(t){Ho();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Uo()}}}function il(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)il(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ho=new WeakMap,er=Symbol(""),po=Symbol(""),Ur=Symbol("");function Ct(e,t,n){if(Gt&&at){let r=ho.get(e);r||ho.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new qo),s.map=r,s.key=n),s.track()}}function mn(e,t,n,r,s,o){const i=ho.get(e);if(!i){Hr++;return}const a=l=>{l&&l.trigger()};if(Ho(),t==="clear")i.forEach(a);else{const l=Oe(e),d=l&&Do(n);if(l&&n==="length"){const u=Number(r);i.forEach((f,g)=>{(g==="length"||g===Ur||!Yt(g)&&g>=u)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),d&&a(i.get(Ur)),t){case"add":l?d&&a(i.get("length")):(a(i.get(er)),pr(e)&&a(i.get(po)));break;case"delete":l||(a(i.get(er)),pr(e)&&a(i.get(po)));break;case"set":pr(e)&&a(i.get(er));break}}Uo()}function lr(e){const t=Je(e);return t===e?t:(Ct(t,"iterate",Ur),Ut(e)?t:t.map(Jt))}function Cs(e){return Ct(e=Je(e),"iterate",Ur),e}function In(e,t){return bn(e)?yr(tr(e)?Jt(t):t):Jt(t)}const uu={__proto__:null,[Symbol.iterator](){return Vs(this,Symbol.iterator,e=>In(this,e))},concat(...e){return lr(this).concat(...e.map(t=>Oe(t)?lr(t):t))},entries(){return Vs(this,"entries",e=>(e[1]=In(this,e[1]),e))},every(e,t){return un(this,"every",e,t,void 0,arguments)},filter(e,t){return un(this,"filter",e,t,n=>n.map(r=>In(this,r)),arguments)},find(e,t){return un(this,"find",e,t,n=>In(this,n),arguments)},findIndex(e,t){return un(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return un(this,"findLast",e,t,n=>In(this,n),arguments)},findLastIndex(e,t){return un(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return un(this,"forEach",e,t,void 0,arguments)},includes(...e){return qs(this,"includes",e)},indexOf(...e){return qs(this,"indexOf",e)},join(e){return lr(this).join(e)},lastIndexOf(...e){return qs(this,"lastIndexOf",e)},map(e,t){return un(this,"map",e,t,void 0,arguments)},pop(){return Cr(this,"pop")},push(...e){return Cr(this,"push",e)},reduce(e,...t){return yi(this,"reduce",e,t)},reduceRight(e,...t){return yi(this,"reduceRight",e,t)},shift(){return Cr(this,"shift")},some(e,t){return un(this,"some",e,t,void 0,arguments)},splice(...e){return Cr(this,"splice",e)},toReversed(){return lr(this).toReversed()},toSorted(e){return lr(this).toSorted(e)},toSpliced(...e){return lr(this).toSpliced(...e)},unshift(...e){return Cr(this,"unshift",e)},values(){return Vs(this,"values",e=>In(this,e))}};function Vs(e,t,n){const r=Cs(e),s=r[t]();return r!==e&&!Ut(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const du=Array.prototype;function un(e,t,n,r,s,o){const i=Cs(e),a=i!==e&&!Ut(e),l=i[t];if(l!==du[t]){const f=l.apply(e,o);return a?Jt(f):f}let d=n;i!==e&&(a?d=function(f,g){return n.call(this,In(e,f),g,e)}:n.length>2&&(d=function(f,g){return n.call(this,f,g,e)}));const u=l.call(i,d,r);return a&&s?s(u):u}function yi(e,t,n,r){const s=Cs(e);let o=n;return s!==e&&(Ut(e)?n.length>3&&(o=function(i,a,l){return n.call(this,i,a,l,e)}):o=function(i,a,l){return n.call(this,i,In(e,a),l,e)}),s[t](o,...r)}function qs(e,t,n){const r=Je(e);Ct(r,"iterate",Ur);const s=r[t](...n);return(s===-1||s===!1)&&Go(n[0])?(n[0]=Je(n[0]),r[t](...n)):s}function Cr(e,t,n=[]){yn(),Ho();const r=Je(e)[t].apply(e,n);return Uo(),wn(),r}const fu=Oo("__proto__,__v_isRef,__isVue"),al=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Yt));function hu(e){Yt(e)||(e=String(e));const t=Je(this);return Ct(t,"has",e),t.hasOwnProperty(e)}class ll{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?Tu:fl:o?dl:ul).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Oe(t);if(!s){let l;if(i&&(l=uu[n]))return l;if(n==="hasOwnProperty")return hu}const a=Reflect.get(t,n,It(t)?t:r);if((Yt(n)?al.has(n):fu(n))||(s||Ct(t,"get",n),o))return a;if(It(a)){const l=i&&Do(n)?a:a.value;return s&&Ze(l)?go(l):l}return Ze(a)?s?go(a):As(a):a}}class cl extends ll{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Oe(t)&&Do(n);if(!this._isShallow){const d=bn(o);if(!Ut(r)&&!bn(r)&&(o=Je(o),r=Je(r)),!i&&It(o)&&!It(r))return d||(o.value=r),!0}const a=i?Number(n)<t.length:Xe(t,n),l=Reflect.set(t,n,r,It(t)?t:s);return t===Je(s)&&(a?Pn(r,o)&&mn(t,"set",n,r):mn(t,"add",n,r)),l}deleteProperty(t,n){const r=Xe(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(!Yt(n)||!al.has(n))&&Ct(t,"has",n),r}ownKeys(t){return Ct(t,"iterate",Oe(t)?"length":er),Reflect.ownKeys(t)}}class pu extends ll{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const mu=new cl,gu=new pu,vu=new cl(!0);const mo=e=>e,ts=e=>Reflect.getPrototypeOf(e);function yu(e,t,n){return function(...r){const s=this.__v_raw,o=Je(s),i=pr(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,d=s[e](...r),u=n?mo:t?yr:Jt;return!t&&Ct(o,"iterate",l?po:er),bt(Object.create(d),{next(){const{value:f,done:g}=d.next();return g?{value:f,done:g}:{value:a?[u(f[0]),u(f[1])]:u(f),done:g}}})}}function ns(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function wu(e,t){const n={get(s){const o=this.__v_raw,i=Je(o),a=Je(s);e||(Pn(s,a)&&Ct(i,"get",s),Ct(i,"get",a));const{has:l}=ts(i),d=t?mo:e?yr:Jt;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&&Ct(Je(s),"iterate",er),s.size},has(s){const o=this.__v_raw,i=Je(o),a=Je(s);return e||(Pn(s,a)&&Ct(i,"has",s),Ct(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=Je(a),d=t?mo:e?yr:Jt;return!e&&Ct(l,"iterate",er),a.forEach((u,f)=>s.call(o,d(u),d(f),i))}};return bt(n,e?{add:ns("add"),set:ns("set"),delete:ns("delete"),clear:ns("clear")}:{add(s){!t&&!Ut(s)&&!bn(s)&&(s=Je(s));const o=Je(this);return ts(o).has.call(o,s)||(o.add(s),mn(o,"add",s,s)),this},set(s,o){!t&&!Ut(o)&&!bn(o)&&(o=Je(o));const i=Je(this),{has:a,get:l}=ts(i);let d=a.call(i,s);d||(s=Je(s),d=a.call(i,s));const u=l.call(i,s);return i.set(s,o),d?Pn(o,u)&&mn(i,"set",s,o):mn(i,"add",s,o),this},delete(s){const o=Je(this),{has:i,get:a}=ts(o);let l=i.call(o,s);l||(s=Je(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=Je(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]=yu(s,e,t)}),n}function Wo(e,t){const n=wu(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(Xe(n,s)&&s in r?n:r,s,o)}const bu={get:Wo(!1,!1)},_u={get:Wo(!1,!0)},ku={get:Wo(!0,!1)};const ul=new WeakMap,dl=new WeakMap,fl=new WeakMap,Tu=new WeakMap;function Su(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function xu(e){return e.__v_skip||!Object.isExtensible(e)?0:Su(Yc(e))}function As(e){return bn(e)?e:Ko(e,!1,mu,bu,ul)}function hl(e){return Ko(e,!1,vu,_u,dl)}function go(e){return Ko(e,!0,gu,ku,fl)}function Ko(e,t,n,r,s){if(!Ze(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=xu(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 tr(e){return bn(e)?tr(e.__v_raw):!!(e&&e.__v_isReactive)}function bn(e){return!!(e&&e.__v_isReadonly)}function Ut(e){return!!(e&&e.__v_isShallow)}function Go(e){return e?!!e.__v_raw:!1}function Je(e){const t=e&&e.__v_raw;return t?Je(t):e}function Cu(e){return!Xe(e,"__v_skip")&&Object.isExtensible(e)&&Ya(e,"__v_skip",!0),e}const Jt=e=>Ze(e)?As(e):e,yr=e=>Ze(e)?go(e):e;function It(e){return e?e.__v_isRef===!0:!1}function U(e){return pl(e,!1)}function Au(e){return pl(e,!0)}function pl(e,t){return It(e)?e:new Eu(e,t)}class Eu{constructor(t,n){this.dep=new qo,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Je(t),this._value=n?t:Jt(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Ut(t)||bn(t);t=r?t:Je(t),Pn(t,n)&&(this._rawValue=t,this._value=r?t:Jt(t),this.dep.trigger())}}function $e(e){return It(e)?e.value:e}const Iu={get:(e,t,n)=>t==="__v_raw"?e:$e(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return It(s)&&!It(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function ml(e){return tr(e)?e:new Proxy(e,Iu)}class Ru{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new qo(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Hr-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&at!==this)return tl(this,!0),!0}get value(){const t=this.dep.track();return sl(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function $u(e,t,n=!1){let r,s;return He(e)?r=e:(r=e.get,s=e.set),new Ru(r,s,n)}const rs={},hs=new WeakMap;let Jn;function Mu(e,t=!1,n=Jn){if(n){let r=hs.get(n);r||hs.set(n,r=[]),r.push(e)}}function Pu(e,t,n=it){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,d=F=>s?F:Ut(F)||s===!1||s===0?gn(F,1):gn(F);let u,f,g,b,M=!1,C=!1;if(It(e)?(f=()=>e.value,M=Ut(e)):tr(e)?(f=()=>d(e),M=!0):Oe(e)?(C=!0,M=e.some(F=>tr(F)||Ut(F)),f=()=>e.map(F=>{if(It(F))return F.value;if(tr(F))return d(F);if(He(F))return l?l(F,2):F()})):He(e)?t?f=l?()=>l(e,2):e:f=()=>{if(g){yn();try{g()}finally{wn()}}const F=Jn;Jn=u;try{return l?l(e,3,[b]):e(b)}finally{Jn=F}}:f=ln,t&&s){const F=f,ae=s===!0?1/0:s;f=()=>gn(F(),ae)}const B=au(),K=()=>{u.stop(),B&&B.active&&Lo(B.effects,u)};if(o&&t){const F=t;t=(...ae)=>{F(...ae),K()}}let $=C?new Array(e.length).fill(rs):rs;const q=F=>{if(!(!(u.flags&1)||!u.dirty&&!F))if(t){const ae=u.run();if(s||M||(C?ae.some((ie,le)=>Pn(ie,$[le])):Pn(ae,$))){g&&g();const ie=Jn;Jn=u;try{const le=[ae,$===rs?void 0:C&&$[0]===rs?[]:$,b];$=ae,l?l(t,3,le):t(...le)}finally{Jn=ie}}}else u.run()};return a&&a(q),u=new Za(f),u.scheduler=i?()=>i(q,!1):q,b=F=>Mu(F,!1,u),g=u.onStop=()=>{const F=hs.get(u);if(F){if(l)l(F,4);else for(const ae of F)ae();hs.delete(u)}},t?r?q(!0):$=u.run():i?i(q.bind(null,!0),!0):u.run(),K.pause=u.pause.bind(u),K.resume=u.resume.bind(u),K.stop=K,K}function gn(e,t=1/0,n){if(t<=0||!Ze(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,It(e))gn(e.value,t,n);else if(Oe(e))for(let r=0;r<e.length;r++)gn(e[r],t,n);else if(Wa(e)||pr(e))e.forEach(r=>{gn(r,t,n)});else if(za(e)){for(const r in e)gn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&gn(e[r],t,n)}return e}/**
10
- * @vue/runtime-core v3.5.29
11
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
- * @license MIT
13
- **/function Qr(e,t,n,r){try{return r?e(...r):e()}catch(s){Es(s,t,n)}}function Qt(e,t,n,r){if(He(e)){const s=Qr(e,t,n,r);return s&&Ka(s)&&s.catch(o=>{Es(o,t,n)}),s}if(Oe(e)){const s=[];for(let o=0;o<e.length;o++)s.push(Qt(e[o],t,n,r));return s}}function Es(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||it;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){yn(),Qr(o,null,10,[e,l,d]),wn();return}}Nu(e,n,s,r,i)}function Nu(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Pt=[];let rn=-1;const mr=[];let Rn=null,ur=0;const gl=Promise.resolve();let ps=null;function Vt(e){const t=ps||gl;return e?t.then(this?e.bind(this):e):t}function Ou(e){let t=rn+1,n=Pt.length;for(;t<n;){const r=t+n>>>1,s=Pt[r],o=Vr(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function zo(e){if(!(e.flags&1)){const t=Vr(e),n=Pt[Pt.length-1];!n||!(e.flags&2)&&t>=Vr(n)?Pt.push(e):Pt.splice(Ou(t),0,e),e.flags|=1,vl()}}function vl(){ps||(ps=gl.then(wl))}function ju(e){Oe(e)?mr.push(...e):Rn&&e.id===-1?Rn.splice(ur+1,0,e):e.flags&1||(mr.push(e),e.flags|=1),vl()}function wi(e,t,n=rn+1){for(;n<Pt.length;n++){const r=Pt[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Pt.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function yl(e){if(mr.length){const t=[...new Set(mr)].sort((n,r)=>Vr(n)-Vr(r));if(mr.length=0,Rn){Rn.push(...t);return}for(Rn=t,ur=0;ur<Rn.length;ur++){const n=Rn[ur];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Rn=null,ur=0}}const Vr=e=>e.id==null?e.flags&2?-1:1/0:e.id;function wl(e){try{for(rn=0;rn<Pt.length;rn++){const t=Pt[rn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Qr(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;rn<Pt.length;rn++){const t=Pt[rn];t&&(t.flags&=-2)}rn=-1,Pt.length=0,yl(),ps=null,(Pt.length||mr.length)&&wl()}}let _t=null,bl=null;function ms(e){const t=_t;return _t=e,bl=e&&e.type.__scopeId||null,t}function nt(e,t=_t,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&ys(-1);const o=ms(t);let i;try{i=e(...s)}finally{ms(o),r._d&&ys(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Nn(e,t){if(_t===null)return e;const n=Ns(_t),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=it]=t[s];o&&(He(o)&&(o={mounted:o,updated:o}),o.deep&&gn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function Wn(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&&(yn(),Qt(l,n,8,[e.el,a,e,t]),wn())}}function cs(e,t){if(Et){let n=Et.provides;const r=Et.parent&&Et.parent.provides;r===n&&(n=Et.provides=Object.create(r)),n[e]=t}}function zt(e,t,n=!1){const r=Zo();if(r||vr){let s=vr?vr._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&&He(t)?t.call(r&&r.proxy):t}}const Lu=Symbol.for("v-scx"),Du=()=>zt(Lu);function ft(e,t,n){return _l(e,t,n)}function _l(e,t,n=it){const{immediate:r,deep:s,flush:o,once:i}=n,a=bt({},n),l=t&&r||!t&&o!=="post";let d;if(Gr){if(o==="sync"){const b=Du();d=b.__watcherHandles||(b.__watcherHandles=[])}else if(!l){const b=()=>{};return b.stop=ln,b.resume=ln,b.pause=ln,b}}const u=Et;a.call=(b,M,C)=>Qt(b,u,M,C);let f=!1;o==="post"?a.scheduler=b=>{xt(b,u&&u.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(b,M)=>{M?b():zo(b)}),a.augmentJob=b=>{t&&(b.flags|=4),f&&(b.flags|=2,u&&(b.id=u.uid,b.i=u))};const g=Pu(e,t,a);return Gr&&(d?d.push(g):l&&g()),g}function Bu(e,t,n){const r=this.proxy,s=pt(e)?e.includes(".")?kl(r,e):()=>r[e]:e.bind(r,r);let o;He(t)?o=t:(o=t.handler,n=t);const i=Xr(this),a=_l(s,o.bind(r),n);return i(),a}function kl(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 Tl=Symbol("_vte"),Sl=e=>e.__isTeleport,jr=e=>e&&(e.disabled||e.disabled===""),bi=e=>e&&(e.defer||e.defer===""),_i=e=>typeof SVGElement<"u"&&e instanceof SVGElement,ki=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,vo=(e,t)=>{const n=e&&e.to;return pt(n)?t?t(n):null:n},xl={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,d){const{mc:u,pc:f,pbc:g,o:{insert:b,querySelector:M,createText:C,createComment:B}}=d,K=jr(t.props);let{shapeFlag:$,children:q,dynamicChildren:F}=t;if(e==null){const ae=t.el=C(""),ie=t.anchor=C("");b(ae,n,r),b(ie,n,r);const le=(oe,te)=>{$&16&&u(q,oe,te,s,o,i,a,l)},de=()=>{const oe=t.target=vo(t.props,M),te=yo(oe,t,C,b);oe&&(i!=="svg"&&_i(oe)?i="svg":i!=="mathml"&&ki(oe)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(oe),K||(le(oe,te),us(t,!1)))};K&&(le(n,ie),us(t,!0)),bi(t.props)?(t.el.__isMounted=!1,xt(()=>{de(),delete t.el.__isMounted},o)):de()}else{if(bi(t.props)&&e.el.__isMounted===!1){xt(()=>{xl.process(e,t,n,r,s,o,i,a,l,d)},o);return}t.el=e.el,t.targetStart=e.targetStart;const ae=t.anchor=e.anchor,ie=t.target=e.target,le=t.targetAnchor=e.targetAnchor,de=jr(e.props),oe=de?n:ie,te=de?ae:le;if(i==="svg"||_i(ie)?i="svg":(i==="mathml"||ki(ie))&&(i="mathml"),F?(g(e.dynamicChildren,F,oe,s,o,i,a),Qo(e,t,!0)):l||f(e,t,oe,te,s,o,i,a,!1),K)de?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):ss(t,n,ae,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const fe=t.target=vo(t.props,M);fe&&ss(t,fe,null,d,0)}else de&&ss(t,ie,le,d,1);us(t,K)}},remove(e,t,n,{um:r,o:{remove:s}},o){const{shapeFlag:i,children:a,anchor:l,targetStart:d,targetAnchor:u,target:f,props:g}=e;if(f&&(s(d),s(u)),o&&s(l),i&16){const b=o||!jr(g);for(let M=0;M<a.length;M++){const C=a[M];r(C,t,n,b,!!C.dynamicChildren)}}},move:ss,hydrate:Fu};function ss(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||jr(u))&&l&16)for(let g=0;g<d.length;g++)s(d[g],t,n,2);f&&r(a,t,n)}function Fu(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:d,createText:u}},f){function g(B,K){let $=K;for(;$;){if($&&$.nodeType===8){if($.data==="teleport start anchor")t.targetStart=$;else if($.data==="teleport anchor"){t.targetAnchor=$,B._lpa=t.targetAnchor&&i(t.targetAnchor);break}}$=i($)}}function b(B,K){K.anchor=f(i(B),K,a(B),n,r,s,o)}const M=t.target=vo(t.props,l),C=jr(t.props);if(M){const B=M._lpa||M.firstChild;t.shapeFlag&16&&(C?(b(e,t),g(M,B),t.targetAnchor||yo(M,t,u,d,a(e)===M?e:null)):(t.anchor=i(e),g(M,B),t.targetAnchor||yo(M,t,u,d),f(B&&i(B),t,M,n,r,s,o))),us(t,C)}else C&&t.shapeFlag&16&&(b(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Cl=xl;function us(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 yo(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Tl]=i,e&&(r(o,e,s),r(i,e,s)),i}const sn=Symbol("_leaveCb"),Ar=Symbol("_enterCb");function Hu(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Dn(()=>{e.isMounted=!0}),Bn(()=>{e.isUnmounting=!0}),e}const Ht=[Function,Array],Al={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ht,onEnter:Ht,onAfterEnter:Ht,onEnterCancelled:Ht,onBeforeLeave:Ht,onLeave:Ht,onAfterLeave:Ht,onLeaveCancelled:Ht,onBeforeAppear:Ht,onAppear:Ht,onAfterAppear:Ht,onAppearCancelled:Ht},El=e=>{const t=e.subTree;return t.component?El(t.component):t},Uu={name:"BaseTransition",props:Al,setup(e,{slots:t}){const n=Zo(),r=Hu();return()=>{const s=t.default&&$l(t.default(),!0);if(!s||!s.length)return;const o=Il(s),i=Je(e),{mode:a}=i;if(r.isLeaving)return Ws(o);const l=Ti(o);if(!l)return Ws(o);let d=wo(l,i,r,n,f=>d=f);l.type!==At&&qr(l,d);let u=n.subTree&&Ti(n.subTree);if(u&&u.type!==At&&!Qn(u,l)&&El(n).type!==At){let f=wo(u,i,r,n);if(qr(u,f),a==="out-in"&&l.type!==At)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,u=void 0},Ws(o);a==="in-out"&&l.type!==At?f.delayLeave=(g,b,M)=>{const C=Rl(r,u);C[String(u.key)]=u,g[sn]=()=>{b(),g[sn]=void 0,delete d.delayedLeave,u=void 0},d.delayedLeave=()=>{M(),delete d.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return o}}};function Il(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==At){t=n;break}}return t}const Vu=Uu;function Rl(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:g,onLeave:b,onAfterLeave:M,onLeaveCancelled:C,onBeforeAppear:B,onAppear:K,onAfterAppear:$,onAppearCancelled:q}=t,F=String(e.key),ae=Rl(n,e),ie=(oe,te)=>{oe&&Qt(oe,r,9,te)},le=(oe,te)=>{const fe=te[1];ie(oe,te),Oe(oe)?oe.every(X=>X.length<=1)&&fe():oe.length<=1&&fe()},de={mode:i,persisted:a,beforeEnter(oe){let te=l;if(!n.isMounted)if(o)te=B||l;else return;oe[sn]&&oe[sn](!0);const fe=ae[F];fe&&Qn(e,fe)&&fe.el[sn]&&fe.el[sn](),ie(te,[oe])},enter(oe){if(ae[F]===e)return;let te=d,fe=u,X=f;if(!n.isMounted)if(o)te=K||d,fe=$||u,X=q||f;else return;let Ne=!1;oe[Ar]=Ge=>{Ne||(Ne=!0,Ge?ie(X,[oe]):ie(fe,[oe]),de.delayedLeave&&de.delayedLeave(),oe[Ar]=void 0)};const We=oe[Ar].bind(null,!1);te?le(te,[oe,We]):We()},leave(oe,te){const fe=String(e.key);if(oe[Ar]&&oe[Ar](!0),n.isUnmounting)return te();ie(g,[oe]);let X=!1;oe[sn]=We=>{X||(X=!0,te(),We?ie(C,[oe]):ie(M,[oe]),oe[sn]=void 0,ae[fe]===e&&delete ae[fe])};const Ne=oe[sn].bind(null,!1);ae[fe]=e,b?le(b,[oe,Ne]):Ne()},clone(oe){const te=wo(oe,t,n,r,s);return s&&s(te),te}};return de}function Ws(e){if(Is(e))return e=On(e),e.children=null,e}function Ti(e){if(!Is(e))return Sl(e.type)&&e.children?Il(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&&He(n.default))return n.default()}}function qr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,qr(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 $l(e,t=!1,n){let r=[],s=0;for(let o=0;o<e.length;o++){let i=e[o];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:o);i.type===Fe?(i.patchFlag&128&&s++,r=r.concat($l(i.children,t,a))):(t||i.type!==At)&&r.push(a!=null?On(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function kt(e,t){return He(e)?bt({name:e.name},t,{setup:e}):e}function Ml(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Si(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const gs=new WeakMap;function Lr(e,t,n,r,s=!1){if(Oe(e)){e.forEach((C,B)=>Lr(C,t&&(Oe(t)?t[B]:t),n,r,s));return}if(gr(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Lr(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?Ns(r.component):r.el,i=s?null:o,{i:a,r:l}=e,d=t&&t.r,u=a.refs===it?a.refs={}:a.refs,f=a.setupState,g=Je(f),b=f===it?qa:C=>Si(u,C)?!1:Xe(g,C),M=(C,B)=>!(B&&Si(u,B));if(d!=null&&d!==l){if(xi(t),pt(d))u[d]=null,b(d)&&(f[d]=null);else if(It(d)){const C=t;M(d,C.k)&&(d.value=null),C.k&&(u[C.k]=null)}}if(He(l))Qr(l,a,12,[i,u]);else{const C=pt(l),B=It(l);if(C||B){const K=()=>{if(e.f){const $=C?b(l)?f[l]:u[l]:M()||!e.k?l.value:u[e.k];if(s)Oe($)&&Lo($,o);else if(Oe($))$.includes(o)||$.push(o);else if(C)u[l]=[o],b(l)&&(f[l]=u[l]);else{const q=[o];M(l,e.k)&&(l.value=q),e.k&&(u[e.k]=q)}}else C?(u[l]=i,b(l)&&(f[l]=i)):B&&(M(l,e.k)&&(l.value=i),e.k&&(u[e.k]=i))};if(i){const $=()=>{K(),gs.delete(e)};$.id=-1,gs.set(e,$),xt($,n)}else xi(e),K()}}}function xi(e){const t=gs.get(e);t&&(t.flags|=8,gs.delete(e))}xs().requestIdleCallback;xs().cancelIdleCallback;const gr=e=>!!e.type.__asyncLoader,Is=e=>e.type.__isKeepAlive;function qu(e,t){Pl(e,"a",t)}function Wu(e,t){Pl(e,"da",t)}function Pl(e,t,n=Et){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(Rs(t,r,n),n){let s=n.parent;for(;s&&s.parent;)Is(s.parent.vnode)&&Ku(r,t,n,s),s=s.parent}}function Ku(e,t,n,r){const s=Rs(t,e,r,!0);$s(()=>{Lo(r[t],s)},n)}function Rs(e,t,n=Et,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{yn();const a=Xr(n),l=Qt(t,n,e,i);return a(),wn(),l});return r?s.unshift(o):s.push(o),o}}const _n=e=>(t,n=Et)=>{(!Gr||e==="sp")&&Rs(e,(...r)=>t(...r),n)},Gu=_n("bm"),Dn=_n("m"),zu=_n("bu"),Yu=_n("u"),Bn=_n("bum"),$s=_n("um"),Ju=_n("sp"),Qu=_n("rtg"),Xu=_n("rtc");function Zu(e,t=Et){Rs("ec",e,t)}const ed="components",Nl=Symbol.for("v-ndc");function td(e){return pt(e)?nd(ed,e,!1)||e:e||Nl}function nd(e,t,n=!0,r=!1){const s=_t||Et;if(s){const o=s.type;{const a=Hd(o,!1);if(a&&(a===t||a===qt(t)||a===Ss(qt(t))))return o}const i=Ci(s[e]||o[e],t)||Ci(s.appContext[e],t);return!i&&r?o:i}}function Ci(e,t){return e&&(e[t]||e[qt(t)]||e[Ss(qt(t))])}function ht(e,t,n,r){let s;const o=n,i=Oe(e);if(i||pt(e)){const a=i&&tr(e);let l=!1,d=!1;a&&(l=!Ut(e),d=bn(e),e=Cs(e)),s=new Array(e.length);for(let u=0,f=e.length;u<f;u++)s[u]=t(l?d?yr(Jt(e[u])):Jt(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(Ze(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 an(e,t,n={},r,s){if(_t.ce||_t.parent&&gr(_t.parent)&&_t.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),_(),ot(Fe,null,[Ae("slot",n,r)],d?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),_();const i=o&&Ol(o(n)),a=n.key||i&&i.key,l=ot(Fe,{key:(a&&!Yt(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function Ol(e){return e.some(t=>Kr(t)?!(t.type===At||t.type===Fe&&!Ol(t.children)):!0)?e:null}const bo=e=>e?tc(e)?Ns(e):bo(e.parent):null,Dr=bt(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>bo(e.parent),$root:e=>bo(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Ll(e),$forceUpdate:e=>e.f||(e.f=()=>{zo(e.update)}),$nextTick:e=>e.n||(e.n=Vt.bind(e.proxy)),$watch:e=>Bu.bind(e)}),Ks=(e,t)=>e!==it&&!e.__isScriptSetup&&Xe(e,t),rd={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 g=i[t];if(g!==void 0)switch(g){case 1:return r[t];case 2:return s[t];case 4:return n[t];case 3:return o[t]}else{if(Ks(r,t))return i[t]=1,r[t];if(s!==it&&Xe(s,t))return i[t]=2,s[t];if(Xe(o,t))return i[t]=3,o[t];if(n!==it&&Xe(n,t))return i[t]=4,n[t];_o&&(i[t]=0)}}const d=Dr[t];let u,f;if(d)return t==="$attrs"&&Ct(e.attrs,"get",""),d(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==it&&Xe(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,Xe(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return Ks(s,t)?(s[t]=n,!0):r!==it&&Xe(r,t)?(r[t]=n,!0):Xe(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!==it&&a[0]!=="$"&&Xe(e,a)||Ks(t,a)||Xe(o,a)||Xe(r,a)||Xe(Dr,a)||Xe(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Xe(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function sd(){return od().slots}function od(e){const t=Zo();return t.setupContext||(t.setupContext=rc(t))}function Ai(e){return Oe(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let _o=!0;function id(e){const t=Ll(e),n=e.proxy,r=e.ctx;_o=!1,t.beforeCreate&&Ei(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:d,created:u,beforeMount:f,mounted:g,beforeUpdate:b,updated:M,activated:C,deactivated:B,beforeDestroy:K,beforeUnmount:$,destroyed:q,unmounted:F,render:ae,renderTracked:ie,renderTriggered:le,errorCaptured:de,serverPrefetch:oe,expose:te,inheritAttrs:fe,components:X,directives:Ne,filters:We}=t;if(d&&ad(d,r,null),i)for(const Le in i){const Ee=i[Le];He(Ee)&&(r[Le]=Ee.bind(n))}if(s){const Le=s.call(n,n);Ze(Le)&&(e.data=As(Le))}if(_o=!0,o)for(const Le in o){const Ee=o[Le],rt=He(Ee)?Ee.bind(n,n):He(Ee.get)?Ee.get.bind(n,n):ln,tt=!He(Ee)&&He(Ee.set)?Ee.set.bind(n):ln,et=ce({get:rt,set:tt});Object.defineProperty(r,Le,{enumerable:!0,configurable:!0,get:()=>et.value,set:qe=>et.value=qe})}if(a)for(const Le in a)jl(a[Le],r,n,Le);if(l){const Le=He(l)?l.call(n):l;Reflect.ownKeys(Le).forEach(Ee=>{cs(Ee,Le[Ee])})}u&&Ei(u,e,"c");function ke(Le,Ee){Oe(Ee)?Ee.forEach(rt=>Le(rt.bind(n))):Ee&&Le(Ee.bind(n))}if(ke(Gu,f),ke(Dn,g),ke(zu,b),ke(Yu,M),ke(qu,C),ke(Wu,B),ke(Zu,de),ke(Xu,ie),ke(Qu,le),ke(Bn,$),ke($s,F),ke(Ju,oe),Oe(te))if(te.length){const Le=e.exposed||(e.exposed={});te.forEach(Ee=>{Object.defineProperty(Le,Ee,{get:()=>n[Ee],set:rt=>n[Ee]=rt,enumerable:!0})})}else e.exposed||(e.exposed={});ae&&e.render===ln&&(e.render=ae),fe!=null&&(e.inheritAttrs=fe),X&&(e.components=X),Ne&&(e.directives=Ne),oe&&Ml(e)}function ad(e,t,n=ln){Oe(e)&&(e=ko(e));for(const r in e){const s=e[r];let o;Ze(s)?"default"in s?o=zt(s.from||r,s.default,!0):o=zt(s.from||r):o=zt(s),It(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function Ei(e,t,n){Qt(Oe(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function jl(e,t,n,r){let s=r.includes(".")?kl(n,r):()=>n[r];if(pt(e)){const o=t[e];He(o)&&ft(s,o)}else if(He(e))ft(s,e.bind(n));else if(Ze(e))if(Oe(e))e.forEach(o=>jl(o,t,n,r));else{const o=He(e.handler)?e.handler.bind(n):t[e.handler];He(o)&&ft(s,o,e)}}function Ll(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=>vs(l,d,i,!0)),vs(l,t,i)),Ze(t)&&o.set(t,l),l}function vs(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&vs(e,o,n,!0),s&&s.forEach(i=>vs(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=ld[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const ld={data:Ii,props:Ri,emits:Ri,methods:Mr,computed:Mr,beforeCreate:$t,created:$t,beforeMount:$t,mounted:$t,beforeUpdate:$t,updated:$t,beforeDestroy:$t,beforeUnmount:$t,destroyed:$t,unmounted:$t,activated:$t,deactivated:$t,errorCaptured:$t,serverPrefetch:$t,components:Mr,directives:Mr,watch:ud,provide:Ii,inject:cd};function Ii(e,t){return t?e?function(){return bt(He(e)?e.call(this,this):e,He(t)?t.call(this,this):t)}:t:e}function cd(e,t){return Mr(ko(e),ko(t))}function ko(e){if(Oe(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function $t(e,t){return e?[...new Set([].concat(e,t))]:t}function Mr(e,t){return e?bt(Object.create(null),e,t):t}function Ri(e,t){return e?Oe(e)&&Oe(t)?[...new Set([...e,...t])]:bt(Object.create(null),Ai(e),Ai(t??{})):t}function ud(e,t){if(!e)return t;if(!t)return e;const n=bt(Object.create(null),e);for(const r in t)n[r]=$t(e[r],t[r]);return n}function Dl(){return{app:null,config:{isNativeTag:qa,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 dd=0;function fd(e,t){return function(r,s=null){He(r)||(r=bt({},r)),s!=null&&!Ze(s)&&(s=null);const o=Dl(),i=new WeakSet,a=[];let l=!1;const d=o.app={_uid:dd++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:Vd,get config(){return o.config},set config(u){},use(u,...f){return i.has(u)||(u&&He(u.install)?(i.add(u),u.install(d,...f)):He(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,g){if(!l){const b=d._ceVNode||Ae(r,s);return b.appContext=o,g===!0?g="svg":g===!1&&(g=void 0),e(b,u,g),l=!0,d._container=u,u.__vue_app__=d,Ns(b.component)}},onUnmount(u){a.push(u)},unmount(){l&&(Qt(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=vr;vr=d;try{return u()}finally{vr=f}}};return d}}let vr=null;const hd=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${qt(t)}Modifiers`]||e[`${Ln(t)}Modifiers`];function pd(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||it;let s=n;const o=t.startsWith("update:"),i=o&&hd(r,t.slice(7));i&&(i.trim&&(s=n.map(u=>pt(u)?u.trim():u)),i.number&&(s=n.map(Bo)));let a,l=r[a=Fs(t)]||r[a=Fs(qt(t))];!l&&o&&(l=r[a=Fs(Ln(t))]),l&&Qt(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,Qt(d,e,6,s)}}const md=new WeakMap;function Bl(e,t,n=!1){const r=n?md:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!He(e)){const l=d=>{const u=Bl(d,t,!0);u&&(a=!0,bt(i,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(Ze(e)&&r.set(e,null),null):(Oe(o)?o.forEach(l=>i[l]=null):bt(i,o),Ze(e)&&r.set(e,i),i)}function Ms(e,t){return!e||!ks(t)?!1:(t=t.slice(2).replace(/Once$/,""),Xe(e,t[0].toLowerCase()+t.slice(1))||Xe(e,Ln(t))||Xe(e,t))}function $i(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:g,setupState:b,ctx:M,inheritAttrs:C}=e,B=ms(e);let K,$;try{if(n.shapeFlag&4){const F=s||r,ae=F;K=on(d.call(ae,F,u,f,b,g,M)),$=a}else{const F=t;K=on(F.length>1?F(f,{attrs:a,slots:i,emit:l}):F(f,null)),$=t.props?a:gd(a)}}catch(F){Br.length=0,Es(F,e,1),K=Ae(At)}let q=K;if($&&C!==!1){const F=Object.keys($),{shapeFlag:ae}=q;F.length&&ae&7&&(o&&F.some(jo)&&($=vd($,o)),q=On(q,$,!1,!0))}return n.dirs&&(q=On(q,null,!1,!0),q.dirs=q.dirs?q.dirs.concat(n.dirs):n.dirs),n.transition&&qr(q,n.transition),K=q,ms(B),K}const gd=e=>{let t;for(const n in e)(n==="class"||n==="style"||ks(n))&&((t||(t={}))[n]=e[n]);return t},vd=(e,t)=>{const n={};for(const r in e)(!jo(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function yd(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?Mi(r,i,d):!!i;if(l&8){const u=t.dynamicProps;for(let f=0;f<u.length;f++){const g=u[f];if(Fl(i,r,g)&&!Ms(d,g))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?Mi(r,i,d):!0:!!i;return!1}function Mi(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(Fl(t,e,o)&&!Ms(n,o))return!0}return!1}function Fl(e,t,n){const r=e[n],s=t[n];return n==="style"&&Ze(r)&&Ze(s)?!Fo(r,s):r!==s}function wd({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 Hl={},Ul=()=>Object.create(Hl),Vl=e=>Object.getPrototypeOf(e)===Hl;function bd(e,t,n,r=!1){const s={},o=Ul();e.propsDefaults=Object.create(null),ql(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:hl(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function _d(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=Je(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 g=u[f];if(Ms(e.emitsOptions,g))continue;const b=t[g];if(l)if(Xe(o,g))b!==o[g]&&(o[g]=b,d=!0);else{const M=qt(g);s[M]=To(l,a,M,b,e,!1)}else b!==o[g]&&(o[g]=b,d=!0)}}}else{ql(e,t,s,o)&&(d=!0);let u;for(const f in a)(!t||!Xe(t,f)&&((u=Ln(f))===f||!Xe(t,u)))&&(l?n&&(n[f]!==void 0||n[u]!==void 0)&&(s[f]=To(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!Xe(t,f))&&(delete o[f],d=!0)}d&&mn(e.attrs,"set","")}function ql(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(Pr(l))continue;const d=t[l];let u;s&&Xe(s,u=qt(l))?!o||!o.includes(u)?n[u]=d:(a||(a={}))[u]=d:Ms(e.emitsOptions,l)||(!(l in r)||d!==r[l])&&(r[l]=d,i=!0)}if(o){const l=Je(n),d=a||it;for(let u=0;u<o.length;u++){const f=o[u];n[f]=To(s,l,f,d[f],e,!Xe(d,f))}}return i}function To(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=Xe(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&He(l)){const{propsDefaults:d}=s;if(n in d)r=d[n];else{const u=Xr(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===Ln(n))&&(r=!0))}return r}const kd=new WeakMap;function Wl(e,t,n=!1){const r=n?kd:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!He(e)){const u=f=>{l=!0;const[g,b]=Wl(f,t,!0);bt(i,g),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 Ze(e)&&r.set(e,hr),hr;if(Oe(o))for(let u=0;u<o.length;u++){const f=qt(o[u]);Pi(f)&&(i[f]=it)}else if(o)for(const u in o){const f=qt(u);if(Pi(f)){const g=o[u],b=i[f]=Oe(g)||He(g)?{type:g}:bt({},g),M=b.type;let C=!1,B=!0;if(Oe(M))for(let K=0;K<M.length;++K){const $=M[K],q=He($)&&$.name;if(q==="Boolean"){C=!0;break}else q==="String"&&(B=!1)}else C=He(M)&&M.name==="Boolean";b[0]=C,b[1]=B,(C||Xe(b,"default"))&&a.push(f)}}const d=[i,a];return Ze(e)&&r.set(e,d),d}function Pi(e){return e[0]!=="$"&&!Pr(e)}const Yo=e=>e==="_"||e==="_ctx"||e==="$stable",Jo=e=>Oe(e)?e.map(on):[on(e)],Td=(e,t,n)=>{if(t._n)return t;const r=nt((...s)=>Jo(t(...s)),n);return r._c=!1,r},Kl=(e,t,n)=>{const r=e._ctx;for(const s in e){if(Yo(s))continue;const o=e[s];if(He(o))t[s]=Td(s,o,r);else if(o!=null){const i=Jo(o);t[s]=()=>i}}},Gl=(e,t)=>{const n=Jo(t);e.slots.default=()=>n},zl=(e,t,n)=>{for(const r in t)(n||!Yo(r))&&(e[r]=t[r])},Sd=(e,t,n)=>{const r=e.slots=Ul();if(e.vnode.shapeFlag&32){const s=t._;s?(zl(r,t,n),n&&Ya(r,"_",s,!0)):Kl(t,r)}else t&&Gl(e,t)},xd=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=it;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:zl(s,t,n):(o=!t.$stable,Kl(t,s)),i=t}else t&&(Gl(e,t),i={default:1});if(o)for(const a in s)!Yo(a)&&i[a]==null&&delete s[a]},xt=Rd;function Cd(e){return Ad(e)}function Ad(e,t){const n=xs();n.__VUE__=!0;const{insert:r,remove:s,patchProp:o,createElement:i,createText:a,createComment:l,setText:d,setElementText:u,parentNode:f,nextSibling:g,setScopeId:b=ln,insertStaticContent:M}=e,C=(m,v,S,L=null,H=null,O=null,re=void 0,ee=null,Q=!!v.dynamicChildren)=>{if(m===v)return;m&&!Qn(m,v)&&(L=E(m),qe(m,H,O,!0),m=null),v.patchFlag===-2&&(Q=!1,v.dynamicChildren=null);const{type:G,ref:ne,shapeFlag:se}=v;switch(G){case Ps:B(m,v,S,L);break;case At:K(m,v,S,L);break;case zs:m==null&&$(v,S,L,re);break;case Fe:X(m,v,S,L,H,O,re,ee,Q);break;default:se&1?ae(m,v,S,L,H,O,re,ee,Q):se&6?Ne(m,v,S,L,H,O,re,ee,Q):(se&64||se&128)&&G.process(m,v,S,L,H,O,re,ee,Q,he)}ne!=null&&H?Lr(ne,m&&m.ref,O,v||m,!v):ne==null&&m&&m.ref!=null&&Lr(m.ref,null,O,m,!0)},B=(m,v,S,L)=>{if(m==null)r(v.el=a(v.children),S,L);else{const H=v.el=m.el;v.children!==m.children&&d(H,v.children)}},K=(m,v,S,L)=>{m==null?r(v.el=l(v.children||""),S,L):v.el=m.el},$=(m,v,S,L)=>{[m.el,m.anchor]=M(m.children,v,S,L,m.el,m.anchor)},q=({el:m,anchor:v},S,L)=>{let H;for(;m&&m!==v;)H=g(m),r(m,S,L),m=H;r(v,S,L)},F=({el:m,anchor:v})=>{let S;for(;m&&m!==v;)S=g(m),s(m),m=S;s(v)},ae=(m,v,S,L,H,O,re,ee,Q)=>{if(v.type==="svg"?re="svg":v.type==="math"&&(re="mathml"),m==null)ie(v,S,L,H,O,re,ee,Q);else{const G=m.el&&m.el._isVueCE?m.el:null;try{G&&G._beginPatch(),oe(m,v,H,O,re,ee,Q)}finally{G&&G._endPatch()}}},ie=(m,v,S,L,H,O,re,ee)=>{let Q,G;const{props:ne,shapeFlag:se,transition:ye,dirs:xe}=m;if(Q=m.el=i(m.type,O,ne&&ne.is,ne),se&8?u(Q,m.children):se&16&&de(m.children,Q,null,L,H,Gs(m,O),re,ee),xe&&Wn(m,null,L,"created"),le(Q,m,m.scopeId,re,L),ne){for(const je in ne)je!=="value"&&!Pr(je)&&o(Q,je,null,ne[je],O,L);"value"in ne&&o(Q,"value",null,ne.value,O),(G=ne.onVnodeBeforeMount)&&nn(G,L,m)}xe&&Wn(m,null,L,"beforeMount");const Me=Ed(H,ye);Me&&ye.beforeEnter(Q),r(Q,v,S),((G=ne&&ne.onVnodeMounted)||Me||xe)&&xt(()=>{G&&nn(G,L,m),Me&&ye.enter(Q),xe&&Wn(m,null,L,"mounted")},H)},le=(m,v,S,L,H)=>{if(S&&b(m,S),L)for(let O=0;O<L.length;O++)b(m,L[O]);if(H){let O=H.subTree;if(v===O||Ql(O.type)&&(O.ssContent===v||O.ssFallback===v)){const re=H.vnode;le(m,re,re.scopeId,re.slotScopeIds,H.parent)}}},de=(m,v,S,L,H,O,re,ee,Q=0)=>{for(let G=Q;G<m.length;G++){const ne=m[G]=ee?pn(m[G]):on(m[G]);C(null,ne,v,S,L,H,O,re,ee)}},oe=(m,v,S,L,H,O,re)=>{const ee=v.el=m.el;let{patchFlag:Q,dynamicChildren:G,dirs:ne}=v;Q|=m.patchFlag&16;const se=m.props||it,ye=v.props||it;let xe;if(S&&Kn(S,!1),(xe=ye.onVnodeBeforeUpdate)&&nn(xe,S,v,m),ne&&Wn(v,m,S,"beforeUpdate"),S&&Kn(S,!0),(se.innerHTML&&ye.innerHTML==null||se.textContent&&ye.textContent==null)&&u(ee,""),G?te(m.dynamicChildren,G,ee,S,L,Gs(v,H),O):re||Ee(m,v,ee,null,S,L,Gs(v,H),O,!1),Q>0){if(Q&16)fe(ee,se,ye,S,H);else if(Q&2&&se.class!==ye.class&&o(ee,"class",null,ye.class,H),Q&4&&o(ee,"style",se.style,ye.style,H),Q&8){const Me=v.dynamicProps;for(let je=0;je<Me.length;je++){const Be=Me[je],Ue=se[Be],N=ye[Be];(N!==Ue||Be==="value")&&o(ee,Be,Ue,N,H,S)}}Q&1&&m.children!==v.children&&u(ee,v.children)}else!re&&G==null&&fe(ee,se,ye,S,H);((xe=ye.onVnodeUpdated)||ne)&&xt(()=>{xe&&nn(xe,S,v,m),ne&&Wn(v,m,S,"updated")},L)},te=(m,v,S,L,H,O,re)=>{for(let ee=0;ee<v.length;ee++){const Q=m[ee],G=v[ee],ne=Q.el&&(Q.type===Fe||!Qn(Q,G)||Q.shapeFlag&198)?f(Q.el):S;C(Q,G,ne,null,L,H,O,re,!0)}},fe=(m,v,S,L,H)=>{if(v!==S){if(v!==it)for(const O in v)!Pr(O)&&!(O in S)&&o(m,O,v[O],null,H,L);for(const O in S){if(Pr(O))continue;const re=S[O],ee=v[O];re!==ee&&O!=="value"&&o(m,O,ee,re,H,L)}"value"in S&&o(m,"value",v.value,S.value,H)}},X=(m,v,S,L,H,O,re,ee,Q)=>{const G=v.el=m?m.el:a(""),ne=v.anchor=m?m.anchor:a("");let{patchFlag:se,dynamicChildren:ye,slotScopeIds:xe}=v;xe&&(ee=ee?ee.concat(xe):xe),m==null?(r(G,S,L),r(ne,S,L),de(v.children||[],S,ne,H,O,re,ee,Q)):se>0&&se&64&&ye&&m.dynamicChildren&&m.dynamicChildren.length===ye.length?(te(m.dynamicChildren,ye,S,H,O,re,ee),(v.key!=null||H&&v===H.subTree)&&Qo(m,v,!0)):Ee(m,v,S,ne,H,O,re,ee,Q)},Ne=(m,v,S,L,H,O,re,ee,Q)=>{v.slotScopeIds=ee,m==null?v.shapeFlag&512?H.ctx.activate(v,S,L,re,Q):We(v,S,L,H,O,re,Q):Ge(m,v,Q)},We=(m,v,S,L,H,O,re)=>{const ee=m.component=Ld(m,L,H);if(Is(m)&&(ee.ctx.renderer=he),Dd(ee,!1,re),ee.asyncDep){if(H&&H.registerDep(ee,ke,re),!m.el){const Q=ee.subTree=Ae(At);K(null,Q,v,S),m.placeholder=Q.el}}else ke(ee,m,v,S,H,O,re)},Ge=(m,v,S)=>{const L=v.component=m.component;if(yd(m,v,S))if(L.asyncDep&&!L.asyncResolved){Le(L,v,S);return}else L.next=v,L.update();else v.el=m.el,L.vnode=v},ke=(m,v,S,L,H,O,re)=>{const ee=()=>{if(m.isMounted){let{next:se,bu:ye,u:xe,parent:Me,vnode:je}=m;{const p=Yl(m);if(p){se&&(se.el=je.el,Le(m,se,re)),p.asyncDep.then(()=>{xt(()=>{m.isUnmounted||G()},H)});return}}let Be=se,Ue;Kn(m,!1),se?(se.el=je.el,Le(m,se,re)):se=je,ye&&ls(ye),(Ue=se.props&&se.props.onVnodeBeforeUpdate)&&nn(Ue,Me,se,je),Kn(m,!0);const N=$i(m),V=m.subTree;m.subTree=N,C(V,N,f(V.el),E(V),m,H,O),se.el=N.el,Be===null&&wd(m,N.el),xe&&xt(xe,H),(Ue=se.props&&se.props.onVnodeUpdated)&&xt(()=>nn(Ue,Me,se,je),H)}else{let se;const{el:ye,props:xe}=v,{bm:Me,m:je,parent:Be,root:Ue,type:N}=m,V=gr(v);Kn(m,!1),Me&&ls(Me),!V&&(se=xe&&xe.onVnodeBeforeMount)&&nn(se,Be,v),Kn(m,!0);{Ue.ce&&Ue.ce._hasShadowRoot()&&Ue.ce._injectChildStyle(N);const p=m.subTree=$i(m);C(null,p,S,L,m,H,O),v.el=p.el}if(je&&xt(je,H),!V&&(se=xe&&xe.onVnodeMounted)){const p=v;xt(()=>nn(se,Be,p),H)}(v.shapeFlag&256||Be&&gr(Be.vnode)&&Be.vnode.shapeFlag&256)&&m.a&&xt(m.a,H),m.isMounted=!0,v=S=L=null}};m.scope.on();const Q=m.effect=new Za(ee);m.scope.off();const G=m.update=Q.run.bind(Q),ne=m.job=Q.runIfDirty.bind(Q);ne.i=m,ne.id=m.uid,Q.scheduler=()=>zo(ne),Kn(m,!0),G()},Le=(m,v,S)=>{v.component=m;const L=m.vnode.props;m.vnode=v,m.next=null,_d(m,v.props,L,S),xd(m,v.children,S),yn(),wi(m),wn()},Ee=(m,v,S,L,H,O,re,ee,Q=!1)=>{const G=m&&m.children,ne=m?m.shapeFlag:0,se=v.children,{patchFlag:ye,shapeFlag:xe}=v;if(ye>0){if(ye&128){tt(G,se,S,L,H,O,re,ee,Q);return}else if(ye&256){rt(G,se,S,L,H,O,re,ee,Q);return}}xe&8?(ne&16&&Se(G,H,O),se!==G&&u(S,se)):ne&16?xe&16?tt(G,se,S,L,H,O,re,ee,Q):Se(G,H,O,!0):(ne&8&&u(S,""),xe&16&&de(se,S,L,H,O,re,ee,Q))},rt=(m,v,S,L,H,O,re,ee,Q)=>{m=m||hr,v=v||hr;const G=m.length,ne=v.length,se=Math.min(G,ne);let ye;for(ye=0;ye<se;ye++){const xe=v[ye]=Q?pn(v[ye]):on(v[ye]);C(m[ye],xe,S,null,H,O,re,ee,Q)}G>ne?Se(m,H,O,!0,!1,se):de(v,S,L,H,O,re,ee,Q,se)},tt=(m,v,S,L,H,O,re,ee,Q)=>{let G=0;const ne=v.length;let se=m.length-1,ye=ne-1;for(;G<=se&&G<=ye;){const xe=m[G],Me=v[G]=Q?pn(v[G]):on(v[G]);if(Qn(xe,Me))C(xe,Me,S,null,H,O,re,ee,Q);else break;G++}for(;G<=se&&G<=ye;){const xe=m[se],Me=v[ye]=Q?pn(v[ye]):on(v[ye]);if(Qn(xe,Me))C(xe,Me,S,null,H,O,re,ee,Q);else break;se--,ye--}if(G>se){if(G<=ye){const xe=ye+1,Me=xe<ne?v[xe].el:L;for(;G<=ye;)C(null,v[G]=Q?pn(v[G]):on(v[G]),S,Me,H,O,re,ee,Q),G++}}else if(G>ye)for(;G<=se;)qe(m[G],H,O,!0),G++;else{const xe=G,Me=G,je=new Map;for(G=Me;G<=ye;G++){const Y=v[G]=Q?pn(v[G]):on(v[G]);Y.key!=null&&je.set(Y.key,G)}let Be,Ue=0;const N=ye-Me+1;let V=!1,p=0;const A=new Array(N);for(G=0;G<N;G++)A[G]=0;for(G=xe;G<=se;G++){const Y=m[G];if(Ue>=N){qe(Y,H,O,!0);continue}let ve;if(Y.key!=null)ve=je.get(Y.key);else for(Be=Me;Be<=ye;Be++)if(A[Be-Me]===0&&Qn(Y,v[Be])){ve=Be;break}ve===void 0?qe(Y,H,O,!0):(A[ve-Me]=G+1,ve>=p?p=ve:V=!0,C(Y,v[ve],S,null,H,O,re,ee,Q),Ue++)}const I=V?Id(A):hr;for(Be=I.length-1,G=N-1;G>=0;G--){const Y=Me+G,ve=v[Y],Ce=v[Y+1],Ye=Y+1<ne?Ce.el||Jl(Ce):L;A[G]===0?C(null,ve,S,Ye,H,O,re,ee,Q):V&&(Be<0||G!==I[Be]?et(ve,S,Ye,2):Be--)}}},et=(m,v,S,L,H=null)=>{const{el:O,type:re,transition:ee,children:Q,shapeFlag:G}=m;if(G&6){et(m.component.subTree,v,S,L);return}if(G&128){m.suspense.move(v,S,L);return}if(G&64){re.move(m,v,S,he);return}if(re===Fe){r(O,v,S);for(let se=0;se<Q.length;se++)et(Q[se],v,S,L);r(m.anchor,v,S);return}if(re===zs){q(m,v,S);return}if(L!==2&&G&1&&ee)if(L===0)ee.beforeEnter(O),r(O,v,S),xt(()=>ee.enter(O),H);else{const{leave:se,delayLeave:ye,afterLeave:xe}=ee,Me=()=>{m.ctx.isUnmounted?s(O):r(O,v,S)},je=()=>{O._isLeaving&&O[sn](!0),se(O,()=>{Me(),xe&&xe()})};ye?ye(O,Me,je):je()}else r(O,v,S)},qe=(m,v,S,L=!1,H=!1)=>{const{type:O,props:re,ref:ee,children:Q,dynamicChildren:G,shapeFlag:ne,patchFlag:se,dirs:ye,cacheIndex:xe}=m;if(se===-2&&(H=!1),ee!=null&&(yn(),Lr(ee,null,S,m,!0),wn()),xe!=null&&(v.renderCache[xe]=void 0),ne&256){v.ctx.deactivate(m);return}const Me=ne&1&&ye,je=!gr(m);let Be;if(je&&(Be=re&&re.onVnodeBeforeUnmount)&&nn(Be,v,m),ne&6)Te(m.component,S,L);else{if(ne&128){m.suspense.unmount(S,L);return}Me&&Wn(m,null,v,"beforeUnmount"),ne&64?m.type.remove(m,v,S,he,L):G&&!G.hasOnce&&(O!==Fe||se>0&&se&64)?Se(G,v,S,!1,!0):(O===Fe&&se&384||!H&&ne&16)&&Se(Q,v,S),L&&ut(m)}(je&&(Be=re&&re.onVnodeUnmounted)||Me)&&xt(()=>{Be&&nn(Be,v,m),Me&&Wn(m,null,v,"unmounted")},S)},ut=m=>{const{type:v,el:S,anchor:L,transition:H}=m;if(v===Fe){ue(S,L);return}if(v===zs){F(m);return}const O=()=>{s(S),H&&!H.persisted&&H.afterLeave&&H.afterLeave()};if(m.shapeFlag&1&&H&&!H.persisted){const{leave:re,delayLeave:ee}=H,Q=()=>re(S,O);ee?ee(m.el,O,Q):Q()}else O()},ue=(m,v)=>{let S;for(;m!==v;)S=g(m),s(m),m=S;s(v)},Te=(m,v,S)=>{const{bum:L,scope:H,job:O,subTree:re,um:ee,m:Q,a:G}=m;Ni(Q),Ni(G),L&&ls(L),H.stop(),O&&(O.flags|=8,qe(re,m,v,S)),ee&&xt(ee,v),xt(()=>{m.isUnmounted=!0},v)},Se=(m,v,S,L=!1,H=!1,O=0)=>{for(let re=O;re<m.length;re++)qe(m[re],v,S,L,H)},E=m=>{if(m.shapeFlag&6)return E(m.component.subTree);if(m.shapeFlag&128)return m.suspense.next();const v=g(m.anchor||m.el),S=v&&v[Tl];return S?g(S):v};let z=!1;const Z=(m,v,S)=>{let L;m==null?v._vnode&&(qe(v._vnode,null,null,!0),L=v._vnode.component):C(v._vnode||null,m,v,null,null,null,S),v._vnode=m,z||(z=!0,wi(L),yl(),z=!1)},he={p:C,um:qe,m:et,r:ut,mt:We,mc:de,pc:Ee,pbc:te,n:E,o:e};return{render:Z,hydrate:void 0,createApp:fd(Z)}}function Gs({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 Kn({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Ed(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Qo(e,t,n=!1){const r=e.children,s=t.children;if(Oe(r)&&Oe(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]=pn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&Qo(i,a)),a.type===Ps&&(a.patchFlag===-1&&(a=s[o]=pn(a)),a.el=i.el),a.type===At&&!a.el&&(a.el=i.el)}}function Id(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 Yl(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Yl(t)}function Ni(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Jl(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Jl(t.subTree):null}const Ql=e=>e.__isSuspense;function Rd(e,t){t&&t.pendingBranch?Oe(e)?t.effects.push(...e):t.effects.push(e):ju(e)}const Fe=Symbol.for("v-fgt"),Ps=Symbol.for("v-txt"),At=Symbol.for("v-cmt"),zs=Symbol.for("v-stc"),Br=[];let Bt=null;function _(e=!1){Br.push(Bt=e?null:[])}function $d(){Br.pop(),Bt=Br[Br.length-1]||null}let Wr=1;function ys(e,t=!1){Wr+=e,e<0&&Bt&&t&&(Bt.hasOnce=!0)}function Xl(e){return e.dynamicChildren=Wr>0?Bt||hr:null,$d(),Wr>0&&Bt&&Bt.push(e),e}function x(e,t,n,r,s,o){return Xl(w(e,t,n,r,s,o,!0))}function ot(e,t,n,r,s){return Xl(Ae(e,t,n,r,s,!0))}function Kr(e){return e?e.__v_isVNode===!0:!1}function Qn(e,t){return e.type===t.type&&e.key===t.key}const Zl=({key:e})=>e??null,ds=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?pt(e)||It(e)||He(e)?{i:_t,r:e,k:t,f:!!n}:e:null);function w(e,t=null,n=null,r=0,s=null,o=e===Fe?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Zl(t),ref:t&&ds(t),scopeId:bl,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?(Xo(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=pt(n)?8:16),Wr>0&&!i&&Bt&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Bt.push(l),l}const Ae=Md;function Md(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===Nl)&&(e=At),Kr(e)){const a=On(e,t,!0);return n&&Xo(a,n),Wr>0&&!o&&Bt&&(a.shapeFlag&6?Bt[Bt.indexOf(e)]=a:Bt.push(a)),a.patchFlag=-2,a}if(Ud(e)&&(e=e.__vccOpts),t){t=Pd(t);let{class:a,style:l}=t;a&&!pt(a)&&(t.class=lt(a)),Ze(l)&&(Go(l)&&!Oe(l)&&(l=bt({},l)),t.style=nr(l))}const i=pt(e)?1:Ql(e)?128:Sl(e)?64:Ze(e)?4:He(e)?2:0;return w(e,t,n,r,s,i,o,!0)}function Pd(e){return e?Go(e)||Vl(e)?bt({},e):e:null}function On(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,d=t?ec(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Zl(d),ref:t&&t.ref?n&&o?Oe(o)?o.concat(ds(t)):[o,ds(t)]:ds(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Fe?i===-1?16:i|16:i,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&On(e.ssContent),ssFallback:e.ssFallback&&On(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&qr(u,l.clone(u)),u}function Nd(e=" ",t=0){return Ae(Ps,null,e,t)}function pe(e="",t=!1){return t?(_(),ot(At,null,e)):Ae(At,null,e)}function on(e){return e==null||typeof e=="boolean"?Ae(At):Oe(e)?Ae(Fe,null,e.slice()):Kr(e)?pn(e):Ae(Ps,null,String(e))}function pn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:On(e)}function Xo(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Oe(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),Xo(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!Vl(t)?t._ctx=_t:s===3&&_t&&(_t.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else He(t)?(t={default:t,_ctx:_t},n=32):(t=String(t),r&64?(n=16,t=[Nd(t)]):n=8);e.children=t,e.shapeFlag|=n}function ec(...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=lt([t.class,r.class]));else if(s==="style")t.style=nr([t.style,r.style]);else if(ks(s)){const o=t[s],i=r[s];i&&o!==i&&!(Oe(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function nn(e,t,n,r=null){Qt(e,t,7,[n,r])}const Od=Dl();let jd=0;function Ld(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||Od,o={uid:jd++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new iu(!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:Wl(r,s),emitsOptions:Bl(r,s),emit:null,emitted:null,propsDefaults:it,inheritAttrs:r.inheritAttrs,ctx:it,data:it,props:it,attrs:it,slots:it,refs:it,setupState:it,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=pd.bind(null,o),e.ce&&e.ce(o),o}let Et=null;const Zo=()=>Et||_t;let ws,So;{const e=xs(),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=>Et=n),So=t("__VUE_SSR_SETTERS__",n=>Gr=n)}const Xr=e=>{const t=Et;return ws(e),e.scope.on(),()=>{e.scope.off(),ws(t)}},Oi=()=>{Et&&Et.scope.off(),ws(null)};function tc(e){return e.vnode.shapeFlag&4}let Gr=!1;function Dd(e,t=!1,n=!1){t&&So(t);const{props:r,children:s}=e.vnode,o=tc(e);bd(e,r,o,t),Sd(e,s,n||t);const i=o?Bd(e,t):void 0;return t&&So(!1),i}function Bd(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,rd);const{setup:r}=n;if(r){yn();const s=e.setupContext=r.length>1?rc(e):null,o=Xr(e),i=Qr(r,e,0,[e.props,s]),a=Ka(i);if(wn(),o(),(a||e.sp)&&!gr(e)&&Ml(e),a){if(i.then(Oi,Oi),t)return i.then(l=>{ji(e,l)}).catch(l=>{Es(l,e,0)});e.asyncDep=i}else ji(e,i)}else nc(e)}function ji(e,t,n){He(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ze(t)&&(e.setupState=ml(t)),nc(e)}function nc(e,t,n){const r=e.type;e.render||(e.render=r.render||ln);{const s=Xr(e);yn();try{id(e)}finally{wn(),s()}}}const Fd={get(e,t){return Ct(e,"get",""),e[t]}};function rc(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Fd),slots:e.slots,emit:e.emit,expose:t}}function Ns(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(ml(Cu(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Dr)return Dr[n](e)},has(t,n){return n in t||n in Dr}})):e.proxy}function Hd(e,t=!0){return He(e)?e.displayName||e.name:e.name||t&&e.__name}function Ud(e){return He(e)&&"__vccOpts"in e}const ce=(e,t)=>$u(e,t,Gr);function ei(e,t,n){try{ys(-1);const r=arguments.length;return r===2?Ze(t)&&!Oe(t)?Kr(t)?Ae(e,null,[t]):Ae(e,t):Ae(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Kr(n)&&(n=[n]),Ae(e,t,n))}finally{ys(1)}}const Vd="3.5.29";/**
14
- * @vue/runtime-dom v3.5.29
15
- * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
- * @license MIT
17
- **/let xo;const Li=typeof window<"u"&&window.trustedTypes;if(Li)try{xo=Li.createPolicy("vue",{createHTML:e=>e})}catch{}const sc=xo?e=>xo.createHTML(e):e=>e,qd="http://www.w3.org/2000/svg",Wd="http://www.w3.org/1998/Math/MathML",hn=typeof document<"u"?document:null,Di=hn&&hn.createElement("template"),Kd={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"?hn.createElementNS(qd,e):t==="mathml"?hn.createElementNS(Wd,e):n?hn.createElement(e,{is:n}):hn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>hn.createTextNode(e),createComment:e=>hn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>hn.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{Di.innerHTML=sc(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=Di.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]}},Cn="transition",Er="animation",zr=Symbol("_vtc"),oc={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},Gd=bt({},Al,oc),zd=e=>(e.displayName="Transition",e.props=Gd,e),Yd=zd((e,{slots:t})=>ei(Vu,Jd(e),t)),Gn=(e,t=[])=>{Oe(e)?e.forEach(n=>n(...t)):e&&e(...t)},Bi=e=>e?Oe(e)?e.some(t=>t.length>1):e.length>1:!1;function Jd(e){const t={};for(const X in e)X in oc||(t[X]=e[X]);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:g=`${n}-leave-active`,leaveToClass:b=`${n}-leave-to`}=e,M=Qd(s),C=M&&M[0],B=M&&M[1],{onBeforeEnter:K,onEnter:$,onEnterCancelled:q,onLeave:F,onLeaveCancelled:ae,onBeforeAppear:ie=K,onAppear:le=$,onAppearCancelled:de=q}=t,oe=(X,Ne,We,Ge)=>{X._enterCancelled=Ge,zn(X,Ne?u:a),zn(X,Ne?d:i),We&&We()},te=(X,Ne)=>{X._isLeaving=!1,zn(X,f),zn(X,b),zn(X,g),Ne&&Ne()},fe=X=>(Ne,We)=>{const Ge=X?le:$,ke=()=>oe(Ne,X,We);Gn(Ge,[Ne,ke]),Fi(()=>{zn(Ne,X?l:o),dn(Ne,X?u:a),Bi(Ge)||Hi(Ne,r,C,ke)})};return bt(t,{onBeforeEnter(X){Gn(K,[X]),dn(X,o),dn(X,i)},onBeforeAppear(X){Gn(ie,[X]),dn(X,l),dn(X,d)},onEnter:fe(!1),onAppear:fe(!0),onLeave(X,Ne){X._isLeaving=!0;const We=()=>te(X,Ne);dn(X,f),X._enterCancelled?(dn(X,g),qi(X)):(qi(X),dn(X,g)),Fi(()=>{X._isLeaving&&(zn(X,f),dn(X,b),Bi(F)||Hi(X,r,B,We))}),Gn(F,[X,We])},onEnterCancelled(X){oe(X,!1,void 0,!0),Gn(q,[X])},onAppearCancelled(X){oe(X,!0,void 0,!0),Gn(de,[X])},onLeaveCancelled(X){te(X),Gn(ae,[X])}})}function Qd(e){if(e==null)return null;if(Ze(e))return[Ys(e.enter),Ys(e.leave)];{const t=Ys(e);return[t,t]}}function Ys(e){return Xc(e)}function dn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[zr]||(e[zr]=new Set)).add(t)}function zn(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[zr];n&&(n.delete(t),n.size||(e[zr]=void 0))}function Fi(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Xd=0;function Hi(e,t,n,r){const s=e._endId=++Xd,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=Zd(e,t);if(!i)return r();const d=i+"end";let u=0;const f=()=>{e.removeEventListener(d,g),o()},g=b=>{b.target===e&&++u>=l&&f()};setTimeout(()=>{u<l&&f()},a+1),e.addEventListener(d,g)}function Zd(e,t){const n=window.getComputedStyle(e),r=M=>(n[M]||"").split(", "),s=r(`${Cn}Delay`),o=r(`${Cn}Duration`),i=Ui(s,o),a=r(`${Er}Delay`),l=r(`${Er}Duration`),d=Ui(a,l);let u=null,f=0,g=0;t===Cn?i>0&&(u=Cn,f=i,g=o.length):t===Er?d>0&&(u=Er,f=d,g=l.length):(f=Math.max(i,d),u=f>0?i>d?Cn:Er:null,g=u?u===Cn?o.length:l.length:0);const b=u===Cn&&/\b(?:transform|all)(?:,|$)/.test(r(`${Cn}Property`).toString());return{type:u,timeout:f,propCount:g,hasTransform:b}}function Ui(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>Vi(n)+Vi(e[r])))}function Vi(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function qi(e){return(e?e.ownerDocument:document).body.offsetHeight}function ef(e,t,n){const r=e[zr];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Wi=Symbol("_vod"),tf=Symbol("_vsh"),nf=Symbol(""),rf=/(?:^|;)\s*display\s*:/;function sf(e,t,n){const r=e.style,s=pt(n);let o=!1;if(n&&!s){if(t)if(pt(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&fs(r,a,"")}else for(const i in t)n[i]==null&&fs(r,i,"");for(const i in n)i==="display"&&(o=!0),fs(r,i,n[i])}else if(s){if(t!==n){const i=r[nf];i&&(n+=";"+i),r.cssText=n,o=rf.test(n)}}else t&&e.removeAttribute("style");Wi in e&&(e[Wi]=o?r.display:"",e[tf]&&(r.display="none"))}const Ki=/\s*!important$/;function fs(e,t,n){if(Oe(n))n.forEach(r=>fs(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=of(e,t);Ki.test(n)?e.setProperty(Ln(r),n.replace(Ki,""),"important"):e[r]=n}}const Gi=["Webkit","Moz","ms"],Js={};function of(e,t){const n=Js[t];if(n)return n;let r=qt(t);if(r!=="filter"&&r in e)return Js[t]=r;r=Ss(r);for(let s=0;s<Gi.length;s++){const o=Gi[s]+r;if(o in e)return Js[t]=o}return t}const zi="http://www.w3.org/1999/xlink";function Yi(e,t,n,r,s,o=su(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(zi,t.slice(6,t.length)):e.setAttributeNS(zi,t,n):n==null||o&&!Ja(n)?e.removeAttribute(t):e.setAttribute(t,o?"":Yt(n)?String(n):n)}function Ji(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?sc(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=Ja(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 dr(e,t,n,r){e.addEventListener(t,n,r)}function af(e,t,n,r){e.removeEventListener(t,n,r)}const Qi=Symbol("_vei");function lf(e,t,n,r,s=null){const o=e[Qi]||(e[Qi]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=cf(t);if(r){const d=o[t]=ff(r,s);dr(e,a,d,l)}else i&&(af(e,a,i,l),o[t]=void 0)}}const Xi=/(?:Once|Passive|Capture)$/;function cf(e){let t;if(Xi.test(e)){t={};let r;for(;r=e.match(Xi);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Ln(e.slice(2)),t]}let Qs=0;const uf=Promise.resolve(),df=()=>Qs||(uf.then(()=>Qs=0),Qs=Date.now());function ff(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;Qt(hf(r,n.value),t,5,[r])};return n.value=e,n.attached=df(),n}function hf(e,t){if(Oe(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 Zi=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,pf=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?ef(e,r,i):t==="style"?sf(e,n,r):ks(t)?jo(t)||lf(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):mf(e,t,r,i))?(Ji(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Yi(e,t,r,i,o,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!pt(r))?Ji(e,qt(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),Yi(e,t,r,i))};function mf(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&Zi(t)&&He(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 Zi(t)&&pt(n)?!1:t in e}const ea=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Oe(t)?n=>ls(t,n):t};function gf(e){e.target.composing=!0}function ta(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Xs=Symbol("_assign");function na(e,t,n){return t&&(e=e.trim()),n&&(e=Bo(e)),e}const jn={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[Xs]=ea(s);const o=r||s.props&&s.props.type==="number";dr(e,t?"change":"input",i=>{i.target.composing||e[Xs](na(e.value,n,o))}),(n||o)&&dr(e,"change",()=>{e.value=na(e.value,n,o)}),t||(dr(e,"compositionstart",gf),dr(e,"compositionend",ta),dr(e,"change",ta))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[Xs]=ea(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?Bo(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))}},vf=["ctrl","shift","alt","meta"],yf={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)=>vf.some(n=>e[`${n}Key`]&&!t.includes(n))},ct=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...o)=>{for(let i=0;i<t.length;i++){const a=yf[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},wf={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ft=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=Ln(s.key);if(t.some(i=>i===o||wf[i]===o))return e(s)}))},bf=bt({patchProp:pf},Kd);let ra;function _f(){return ra||(ra=Cd(bf))}const kf=((...e)=>{const t=_f().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Sf(r);if(!s)return;const o=t._component;!He(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Tf(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Tf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Sf(e){return pt(e)?document.querySelector(e):e}/*!
18
- * vue-router v4.6.4
19
- * (c) 2025 Eduardo San Martin Morote
20
- * @license MIT
21
- */const fr=typeof document<"u";function ic(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function xf(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&ic(e.default)}const Qe=Object.assign;function Zs(e,t){const n={};for(const r in t){const s=t[r];n[r]=Xt(s)?s.map(e):e(s)}return n}const Fr=()=>{},Xt=Array.isArray;function sa(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const ac=/#/g,Cf=/&/g,Af=/\//g,Ef=/=/g,If=/\?/g,lc=/\+/g,Rf=/%5B/g,$f=/%5D/g,cc=/%5E/g,Mf=/%60/g,uc=/%7B/g,Pf=/%7C/g,dc=/%7D/g,Nf=/%20/g;function ti(e){return e==null?"":encodeURI(""+e).replace(Pf,"|").replace(Rf,"[").replace($f,"]")}function Of(e){return ti(e).replace(uc,"{").replace(dc,"}").replace(cc,"^")}function Co(e){return ti(e).replace(lc,"%2B").replace(Nf,"+").replace(ac,"%23").replace(Cf,"%26").replace(Mf,"`").replace(uc,"{").replace(dc,"}").replace(cc,"^")}function jf(e){return Co(e).replace(Ef,"%3D")}function Lf(e){return ti(e).replace(ac,"%23").replace(If,"%3F")}function Df(e){return Lf(e).replace(Af,"%2F")}function Yr(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Bf=/\/$/,Ff=e=>e.replace(Bf,"");function eo(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=qf(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:Yr(i)}}function Hf(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function oa(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Uf(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&wr(t.matched[r],n.matched[s])&&fc(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function wr(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function fc(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Vf(e[n],t[n]))return!1;return!0}function Vf(e,t){return Xt(e)?ia(e,t):Xt(t)?ia(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function ia(e,t){return Xt(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function qf(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 An={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Ao=(function(e){return e.pop="pop",e.push="push",e})({}),to=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function Wf(e){if(!e)if(fr){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Ff(e)}const Kf=/^[^#]+#/;function Gf(e,t){return e.replace(Kf,"#")+t}function zf(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 Os=()=>({left:window.scrollX,top:window.scrollY});function Yf(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=zf(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 aa(e,t){return(history.state?history.state.position-t:-1)+e}const Eo=new Map;function Jf(e,t){Eo.set(e,t)}function Qf(e){const t=Eo.get(e);return Eo.delete(e),t}function Xf(e){return typeof e=="string"||e&&typeof e=="object"}function hc(e){return typeof e=="string"||typeof e=="symbol"}let mt=(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 pc=Symbol("");mt.MATCHER_NOT_FOUND+"",mt.NAVIGATION_GUARD_REDIRECT+"",mt.NAVIGATION_ABORTED+"",mt.NAVIGATION_CANCELLED+"",mt.NAVIGATION_DUPLICATED+"";function br(e,t){return Qe(new Error,{type:e,[pc]:!0},t)}function fn(e,t){return e instanceof Error&&pc in e&&(t==null||!!(e.type&t))}const Zf=["params","query","hash"];function eh(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of Zf)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function th(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(lc," "),o=s.indexOf("="),i=Yr(o<0?s:s.slice(0,o)),a=o<0?null:Yr(s.slice(o+1));if(i in t){let l=t[i];Xt(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function la(e){let t="";for(let n in e){const r=e[n];if(n=jf(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(Xt(r)?r.map(s=>s&&Co(s)):[r&&Co(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function nh(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=Xt(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const rh=Symbol(""),ca=Symbol(""),js=Symbol(""),ni=Symbol(""),Io=Symbol("");function Ir(){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 $n(e,t,n,r,s,o=i=>i()){const i=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,l)=>{const d=g=>{g===!1?l(br(mt.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?l(g):Xf(g)?l(br(mt.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(i&&r.enterCallbacks[s]===i&&typeof g=="function"&&i.push(g),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(g=>l(g))})}function no(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(ic(l)){const d=(l.__vccOpts||l)[t];d&&o.push($n(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=xf(u)?u.default:u;i.mods[a]=u,i.components[a]=f;const g=(f.__vccOpts||f)[t];return g&&$n(g,n,r,i,a,s)()}))}}return o}function sh(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=>wr(d,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(d=>wr(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 oh=()=>location.protocol+"//"+location.host;function mc(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),oa(a,"")}return oa(n,e)+r+s}function ih(e,t,n,r){let s=[],o=[],i=null;const a=({state:g})=>{const b=mc(e,location),M=n.value,C=t.value;let B=0;if(g){if(n.value=b,t.value=g,i&&i===M){i=null;return}B=C?g.position-C.position:0}else r(b);s.forEach(K=>{K(n.value,M,{delta:B,type:Ao.pop,direction:B?B>0?to.forward:to.back:to.unknown})})};function l(){i=n.value}function d(g){s.push(g);const b=()=>{const M=s.indexOf(g);M>-1&&s.splice(M,1)};return o.push(b),b}function u(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(Qe({},g.state,{scroll:Os()}),"")}}function f(){for(const g of o)g();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 ua(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?Os():null}}function ah(e){const{history:t,location:n}=window,r={value:mc(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("#"),g=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:oh()+e+l;try{t[u?"replaceState":"pushState"](d,"",g),s.value=d}catch(b){console.error(b),n[u?"replace":"assign"](g)}}function i(l,d){o(l,Qe({},t.state,ua(s.value.back,l,s.value.forward,!0),d,{position:s.value.position}),!0),r.value=l}function a(l,d){const u=Qe({},s.value,t.state,{forward:l,scroll:Os()});o(u.current,u,!0),o(l,Qe({},ua(r.value,l,null),{position:u.position+1},d),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function lh(e){e=Wf(e);const t=ah(e),n=ih(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=Qe({location:"",base:e,go:r,createHref:Gf.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 ch(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),lh(e)}let Zn=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var wt=(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})(wt||{});const uh={type:Zn.Static,value:""},dh=/[a-zA-Z0-9_]/;function fh(e){if(!e)return[[]];if(e==="/")return[[uh]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(b){throw new Error(`ERR (${n})/"${d}": ${b}`)}let n=wt.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,d="",u="";function f(){d&&(n===wt.Static?o.push({type:Zn.Static,value:d}):n===wt.Param||n===wt.ParamRegExp||n===wt.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),o.push({type:Zn.Param,value:d,regexp:u,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),d="")}function g(){d+=l}for(;a<e.length;){if(l=e[a++],l==="\\"&&n!==wt.ParamRegExp){r=n,n=wt.EscapeNext;continue}switch(n){case wt.Static:l==="/"?(d&&f(),i()):l===":"?(f(),n=wt.Param):g();break;case wt.EscapeNext:g(),n=r;break;case wt.Param:l==="("?n=wt.ParamRegExp:dh.test(l)?g():(f(),n=wt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case wt.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=wt.ParamRegExpEnd:u+=l;break;case wt.ParamRegExpEnd:f(),n=wt.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===wt.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),f(),i(),s}const da="[^/]+?",hh={sensitive:!1,strict:!1,start:!0,end:!0};var Mt=(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})(Mt||{});const ph=/[.+*?^${}()[\]/\\]/g;function mh(e,t){const n=Qe({},hh,t),r=[];let s=n.start?"^":"";const o=[];for(const d of e){const u=d.length?[]:[Mt.Root];n.strict&&!d.length&&(s+="/");for(let f=0;f<d.length;f++){const g=d[f];let b=Mt.Segment+(n.sensitive?Mt.BonusCaseSensitive:0);if(g.type===Zn.Static)f||(s+="/"),s+=g.value.replace(ph,"\\$&"),b+=Mt.Static;else if(g.type===Zn.Param){const{value:M,repeatable:C,optional:B,regexp:K}=g;o.push({name:M,repeatable:C,optional:B});const $=K||da;if($!==da){b+=Mt.BonusCustomRegExp;try{`${$}`}catch(F){throw new Error(`Invalid custom RegExp for param "${M}" (${$}): `+F.message)}}let q=C?`((?:${$})(?:/(?:${$}))*)`:`(${$})`;f||(q=B&&d.length<2?`(?:/${q})`:"/"+q),B&&(q+="?"),s+=q,b+=Mt.Dynamic,B&&(b+=Mt.BonusOptional),C&&(b+=Mt.BonusRepeatable),$===".*"&&(b+=Mt.BonusWildcard)}u.push(b)}r.push(u)}if(n.strict&&n.end){const d=r.length-1;r[d][r[d].length-1]+=Mt.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 g=1;g<u.length;g++){const b=u[g]||"",M=o[g-1];f[M.name]=b&&M.repeatable?b.split("/"):b}return f}function l(d){let u="",f=!1;for(const g of e){(!f||!u.endsWith("/"))&&(u+="/"),f=!1;for(const b of g)if(b.type===Zn.Static)u+=b.value;else if(b.type===Zn.Param){const{value:M,repeatable:C,optional:B}=b,K=M in d?d[M]:"";if(Xt(K)&&!C)throw new Error(`Provided param "${M}" is an array but it is not repeatable (* or + modifiers)`);const $=Xt(K)?K.join("/"):K;if(!$)if(B)g.length<2&&(u.endsWith("/")?u=u.slice(0,-1):f=!0);else throw new Error(`Missing required param "${M}"`);u+=$}}return u||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function gh(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]===Mt.Static+Mt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Mt.Static+Mt.Segment?1:-1:0}function gc(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=gh(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(fa(r))return 1;if(fa(s))return-1}return s.length-r.length}function fa(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const vh={strict:!1,end:!0,sensitive:!1};function yh(e,t,n){const r=mh(fh(e.path),n),s=Qe(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function wh(e,t){const n=[],r=new Map;t=sa(vh,t);function s(f){return r.get(f)}function o(f,g,b){const M=!b,C=pa(f);C.aliasOf=b&&b.record;const B=sa(t,f),K=[C];if("alias"in f){const F=typeof f.alias=="string"?[f.alias]:f.alias;for(const ae of F)K.push(pa(Qe({},C,{components:b?b.record.components:C.components,path:ae,aliasOf:b?b.record:C})))}let $,q;for(const F of K){const{path:ae}=F;if(g&&ae[0]!=="/"){const ie=g.record.path,le=ie[ie.length-1]==="/"?"":"/";F.path=g.record.path+(ae&&le+ae)}if($=yh(F,g,B),b?b.alias.push($):(q=q||$,q!==$&&q.alias.push($),M&&f.name&&!ma($)&&i(f.name)),vc($)&&l($),C.children){const ie=C.children;for(let le=0;le<ie.length;le++)o(ie[le],$,b&&b.children[le])}b=b||$}return q?()=>{i(q)}:Fr}function i(f){if(hc(f)){const g=r.get(f);g&&(r.delete(f),n.splice(n.indexOf(g),1),g.children.forEach(i),g.alias.forEach(i))}else{const g=n.indexOf(f);g>-1&&(n.splice(g,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 g=kh(f,n);n.splice(g,0,f),f.record.name&&!ma(f)&&r.set(f.record.name,f)}function d(f,g){let b,M={},C,B;if("name"in f&&f.name){if(b=r.get(f.name),!b)throw br(mt.MATCHER_NOT_FOUND,{location:f});B=b.record.name,M=Qe(ha(g.params,b.keys.filter(q=>!q.optional).concat(b.parent?b.parent.keys.filter(q=>q.optional):[]).map(q=>q.name)),f.params&&ha(f.params,b.keys.map(q=>q.name))),C=b.stringify(M)}else if(f.path!=null)C=f.path,b=n.find(q=>q.re.test(C)),b&&(M=b.parse(C),B=b.record.name);else{if(b=g.name?r.get(g.name):n.find(q=>q.re.test(g.path)),!b)throw br(mt.MATCHER_NOT_FOUND,{location:f,currentLocation:g});B=b.record.name,M=Qe({},g.params,f.params),C=b.stringify(M)}const K=[];let $=b;for(;$;)K.unshift($.record),$=$.parent;return{name:B,path:C,params:M,matched:K,meta:_h(K)}}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 ha(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function pa(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:bh(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 bh(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 ma(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function _h(e){return e.reduce((t,n)=>Qe(t,n.meta),{})}function kh(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;gc(e,t[o])<0?r=o:n=o+1}const s=Th(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Th(e){let t=e;for(;t=t.parent;)if(vc(t)&&gc(e,t)===0)return t}function vc({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function ga(e){const t=zt(js),n=zt(ni),r=ce(()=>{const l=$e(e.to);return t.resolve(l)}),s=ce(()=>{const{matched:l}=r.value,{length:d}=l,u=l[d-1],f=n.matched;if(!u||!f.length)return-1;const g=f.findIndex(wr.bind(null,u));if(g>-1)return g;const b=va(l[d-2]);return d>1&&va(u)===b&&f[f.length-1].path!==b?f.findIndex(wr.bind(null,l[d-2])):g}),o=ce(()=>s.value>-1&&Eh(n.params,r.value.params)),i=ce(()=>s.value>-1&&s.value===n.matched.length-1&&fc(n.params,r.value.params));function a(l={}){if(Ah(l)){const d=t[$e(e.replace)?"replace":"push"]($e(e.to)).catch(Fr);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:r,href:ce(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function Sh(e){return e.length===1?e[0]:e}const xh=kt({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:ga,setup(e,{slots:t}){const n=As(ga(e)),{options:r}=zt(js),s=ce(()=>({[ya(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[ya(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Sh(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)}}}),Ch=xh;function Ah(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 Eh(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(!Xt(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 ya=(e,t,n)=>e??t??n,Ih=kt({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=zt(Io),s=ce(()=>e.route||r.value),o=zt(ca,0),i=ce(()=>{let d=$e(o);const{matched:u}=s.value;let f;for(;(f=u[d])&&!f.components;)d++;return d}),a=ce(()=>s.value.matched[i.value]);cs(ca,ce(()=>i.value+1)),cs(rh,a),cs(Io,s);const l=U();return ft(()=>[l.value,a.value,e.name],([d,u,f],[g,b,M])=>{u&&(u.instances[f]=d,b&&b!==u&&d&&d===g&&(u.leaveGuards.size||(u.leaveGuards=b.leaveGuards),u.updateGuards.size||(u.updateGuards=b.updateGuards))),d&&u&&(!b||!wr(u,b)||!g)&&(u.enterCallbacks[f]||[]).forEach(C=>C(d))},{flush:"post"}),()=>{const d=s.value,u=e.name,f=a.value,g=f&&f.components[u];if(!g)return wa(n.default,{Component:g,route:d});const b=f.props[u],M=b?b===!0?d.params:typeof b=="function"?b(d):b:null,B=ei(g,Qe({},M,t,{onVnodeUnmounted:K=>{K.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return wa(n.default,{Component:B,route:d})||B}}});function wa(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Rh=Ih;function $h(e){const t=wh(e.routes,e),n=e.parseQuery||th,r=e.stringifyQuery||la,s=e.history,o=Ir(),i=Ir(),a=Ir(),l=Au(An);let d=An;fr&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=Zs.bind(null,E=>""+E),f=Zs.bind(null,Df),g=Zs.bind(null,Yr);function b(E,z){let Z,he;return hc(E)?(Z=t.getRecordMatcher(E),he=z):he=E,t.addRoute(he,Z)}function M(E){const z=t.getRecordMatcher(E);z&&t.removeRoute(z)}function C(){return t.getRoutes().map(E=>E.record)}function B(E){return!!t.getRecordMatcher(E)}function K(E,z){if(z=Qe({},z||l.value),typeof E=="string"){const S=eo(n,E,z.path),L=t.resolve({path:S.path},z),H=s.createHref(S.fullPath);return Qe(S,L,{params:g(L.params),hash:Yr(S.hash),redirectedFrom:void 0,href:H})}let Z;if(E.path!=null)Z=Qe({},E,{path:eo(n,E.path,z.path).path});else{const S=Qe({},E.params);for(const L in S)S[L]==null&&delete S[L];Z=Qe({},E,{params:f(S)}),z.params=f(z.params)}const he=t.resolve(Z,z),Re=E.hash||"";he.params=u(g(he.params));const m=Hf(r,Qe({},E,{hash:Of(Re),path:he.path})),v=s.createHref(m);return Qe({fullPath:m,hash:Re,query:r===la?nh(E.query):E.query||{}},he,{redirectedFrom:void 0,href:v})}function $(E){return typeof E=="string"?eo(n,E,l.value.path):Qe({},E)}function q(E,z){if(d!==E)return br(mt.NAVIGATION_CANCELLED,{from:z,to:E})}function F(E){return le(E)}function ae(E){return F(Qe($(E),{replace:!0}))}function ie(E,z){const Z=E.matched[E.matched.length-1];if(Z&&Z.redirect){const{redirect:he}=Z;let Re=typeof he=="function"?he(E,z):he;return typeof Re=="string"&&(Re=Re.includes("?")||Re.includes("#")?Re=$(Re):{path:Re},Re.params={}),Qe({query:E.query,hash:E.hash,params:Re.path!=null?{}:E.params},Re)}}function le(E,z){const Z=d=K(E),he=l.value,Re=E.state,m=E.force,v=E.replace===!0,S=ie(Z,he);if(S)return le(Qe($(S),{state:typeof S=="object"?Qe({},Re,S.state):Re,force:m,replace:v}),z||Z);const L=Z;L.redirectedFrom=z;let H;return!m&&Uf(r,he,Z)&&(H=br(mt.NAVIGATION_DUPLICATED,{to:L,from:he}),et(he,he,!0,!1)),(H?Promise.resolve(H):te(L,he)).catch(O=>fn(O)?fn(O,mt.NAVIGATION_GUARD_REDIRECT)?O:tt(O):Ee(O,L,he)).then(O=>{if(O){if(fn(O,mt.NAVIGATION_GUARD_REDIRECT))return le(Qe({replace:v},$(O.to),{state:typeof O.to=="object"?Qe({},Re,O.to.state):Re,force:m}),z||L)}else O=X(L,he,!0,v,Re);return fe(L,he,O),O})}function de(E,z){const Z=q(E,z);return Z?Promise.reject(Z):Promise.resolve()}function oe(E){const z=ue.values().next().value;return z&&typeof z.runWithContext=="function"?z.runWithContext(E):E()}function te(E,z){let Z;const[he,Re,m]=sh(E,z);Z=no(he.reverse(),"beforeRouteLeave",E,z);for(const S of he)S.leaveGuards.forEach(L=>{Z.push($n(L,E,z))});const v=de.bind(null,E,z);return Z.push(v),Se(Z).then(()=>{Z=[];for(const S of o.list())Z.push($n(S,E,z));return Z.push(v),Se(Z)}).then(()=>{Z=no(Re,"beforeRouteUpdate",E,z);for(const S of Re)S.updateGuards.forEach(L=>{Z.push($n(L,E,z))});return Z.push(v),Se(Z)}).then(()=>{Z=[];for(const S of m)if(S.beforeEnter)if(Xt(S.beforeEnter))for(const L of S.beforeEnter)Z.push($n(L,E,z));else Z.push($n(S.beforeEnter,E,z));return Z.push(v),Se(Z)}).then(()=>(E.matched.forEach(S=>S.enterCallbacks={}),Z=no(m,"beforeRouteEnter",E,z,oe),Z.push(v),Se(Z))).then(()=>{Z=[];for(const S of i.list())Z.push($n(S,E,z));return Z.push(v),Se(Z)}).catch(S=>fn(S,mt.NAVIGATION_CANCELLED)?S:Promise.reject(S))}function fe(E,z,Z){a.list().forEach(he=>oe(()=>he(E,z,Z)))}function X(E,z,Z,he,Re){const m=q(E,z);if(m)return m;const v=z===An,S=fr?history.state:{};Z&&(he||v?s.replace(E.fullPath,Qe({scroll:v&&S&&S.scroll},Re)):s.push(E.fullPath,Re)),l.value=E,et(E,z,Z,v),tt()}let Ne;function We(){Ne||(Ne=s.listen((E,z,Z)=>{if(!Te.listening)return;const he=K(E),Re=ie(he,Te.currentRoute.value);if(Re){le(Qe(Re,{replace:!0,force:!0}),he).catch(Fr);return}d=he;const m=l.value;fr&&Jf(aa(m.fullPath,Z.delta),Os()),te(he,m).catch(v=>fn(v,mt.NAVIGATION_ABORTED|mt.NAVIGATION_CANCELLED)?v:fn(v,mt.NAVIGATION_GUARD_REDIRECT)?(le(Qe($(v.to),{force:!0}),he).then(S=>{fn(S,mt.NAVIGATION_ABORTED|mt.NAVIGATION_DUPLICATED)&&!Z.delta&&Z.type===Ao.pop&&s.go(-1,!1)}).catch(Fr),Promise.reject()):(Z.delta&&s.go(-Z.delta,!1),Ee(v,he,m))).then(v=>{v=v||X(he,m,!1),v&&(Z.delta&&!fn(v,mt.NAVIGATION_CANCELLED)?s.go(-Z.delta,!1):Z.type===Ao.pop&&fn(v,mt.NAVIGATION_ABORTED|mt.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),fe(he,m,v)}).catch(Fr)}))}let Ge=Ir(),ke=Ir(),Le;function Ee(E,z,Z){tt(E);const he=ke.list();return he.length?he.forEach(Re=>Re(E,z,Z)):console.error(E),Promise.reject(E)}function rt(){return Le&&l.value!==An?Promise.resolve():new Promise((E,z)=>{Ge.add([E,z])})}function tt(E){return Le||(Le=!E,We(),Ge.list().forEach(([z,Z])=>E?Z(E):z()),Ge.reset()),E}function et(E,z,Z,he){const{scrollBehavior:Re}=e;if(!fr||!Re)return Promise.resolve();const m=!Z&&Qf(aa(E.fullPath,0))||(he||!Z)&&history.state&&history.state.scroll||null;return Vt().then(()=>Re(E,z,m)).then(v=>v&&Yf(v)).catch(v=>Ee(v,E,z))}const qe=E=>s.go(E);let ut;const ue=new Set,Te={currentRoute:l,listening:!0,addRoute:b,removeRoute:M,clearRoutes:t.clearRoutes,hasRoute:B,getRoutes:C,resolve:K,options:e,push:F,replace:ae,go:qe,back:()=>qe(-1),forward:()=>qe(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:ke.add,isReady:rt,install(E){E.component("RouterLink",Ch),E.component("RouterView",Rh),E.config.globalProperties.$router=Te,Object.defineProperty(E.config.globalProperties,"$route",{enumerable:!0,get:()=>$e(l)}),fr&&!ut&&l.value===An&&(ut=!0,F(s.location).catch(he=>{}));const z={};for(const he in An)Object.defineProperty(z,he,{get:()=>l.value[he],enumerable:!0});E.provide(js,Te),E.provide(ni,hl(z)),E.provide(Io,l);const Z=E.unmount;ue.add(E),E.unmount=function(){ue.delete(E),ue.size<1&&(d=An,Ne&&Ne(),Ne=null,l.value=An,ut=!1,Le=!1),Z()}}};function Se(E){return E.reduce((z,Z)=>z.then(()=>oe(Z)),Promise.resolve())}return Te}function Mh(){return zt(js)}function Ph(e){return zt(ni)}const ba=768;function yc(){const e=U(typeof window<"u"?window.innerWidth<ba:!1);let t=null;function n(r){e.value=r.matches}return Dn(()=>{t=window.matchMedia(`(max-width: ${ba-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),$s(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Nh={key:0,class:"desktop-sidebar"},Oh={class:"desktop-main"},_a="codex-web-local.sidebar-width.v1",jh=260,Lh=620,ka=320,Dh=kt({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=yc();function r(d){return Math.min(Lh,Math.max(jh,d))}function s(){if(typeof window>"u")return ka;const d=window.localStorage.getItem(_a),u=Number(d);return Number.isFinite(u)?r(u):ka}const o=U(s()),i=ce(()=>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(_a,String(d))}function l(d){d.preventDefault();const u=d.clientX,f=o.value,g=M=>{const C=M.clientX-u;o.value=r(f+C)},b=()=>{a(o.value),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",b)};window.addEventListener("mousemove",g),window.addEventListener("mouseup",b)}return(d,u)=>(_(),x("div",{class:lt(["desktop-layout",{"is-mobile":$e(n)}]),style:nr(i.value)},[$e(n)?(_(),ot(Cl,{key:0,to:"body"},[Ae(Yd,{name:"drawer"},{default:nt(()=>[e.isSidebarCollapsed?pe("",!0):(_(),x("div",{key:0,class:"mobile-drawer-backdrop",onClick:u[1]||(u[1]=f=>d.$emit("close-sidebar"))},[w("aside",{class:"mobile-drawer",onClick:u[0]||(u[0]=ct(()=>{},["stop"]))},[an(d.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):pe("",!0),$e(n)?pe("",!0):(_(),x(Fe,{key:1},[e.isSidebarCollapsed?pe("",!0):(_(),x("aside",Nh,[an(d.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?pe("",!0):(_(),x("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),w("section",Oh,[an(d.$slots,"content",{},void 0)])],6))}}),ze=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},Bh=ze(Dh,[["__scopeId","data-v-2039d51b"]]),Fh={},Hh={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Uh(e,t){return _(),x("svg",Hh,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M3 6a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2m2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8m-9 4h4"},null,-1)])])}const ro=ze(Fh,[["render",Uh]]),Vh={},qh={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Wh(e,t){return _(),x("svg",qh,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const ri=ze(Vh,[["render",Wh]]),Kh={},Gh={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function zh(e,t){return _(),x("svg",Gh,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const wc=ze(Kh,[["render",zh]]),Yh={},Jh={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Qh(e,t){return _(),x("svg",Jh,[...t[0]||(t[0]=[w("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 Ta=ze(Yh,[["render",Qh]]),Xh={},Zh={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function ep(e,t){return _(),x("svg",Zh,[...t[0]||(t[0]=[w("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 bs=ze(Xh,[["render",ep]]),tp={},np={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function rp(e,t){return _(),x("svg",np,[...t[0]||(t[0]=[w("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 sp=ze(tp,[["render",rp]]),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 _(),x("svg",ip,[...t[0]||(t[0]=[w("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 lp=ze(op,[["render",ap]]),cp={},up={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function dp(e,t){return _(),x("svg",up,[...t[0]||(t[0]=[w("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 so=ze(cp,[["render",dp]]),fp={},hp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function pp(e,t){return _(),x("svg",hp,[...t[0]||(t[0]=[w("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 oo=ze(fp,[["render",pp]]),mp={key:0,class:"sidebar-menu-row-left"},gp={class:"sidebar-menu-row-main"},vp={key:1,class:"sidebar-menu-row-right"},yp={key:0,class:"sidebar-menu-row-right-default"},wp={key:1,class:"sidebar-menu-row-right-hover"},bp=kt({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=sd(),r=ce(()=>!!n.left),s=ce(()=>!!n.right),o=ce(()=>!!n["right-hover"]),i=ce(()=>s.value||o.value);return(a,l)=>(_(),ot(td(t.as),ec({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:nt(()=>[r.value?(_(),x("span",mp,[an(a.$slots,"left",{},void 0,!0)])):pe("",!0),w("span",gp,[an(a.$slots,"default",{},void 0,!0)]),i.value?(_(),x("span",vp,[s.value?(_(),x("span",yp,[an(a.$slots,"right",{},void 0,!0)])):pe("",!0),o.value?(_(),x("span",wp,[an(a.$slots,"right-hover",{},void 0,!0)])):pe("",!0)])):pe("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),Yn=ze(bp,[["__scopeId","data-v-daeca4df"]]),_p={class:"thread-tree-root"},kp={key:0,class:"pinned-section"},Tp={class:"thread-list"},Sp={class:"thread-left-stack"},xp=["data-state"],Cp=["onClick"],Ap=["onClick"],Ep={class:"thread-row-title-wrap"},Ip={class:"thread-row-title"},Rp={class:"thread-row-time"},$p=["data-confirm","onClick"],Mp={key:0},Pp=["aria-expanded"],Np=["data-active"],Op={key:0},jp=["data-active"],Lp={key:0},Dp={key:1,class:"thread-tree-no-results"},Bp={key:2,class:"thread-tree-loading"},Fp={key:3,class:"thread-list thread-list-global"},Hp={class:"thread-left-stack"},Up=["data-state"],Vp=["onClick"],qp=["onClick"],Wp={class:"thread-row-title-wrap"},Kp={class:"thread-row-title"},Gp={class:"thread-row-time"},zp=["data-confirm","onClick"],Yp={key:0},Jp=["data-project-name","data-expanded","data-dragging"],Qp={class:"project-icon-stack"},Xp={class:"project-icon-folder"},Zp={class:"project-icon-chevron"},em=["data-dragging-handle","onMousedown"],tm={class:"project-title"},nm={class:"project-hover-controls"},rm=["onClick"],sm=["onClick"],om=["onClick"],im=["onInput"],am=["aria-label","title","onClick"],lm={key:0,class:"thread-list"},cm={class:"thread-left-stack"},um=["data-state"],dm=["onClick"],fm=["onClick"],hm={class:"thread-row-title-wrap"},pm={class:"thread-row-title"},mm={class:"thread-row-time"},gm=["data-confirm","onClick"],vm={key:0},ym=["onClick"],wm=4,Sa=6,xa="codex-web-local.thread-view-mode.v1",Ca="codex-web-local.collapsed-projects.v1",bm=kt({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{}},emits:["select","archive","start-new-thread","rename-project","remove-project","reorder-project"],setup(e,{emit:t}){const n=e,r=t,s=U({}),o=U({}),i=U([]),a=U(""),l=U(""),d=U("actions"),u=U(""),f=U(null),g=U(null),b=U(null);let M=null,C=null;const B=U(""),K=U({}),$=new Map,q=new Map,F=new WeakMap,ae=U(null),ie=U(!1),le=U(te()),de=typeof window<"u"?new ResizeObserver(T=>{for(const R of T){const P=R.target,J=F.get(P);J&&A(J,P)}}):null;function oe(){if(typeof window>"u")return{};try{const T=window.localStorage.getItem(Ca);if(!T)return{};const R=JSON.parse(T);return!R||typeof R!="object"||Array.isArray(R)?{}:R}catch{return{}}}function te(){return typeof window>"u"?"project":window.localStorage.getItem(xa)==="chronological"?"chronological":"project"}o.value=oe(),ft(o,T=>{typeof window>"u"||window.localStorage.setItem(Ca,JSON.stringify(T))},{deep:!0}),ft(le,T=>{typeof window>"u"||window.localStorage.setItem(xa,T)});const fe=ce(()=>n.searchQuery.trim().toLowerCase()),X=ce(()=>fe.value.length>0);function Ne(T){if(!X.value)return!0;const R=fe.value;return T.title.toLowerCase().includes(R)||T.preview.toLowerCase().includes(R)}const We=ce(()=>X.value?n.groups.map(T=>({...T,threads:T.threads.filter(Ne)})).filter(T=>T.threads.length>0):n.groups),Ge=ce(()=>le.value==="chronological"),ke=ce(()=>{const T=We.value,R=[];for(const P of T)for(const J of P.threads)ue(J.id)||R.push(J);return R.sort((P,J)=>{const Ve=new Date(P.updatedAtIso||P.createdAtIso).getTime();return new Date(J.updatedAtIso||J.createdAtIso).getTime()-Ve})}),Le=ce(()=>{const T=new Map;for(const R of n.groups)for(const P of R.threads)T.set(P.id,P);return T}),Ee=ce(()=>i.value.map(T=>Le.value.get(T)??null).filter(T=>T!==null).filter(Ne)),rt=ce(()=>{const T=b.value;if(!T||T.dropTargetIndexFull===null||n.groups.length===0)return null;const R=Math.max(0,Math.min(T.dropTargetIndexFull,n.groups.length)),P=R>T.fromIndex?R-1:R,J=Math.max(0,Math.min(P,n.groups.length-1));return J===T.fromIndex?null:J}),tt=ce(()=>{const R=(X.value?We.value:n.groups).map(Nt=>Nt.projectName),P=b.value,J=rt.value;if(!P||J===null)return R;const Ve=[...R],[vt]=Ve.splice(P.fromIndex,1);return vt?(Ve.splice(J,0,vt),Ve):R}),et=ce(()=>{const T={};let R=0;for(const P of tt.value)T[P]=R,R+=xe(P);return T}),qe=ce(()=>{let T=0;for(const R of tt.value)T+=xe(R);return{height:`${Math.max(0,T)}px`}});function ut(T){const R=new Date(T).getTime();if(Number.isNaN(R))return"n/a";const P=Math.abs(Date.now()-R);if(P<6e4)return"now";const J=Math.floor(P/6e4);if(J<60)return`${J}m`;const Ve=Math.floor(J/60);return Ve<24?`${Ve}h`:`${Math.floor(Ve/24)}d`}function ue(T){return i.value.includes(T)}function Te(T){if(ue(T)){i.value=i.value.filter(R=>R!==T);return}i.value=[T,...i.value]}function Se(T){r("select",T)}function E(T){if(a.value!==T){a.value=T;return}a.value="",i.value=i.value.filter(R=>R!==T),r("archive",T)}function z(T){return`start new thread ${Re(T)}`}function Z(T){r("start-new-thread",T)}function he(T){a.value===T&&(a.value="")}function Re(T){return n.projectDisplayNameById[T]??T}function m(T){return l.value===T}function v(){l.value="",d.value="actions",u.value=""}function S(){ie.value=!ie.value}function L(T){le.value=T,ie.value=!1}function H(T){if(l.value===T){v();return}l.value=T,d.value="actions",u.value=Re(T)}function O(T){l.value=T,d.value="rename",u.value=Re(T)}function re(T){r("rename-project",{projectName:T,displayName:u.value})}function ee(T){r("remove-project",T),v()}function Q(T,R){if(!T.altKey||T.key!=="ArrowUp"&&T.key!=="ArrowDown")return;const P=n.groups.findIndex(vt=>vt.projectName===R);if(P<0)return;const J=T.key==="ArrowUp"?-1:1,Ve=Math.max(0,Math.min(P+J,n.groups.length-1));Ve!==P&&(T.preventDefault(),r("reorder-project",{projectName:R,toIndex:Ve}))}function G(T){return s.value[T]===!0}function ne(T){return o.value[T]===!0}function se(T){s.value={...s.value,[T]:!G(T)}}function ye(T){if(B.value===T){B.value="";return}o.value={...o.value,[T]:!ne(T)}}function xe(T){const R=K.value[T]??0,P=b.value,Ve=((P==null?void 0:P.projectName)===T?P.groupHeight:null)??R,vt=ne(T)?0:Sa;return Math.max(0,Ve+vt)}function Me(T,R){const P=R instanceof HTMLElement?R:R&&"$el"in R&&R.$el instanceof HTMLElement?R.$el:null;if(P){q.set(T,P);return}q.delete(T)}function je(T){const R=l.value;if(!R)return!1;const P=q.get(R);if(!P)return!1;if((typeof T.composedPath=="function"?T.composedPath():[]).includes(P))return!0;const Ve=T.target;return Ve instanceof Node?P.contains(Ve):!1}function Be(T){if(ie.value){const R=ae.value,P=typeof T.composedPath=="function"?T.composedPath():[];!!R&&(P.includes(R)||T.target instanceof Node&&R.contains(T.target))||(ie.value=!1)}l.value&&(je(T)||v())}function Ue(T){l.value&&(je(T)||v())}function N(){ie.value&&(ie.value=!1),l.value&&v()}function V(){window.addEventListener("pointerdown",Be,{capture:!0}),window.addEventListener("focusin",Ue,{capture:!0}),window.addEventListener("blur",N)}function p(){window.removeEventListener("pointerdown",Be,{capture:!0}),window.removeEventListener("focusin",Ue,{capture:!0}),window.removeEventListener("blur",N)}function A(T,R){const P=R.getBoundingClientRect().height;if(!Number.isFinite(P)||P<=0)return;const J=K.value[T];J!==void 0&&Math.abs(J-P)<.5||(K.value={...K.value,[T]:P})}function I(T,R){const P=$.get(T);P&&P!==R&&de&&de.unobserve(P);const J=R instanceof HTMLElement?R:R&&"$el"in R&&R.$el instanceof HTMLElement?R.$el:null;if(J){$.set(T,J),F.set(J,T),A(T,J),de==null||de.observe(J);return}P&&(de==null||de.unobserve(P)),$.delete(T)}function Y(T,R){if(T.button!==0||g.value||b.value)return;const P=n.groups.findIndex(Nt=>Nt.projectName===R),J=$.get(R);if(P<0||!J)return;const Ve=J.getBoundingClientRect(),vt=ne(R)?0:Sa;g.value={projectName:R,fromIndex:P,startClientX:T.clientX,startClientY:T.clientY,pointerOffsetY:T.clientY-Ve.top,groupLeft:Ve.left,groupWidth:Ve.width,groupHeight:Ve.height,groupOuterHeight:Ve.height+vt},T.preventDefault(),ve()}function ve(){window.addEventListener("mousemove",Ye),window.addEventListener("mouseup",we),window.addEventListener("keydown",me)}function Ce(){window.removeEventListener("mousemove",Ye),window.removeEventListener("mouseup",we),window.removeEventListener("keydown",me)}function Ye(T){M={clientX:T.clientX,clientY:T.clientY},yt()}function we(T){Zt({clientX:T.clientX,clientY:T.clientY});const R=b.value;if(R&&rt.value!==null){const P=n.groups.findIndex(J=>J.projectName===R.projectName);if(P>=0){const J=rt.value;J!==P&&r("reorder-project",{projectName:R.projectName,toIndex:J})}}dt()}function me(T){T.key==="Escape"&&(!g.value&&!b.value||(T.preventDefault(),dt()))}function dt(){C!==null&&(window.cancelAnimationFrame(C),C=null),M=null,g.value=null,b.value=null,B.value="",Ce()}function yt(){C===null&&(C=window.requestAnimationFrame(()=>{if(C=null,!M)return;const T=M;M=null,Zt(T)}))}function Zt(T){const R=g.value;if(!b.value&&R){const P=T.clientX-R.startClientX,J=T.clientY-R.startClientY;if(Math.hypot(P,J)<wm)return;v(),B.value=R.projectName,b.value={projectName:R.projectName,fromIndex:R.fromIndex,pointerOffsetY:R.pointerOffsetY,groupLeft:R.groupLeft,groupWidth:R.groupWidth,groupHeight:R.groupHeight,groupOuterHeight:R.groupOuterHeight,ghostTop:T.clientY-R.pointerOffsetY,dropTargetIndexFull:null}}b.value&&kn(T)}function kn(T){const R=b.value;if(!R)return;if(R.ghostTop=T.clientY-R.pointerOffsetY,!Fn(T)){R.dropTargetIndexFull=null;return}const P=T.clientY,J=f.value;if(!J){R.dropTargetIndexFull=null;return}const Ve=J.getBoundingClientRect(),vt=new Map(n.groups.map((Ot,Sn)=>[Ot.projectName,Sn])),Nt=n.groups.map(Ot=>Ot.projectName).filter(Ot=>Ot!==R.projectName);let sr=0,or=n.groups.length;for(const Ot of Nt){const Sn=vt.get(Ot);if(Sn===void 0)continue;const ir=xe(Ot),xr=Ve.top+sr+ir/2;if(P<xr){or=Sn;break}sr+=ir}R.dropTargetIndexFull=or}function Fn(T){const R=f.value;if(!R)return!1;const P=R.getBoundingClientRect(),J=T.clientX>=P.left&&T.clientX<=P.right,Ve=T.clientY>=P.top-32&&T.clientY<=P.bottom+32;return J&&Ve}function Rt(T){var R;return((R=b.value)==null?void 0:R.projectName)===T}function rr(T){const R=b.value,P=et.value[T]??0,J=l.value===T;return!R||R.projectName!==T?{position:"absolute",top:"0",left:"0",right:"0",zIndex:J?"40":"1",transform:`translate3d(0, ${P}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${R.groupLeft}px`,width:`${R.groupWidth}px`,height:`${R.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${R.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function en(T){return T.threads.filter(R=>!ue(R.id))}function kr(T){if(X.value)return en(T);if(ne(T.projectName))return[];const R=en(T);return G(T.projectName)?R:R.slice(0,10)}function Tr(T){return X.value?!1:!ne(T.projectName)&&en(T).length>10}function Sr(T){return en(T).length>0}function cn(T){return T.inProgress?"working":T.unread?"unread":"idle"}ft(()=>n.groups.map(T=>T.projectName),T=>{var Ve,vt;const R=((Ve=b.value)==null?void 0:Ve.projectName)??((vt=g.value)==null?void 0:vt.projectName)??"";R&&!n.groups.some(Nt=>Nt.projectName===R)&&dt();const P=new Set(T),J=Object.fromEntries(Object.entries(K.value).filter(([Nt])=>P.has(Nt)));Object.keys(J).length!==Object.keys(K.value).length&&(K.value=J)});const Tn=ce(()=>ie.value||l.value!=="");return ft(Tn,T=>{if(T){V();return}p()}),Bn(()=>{for(const T of $.values())de==null||de.unobserve(T);$.clear(),q.clear(),p(),dt()}),(T,R)=>(_(),x("section",_p,[Ee.value.length>0?(_(),x("section",kp,[w("ul",Tp,[(_(!0),x(Fe,null,ht(Ee.value,P=>(_(),x("li",{key:P.id,class:"thread-row-item"},[Ae(Yn,{class:"thread-row","data-active":P.id===e.selectedThreadId,"data-pinned":ue(P.id),onMouseleave:J=>he(P.id)},{left:nt(()=>[w("span",Sp,[P.inProgress||P.unread?(_(),x("span",{key:0,class:"thread-status-indicator","data-state":cn(P)},null,8,xp)):pe("",!0),w("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:J=>Te(P.id)},[Ae(oo,{class:"thread-icon"})],8,Cp)])]),right:nt(()=>[w("span",Rp,_e(ut(P.createdAtIso||P.updatedAtIso)),1)]),"right-hover":nt(()=>[w("button",{class:"thread-archive-button","data-confirm":a.value===P.id,type:"button",title:"archive_thread",onClick:J=>E(P.id)},[a.value===P.id?(_(),x("span",Mp,"confirm")):(_(),ot(ro,{key:1,class:"thread-icon"}))],8,$p)]),default:nt(()=>[w("button",{class:"thread-main-button",type:"button",onClick:J=>Se(P.id)},[w("span",Ep,[w("span",Ip,_e(P.title),1),P.hasWorktree?(_(),ot(so,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):pe("",!0)])],8,Ap)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):pe("",!0),Ae(Yn,{as:"header",class:"thread-tree-header-row"},{right:nt(()=>[w("div",{ref_key:"organizeMenuWrapRef",ref:ae,class:"organize-menu-wrap"},[w("button",{class:"organize-menu-trigger",type:"button","aria-expanded":ie.value,"aria-label":"Organize threads",title:"Organize threads",onClick:S},[Ae(Ta,{class:"thread-icon"})],8,Pp),ie.value?(_(),x("div",{key:0,class:"organize-menu-panel",onClick:R[2]||(R[2]=ct(()=>{},["stop"]))},[R[7]||(R[7]=w("p",{class:"organize-menu-title"},"Organize",-1)),w("button",{class:"organize-menu-item","data-active":le.value==="project",type:"button",onClick:R[0]||(R[0]=P=>L("project"))},[R[5]||(R[5]=w("span",null,"By project",-1)),le.value==="project"?(_(),x("span",Op,"✓")):pe("",!0)],8,Np),w("button",{class:"organize-menu-item","data-active":le.value==="chronological",type:"button",onClick:R[1]||(R[1]=P=>L("chronological"))},[R[6]||(R[6]=w("span",null,"Chronological list",-1)),le.value==="chronological"?(_(),x("span",Lp,"✓")):pe("",!0)],8,jp)])):pe("",!0)],512)]),default:nt(()=>[R[8]||(R[8]=w("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),X.value&&We.value.length===0?(_(),x("p",Dp,"No matching threads")):e.isLoading&&e.groups.length===0?(_(),x("p",Bp,"Loading threads...")):Ge.value?(_(),x("ul",Fp,[(_(!0),x(Fe,null,ht(ke.value,P=>(_(),x("li",{key:P.id,class:"thread-row-item"},[Ae(Yn,{class:"thread-row","data-active":P.id===e.selectedThreadId,"data-pinned":ue(P.id),onMouseleave:J=>he(P.id)},{left:nt(()=>[w("span",Hp,[P.inProgress||P.unread?(_(),x("span",{key:0,class:"thread-status-indicator","data-state":cn(P)},null,8,Up)):pe("",!0),w("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:J=>Te(P.id)},[Ae(oo,{class:"thread-icon"})],8,Vp)])]),right:nt(()=>[w("span",Gp,_e(ut(P.createdAtIso||P.updatedAtIso)),1)]),"right-hover":nt(()=>[w("button",{class:"thread-archive-button","data-confirm":a.value===P.id,type:"button",title:"archive_thread",onClick:J=>E(P.id)},[a.value===P.id?(_(),x("span",Yp,"confirm")):(_(),ot(ro,{key:1,class:"thread-icon"}))],8,zp)]),default:nt(()=>[w("button",{class:"thread-main-button",type:"button",onClick:J=>Se(P.id)},[w("span",Wp,[w("span",Kp,_e(P.title),1),P.hasWorktree?(_(),ot(so,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):pe("",!0)])],8,qp)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(_(),x("div",{key:4,ref_key:"groupsContainerRef",ref:f,class:"thread-tree-groups",style:nr(qe.value)},[(_(!0),x(Fe,null,ht(We.value,P=>(_(),x("article",{key:P.projectName,ref_for:!0,ref:J=>I(P.projectName,J),class:"project-group","data-project-name":P.projectName,"data-expanded":!ne(P.projectName),"data-dragging":Rt(P.projectName),style:nr(rr(P.projectName))},[Ae(Yn,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:J=>ye(P.projectName),onKeydown:[J=>Q(J,P.projectName),Ft(ct(J=>ye(P.projectName),["prevent"]),["enter"]),Ft(ct(J=>ye(P.projectName),["prevent"]),["space"])]},{left:nt(()=>[w("span",Qp,[w("span",Xp,[ne(P.projectName)?(_(),ot(sp,{key:0,class:"thread-icon"})):(_(),ot(lp,{key:1,class:"thread-icon"}))]),w("span",Zp,[ne(P.projectName)?(_(),ot(wc,{key:0,class:"thread-icon"})):(_(),ot(ri,{key:1,class:"thread-icon"}))])])]),right:nt(()=>[w("div",nm,[w("div",{ref_for:!0,ref:J=>Me(P.projectName,J),class:"project-menu-wrap"},[w("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:ct(J=>H(P.projectName),["stop"])},[Ae(Ta,{class:"thread-icon"})],8,rm),m(P.projectName)?(_(),x("div",{key:0,class:"project-menu-panel",onClick:R[4]||(R[4]=ct(()=>{},["stop"]))},[d.value==="actions"?(_(),x(Fe,{key:0},[w("button",{class:"project-menu-item",type:"button",onClick:J=>O(P.projectName)}," Edit name ",8,sm),w("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:J=>ee(P.projectName)}," Remove ",8,om)],64)):(_(),x(Fe,{key:1},[R[9]||(R[9]=w("label",{class:"project-menu-label"},"Project name",-1)),Nn(w("input",{"onUpdate:modelValue":R[3]||(R[3]=J=>u.value=J),class:"project-menu-input",type:"text",onInput:J=>re(P.projectName)},null,40,im),[[jn,u.value]])],64))])):pe("",!0)],512),w("button",{class:"thread-start-button",type:"button","aria-label":z(P.projectName),title:z(P.projectName),onClick:ct(J=>Z(P.projectName),["stop"])},[Ae(bs,{class:"thread-icon"})],8,am)])]),default:nt(()=>[w("span",{class:"project-main-button","data-dragging-handle":Rt(P.projectName),onMousedown:ct(J=>Y(J,P.projectName),["left"])},[w("span",tm,_e(Re(P.projectName)),1)],40,em)]),_:2},1032,["onClick","onKeydown"]),Sr(P)?(_(),x("ul",lm,[(_(!0),x(Fe,null,ht(kr(P),J=>(_(),x("li",{key:J.id,class:"thread-row-item"},[Ae(Yn,{class:"thread-row","data-active":J.id===e.selectedThreadId,"data-pinned":ue(J.id),onMouseleave:Ve=>he(J.id)},{left:nt(()=>[w("span",cm,[J.inProgress||J.unread?(_(),x("span",{key:0,class:"thread-status-indicator","data-state":cn(J)},null,8,um)):pe("",!0),w("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Ve=>Te(J.id)},[Ae(oo,{class:"thread-icon"})],8,dm)])]),right:nt(()=>[w("span",mm,_e(ut(J.createdAtIso||J.updatedAtIso)),1)]),"right-hover":nt(()=>[w("button",{class:"thread-archive-button","data-confirm":a.value===J.id,type:"button",title:"archive_thread",onClick:Ve=>E(J.id)},[a.value===J.id?(_(),x("span",vm,"confirm")):(_(),ot(ro,{key:1,class:"thread-icon"}))],8,gm)]),default:nt(()=>[w("button",{class:"thread-main-button",type:"button",onClick:Ve=>Se(J.id)},[w("span",hm,[w("span",pm,_e(J.title),1),J.hasWorktree?(_(),ot(so,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):pe("",!0)])],8,fm)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(_(),ot(Yn,{key:1,as:"p",class:"project-empty-row"},{left:nt(()=>[...R[10]||(R[10]=[w("span",{class:"project-empty-spacer"},null,-1)])]),default:nt(()=>[R[11]||(R[11]=w("span",{class:"project-empty"},"No threads",-1))]),_:1})),Tr(P)?(_(),ot(Yn,{key:2,class:"thread-show-more-row"},{left:nt(()=>[...R[12]||(R[12]=[w("span",{class:"thread-show-more-spacer"},null,-1)])]),default:nt(()=>[w("button",{class:"thread-show-more-button",type:"button",onClick:J=>se(P.projectName)},_e(G(P.projectName)?"Show less":"Show more"),9,ym)]),_:2},1024)):pe("",!0)],12,Jp))),128))],4))]))}}),_m=ze(bm,[["__scopeId","data-v-5bbc0cb5"]]),km={class:"content-header"},Tm={class:"content-leading"},Sm={class:"content-title"},xm={class:"content-actions"},Cm=kt({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(_(),x("header",km,[w("div",Tm,[an(t.$slots,"leading",{},void 0)]),w("h1",Sm,_e(e.title),1),w("div",xm,[an(t.$slots,"actions",{},void 0)])]))}}),Am=ze(Cm,[["__scopeId","data-v-66ee223c"]]),Em={},Im={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Rm(e,t){return _(),x("svg",Im,[...t[0]||(t[0]=[w("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const si=ze(Em,[["render",Rm]]),$m={},Mm={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Pm(e,t){return _(),x("svg",Mm,[...t[0]||(t[0]=[w("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 Nm=ze($m,[["render",Pm]]),Om={class:"conversation-root"},jm={key:0,class:"conversation-loading"},Lm={key:1,class:"conversation-empty"},Dm={class:"message-row"},Bm={class:"message-stack"},Fm={class:"request-card"},Hm={class:"request-title"},Um={class:"request-meta"},Vm={key:0,class:"request-reason"},qm={key:1,class:"request-actions"},Wm=["onClick"],Km=["onClick"],Gm=["onClick"],zm=["onClick"],Ym={key:2,class:"request-actions"},Jm=["onClick"],Qm=["onClick"],Xm=["onClick"],Zm=["onClick"],eg={key:3,class:"request-user-input"},tg={class:"request-question-title"},ng={key:0,class:"request-question-text"},rg=["value","onChange"],sg=["value"],og=["value","onInput"],ig=["onClick"],ag={key:4,class:"request-actions"},lg=["onClick"],cg=["onClick"],ug={key:5,class:"request-actions"},dg=["onClick"],fg=["onClick"],hg=["data-role","data-message-type"],pg={key:0,class:"message-row","data-role":"system"},mg={class:"message-stack","data-role":"system"},gg=["onClick"],vg={class:"cmd-label"},yg={class:"cmd-status"},wg={class:"cmd-output-inner"},bg={class:"cmd-output"},_g=["data-role","data-message-type"],kg=["data-role"],Tg=["data-role"],Sg=["data-role"],xg=["onClick"],Cg=["src"],Ag={key:1,class:"message-file-attachments"},Eg=["title"],Ig=["data-role"],Rg={key:0,class:"worked-separator-wrap","aria-live":"polite"},$g=["onClick"],Mg={class:"worked-separator-text"},Pg={key:0,class:"worked-details"},Ng=["onClick"],Og={class:"cmd-label"},jg={class:"cmd-status"},Lg={class:"cmd-output-inner"},Dg={class:"cmd-output"},Bg={key:1,class:"message-text-flow"},Fg={key:0,class:"message-text"},Hg={key:0},Ug={key:2,class:"message-inline-code"},Vg={key:1,class:"message-text"},qg=["onClick"],Wg=["src","alt","onError"],Kg=["onClick"],Gg={key:0,class:"conversation-item conversation-item-overlay"},zg={class:"message-row"},Yg={class:"message-stack"},Jg={class:"live-overlay-inline","aria-live":"polite"},Qg={class:"live-overlay-label"},Xg={key:0,class:"live-overlay-reasoning"},Zg={key:1,class:"live-overlay-error"},ev=["src"],tv=16,nv=kt({__name:"ThreadConversation",props:{messages:{},pendingRequests:{},liveOverlay:{},isLoading:{type:Boolean},activeThreadId:{},scrollState:{},isTurnInProgress:{type:Boolean},isRollingBack:{type:Boolean}},emits:["updateScrollState","respondServerRequest","rollback"],setup(e,{emit:t}){const n=U(new Set),r=U(new Set),s=U(new Set),o=U({});function i(p){return p.messageType==="commandExecution"&&!!p.commandExecution}function a(p){var A;return((A=p.commandExecution)==null?void 0:A.status)==="inProgress"||r.value.has(p.id)?!0:n.value.has(p.id)}function l(p){return r.value.has(p.id)}function d(p){var I;if(((I=p.commandExecution)==null?void 0:I.status)==="inProgress")return;const A=new Set(n.value);A.has(p.id)?A.delete(p.id):A.add(p.id),n.value=A}function u(p){const A=new Set(s.value);A.has(p.id)?A.delete(p.id):A.add(p.id),s.value=A}function f(p){return s.value.has(p.id)}function g(p){const A=p.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(p){var I,Y;const A=(I=p.commandExecution)==null?void 0:I.status;return A==="inProgress"?"cmd-status-running":A==="completed"&&((Y=p.commandExecution)==null?void 0:Y.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function M(p){const A=new Set(r.value);A.add(p),r.value=A,setTimeout(()=>{const I=new Set(r.value);I.delete(p),r.value=I},1e3)}function C(p,A){const I=[];for(let Y=A-1;Y>=0;Y--){const ve=p[Y];if(ve.messageType==="commandExecution")I.unshift(ve);else if(ve.role==="user"||ve.messageType==="worked")break}return I}const B=e,K=t,$=U(null),q=U(null),F=U(""),ae=U({}),ie=U({});let le=0,de=0,oe=0;const te=new WeakSet,fe=U(new Set);function X(p){if(!p||/\s/u.test(p)||p.endsWith("/")||p.endsWith("\\")||/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(p))return!1;const A=p.startsWith("/"),I=/^[A-Za-z]:[\\/]/u.test(p),Y=p.startsWith("./")||p.startsWith("../")||p.startsWith("~/"),ve=p.includes("/")||p.includes("\\");return A||I||Y||ve}function Ne(p){return p.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||p}function We(p){if(!p)return null;let A=p,I=null;const Y=A.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(Y)A=Y[1],I=Number(Y[2]);else{const ve=A.match(/^(.*):(\d+)(?::\d+)?$/u);ve&&(A=ve[1],I=Number(ve[2]))}return X(A)?{path:A,line:I}:null}function Ge(p){if(!p.includes("`"))return[{kind:"text",value:p}];const A=[];let I=0,Y=0;for(;I<p.length;){if(p[I]!=="`"){I+=1;continue}let ve=1;for(;I+ve<p.length&&p[I+ve]==="`";)ve+=1;const Ce="`".repeat(ve);let Ye=I+ve,we=-1;for(;Ye<p.length;){const dt=p.indexOf(Ce,Ye);if(dt<0)break;const yt=dt>0&&p[dt-1]==="`",Zt=dt+ve<p.length&&p[dt+ve]==="`",kn=p.slice(I+ve,dt).includes(`
26
- `);if(!yt&&!Zt&&!kn){we=dt;break}Ye=dt+1}if(we<0){I+=ve;continue}I>Y&&A.push({kind:"text",value:p.slice(Y,I)});const me=p.slice(I+ve,we);if(me.length>0){const dt=We(me);if(dt){const yt=Ne(dt.path),Zt=dt.line?`${yt} (line ${String(dt.line)})`:yt;A.push({kind:"file",value:me,displayName:Zt})}else A.push({kind:"code",value:me})}else A.push({kind:"text",value:`${Ce}${Ce}`});I=we+ve,Y=I}return Y<p.length&&A.push({kind:"text",value:p.slice(Y)}),A}function ke(p){const A=p.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 I=A.startsWith("/"),Y=/^[A-Za-z]:[\\/]/u.test(A);return I||Y?`/codex-local-image?path=${encodeURIComponent(A)}`:A}function Le(p){if(!p.includes("![")||!p.includes("]("))return[{kind:"text",value:p}];const A=[],I=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let Y=0;for(const ve of p.matchAll(I)){const[Ce,Ye,we]=ve;if(typeof ve.index!="number")continue;const me=ve.index,dt=me+Ce.length,yt=ke(we.trim());yt&&(me>Y&&A.push({kind:"text",value:p.slice(Y,me)}),A.push({kind:"image",url:yt,alt:Ye.trim(),markdown:Ce}),Y=dt)}return Y<p.length&&A.push({kind:"text",value:p.slice(Y)}),A.length>0?A:[{kind:"text",value:p}]}function Ee(p){return p!==null&&typeof p=="object"&&!Array.isArray(p)?p:null}function rt(p){const A=new Date(p);return Number.isNaN(A.getTime())?p:A.toLocaleTimeString()}function tt(p){const A=Ee(p.params),I=A==null?void 0:A.reason;return typeof I=="string"?I.trim():""}function et(p,A){return`${String(p)}:${A}`}function qe(p){const A=Ee(p.params),I=Array.isArray(A==null?void 0:A.questions)?A.questions:[],Y=[];for(const ve of I){const Ce=Ee(ve);if(!Ce)continue;const Ye=typeof Ce.id=="string"?Ce.id:"";if(!Ye)continue;const we=Array.isArray(Ce.options)?Ce.options.map(me=>Ee(me)).map(me=>me==null?void 0:me.label).filter(me=>typeof me=="string"&&me.length>0):[];Y.push({id:Ye,header:typeof Ce.header=="string"?Ce.header:"",question:typeof Ce.question=="string"?Ce.question:"",isOther:Ce.isOther===!0,options:we})}return Y}function ut(p,A,I){const Y=et(p,A),ve=ae.value[Y];return typeof ve=="string"&&ve.length>0?ve:I}function ue(p,A){const I=et(p,A);return ie.value[I]??""}function Te(p,A,I){const Y=I.target;if(!(Y instanceof HTMLSelectElement))return;const ve=et(p,A);ae.value={...ae.value,[ve]:Y.value}}function Se(p,A,I){const Y=I.target;if(!(Y instanceof HTMLInputElement))return;const ve=et(p,A);ie.value={...ie.value,[ve]:Y.value}}function E(p,A){K("respondServerRequest",{id:p,result:{decision:A}})}function z(p){const A=qe(p),I={};for(const Y of A){const ve=ut(p.id,Y.id,Y.options[0]||""),Ce=ue(p.id,Y.id).trim(),Ye=[ve,Ce].map(we=>we.trim()).filter(we=>we.length>0);I[Y.id]={answers:Ye}}K("respondServerRequest",{id:p.id,result:{answers:I}})}function Z(p){K("respondServerRequest",{id:p,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function he(p){K("respondServerRequest",{id:p,result:{success:!0,contentItems:[]}})}function Re(p){K("respondServerRequest",{id:p,result:{}})}function m(p){K("respondServerRequest",{id:p,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function v(p){return!(p.role!=="user"&&p.role!=="assistant"||typeof p.turnIndex!="number"||B.isTurnInProgress||B.isRollingBack)}function S(p){v(p)&&K("rollback",{turnIndex:p.turnIndex})}function L(){const p=$.value,A=q.value;!p||!A||(p.scrollTop=p.scrollHeight,A.scrollIntoView({block:"end"}))}function H(p){return p.scrollHeight-(p.scrollTop+p.clientHeight)<=tv}function O(p){if(!B.activeThreadId)return;const A=Math.max(p.scrollHeight-p.clientHeight,0),I=A>0?Math.min(Math.max(p.scrollTop/A,0),1):1;K("updateScrollState",{threadId:B.activeThreadId,state:{scrollTop:p.scrollTop,isAtBottom:H(p),scrollRatio:I}})}function re(){const p=$.value;if(!p)return;const A=B.scrollState;if(!A||A.isAtBottom){ee();return}const I=Math.max(p.scrollHeight-p.clientHeight,0),Y=typeof A.scrollRatio=="number"?A.scrollRatio*I:A.scrollTop;p.scrollTop=Math.min(Math.max(Y,0),I),O(p)}function ee(){const p=$.value;p&&(L(),O(p))}function Q(){const p=B.scrollState;return!p||p.isAtBottom===!0}function G(){if(!Q()){oe=0,de=0;return}if(ee(),oe-=1,oe<=0){de=0;return}de=requestAnimationFrame(G)}function ne(p=6){Q()&&(de&&(cancelAnimationFrame(de),de=0),oe=Math.max(p,1),de=requestAnimationFrame(G))}function se(){ne(3)}function ye(){if(!Q())return;const p=$.value;if(!p)return;const A=p.querySelectorAll("img.message-image-preview");for(const I of A)I.complete||te.has(I)||(te.add(I),I.addEventListener("load",se,{once:!0}),I.addEventListener("error",se,{once:!0}))}async function xe(){await Vt(),le&&cancelAnimationFrame(le),le=requestAnimationFrame(()=>{le=0,re(),ye(),ne()})}ft(()=>B.messages,async p=>{if(!B.isLoading){for(const A of p){if(A.messageType!=="commandExecution"||!A.commandExecution)continue;const I=o.value[A.id],Y=A.commandExecution.status;I==="inProgress"&&Y!=="inProgress"&&M(A.id),o.value[A.id]=Y}await xe()}}),ft(()=>B.liveOverlay,async p=>{p&&(await Vt(),ee(),ne(8))},{deep:!0}),ft(()=>B.isLoading,async p=>{p||await xe()}),ft(()=>B.activeThreadId,()=>{F.value="",fe.value=new Set},{flush:"post"});function Me(){const p=$.value;!p||B.isLoading||O(p)}function je(p){F.value=ke(p)}function Be(p,A){return`${p}:${String(A)}`}function Ue(p,A){const I=new Set(fe.value);I.add(Be(p,A)),fe.value=I}function N(p,A){return fe.value.has(Be(p,A))}function V(){F.value=""}return Bn(()=>{le&&cancelAnimationFrame(le),de&&cancelAnimationFrame(de)}),(p,A)=>(_(),x("section",Om,[e.isLoading?(_(),x("p",jm,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(_(),x("p",Lm," No messages in this thread yet. ")):(_(),x("ul",{key:2,ref_key:"conversationListRef",ref:$,class:"conversation-list",onScroll:Me},[(_(!0),x(Fe,null,ht(e.pendingRequests,I=>(_(),x("li",{key:`server-request:${I.id}`,class:"conversation-item conversation-item-request"},[w("div",Dm,[w("div",Bm,[w("article",Fm,[w("p",Hm,_e(I.method),1),w("p",Um,"Request #"+_e(I.id)+" · "+_e(rt(I.receivedAtIso)),1),tt(I)?(_(),x("p",Vm,_e(tt(I)),1)):pe("",!0),I.method==="item/commandExecution/requestApproval"?(_(),x("section",qm,[w("button",{type:"button",class:"request-button request-button-primary",onClick:Y=>E(I.id,"accept")},"Accept",8,Wm),w("button",{type:"button",class:"request-button",onClick:Y=>E(I.id,"acceptForSession")},"Accept for Session",8,Km),w("button",{type:"button",class:"request-button",onClick:Y=>E(I.id,"decline")},"Decline",8,Gm),w("button",{type:"button",class:"request-button",onClick:Y=>E(I.id,"cancel")},"Cancel",8,zm)])):I.method==="item/fileChange/requestApproval"?(_(),x("section",Ym,[w("button",{type:"button",class:"request-button request-button-primary",onClick:Y=>E(I.id,"accept")},"Accept",8,Jm),w("button",{type:"button",class:"request-button",onClick:Y=>E(I.id,"acceptForSession")},"Accept for Session",8,Qm),w("button",{type:"button",class:"request-button",onClick:Y=>E(I.id,"decline")},"Decline",8,Xm),w("button",{type:"button",class:"request-button",onClick:Y=>E(I.id,"cancel")},"Cancel",8,Zm)])):I.method==="item/tool/requestUserInput"?(_(),x("section",eg,[(_(!0),x(Fe,null,ht(qe(I),Y=>(_(),x("div",{key:`${I.id}:${Y.id}`,class:"request-question"},[w("p",tg,_e(Y.header||Y.question),1),Y.header&&Y.question?(_(),x("p",ng,_e(Y.question),1)):pe("",!0),w("select",{class:"request-select",value:ut(I.id,Y.id,Y.options[0]||""),onChange:ve=>Te(I.id,Y.id,ve)},[(_(!0),x(Fe,null,ht(Y.options,ve=>(_(),x("option",{key:`${I.id}:${Y.id}:${ve}`,value:ve},_e(ve),9,sg))),128))],40,rg),Y.isOther?(_(),x("input",{key:1,class:"request-input",type:"text",value:ue(I.id,Y.id),placeholder:"Other answer",onInput:ve=>Se(I.id,Y.id,ve)},null,40,og)):pe("",!0)]))),128)),w("button",{type:"button",class:"request-button request-button-primary",onClick:Y=>z(I)}," Submit Answers ",8,ig)])):I.method==="item/tool/call"?(_(),x("section",ag,[w("button",{type:"button",class:"request-button request-button-primary",onClick:Y=>Z(I.id)},"Fail Tool Call",8,lg),w("button",{type:"button",class:"request-button",onClick:Y=>he(I.id)},"Success (Empty)",8,cg)])):(_(),x("section",ug,[w("button",{type:"button",class:"request-button request-button-primary",onClick:Y=>Re(I.id)},"Return Empty Result",8,dg),w("button",{type:"button",class:"request-button",onClick:Y=>m(I.id)},"Reject Request",8,fg)]))])])])]))),128)),(_(!0),x(Fe,null,ht(e.messages,I=>{var Y,ve;return _(),x("li",{key:I.id,class:lt(["conversation-item",{"conversation-item-rollbackable":v(I)}]),"data-role":I.role,"data-message-type":I.messageType||""},[i(I)?(_(),x("div",pg,[w("div",mg,[w("button",{type:"button",class:lt(["cmd-row",[b(I),{"cmd-expanded":a(I)}]]),onClick:Ce=>d(I)},[w("span",{class:lt(["cmd-chevron",{"cmd-chevron-open":a(I)}])},"▶",2),w("code",vg,_e(((Y=I.commandExecution)==null?void 0:Y.command)||"(command)"),1),w("span",yg,_e(g(I)),1)],10,gg),w("div",{class:lt(["cmd-output-wrap",{"cmd-output-visible":a(I),"cmd-output-collapsing":l(I)}])},[w("div",wg,[w("pre",bg,_e(((ve=I.commandExecution)==null?void 0:ve.aggregatedOutput)||"(no output)"),1)])],2)])])):(_(),x("div",{key:1,class:"message-row","data-role":I.role,"data-message-type":I.messageType||""},[w("div",{class:"message-stack","data-role":I.role},[w("article",{class:"message-body","data-role":I.role},[I.images&&I.images.length>0?(_(),x("ul",{key:0,class:"message-image-list","data-role":I.role},[(_(!0),x(Fe,null,ht(I.images,Ce=>(_(),x("li",{key:Ce,class:"message-image-item"},[w("button",{class:"message-image-button",type:"button",onClick:Ye=>je(Ce)},[w("img",{class:"message-image-preview",src:ke(Ce),alt:"Message image preview",loading:"lazy"},null,8,Cg)],8,xg)]))),128))],8,Sg)):pe("",!0),I.fileAttachments&&I.fileAttachments.length>0?(_(),x("div",Ag,[(_(!0),x(Fe,null,ht(I.fileAttachments,Ce=>(_(),x("span",{key:Ce.path,class:"message-file-chip"},[A[2]||(A[2]=w("span",{class:"message-file-chip-icon"},"📄",-1)),w("span",{class:"message-file-chip-name",title:Ce.path},_e(Ce.label),9,Eg)]))),128))])):pe("",!0),I.text.length>0?(_(),x("article",{key:2,class:"message-card","data-role":I.role},[I.messageType==="worked"?(_(),x("div",Rg,[w("button",{type:"button",class:"worked-separator",onClick:Ce=>u(I)},[A[3]||(A[3]=w("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),w("span",{class:lt(["worked-chevron",{"worked-chevron-open":f(I)}])},"▶",2),w("p",Mg,_e(I.text),1),A[4]||(A[4]=w("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,$g),f(I)?(_(),x("div",Pg,[(_(!0),x(Fe,null,ht(C(e.messages,e.messages.indexOf(I)),Ce=>{var Ye,we;return _(),x("div",{key:`worked-cmd-${Ce.id}`,class:"worked-cmd-item"},[w("button",{type:"button",class:lt(["cmd-row",[b(Ce),{"cmd-expanded":a(Ce)}]]),onClick:me=>d(Ce)},[w("span",{class:lt(["cmd-chevron",{"cmd-chevron-open":a(Ce)}])},"▶",2),w("code",Og,_e(((Ye=Ce.commandExecution)==null?void 0:Ye.command)||"(command)"),1),w("span",jg,_e(g(Ce)),1)],10,Ng),w("div",{class:lt(["cmd-output-wrap",{"cmd-output-visible":a(Ce),"cmd-output-collapsing":l(Ce)}])},[w("div",Lg,[w("pre",Dg,_e(((we=Ce.commandExecution)==null?void 0:we.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):pe("",!0)])):(_(),x("div",Bg,[(_(!0),x(Fe,null,ht(Le(I.text),(Ce,Ye)=>(_(),x(Fe,{key:`block-${Ye}`},[Ce.kind==="text"?(_(),x("p",Fg,[(_(!0),x(Fe,null,ht(Ge(Ce.value),(we,me)=>(_(),x(Fe,{key:`seg-${Ye}-${me}`},[we.kind==="text"?(_(),x("span",Hg,_e(we.value),1)):we.kind==="file"?(_(),x("a",{key:1,class:"message-file-link",href:"#",onClick:A[0]||(A[0]=ct(()=>{},["prevent"]))},_e(we.displayName),1)):(_(),x("code",Ug,_e(we.value),1))],64))),128))])):N(I.id,Ye)?(_(),x("p",Vg,_e(Ce.markdown),1)):(_(),x("button",{key:2,class:"message-image-button",type:"button",onClick:we=>je(Ce.url)},[w("img",{class:"message-image-preview message-markdown-image",src:Ce.url,alt:Ce.alt||"Embedded message image",loading:"lazy",onError:we=>Ue(I.id,Ye)},null,40,Wg)],8,qg))],64))),128))]))],8,Ig)):pe("",!0)],8,Tg),v(I)?(_(),x("button",{key:0,class:"rollback-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:Ce=>S(I)},[Ae(Nm,{class:"rollback-icon"}),A[5]||(A[5]=w("span",{class:"rollback-label"},"Rollback",-1))],8,Kg)):pe("",!0)],8,kg)],8,_g))],10,hg)}),128)),e.liveOverlay?(_(),x("li",Gg,[w("div",zg,[w("div",Yg,[w("article",Jg,[w("p",Qg,_e(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(_(),x("p",Xg,_e(e.liveOverlay.reasoningText),1)):pe("",!0),e.liveOverlay.errorText?(_(),x("p",Zg,_e(e.liveOverlay.errorText),1)):pe("",!0)])])])])):pe("",!0),w("li",{ref_key:"bottomAnchorRef",ref:q,class:"conversation-bottom-anchor"},null,512)],544)),F.value.length>0?(_(),x("div",{key:3,class:"image-modal-backdrop",onClick:V},[w("div",{class:"image-modal-content",onClick:A[1]||(A[1]=ct(()=>{},["stop"]))},[w("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:V},[Ae(si,{class:"icon-svg"})]),w("img",{class:"image-modal-image",src:F.value,alt:"Expanded message image"},null,8,ev)])])):pe("",!0)]))}}),rv=ze(nv,[["__scopeId","data-v-857238be"]]);function sv(e){var u;const t=U("idle"),n=U(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=g=>{g.data.size>0&&o.push(g.data)},r.onstop=()=>{var M;const g=o,b=(r==null?void 0:r.mimeType)||((M=g[0])==null?void 0:M.type)||"audio/webm";d(),t.value="idle",l(g,b)},r.start(),t.value="recording"}catch(g){d(),(f=e.onError)==null||f.call(e,g)}}function a(){t.value!=="recording"||!r||r.state!=="inactive"&&r.stop()}async function l(f,g){var M;if(f.length===0)return;const b=new Blob(f,{type:g});try{const C=g.split(/[/;]/)[1]??"webm",B=`----codex-transcribe-${crypto.randomUUID()}`,K=new Uint8Array(await b.arrayBuffer()),$=new TextEncoder,q=[];q.push($.encode(`--${B}\r
27
- `)),q.push($.encode(`Content-Disposition: form-data; name="file"; filename="codex.${C}"\r
28
- `)),q.push($.encode(`Content-Type: ${g}\r
29
- \r
30
- `)),q.push(K),q.push($.encode(`\r
31
- --${B}--\r
32
- `));let F=0;for(const te of q)F+=te.byteLength;const ae=new Uint8Array(F);let ie=0;for(const te of q)ae.set(te,ie),ie+=te.byteLength;const le=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${B}`},body:ae});if(!le.ok)throw new Error(`Transcription failed: ${le.status}`);const oe=((await le.json()).text??"").trim();oe.length>0&&e.onTranscript(oe)}catch(C){(M=e.onError)==null||M.call(e,C)}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 Bn(d),{state:t,isSupported:n,startRecording:i,stopRecording:a}}function Aa(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class vn extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function oi(e,t){const n=Aa(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=Aa(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function _r(e,t,n){return e instanceof vn?e:e instanceof Error?new vn(e.message||t,{code:"unknown_error",method:n}):new vn(t,{code:"unknown_error",method:n})}function bc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function ov(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 vn(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 vn(oi(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 vn(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function Ea(e){const t=bc(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 iv(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=Ea(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=Ea(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 av(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 vn(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 vn(oi(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function lv(){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 vn(oi(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=bc(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function Ia(e){return new Date(e*1e3).toISOString()}function cv(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function uv(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const dv=/^##\s+(.+?):\s+(.+?)\s*$/,fv=/^#\s*files mentioned by the user\s*:?\s*$/i;function hv(e){var s,o;const t=e.split(`
33
- `).findIndex(i=>fv.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(dv);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 pv(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 mv(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:uv(l),isUnhandled:!0});const o=n.join(`
35
- `),i=hv(o);return{text:pv(o),images:r,fileAttachments:i,rawBlocks:s}}function gv(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=mv(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=vv(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 vv(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function yv(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function wv(e){const t=yv(e);return t.length>0?t:"Untitled thread"}function bv(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:wv(e),projectName:cv(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:Ia(e.createdAt),updatedAtIso:Ia(e.updatedAt),preview:e.preview,unread:!1,inProgress:!1}}function _v(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 kv(e){const t=e.data.map(bv);return _v(t)}function _c(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 gv(i))n.push({...a,turnIndex:r})}return n}async function Wt(e,t){try{return await ov(e,t)}catch(n){throw _r(n,`RPC ${e} failed`,e)}}function Tv(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function Sv(){const e=await Wt("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return kv(e)}async function xv(e){const t=await Wt("thread/read",{threadId:e,includeTurns:!0});return _c(t)}async function Cv(){try{return await Sv()}catch(e){throw _r(e,"Failed to load thread groups","thread/list")}}async function Av(e){try{return await xv(e)}catch(t){throw _r(t,`Failed to load thread ${e}`,"thread/read")}}function Ev(e){return iv(e)}async function Iv(e,t){await av({id:e,...t})}async function Rv(){return lv()}async function Ra(e){await Wt("thread/resume",{threadId:e})}async function $v(e){await Wt("thread/archive",{threadId:e})}async function $a(e,t){const n=await Wt("thread/rollback",{threadId:e,numTurns:t});return _c(n)}function Mv(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 Pv(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 Wt("thread/start",n),s=Mv(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw _r(n,"Failed to start a new thread","thread/start")}}function Nv(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 Ov(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:Nv(t,i)}];for(const f of n){const g=f.trim();g&&l.push({type:"image",url:g,image_url:g})}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 Wt("turn/start",u)}catch(a){throw _r(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function jv(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 Wt("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw _r(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function Lv(){const e=await Wt("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 Dv(){const e=await Wt("config/read",{}),t=e.config.model??"",n=Tv(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function Bv(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 Ma(){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 Bv(n.data)}async function Pa(){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 Fv(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 Hv(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=ii(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 Uv(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=ii(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 Vv(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=ii(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,g=typeof f=="string"?f.trim():"";g&&l.push({path:g})}return l}function ii(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 qv(){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 Na(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 Wv(e,t){var n;try{return((n=(await Wt("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function Kv(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await Wt("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 Gv(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 zv={},Yv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Jv(e,t){return _(),x("svg",Yv,[...t[0]||(t[0]=[w("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 Qv=ze(zv,[["render",Jv]]),Xv={},Zv={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ey(e,t){return _(),x("svg",Zv,[...t[0]||(t[0]=[w("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 ty=ze(Xv,[["render",ey]]),ny={},ry={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function sy(e,t){return _(),x("svg",ry,[...t[0]||(t[0]=[w("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),w("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 oy=ze(ny,[["render",sy]]),iy=["disabled"],ay={class:"composer-dropdown-value"},ly={class:"composer-dropdown-menu"},cy={key:0,class:"composer-dropdown-search-wrap"},uy=["placeholder","onKeydown"],dy={class:"composer-dropdown-options",role:"listbox"},fy=["onClick"],hy={key:0,class:"composer-dropdown-empty"},py={key:1,class:"composer-dropdown-add-wrap"},my=["placeholder","onKeydown"],gy=kt({__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=U(null),o=U(null),i=U(null),a=U(!1),l=U(""),d=U(!1),u=U(""),f=ce(()=>{var fe;const te=n.options.find(X=>X.value===n.modelValue);return te?te.label:((fe=n.placeholder)==null?void 0:fe.trim())||""}),g=ce(()=>n.openDirection??"down"),b=ce(()=>n.enableSearch===!0),M=ce(()=>n.showAddAction===!0),C=ce(()=>{var te;return((te=n.searchPlaceholder)==null?void 0:te.trim())||"Quick search projects"}),B=ce(()=>{var te;return((te=n.addActionLabel)==null?void 0:te.trim())||"Add new project"}),K=ce(()=>{var te;return((te=n.addPlaceholder)==null?void 0:te.trim())||"Project name or absolute path"}),$=ce(()=>{const te=l.value.trim().toLowerCase();return te?n.options.filter(fe=>fe.label.toLowerCase().includes(te)||fe.value.toLowerCase().includes(te)):n.options});function q(){n.disabled||(a.value=!a.value)}function F(te){r("update:modelValue",te),a.value=!1,l.value=""}function ae(){var te;d.value=!0,u.value=((te=n.defaultAddValue)==null?void 0:te.trim())||"",Vt(()=>{var fe;return(fe=i.value)==null?void 0:fe.focus()})}function ie(){if(l.value.length>0){l.value="";return}a.value=!1}function le(){const te=u.value.trim();te&&(r("add",te),d.value=!1,u.value="",a.value=!1,l.value="")}function de(){d.value=!1,u.value="",Vt(()=>{var te;return(te=o.value)==null?void 0:te.focus()})}function oe(te){if(!a.value)return;const fe=s.value;if(!fe)return;const X=te.target;X instanceof Node&&(fe.contains(X)||(a.value=!1,l.value="",d.value=!1,u.value=""))}return ft(a,te=>{if(!te){d.value=!1,u.value="";return}b.value&&Vt(()=>{var fe;return(fe=o.value)==null?void 0:fe.focus()})}),Dn(()=>{window.addEventListener("pointerdown",oe)}),Bn(()=>{window.removeEventListener("pointerdown",oe)}),(te,fe)=>(_(),x("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[w("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:q},[w("span",ay,_e(f.value),1),Ae(ri,{class:"composer-dropdown-chevron"})],8,iy),a.value?(_(),x("div",{key:0,class:lt(["composer-dropdown-menu-wrap",{"composer-dropdown-menu-wrap-up":g.value==="up","composer-dropdown-menu-wrap-down":g.value==="down"}])},[w("div",ly,[b.value?(_(),x("div",cy,[Nn(w("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":fe[0]||(fe[0]=X=>l.value=X),class:"composer-dropdown-search-input",type:"text",placeholder:C.value,onKeydown:Ft(ct(ie,["prevent"]),["esc"])},null,40,uy),[[jn,l.value]])])):pe("",!0),w("ul",dy,[(_(!0),x(Fe,null,ht($.value,X=>(_(),x("li",{key:X.value},[w("button",{class:lt(["composer-dropdown-option",{"is-selected":X.value===e.modelValue}]),type:"button",onClick:Ne=>F(X.value)},_e(X.label),11,fy)]))),128)),$.value.length===0?(_(),x("li",hy," No matching projects ")):pe("",!0)]),M.value?(_(),x("div",py,[d.value?(_(),x(Fe,{key:0},[Nn(w("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":fe[1]||(fe[1]=X=>u.value=X),class:"composer-dropdown-add-input",type:"text",placeholder:K.value,onKeydown:[Ft(ct(le,["prevent"]),["enter"]),Ft(ct(de,["prevent"]),["esc"])]},null,40,my),[[jn,u.value]]),w("div",{class:"composer-dropdown-add-actions"},[w("button",{type:"button",class:"composer-dropdown-add-btn",onClick:le},"Open"),w("button",{type:"button",class:"composer-dropdown-add-btn",onClick:de},"Cancel")])],64)):(_(),x("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:ae},_e(B.value),1))])):pe("",!0)])],2)):pe("",!0)],512))}}),Ro=ze(gy,[["__scopeId","data-v-8fdced75"]]),vy=["disabled"],yy={class:"search-dropdown-value"},wy={class:"search-dropdown-search-wrap"},by=["placeholder","onKeydown"],_y={key:0,class:"search-dropdown-list",role:"listbox"},ky=["onClick","onPointerenter"],Ty={class:"search-dropdown-option-check"},Sy={class:"search-dropdown-option-label"},xy={key:0,class:"search-dropdown-option-desc"},Cy={key:1,class:"search-dropdown-empty"},Ay=kt({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=U(null),o=U(null),i=U(!1),a=U(""),l=U(0),d=ce(()=>n.openDirection??"down"),u=ce(()=>new Set(n.selectedValues)),f=ce(()=>{if(n.selectedValues.length===0)return n.placeholder||"Select...";if(n.selectedValues.length===1){const $=n.options.find(q=>q.value===n.selectedValues[0]);return($==null?void 0:$.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),g=ce(()=>{const $=a.value.toLowerCase().trim();return $?n.options.filter(q=>{var F;return q.label.toLowerCase().includes($)||(((F=q.description)==null?void 0:F.toLowerCase().includes($))??!1)}):n.options});function b(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,Vt(()=>{var $;return($=o.value)==null?void 0:$.focus()})))}function M($){r("toggle",$.value,!u.value.has($.value))}function C($){g.value.length!==0&&(l.value=(l.value+$+g.value.length)%g.value.length)}function B(){const $=g.value[l.value];$&&M($)}function K($){if(!i.value)return;const q=s.value;if(!q)return;const F=$.target;F instanceof Node&&(q.contains(F)||(i.value=!1))}return ft(a,()=>{l.value=0}),Dn(()=>window.addEventListener("pointerdown",K)),Bn(()=>window.removeEventListener("pointerdown",K)),($,q)=>(_(),x("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[w("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:b},[w("span",yy,_e(f.value),1),Ae(ri,{class:"search-dropdown-chevron"})],8,vy),i.value?(_(),x("div",{key:0,class:lt(["search-dropdown-menu-wrap",{"search-dropdown-menu-wrap-up":d.value==="up","search-dropdown-menu-wrap-down":d.value==="down"}])},[w("div",wy,[Nn(w("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":q[0]||(q[0]=F=>a.value=F),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[q[1]||(q[1]=Ft(ct(F=>i.value=!1,["prevent"]),["escape"])),Ft(ct(B,["prevent"]),["enter"]),q[2]||(q[2]=Ft(ct(F=>C(1),["prevent"]),["arrow-down"])),q[3]||(q[3]=Ft(ct(F=>C(-1),["prevent"]),["arrow-up"]))]},null,40,by),[[jn,a.value]])]),g.value.length>0?(_(),x("ul",_y,[(_(!0),x(Fe,null,ht(g.value,(F,ae)=>(_(),x("li",{key:F.value},[w("button",{class:lt(["search-dropdown-option",{"is-selected":u.value.has(F.value),"is-highlighted":ae===l.value}]),type:"button",onClick:ie=>M(F),onPointerenter:ie=>l.value=ae},[w("span",Ty,_e(u.value.has(F.value)?"✓":""),1),w("span",Sy,_e(F.label),1),F.description?(_(),x("span",xy,_e(F.description),1)):pe("",!0)],42,ky)]))),128))])):(_(),x("div",Cy,"No results"))],2)):pe("",!0)],512))}}),Ey=ze(Ay,[["__scopeId","data-v-4d3f2c83"]]),Iy={class:"skill-picker-header"},Ry=["onKeydown"],$y={key:0,class:"skill-picker-list",role:"listbox"},My=["onClick","onPointerenter"],Py={class:"skill-picker-name"},Ny={key:0,class:"skill-picker-desc"},Oy={key:1,class:"skill-picker-empty"},jy=kt({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=U(null),o=U(null),i=U(""),a=U(0),l=ce(()=>{const g=i.value.toLowerCase().trim();return g?n.skills.filter(b=>b.name.toLowerCase().includes(g)||b.description.toLowerCase().includes(g)):n.skills}),d=ce(()=>{const g={};return n.anchorBottom!=null&&(g.bottom=`${n.anchorBottom}px`),n.anchorLeft!=null&&(g.left=`${n.anchorLeft}px`),g});function u(g){l.value.length!==0&&(a.value=(a.value+g+l.value.length)%l.value.length)}function f(){const g=l.value[a.value];g&&r("select",g)}return ft(()=>n.visible,g=>{g&&(i.value="",a.value=0,Vt(()=>{var b;return(b=o.value)==null?void 0:b.focus()}))}),ft(i,()=>{a.value=0}),(g,b)=>e.visible?(_(),x("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:nr(d.value)},[w("div",Iy,[Nn(w("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":b[0]||(b[0]=M=>i.value=M),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[b[1]||(b[1]=Ft(ct(M=>g.$emit("close"),["prevent"]),["escape"])),Ft(ct(f,["prevent"]),["enter"]),b[2]||(b[2]=Ft(ct(M=>u(1),["prevent"]),["arrow-down"])),b[3]||(b[3]=Ft(ct(M=>u(-1),["prevent"]),["arrow-up"]))]},null,40,Ry),[[jn,i.value]])]),l.value.length>0?(_(),x("ul",$y,[(_(!0),x(Fe,null,ht(l.value,(M,C)=>(_(),x("li",{key:M.path},[w("button",{class:lt(["skill-picker-item",{"is-highlighted":C===a.value}]),type:"button",onClick:B=>g.$emit("select",M),onPointerenter:B=>a.value=C},[w("span",Py,_e(M.name),1),M.description?(_(),x("span",Ny,_e(M.description),1)):pe("",!0)],42,My)]))),128))])):(_(),x("div",Oy,"No skills found"))],4)):pe("",!0)}}),Ly=ze(jy,[["__scopeId","data-v-d6a08788"]]),Dy={key:0,class:"thread-composer-attachments"},By=["src","alt"],Fy=["aria-label","disabled","onClick"],Hy={key:1,class:"thread-composer-file-chips"},Uy=["title"],Vy=["aria-label","disabled","onClick"],qy={key:2,class:"thread-composer-skill-chips"},Wy={class:"thread-composer-skill-chip-name"},Ky=["aria-label","onClick"],Gy={class:"thread-composer-input-wrap"},zy={key:0,class:"thread-composer-file-mentions"},Yy=["onMousedown"],Jy={key:1,class:"thread-composer-file-mention-icon-markdown"},Qy={class:"thread-composer-file-mention-text"},Xy={class:"thread-composer-file-mention-name"},Zy={key:0,class:"thread-composer-file-mention-dir"},ew={key:1,class:"thread-composer-file-mention-empty"},tw=["placeholder","disabled"],nw={class:"thread-composer-controls"},rw=["disabled"],sw={key:0,class:"thread-composer-attach-menu"},ow=["disabled"],iw=["disabled"],aw={class:"thread-composer-actions"},lw=["aria-label","title","disabled"],cw=["disabled"],uw=["aria-label","title","disabled"],dw=["disabled"],fw=["disabled"],hw=kt({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},models:{},selectedModel:{},selectedReasoningEffort:{},skills:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(e,{emit:t}){const n=e,r=t,s=U(""),o=U([]),i=U([]),a=U([]),{state:l,isSupported:d,startRecording:u,stopRecording:f}=sv({onTranscript:N=>{const V=N.trim();!V||ke.value||(r("submit",{text:V,imageUrls:o.value.map(p=>p.url),fileAttachments:[...a.value],skills:i.value.map(p=>({name:p.name,path:p.path})),mode:"steer",source:"dictation"}),s.value="",o.value=[],i.value=[],a.value=[],B.value=!1,K.value=!1,O())}}),g=U(null),b=U(null),M=U(null),C=U(null),B=U(!1),K=U(!1),$=U(null),q=U(""),F=U([]),ae=U(!1),ie=U(0);let le=0,de=null;const oe=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),te=[{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"}],fe=ce(()=>n.models.map(N=>({value:N,label:N}))),X=ce(()=>n.skills??[]),Ne=ce(()=>i.value.map(N=>N.path)),We=ce(()=>(n.skills??[]).map(N=>({value:N.path,label:N.name,description:N.description}))),Ge=ce(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),ke=ce(()=>n.disabled||!n.activeThreadId),Le=ce(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function Ee(N="steer"){var p;const V=s.value.trim();if(Ge.value){if(r("submit",{text:V,imageUrls:o.value.map(A=>A.url),fileAttachments:[...a.value],skills:i.value.map(A=>({name:A.name,path:A.path})),mode:N,source:"manual"}),s.value="",o.value=[],i.value=[],a.value=[],B.value=!1,K.value=!1,O(),oe){(p=C.value)==null||p.blur();return}Vt(()=>{var A;return(A=C.value)==null?void 0:A.focus()})}}function rt(){r("interrupt")}function tt(N){r("update:selected-model",N)}function et(N){r("update:selected-reasoning-effort",N)}function qe(){ke.value||(B.value=!B.value)}function ut(){var N;(N=b.value)==null||N.click()}function ue(){var N;(N=M.value)==null||N.click()}function Te(N){o.value=o.value.filter(V=>V.id!==N)}function Se(N){i.value=i.value.filter(V=>V.path!==N)}function E(N){a.value=a.value.filter(V=>V.fsPath!==N)}function z(N){const V=N.replace(/\\/g,"/");if(a.value.some(I=>I.fsPath===V))return;const p=V.split("/").filter(Boolean),A=p[p.length-1]??V;a.value=[...a.value,{label:A,path:V,fsPath:V}]}function Z(N){return N.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(N.name)}function he(N){if(!(!N||N.length===0))for(const V of Array.from(N))if(Z(V)){const p=new FileReader;p.onload=()=>{typeof p.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:V.name,url:p.result})},p.readAsDataURL(V)}else Gv(V).then(p=>{p&&z(p)}).catch(()=>{})}function Re(N){N&&(N.value="")}function m(N){const V=N.target;he((V==null?void 0:V.files)??null),Re(V),B.value=!1}function v(N){const V=N.target;he((V==null?void 0:V.files)??null),Re(V),B.value=!1}function S(){const N=s.value;N==="/"?K.value=!0:K.value&&!N.startsWith("/")&&(K.value=!1),re()}function L(N){if(ae.value){if(N.key==="Escape"){N.preventDefault(),O();return}if(N.key==="ArrowDown"){N.preventDefault(),F.value.length>0&&(ie.value=(ie.value+1)%F.value.length);return}if(N.key==="ArrowUp"){if(N.preventDefault(),F.value.length>0){const V=F.value.length;ie.value=(ie.value+V-1)%V}return}if(N.key==="Enter"||N.key==="Tab"){N.preventDefault();const V=F.value[ie.value];V?Q(V):O();return}}if(N.key==="Enter"&&!N.shiftKey){N.preventDefault(),Ee("steer");return}if(K.value){if(N.key==="Escape"){N.preventDefault(),H();return}if(N.key==="ArrowDown"||N.key==="ArrowUp"){N.preventDefault();return}}}function H(){var N;K.value=!1,(N=C.value)==null||N.focus()}function O(){ae.value=!1,$.value=null,q.value="",F.value=[],ie.value=0}function re(){const N=C.value;if(!N){O();return}const V=N.selectionStart??s.value.length,A=s.value.slice(0,V).match(/(^|\s)(@[^\s@]*)$/);if(!A){O();return}const I=A[2]??"",Y=I.length,ve=V-Y;$.value=ve,q.value=I.slice(1),ae.value=!0,ee()}async function ee(){if(!ae.value)return;const N=(n.cwd??"").trim();if(!N){F.value=[];return}de&&clearTimeout(de);const V=++le;de=setTimeout(async()=>{try{const p=await Vv(N,q.value,20);if(!ae.value||V!==le)return;F.value=p,ie.value=0}catch{if(!ae.value||V!==le)return;F.value=[]}},120)}function Q(N){const V=C.value,p=$.value;if(p!==null&&V){const A=V.selectionStart??s.value.length;s.value=`${s.value.slice(0,p)}${s.value.slice(A)}`.trimEnd()}z(N.path),O(),Vt(()=>V==null?void 0:V.focus())}function G(N){const V=N.lastIndexOf("/");return V<0?N:N.slice(V+1)}function ne(N){const V=N.lastIndexOf("/");return V<=0?"":N.slice(0,V)}function se(N){const V=G(N),p=V.lastIndexOf(".");return p<=0?"":V.slice(p+1).toLowerCase()}function ye(N){const V=se(N);return V==="ts"?"TS":V==="tsx"?"TSX":V==="js"?"JS":V==="jsx"?"JSX":V==="json"?"{}":""}function xe(N){const V=se(N);return V.startsWith("ts")?"ts":V.startsWith("js")?"js":V==="json"?"json":"default"}function Me(N){const V=se(N);return V==="md"||V==="mdx"}function je(N){var V;i.value.some(p=>p.path===N.path)||(i.value=[...i.value,N]),s.value=s.value.startsWith("/")?"":s.value,K.value=!1,(V=C.value)==null||V.focus()}function Be(N,V){if(V){const p=(n.skills??[]).find(A=>A.path===N);p&&!i.value.some(A=>A.path===N)&&(i.value=[...i.value,p])}else i.value=i.value.filter(p=>p.path!==N)}function Ue(N){if(!B.value)return;const V=g.value;if(!V)return;const p=N.target;!p||V.contains(p)||(B.value=!1)}return Dn(()=>{document.addEventListener("click",Ue)}),Bn(()=>{document.removeEventListener("click",Ue),de&&clearTimeout(de)}),ft(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],B.value=!1,K.value=!1,O()}),ft(()=>n.cwd,()=>{ae.value&&ee()}),(N,V)=>(_(),x("form",{class:"thread-composer",onSubmit:V[7]||(V[7]=ct(p=>Ee("steer"),["prevent"]))},[w("div",{class:lt(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(_(),x("div",Dy,[(_(!0),x(Fe,null,ht(o.value,p=>(_(),x("div",{key:p.id,class:"thread-composer-attachment"},[w("img",{class:"thread-composer-attachment-image",src:p.url,alt:p.name||"Selected image"},null,8,By),w("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${p.name||"image"}`,disabled:ke.value,onClick:A=>Te(p.id)}," x ",8,Fy)]))),128))])):pe("",!0),a.value.length>0?(_(),x("div",Hy,[(_(!0),x(Fe,null,ht(a.value,p=>(_(),x("span",{key:p.fsPath,class:"thread-composer-file-chip"},[Ae(bs,{class:"thread-composer-file-chip-icon"}),w("span",{class:"thread-composer-file-chip-name",title:p.fsPath},_e(p.label),9,Uy),w("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${p.label}`,disabled:ke.value,onClick:A=>E(p.fsPath)},"×",8,Vy)]))),128))])):pe("",!0),i.value.length>0?(_(),x("div",qy,[(_(!0),x(Fe,null,ht(i.value,p=>(_(),x("span",{key:p.path,class:"thread-composer-skill-chip"},[w("span",Wy,_e(p.name),1),w("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${p.name}`,onClick:A=>Se(p.path)},"×",8,Ky)]))),128))])):pe("",!0),w("div",Gy,[ae.value?(_(),x("div",zy,[F.value.length>0?(_(!0),x(Fe,{key:0},ht(F.value,(p,A)=>(_(),x("button",{key:p.path,class:lt(["thread-composer-file-mention-row",{"is-active":A===ie.value}]),type:"button",onMousedown:ct(I=>Q(p),["prevent"])},[ye(p.path)?(_(),x("span",{key:0,class:lt(["thread-composer-file-mention-icon-badge",`is-${xe(p.path)}`])},_e(ye(p.path)),3)):Me(p.path)?(_(),x("span",Jy,"↓")):(_(),ot(bs,{key:2,class:"thread-composer-file-mention-icon-file"})),w("span",Qy,[w("span",Xy,_e(G(p.path)),1),ne(p.path)?(_(),x("span",Zy,_e(ne(p.path)),1)):pe("",!0)])],42,Yy))),128)):(_(),x("div",ew,"No matching files"))])):pe("",!0),Nn(w("textarea",{ref_key:"inputRef",ref:C,"onUpdate:modelValue":V[0]||(V[0]=p=>s.value=p),class:"thread-composer-input",placeholder:Le.value,disabled:ke.value,onInput:S,onKeydown:L},null,40,tw),[[jn,s.value]]),Ae(Ly,{skills:X.value,visible:K.value,"anchor-bottom":44,"anchor-left":0,onSelect:je,onClose:H},null,8,["skills","visible"])]),w("div",nw,[w("div",{ref_key:"attachMenuRootRef",ref:g,class:"thread-composer-attach"},[w("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:ke.value,onClick:qe}," + ",8,rw),B.value?(_(),x("div",sw,[w("button",{class:"thread-composer-attach-item",type:"button",disabled:ke.value,onClick:ut}," Add photos & files ",8,ow),w("button",{class:"thread-composer-attach-item",type:"button",disabled:ke.value,onClick:ue}," Take photo ",8,iw)])):pe("",!0)],512),Ae(Ro,{class:"thread-composer-control","model-value":e.selectedModel,options:fe.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":tt},null,8,["model-value","options","disabled"]),Ae(Ey,{class:"thread-composer-control",options:We.value,"selected-values":Ne.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress||(e.skills??[]).length===0,onToggle:Be},null,8,["options","selected-values","disabled"]),Ae(Ro,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:te,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":et},null,8,["model-value","disabled"]),w("div",aw,[$e(d)&&!e.isTurnInProgress?(_(),x("button",{key:0,class:lt(["thread-composer-mic",{"thread-composer-mic--active":$e(l)!=="idle"}]),type:"button","aria-label":$e(l)==="recording"?"Stop dictation":"Hold to dictate",title:$e(l)==="recording"?"Release to transcribe":"Hold to dictate",disabled:ke.value,onMousedown:V[1]||(V[1]=ct((...p)=>$e(u)&&$e(u)(...p),["prevent"])),onMouseup:V[2]||(V[2]=(...p)=>$e(f)&&$e(f)(...p)),onMouseleave:V[3]||(V[3]=p=>$e(l)==="recording"&&$e(f)()),onTouchstart:V[4]||(V[4]=ct((...p)=>$e(u)&&$e(u)(...p),["prevent"])),onTouchend:V[5]||(V[5]=(...p)=>$e(f)&&$e(f)(...p))},[Ae(ty,{class:"thread-composer-mic-icon"})],42,lw)):pe("",!0),e.isTurnInProgress?(_(),x("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:rt},[Ae(oy,{class:"thread-composer-stop-icon"})],8,cw)):pe("",!0),w("button",{class:lt(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress}]),type:"button","aria-label":e.isTurnInProgress?"Queue message":"Send message",title:e.isTurnInProgress?"Queue (button) · Enter to steer":"Send",disabled:!Ge.value,onClick:V[6]||(V[6]=p=>Ee(e.isTurnInProgress?"queue":"steer"))},[Ae(Qv,{class:"thread-composer-submit-icon"})],10,uw)])])],2),w("input",{ref_key:"photoLibraryInputRef",ref:b,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:ke.value,onChange:m},null,40,dw),w("input",{ref_key:"cameraCaptureInputRef",ref:M,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:ke.value,onChange:v},null,40,fw)],32))}}),Oa=ze(hw,[["__scopeId","data-v-94976df7"]]),pw={key:0,class:"queued-messages"},mw={class:"queued-messages-inner"},gw={class:"queued-row-text"},vw={class:"queued-row-actions"},yw=["onClick"],ww=["onClick"],bw=kt({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(_(),x("div",pw,[w("div",mw,[(_(!0),x(Fe,null,ht(e.messages,r=>(_(),x("div",{key:r.id,class:"queued-row"},[n[1]||(n[1]=w("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[w("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)),w("span",gw,_e(r.text),1),w("div",vw,[w("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,yw),w("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]=[w("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[w("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,ww)])]))),128))])])):pe("",!0)}}),_w=ze(bw,[["__scopeId","data-v-ea583733"]]),kw={},Tw={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function Sw(e,t){return _(),x("svg",Tw,[...t[0]||(t[0]=[w("circle",{cx:"11",cy:"11",r:"8"},null,-1),w("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const $o=ze(kw,[["render",Sw]]),xw={class:"skill-card-top"},Cw=["src","alt"],Aw={key:1,class:"skill-card-avatar-fallback"},Ew={class:"skill-card-info"},Iw={class:"skill-card-header"},Rw={class:"skill-card-name"},$w={key:0,class:"skill-card-badge-disabled"},Mw={key:1,class:"skill-card-badge"},Pw={class:"skill-card-owner"},Nw={key:0,class:"skill-card-desc"},Ow={key:1,class:"skill-card-date"},jw=kt({__name:"SkillCard",props:{skill:{}},emits:["select"],setup(e){const t=e,n=ce(()=>{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)=>(_(),x("button",{class:lt(["skill-card",{"is-disabled":e.skill.installed&&e.skill.enabled===!1}]),type:"button",onClick:o[0]||(o[0]=i=>s.$emit("select",e.skill))},[w("div",xw,[e.skill.avatarUrl?(_(),x("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,Cw)):(_(),x("div",Aw,_e(e.skill.owner.charAt(0)),1)),w("div",Ew,[w("div",Iw,[w("span",Rw,_e(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(_(),x("span",$w,"Disabled")):e.skill.installed?(_(),x("span",Mw,"Installed")):pe("",!0)]),w("span",Pw,_e(e.skill.owner),1)])]),e.skill.description?(_(),x("p",Nw,_e(e.skill.description),1)):pe("",!0),n.value?(_(),x("span",Ow,_e(n.value),1)):pe("",!0)],2))}}),ja=ze(jw,[["__scopeId","data-v-2a1e8196"]]),Lw={class:"sdm-panel"},Dw={class:"sdm-header"},Bw={class:"sdm-title-area"},Fw=["src","alt"],Hw={class:"sdm-title-col"},Uw={class:"sdm-title-row"},Vw={class:"sdm-title"},qw={key:0,class:"sdm-badge-disabled"},Ww={class:"sdm-owner"},Kw={class:"sdm-body"},Gw={key:0,class:"sdm-desc"},zw={key:1,class:"sdm-readme-loading"},Yw=["innerHTML"],Jw=["href"],Qw={class:"sdm-footer"},Xw={class:"sdm-footer-actions"},Zw=["disabled"],eb=["disabled"],tb=["disabled"],nb=kt({__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=U(null),o=U(""),i=U(!1),a=ce(()=>s.value??n.skill.enabled??!0),l=ce(()=>n.isInstalling===!0||n.isUninstalling===!0),d=ce(()=>{const C=o.value;if(!C)return"";const B=C.replace(/^---[\s\S]*?---\s*/,"");return u(B)});function u(C){return C.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 C=new URLSearchParams({owner:n.skill.owner,name:n.skill.name}),B=await fetch(`/codex-api/skills-hub/readme?${C}`);if(!B.ok)return;const K=await B.json();o.value=K.content??""}catch{}finally{i.value=!1}}}ft(()=>n.visible,C=>{C&&(s.value=null,o.value="",f())});function g(){r("install",n.skill)}function b(){r("uninstall",n.skill)}function M(){const C=!a.value;s.value=C,r("toggle-enabled",n.skill,C)}return(C,B)=>(_(),ot(Cl,{to:"body"},[e.visible?(_(),x("div",{key:0,class:"sdm-overlay",onClick:B[1]||(B[1]=ct(K=>C.$emit("close"),["self"]))},[w("div",Lw,[w("div",Dw,[w("div",Bw,[e.skill.avatarUrl?(_(),x("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,Fw)):pe("",!0),w("div",Hw,[w("div",Uw,[w("h3",Vw,_e(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(_(),x("span",qw,"Disabled")):pe("",!0)]),w("span",Ww,_e(e.skill.owner),1)])]),w("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:B[0]||(B[0]=K=>C.$emit("close"))},[Ae(si,{class:"sdm-close-icon"})])]),w("div",Kw,[e.skill.description?(_(),x("p",Gw,_e(e.skill.description),1)):pe("",!0),i.value?(_(),x("div",zw,"Loading skill contents...")):o.value?(_(),x("div",{key:2,class:"sdm-readme",innerHTML:d.value},null,8,Yw)):pe("",!0),w("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,Jw)]),w("div",Qw,[w("div",Xw,[e.skill.installed?(_(),x("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:b},_e(n.isUninstalling?"Uninstalling...":"Uninstall"),9,Zw)):(_(),x("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:g},_e(n.isInstalling?"Installing...":"Install"),9,eb)),e.skill.installed?(_(),x("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:M},_e(a.value?"Disable":"Enable"),9,tb)):pe("",!0)])])])])):pe("",!0)]))}}),rb=ze(nb,[["__scopeId","data-v-19a385ca"]]),sb={class:"skills-hub"},ob={class:"skills-hub-toolbar"},ib={class:"skills-hub-search-wrap"},ab={key:0,class:"skills-hub-count"},lb={key:1,class:"skills-hub-section"},cb={class:"skills-hub-section-title"},ub={key:0,class:"skills-hub-grid"},db={class:"skills-hub-section"},fb={key:0,class:"skills-hub-loading"},hb={key:1,class:"skills-hub-error"},pb={key:0,class:"skills-hub-grid"},mb={key:1,class:"skills-hub-empty"},os="codex-web-local.skills-hub.cache.v1",gb=kt({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=U(null),s=U(""),o=U("date"),i=U([]),a=U([]),l=U(0),d=U(!1),u=U(""),f=U(!0),g=U(!1),b=U(n),M=U(null),C=U(""),B=U(!1),K=U(!1);let $=null,q=null;const F=t,ae=ce(()=>o.value==="date"?"Newest":"A-Z"),ie=ce(()=>{var ue;return((ue=M.value)==null?void 0:ue.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),le=ce(()=>`${b.value.owner}/${b.value.name}`),de=ce(()=>B.value&&C.value===le.value),oe=ce(()=>K.value&&C.value===le.value),te=ce(()=>{const ue=s.value.toLowerCase().trim();return ue?a.value.filter(Te=>Te.name.toLowerCase().includes(ue)||Te.owner.toLowerCase().includes(ue)||(Te.displayName??"").toLowerCase().includes(ue)):a.value});function fe(ue,Te="success"){M.value={text:ue,type:Te},q&&clearTimeout(q),q=setTimeout(()=>{M.value=null},3e3)}function X(){o.value=o.value==="date"?"name":"date",Ee(s.value)}function Ne(ue){return`${o.value}::${ue.trim().toLowerCase()}`}function We(ue){var Te;if(typeof window>"u")return null;try{const Se=window.localStorage.getItem(os);return Se?((Te=JSON.parse(Se).byKey)==null?void 0:Te[ue])??null:null}catch{return null}}function Ge(ue,Te){if(!(typeof window>"u"))try{const Se=window.localStorage.getItem(os),z=(Se?JSON.parse(Se):{}).byKey??{};z[ue]=Te,window.localStorage.setItem(os,JSON.stringify({byKey:z}))}catch{}}function ke(){if(!(typeof window>"u"))try{window.localStorage.removeItem(os)}catch{}}function Le(ue){const Te=ue.installed??[];a.value=Te;const Se=new Set(Te.map(E=>E.name));i.value=ue.data.map(E=>{if(E.installed||Se.has(E.name)){const z=Te.find(Z=>Z.name===E.name);return{...E,installed:!0,path:(z==null?void 0:z.path)??E.path,enabled:(z==null?void 0:z.enabled)??E.enabled}}return E}).filter(E=>!E.installed),l.value=ue.total}async function Ee(ue){const Te=Ne(ue),Se=We(Te);Se&&Le(Se),d.value=!Se,u.value="";try{const E=new URLSearchParams;ue.trim()&&E.set("q",ue.trim()),E.set("limit","100"),E.set("sort",o.value);const z=await fetch(`/codex-api/skills-hub?${E}`);if(!z.ok)throw new Error(`HTTP ${z.status}`);const Z=await z.json();Le(Z),Ge(Te,Z)}catch(E){u.value=E instanceof Error?E.message:"Failed to load skills"}finally{d.value=!1}}function rt(){$&&clearTimeout($),$=setTimeout(()=>Ee(s.value),300)}function tt(ue){b.value=ue,g.value=!0}async function et(ue){C.value=`${ue.owner}/${ue.name}`,B.value=!0;try{const Se=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:ue.owner,name:ue.name})})).json();if(!Se.ok)throw new Error(Se.error||"Install failed");const E={...ue,installed:!0,path:Se.path,enabled:!0};a.value=[...a.value,E],i.value=i.value.filter(z=>z.name!==ue.name),b.value=E,fe(`${ue.displayName||ue.name} skill installed`),g.value=!1,ke(),F("skills-changed")}catch(Te){fe(Te instanceof Error?Te.message:"Failed to install skill","error")}finally{B.value=!1}}async function qe(ue){C.value=`${ue.owner}/${ue.name}`,K.value=!0;try{const Se=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ue.name,path:ue.path})})).json();if(!Se.ok)throw new Error(Se.error||"Uninstall failed");a.value=a.value.filter(E=>E.name!==ue.name),ue.owner!=="local"&&(i.value=[...i.value,{...ue,installed:!1,path:void 0,enabled:void 0}]),fe(`${ue.displayName||ue.name} skill uninstalled`),g.value=!1,ke(),F("skills-changed")}catch(Te){fe(Te instanceof Error?Te.message:"Failed to uninstall skill","error")}finally{K.value=!1}}async function ut(ue,Te){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:ue.path,enabled:Te}})})).ok)throw new Error("Failed to update skill");fe(`${ue.displayName||ue.name} skill ${Te?"enabled":"disabled"}`),await Ee(s.value)}catch(Se){fe(Se instanceof Error?Se.message:"Failed to update skill","error")}}return Dn(()=>{Ee("")}),(ue,Te)=>(_(),x("div",sb,[Te[3]||(Te[3]=w("div",{class:"skills-hub-header"},[w("h2",{class:"skills-hub-title"},"Skills Hub"),w("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),w("div",ob,[w("div",ib,[Ae($o,{class:"skills-hub-search-icon"}),Nn(w("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":Te[0]||(Te[0]=Se=>s.value=Se),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:rt},null,544),[[jn,s.value]]),l.value>0?(_(),x("span",ab,_e(l.value)+" skills",1)):pe("",!0)]),w("button",{class:"skills-hub-sort",type:"button",onClick:X},_e(ae.value),1)]),M.value?(_(),x("div",{key:0,class:lt(["skills-hub-toast",ie.value])},_e(M.value.text),3)):pe("",!0),te.value.length>0?(_(),x("div",lb,[w("button",{class:"skills-hub-section-toggle",type:"button",onClick:Te[1]||(Te[1]=Se=>f.value=!f.value)},[w("span",cb,"Installed ("+_e(te.value.length)+")",1),Ae(wc,{class:lt(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(_(),x("div",ub,[(_(!0),x(Fe,null,ht(te.value,Se=>(_(),ot(ja,{key:Se.name,skill:Se,onSelect:E=>tt(E)},null,8,["skill","onSelect"]))),128))])):pe("",!0)])):pe("",!0),w("div",db,[d.value?(_(),x("div",fb,"Loading skills...")):u.value?(_(),x("div",hb,_e(u.value),1)):(_(),x(Fe,{key:2},[i.value.length>0?(_(),x("div",pb,[(_(!0),x(Fe,null,ht(i.value,Se=>(_(),ot(ja,{key:Se.url,skill:Se,onSelect:E=>tt(E)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(_(),x("div",mb,'No skills found for "'+_e(s.value)+'"',1)):pe("",!0)],64))]),Ae(rb,{skill:b.value,visible:g.value,"is-installing":de.value,"is-uninstalling":oe.value,onClose:Te[2]||(Te[2]=Se=>g.value=!1),onInstall:et,onUninstall:qe,onToggleEnabled:ut},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),vb=ze(gb,[["__scopeId","data-v-1967b404"]]),yb={},wb={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 bb(e,t){return _(),x("svg",wb,[...t[0]||(t[0]=[w("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),w("path",{d:"M9 4l0 16"},null,-1)])])}const _b=ze(yb,[["render",bb]]),kb={},Tb={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function Sb(e,t){return _(),x("svg",Tb,[...t[0]||(t[0]=[w("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 xb=ze(kb,[["render",Sb]]),Cb={},Ab={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function Eb(e,t){return _(),x("svg",Ab,[...t[0]||(t[0]=[w("path",{d:"M20 11a8.1 8.1 0 0 0-15.5-2m-.5-4v4h4"},null,-1),w("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null,-1)])])}const Ib=ze(Cb,[["render",Eb]]),Rb={class:"sidebar-thread-controls"},$b=["aria-label","title"],Mb=["aria-pressed","aria-label","title"],Pb=kt({__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)=>(_(),x("div",Rb,[w("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?(_(),ot(xb,{key:0,class:"sidebar-thread-controls-icon"})):(_(),ot(_b,{key:1,class:"sidebar-thread-controls-icon"}))],8,$b),w("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"))},[Ae(Ib,{class:"sidebar-thread-controls-icon"})],8,Mb),an(t.$slots,"default",{},void 0),e.showNewThreadButton?(_(),x("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"))},[Ae(bs,{class:"sidebar-thread-controls-icon"})])):pe("",!0)]))}}),La=ze(Pb,[["__scopeId","data-v-57866500"]]);function Mn(e){return e.flatMap(t=>t.threads)}const kc="codex-web-local.thread-read-state.v1",Tc="codex-web-local.thread-scroll-state.v1",Mo="codex-web-local.selected-thread-id.v1",Sc="codex-web-local.project-order.v1",xc="codex-web-local.project-display-name.v1",Cc="codex-web-local.auto-refresh-enabled.v1",io=220,Rr=4e3,Da=["none","minimal","low","medium","high","xhigh"],$r="__global__";function Nb(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(kc);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function Ba(e){typeof window>"u"||window.localStorage.setItem(kc,JSON.stringify(e))}function Ob(){return typeof window>"u"?!1:window.localStorage.getItem(Cc)==="1"}function Fa(e){typeof window>"u"||window.localStorage.setItem(Cc,e?"1":"0")}function Ac(e,t,n){return Math.min(Math.max(e,t),n)}function jb(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=Ac(t.scrollRatio,0,1)),n}function Lb(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Tc);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=jb(s);o&&(n[r]=o)}return n}catch{return{}}}function Ha(e){typeof window>"u"||window.localStorage.setItem(Tc,JSON.stringify(e))}function Db(){return typeof window>"u"?"":window.localStorage.getItem(Mo)??""}function Bb(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(Mo);return}window.localStorage.setItem(Mo,e)}}function Fb(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Sc);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 cr(e){typeof window>"u"||window.localStorage.setItem(Sc,JSON.stringify(e))}function Hb(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(xc);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 ao(e){typeof window>"u"||window.localStorage.setItem(xc,JSON.stringify(e))}function is(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 Xn(e,n)?e:n}function lo(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 Xn(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 Ub(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 Vb(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function Po(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&Xn(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&Vb(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function _s(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 qb(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&&Po(f,u)?f:u});if(n.preserveMissing!==!0)return _s(e,o)?e:o;const i=e.map(u=>{const f=s.get(u.id);return!f||Po(u,f)?u:f}),a=new Set(e.map(u=>u.id)),l=o.filter(u=>!a.has(u.id)),d=[...i,...l];return _s(e,d)?e:d}function No(e){return e.replace(/\s+/gu," ").trim()}function Wb(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>No(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=No(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function Ua(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(Po(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const Ec="worked";function En(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function Kb(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 Gb(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function zb(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 Yb(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${Kb(e.durationMs)}`,messageType:Ec}}function Jb(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function Qb(e,t){const n=Yb(t),r=e.filter(i=>i.messageType!==Ec),s=Jb(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function Tt(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function Xb(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 Zb(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 e0(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 St(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function as(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&&Xb(d,l)?d:l});return o&&o.projectName===s.projectName&&Zb(o.threads,a)?o:{projectName:s.projectName,threads:a}});return e0(e,r)?e:r}function t0(e,t,n){const r=new Set(Mn(t).map(a=>a.id)),s=Mn(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 n0(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function co(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function r0(e){const t=e.split(`
43
- `).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function s0(){const e=U([]),t=U([]),n=U(Db()),r=U({}),s=U({}),o=U({}),i=U({}),a=U({}),l=U({}),d=U({}),u=U([]),f=U(""),g=U("medium"),b=U(Nb()),M=U(Lb()),C=U(Fb()),B=U(Hb()),K=U({}),$=U({}),q=U({}),F=U({}),ae=U({}),ie=U({}),le=U({}),de=U({}),oe=U({}),te=U([]),fe=U(!1),X=U(!1),Ne=U(!1),We=U(!1),Ge=U(!1),ke=U(""),Le=U(!1),Ee=U(!1),rt=U(Ob()),tt=U(Math.floor(Rr/1e3));let et=null,qe=null,ut=null,ue=null,Te=!1;const Se=new Set;let E=!1,z=!1;const Z=new Map,he=ce(()=>Mn(e.value)),Re=ce(()=>he.value.find(c=>c.id===n.value)??null),m=ce(()=>M.value[n.value]??null),v=ce(()=>{const c=[],h=n.value;return h&&Array.isArray(de.value[h])&&c.push(...de.value[h]),Array.isArray(de.value[$r])&&c.push(...de.value[$r]),c.sort((y,k)=>y.receivedAtIso.localeCompare(k.receivedAtIso))}),S=ce(()=>{var W;const c=n.value;if(!c)return null;const h=ae.value[c],y=(o.value[c]??"").trim(),k=(((W=ie.value[c])==null?void 0:W.message)??"").trim();return!h&&!y&&!k?null:{activityLabel:(h==null?void 0:h.label)||"Thinking",activityDetails:(h==null?void 0:h.details)??[],reasoningText:y,errorText:k}}),L=ce(()=>{const c=n.value;if(!c)return[];const h=r.value[c]??[],y=s.value[c]??[],k=i.value[c]??[],W=[...h,...k,...y],j=F.value[c];return j?Qb(W,j):W});function H(c){n.value!==c&&(n.value=c,Bb(c),z=!1)}function O(c){f.value=c.trim()}function re(c){c&&!Da.includes(c)||(g.value=c)}function ee(c,h){const y=c.trim()||"default",k=h||"default";return[`Model: ${y}`,`Thinking: ${k}`]}async function Q(){try{const[c,h]=await Promise.all([Lv(),Dv()]);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&&Da.includes(h.reasoningEffort)&&(g.value=h.reasoningEffort)}catch{}}function G(c){const h=oe.value;return Object.keys(h).length===0?c:c.map(y=>({projectName:y.projectName,threads:y.threads.map(k=>{const W=h[k.id];return W?{...k,title:W}:k})}))}function ne(){const h=G(t.value).map(y=>({projectName:y.projectName,threads:y.threads.map(k=>{const W=a.value[k.id]===!0,j=n.value===k.id,be=b.value[k.id],Pe=d.value[k.id]===!0,Ie=!j&&!W&&(Pe||be!==k.updatedAtIso);return{...k,inProgress:W,unread:Ie}})}));e.value=as(e.value,h)}function se(c,h,y){const k=new Date().toISOString(),W=h.trim(),j=n0(W),be={id:c,title:r0(y),projectName:j,cwd:W,hasWorktree:W.includes("/.codex/worktrees/")||W.includes("/.git/worktrees/"),createdAtIso:k,updatedAtIso:k,preview:y,unread:!1,inProgress:!1},Pe=t.value.findIndex(st=>st.projectName===j);if(Pe>=0){const Dt=t.value[Pe].threads.filter(Vn=>Vn.id!==c),Un={projectName:j,threads:[be,...Dt]},xn=[...t.value];xn.splice(Pe,1,Un),t.value=xn}else t.value=[{projectName:j,threads:[be]},...t.value];const Ie=is(C.value,t.value);Xn(C.value,Ie)||(C.value=Ie,cr(C.value)),ne()}function ye(c){const h=new Set(c.map(j=>j.id)),y=St(b.value,h);y!==b.value&&(b.value=y,Ba(y));const k=St(M.value,h);k!==M.value&&(M.value=k,Ha(k)),$.value=St($.value,h),K.value=St(K.value,h),q.value=St(q.value,h),r.value=St(r.value,h),s.value=St(s.value,h),o.value=St(o.value,h),i.value=St(i.value,h),F.value=St(F.value,h),ae.value=St(ae.value,h),ie.value=St(ie.value,h),le.value=St(le.value,h),d.value=St(d.value,h),a.value=St(a.value,h);const W={};for(const[j,be]of Object.entries(de.value))(j===$r||h.has(j))&&(W[j]=be);de.value=W}function xe(c){const h=Mn(t.value).find(y=>y.id===c);h&&(b.value={...b.value,[c]:h.updatedAtIso},Ba(b.value),d.value[c]&&(d.value=Tt(d.value,c)),ne())}function Me(c,h){if(!c)return;const y=F.value[c];if(h){if(Gb(y,h))return;F.value={...F.value,[c]:h}}else y&&(F.value=Tt(F.value,c))}function je(c,h){!c||a.value[c]===!0===h||(h?a.value={...a.value,[c]:!0}:a.value=Tt(a.value,c),ne())}function Be(c){c&&c!==n.value&&d.value[c]!==!0&&(d.value={...d.value,[c]:!0},ne())}function Ue(c,h){if(!c)return;const y=ae.value[c];if(!h){y&&(ae.value=Tt(ae.value,c));return}const k=en(h.label)||"Thinking",W=h.details.map(Pe=>en(Pe)).filter(Pe=>Pe.length>0&&Pe!==k),j=Array.from(new Set([...(y==null?void 0:y.details)??[],...W])).slice(-3),be={label:k,details:j};zb(y,be)||(ae.value={...ae.value,[c]:be})}function N(c,h){if(!c)return;const y=ie.value[c],k=h?No(h):"";if(!k){y&&(ie.value=Tt(ie.value,c));return}(y==null?void 0:y.message)!==k&&(ie.value={...ie.value,[c]:{message:k}})}function V(c){const h=Mn(t.value).find(y=>y.id===c);return(h==null?void 0:h.updatedAtIso)??""}function p(c,h){if(!c)return;const y={scrollTop:Math.max(0,h.scrollTop),isAtBottom:h.isAtBottom===!0};typeof h.scrollRatio=="number"&&Number.isFinite(h.scrollRatio)&&(y.scrollRatio=Ac(h.scrollRatio,0,1));const k=M.value[c];k&&k.scrollTop===y.scrollTop&&k.isAtBottom===y.isAtBottom&&k.scrollRatio===y.scrollRatio||(M.value={...M.value,[c]:y},Ha(M.value))}function A(c,h){const y=r.value[c]??[];_s(y,h)||(r.value={...r.value,[c]:h})}function I(c,h){const y=s.value[c]??[];_s(y,h)||(s.value={...s.value,[c]:h})}function Y(c,h){const y=s.value[c]??[],k=Ua(y,h);I(c,k)}function ve(c,h){if(!c)return;const y=h.trim(),k=o.value[c]??"";if(y.length===0){if(!k)return;o.value=Tt(o.value,c);return}k!==y&&(o.value={...o.value,[c]:y})}function Ce(c,h){if(!c)return;const y=o.value[c]??"";ve(c,`${y}${h}`)}function Ye(c){c&&c in o.value&&(o.value=Tt(o.value,c))}function we(c){return c!==null&&typeof c=="object"&&!Array.isArray(c)?c:null}function me(c){return typeof c=="string"?c:""}function dt(c){return typeof c=="number"&&Number.isFinite(c)?c:null}function yt(c){const h=we(c.params);if(!h)return"";const y=me(h.threadId);if(y)return y;const k=me(h.thread_id);if(k)return k;const W=me(h.conversationId);if(W)return W;const j=me(h.conversation_id);if(j)return j;const be=we(h.thread),Pe=me(be==null?void 0:be.id);if(Pe)return Pe;const Ie=we(h.turn),st=me(Ie==null?void 0:Ie.threadId);if(st)return st;const Dt=me(Ie==null?void 0:Ie.thread_id);return Dt||""}function Zt(c){if(c.method!=="turn/completed")return"";const h=we(c.params),y=we(h==null?void 0:h.turn);if(!y||y.status!=="failed")return"";const k=we(y.error);return me(k==null?void 0:k.message)}function kn(c){const h=we(c);if(!h)return null;const y=h.id,k=me(h.method),W=h.params;if(typeof y!="number"||!Number.isInteger(y)||!k)return null;const j=we(W),be=me(j==null?void 0:j.threadId)||$r,Pe=me(j==null?void 0:j.turnId),Ie=me(j==null?void 0:j.itemId),st=me(h.receivedAtIso)||new Date().toISOString();return{id:y,method:k,threadId:be,turnId:Pe,itemId:Ie,receivedAtIso:st,params:W??null}}function Fn(c){const h=c.threadId||$r,y=de.value[h]??[],k=y.findIndex(j=>j.id===c.id),W=[...y];k>=0?W.splice(k,1,c):W.push(c),de.value={...de.value,[h]:W.sort((j,be)=>j.receivedAtIso.localeCompare(be.receivedAtIso))}}function Rt(c){const h={};for(const[y,k]of Object.entries(de.value)){const W=k.filter(j=>j.id!==c);W.length>0&&(h[y]=W)}de.value=h}function rr(c){if(c.method==="server/request"){const h=kn(c.params);return h&&Fn(h),!0}if(c.method==="server/request/resolved"){const h=we(c.params),y=h==null?void 0:h.id;return typeof y=="number"&&Number.isInteger(y)&&Rt(y),!0}return!1}function en(c){return c.replace(/\s+/gu," ").trim()}function kr(c){const h=yt(c);if(!h)return null;if(c.method==="turn/started")return{threadId:h,activity:{label:"Thinking",details:[]}};if(c.method==="item/started"){const y=we(c.params),k=we(y==null?void 0:y.item),W=me(k==null?void 0:k.type).toLowerCase();if(W==="reasoning")return{threadId:h,activity:{label:"Thinking",details:[]}};if(W==="agentmessage")return{threadId:h,activity:{label:"Writing response",details:[]}};if(W==="commandexecution"){const j=me(k==null?void 0:k.command);return{threadId:h,activity:{label:"Running command",details:j?[j]:[]}}}}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 Tr(c){if(c.method!=="turn/started")return null;const h=we(c.params);if(!h)return null;const y=yt(c);if(!y)return null;const k=we(h.turn),W=me(k==null?void 0:k.id)||me(h.turnId)||`${y}:unknown`;if(!W)return null;const j=En(me(k==null?void 0:k.startedAt))??En(me(h.startedAt))??En(c.atIso)??Date.now();return{threadId:y,turnId:W,startedAtMs:j}}function Sr(c){if(c.method!=="turn/completed")return null;const h=we(c.params);if(!h)return null;const y=yt(c);if(!y)return null;const k=we(h.turn),W=me(k==null?void 0:k.id)||me(h.turnId)||`${y}:unknown`;if(!W)return null;const j=En(me(k==null?void 0:k.completedAt))??En(me(h.completedAt))??En(c.atIso)??Date.now(),be=En(me(k==null?void 0:k.startedAt))??En(me(h.startedAt))??void 0;return{threadId:y,turnId:W,completedAtMs:j,startedAtMs:be}}function cn(c){return`${c}:live-reasoning`}function Tn(c){const h=we(c.params);if(!h)return"";if(c.method==="item/started"){const y=we(h.item);return!y||y.type!=="reasoning"?"":me(y.id)}return""}function T(c){const h=we(c.params);if(!h)return null;if(c.method==="item/reasoning/summaryTextDelta"){const y=me(h.itemId),k=me(h.delta);return!y||!k?null:{messageId:cn(y),delta:k}}return null}function R(c){const h=we(c.params);if(!h)return"";if(c.method==="item/reasoning/summaryPartAdded"){const y=me(h.itemId);return y?cn(y):""}return""}function P(c){const h=we(c.params);if(!h)return"";if(c.method==="item/completed"){const y=we(h.item);return!y||y.type!=="reasoning"?"":cn(me(y.id))}return""}function J(c){const h=we(c.params);if(!h)return"";if(c.method==="item/started"){const y=we(h.item);return!y||y.type!=="agentMessage"?"":me(y.id)}return""}function Ve(c){const h=we(c.params);if(!h)return null;if(c.method==="item/agentMessage/delta"){const y=me(h.itemId),k=me(h.delta);return!y||!k?null:{messageId:y,delta:k}}return null}function vt(c){const h=we(c.params);if(!h)return null;if(c.method==="item/completed"){const y=we(h.item);if(!y||y.type!=="agentMessage")return null;const k=me(y.id),W=me(y.text);return!k||!W?null:{id:k,role:"assistant",text:W,messageType:"agentMessage.live"}}return null}function Nt(c){if(c.method!=="item/started")return null;const h=we(c.params),y=we(h==null?void 0:h.item);if(!y||y.type!=="commandExecution")return null;const k=me(y.id),W=me(y.command);if(!k)return null;const j=typeof y.cwd=="string"?y.cwd:null;return{id:k,role:"system",text:W,messageType:"commandExecution",commandExecution:{command:W,cwd:j,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function sr(c){if(c.method!=="item/commandExecution/outputDelta")return null;const h=we(c.params);if(!h)return null;const y=me(h.itemId),k=me(h.delta);return!y||!k?null:{itemId:y,delta:k}}function or(c){if(c.method!=="item/completed")return null;const h=we(c.params),y=we(h==null?void 0:h.item);if(!y||y.type!=="commandExecution")return null;const k=me(y.id),W=me(y.command);if(!k)return null;const j=typeof y.cwd=="string"?y.cwd:null,be=me(y.status),Pe=be==="failed"?"failed":be==="declined"?"declined":be==="interrupted"?"interrupted":"completed",Ie=typeof y.aggregatedOutput=="string"?y.aggregatedOutput:"",st=typeof y.exitCode=="number"?y.exitCode:null;return{id:k,role:"system",text:W,messageType:"commandExecution",commandExecution:{command:W,cwd:j,status:Pe,aggregatedOutput:Ie,exitCode:st}}}function Ot(c,h){const y=i.value[c]??[],k=Ua(y,h);k!==y&&(i.value={...i.value,[c]:k})}function Sn(c,h){const y=i.value[c];if(!y||y.length===0)return;const k=new Set(h.map(j=>j.id)),W=y.filter(j=>!k.has(j.id));W.length!==y.length&&(W.length===0?i.value=Tt(i.value,c):i.value={...i.value,[c]:W})}function ir(c){if(c.method==="item/agentMessage/delta")return!0;const h=we(c.params);if(!h)return!1;if(c.method==="item/completed"){const y=we(h.item);return(y==null?void 0:y.type)==="agentMessage"}return!1}function xr(c){var Vn,fi,hi,pi;if(rr(c))return;if(c.method==="thread/name/updated"){const Ke=we(c.params),tn=me(Ke==null?void 0:Ke.threadId),qn=me(Ke==null?void 0:Ke.threadName);tn&&qn&&(oe.value={...oe.value,[tn]:qn},ne(),Na(tn,qn))}const h=kr(c);h&&Ue(h.threadId,h.activity);const y=Tr(c);y&&(Z.set(y.turnId,y),le.value={...le.value,[y.threadId]:y.turnId},Me(y.threadId,null),N(y.threadId,null),je(y.threadId,!0),d.value[y.threadId]&&(d.value=Tt(d.value,y.threadId)));const k=Sr(c);if(k){const Ke=Z.get(k.turnId);Ke&&Z.delete(k.turnId);const tn=dt((Vn=we(c.params))==null?void 0:Vn.durationMs)??dt((hi=we((fi=we(c.params))==null?void 0:fi.turn))==null?void 0:hi.durationMs)??(typeof k.startedAtMs=="number"?k.completedAtMs-k.startedAtMs:null)??(Ke?k.completedAtMs-Ke.startedAtMs:null),qn=typeof tn=="number"?Math.max(0,tn):0;Me(k.threadId,{turnId:k.turnId,durationMs:qn}),le.value[k.threadId]&&(le.value=Tt(le.value,k.threadId)),je(k.threadId,!1),Ue(k.threadId,null),Be(k.threadId),ai(k.threadId)}const W=Zt(c);if(W){const Ke=(k==null?void 0:k.threadId)||yt(c);Ke&&N(Ke,W),ke.value=W}else k&&N(k.threadId,null);const j=yt(c);if(!j||j!==n.value)return;J(c);const be=Ve(c);if(be){const Ke=(s.value[j]??[]).find(qn=>qn.id===be.messageId),tn=`${(Ke==null?void 0:Ke.text)??""}${be.delta}`;Y(j,{id:be.messageId,role:"assistant",text:tn,messageType:"agentMessage.live"})}const Pe=vt(c);Pe&&Y(j,Pe),Tn(c);const Ie=T(c);if(Ie&&Ce(j,Ie.delta),R(c)){const Ke=o.value[j]??"";Ke.trim().length>0&&!Ke.endsWith(`
44
-
45
- `)&&ve(j,`${Ke}
46
-
47
- `)}P(c);const Dt=Nt(c);Dt&&(Ot(j,Dt),Ue(j,{label:"Running command",details:[((pi=Dt.commandExecution)==null?void 0:pi.command)??""]}));const Un=sr(c);if(Un){const Ke=(i.value[j]??[]).find(tn=>tn.id===Un.itemId);Ke!=null&&Ke.commandExecution&&Ot(j,{...Ke,commandExecution:{...Ke.commandExecution,aggregatedOutput:`${Ke.commandExecution.aggregatedOutput}${Un.delta}`}})}const xn=or(c);if(xn&&Ot(j,xn),ir(c)&&(z&&n.value&&p(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),Ye(j)),c.method==="turn/completed"){z=!1,Ye(j),i.value[j]&&(i.value=Tt(i.value,j));const Ke=yt(c);Ke&&(je(Ke,!1),Ue(Ke,null),Be(Ke),ai(Ke))}}function Zr(c){const h=yt(c);h&&Se.add(h);const y=c.method;(y.startsWith("thread/")||y.startsWith("turn/")||y.startsWith("item/"))&&(Te=!0),!(qe!==null||typeof window>"u")&&(qe=window.setTimeout(()=>{qe=null,Hn()},io))}async function Ls(c){if(!E){E=!0;try{const h=await Ma(),y=[];for(const k of h.order){const W=co(k);y.includes(W)||y.push(W)}if(y.length>0){const k=is(y,c);Xn(C.value,k)||(C.value=k,cr(C.value))}if(Object.keys(h.labels).length>0){const k={...B.value};let W=!1;for(const[j,be]of Object.entries(h.labels)){const Pe=co(j);k[Pe]!==be&&(k[Pe]=be,W=!0)}W&&(B.value=k,ao(k))}}catch{}}}async function D(){if(!(Object.keys(oe.value).length>0))try{const c=await qv();Object.keys(c.titles).length>0&&(oe.value=c.titles)}catch{}}async function ge(c,h,y){if(oe.value[c])return;const k=h.trim();if(!k)return;const W=k.length>300?k.slice(0,300):k;try{const j=await Wv(W,y);if(!j||oe.value[c])return;oe.value={...oe.value,[c]:j},ne(),Na(c,j)}catch{}}async function De(){var c;Ee.value||(fe.value=!0);try{const[h]=await Promise.all([Cv(),D()]);await Ls(h);const y=is(C.value,h);Xn(C.value,y)||(C.value=y,cr(C.value));const k=lo(h,C.value),W=t0(t.value,k,a.value);t.value=as(t.value,W),a.value=St(a.value,new Set(Mn(t.value).map(Pe=>Pe.id))),ne(),Ee.value=!0;const j=Mn(e.value);ye(j),j.some(Pe=>Pe.id===n.value)||H(((c=j[0])==null?void 0:c.id)??"")}finally{fe.value=!1}}async function gt(c,h={}){if(!c)return;const y=$.value[c]===!0,k=h.silent!==!0&&!y;k&&(X.value=!0);try{q.value[c]!==!0&&(await Ra(c),q.value={...q.value,[c]:!0});const W=await Av(c),j=r.value[c]??[],be=qb(j,W,{preserveMissing:h.silent===!0});A(c,be);const Pe=s.value[c]??[],Ie=Wb(Pe,W);I(c,Ie),Sn(c,W),$.value={...$.value,[c]:!0};const st=V(c);st&&(K.value={...K.value,[c]:st}),xe(c)}finally{k&&(X.value=!1)}}async function jt(){try{const c=t.value.flatMap(h=>h.threads.map(y=>y.cwd)).filter(Boolean);te.value=await Kv(c.length>0?[...new Set(c)]:void 0)}catch{}}async function Kt(){ke.value="";try{await De(),await Promise.all([Q(),jt()]),await gt(n.value)}catch(c){ke.value=c instanceof Error?c.message:"Unknown application error"}}async function ar(c){H(c);try{await gt(c)}catch(h){ke.value=h instanceof Error?h.message:"Unknown application error"}}async function Ic(c){try{await $v(c),await De(),n.value===c&&await gt(n.value)}catch(h){ke.value=h instanceof Error?h.message:"Unknown application error"}}async function Ds(c,h=[],y=[],k="steer",W=[]){const j=n.value,be=c.trim();if(!j||!be&&h.length===0&&W.length===0)return;const Pe=a.value[j]===!0;if(Pe&&k==="queue"){const Ie=l.value[j]??[],st=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[j]:[...Ie,{id:st,text:be,imageUrls:h,skills:y,fileAttachments:W}]};return}if(Pe){z=!0,es(j,be,h,y,W).catch(Ie=>{const st=Ie instanceof Error?Ie.message:"Unknown application error";N(j,st),ke.value=st});return}ke.value="",z=!0,Me(j,null),Ue(j,{label:"Thinking",details:ee(f.value,g.value)}),N(j,null),je(j,!0);try{await es(j,be,h,y,W)}catch(Ie){z=!1,je(j,!1),Ue(j,null);const st=Ie instanceof Error?Ie.message:"Unknown application error";throw N(j,st),ke.value=st,Ie}}async function Rc(c,h,y=[],k=[],W=[]){const j=c.trim(),be=h.trim(),Pe=f.value.trim();if(!j&&y.length===0&&W.length===0)return"";Ne.value=!0,ke.value="";let Ie="";try{if(Ie=await Pv(be||void 0,Pe||void 0),!Ie)return"";se(Ie,be,j||"[Image]"),q.value={...q.value,[Ie]:!0},H(Ie),z=!0,Me(Ie,null),Ue(Ie,{label:"Thinking",details:ee(f.value,g.value)}),N(Ie,null),je(Ie,!0);const st=Ie,Dt=be||null,Un=j;return es(Ie,j,y,k,W).catch(xn=>{z=!1,je(Ie,!1),Ue(Ie,null);const Vn=xn instanceof Error?xn.message:"Unknown application error";N(Ie,Vn),ke.value=Vn}).finally(()=>{Ne.value=!1}),ge(st,Un,Dt),Ie}catch(st){z=!1,Ie&&(je(Ie,!1),Ue(Ie,null));const Dt=st instanceof Error?st.message:"Unknown application error";throw Ie&&N(Ie,Dt),ke.value=Dt,Ne.value=!1,st}}async function es(c,h,y=[],k=[],W=[]){const j=f.value.trim(),be=g.value;try{q.value[c]!==!0&&await Ra(c),await Ov(c,h,y,j||void 0,be||void 0,k.length>0?k:void 0,W),q.value={...q.value,[c]:!0},Se.add(c),Te=!0,await Hn()}catch(Pe){throw Pe}}async function ai(c){const h=l.value[c];if(!h||h.length===0)return;const[y,...k]=h;l.value=k.length>0?{...l.value,[c]:k}:Tt(l.value,c),Ne.value=!0,ke.value="",z=!0,Me(c,null),Ue(c,{label:"Thinking",details:ee(f.value,g.value)}),N(c,null),je(c,!0);try{await es(c,y.text,y.imageUrls,y.skills,y.fileAttachments)}catch{je(c,!1),Ue(c,null)}finally{Ne.value=!1}}async function $c(){const c=n.value;c&&await li(c)}async function li(c){if(!c||a.value[c]!==!0)return;const h=le.value[c];We.value=!0,ke.value="";try{await jv(c,h),je(c,!1),Ue(c,null),N(c,null),le.value[c]&&(le.value=Tt(le.value,c)),Se.add(c),Te=!0,await Hn()}catch(y){const k=y instanceof Error?y.message:"Failed to interrupt active turn";N(c,k),ke.value=k}finally{We.value=!1}}async function Mc(c){const h=n.value;if(!h||Ge.value)return;const k=(r.value[h]??[]).reduce((j,be)=>typeof be.turnIndex=="number"&&be.turnIndex>j?be.turnIndex:j,-1);if(k<0||c>k)return;const W=k-c+1;if(!(W<1)){Ge.value=!0,ke.value="";try{const j=await $a(h,W);A(h,j),I(h,[]),Ye(h),i.value[h]&&(i.value=Tt(i.value,h)),Me(h,null),Ue(h,null),N(h,null),Te=!0,await Hn()}catch(j){ke.value=j instanceof Error?j.message:"Failed to rollback thread"}finally{Ge.value=!1}}}function Pc(c){return(r.value[c]??[]).reduce((y,k)=>typeof k.turnIndex=="number"&&k.turnIndex>y?k.turnIndex:y,-1)}async function Nc(c){if(!(!c||Ge.value||Pc(c)<0)){Ge.value=!0,ke.value="";try{const y=await $a(c,1);A(c,y),I(c,[]),Ye(c),i.value[c]&&(i.value=Tt(i.value,c)),Me(c,null),Ue(c,null),N(c,null),Te=!0,await Hn()}catch(y){ke.value=y instanceof Error?y.message:"Failed to rollback thread"}finally{Ge.value=!1}}}async function Oc(c,h=[],y=[],k=[]){const W=n.value,j=c.trim();!W||!j&&h.length===0&&k.length===0||(a.value[W]===!0&&(await li(W),await Nc(W)),await Ds(j,h,y,"steer",k))}function jc(c,h){c.length===0||(B.value[c]??"")===h||(B.value={...B.value,[c]:h},ao(B.value))}function Lc(c){var W;if(c.length===0)return;const h=C.value.filter(j=>j!==c);if(Xn(C.value,h)||(C.value=h,cr(C.value)),t.value=t.value.filter(j=>j.projectName!==c),B.value[c]!==void 0){const j={...B.value};delete j[c],B.value=j,ao(j)}ne();const y=Mn(e.value);ye(y),y.some(j=>j.id===n.value)||H(((W=y[0])==null?void 0:W.id)??""),Bs()}function Dc(c,h){if(c.length===0||t.value.length===0)return;const y=t.value.map(Ie=>Ie.projectName),k=y.indexOf(c);if(k===-1)return;const W=Math.max(0,Math.min(h,y.length-1)),j=Ub(y,k,W);if(j===y)return;const be=is(j,t.value);C.value=be,cr(C.value);const Pe=lo(t.value,C.value);t.value=as(t.value,Pe),ne(),Bs()}function Bc(c){const h=c.trim();if(!h)return;const y=[h,...C.value.filter(W=>W!==h)];if(Xn(C.value,y))return;C.value=y,cr(C.value);const k=lo(t.value,C.value);t.value=as(t.value,k),ne(),Bs()}async function Bs(){var c,h;try{const y=await Ma(),k=new Map;for(const be of y.order){const Pe=co(be);k.has(Pe)||k.set(Pe,be)}for(const be of t.value){const Pe=((h=(c=be.threads[0])==null?void 0:c.cwd)==null?void 0:h.trim())??"";Pe&&k.set(be.projectName,Pe)}const W=[];for(const be of C.value){const Pe=k.get(be);Pe&&!W.includes(Pe)&&W.push(Pe)}for(const be of y.order)W.includes(be)||W.push(be);const j=y.active.filter(be=>W.includes(be));j.length===0&&W.length>0&&j.push(W[0]),await Fv({order:W,labels:y.labels,active:j})}catch{}}async function Fc(){if(!Le.value){Le.value=!0;try{if(await De(),!n.value)return;const c=n.value,h=V(c),y=K.value[c]??"",k=h.length>0&&h!==y;(a.value[c]===!0||k)&&await gt(c,{silent:!0})}catch{}finally{Le.value=!1}}}async function Hn(){if(Le.value){typeof window<"u"&&qe===null&&(qe=window.setTimeout(()=>{qe=null,Hn()},io));return}Le.value=!0;const c=Te,h=new Set(Se);Te=!1,Se.clear();try{c&&await De();const y=n.value;if(!y)return;const k=h.has(y),W=a.value[y]===!0,j=V(y),be=K.value[y]??"",Pe=j.length>0&&j!==be;(k||W||Pe||c)&&await gt(y,{silent:!0})}catch{}finally{Le.value=!1,(Te||Se.size>0)&&typeof window<"u"&&qe===null&&(qe=window.setTimeout(()=>{qe=null,Hn()},io))}}function Hc(){typeof window>"u"||et||(rt.value&&ui(),Uc(),et=Ev(c=>{xr(c),Zr(c)}))}async function Uc(){try{const c=await Rv();for(const h of c){const y=kn(h);y&&Fn(y)}}catch{}}async function Vc(c){try{await Iv(c.id,{result:c.result,error:c.error}),Rt(c.id)}catch(h){ke.value=h instanceof Error?h.message:"Failed to reply to server request"}}function ci(c={}){const h=c.updatePreference??!0;ut!==null&&typeof window<"u"&&(window.clearInterval(ut),ut=null),ue!==null&&typeof window<"u"&&(window.clearInterval(ue),ue=null),h&&(rt.value=!1,Fa(!1)),tt.value=Math.floor(Rr/1e3)}function ui(){typeof window>"u"||ut!==null||ue!==null||(rt.value=!0,Fa(!0),tt.value=Math.floor(Rr/1e3),ut=window.setInterval(()=>{tt.value=Math.floor(Rr/1e3),Fc()},Rr),ue=window.setInterval(()=>{tt.value=Math.max(0,tt.value-1)},1e3))}function qc(){if(rt.value){ci();return}ui()}function Wc(){ci({updatePreference:!1}),et&&(et(),et=null),Te=!1,Se.clear(),Z.clear(),qe!==null&&typeof window<"u"&&(window.clearTimeout(qe),qe=null),z=!1,r.value={},s.value={},o.value={},i.value={},ae.value={},F.value={},ie.value={},le.value={},l.value={}}const Kc=ce(()=>{const c=n.value;return c?l.value[c]??[]:[]});function di(c){const h=n.value;if(!h)return;const y=l.value[h];if(!y)return;const k=y.filter(W=>W.id!==c);l.value=k.length>0?{...l.value,[h]:k}:Tt(l.value,h)}function Gc(c){const h=n.value;if(!h)return;const y=l.value[h];if(!y)return;const k=y.find(W=>W.id===c);k&&(di(c),Ds(k.text,k.imageUrls,k.skills,"steer",k.fileAttachments))}return{projectGroups:e,projectDisplayNameById:B,selectedThread:Re,selectedThreadScrollState:m,selectedThreadServerRequests:v,selectedLiveOverlay:S,selectedThreadId:n,availableModelIds:u,selectedModelId:f,selectedReasoningEffort:g,installedSkills:te,messages:L,isLoadingThreads:fe,isLoadingMessages:X,isSendingMessage:Ne,isInterruptingTurn:We,isAutoRefreshEnabled:rt,autoRefreshSecondsLeft:tt,error:ke,refreshAll:Kt,refreshSkills:jt,selectThread:ar,setThreadScrollState:p,archiveThreadById:Ic,sendMessageToSelectedThread:Ds,sendDictationMessageToSelectedThread:Oc,sendMessageToNewThread:Rc,interruptSelectedThreadTurn:$c,rollbackSelectedThread:Mc,isRollingBack:Ge,selectedThreadQueuedMessages:Kc,removeQueuedMessage:di,steerQueuedMessage:Gc,setSelectedModelId:O,setSelectedReasoningEffort:re,respondToPendingServerRequest:Vc,renameProject:jc,removeProject:Lc,reorderProject:Dc,pinProjectToTop:Bc,toggleAutoRefreshTimer:qc,startPolling:Hc,stopPolling:Wc}}const o0="0.1.14",i0={version:o0},a0={class:"sidebar-root"},l0=["aria-pressed"],c0={key:1,class:"sidebar-search-bar"},u0={class:"content-root"},d0={class:"content-body"},f0={key:1,class:"content-grid"},h0={class:"new-thread-empty"},p0={key:2,class:"content-grid"},m0={class:"content-thread"},g0={class:"composer-with-queue"},v0={class:"build-badge","aria-label":"Worktree name"},Va="codex-web-local.sidebar-collapsed.v1",y0=kt({__name:"App",setup(e){const t="7f44",n=i0.version,{projectGroups:r,projectDisplayNameById:s,selectedThread:o,selectedThreadScrollState:i,selectedThreadServerRequests:a,selectedLiveOverlay:l,selectedThreadId:d,availableModelIds:u,selectedModelId:f,selectedReasoningEffort:g,installedSkills:b,messages:M,isLoadingThreads:C,isLoadingMessages:B,isInterruptingTurn:K,isAutoRefreshEnabled:$,autoRefreshSecondsLeft:q,refreshAll:F,refreshSkills:ae,selectThread:ie,setThreadScrollState:le,archiveThreadById:de,sendMessageToSelectedThread:oe,sendDictationMessageToSelectedThread:te,sendMessageToNewThread:fe,interruptSelectedThreadTurn:X,rollbackSelectedThread:Ne,isRollingBack:We,selectedThreadQueuedMessages:Ge,removeQueuedMessage:ke,steerQueuedMessage:Le,setSelectedModelId:Ee,setSelectedReasoningEffort:rt,respondToPendingServerRequest:tt,renameProject:et,removeProject:qe,reorderProject:ut,pinProjectToTop:ue,toggleAutoRefreshTimer:Te,startPolling:Se,stopPolling:E}=s0(),z=Ph(),Z=Mh(),{isMobile:he}=yc(),Re=U(!1),m=U(!1),v=U(""),S=U(Ot()),L=U(""),H=U(!1),O=U(null),re=U("New Project (1)"),ee=U(""),Q=ce(()=>{const D=z.params.threadId;return typeof D=="string"?D:""}),G=ce(()=>{const D=new Set;for(const ge of r.value)for(const De of ge.threads)D.add(De.id);return D}),ne=ce(()=>z.name==="home"),se=ce(()=>z.name==="skills"),ye=ce(()=>{var D;return se.value?"Skills":ne.value?"New thread":((D=o.value)==null?void 0:D.title)??"Choose a thread"}),xe=ce(()=>$.value?`Auto refresh in ${String(q.value)}s`:"Enable 4s refresh"),Me=ce(()=>M.value.filter(D=>{const ge=ir(D.messageType,D.role);return ge==="worked"?!0:!(ge==="turnActivity.live"||ge==="turnError.live"||ge==="agentReasoning.live")})),je=ce(()=>l.value),Be=ce(()=>ne.value?"__new-thread__":d.value),Ue=ce(()=>{var D,ge;return ne.value?v.value.trim():((ge=(D=o.value)==null?void 0:D.cwd)==null?void 0:ge.trim())??""}),N=ce(()=>{var D;return!ne.value&&((D=o.value)==null?void 0:D.inProgress)===!0}),V=ce(()=>{var gt,jt;const D=[],ge=new Set;for(const Kt of r.value){const ar=((jt=(gt=Kt.threads[0])==null?void 0:gt.cwd)==null?void 0:jt.trim())??"";!ar||ge.has(ar)||(ge.add(ar),D.push({value:ar,label:s.value[Kt.projectName]??Kt.projectName}))}const De=v.value.trim();return De&&!ge.has(De)&&D.unshift({value:De,label:J(De)}),D});Dn(()=>{window.addEventListener("keydown",rr),xr(),R(),Tn()}),$s(()=>{window.removeEventListener("keydown",rr),E()});function p(){ae()}function A(){H.value=!H.value,H.value?Vt(()=>{var D;return(D=O.value)==null?void 0:D.focus()}):L.value=""}function I(){var D;L.value="",(D=O.value)==null||D.focus()}function Y(D){D.key==="Escape"&&(H.value=!1,L.value="")}function ve(D){D&&(z.name==="thread"&&Q.value===D||(Z.push({name:"thread",params:{threadId:D}}),he.value&&Rt(!0)))}function Ce(D){de(D)}function Ye(D){var gt,jt;const ge=r.value.find(Kt=>Kt.projectName===D),De=((jt=(gt=ge==null?void 0:ge.threads[0])==null?void 0:gt.cwd)==null?void 0:jt.trim())??"";De&&(v.value=De),he.value&&Rt(!0),!ne.value&&Z.push({name:"home"})}function we(){var ge,De;const D=((De=(ge=o.value)==null?void 0:ge.cwd)==null?void 0:De.trim())??"";D&&(v.value=D),he.value&&Rt(!0),!ne.value&&Z.push({name:"home"})}function me(D){et(D.projectName,D.displayName)}function dt(D){qe(D)}function yt(D){ut(D.projectName,D.toIndex)}function Zt(D){le(D.threadId,D.state)}function kn(D){tt(D)}function Fn(){Te()}function Rt(D){S.value!==D&&(S.value=D,Sn(D))}function rr(D){D.defaultPrevented||!D.ctrlKey&&!D.metaKey||D.shiftKey||D.altKey||D.key.toLowerCase()==="b"&&(D.preventDefault(),Rt(!S.value))}function en(D){const ge=D.text;if(ne.value){Ls(ge,D.imageUrls,D.skills,D.fileAttachments);return}if(D.source==="dictation"){te(ge,D.imageUrls,D.skills,D.fileAttachments);return}oe(ge,D.imageUrls,D.skills,D.mode,D.fileAttachments)}function kr(D){v.value=D.trim()}async function Tr(D){const ge=D.trim();if(!ge)return;const De=cn(ge),gt=await Sr(),jt=De?ge:Ve(gt,ge);if(jt)try{const Kt=await Hv(jt,{createIfMissing:!De,label:De?"":ge});Kt&&(v.value=Kt,ue(J(Kt)),Tn())}catch{}}async function Sr(){const D=T();if(D)return D;try{const ge=await Pa();if(ge)return ee.value=ge,ge}catch{}return""}function cn(D){return D?D.startsWith("~/")||D.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test(D):!1}async function Tn(){const D=T();if(!D){re.value="New Project (1)";return}try{const ge=await Uv(D);re.value=ge.name||"New Project (1)"}catch{re.value="New Project (1)"}}function T(){var De,gt;const D=v.value.trim();if(D)return P(D);const ge=((gt=(De=V.value[0])==null?void 0:De.value)==null?void 0:gt.trim())??"";return ge?P(ge):ee.value.trim()}async function R(){try{ee.value=await Pa()}catch{ee.value=""}}function P(D){const ge=D.trim().replace(/\/+$/,"");if(!ge)return"";const De=ge.lastIndexOf("/");return De<=0?"":ge.slice(0,De)}function J(D){const ge=D.trim().replace(/\/+$/,"");if(!ge)return"";const De=ge.lastIndexOf("/");return De<0?ge:ge.slice(De+1)}function Ve(D,ge){const De=D.trim().replace(/\/+$/,""),gt=ge.trim().replace(/^\/+/,"");return!De||!gt?"":`${De}/${gt}`}function vt(D){Ee(D)}function Nt(D){rt(D)}function sr(){X()}function or(D){Ne(D.turnIndex)}function Ot(){return typeof window>"u"?!1:window.localStorage.getItem(Va)==="1"}function Sn(D){typeof window>"u"||window.localStorage.setItem(Va,D?"1":"0")}function ir(D,ge){const De=(D??"").trim();return De.length>0?De:ge.trim()||"message"}async function xr(){await F(),m.value=!0,await Zr(),Se()}async function Zr(){if(!Re.value){Re.value=!0;try{if(z.name==="home"||z.name==="skills"){d.value!==""&&await ie("");return}if(z.name==="thread"){const D=Q.value;if(!D)return;if(!G.value.has(D)){await Z.replace({name:"home"});return}d.value!==D&&await ie(D);return}}finally{Re.value=!1}}}ft(()=>[z.name,Q.value,C.value,G.value.has(Q.value),d.value],async()=>{m.value&&await Zr()}),ft(()=>d.value,async D=>{if(m.value&&!Re.value&&!(ne.value||se.value)){if(!D){z.name!=="home"&&await Z.replace({name:"home"});return}z.name==="thread"&&Q.value===D||await Z.replace({name:"thread",params:{threadId:D}})}}),ft(()=>V.value,D=>{if(D.length===0){v.value="";return}D.some(De=>De.value===v.value)||(v.value=D[0].value),Tn()},{immediate:!0}),ft(()=>v.value,()=>{Tn()}),ft(he,D=>{D&&!S.value&&Rt(!0)});async function Ls(D,ge=[],De=[],gt=[]){try{const jt=await fe(D,v.value,ge,De,gt);if(!jt)return;await Z.replace({name:"thread",params:{threadId:jt}})}catch{}}return(D,ge)=>(_(),x(Fe,null,[Ae(Bh,{"is-sidebar-collapsed":S.value,onCloseSidebar:ge[4]||(ge[4]=De=>Rt(!0))},{sidebar:nt(()=>[w("section",a0,[S.value?pe("",!0):(_(),ot(La,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":S.value,"is-auto-refresh-enabled":$e($),"auto-refresh-button-label":xe.value,"show-new-thread-button":!0,onToggleSidebar:ge[0]||(ge[0]=De=>Rt(!S.value)),onToggleAutoRefresh:Fn,onStartNewThread:we},{default:nt(()=>[w("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":H.value,"aria-label":"Search threads",title:"Search threads",onClick:A},[Ae($o,{class:"sidebar-search-toggle-icon"})],8,l0)]),_:1},8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])),!S.value&&H.value?(_(),x("div",c0,[Ae($o,{class:"sidebar-search-bar-icon"}),Nn(w("input",{ref_key:"sidebarSearchInputRef",ref:O,"onUpdate:modelValue":ge[1]||(ge[1]=De=>L.value=De),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:Y},null,544),[[jn,L.value]]),L.value.length>0?(_(),x("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:I},[Ae(si,{class:"sidebar-search-clear-icon"})])):pe("",!0)])):pe("",!0),S.value?pe("",!0):(_(),x("button",{key:2,class:lt(["sidebar-skills-link",{"is-active":se.value}]),type:"button",onClick:ge[2]||(ge[2]=De=>{$e(Z).push({name:"skills"}),$e(he)&&Rt(!0)})}," Skills Hub ",2)),S.value?pe("",!0):(_(),ot(_m,{key:3,groups:$e(r),"project-display-name-by-id":$e(s),"selected-thread-id":$e(d),"is-loading":$e(C),"search-query":L.value,onSelect:ve,onArchive:Ce,onStartNewThread:Ye,onRenameProject:me,onRemoveProject:dt,onReorderProject:yt},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query"]))])]),content:nt(()=>[w("section",u0,[Ae(Am,{title:ye.value},{leading:nt(()=>[S.value||$e(he)?(_(),ot(La,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":S.value,"is-auto-refresh-enabled":$e($),"auto-refresh-button-label":xe.value,"show-new-thread-button":!0,onToggleSidebar:ge[3]||(ge[3]=De=>Rt(!S.value)),onToggleAutoRefresh:Fn,onStartNewThread:we},null,8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])):pe("",!0)]),_:1},8,["title"]),w("section",d0,[se.value?(_(),ot(vb,{key:0,onSkillsChanged:p})):ne.value?(_(),x("div",f0,[w("div",h0,[ge[5]||(ge[5]=w("p",{class:"new-thread-hero"},"Let's build",-1)),Ae(Ro,{class:"new-thread-folder-dropdown","model-value":v.value,options:V.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":re.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":kr,onAdd:Tr},null,8,["model-value","options","default-add-value"])]),Ae(Oa,{"active-thread-id":Be.value,cwd:Ue.value,models:$e(u),"selected-model":$e(f),"selected-reasoning-effort":$e(g),skills:$e(b),"is-turn-in-progress":!1,"is-interrupting-turn":!1,onSubmit:en,"onUpdate:selectedModel":vt,"onUpdate:selectedReasoningEffort":Nt},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills"])])):(_(),x("div",p0,[w("div",m0,[Ae(rv,{messages:Me.value,"is-loading":$e(B),"active-thread-id":Be.value,"scroll-state":$e(i),"live-overlay":je.value,"pending-requests":$e(a),"is-turn-in-progress":N.value,"is-rolling-back":$e(We),onUpdateScrollState:Zt,onRespondServerRequest:kn,onRollback:or},null,8,["messages","is-loading","active-thread-id","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),w("div",g0,[Ae(_w,{messages:$e(Ge),onSteer:$e(Le),onDelete:$e(ke)},null,8,["messages","onSteer","onDelete"]),Ae(Oa,{"active-thread-id":Be.value,cwd:Ue.value,models:$e(u),"selected-model":$e(f),"selected-reasoning-effort":$e(g),skills:$e(b),"is-turn-in-progress":N.value,"is-interrupting-turn":$e(K),"has-queue-above":$e(Ge).length>0,onSubmit:en,"onUpdate:selectedModel":vt,"onUpdate:selectedReasoningEffort":Nt,onInterrupt:sr},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","is-turn-in-progress","is-interrupting-turn","has-queue-above"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),w("div",v0," WT "+_e($e(t))+" · v"+_e($e(n)),1)],64))}}),w0=ze(y0,[["__scopeId","data-v-3790464e"]]),uo={render:()=>null},b0=$h({history:ch(),routes:[{path:"/",name:"home",component:uo},{path:"/thread/:threadId",name:"thread",component:uo},{path:"/skills",name:"skills",component:uo},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});kf(w0).use(b0).mount("#app");