codexapp 0.1.27 → 0.1.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-Bhfj4wvl.js +48 -0
- package/dist/assets/index-CBIbfWDP.css +1 -0
- package/dist/index.html +2 -2
- package/dist-cli/index.js +164 -280
- package/dist-cli/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/assets/index-cSjdFqX4.js +0 -48
- package/dist/assets/index-sxLu4gFb.css +0 -1
|
@@ -1,48 +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.28
|
|
3
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
-
* @license MIT
|
|
5
|
-
**/function li(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ht={},jr=[],hn=()=>{},gl=()=>!1,Ks=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ci=e=>e.startsWith("onUpdate:"),xt=Object.assign,ui=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},du=Object.prototype.hasOwnProperty,st=(e,t)=>du.call(e,t),Be=Array.isArray,Dr=e=>ws(e)==="[object Map]",vl=e=>ws(e)==="[object Set]",Hi=e=>ws(e)==="[object Date]",Ve=e=>typeof e=="function",_t=e=>typeof e=="string",nn=e=>typeof e=="symbol",ot=e=>e!==null&&typeof e=="object",yl=e=>(ot(e)||Ve(e))&&Ve(e.then)&&Ve(e.catch),wl=Object.prototype.toString,ws=e=>wl.call(e),fu=e=>ws(e).slice(8,-1),bl=e=>ws(e)==="[object Object]",di=e=>_t(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ns=li(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Gs=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},hu=/-\w/g,Zt=Gs(e=>e.replace(hu,t=>t.slice(1).toUpperCase())),pu=/\B([A-Z])/g,Yn=Gs(e=>e.replace(pu,"-$1").toLowerCase()),zs=Gs(e=>e.charAt(0).toUpperCase()+e.slice(1)),uo=Gs(e=>e?`on${zs(e)}`:""),Gn=(e,t)=>!Object.is(e,t),Rs=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},_l=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},fi=e=>{const t=parseFloat(e);return isNaN(t)?e:t},mu=e=>{const t=_t(e)?Number(e):NaN;return isNaN(t)?e:t};let Ui;const Ys=()=>Ui||(Ui=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function gr(e){if(Be(e)){const t={};for(let n=0;n<e.length;n++){const r=e[n],s=_t(r)?wu(r):gr(r);if(s)for(const o in s)t[o]=s[o]}return t}else if(_t(e)||ot(e))return e}const gu=/;(?![^(]*\))/g,vu=/:([^]+)/,yu=/\/\*[^]*?\*\//g;function wu(e){const t={};return e.replace(yu,"").split(gu).forEach(n=>{if(n){const r=n.split(vu);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function lt(e){let t="";if(_t(e))t=e;else if(Be(e))for(let n=0;n<e.length;n++){const r=lt(e[n]);r&&(t+=r+" ")}else if(ot(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const bu="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",_u=li(bu);function kl(e){return!!e||e===""}function ku(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=hi(e[r],t[r]);return n}function hi(e,t){if(e===t)return!0;let n=Hi(e),r=Hi(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=nn(e),r=nn(t),n||r)return e===t;if(n=Be(e),r=Be(t),n||r)return n&&r?ku(e,t):!1;if(n=ot(e),r=ot(t),n||r){if(!n||!r)return!1;const s=Object.keys(e).length,o=Object.keys(t).length;if(s!==o)return!1;for(const i in e){const a=e.hasOwnProperty(i),l=t.hasOwnProperty(i);if(a&&!l||!a&&l||!hi(e[i],t[i]))return!1}}return String(e)===String(t)}const Tl=e=>!!(e&&e.__v_isRef===!0),fe=e=>_t(e)?e:e==null?"":Be(e)||ot(e)&&(e.toString===wl||!Ve(e.toString))?Tl(e)?fe(e.value):JSON.stringify(e,Sl,2):String(e),Sl=(e,t)=>Tl(t)?Sl(e,t.value):Dr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,s],o)=>(n[fo(r,o)+" =>"]=s,n),{})}:vl(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>fo(n))}:nn(t)?fo(t):ot(t)&&!Be(t)&&!bl(t)?String(t):t,fo=(e,t="")=>{var n;return nn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
|
6
|
-
* @vue/reactivity v3.5.28
|
|
7
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8
|
-
* @license MIT
|
|
9
|
-
**/let Wt;class Tu{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=Wt,!t&&Wt&&(this.index=(Wt.scopes||(Wt.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=Wt;try{return Wt=this,t()}finally{Wt=n}}}on(){++this._on===1&&(this.prevScope=Wt,Wt=this)}off(){this._on>0&&--this._on===0&&(Wt=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function Su(){return Wt}let gt;const ho=new WeakSet;class xl{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Wt&&Wt.active&&Wt.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ho.has(this)&&(ho.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||El(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Vi(this),Al(this);const t=gt,n=en;gt=this,en=!0;try{return this.fn()}finally{Il(this),gt=t,en=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)gi(t);this.deps=this.depsTail=void 0,Vi(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ho.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Do(this)&&this.run()}get dirty(){return Do(this)}}let Cl=0,rs,ss;function El(e,t=!1){if(e.flags|=8,t){e.next=ss,ss=e;return}e.next=rs,rs=e}function pi(){Cl++}function mi(){if(--Cl>0)return;if(ss){let t=ss;for(ss=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;rs;){let t=rs;for(rs=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function Al(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Il(e){let t,n=e.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),gi(r),xu(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}e.deps=t,e.depsTail=n}function Do(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Rl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Rl(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===us)||(e.globalVersion=us,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Do(e))))return;e.flags|=2;const t=e.dep,n=gt,r=en;gt=e,en=!0;try{Al(e);const s=e.fn(e._value);(t.version===0||Gn(s,e._value))&&(e.flags|=128,e._value=s,t.version++)}catch(s){throw t.version++,s}finally{gt=n,en=r,Il(e),e.flags&=-3}}function gi(e,t=!1){const{dep:n,prevSub:r,nextSub:s}=e;if(r&&(r.nextSub=s,e.prevSub=void 0),s&&(s.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)gi(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function xu(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let en=!0;const $l=[];function En(){$l.push(en),en=!1}function An(){const e=$l.pop();en=e===void 0?!0:e}function Vi(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=gt;gt=void 0;try{t()}finally{gt=n}}}let us=0;class Cu{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class vi{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!gt||!en||gt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==gt)n=this.activeLink=new Cu(gt,this),gt.deps?(n.prevDep=gt.depsTail,gt.depsTail.nextDep=n,gt.depsTail=n):gt.deps=gt.depsTail=n,Ml(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=gt.depsTail,n.nextDep=void 0,gt.depsTail.nextDep=n,gt.depsTail=n,gt.deps===n&&(gt.deps=r)}return n}trigger(t){this.version++,us++,this.notify(t)}notify(t){pi();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{mi()}}}function Ml(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)Ml(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Lo=new WeakMap,pr=Symbol(""),Bo=Symbol(""),ds=Symbol("");function Ot(e,t,n){if(en&>){let r=Lo.get(e);r||Lo.set(e,r=new Map);let s=r.get(n);s||(r.set(n,s=new vi),s.map=r,s.key=n),s.track()}}function Sn(e,t,n,r,s,o){const i=Lo.get(e);if(!i){us++;return}const a=l=>{l&&l.trigger()};if(pi(),t==="clear")i.forEach(a);else{const l=Be(e),d=l&&di(n);if(l&&n==="length"){const u=Number(r);i.forEach((f,g)=>{(g==="length"||g===ds||!nn(g)&&g>=u)&&a(f)})}else switch((n!==void 0||i.has(void 0))&&a(i.get(n)),d&&a(i.get(ds)),t){case"add":l?d&&a(i.get("length")):(a(i.get(pr)),Dr(e)&&a(i.get(Bo)));break;case"delete":l||(a(i.get(pr)),Dr(e)&&a(i.get(Bo)));break;case"set":Dr(e)&&a(i.get(pr));break}}mi()}function $r(e){const t=nt(e);return t===e?t:(Ot(t,"iterate",ds),Xt(e)?t:t.map(rn))}function Js(e){return Ot(e=nt(e),"iterate",ds),e}function Vn(e,t){return In(e)?Hr(mr(e)?rn(t):t):rn(t)}const Eu={__proto__:null,[Symbol.iterator](){return po(this,Symbol.iterator,e=>Vn(this,e))},concat(...e){return $r(this).concat(...e.map(t=>Be(t)?$r(t):t))},entries(){return po(this,"entries",e=>(e[1]=Vn(this,e[1]),e))},every(e,t){return wn(this,"every",e,t,void 0,arguments)},filter(e,t){return wn(this,"filter",e,t,n=>n.map(r=>Vn(this,r)),arguments)},find(e,t){return wn(this,"find",e,t,n=>Vn(this,n),arguments)},findIndex(e,t){return wn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return wn(this,"findLast",e,t,n=>Vn(this,n),arguments)},findLastIndex(e,t){return wn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return wn(this,"forEach",e,t,void 0,arguments)},includes(...e){return mo(this,"includes",e)},indexOf(...e){return mo(this,"indexOf",e)},join(e){return $r(this).join(e)},lastIndexOf(...e){return mo(this,"lastIndexOf",e)},map(e,t){return wn(this,"map",e,t,void 0,arguments)},pop(){return zr(this,"pop")},push(...e){return zr(this,"push",e)},reduce(e,...t){return Wi(this,"reduce",e,t)},reduceRight(e,...t){return Wi(this,"reduceRight",e,t)},shift(){return zr(this,"shift")},some(e,t){return wn(this,"some",e,t,void 0,arguments)},splice(...e){return zr(this,"splice",e)},toReversed(){return $r(this).toReversed()},toSorted(e){return $r(this).toSorted(e)},toSpliced(...e){return $r(this).toSpliced(...e)},unshift(...e){return zr(this,"unshift",e)},values(){return po(this,"values",e=>Vn(this,e))}};function po(e,t,n){const r=Js(e),s=r[t]();return r!==e&&!Xt(e)&&(s._next=s.next,s.next=()=>{const o=s._next();return o.done||(o.value=n(o.value)),o}),s}const Au=Array.prototype;function wn(e,t,n,r,s,o){const i=Js(e),a=i!==e&&!Xt(e),l=i[t];if(l!==Au[t]){const f=l.apply(e,o);return a?rn(f):f}let d=n;i!==e&&(a?d=function(f,g){return n.call(this,Vn(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 Wi(e,t,n,r){const s=Js(e);let o=n;return s!==e&&(Xt(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,Vn(e,a),l,e)}),s[t](o,...r)}function mo(e,t,n){const r=nt(e);Ot(r,"iterate",ds);const s=r[t](...n);return(s===-1||s===!1)&&bi(n[0])?(n[0]=nt(n[0]),r[t](...n)):s}function zr(e,t,n=[]){En(),pi();const r=nt(e)[t].apply(e,n);return mi(),An(),r}const Iu=li("__proto__,__v_isRef,__isVue"),Pl=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(nn));function Ru(e){nn(e)||(e=String(e));const t=nt(this);return Ot(t,"has",e),t.hasOwnProperty(e)}class Ol{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const s=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(s?o?Fu:Ll:o?Dl:jl).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const i=Be(t);if(!s){let l;if(i&&(l=Eu[n]))return l;if(n==="hasOwnProperty")return Ru}const a=Reflect.get(t,n,Dt(t)?t:r);if((nn(n)?Pl.has(n):Iu(n))||(s||Ot(t,"get",n),o))return a;if(Dt(a)){const l=i&&di(n)?a:a.value;return s&&ot(l)?Ho(l):l}return ot(a)?s?Ho(a):Qs(a):a}}class Nl extends Ol{constructor(t=!1){super(!1,t)}set(t,n,r,s){let o=t[n];const i=Be(t)&&di(n);if(!this._isShallow){const d=In(o);if(!Xt(r)&&!In(r)&&(o=nt(o),r=nt(r)),!i&&Dt(o)&&!Dt(r))return d||(o.value=r),!0}const a=i?Number(n)<t.length:st(t,n),l=Reflect.set(t,n,r,Dt(t)?t:s);return t===nt(s)&&(a?Gn(r,o)&&Sn(t,"set",n,r):Sn(t,"add",n,r)),l}deleteProperty(t,n){const r=st(t,n);t[n];const s=Reflect.deleteProperty(t,n);return s&&r&&Sn(t,"delete",n,void 0),s}has(t,n){const r=Reflect.has(t,n);return(!nn(n)||!Pl.has(n))&&Ot(t,"has",n),r}ownKeys(t){return Ot(t,"iterate",Be(t)?"length":pr),Reflect.ownKeys(t)}}class $u extends Ol{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const Mu=new Nl,Pu=new $u,Ou=new Nl(!0);const Fo=e=>e,ks=e=>Reflect.getPrototypeOf(e);function Nu(e,t,n){return function(...r){const s=this.__v_raw,o=nt(s),i=Dr(o),a=e==="entries"||e===Symbol.iterator&&i,l=e==="keys"&&i,d=s[e](...r),u=n?Fo:t?Hr:rn;return!t&&Ot(o,"iterate",l?Bo:pr),xt(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 Ts(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function ju(e,t){const n={get(s){const o=this.__v_raw,i=nt(o),a=nt(s);e||(Gn(s,a)&&Ot(i,"get",s),Ot(i,"get",a));const{has:l}=ks(i),d=t?Fo:e?Hr:rn;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&&Ot(nt(s),"iterate",pr),s.size},has(s){const o=this.__v_raw,i=nt(o),a=nt(s);return e||(Gn(s,a)&&Ot(i,"has",s),Ot(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=nt(a),d=t?Fo:e?Hr:rn;return!e&&Ot(l,"iterate",pr),a.forEach((u,f)=>s.call(o,d(u),d(f),i))}};return xt(n,e?{add:Ts("add"),set:Ts("set"),delete:Ts("delete"),clear:Ts("clear")}:{add(s){!t&&!Xt(s)&&!In(s)&&(s=nt(s));const o=nt(this);return ks(o).has.call(o,s)||(o.add(s),Sn(o,"add",s,s)),this},set(s,o){!t&&!Xt(o)&&!In(o)&&(o=nt(o));const i=nt(this),{has:a,get:l}=ks(i);let d=a.call(i,s);d||(s=nt(s),d=a.call(i,s));const u=l.call(i,s);return i.set(s,o),d?Gn(o,u)&&Sn(i,"set",s,o):Sn(i,"add",s,o),this},delete(s){const o=nt(this),{has:i,get:a}=ks(o);let l=i.call(o,s);l||(s=nt(s),l=i.call(o,s)),a&&a.call(o,s);const d=o.delete(s);return l&&Sn(o,"delete",s,void 0),d},clear(){const s=nt(this),o=s.size!==0,i=s.clear();return o&&Sn(s,"clear",void 0,void 0),i}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=Nu(s,e,t)}),n}function yi(e,t){const n=ju(e,t);return(r,s,o)=>s==="__v_isReactive"?!e:s==="__v_isReadonly"?e:s==="__v_raw"?r:Reflect.get(st(n,s)&&s in r?n:r,s,o)}const Du={get:yi(!1,!1)},Lu={get:yi(!1,!0)},Bu={get:yi(!0,!1)};const jl=new WeakMap,Dl=new WeakMap,Ll=new WeakMap,Fu=new WeakMap;function Hu(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Uu(e){return e.__v_skip||!Object.isExtensible(e)?0:Hu(fu(e))}function Qs(e){return In(e)?e:wi(e,!1,Mu,Du,jl)}function Bl(e){return wi(e,!1,Ou,Lu,Dl)}function Ho(e){return wi(e,!0,Pu,Bu,Ll)}function wi(e,t,n,r,s){if(!ot(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const o=Uu(e);if(o===0)return e;const i=s.get(e);if(i)return i;const a=new Proxy(e,o===2?r:n);return s.set(e,a),a}function mr(e){return In(e)?mr(e.__v_raw):!!(e&&e.__v_isReactive)}function In(e){return!!(e&&e.__v_isReadonly)}function Xt(e){return!!(e&&e.__v_isShallow)}function bi(e){return e?!!e.__v_raw:!1}function nt(e){const t=e&&e.__v_raw;return t?nt(t):e}function Vu(e){return!st(e,"__v_skip")&&Object.isExtensible(e)&&_l(e,"__v_skip",!0),e}const rn=e=>ot(e)?Qs(e):e,Hr=e=>ot(e)?Ho(e):e;function Dt(e){return e?e.__v_isRef===!0:!1}function P(e){return Fl(e,!1)}function Wu(e){return Fl(e,!0)}function Fl(e,t){return Dt(e)?e:new qu(e,t)}class qu{constructor(t,n){this.dep=new vi,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:nt(t),this._value=n?t:rn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Xt(t)||In(t);t=r?t:nt(t),Gn(t,n)&&(this._rawValue=t,this._value=r?t:rn(t),this.dep.trigger())}}function je(e){return Dt(e)?e.value:e}const Ku={get:(e,t,n)=>t==="__v_raw"?e:je(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const s=e[t];return Dt(s)&&!Dt(n)?(s.value=n,!0):Reflect.set(e,t,n,r)}};function Hl(e){return mr(e)?e:new Proxy(e,Ku)}class Gu{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new vi(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=us-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&>!==this)return El(this,!0),!0}get value(){const t=this.dep.track();return Rl(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function zu(e,t,n=!1){let r,s;return Ve(e)?r=e:(r=e.get,s=e.set),new Gu(r,s,n)}const Ss={},js=new WeakMap;let ur;function Yu(e,t=!1,n=ur){if(n){let r=js.get(n);r||js.set(n,r=[]),r.push(e)}}function Ju(e,t,n=ht){const{immediate:r,deep:s,once:o,scheduler:i,augmentJob:a,call:l}=n,d=D=>s?D:Xt(D)||s===!1||s===0?xn(D,1):xn(D);let u,f,g,k,N=!1,I=!1;if(Dt(e)?(f=()=>e.value,N=Xt(e)):mr(e)?(f=()=>d(e),N=!0):Be(e)?(I=!0,N=e.some(D=>mr(D)||Xt(D)),f=()=>e.map(D=>{if(Dt(D))return D.value;if(mr(D))return d(D);if(Ve(D))return l?l(D,2):D()})):Ve(e)?t?f=l?()=>l(e,2):e:f=()=>{if(g){En();try{g()}finally{An()}}const D=ur;ur=u;try{return l?l(e,3,[k]):e(k)}finally{ur=D}}:f=hn,t&&s){const D=f,ae=s===!0?1/0:s;f=()=>xn(D(),ae)}const F=Su(),z=()=>{u.stop(),F&&F.active&&ui(F.effects,u)};if(o&&t){const D=t;t=(...ae)=>{D(...ae),z()}}let j=I?new Array(e.length).fill(Ss):Ss;const U=D=>{if(!(!(u.flags&1)||!u.dirty&&!D))if(t){const ae=u.run();if(s||N||(I?ae.some((ue,de)=>Gn(ue,j[de])):Gn(ae,j))){g&&g();const ue=ur;ur=u;try{const de=[ae,j===Ss?void 0:I&&j[0]===Ss?[]:j,k];j=ae,l?l(t,3,de):t(...de)}finally{ur=ue}}}else u.run()};return a&&a(U),u=new xl(f),u.scheduler=i?()=>i(U,!1):U,k=D=>Yu(D,!1,u),g=u.onStop=()=>{const D=js.get(u);if(D){if(l)l(D,4);else for(const ae of D)ae();js.delete(u)}},t?r?U(!0):j=u.run():i?i(U.bind(null,!0),!0):u.run(),z.pause=u.pause.bind(u),z.resume=u.resume.bind(u),z.stop=z,z}function xn(e,t=1/0,n){if(t<=0||!ot(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Dt(e))xn(e.value,t,n);else if(Be(e))for(let r=0;r<e.length;r++)xn(e[r],t,n);else if(vl(e)||Dr(e))e.forEach(r=>{xn(r,t,n)});else if(bl(e)){for(const r in e)xn(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&xn(e[r],t,n)}return e}/**
|
|
10
|
-
* @vue/runtime-core v3.5.28
|
|
11
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
|
-
* @license MIT
|
|
13
|
-
**/function bs(e,t,n,r){try{return r?e(...r):e()}catch(s){Xs(s,t,n)}}function sn(e,t,n,r){if(Ve(e)){const s=bs(e,t,n,r);return s&&yl(s)&&s.catch(o=>{Xs(o,t,n)}),s}if(Be(e)){const s=[];for(let o=0;o<e.length;o++)s.push(sn(e[o],t,n,r));return s}}function Xs(e,t,n,r=!0){const s=t?t.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:i}=t&&t.appContext.config||ht;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){En(),bs(o,null,10,[e,l,d]),An();return}}Qu(e,n,s,r,i)}function Qu(e,t,n,r=!0,s=!1){if(s)throw e;console.error(e)}const Ft=[];let cn=-1;const Lr=[];let Wn=null,Pr=0;const Ul=Promise.resolve();let Ds=null;function zt(e){const t=Ds||Ul;return e?t.then(this?e.bind(this):e):t}function Xu(e){let t=cn+1,n=Ft.length;for(;t<n;){const r=t+n>>>1,s=Ft[r],o=fs(s);o<e||o===e&&s.flags&2?t=r+1:n=r}return t}function _i(e){if(!(e.flags&1)){const t=fs(e),n=Ft[Ft.length-1];!n||!(e.flags&2)&&t>=fs(n)?Ft.push(e):Ft.splice(Xu(t),0,e),e.flags|=1,Vl()}}function Vl(){Ds||(Ds=Ul.then(ql))}function Zu(e){Be(e)?Lr.push(...e):Wn&&e.id===-1?Wn.splice(Pr+1,0,e):e.flags&1||(Lr.push(e),e.flags|=1),Vl()}function qi(e,t,n=cn+1){for(;n<Ft.length;n++){const r=Ft[n];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;Ft.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Wl(e){if(Lr.length){const t=[...new Set(Lr)].sort((n,r)=>fs(n)-fs(r));if(Lr.length=0,Wn){Wn.push(...t);return}for(Wn=t,Pr=0;Pr<Wn.length;Pr++){const n=Wn[Pr];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Wn=null,Pr=0}}const fs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function ql(e){try{for(cn=0;cn<Ft.length;cn++){const t=Ft[cn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),bs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;cn<Ft.length;cn++){const t=Ft[cn];t&&(t.flags&=-2)}cn=-1,Ft.length=0,Wl(),Ds=null,(Ft.length||Lr.length)&&ql()}}let It=null,Kl=null;function Ls(e){const t=It;return It=e,Kl=e&&e.type.__scopeId||null,t}function it(e,t=It,n){if(!t||e._n)return e;const r=(...s)=>{r._d&&Us(-1);const o=Ls(t);let i;try{i=e(...s)}finally{Ls(o),r._d&&Us(1)}return i};return r._n=!0,r._c=!0,r._d=!0,r}function Rn(e,t){if(It===null)return e;const n=so(It),r=e.dirs||(e.dirs=[]);for(let s=0;s<t.length;s++){let[o,i,a,l=ht]=t[s];o&&(Ve(o)&&(o={mounted:o,updated:o}),o.deep&&xn(i),r.push({dir:o,instance:n,value:i,oldValue:void 0,arg:a,modifiers:l}))}return e}function or(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&&(En(),sn(l,n,8,[e.el,a,e,t]),An())}}function $s(e,t){if(jt){let n=jt.provides;const r=jt.parent&&jt.parent.provides;r===n&&(n=jt.provides=Object.create(r)),n[e]=t}}function tn(e,t,n=!1){const r=Ci();if(r||Fr){let s=Fr?Fr._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&&Ve(t)?t.call(r&&r.proxy):t}}const ed=Symbol.for("v-scx"),td=()=>tn(ed);function at(e,t,n){return Gl(e,t,n)}function Gl(e,t,n=ht){const{immediate:r,deep:s,flush:o,once:i}=n,a=xt({},n),l=t&&r||!t&&o!=="post";let d;if(gs){if(o==="sync"){const k=td();d=k.__watcherHandles||(k.__watcherHandles=[])}else if(!l){const k=()=>{};return k.stop=hn,k.resume=hn,k.pause=hn,k}}const u=jt;a.call=(k,N,I)=>sn(k,u,N,I);let f=!1;o==="post"?a.scheduler=k=>{Pt(k,u&&u.suspense)}:o!=="sync"&&(f=!0,a.scheduler=(k,N)=>{N?k():_i(k)}),a.augmentJob=k=>{t&&(k.flags|=4),f&&(k.flags|=2,u&&(k.id=u.uid,k.i=u))};const g=Ju(e,t,a);return gs&&(d?d.push(g):l&&g()),g}function nd(e,t,n){const r=this.proxy,s=_t(e)?e.includes(".")?zl(r,e):()=>r[e]:e.bind(r,r);let o;Ve(t)?o=t:(o=t.handler,n=t);const i=_s(this),a=Gl(s,o.bind(r),n);return i(),a}function zl(e,t){const n=t.split(".");return()=>{let r=e;for(let s=0;s<n.length&&r;s++)r=r[n[s]];return r}}const Yl=Symbol("_vte"),Jl=e=>e.__isTeleport,os=e=>e&&(e.disabled||e.disabled===""),Ki=e=>e&&(e.defer||e.defer===""),Gi=e=>typeof SVGElement<"u"&&e instanceof SVGElement,zi=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Uo=(e,t)=>{const n=e&&e.to;return _t(n)?t?t(n):null:n},Ql={name:"Teleport",__isTeleport:!0,process(e,t,n,r,s,o,i,a,l,d){const{mc:u,pc:f,pbc:g,o:{insert:k,querySelector:N,createText:I,createComment:F}}=d,z=os(t.props);let{shapeFlag:j,children:U,dynamicChildren:D}=t;if(e==null){const ae=t.el=I(""),ue=t.anchor=I("");k(ae,n,r),k(ue,n,r);const de=(oe,X)=>{j&16&&u(U,oe,X,s,o,i,a,l)},Te=()=>{const oe=t.target=Uo(t.props,N),X=Vo(oe,t,I,k);oe&&(i!=="svg"&&Gi(oe)?i="svg":i!=="mathml"&&zi(oe)&&(i="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(oe),z||(de(oe,X),Ms(t,!1)))};z&&(de(n,ue),Ms(t,!0)),Ki(t.props)?(t.el.__isMounted=!1,Pt(()=>{Te(),delete t.el.__isMounted},o)):Te()}else{if(Ki(t.props)&&e.el.__isMounted===!1){Pt(()=>{Ql.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,ue=t.target=e.target,de=t.targetAnchor=e.targetAnchor,Te=os(e.props),oe=Te?n:ue,X=Te?ae:de;if(i==="svg"||Gi(ue)?i="svg":(i==="mathml"||zi(ue))&&(i="mathml"),D?(g(e.dynamicChildren,D,oe,s,o,i,a),Si(e,t,!0)):l||f(e,t,oe,X,s,o,i,a,!1),z)Te?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):xs(t,n,ae,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const me=t.target=Uo(t.props,N);me&&xs(t,me,null,d,0)}else Te&&xs(t,ue,de,d,1);Ms(t,z)}},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 k=o||!os(g);for(let N=0;N<a.length;N++){const I=a[N];r(I,t,n,k,!!I.dynamicChildren)}}},move:xs,hydrate:rd};function xs(e,t,n,{o:{insert:r},m:s},o=2){o===0&&r(e.targetAnchor,t,n);const{el:i,anchor:a,shapeFlag:l,children:d,props:u}=e,f=o===2;if(f&&r(i,t,n),(!f||os(u))&&l&16)for(let g=0;g<d.length;g++)s(d[g],t,n,2);f&&r(a,t,n)}function rd(e,t,n,r,s,o,{o:{nextSibling:i,parentNode:a,querySelector:l,insert:d,createText:u}},f){function g(F,z){let j=z;for(;j;){if(j&&j.nodeType===8){if(j.data==="teleport start anchor")t.targetStart=j;else if(j.data==="teleport anchor"){t.targetAnchor=j,F._lpa=t.targetAnchor&&i(t.targetAnchor);break}}j=i(j)}}function k(F,z){z.anchor=f(i(F),z,a(F),n,r,s,o)}const N=t.target=Uo(t.props,l),I=os(t.props);if(N){const F=N._lpa||N.firstChild;t.shapeFlag&16&&(I?(k(e,t),g(N,F),t.targetAnchor||Vo(N,t,u,d,a(e)===N?e:null)):(t.anchor=i(e),g(N,F),t.targetAnchor||Vo(N,t,u,d),f(F&&i(F),t,N,n,r,s,o))),Ms(t,I)}else I&&t.shapeFlag&16&&(k(e,t),t.targetStart=e,t.targetAnchor=i(e));return t.anchor&&i(t.anchor)}const Bs=Ql;function Ms(e,t){const n=e.ctx;if(n&&n.ut){let r,s;for(t?(r=e.el,s=e.anchor):(r=e.targetStart,s=e.targetAnchor);r&&r!==s;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function Vo(e,t,n,r,s=null){const o=t.targetStart=n(""),i=t.targetAnchor=n("");return o[Yl]=i,e&&(r(o,e,s),r(i,e,s)),i}const un=Symbol("_leaveCb"),Yr=Symbol("_enterCb");function sd(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Pn(()=>{e.isMounted=!0}),On(()=>{e.isUnmounting=!0}),e}const Jt=[Function,Array],Xl={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Jt,onEnter:Jt,onAfterEnter:Jt,onEnterCancelled:Jt,onBeforeLeave:Jt,onLeave:Jt,onAfterLeave:Jt,onLeaveCancelled:Jt,onBeforeAppear:Jt,onAppear:Jt,onAfterAppear:Jt,onAppearCancelled:Jt},Zl=e=>{const t=e.subTree;return t.component?Zl(t.component):t},od={name:"BaseTransition",props:Xl,setup(e,{slots:t}){const n=Ci(),r=sd();return()=>{const s=t.default&&nc(t.default(),!0);if(!s||!s.length)return;const o=ec(s),i=nt(e),{mode:a}=i;if(r.isLeaving)return go(o);const l=Yi(o);if(!l)return go(o);let d=Wo(l,i,r,n,f=>d=f);l.type!==Nt&&hs(l,d);let u=n.subTree&&Yi(n.subTree);if(u&&u.type!==Nt&&!dr(u,l)&&Zl(n).type!==Nt){let f=Wo(u,i,r,n);if(hs(u,f),a==="out-in"&&l.type!==Nt)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,u=void 0},go(o);a==="in-out"&&l.type!==Nt?f.delayLeave=(g,k,N)=>{const I=tc(r,u);I[String(u.key)]=u,g[un]=()=>{k(),g[un]=void 0,delete d.delayedLeave,u=void 0},d.delayedLeave=()=>{N(),delete d.delayedLeave,u=void 0}}:u=void 0}else u&&(u=void 0);return o}}};function ec(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Nt){t=n;break}}return t}const id=od;function tc(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function Wo(e,t,n,r,s){const{appear:o,mode:i,persisted:a=!1,onBeforeEnter:l,onEnter:d,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:g,onLeave:k,onAfterLeave:N,onLeaveCancelled:I,onBeforeAppear:F,onAppear:z,onAfterAppear:j,onAppearCancelled:U}=t,D=String(e.key),ae=tc(n,e),ue=(oe,X)=>{oe&&sn(oe,r,9,X)},de=(oe,X)=>{const me=X[1];ue(oe,X),Be(oe)?oe.every(ne=>ne.length<=1)&&me():oe.length<=1&&me()},Te={mode:i,persisted:a,beforeEnter(oe){let X=l;if(!n.isMounted)if(o)X=F||l;else return;oe[un]&&oe[un](!0);const me=ae[D];me&&dr(e,me)&&me.el[un]&&me.el[un](),ue(X,[oe])},enter(oe){let X=d,me=u,ne=f;if(!n.isMounted)if(o)X=z||d,me=j||u,ne=U||f;else return;let Fe=!1;oe[Yr]=Ge=>{Fe||(Fe=!0,Ge?ue(ne,[oe]):ue(me,[oe]),Te.delayedLeave&&Te.delayedLeave(),oe[Yr]=void 0)};const He=oe[Yr].bind(null,!1);X?de(X,[oe,He]):He()},leave(oe,X){const me=String(e.key);if(oe[Yr]&&oe[Yr](!0),n.isUnmounting)return X();ue(g,[oe]);let ne=!1;oe[un]=He=>{ne||(ne=!0,X(),He?ue(I,[oe]):ue(N,[oe]),oe[un]=void 0,ae[me]===e&&delete ae[me])};const Fe=oe[un].bind(null,!1);ae[me]=e,k?de(k,[oe,Fe]):Fe()},clone(oe){const X=Wo(oe,t,n,r,s);return s&&s(X),X}};return Te}function go(e){if(Zs(e))return e=zn(e),e.children=null,e}function Yi(e){if(!Zs(e))return Jl(e.type)&&e.children?ec(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Ve(n.default))return n.default()}}function hs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,hs(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function nc(e,t=!1,n){let r=[],s=0;for(let o=0;o<e.length;o++){let i=e[o];const a=n==null?i.key:String(n)+String(i.key!=null?i.key:o);i.type===Ue?(i.patchFlag&128&&s++,r=r.concat(nc(i.children,t,a))):(t||i.type!==Nt)&&r.push(a!=null?zn(i,{key:a}):i)}if(s>1)for(let o=0;o<r.length;o++)r[o].patchFlag=-2;return r}function Et(e,t){return Ve(e)?xt({name:e.name},t,{setup:e}):e}function rc(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Ji(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Fs=new WeakMap;function is(e,t,n,r,s=!1){if(Be(e)){e.forEach((I,F)=>is(I,t&&(Be(t)?t[F]:t),n,r,s));return}if(Br(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&is(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?so(r.component):r.el,i=s?null:o,{i:a,r:l}=e,d=t&&t.r,u=a.refs===ht?a.refs={}:a.refs,f=a.setupState,g=nt(f),k=f===ht?gl:I=>Ji(u,I)?!1:st(g,I),N=(I,F)=>!(F&&Ji(u,F));if(d!=null&&d!==l){if(Qi(t),_t(d))u[d]=null,k(d)&&(f[d]=null);else if(Dt(d)){const I=t;N(d,I.k)&&(d.value=null),I.k&&(u[I.k]=null)}}if(Ve(l))bs(l,a,12,[i,u]);else{const I=_t(l),F=Dt(l);if(I||F){const z=()=>{if(e.f){const j=I?k(l)?f[l]:u[l]:N()||!e.k?l.value:u[e.k];if(s)Be(j)&&ui(j,o);else if(Be(j))j.includes(o)||j.push(o);else if(I)u[l]=[o],k(l)&&(f[l]=u[l]);else{const U=[o];N(l,e.k)&&(l.value=U),e.k&&(u[e.k]=U)}}else I?(u[l]=i,k(l)&&(f[l]=i)):F&&(N(l,e.k)&&(l.value=i),e.k&&(u[e.k]=i))};if(i){const j=()=>{z(),Fs.delete(e)};j.id=-1,Fs.set(e,j),Pt(j,n)}else Qi(e),z()}}}function Qi(e){const t=Fs.get(e);t&&(t.flags|=8,Fs.delete(e))}Ys().requestIdleCallback;Ys().cancelIdleCallback;const Br=e=>!!e.type.__asyncLoader,Zs=e=>e.type.__isKeepAlive;function ad(e,t){sc(e,"a",t)}function ld(e,t){sc(e,"da",t)}function sc(e,t,n=jt){const r=e.__wdc||(e.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return e()});if(eo(t,r,n),n){let s=n.parent;for(;s&&s.parent;)Zs(s.parent.vnode)&&cd(r,t,n,s),s=s.parent}}function cd(e,t,n,r){const s=eo(t,e,r,!0);to(()=>{ui(r[t],s)},n)}function eo(e,t,n=jt,r=!1){if(n){const s=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...i)=>{En();const a=_s(n),l=sn(t,n,e,i);return a(),An(),l});return r?s.unshift(o):s.push(o),o}}const Mn=e=>(t,n=jt)=>{(!gs||e==="sp")&&eo(e,(...r)=>t(...r),n)},ud=Mn("bm"),Pn=Mn("m"),dd=Mn("bu"),fd=Mn("u"),On=Mn("bum"),to=Mn("um"),hd=Mn("sp"),pd=Mn("rtg"),md=Mn("rtc");function gd(e,t=jt){eo("ec",e,t)}const vd="components",oc=Symbol.for("v-ndc");function qo(e){return _t(e)?yd(vd,e,!1)||e:e||oc}function yd(e,t,n=!0,r=!1){const s=It||jt;if(s){const o=s.type;{const a=rf(o,!1);if(a&&(a===t||a===Zt(t)||a===zs(Zt(t))))return o}const i=Xi(s[e]||o[e],t)||Xi(s.appContext[e],t);return!i&&r?o:i}}function Xi(e,t){return e&&(e[t]||e[Zt(t)]||e[zs(Zt(t))])}function wt(e,t,n,r){let s;const o=n,i=Be(e);if(i||_t(e)){const a=i&&mr(e);let l=!1,d=!1;a&&(l=!Xt(e),d=In(e),e=Js(e)),s=new Array(e.length);for(let u=0,f=e.length;u<f;u++)s[u]=t(l?d?Hr(rn(e[u])):rn(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(ot(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 fn(e,t,n={},r,s){if(It.ce||It.parent&&Br(It.parent)&&It.parent.ce){const d=Object.keys(n).length>0;return t!=="default"&&(n.name=t),w(),dt(Ue,null,[Ce("slot",n,r)],d?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),w();const i=o&&ic(o(n)),a=n.key||i&&i.key,l=dt(Ue,{key:(a&&!nn(a)?a:`_${t}`)+(!i&&r?"_fb":"")},i||[],i&&e._===1?64:-2);return o&&o._c&&(o._d=!0),l}function ic(e){return e.some(t=>ms(t)?!(t.type===Nt||t.type===Ue&&!ic(t.children)):!0)?e:null}const Ko=e=>e?Cc(e)?so(e):Ko(e.parent):null,as=xt(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Ko(e.parent),$root:e=>Ko(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>lc(e),$forceUpdate:e=>e.f||(e.f=()=>{_i(e.update)}),$nextTick:e=>e.n||(e.n=zt.bind(e.proxy)),$watch:e=>nd.bind(e)}),vo=(e,t)=>e!==ht&&!e.__isScriptSetup&&st(e,t),wd={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,props:o,accessCache:i,type:a,appContext:l}=e;if(t[0]!=="$"){const 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(vo(r,t))return i[t]=1,r[t];if(s!==ht&&st(s,t))return i[t]=2,s[t];if(st(o,t))return i[t]=3,o[t];if(n!==ht&&st(n,t))return i[t]=4,n[t];Go&&(i[t]=0)}}const d=as[t];let u,f;if(d)return t==="$attrs"&&Ot(e.attrs,"get",""),d(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==ht&&st(n,t))return i[t]=4,n[t];if(f=l.config.globalProperties,st(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:s,ctx:o}=e;return vo(s,t)?(s[t]=n,!0):r!==ht&&st(r,t)?(r[t]=n,!0):st(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!==ht&&a[0]!=="$"&&st(e,a)||vo(t,a)||st(o,a)||st(r,a)||st(as,a)||st(s.config.globalProperties,a)||(l=i.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:st(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function bd(){return _d().slots}function _d(e){const t=Ci();return t.setupContext||(t.setupContext=Ac(t))}function Zi(e){return Be(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Go=!0;function kd(e){const t=lc(e),n=e.proxy,r=e.ctx;Go=!1,t.beforeCreate&&ea(t.beforeCreate,e,"bc");const{data:s,computed:o,methods:i,watch:a,provide:l,inject:d,created:u,beforeMount:f,mounted:g,beforeUpdate:k,updated:N,activated:I,deactivated:F,beforeDestroy:z,beforeUnmount:j,destroyed:U,unmounted:D,render:ae,renderTracked:ue,renderTriggered:de,errorCaptured:Te,serverPrefetch:oe,expose:X,inheritAttrs:me,components:ne,directives:Fe,filters:He}=t;if(d&&Td(d,r,null),i)for(const _e in i){const Oe=i[_e];Ve(Oe)&&(r[_e]=Oe.bind(n))}if(s){const _e=s.call(n,n);ot(_e)&&(e.data=Qs(_e))}if(Go=!0,o)for(const _e in o){const Oe=o[_e],vt=Ve(Oe)?Oe.bind(n,n):Ve(Oe.get)?Oe.get.bind(n,n):hn,Ze=!Ve(Oe)&&Ve(Oe.set)?Oe.set.bind(n):hn,ct=ce({get:vt,set:Ze});Object.defineProperty(r,_e,{enumerable:!0,configurable:!0,get:()=>ct.value,set:tt=>ct.value=tt})}if(a)for(const _e in a)ac(a[_e],r,n,_e);if(l){const _e=Ve(l)?l.call(n):l;Reflect.ownKeys(_e).forEach(Oe=>{$s(Oe,_e[Oe])})}u&&ea(u,e,"c");function Ae(_e,Oe){Be(Oe)?Oe.forEach(vt=>_e(vt.bind(n))):Oe&&_e(Oe.bind(n))}if(Ae(ud,f),Ae(Pn,g),Ae(dd,k),Ae(fd,N),Ae(ad,I),Ae(ld,F),Ae(gd,Te),Ae(md,ue),Ae(pd,de),Ae(On,j),Ae(to,D),Ae(hd,oe),Be(X))if(X.length){const _e=e.exposed||(e.exposed={});X.forEach(Oe=>{Object.defineProperty(_e,Oe,{get:()=>n[Oe],set:vt=>n[Oe]=vt,enumerable:!0})})}else e.exposed||(e.exposed={});ae&&e.render===hn&&(e.render=ae),me!=null&&(e.inheritAttrs=me),ne&&(e.components=ne),Fe&&(e.directives=Fe),oe&&rc(e)}function Td(e,t,n=hn){Be(e)&&(e=zo(e));for(const r in e){const s=e[r];let o;ot(s)?"default"in s?o=tn(s.from||r,s.default,!0):o=tn(s.from||r):o=tn(s),Dt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:i=>o.value=i}):t[r]=o}}function ea(e,t,n){sn(Be(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function ac(e,t,n,r){let s=r.includes(".")?zl(n,r):()=>n[r];if(_t(e)){const o=t[e];Ve(o)&&at(s,o)}else if(Ve(e))at(s,e.bind(n));else if(ot(e))if(Be(e))e.forEach(o=>ac(o,t,n,r));else{const o=Ve(e.handler)?e.handler.bind(n):t[e.handler];Ve(o)&&at(s,o,e)}}function lc(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:s,optionsCache:o,config:{optionMergeStrategies:i}}=e.appContext,a=o.get(t);let l;return a?l=a:!s.length&&!n&&!r?l=t:(l={},s.length&&s.forEach(d=>Hs(l,d,i,!0)),Hs(l,t,i)),ot(t)&&o.set(t,l),l}function Hs(e,t,n,r=!1){const{mixins:s,extends:o}=t;o&&Hs(e,o,n,!0),s&&s.forEach(i=>Hs(e,i,n,!0));for(const i in t)if(!(r&&i==="expose")){const a=Sd[i]||n&&n[i];e[i]=a?a(e[i],t[i]):t[i]}return e}const Sd={data:ta,props:na,emits:na,methods:ts,computed:ts,beforeCreate:Lt,created:Lt,beforeMount:Lt,mounted:Lt,beforeUpdate:Lt,updated:Lt,beforeDestroy:Lt,beforeUnmount:Lt,destroyed:Lt,unmounted:Lt,activated:Lt,deactivated:Lt,errorCaptured:Lt,serverPrefetch:Lt,components:ts,directives:ts,watch:Cd,provide:ta,inject:xd};function ta(e,t){return t?e?function(){return xt(Ve(e)?e.call(this,this):e,Ve(t)?t.call(this,this):t)}:t:e}function xd(e,t){return ts(zo(e),zo(t))}function zo(e){if(Be(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Lt(e,t){return e?[...new Set([].concat(e,t))]:t}function ts(e,t){return e?xt(Object.create(null),e,t):t}function na(e,t){return e?Be(e)&&Be(t)?[...new Set([...e,...t])]:xt(Object.create(null),Zi(e),Zi(t??{})):t}function Cd(e,t){if(!e)return t;if(!t)return e;const n=xt(Object.create(null),e);for(const r in t)n[r]=Lt(e[r],t[r]);return n}function cc(){return{app:null,config:{isNativeTag:gl,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Ed=0;function Ad(e,t){return function(r,s=null){Ve(r)||(r=xt({},r)),s!=null&&!ot(s)&&(s=null);const o=cc(),i=new WeakSet,a=[];let l=!1;const d=o.app={_uid:Ed++,_component:r,_props:s,_container:null,_context:o,_instance:null,version:of,get config(){return o.config},set config(u){},use(u,...f){return i.has(u)||(u&&Ve(u.install)?(i.add(u),u.install(d,...f)):Ve(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 k=d._ceVNode||Ce(r,s);return k.appContext=o,g===!0?g="svg":g===!1&&(g=void 0),e(k,u,g),l=!0,d._container=u,u.__vue_app__=d,so(k.component)}},onUnmount(u){a.push(u)},unmount(){l&&(sn(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=Fr;Fr=d;try{return u()}finally{Fr=f}}};return d}}let Fr=null;const Id=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Zt(t)}Modifiers`]||e[`${Yn(t)}Modifiers`];function Rd(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||ht;let s=n;const o=t.startsWith("update:"),i=o&&Id(r,t.slice(7));i&&(i.trim&&(s=n.map(u=>_t(u)?u.trim():u)),i.number&&(s=n.map(fi)));let a,l=r[a=uo(t)]||r[a=uo(Zt(t))];!l&&o&&(l=r[a=uo(Yn(t))]),l&&sn(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,sn(d,e,6,s)}}const $d=new WeakMap;function uc(e,t,n=!1){const r=n?$d:t.emitsCache,s=r.get(e);if(s!==void 0)return s;const o=e.emits;let i={},a=!1;if(!Ve(e)){const l=d=>{const u=uc(d,t,!0);u&&(a=!0,xt(i,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!a?(ot(e)&&r.set(e,null),null):(Be(o)?o.forEach(l=>i[l]=null):xt(i,o),ot(e)&&r.set(e,i),i)}function no(e,t){return!e||!Ks(t)?!1:(t=t.slice(2).replace(/Once$/,""),st(e,t[0].toLowerCase()+t.slice(1))||st(e,Yn(t))||st(e,t))}function ra(e){const{type:t,vnode:n,proxy:r,withProxy:s,propsOptions:[o],slots:i,attrs:a,emit:l,render:d,renderCache:u,props:f,data:g,setupState:k,ctx:N,inheritAttrs:I}=e,F=Ls(e);let z,j;try{if(n.shapeFlag&4){const D=s||r,ae=D;z=dn(d.call(ae,D,u,f,k,g,N)),j=a}else{const D=t;z=dn(D.length>1?D(f,{attrs:a,slots:i,emit:l}):D(f,null)),j=t.props?a:Md(a)}}catch(D){ls.length=0,Xs(D,e,1),z=Ce(Nt)}let U=z;if(j&&I!==!1){const D=Object.keys(j),{shapeFlag:ae}=U;D.length&&ae&7&&(o&&D.some(ci)&&(j=Pd(j,o)),U=zn(U,j,!1,!0))}return n.dirs&&(U=zn(U,null,!1,!0),U.dirs=U.dirs?U.dirs.concat(n.dirs):n.dirs),n.transition&&hs(U,n.transition),z=U,Ls(F),z}const Md=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ks(n))&&((t||(t={}))[n]=e[n]);return t},Pd=(e,t)=>{const n={};for(const r in e)(!ci(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Od(e,t,n){const{props:r,children:s,component:o}=e,{props:i,children:a,patchFlag:l}=t,d=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?sa(r,i,d):!!i;if(l&8){const u=t.dynamicProps;for(let f=0;f<u.length;f++){const g=u[f];if(dc(i,r,g)&&!no(d,g))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===i?!1:r?i?sa(r,i,d):!0:!!i;return!1}function sa(e,t,n){const r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let s=0;s<r.length;s++){const o=r[s];if(dc(t,e,o)&&!no(n,o))return!0}return!1}function dc(e,t,n){const r=e[n],s=t[n];return n==="style"&&ot(r)&&ot(s)?!hi(r,s):r!==s}function Nd({vnode:e,parent:t},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.el=e.el),r===e)(e=t.vnode).el=n,t=t.parent;else break}}const fc={},hc=()=>Object.create(fc),pc=e=>Object.getPrototypeOf(e)===fc;function jd(e,t,n,r=!1){const s={},o=hc();e.propsDefaults=Object.create(null),mc(e,t,s,o);for(const i in e.propsOptions[0])i in s||(s[i]=void 0);n?e.props=r?s:Bl(s):e.type.props?e.props=s:e.props=o,e.attrs=o}function Dd(e,t,n,r){const{props:s,attrs:o,vnode:{patchFlag:i}}=e,a=nt(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(no(e.emitsOptions,g))continue;const k=t[g];if(l)if(st(o,g))k!==o[g]&&(o[g]=k,d=!0);else{const N=Zt(g);s[N]=Yo(l,a,N,k,e,!1)}else k!==o[g]&&(o[g]=k,d=!0)}}}else{mc(e,t,s,o)&&(d=!0);let u;for(const f in a)(!t||!st(t,f)&&((u=Yn(f))===f||!st(t,u)))&&(l?n&&(n[f]!==void 0||n[u]!==void 0)&&(s[f]=Yo(l,a,f,void 0,e,!0)):delete s[f]);if(o!==a)for(const f in o)(!t||!st(t,f))&&(delete o[f],d=!0)}d&&Sn(e.attrs,"set","")}function mc(e,t,n,r){const[s,o]=e.propsOptions;let i=!1,a;if(t)for(let l in t){if(ns(l))continue;const d=t[l];let u;s&&st(s,u=Zt(l))?!o||!o.includes(u)?n[u]=d:(a||(a={}))[u]=d:no(e.emitsOptions,l)||(!(l in r)||d!==r[l])&&(r[l]=d,i=!0)}if(o){const l=nt(n),d=a||ht;for(let u=0;u<o.length;u++){const f=o[u];n[f]=Yo(s,l,f,d[f],e,!st(d,f))}}return i}function Yo(e,t,n,r,s,o){const i=e[n];if(i!=null){const a=st(i,"default");if(a&&r===void 0){const l=i.default;if(i.type!==Function&&!i.skipFactory&&Ve(l)){const{propsDefaults:d}=s;if(n in d)r=d[n];else{const u=_s(s);r=d[n]=l.call(null,t),u()}}else r=l;s.ce&&s.ce._setProp(n,r)}i[0]&&(o&&!a?r=!1:i[1]&&(r===""||r===Yn(n))&&(r=!0))}return r}const Ld=new WeakMap;function gc(e,t,n=!1){const r=n?Ld:t.propsCache,s=r.get(e);if(s)return s;const o=e.props,i={},a=[];let l=!1;if(!Ve(e)){const u=f=>{l=!0;const[g,k]=gc(f,t,!0);xt(i,g),k&&a.push(...k)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!o&&!l)return ot(e)&&r.set(e,jr),jr;if(Be(o))for(let u=0;u<o.length;u++){const f=Zt(o[u]);oa(f)&&(i[f]=ht)}else if(o)for(const u in o){const f=Zt(u);if(oa(f)){const g=o[u],k=i[f]=Be(g)||Ve(g)?{type:g}:xt({},g),N=k.type;let I=!1,F=!0;if(Be(N))for(let z=0;z<N.length;++z){const j=N[z],U=Ve(j)&&j.name;if(U==="Boolean"){I=!0;break}else U==="String"&&(F=!1)}else I=Ve(N)&&N.name==="Boolean";k[0]=I,k[1]=F,(I||st(k,"default"))&&a.push(f)}}const d=[i,a];return ot(e)&&r.set(e,d),d}function oa(e){return e[0]!=="$"&&!ns(e)}const ki=e=>e==="_"||e==="_ctx"||e==="$stable",Ti=e=>Be(e)?e.map(dn):[dn(e)],Bd=(e,t,n)=>{if(t._n)return t;const r=it((...s)=>Ti(t(...s)),n);return r._c=!1,r},vc=(e,t,n)=>{const r=e._ctx;for(const s in e){if(ki(s))continue;const o=e[s];if(Ve(o))t[s]=Bd(s,o,r);else if(o!=null){const i=Ti(o);t[s]=()=>i}}},yc=(e,t)=>{const n=Ti(t);e.slots.default=()=>n},wc=(e,t,n)=>{for(const r in t)(n||!ki(r))&&(e[r]=t[r])},Fd=(e,t,n)=>{const r=e.slots=hc();if(e.vnode.shapeFlag&32){const s=t._;s?(wc(r,t,n),n&&_l(r,"_",s,!0)):vc(t,r)}else t&&yc(e,t)},Hd=(e,t,n)=>{const{vnode:r,slots:s}=e;let o=!0,i=ht;if(r.shapeFlag&32){const a=t._;a?n&&a===1?o=!1:wc(s,t,n):(o=!t.$stable,vc(t,s)),i=t}else t&&(yc(e,t),i={default:1});if(o)for(const a in s)!ki(a)&&i[a]==null&&delete s[a]},Pt=Kd;function Ud(e){return Vd(e)}function Vd(e,t){const n=Ys();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:k=hn,insertStaticContent:N}=e,I=(p,y,x,O=null,B=null,L=null,ee=void 0,se=null,Q=!!y.dynamicChildren)=>{if(p===y)return;p&&!dr(p,y)&&(O=E(p),tt(p,B,L,!0),p=null),y.patchFlag===-2&&(Q=!1,y.dynamicChildren=null);const{type:V,ref:we,shapeFlag:ie}=y;switch(V){case ro:F(p,y,x,O);break;case Nt:z(p,y,x,O);break;case wo:p==null&&j(y,x,O,ee);break;case Ue:ne(p,y,x,O,B,L,ee,se,Q);break;default:ie&1?ae(p,y,x,O,B,L,ee,se,Q):ie&6?Fe(p,y,x,O,B,L,ee,se,Q):(ie&64||ie&128)&&V.process(p,y,x,O,B,L,ee,se,Q,ye)}we!=null&&B?is(we,p&&p.ref,L,y||p,!y):we==null&&p&&p.ref!=null&&is(p.ref,null,L,p,!0)},F=(p,y,x,O)=>{if(p==null)r(y.el=a(y.children),x,O);else{const B=y.el=p.el;y.children!==p.children&&d(B,y.children)}},z=(p,y,x,O)=>{p==null?r(y.el=l(y.children||""),x,O):y.el=p.el},j=(p,y,x,O)=>{[p.el,p.anchor]=N(p.children,y,x,O,p.el,p.anchor)},U=({el:p,anchor:y},x,O)=>{let B;for(;p&&p!==y;)B=g(p),r(p,x,O),p=B;r(y,x,O)},D=({el:p,anchor:y})=>{let x;for(;p&&p!==y;)x=g(p),s(p),p=x;s(y)},ae=(p,y,x,O,B,L,ee,se,Q)=>{if(y.type==="svg"?ee="svg":y.type==="math"&&(ee="mathml"),p==null)ue(y,x,O,B,L,ee,se,Q);else{const V=p.el&&p.el._isVueCE?p.el:null;try{V&&V._beginPatch(),oe(p,y,B,L,ee,se,Q)}finally{V&&V._endPatch()}}},ue=(p,y,x,O,B,L,ee,se)=>{let Q,V;const{props:we,shapeFlag:ie,transition:ge,dirs:ke}=p;if(Q=p.el=i(p.type,L,we&&we.is,we),ie&8?u(Q,p.children):ie&16&&Te(p.children,Q,null,O,B,yo(p,L),ee,se),ke&&or(p,null,O,"created"),de(Q,p,p.scopeId,ee,O),we){for(const We in we)We!=="value"&&!ns(We)&&o(Q,We,null,we[We],L,O);"value"in we&&o(Q,"value",null,we.value,L),(V=we.onVnodeBeforeMount)&&ln(V,O,p)}ke&&or(p,null,O,"beforeMount");const Ne=Wd(B,ge);Ne&&ge.beforeEnter(Q),r(Q,y,x),((V=we&&we.onVnodeMounted)||Ne||ke)&&Pt(()=>{V&&ln(V,O,p),Ne&&ge.enter(Q),ke&&or(p,null,O,"mounted")},B)},de=(p,y,x,O,B)=>{if(x&&k(p,x),O)for(let L=0;L<O.length;L++)k(p,O[L]);if(B){let L=B.subTree;if(y===L||kc(L.type)&&(L.ssContent===y||L.ssFallback===y)){const ee=B.vnode;de(p,ee,ee.scopeId,ee.slotScopeIds,B.parent)}}},Te=(p,y,x,O,B,L,ee,se,Q=0)=>{for(let V=Q;V<p.length;V++){const we=p[V]=se?Tn(p[V]):dn(p[V]);I(null,we,y,x,O,B,L,ee,se)}},oe=(p,y,x,O,B,L,ee)=>{const se=y.el=p.el;let{patchFlag:Q,dynamicChildren:V,dirs:we}=y;Q|=p.patchFlag&16;const ie=p.props||ht,ge=y.props||ht;let ke;if(x&&ir(x,!1),(ke=ge.onVnodeBeforeUpdate)&&ln(ke,x,y,p),we&&or(y,p,x,"beforeUpdate"),x&&ir(x,!0),(ie.innerHTML&&ge.innerHTML==null||ie.textContent&&ge.textContent==null)&&u(se,""),V?X(p.dynamicChildren,V,se,x,O,yo(y,B),L):ee||Oe(p,y,se,null,x,O,yo(y,B),L,!1),Q>0){if(Q&16)me(se,ie,ge,x,B);else if(Q&2&&ie.class!==ge.class&&o(se,"class",null,ge.class,B),Q&4&&o(se,"style",ie.style,ge.style,B),Q&8){const Ne=y.dynamicProps;for(let We=0;We<Ne.length;We++){const Ie=Ne[We],pt=ie[Ie],Ke=ge[Ie];(Ke!==pt||Ie==="value")&&o(se,Ie,pt,Ke,B,x)}}Q&1&&p.children!==y.children&&u(se,y.children)}else!ee&&V==null&&me(se,ie,ge,x,B);((ke=ge.onVnodeUpdated)||we)&&Pt(()=>{ke&&ln(ke,x,y,p),we&&or(y,p,x,"updated")},O)},X=(p,y,x,O,B,L,ee)=>{for(let se=0;se<y.length;se++){const Q=p[se],V=y[se],we=Q.el&&(Q.type===Ue||!dr(Q,V)||Q.shapeFlag&198)?f(Q.el):x;I(Q,V,we,null,O,B,L,ee,!0)}},me=(p,y,x,O,B)=>{if(y!==x){if(y!==ht)for(const L in y)!ns(L)&&!(L in x)&&o(p,L,y[L],null,B,O);for(const L in x){if(ns(L))continue;const ee=x[L],se=y[L];ee!==se&&L!=="value"&&o(p,L,se,ee,B,O)}"value"in x&&o(p,"value",y.value,x.value,B)}},ne=(p,y,x,O,B,L,ee,se,Q)=>{const V=y.el=p?p.el:a(""),we=y.anchor=p?p.anchor:a("");let{patchFlag:ie,dynamicChildren:ge,slotScopeIds:ke}=y;ke&&(se=se?se.concat(ke):ke),p==null?(r(V,x,O),r(we,x,O),Te(y.children||[],x,we,B,L,ee,se,Q)):ie>0&&ie&64&&ge&&p.dynamicChildren&&p.dynamicChildren.length===ge.length?(X(p.dynamicChildren,ge,x,B,L,ee,se),(y.key!=null||B&&y===B.subTree)&&Si(p,y,!0)):Oe(p,y,x,we,B,L,ee,se,Q)},Fe=(p,y,x,O,B,L,ee,se,Q)=>{y.slotScopeIds=se,p==null?y.shapeFlag&512?B.ctx.activate(y,x,O,ee,Q):He(y,x,O,B,L,ee,Q):Ge(p,y,Q)},He=(p,y,x,O,B,L,ee)=>{const se=p.component=Zd(p,O,B);if(Zs(p)&&(se.ctx.renderer=ye),ef(se,!1,ee),se.asyncDep){if(B&&B.registerDep(se,Ae,ee),!p.el){const Q=se.subTree=Ce(Nt);z(null,Q,y,x),p.placeholder=Q.el}}else Ae(se,p,y,x,B,L,ee)},Ge=(p,y,x)=>{const O=y.component=p.component;if(Od(p,y,x))if(O.asyncDep&&!O.asyncResolved){_e(O,y,x);return}else O.next=y,O.update();else y.el=p.el,O.vnode=y},Ae=(p,y,x,O,B,L,ee)=>{const se=()=>{if(p.isMounted){let{next:ie,bu:ge,u:ke,parent:Ne,vnode:We}=p;{const W=bc(p);if(W){ie&&(ie.el=We.el,_e(p,ie,ee)),W.asyncDep.then(()=>{Pt(()=>{p.isUnmounted||V()},B)});return}}let Ie=ie,pt;ir(p,!1),ie?(ie.el=We.el,_e(p,ie,ee)):ie=We,ge&&Rs(ge),(pt=ie.props&&ie.props.onVnodeBeforeUpdate)&&ln(pt,Ne,ie,We),ir(p,!0);const Ke=ra(p),H=p.subTree;p.subTree=Ke,I(H,Ke,f(H.el),E(H),p,B,L),ie.el=Ke.el,Ie===null&&Nd(p,Ke.el),ke&&Pt(ke,B),(pt=ie.props&&ie.props.onVnodeUpdated)&&Pt(()=>ln(pt,Ne,ie,We),B)}else{let ie;const{el:ge,props:ke}=y,{bm:Ne,m:We,parent:Ie,root:pt,type:Ke}=p,H=Br(y);ir(p,!1),Ne&&Rs(Ne),!H&&(ie=ke&&ke.onVnodeBeforeMount)&&ln(ie,Ie,y),ir(p,!0);{pt.ce&&pt.ce._hasShadowRoot()&&pt.ce._injectChildStyle(Ke);const W=p.subTree=ra(p);I(null,W,x,O,p,B,L),y.el=W.el}if(We&&Pt(We,B),!H&&(ie=ke&&ke.onVnodeMounted)){const W=y;Pt(()=>ln(ie,Ie,W),B)}(y.shapeFlag&256||Ie&&Br(Ie.vnode)&&Ie.vnode.shapeFlag&256)&&p.a&&Pt(p.a,B),p.isMounted=!0,y=x=O=null}};p.scope.on();const Q=p.effect=new xl(se);p.scope.off();const V=p.update=Q.run.bind(Q),we=p.job=Q.runIfDirty.bind(Q);we.i=p,we.id=p.uid,Q.scheduler=()=>_i(we),ir(p,!0),V()},_e=(p,y,x)=>{y.component=p;const O=p.vnode.props;p.vnode=y,p.next=null,Dd(p,y.props,O,x),Hd(p,y.children,x),En(),qi(p),An()},Oe=(p,y,x,O,B,L,ee,se,Q=!1)=>{const V=p&&p.children,we=p?p.shapeFlag:0,ie=y.children,{patchFlag:ge,shapeFlag:ke}=y;if(ge>0){if(ge&128){Ze(V,ie,x,O,B,L,ee,se,Q);return}else if(ge&256){vt(V,ie,x,O,B,L,ee,se,Q);return}}ke&8?(we&16&&Se(V,B,L),ie!==V&&u(x,ie)):we&16?ke&16?Ze(V,ie,x,O,B,L,ee,se,Q):Se(V,B,L,!0):(we&8&&u(x,""),ke&16&&Te(ie,x,O,B,L,ee,se,Q))},vt=(p,y,x,O,B,L,ee,se,Q)=>{p=p||jr,y=y||jr;const V=p.length,we=y.length,ie=Math.min(V,we);let ge;for(ge=0;ge<ie;ge++){const ke=y[ge]=Q?Tn(y[ge]):dn(y[ge]);I(p[ge],ke,x,null,B,L,ee,se,Q)}V>we?Se(p,B,L,!0,!1,ie):Te(y,x,O,B,L,ee,se,Q,ie)},Ze=(p,y,x,O,B,L,ee,se,Q)=>{let V=0;const we=y.length;let ie=p.length-1,ge=we-1;for(;V<=ie&&V<=ge;){const ke=p[V],Ne=y[V]=Q?Tn(y[V]):dn(y[V]);if(dr(ke,Ne))I(ke,Ne,x,null,B,L,ee,se,Q);else break;V++}for(;V<=ie&&V<=ge;){const ke=p[ie],Ne=y[ge]=Q?Tn(y[ge]):dn(y[ge]);if(dr(ke,Ne))I(ke,Ne,x,null,B,L,ee,se,Q);else break;ie--,ge--}if(V>ie){if(V<=ge){const ke=ge+1,Ne=ke<we?y[ke].el:O;for(;V<=ge;)I(null,y[V]=Q?Tn(y[V]):dn(y[V]),x,Ne,B,L,ee,se,Q),V++}}else if(V>ge)for(;V<=ie;)tt(p[V],B,L,!0),V++;else{const ke=V,Ne=V,We=new Map;for(V=Ne;V<=ge;V++){const b=y[V]=Q?Tn(y[V]):dn(y[V]);b.key!=null&&We.set(b.key,V)}let Ie,pt=0;const Ke=ge-Ne+1;let H=!1,W=0;const J=new Array(Ke);for(V=0;V<Ke;V++)J[V]=0;for(V=ke;V<=ie;V++){const b=p[V];if(pt>=Ke){tt(b,B,L,!0);continue}let A;if(b.key!=null)A=We.get(b.key);else for(Ie=Ne;Ie<=ge;Ie++)if(J[Ie-Ne]===0&&dr(b,y[Ie])){A=Ie;break}A===void 0?tt(b,B,L,!0):(J[A-Ne]=V+1,A>=W?W=A:H=!0,I(b,y[A],x,null,B,L,ee,se,Q),pt++)}const Ye=H?qd(J):jr;for(Ie=Ye.length-1,V=Ke-1;V>=0;V--){const b=Ne+V,A=y[b],M=y[b+1],re=b+1<we?M.el||_c(M):O;J[V]===0?I(null,A,x,re,B,L,ee,se,Q):H&&(Ie<0||V!==Ye[Ie]?ct(A,x,re,2):Ie--)}}},ct=(p,y,x,O,B=null)=>{const{el:L,type:ee,transition:se,children:Q,shapeFlag:V}=p;if(V&6){ct(p.component.subTree,y,x,O);return}if(V&128){p.suspense.move(y,x,O);return}if(V&64){ee.move(p,y,x,ye);return}if(ee===Ue){r(L,y,x);for(let ie=0;ie<Q.length;ie++)ct(Q[ie],y,x,O);r(p.anchor,y,x);return}if(ee===wo){U(p,y,x);return}if(O!==2&&V&1&&se)if(O===0)se.beforeEnter(L),r(L,y,x),Pt(()=>se.enter(L),B);else{const{leave:ie,delayLeave:ge,afterLeave:ke}=se,Ne=()=>{p.ctx.isUnmounted?s(L):r(L,y,x)},We=()=>{L._isLeaving&&L[un](!0),ie(L,()=>{Ne(),ke&&ke()})};ge?ge(L,Ne,We):We()}else r(L,y,x)},tt=(p,y,x,O=!1,B=!1)=>{const{type:L,props:ee,ref:se,children:Q,dynamicChildren:V,shapeFlag:we,patchFlag:ie,dirs:ge,cacheIndex:ke}=p;if(ie===-2&&(B=!1),se!=null&&(En(),is(se,null,x,p,!0),An()),ke!=null&&(y.renderCache[ke]=void 0),we&256){y.ctx.deactivate(p);return}const Ne=we&1&&ge,We=!Br(p);let Ie;if(We&&(Ie=ee&&ee.onVnodeBeforeUnmount)&&ln(Ie,y,p),we&6)Ee(p.component,x,O);else{if(we&128){p.suspense.unmount(x,O);return}Ne&&or(p,null,y,"beforeUnmount"),we&64?p.type.remove(p,y,x,ye,O):V&&!V.hasOnce&&(L!==Ue||ie>0&&ie&64)?Se(V,y,x,!1,!0):(L===Ue&&ie&384||!B&&we&16)&&Se(Q,y,x),O&&ze(p)}(We&&(Ie=ee&&ee.onVnodeUnmounted)||Ne)&&Pt(()=>{Ie&&ln(Ie,y,p),Ne&&or(p,null,y,"unmounted")},x)},ze=p=>{const{type:y,el:x,anchor:O,transition:B}=p;if(y===Ue){he(x,O);return}if(y===wo){D(p);return}const L=()=>{s(x),B&&!B.persisted&&B.afterLeave&&B.afterLeave()};if(p.shapeFlag&1&&B&&!B.persisted){const{leave:ee,delayLeave:se}=B,Q=()=>ee(x,L);se?se(p.el,L,Q):Q()}else L()},he=(p,y)=>{let x;for(;p!==y;)x=g(p),s(p),p=x;s(y)},Ee=(p,y,x)=>{const{bum:O,scope:B,job:L,subTree:ee,um:se,m:Q,a:V}=p;ia(Q),ia(V),O&&Rs(O),B.stop(),L&&(L.flags|=8,tt(ee,p,y,x)),se&&Pt(se,y),Pt(()=>{p.isUnmounted=!0},y)},Se=(p,y,x,O=!1,B=!1,L=0)=>{for(let ee=L;ee<p.length;ee++)tt(p[ee],y,x,O,B)},E=p=>{if(p.shapeFlag&6)return E(p.component.subTree);if(p.shapeFlag&128)return p.suspense.next();const y=g(p.anchor||p.el),x=y&&y[Yl];return x?g(x):y};let Z=!1;const Y=(p,y,x)=>{let O;p==null?y._vnode&&(tt(y._vnode,null,null,!0),O=y._vnode.component):I(y._vnode||null,p,y,null,null,null,x),y._vnode=p,Z||(Z=!0,qi(O),Wl(),Z=!1)},ye={p:I,um:tt,m:ct,r:ze,mt:He,mc:Te,pc:Oe,pbc:X,n:E,o:e};return{render:Y,hydrate:void 0,createApp:Ad(Y)}}function yo({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function ir({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Wd(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function Si(e,t,n=!1){const r=e.children,s=t.children;if(Be(r)&&Be(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]=Tn(s[o]),a.el=i.el),!n&&a.patchFlag!==-2&&Si(i,a)),a.type===ro&&(a.patchFlag===-1&&(a=s[o]=Tn(a)),a.el=i.el),a.type===Nt&&!a.el&&(a.el=i.el)}}function qd(e){const t=e.slice(),n=[0];let r,s,o,i,a;const l=e.length;for(r=0;r<l;r++){const d=e[r];if(d!==0){if(s=n[n.length-1],e[s]<d){t[r]=s,n.push(r);continue}for(o=0,i=n.length-1;o<i;)a=o+i>>1,e[n[a]]<d?o=a+1:i=a;d<e[n[o]]&&(o>0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,i=n[o-1];o-- >0;)n[o]=i,i=t[i];return n}function bc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:bc(t)}function ia(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function _c(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?_c(t.subTree):null}const kc=e=>e.__isSuspense;function Kd(e,t){t&&t.pendingBranch?Be(e)?t.effects.push(...e):t.effects.push(e):Zu(e)}const Ue=Symbol.for("v-fgt"),ro=Symbol.for("v-txt"),Nt=Symbol.for("v-cmt"),wo=Symbol.for("v-stc"),ls=[];let Gt=null;function w(e=!1){ls.push(Gt=e?null:[])}function Gd(){ls.pop(),Gt=ls[ls.length-1]||null}let ps=1;function Us(e,t=!1){ps+=e,e<0&&Gt&&t&&(Gt.hasOnce=!0)}function Tc(e){return e.dynamicChildren=ps>0?Gt||jr:null,Gd(),ps>0&&Gt&&Gt.push(e),e}function S(e,t,n,r,s,o){return Tc(m(e,t,n,r,s,o,!0))}function dt(e,t,n,r,s){return Tc(Ce(e,t,n,r,s,!0))}function ms(e){return e?e.__v_isVNode===!0:!1}function dr(e,t){return e.type===t.type&&e.key===t.key}const Sc=({key:e})=>e??null,Ps=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?_t(e)||Dt(e)||Ve(e)?{i:It,r:e,k:t,f:!!n}:e:null);function m(e,t=null,n=null,r=0,s=null,o=e===Ue?0:1,i=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Sc(t),ref:t&&Ps(t),scopeId:Kl,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:It};return a?(xi(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=_t(n)?8:16),ps>0&&!i&&Gt&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Gt.push(l),l}const Ce=zd;function zd(e,t=null,n=null,r=0,s=null,o=!1){if((!e||e===oc)&&(e=Nt),ms(e)){const a=zn(e,t,!0);return n&&xi(a,n),ps>0&&!o&&Gt&&(a.shapeFlag&6?Gt[Gt.indexOf(e)]=a:Gt.push(a)),a.patchFlag=-2,a}if(sf(e)&&(e=e.__vccOpts),t){t=Yd(t);let{class:a,style:l}=t;a&&!_t(a)&&(t.class=lt(a)),ot(l)&&(bi(l)&&!Be(l)&&(l=xt({},l)),t.style=gr(l))}const i=_t(e)?1:kc(e)?128:Jl(e)?64:ot(e)?4:Ve(e)?2:0;return m(e,t,n,r,s,i,o,!0)}function Yd(e){return e?bi(e)||pc(e)?xt({},e):e:null}function zn(e,t,n=!1,r=!1){const{props:s,ref:o,patchFlag:i,children:a,transition:l}=e,d=t?xc(s||{},t):s,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&Sc(d),ref:t&&t.ref?n&&o?Be(o)?o.concat(Ps(t)):[o,Ps(t)]:Ps(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!==Ue?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&&zn(e.ssContent),ssFallback:e.ssFallback&&zn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&hs(u,l.clone(u)),u}function Jd(e=" ",t=0){return Ce(ro,null,e,t)}function le(e="",t=!1){return t?(w(),dt(Nt,null,e)):Ce(Nt,null,e)}function dn(e){return e==null||typeof e=="boolean"?Ce(Nt):Be(e)?Ce(Ue,null,e.slice()):ms(e)?Tn(e):Ce(ro,null,String(e))}function Tn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:zn(e)}function xi(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(Be(t))n=16;else if(typeof t=="object")if(r&65){const s=t.default;s&&(s._c&&(s._d=!1),xi(e,s()),s._c&&(s._d=!0));return}else{n=32;const s=t._;!s&&!pc(t)?t._ctx=It:s===3&&It&&(It.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Ve(t)?(t={default:t,_ctx:It},n=32):(t=String(t),r&64?(n=16,t=[Jd(t)]):n=8);e.children=t,e.shapeFlag|=n}function xc(...e){const t={};for(let n=0;n<e.length;n++){const r=e[n];for(const s in r)if(s==="class")t.class!==r.class&&(t.class=lt([t.class,r.class]));else if(s==="style")t.style=gr([t.style,r.style]);else if(Ks(s)){const o=t[s],i=r[s];i&&o!==i&&!(Be(o)&&o.includes(i))&&(t[s]=o?[].concat(o,i):i)}else s!==""&&(t[s]=r[s])}return t}function ln(e,t,n,r=null){sn(e,t,7,[n,r])}const Qd=cc();let Xd=0;function Zd(e,t,n){const r=e.type,s=(t?t.appContext:e.appContext)||Qd,o={uid:Xd++,vnode:e,type:r,parent:t,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Tu(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(s.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:gc(r,s),emitsOptions:uc(r,s),emit:null,emitted:null,propsDefaults:ht,inheritAttrs:r.inheritAttrs,ctx:ht,data:ht,props:ht,attrs:ht,slots:ht,refs:ht,setupState:ht,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=t?t.root:o,o.emit=Rd.bind(null,o),e.ce&&e.ce(o),o}let jt=null;const Ci=()=>jt||It;let Vs,Jo;{const e=Ys(),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)}};Vs=t("__VUE_INSTANCE_SETTERS__",n=>jt=n),Jo=t("__VUE_SSR_SETTERS__",n=>gs=n)}const _s=e=>{const t=jt;return Vs(e),e.scope.on(),()=>{e.scope.off(),Vs(t)}},aa=()=>{jt&&jt.scope.off(),Vs(null)};function Cc(e){return e.vnode.shapeFlag&4}let gs=!1;function ef(e,t=!1,n=!1){t&&Jo(t);const{props:r,children:s}=e.vnode,o=Cc(e);jd(e,r,o,t),Fd(e,s,n||t);const i=o?tf(e,t):void 0;return t&&Jo(!1),i}function tf(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,wd);const{setup:r}=n;if(r){En();const s=e.setupContext=r.length>1?Ac(e):null,o=_s(e),i=bs(r,e,0,[e.props,s]),a=yl(i);if(An(),o(),(a||e.sp)&&!Br(e)&&rc(e),a){if(i.then(aa,aa),t)return i.then(l=>{la(e,l)}).catch(l=>{Xs(l,e,0)});e.asyncDep=i}else la(e,i)}else Ec(e)}function la(e,t,n){Ve(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ot(t)&&(e.setupState=Hl(t)),Ec(e)}function Ec(e,t,n){const r=e.type;e.render||(e.render=r.render||hn);{const s=_s(e);En();try{kd(e)}finally{An(),s()}}}const nf={get(e,t){return Ot(e,"get",""),e[t]}};function Ac(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,nf),slots:e.slots,emit:e.emit,expose:t}}function so(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Hl(Vu(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in as)return as[n](e)},has(t,n){return n in t||n in as}})):e.proxy}function rf(e,t=!0){return Ve(e)?e.displayName||e.name:e.name||t&&e.__name}function sf(e){return Ve(e)&&"__vccOpts"in e}const ce=(e,t)=>zu(e,t,gs);function Ei(e,t,n){try{Us(-1);const r=arguments.length;return r===2?ot(t)&&!Be(t)?ms(t)?Ce(e,null,[t]):Ce(e,t):Ce(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ms(n)&&(n=[n]),Ce(e,t,n))}finally{Us(1)}}const of="3.5.28";/**
|
|
14
|
-
* @vue/runtime-dom v3.5.28
|
|
15
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
16
|
-
* @license MIT
|
|
17
|
-
**/let Qo;const ca=typeof window<"u"&&window.trustedTypes;if(ca)try{Qo=ca.createPolicy("vue",{createHTML:e=>e})}catch{}const Ic=Qo?e=>Qo.createHTML(e):e=>e,af="http://www.w3.org/2000/svg",lf="http://www.w3.org/1998/Math/MathML",kn=typeof document<"u"?document:null,ua=kn&&kn.createElement("template"),cf={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const s=t==="svg"?kn.createElementNS(af,e):t==="mathml"?kn.createElementNS(lf,e):n?kn.createElement(e,{is:n}):kn.createElement(e);return e==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:e=>kn.createTextNode(e),createComment:e=>kn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>kn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,s,o){const i=n?n.previousSibling:t.lastChild;if(s&&(s===o||s.nextSibling))for(;t.insertBefore(s.cloneNode(!0),n),!(s===o||!(s=s.nextSibling)););else{ua.innerHTML=Ic(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const a=ua.content;if(r==="svg"||r==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[i?i.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Fn="transition",Jr="animation",vs=Symbol("_vtc"),Rc={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},uf=xt({},Xl,Rc),df=e=>(e.displayName="Transition",e.props=uf,e),$c=df((e,{slots:t})=>Ei(id,ff(e),t)),ar=(e,t=[])=>{Be(e)?e.forEach(n=>n(...t)):e&&e(...t)},da=e=>e?Be(e)?e.some(t=>t.length>1):e.length>1:!1;function ff(e){const t={};for(const ne in e)ne in Rc||(t[ne]=e[ne]);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:k=`${n}-leave-to`}=e,N=hf(s),I=N&&N[0],F=N&&N[1],{onBeforeEnter:z,onEnter:j,onEnterCancelled:U,onLeave:D,onLeaveCancelled:ae,onBeforeAppear:ue=z,onAppear:de=j,onAppearCancelled:Te=U}=t,oe=(ne,Fe,He,Ge)=>{ne._enterCancelled=Ge,lr(ne,Fe?u:a),lr(ne,Fe?d:i),He&&He()},X=(ne,Fe)=>{ne._isLeaving=!1,lr(ne,f),lr(ne,k),lr(ne,g),Fe&&Fe()},me=ne=>(Fe,He)=>{const Ge=ne?de:j,Ae=()=>oe(Fe,ne,He);ar(Ge,[Fe,Ae]),fa(()=>{lr(Fe,ne?l:o),bn(Fe,ne?u:a),da(Ge)||ha(Fe,r,I,Ae)})};return xt(t,{onBeforeEnter(ne){ar(z,[ne]),bn(ne,o),bn(ne,i)},onBeforeAppear(ne){ar(ue,[ne]),bn(ne,l),bn(ne,d)},onEnter:me(!1),onAppear:me(!0),onLeave(ne,Fe){ne._isLeaving=!0;const He=()=>X(ne,Fe);bn(ne,f),ne._enterCancelled?(bn(ne,g),ga(ne)):(ga(ne),bn(ne,g)),fa(()=>{ne._isLeaving&&(lr(ne,f),bn(ne,k),da(D)||ha(ne,r,F,He))}),ar(D,[ne,He])},onEnterCancelled(ne){oe(ne,!1,void 0,!0),ar(U,[ne])},onAppearCancelled(ne){oe(ne,!0,void 0,!0),ar(Te,[ne])},onLeaveCancelled(ne){X(ne),ar(ae,[ne])}})}function hf(e){if(e==null)return null;if(ot(e))return[bo(e.enter),bo(e.leave)];{const t=bo(e);return[t,t]}}function bo(e){return mu(e)}function bn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[vs]||(e[vs]=new Set)).add(t)}function lr(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[vs];n&&(n.delete(t),n.size||(e[vs]=void 0))}function fa(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let pf=0;function ha(e,t,n,r){const s=e._endId=++pf,o=()=>{s===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:i,timeout:a,propCount:l}=mf(e,t);if(!i)return r();const d=i+"end";let u=0;const f=()=>{e.removeEventListener(d,g),o()},g=k=>{k.target===e&&++u>=l&&f()};setTimeout(()=>{u<l&&f()},a+1),e.addEventListener(d,g)}function mf(e,t){const n=window.getComputedStyle(e),r=N=>(n[N]||"").split(", "),s=r(`${Fn}Delay`),o=r(`${Fn}Duration`),i=pa(s,o),a=r(`${Jr}Delay`),l=r(`${Jr}Duration`),d=pa(a,l);let u=null,f=0,g=0;t===Fn?i>0&&(u=Fn,f=i,g=o.length):t===Jr?d>0&&(u=Jr,f=d,g=l.length):(f=Math.max(i,d),u=f>0?i>d?Fn:Jr:null,g=u?u===Fn?o.length:l.length:0);const k=u===Fn&&/\b(?:transform|all)(?:,|$)/.test(r(`${Fn}Property`).toString());return{type:u,timeout:f,propCount:g,hasTransform:k}}function pa(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,r)=>ma(n)+ma(e[r])))}function ma(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function ga(e){return(e?e.ownerDocument:document).body.offsetHeight}function gf(e,t,n){const r=e[vs];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const va=Symbol("_vod"),vf=Symbol("_vsh"),yf=Symbol(""),wf=/(?:^|;)\s*display\s*:/;function bf(e,t,n){const r=e.style,s=_t(n);let o=!1;if(n&&!s){if(t)if(_t(t))for(const i of t.split(";")){const a=i.slice(0,i.indexOf(":")).trim();n[a]==null&&Os(r,a,"")}else for(const i in t)n[i]==null&&Os(r,i,"");for(const i in n)i==="display"&&(o=!0),Os(r,i,n[i])}else if(s){if(t!==n){const i=r[yf];i&&(n+=";"+i),r.cssText=n,o=wf.test(n)}}else t&&e.removeAttribute("style");va in e&&(e[va]=o?r.display:"",e[vf]&&(r.display="none"))}const ya=/\s*!important$/;function Os(e,t,n){if(Be(n))n.forEach(r=>Os(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=_f(e,t);ya.test(n)?e.setProperty(Yn(r),n.replace(ya,""),"important"):e[r]=n}}const wa=["Webkit","Moz","ms"],_o={};function _f(e,t){const n=_o[t];if(n)return n;let r=Zt(t);if(r!=="filter"&&r in e)return _o[t]=r;r=zs(r);for(let s=0;s<wa.length;s++){const o=wa[s]+r;if(o in e)return _o[t]=o}return t}const ba="http://www.w3.org/1999/xlink";function _a(e,t,n,r,s,o=_u(t)){r&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(ba,t.slice(6,t.length)):e.setAttributeNS(ba,t,n):n==null||o&&!kl(n)?e.removeAttribute(t):e.setAttribute(t,o?"":nn(n)?String(n):n)}function ka(e,t,n,r,s){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Ic(n):n);return}const o=e.tagName;if(t==="value"&&o!=="PROGRESS"&&!o.includes("-")){const a=o==="OPTION"?e.getAttribute("value")||"":e.value,l=n==null?e.type==="checkbox"?"on":"":String(n);(a!==l||!("_value"in e))&&(e.value=l),n==null&&e.removeAttribute(t),e._value=n;return}let i=!1;if(n===""||n==null){const a=typeof e[t];a==="boolean"?n=kl(n):n==null&&a==="string"?(n="",i=!0):a==="number"&&(n=0,i=!0)}try{e[t]=n}catch{}i&&e.removeAttribute(s||t)}function Or(e,t,n,r){e.addEventListener(t,n,r)}function kf(e,t,n,r){e.removeEventListener(t,n,r)}const Ta=Symbol("_vei");function Tf(e,t,n,r,s=null){const o=e[Ta]||(e[Ta]={}),i=o[t];if(r&&i)i.value=r;else{const[a,l]=Sf(t);if(r){const d=o[t]=Ef(r,s);Or(e,a,d,l)}else i&&(kf(e,a,i,l),o[t]=void 0)}}const Sa=/(?:Once|Passive|Capture)$/;function Sf(e){let t;if(Sa.test(e)){t={};let r;for(;r=e.match(Sa);)e=e.slice(0,e.length-r[0].length),t[r[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Yn(e.slice(2)),t]}let ko=0;const xf=Promise.resolve(),Cf=()=>ko||(xf.then(()=>ko=0),ko=Date.now());function Ef(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;sn(Af(r,n.value),t,5,[r])};return n.value=e,n.attached=Cf(),n}function Af(e,t){if(Be(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(r=>s=>!s._stopped&&r&&r(s))}else return t}const xa=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,If=(e,t,n,r,s,o)=>{const i=s==="svg";t==="class"?gf(e,r,i):t==="style"?bf(e,n,r):Ks(t)?ci(t)||Tf(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Rf(e,t,r,i))?(ka(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&_a(e,t,r,i,o,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!_t(r))?ka(e,Zt(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),_a(e,t,r,i))};function Rf(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&xa(t)&&Ve(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const s=e.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return xa(t)&&_t(n)?!1:t in e}const Ca=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Be(t)?n=>Rs(t,n):t};function $f(e){e.target.composing=!0}function Ea(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const To=Symbol("_assign");function Aa(e,t,n){return t&&(e=e.trim()),n&&(e=fi(e)),e}const $n={created(e,{modifiers:{lazy:t,trim:n,number:r}},s){e[To]=Ca(s);const o=r||s.props&&s.props.type==="number";Or(e,t?"change":"input",i=>{i.target.composing||e[To](Aa(e.value,n,o))}),(n||o)&&Or(e,"change",()=>{e.value=Aa(e.value,n,o)}),t||(Or(e,"compositionstart",$f),Or(e,"compositionend",Ea),Or(e,"change",Ea))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:o}},i){if(e[To]=Ca(i),e.composing)return;const a=(o||e.type==="number")&&!/^0\d/.test(e.value)?fi(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===l)||(e.value=l))}},Mf=["ctrl","shift","alt","meta"],Pf={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)=>Mf.some(n=>e[`${n}Key`]&&!t.includes(n))},Je=(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=Pf[t[i]];if(a&&a(s,t))return}return e(s,...o)}))},Of={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ht=(e,t)=>{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const o=Yn(s.key);if(t.some(i=>i===o||Of[i]===o))return e(s)}))},Nf=xt({patchProp:If},cf);let Ia;function jf(){return Ia||(Ia=Ud(Nf))}const Df=((...e)=>{const t=jf().createApp(...e),{mount:n}=t;return t.mount=r=>{const s=Bf(r);if(!s)return;const o=t._component;!Ve(o)&&!o.render&&!o.template&&(o.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const i=n(s,!1,Lf(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),i},t});function Lf(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Bf(e){return _t(e)?document.querySelector(e):e}/*!
|
|
18
|
-
* vue-router v4.6.4
|
|
19
|
-
* (c) 2025 Eduardo San Martin Morote
|
|
20
|
-
* @license MIT
|
|
21
|
-
*/const Nr=typeof document<"u";function Mc(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Ff(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Mc(e.default)}const rt=Object.assign;function So(e,t){const n={};for(const r in t){const s=t[r];n[r]=on(s)?s.map(e):e(s)}return n}const cs=()=>{},on=Array.isArray;function Ra(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const Pc=/#/g,Hf=/&/g,Uf=/\//g,Vf=/=/g,Wf=/\?/g,Oc=/\+/g,qf=/%5B/g,Kf=/%5D/g,Nc=/%5E/g,Gf=/%60/g,jc=/%7B/g,zf=/%7C/g,Dc=/%7D/g,Yf=/%20/g;function Ai(e){return e==null?"":encodeURI(""+e).replace(zf,"|").replace(qf,"[").replace(Kf,"]")}function Jf(e){return Ai(e).replace(jc,"{").replace(Dc,"}").replace(Nc,"^")}function Xo(e){return Ai(e).replace(Oc,"%2B").replace(Yf,"+").replace(Pc,"%23").replace(Hf,"%26").replace(Gf,"`").replace(jc,"{").replace(Dc,"}").replace(Nc,"^")}function Qf(e){return Xo(e).replace(Vf,"%3D")}function Xf(e){return Ai(e).replace(Pc,"%23").replace(Wf,"%3F")}function Zf(e){return Xf(e).replace(Uf,"%2F")}function ys(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const eh=/\/$/,th=e=>e.replace(eh,"");function xo(e,t,n="/"){let r,s={},o="",i="";const a=t.indexOf("#");let l=t.indexOf("?");return l=a>=0&&l>a?-1:l,l>=0&&(r=t.slice(0,l),o=t.slice(l,a>0?a:t.length),s=e(o.slice(1))),a>=0&&(r=r||t.slice(0,a),i=t.slice(a,t.length)),r=oh(r??t,n),{fullPath:r+o+i,path:r,query:s,hash:ys(i)}}function nh(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function $a(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function rh(e,t,n){const r=t.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&Ur(t.matched[r],n.matched[s])&&Lc(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Ur(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Lc(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!sh(e[n],t[n]))return!1;return!0}function sh(e,t){return on(e)?Ma(e,t):on(t)?Ma(t,e):(e==null?void 0:e.valueOf())===(t==null?void 0:t.valueOf())}function Ma(e,t){return on(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function oh(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 Hn={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Zo=(function(e){return e.pop="pop",e.push="push",e})({}),Co=(function(e){return e.back="back",e.forward="forward",e.unknown="",e})({});function ih(e){if(!e)if(Nr){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),th(e)}const ah=/^[^#]+#/;function lh(e,t){return e.replace(ah,"#")+t}function ch(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 oo=()=>({left:window.scrollX,top:window.scrollY});function uh(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=ch(s,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Pa(e,t){return(history.state?history.state.position-t:-1)+e}const ei=new Map;function dh(e,t){ei.set(e,t)}function fh(e){const t=ei.get(e);return ei.delete(e),t}function hh(e){return typeof e=="string"||e&&typeof e=="object"}function Bc(e){return typeof e=="string"||typeof e=="symbol"}let kt=(function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e})({});const Fc=Symbol("");kt.MATCHER_NOT_FOUND+"",kt.NAVIGATION_GUARD_REDIRECT+"",kt.NAVIGATION_ABORTED+"",kt.NAVIGATION_CANCELLED+"",kt.NAVIGATION_DUPLICATED+"";function Vr(e,t){return rt(new Error,{type:e,[Fc]:!0},t)}function _n(e,t){return e instanceof Error&&Fc in e&&(t==null||!!(e.type&t))}const ph=["params","query","hash"];function mh(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of ph)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function gh(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<n.length;++r){const s=n[r].replace(Oc," "),o=s.indexOf("="),i=ys(o<0?s:s.slice(0,o)),a=o<0?null:ys(s.slice(o+1));if(i in t){let l=t[i];on(l)||(l=t[i]=[l]),l.push(a)}else t[i]=a}return t}function Oa(e){let t="";for(let n in e){const r=e[n];if(n=Qf(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(on(r)?r.map(s=>s&&Xo(s)):[r&&Xo(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function vh(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=on(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}const yh=Symbol(""),Na=Symbol(""),io=Symbol(""),Ii=Symbol(""),ti=Symbol("");function Qr(){let e=[];function t(r){return e.push(r),()=>{const s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function qn(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(Vr(kt.NAVIGATION_ABORTED,{from:n,to:t})):g instanceof Error?l(g):hh(g)?l(Vr(kt.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 Eo(e,t,n,r,s=o=>o()){const o=[];for(const i of e)for(const a in i.components){let l=i.components[a];if(!(t!=="beforeRouteEnter"&&!i.instances[a]))if(Mc(l)){const d=(l.__vccOpts||l)[t];d&&o.push(qn(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=Ff(u)?u.default:u;i.mods[a]=u,i.components[a]=f;const g=(f.__vccOpts||f)[t];return g&&qn(g,n,r,i,a,s)()}))}}return o}function wh(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=>Ur(d,a))?r.push(a):n.push(a));const l=e.matched[i];l&&(t.matched.find(d=>Ur(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 bh=()=>location.protocol+"//"+location.host;function Hc(e,t){const{pathname:n,search:r,hash:s}=t,o=e.indexOf("#");if(o>-1){let i=s.includes(e.slice(o))?e.slice(o).length:1,a=s.slice(i);return a[0]!=="/"&&(a="/"+a),$a(a,"")}return $a(n,e)+r+s}function _h(e,t,n,r){let s=[],o=[],i=null;const a=({state:g})=>{const k=Hc(e,location),N=n.value,I=t.value;let F=0;if(g){if(n.value=k,t.value=g,i&&i===N){i=null;return}F=I?g.position-I.position:0}else r(k);s.forEach(z=>{z(n.value,N,{delta:F,type:Zo.pop,direction:F?F>0?Co.forward:Co.back:Co.unknown})})};function l(){i=n.value}function d(g){s.push(g);const k=()=>{const N=s.indexOf(g);N>-1&&s.splice(N,1)};return o.push(k),k}function u(){if(document.visibilityState==="hidden"){const{history:g}=window;if(!g.state)return;g.replaceState(rt({},g.state,{scroll:oo()}),"")}}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 ja(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?oo():null}}function kh(e){const{history:t,location:n}=window,r={value:Hc(e,n)},s={value:t.state};s.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(l,d,u){const f=e.indexOf("#"),g=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:bh()+e+l;try{t[u?"replaceState":"pushState"](d,"",g),s.value=d}catch(k){console.error(k),n[u?"replace":"assign"](g)}}function i(l,d){o(l,rt({},t.state,ja(s.value.back,l,s.value.forward,!0),d,{position:s.value.position}),!0),r.value=l}function a(l,d){const u=rt({},s.value,t.state,{forward:l,scroll:oo()});o(u.current,u,!0),o(l,rt({},ja(r.value,l,null),{position:u.position+1},d),!1),r.value=l}return{location:r,state:s,push:a,replace:i}}function Th(e){e=ih(e);const t=kh(e),n=_h(e,t.state,t.location,t.replace);function r(o,i=!0){i||n.pauseListeners(),history.go(o)}const s=rt({location:"",base:e,go:r,createHref:lh.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 Sh(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),Th(e)}let hr=(function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e})({});var St=(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})(St||{});const xh={type:hr.Static,value:""},Ch=/[a-zA-Z0-9_]/;function Eh(e){if(!e)return[[]];if(e==="/")return[[xh]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(k){throw new Error(`ERR (${n})/"${d}": ${k}`)}let n=St.Static,r=n;const s=[];let o;function i(){o&&s.push(o),o=[]}let a=0,l,d="",u="";function f(){d&&(n===St.Static?o.push({type:hr.Static,value:d}):n===St.Param||n===St.ParamRegExp||n===St.ParamRegExpEnd?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),o.push({type:hr.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!==St.ParamRegExp){r=n,n=St.EscapeNext;continue}switch(n){case St.Static:l==="/"?(d&&f(),i()):l===":"?(f(),n=St.Param):g();break;case St.EscapeNext:g(),n=r;break;case St.Param:l==="("?n=St.ParamRegExp:Ch.test(l)?g():(f(),n=St.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--);break;case St.ParamRegExp:l===")"?u[u.length-1]=="\\"?u=u.slice(0,-1)+l:n=St.ParamRegExpEnd:u+=l;break;case St.ParamRegExpEnd:f(),n=St.Static,l!=="*"&&l!=="?"&&l!=="+"&&a--,u="";break;default:t("Unknown state");break}}return n===St.ParamRegExp&&t(`Unfinished custom RegExp for param "${d}"`),f(),i(),s}const Da="[^/]+?",Ah={sensitive:!1,strict:!1,start:!0,end:!0};var Bt=(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})(Bt||{});const Ih=/[.+*?^${}()[\]/\\]/g;function Rh(e,t){const n=rt({},Ah,t),r=[];let s=n.start?"^":"";const o=[];for(const d of e){const u=d.length?[]:[Bt.Root];n.strict&&!d.length&&(s+="/");for(let f=0;f<d.length;f++){const g=d[f];let k=Bt.Segment+(n.sensitive?Bt.BonusCaseSensitive:0);if(g.type===hr.Static)f||(s+="/"),s+=g.value.replace(Ih,"\\$&"),k+=Bt.Static;else if(g.type===hr.Param){const{value:N,repeatable:I,optional:F,regexp:z}=g;o.push({name:N,repeatable:I,optional:F});const j=z||Da;if(j!==Da){k+=Bt.BonusCustomRegExp;try{`${j}`}catch(D){throw new Error(`Invalid custom RegExp for param "${N}" (${j}): `+D.message)}}let U=I?`((?:${j})(?:/(?:${j}))*)`:`(${j})`;f||(U=F&&d.length<2?`(?:/${U})`:"/"+U),F&&(U+="?"),s+=U,k+=Bt.Dynamic,F&&(k+=Bt.BonusOptional),I&&(k+=Bt.BonusRepeatable),j===".*"&&(k+=Bt.BonusWildcard)}u.push(k)}r.push(u)}if(n.strict&&n.end){const d=r.length-1;r[d][r[d].length-1]+=Bt.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 k=u[g]||"",N=o[g-1];f[N.name]=k&&N.repeatable?k.split("/"):k}return f}function l(d){let u="",f=!1;for(const g of e){(!f||!u.endsWith("/"))&&(u+="/"),f=!1;for(const k of g)if(k.type===hr.Static)u+=k.value;else if(k.type===hr.Param){const{value:N,repeatable:I,optional:F}=k,z=N in d?d[N]:"";if(on(z)&&!I)throw new Error(`Provided param "${N}" is an array but it is not repeatable (* or + modifiers)`);const j=on(z)?z.join("/"):z;if(!j)if(F)g.length<2&&(u.endsWith("/")?u=u.slice(0,-1):f=!0);else throw new Error(`Missing required param "${N}"`);u+=j}}return u||"/"}return{re:i,score:r,keys:o,parse:a,stringify:l}}function $h(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]===Bt.Static+Bt.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Bt.Static+Bt.Segment?1:-1:0}function Uc(e,t){let n=0;const r=e.score,s=t.score;for(;n<r.length&&n<s.length;){const o=$h(r[n],s[n]);if(o)return o;n++}if(Math.abs(s.length-r.length)===1){if(La(r))return 1;if(La(s))return-1}return s.length-r.length}function La(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Mh={strict:!1,end:!0,sensitive:!1};function Ph(e,t,n){const r=Rh(Eh(e.path),n),s=rt(r,{record:e,parent:t,children:[],alias:[]});return t&&!s.record.aliasOf==!t.record.aliasOf&&t.children.push(s),s}function Oh(e,t){const n=[],r=new Map;t=Ra(Mh,t);function s(f){return r.get(f)}function o(f,g,k){const N=!k,I=Fa(f);I.aliasOf=k&&k.record;const F=Ra(t,f),z=[I];if("alias"in f){const D=typeof f.alias=="string"?[f.alias]:f.alias;for(const ae of D)z.push(Fa(rt({},I,{components:k?k.record.components:I.components,path:ae,aliasOf:k?k.record:I})))}let j,U;for(const D of z){const{path:ae}=D;if(g&&ae[0]!=="/"){const ue=g.record.path,de=ue[ue.length-1]==="/"?"":"/";D.path=g.record.path+(ae&&de+ae)}if(j=Ph(D,g,F),k?k.alias.push(j):(U=U||j,U!==j&&U.alias.push(j),N&&f.name&&!Ha(j)&&i(f.name)),Vc(j)&&l(j),I.children){const ue=I.children;for(let de=0;de<ue.length;de++)o(ue[de],j,k&&k.children[de])}k=k||j}return U?()=>{i(U)}:cs}function i(f){if(Bc(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=Dh(f,n);n.splice(g,0,f),f.record.name&&!Ha(f)&&r.set(f.record.name,f)}function d(f,g){let k,N={},I,F;if("name"in f&&f.name){if(k=r.get(f.name),!k)throw Vr(kt.MATCHER_NOT_FOUND,{location:f});F=k.record.name,N=rt(Ba(g.params,k.keys.filter(U=>!U.optional).concat(k.parent?k.parent.keys.filter(U=>U.optional):[]).map(U=>U.name)),f.params&&Ba(f.params,k.keys.map(U=>U.name))),I=k.stringify(N)}else if(f.path!=null)I=f.path,k=n.find(U=>U.re.test(I)),k&&(N=k.parse(I),F=k.record.name);else{if(k=g.name?r.get(g.name):n.find(U=>U.re.test(g.path)),!k)throw Vr(kt.MATCHER_NOT_FOUND,{location:f,currentLocation:g});F=k.record.name,N=rt({},g.params,f.params),I=k.stringify(N)}const z=[];let j=k;for(;j;)z.unshift(j.record),j=j.parent;return{name:F,path:I,params:N,matched:z,meta:jh(z)}}e.forEach(f=>o(f));function u(){n.length=0,r.clear()}return{addRoute:o,resolve:d,removeRoute:i,clearRoutes:u,getRoutes:a,getRecordMatcher:s}}function Ba(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function Fa(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Nh(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 Nh(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function Ha(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function jh(e){return e.reduce((t,n)=>rt(t,n.meta),{})}function Dh(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;Uc(e,t[o])<0?r=o:n=o+1}const s=Lh(e);return s&&(r=t.lastIndexOf(s,r-1)),r}function Lh(e){let t=e;for(;t=t.parent;)if(Vc(t)&&Uc(e,t)===0)return t}function Vc({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Ua(e){const t=tn(io),n=tn(Ii),r=ce(()=>{const l=je(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(Ur.bind(null,u));if(g>-1)return g;const k=Va(l[d-2]);return d>1&&Va(u)===k&&f[f.length-1].path!==k?f.findIndex(Ur.bind(null,l[d-2])):g}),o=ce(()=>s.value>-1&&Vh(n.params,r.value.params)),i=ce(()=>s.value>-1&&s.value===n.matched.length-1&&Lc(n.params,r.value.params));function a(l={}){if(Uh(l)){const d=t[je(e.replace)?"replace":"push"](je(e.to)).catch(cs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:r,href:ce(()=>r.value.href),isActive:o,isExactActive:i,navigate:a}}function Bh(e){return e.length===1?e[0]:e}const Fh=Et({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Ua,setup(e,{slots:t}){const n=Qs(Ua(e)),{options:r}=tn(io),s=ce(()=>({[Wa(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Wa(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&Bh(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)}}}),Hh=Fh;function Uh(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 Vh(e,t){for(const n in t){const r=t[n],s=e[n];if(typeof r=="string"){if(r!==s)return!1}else if(!on(s)||s.length!==r.length||r.some((o,i)=>o.valueOf()!==s[i].valueOf()))return!1}return!0}function Va(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Wa=(e,t,n)=>e??t??n,Wh=Et({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=tn(ti),s=ce(()=>e.route||r.value),o=tn(Na,0),i=ce(()=>{let d=je(o);const{matched:u}=s.value;let f;for(;(f=u[d])&&!f.components;)d++;return d}),a=ce(()=>s.value.matched[i.value]);$s(Na,ce(()=>i.value+1)),$s(yh,a),$s(ti,s);const l=P();return at(()=>[l.value,a.value,e.name],([d,u,f],[g,k,N])=>{u&&(u.instances[f]=d,k&&k!==u&&d&&d===g&&(u.leaveGuards.size||(u.leaveGuards=k.leaveGuards),u.updateGuards.size||(u.updateGuards=k.updateGuards))),d&&u&&(!k||!Ur(u,k)||!g)&&(u.enterCallbacks[f]||[]).forEach(I=>I(d))},{flush:"post"}),()=>{const d=s.value,u=e.name,f=a.value,g=f&&f.components[u];if(!g)return qa(n.default,{Component:g,route:d});const k=f.props[u],N=k?k===!0?d.params:typeof k=="function"?k(d):k:null,F=Ei(g,rt({},N,t,{onVnodeUnmounted:z=>{z.component.isUnmounted&&(f.instances[u]=null)},ref:l}));return qa(n.default,{Component:F,route:d})||F}}});function qa(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const qh=Wh;function Kh(e){const t=Oh(e.routes,e),n=e.parseQuery||gh,r=e.stringifyQuery||Oa,s=e.history,o=Qr(),i=Qr(),a=Qr(),l=Wu(Hn);let d=Hn;Nr&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const u=So.bind(null,E=>""+E),f=So.bind(null,Zf),g=So.bind(null,ys);function k(E,Z){let Y,ye;return Bc(E)?(Y=t.getRecordMatcher(E),ye=Z):ye=E,t.addRoute(ye,Y)}function N(E){const Z=t.getRecordMatcher(E);Z&&t.removeRoute(Z)}function I(){return t.getRoutes().map(E=>E.record)}function F(E){return!!t.getRecordMatcher(E)}function z(E,Z){if(Z=rt({},Z||l.value),typeof E=="string"){const x=xo(n,E,Z.path),O=t.resolve({path:x.path},Z),B=s.createHref(x.fullPath);return rt(x,O,{params:g(O.params),hash:ys(x.hash),redirectedFrom:void 0,href:B})}let Y;if(E.path!=null)Y=rt({},E,{path:xo(n,E.path,Z.path).path});else{const x=rt({},E.params);for(const O in x)x[O]==null&&delete x[O];Y=rt({},E,{params:f(x)}),Z.params=f(Z.params)}const ye=t.resolve(Y,Z),De=E.hash||"";ye.params=u(g(ye.params));const p=nh(r,rt({},E,{hash:Jf(De),path:ye.path})),y=s.createHref(p);return rt({fullPath:p,hash:De,query:r===Oa?vh(E.query):E.query||{}},ye,{redirectedFrom:void 0,href:y})}function j(E){return typeof E=="string"?xo(n,E,l.value.path):rt({},E)}function U(E,Z){if(d!==E)return Vr(kt.NAVIGATION_CANCELLED,{from:Z,to:E})}function D(E){return de(E)}function ae(E){return D(rt(j(E),{replace:!0}))}function ue(E,Z){const Y=E.matched[E.matched.length-1];if(Y&&Y.redirect){const{redirect:ye}=Y;let De=typeof ye=="function"?ye(E,Z):ye;return typeof De=="string"&&(De=De.includes("?")||De.includes("#")?De=j(De):{path:De},De.params={}),rt({query:E.query,hash:E.hash,params:De.path!=null?{}:E.params},De)}}function de(E,Z){const Y=d=z(E),ye=l.value,De=E.state,p=E.force,y=E.replace===!0,x=ue(Y,ye);if(x)return de(rt(j(x),{state:typeof x=="object"?rt({},De,x.state):De,force:p,replace:y}),Z||Y);const O=Y;O.redirectedFrom=Z;let B;return!p&&rh(r,ye,Y)&&(B=Vr(kt.NAVIGATION_DUPLICATED,{to:O,from:ye}),ct(ye,ye,!0,!1)),(B?Promise.resolve(B):X(O,ye)).catch(L=>_n(L)?_n(L,kt.NAVIGATION_GUARD_REDIRECT)?L:Ze(L):Oe(L,O,ye)).then(L=>{if(L){if(_n(L,kt.NAVIGATION_GUARD_REDIRECT))return de(rt({replace:y},j(L.to),{state:typeof L.to=="object"?rt({},De,L.to.state):De,force:p}),Z||O)}else L=ne(O,ye,!0,y,De);return me(O,ye,L),L})}function Te(E,Z){const Y=U(E,Z);return Y?Promise.reject(Y):Promise.resolve()}function oe(E){const Z=he.values().next().value;return Z&&typeof Z.runWithContext=="function"?Z.runWithContext(E):E()}function X(E,Z){let Y;const[ye,De,p]=wh(E,Z);Y=Eo(ye.reverse(),"beforeRouteLeave",E,Z);for(const x of ye)x.leaveGuards.forEach(O=>{Y.push(qn(O,E,Z))});const y=Te.bind(null,E,Z);return Y.push(y),Se(Y).then(()=>{Y=[];for(const x of o.list())Y.push(qn(x,E,Z));return Y.push(y),Se(Y)}).then(()=>{Y=Eo(De,"beforeRouteUpdate",E,Z);for(const x of De)x.updateGuards.forEach(O=>{Y.push(qn(O,E,Z))});return Y.push(y),Se(Y)}).then(()=>{Y=[];for(const x of p)if(x.beforeEnter)if(on(x.beforeEnter))for(const O of x.beforeEnter)Y.push(qn(O,E,Z));else Y.push(qn(x.beforeEnter,E,Z));return Y.push(y),Se(Y)}).then(()=>(E.matched.forEach(x=>x.enterCallbacks={}),Y=Eo(p,"beforeRouteEnter",E,Z,oe),Y.push(y),Se(Y))).then(()=>{Y=[];for(const x of i.list())Y.push(qn(x,E,Z));return Y.push(y),Se(Y)}).catch(x=>_n(x,kt.NAVIGATION_CANCELLED)?x:Promise.reject(x))}function me(E,Z,Y){a.list().forEach(ye=>oe(()=>ye(E,Z,Y)))}function ne(E,Z,Y,ye,De){const p=U(E,Z);if(p)return p;const y=Z===Hn,x=Nr?history.state:{};Y&&(ye||y?s.replace(E.fullPath,rt({scroll:y&&x&&x.scroll},De)):s.push(E.fullPath,De)),l.value=E,ct(E,Z,Y,y),Ze()}let Fe;function He(){Fe||(Fe=s.listen((E,Z,Y)=>{if(!Ee.listening)return;const ye=z(E),De=ue(ye,Ee.currentRoute.value);if(De){de(rt(De,{replace:!0,force:!0}),ye).catch(cs);return}d=ye;const p=l.value;Nr&&dh(Pa(p.fullPath,Y.delta),oo()),X(ye,p).catch(y=>_n(y,kt.NAVIGATION_ABORTED|kt.NAVIGATION_CANCELLED)?y:_n(y,kt.NAVIGATION_GUARD_REDIRECT)?(de(rt(j(y.to),{force:!0}),ye).then(x=>{_n(x,kt.NAVIGATION_ABORTED|kt.NAVIGATION_DUPLICATED)&&!Y.delta&&Y.type===Zo.pop&&s.go(-1,!1)}).catch(cs),Promise.reject()):(Y.delta&&s.go(-Y.delta,!1),Oe(y,ye,p))).then(y=>{y=y||ne(ye,p,!1),y&&(Y.delta&&!_n(y,kt.NAVIGATION_CANCELLED)?s.go(-Y.delta,!1):Y.type===Zo.pop&&_n(y,kt.NAVIGATION_ABORTED|kt.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),me(ye,p,y)}).catch(cs)}))}let Ge=Qr(),Ae=Qr(),_e;function Oe(E,Z,Y){Ze(E);const ye=Ae.list();return ye.length?ye.forEach(De=>De(E,Z,Y)):console.error(E),Promise.reject(E)}function vt(){return _e&&l.value!==Hn?Promise.resolve():new Promise((E,Z)=>{Ge.add([E,Z])})}function Ze(E){return _e||(_e=!E,He(),Ge.list().forEach(([Z,Y])=>E?Y(E):Z()),Ge.reset()),E}function ct(E,Z,Y,ye){const{scrollBehavior:De}=e;if(!Nr||!De)return Promise.resolve();const p=!Y&&fh(Pa(E.fullPath,0))||(ye||!Y)&&history.state&&history.state.scroll||null;return zt().then(()=>De(E,Z,p)).then(y=>y&&uh(y)).catch(y=>Oe(y,E,Z))}const tt=E=>s.go(E);let ze;const he=new Set,Ee={currentRoute:l,listening:!0,addRoute:k,removeRoute:N,clearRoutes:t.clearRoutes,hasRoute:F,getRoutes:I,resolve:z,options:e,push:D,replace:ae,go:tt,back:()=>tt(-1),forward:()=>tt(1),beforeEach:o.add,beforeResolve:i.add,afterEach:a.add,onError:Ae.add,isReady:vt,install(E){E.component("RouterLink",Hh),E.component("RouterView",qh),E.config.globalProperties.$router=Ee,Object.defineProperty(E.config.globalProperties,"$route",{enumerable:!0,get:()=>je(l)}),Nr&&!ze&&l.value===Hn&&(ze=!0,D(s.location).catch(ye=>{}));const Z={};for(const ye in Hn)Object.defineProperty(Z,ye,{get:()=>l.value[ye],enumerable:!0});E.provide(io,Ee),E.provide(Ii,Bl(Z)),E.provide(ti,l);const Y=E.unmount;he.add(E),E.unmount=function(){he.delete(E),he.size<1&&(d=Hn,Fe&&Fe(),Fe=null,l.value=Hn,ze=!1,_e=!1),Y()}}};function Se(E){return E.reduce((Z,Y)=>Z.then(()=>oe(Y)),Promise.resolve())}return Ee}function Gh(){return tn(io)}function zh(e){return tn(Ii)}const Ka=768;function Wc(){const e=P(typeof window<"u"?window.innerWidth<Ka:!1);let t=null;function n(r){e.value=r.matches}return Pn(()=>{t=window.matchMedia(`(max-width: ${Ka-1}px)`),e.value=t.matches,t.addEventListener("change",n)}),to(()=>{t==null||t.removeEventListener("change",n)}),{isMobile:e}}const Yh={key:0,class:"desktop-sidebar"},Jh={class:"desktop-main"},Ga="codex-web-local.sidebar-width.v1",Qh=260,Xh=620,za=320,Zh=Et({__name:"DesktopLayout",props:{isSidebarCollapsed:{type:Boolean,default:!1}},emits:["close-sidebar"],setup(e){const t=e,{isMobile:n}=Wc();function r(d){return Math.min(Xh,Math.max(Qh,d))}function s(){if(typeof window>"u")return za;const d=window.localStorage.getItem(Ga),u=Number(d);return Number.isFinite(u)?r(u):za}const o=P(s()),i=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(Ga,String(d))}function l(d){d.preventDefault();const u=d.clientX,f=o.value,g=N=>{const I=N.clientX-u;o.value=r(f+I)},k=()=>{a(o.value),window.removeEventListener("mousemove",g),window.removeEventListener("mouseup",k)};window.addEventListener("mousemove",g),window.addEventListener("mouseup",k)}return(d,u)=>(w(),S("div",{class:lt(["desktop-layout",{"is-mobile":je(n)}]),style:gr(i.value)},[je(n)?(w(),dt(Bs,{key:0,to:"body"},[Ce($c,{name:"drawer"},{default:it(()=>[e.isSidebarCollapsed?le("",!0):(w(),S("div",{key:0,class:"mobile-drawer-backdrop",onClick:u[1]||(u[1]=f=>d.$emit("close-sidebar"))},[m("aside",{class:"mobile-drawer",onClick:u[0]||(u[0]=Je(()=>{},["stop"]))},[fn(d.$slots,"sidebar",{},void 0,!0)])]))]),_:3})])):le("",!0),je(n)?le("",!0):(w(),S(Ue,{key:1},[e.isSidebarCollapsed?le("",!0):(w(),S("aside",Yh,[fn(d.$slots,"sidebar",{},void 0)])),e.isSidebarCollapsed?le("",!0):(w(),S("button",{key:1,class:"desktop-resize-handle",type:"button","aria-label":"Resize sidebar",onMousedown:l},null,32))],64)),m("section",Jh,[fn(d.$slots,"content",{},void 0)])],6))}}),Xe=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},ep=Xe(Zh,[["__scopeId","data-v-df29c633"]]),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 w(),S("svg",np,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m6 9l6 6l6-6"},null,-1)])])}const ao=Xe(tp,[["render",rp]]),sp={},op={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function ip(e,t){return w(),S("svg",op,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 6l6 6l-6 6"},null,-1)])])}const qc=Xe(sp,[["render",ip]]),ap={},lp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function cp(e,t){return w(),S("svg",lp,[...t[0]||(t[0]=[m("path",{fill:"currentColor",d:"M6 12a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4m6 0a2 2 0 1 0 0-4a2 2 0 0 0 0 4"},null,-1)])])}const Xr=Xe(ap,[["render",cp]]),up={},dp={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function fp(e,t){return w(),S("svg",dp,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 20h4L18.5 9.5a2.828 2.828 0 1 0-4-4L4 16zm9.5-13.5l4 4"},null,-1)])])}const Ws=Xe(up,[["render",fp]]),hp={},pp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function mp(e,t){return w(),S("svg",pp,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l3 3h7a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2"},null,-1)])])}const Kc=Xe(hp,[["render",mp]]),gp={},vp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function yp(e,t){return w(),S("svg",vp,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m5 19l2.757-7.351A1 1 0 0 1 8.693 11H21a1 1 0 0 1 .986 1.164l-.996 5.211A2 2 0 0 1 19.026 19za2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h4l3 3h7a2 2 0 0 1 2 2v2"},null,-1)])])}const wp=Xe(gp,[["render",yp]]),bp={},_p={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function kp(e,t){return w(),S("svg",_p,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 18v-6m0 0a4 4 0 0 1 4-4h2m-6 4a4 4 0 0 0-4-4H6m0-4a2 2 0 1 0 0 4a2 2 0 0 0 0-4m12 0a2 2 0 1 0 0 4a2 2 0 0 0 0-4m-6 14a2 2 0 1 0 0 4a2 2 0 0 0 0-4"},null,-1)])])}const Ns=Xe(bp,[["render",kp]]),Tp={},Sp={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function xp(e,t){return w(),S("svg",Sp,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m15 4.5l-4 4L7 10l-1.5 1.5l7 7L14 17l1.5-4l4-4M9 15l-4.5 4.5M14.5 4L20 9.5"},null,-1)])])}const Ao=Xe(Tp,[["render",xp]]),Cp={key:0,class:"sidebar-menu-row-left"},Ep={class:"sidebar-menu-row-main"},Ap={key:1,class:"sidebar-menu-row-right"},Ip={key:0,class:"sidebar-menu-row-right-default"},Rp={key:1,class:"sidebar-menu-row-right-hover"},$p=Et({inheritAttrs:!1,__name:"SidebarMenuRow",props:{as:{default:"div"},forceRightHover:{type:Boolean,default:!1}},setup(e){const t=e,n=bd(),r=ce(()=>!!n.left),s=ce(()=>!!n.right),o=ce(()=>!!n["right-hover"]),i=ce(()=>s.value||o.value);return(a,l)=>(w(),dt(qo(t.as),xc({class:"sidebar-menu-row","data-has-left":r.value,"data-has-right":i.value,"data-has-right-hover":o.value,"data-force-right-hover":t.forceRightHover},a.$attrs),{default:it(()=>[r.value?(w(),S("span",Cp,[fn(a.$slots,"left",{},void 0,!0)])):le("",!0),m("span",Ep,[fn(a.$slots,"default",{},void 0,!0)]),i.value?(w(),S("span",Ap,[s.value?(w(),S("span",Ip,[fn(a.$slots,"right",{},void 0,!0)])):le("",!0),o.value?(w(),S("span",Rp,[fn(a.$slots,"right-hover",{},void 0,!0)])):le("",!0)])):le("",!0)]),_:3},16,["data-has-left","data-has-right","data-has-right-hover","data-force-right-hover"]))}}),cr=Xe($p,[["__scopeId","data-v-daeca4df"]]),Mp={class:"thread-tree-root"},Pp={key:0,class:"pinned-section"},Op={class:"thread-list"},Np={class:"thread-left-stack"},jp=["data-state"],Dp=["onClick"],Lp=["onClick"],Bp={class:"thread-row-title-wrap"},Fp={class:"thread-row-title"},Hp={class:"thread-row-time"},Up=["onClick"],Vp=["onClick"],Wp=["onClick"],qp=["aria-expanded"],Kp=["data-active"],Gp={key:0},zp=["data-active"],Yp={key:0},Jp={key:1,class:"thread-tree-no-results"},Qp={key:2,class:"thread-tree-loading"},Xp={key:3,class:"thread-list thread-list-global"},Zp={class:"thread-left-stack"},em=["data-state"],tm=["onClick"],nm=["onClick"],rm={class:"thread-row-title-wrap"},sm={class:"thread-row-title"},om={class:"thread-row-time"},im=["onClick"],am=["onClick"],lm=["onClick"],cm=["data-project-name","data-expanded","data-dragging"],um={class:"project-icon-stack"},dm={class:"project-icon-folder"},fm={class:"project-icon-chevron"},hm=["data-dragging-handle","onMousedown"],pm={class:"project-title"},mm={class:"project-hover-controls"},gm=["onClick"],vm=["onClick"],ym=["onClick"],wm=["onClick"],bm=["onInput"],_m=["aria-label","title","onClick"],km={key:0,class:"thread-list"},Tm={class:"thread-left-stack"},Sm=["data-state"],xm=["onClick"],Cm=["onClick"],Em={class:"thread-row-title-wrap"},Am={class:"thread-row-title"},Im={class:"thread-row-time"},Rm=["onClick"],$m=["onClick"],Mm=["onClick"],Pm=["onClick"],Om={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Thread title"},Nm=["onKeydown"],jm={class:"rename-thread-panel",role:"dialog","aria-modal":"true","aria-label":"Delete thread"},Dm={class:"rename-thread-subtitle"},Lm=4,Ya=6,Ja="codex-web-local.thread-view-mode.v1",Qa="codex-web-local.collapsed-projects.v1",Bm=Et({__name:"SidebarThreadTree",props:{groups:{},projectDisplayNameById:{},selectedThreadId:{},isLoading:{type:Boolean},searchQuery:{},searchMatchedThreadIds:{}},emits:["select","archive","start-new-thread","browse-project-files","rename-project","rename-thread","remove-project","reorder-project"],setup(e,{emit:t}){const n=e,r=t,s=P({}),o=P({}),i=P([]),a=P(""),l=P(""),d=P("actions"),u=P(""),f=P(!1),g=P(""),k=P(""),N=P(null),I=P(!1),F=P(""),z=P(""),j=P(null),U=P(null),D=P(null);let ae=null,ue=null;const de=P(""),Te=P({}),oe=new Map,X=new Map,me=new Map,ne=new WeakMap,Fe=P(null),He=P(!1),Ge=P(Oe()),Ae=typeof window<"u"?new ResizeObserver(_=>{for(const C of _){const R=C.target,q=ne.get(R);q&&Xn(q,R)}}):null;function _e(){if(typeof window>"u")return{};try{const _=window.localStorage.getItem(Qa);if(!_)return{};const C=JSON.parse(_);return!C||typeof C!="object"||Array.isArray(C)?{}:C}catch{return{}}}function Oe(){return typeof window>"u"?"project":window.localStorage.getItem(Ja)==="chronological"?"chronological":"project"}o.value=_e(),at(o,_=>{typeof window>"u"||window.localStorage.setItem(Qa,JSON.stringify(_))},{deep:!0}),at(Ge,_=>{typeof window>"u"||window.localStorage.setItem(Ja,_)});const vt=ce(()=>n.searchQuery.trim().toLowerCase()),Ze=ce(()=>vt.value.length>0),ct=ce(()=>n.searchMatchedThreadIds?new Set(n.searchMatchedThreadIds):null);function tt(_){if(!Ze.value)return!0;if(ct.value)return ct.value.has(_.id);const C=vt.value;return _.title.toLowerCase().includes(C)||_.preview.toLowerCase().includes(C)}const ze=ce(()=>Ze.value?n.groups.map(_=>({..._,threads:_.threads.filter(tt)})).filter(_=>_.threads.length>0):n.groups),he=ce(()=>Ge.value==="chronological"),Ee=ce(()=>{const _=ze.value,C=[];for(const R of _)for(const q of R.threads)y(q.id)||C.push(q);return C.sort((R,q)=>{const Le=new Date(R.updatedAtIso||R.createdAtIso).getTime();return new Date(q.updatedAtIso||q.createdAtIso).getTime()-Le})}),Se=ce(()=>{const _=new Map;for(const C of n.groups)for(const R of C.threads)_.set(R.id,R);return _}),E=ce(()=>i.value.map(_=>Se.value.get(_)??null).filter(_=>_!==null).filter(tt)),Z=ce(()=>{const _=D.value;if(!_||_.dropTargetIndexFull===null||n.groups.length===0)return null;const C=Math.max(0,Math.min(_.dropTargetIndexFull,n.groups.length)),R=C>_.fromIndex?C-1:C,q=Math.max(0,Math.min(R,n.groups.length-1));return q===_.fromIndex?null:q}),Y=ce(()=>{const C=(Ze.value?ze.value:n.groups).map(Vt=>Vt.projectName),R=D.value,q=Z.value;if(!R||q===null)return C;const Le=[...C],[bt]=Le.splice(R.fromIndex,1);return bt?(Le.splice(q,0,bt),Le):C}),ye=ce(()=>{const _={};let C=0;for(const R of Y.value)_[R]=C,C+=ut(R);return _}),De=ce(()=>{let _=0;for(const C of Y.value)_+=ut(C);return{height:`${Math.max(0,_)}px`}});function p(_){const C=new Date(_).getTime();if(Number.isNaN(C))return"n/a";const R=Math.abs(Date.now()-C);if(R<6e4)return"now";const q=Math.floor(R/6e4);if(q<60)return`${q}m`;const Le=Math.floor(q/60);return Le<24?`${Le}h`:`${Math.floor(Le/24)}d`}function y(_){return i.value.includes(_)}function x(_){if(y(_)){i.value=i.value.filter(C=>C!==_);return}i.value=[_,...i.value]}function O(_){r("select",_)}function B(_){return`start new thread ${Ie(_)}`}function L(_){r("start-new-thread",_)}function ee(_){l.value===_&&Q()}function se(_){return l.value===_}function Q(){l.value=""}function V(_){if(l.value===_){Q();return}l.value=_}function we(_,C){g.value=_,k.value=C,f.value=!0,Q(),zt(()=>{var R,q;(R=N.value)==null||R.focus(),(q=N.value)==null||q.select()})}function ie(){f.value=!1,g.value="",k.value=""}function ge(){const _=g.value,C=k.value.trim();!_||!C||(r("rename-thread",{threadId:_,title:C}),ie())}function ke(_,C){F.value=_,z.value=C,I.value=!0,Q()}function Ne(){I.value=!1,F.value="",z.value=""}function We(){const _=F.value;_&&(i.value=i.value.filter(C=>C!==_),r("archive",_),Ne())}function Ie(_){return n.projectDisplayNameById[_]??_}function pt(_){return a.value===_}function Ke(){a.value="",d.value="actions",u.value=""}function H(){He.value=!He.value}function W(_){Ge.value=_,He.value=!1}function J(_){if(a.value===_){Ke();return}a.value=_,d.value="actions",u.value=Ie(_)}function Ye(_){a.value=_,d.value="rename",u.value=Ie(_)}function b(_){r("rename-project",{projectName:_,displayName:u.value})}function A(_){r("remove-project",_),Ke()}function M(_){r("browse-project-files",_),Ke()}function re(_,C){if(!_.altKey||_.key!=="ArrowUp"&&_.key!=="ArrowDown")return;const R=n.groups.findIndex(bt=>bt.projectName===C);if(R<0)return;const q=_.key==="ArrowUp"?-1:1,Le=Math.max(0,Math.min(R+q,n.groups.length-1));Le!==R&&(_.preventDefault(),r("reorder-project",{projectName:C,toIndex:Le}))}function xe(_){return s.value[_]===!0}function ve(_){return o.value[_]===!0}function mt(_){s.value={...s.value,[_]:!xe(_)}}function Qe(_){if(de.value===_){de.value="";return}o.value={...o.value,[_]:!ve(_)}}function ut(_){const C=Te.value[_]??0,R=D.value,Le=((R==null?void 0:R.projectName)===_?R.groupHeight:null)??C,bt=ve(_)?0:Ya;return Math.max(0,Le+bt)}function ft(_,C){const R=C instanceof HTMLElement?C:C&&"$el"in C&&C.$el instanceof HTMLElement?C.$el:null;if(R){X.set(_,R);return}X.delete(_)}function Pe(_,C){const R=C instanceof HTMLElement?C:C&&"$el"in C&&C.$el instanceof HTMLElement?C.$el:null;if(R){me.set(_,R);return}me.delete(_)}function Me(_){const C=a.value;if(!C)return!1;const R=X.get(C);if(!R)return!1;if((typeof _.composedPath=="function"?_.composedPath():[]).includes(R))return!0;const Le=_.target;return Le instanceof Node?R.contains(Le):!1}function pn(_){const C=l.value;if(!C)return!1;const R=me.get(C);if(!R)return!1;if((typeof _.composedPath=="function"?_.composedPath():[]).includes(R))return!0;const Le=_.target;return Le instanceof Node?R.contains(Le):!1}function Ut(_){if(He.value){const C=Fe.value,R=typeof _.composedPath=="function"?_.composedPath():[];!!C&&(R.includes(C)||_.target instanceof Node&&C.contains(_.target))||(He.value=!1)}a.value&&(Me(_)||Ke(),l.value&&(pn(_)||Q()))}function Jn(_){a.value&&!Me(_)&&Ke(),l.value&&!pn(_)&&Q()}function vr(){He.value&&(He.value=!1),a.value&&Ke(),l.value&&Q()}function yr(){window.addEventListener("pointerdown",Ut,{capture:!0}),window.addEventListener("focusin",Jn,{capture:!0}),window.addEventListener("blur",vr)}function Qn(){window.removeEventListener("pointerdown",Ut,{capture:!0}),window.removeEventListener("focusin",Jn,{capture:!0}),window.removeEventListener("blur",vr)}function Xn(_,C){const R=C.getBoundingClientRect().height;if(!Number.isFinite(R)||R<=0)return;const q=Te.value[_];q!==void 0&&Math.abs(q-R)<.5||(Te.value={...Te.value,[_]:R})}function qr(_,C){const R=oe.get(_);R&&R!==C&&Ae&&Ae.unobserve(R);const q=C instanceof HTMLElement?C:C&&"$el"in C&&C.$el instanceof HTMLElement?C.$el:null;if(q){oe.set(_,q),ne.set(q,_),Xn(_,q),Ae==null||Ae.observe(q);return}R&&(Ae==null||Ae.unobserve(R)),oe.delete(_)}function wr(_,C){if(_.button!==0||U.value||D.value)return;const R=n.groups.findIndex(Vt=>Vt.projectName===C),q=oe.get(C);if(R<0||!q)return;const Le=q.getBoundingClientRect(),bt=ve(C)?0:Ya;U.value={projectName:C,fromIndex:R,startClientX:_.clientX,startClientY:_.clientY,pointerOffsetY:_.clientY-Le.top,groupLeft:Le.left,groupWidth:Le.width,groupHeight:Le.height,groupOuterHeight:Le.height+bt},_.preventDefault(),br()}function br(){window.addEventListener("mousemove",Zn),window.addEventListener("mouseup",mn),window.addEventListener("keydown",_r)}function Kt(){window.removeEventListener("mousemove",Zn),window.removeEventListener("mouseup",mn),window.removeEventListener("keydown",_r)}function Zn(_){ae={clientX:_.clientX,clientY:_.clientY},Kr()}function mn(_){kr({clientX:_.clientX,clientY:_.clientY});const C=D.value;if(C&&Z.value!==null){const R=n.groups.findIndex(q=>q.projectName===C.projectName);if(R>=0){const q=Z.value;q!==R&&r("reorder-project",{projectName:C.projectName,toIndex:q})}}Nn()}function _r(_){_.key==="Escape"&&(!U.value&&!D.value||(_.preventDefault(),Nn()))}function Nn(){ue!==null&&(window.cancelAnimationFrame(ue),ue=null),ae=null,U.value=null,D.value=null,de.value="",Kt()}function Kr(){ue===null&&(ue=window.requestAnimationFrame(()=>{if(ue=null,!ae)return;const _=ae;ae=null,kr(_)}))}function kr(_){const C=U.value;if(!D.value&&C){const R=_.clientX-C.startClientX,q=_.clientY-C.startClientY;if(Math.hypot(R,q)<Lm)return;Ke(),de.value=C.projectName,D.value={projectName:C.projectName,fromIndex:C.fromIndex,pointerOffsetY:C.pointerOffsetY,groupLeft:C.groupLeft,groupWidth:C.groupWidth,groupHeight:C.groupHeight,groupOuterHeight:C.groupOuterHeight,ghostTop:_.clientY-C.pointerOffsetY,dropTargetIndexFull:null}}D.value&&jn(_)}function jn(_){const C=D.value;if(!C)return;if(C.ghostTop=_.clientY-C.pointerOffsetY,!Tr(_)){C.dropTargetIndexFull=null;return}const R=_.clientY,q=j.value;if(!q){C.dropTargetIndexFull=null;return}const Le=q.getBoundingClientRect(),bt=new Map(n.groups.map((Yt,Ln)=>[Yt.projectName,Ln])),Vt=n.groups.map(Yt=>Yt.projectName).filter(Yt=>Yt!==C.projectName);let vn=0,Er=n.groups.length;for(const Yt of Vt){const Ln=bt.get(Yt);if(Ln===void 0)continue;const nr=ut(Yt),Ar=Le.top+vn+nr/2;if(R<Ar){Er=Ln;break}vn+=nr}C.dropTargetIndexFull=Er}function Tr(_){const C=j.value;if(!C)return!1;const R=C.getBoundingClientRect(),q=_.clientX>=R.left&&_.clientX<=R.right,Le=_.clientY>=R.top-32&&_.clientY<=R.bottom+32;return q&&Le}function Sr(_){var C;return((C=D.value)==null?void 0:C.projectName)===_}function xr(_){const C=D.value,R=ye.value[_]??0,q=a.value===_;return!C||C.projectName!==_?{position:"absolute",top:"0",left:"0",right:"0",zIndex:q?"40":"1",transform:`translate3d(0, ${R}px, 0)`,willChange:"transform",transition:"transform 180ms ease"}:{position:"fixed",top:"0",left:`${C.groupLeft}px`,width:`${C.groupWidth}px`,height:`${C.groupHeight}px`,zIndex:"50",pointerEvents:"none",transform:`translate3d(0, ${C.ghostTop}px, 0)`,willChange:"transform",transition:"transform 0ms linear"}}function gn(_){return _.threads.filter(C=>!y(C.id))}function er(_){if(Ze.value)return gn(_);if(ve(_.projectName))return[];const C=gn(_);return xe(_.projectName)?C:C.slice(0,10)}function tr(_){return Ze.value?!1:!ve(_.projectName)&&gn(_).length>10}function Cr(_){return gn(_).length>0}function Dn(_){return _.inProgress?"working":_.unread?"unread":"idle"}at(()=>n.groups.map(_=>_.projectName),_=>{var Le,bt;const C=((Le=D.value)==null?void 0:Le.projectName)??((bt=U.value)==null?void 0:bt.projectName)??"";C&&!n.groups.some(Vt=>Vt.projectName===C)&&Nn();const R=new Set(_),q=Object.fromEntries(Object.entries(Te.value).filter(([Vt])=>R.has(Vt)));Object.keys(q).length!==Object.keys(Te.value).length&&(Te.value=q)});const Gr=ce(()=>He.value||a.value!=="");return at(Gr,_=>{if(_){yr();return}Qn()}),On(()=>{for(const _ of oe.values())Ae==null||Ae.unobserve(_);oe.clear(),X.clear(),Qn(),Nn()}),(_,C)=>(w(),S("section",Mp,[E.value.length>0?(w(),S("section",Pp,[m("ul",Op,[(w(!0),S(Ue,null,wt(E.value,R=>(w(),S("li",{key:R.id,class:"thread-row-item"},[Ce(cr,{class:"thread-row","data-active":R.id===e.selectedThreadId,"data-pinned":y(R.id),onMouseleave:q=>ee(R.id)},{left:it(()=>[m("span",Np,[R.inProgress||R.unread?(w(),S("span",{key:0,class:"thread-status-indicator","data-state":Dn(R)},null,8,jp)):le("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:q=>x(R.id)},[Ce(Ao,{class:"thread-icon"})],8,Dp)])]),right:it(()=>[m("span",Hp,fe(p(R.createdAtIso||R.updatedAtIso)),1)]),"right-hover":it(()=>[m("div",{ref_for:!0,ref:q=>Pe(R.id,q),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Je(q=>V(R.id),["stop"])},[Ce(Xr,{class:"thread-icon"})],8,Up),se(R.id)?(w(),S("div",{key:0,class:"thread-menu-panel",onClick:C[0]||(C[0]=Je(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:q=>we(R.id,R.title)}," Rename thread ",8,Vp),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:q=>ke(R.id,R.title)}," Delete thread ",8,Wp)])):le("",!0)],512)]),default:it(()=>[m("button",{class:"thread-main-button",type:"button",onClick:q=>O(R.id)},[m("span",Bp,[m("span",Fp,fe(R.title),1),R.hasWorktree?(w(),dt(Ns,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):le("",!0)])],8,Lp)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])])):le("",!0),Ce(cr,{as:"header",class:"thread-tree-header-row"},{right:it(()=>[m("div",{ref_key:"organizeMenuWrapRef",ref:Fe,class:"organize-menu-wrap"},[m("button",{class:"organize-menu-trigger",type:"button","aria-expanded":He.value,"aria-label":"Organize threads",title:"Organize threads",onClick:H},[Ce(Xr,{class:"thread-icon"})],8,qp),He.value?(w(),S("div",{key:0,class:"organize-menu-panel",onClick:C[3]||(C[3]=Je(()=>{},["stop"]))},[C[11]||(C[11]=m("p",{class:"organize-menu-title"},"Organize",-1)),m("button",{class:"organize-menu-item","data-active":Ge.value==="project",type:"button",onClick:C[1]||(C[1]=R=>W("project"))},[C[9]||(C[9]=m("span",null,"By project",-1)),Ge.value==="project"?(w(),S("span",Gp,"✓")):le("",!0)],8,Kp),m("button",{class:"organize-menu-item","data-active":Ge.value==="chronological",type:"button",onClick:C[2]||(C[2]=R=>W("chronological"))},[C[10]||(C[10]=m("span",null,"Chronological list",-1)),Ge.value==="chronological"?(w(),S("span",Yp,"✓")):le("",!0)],8,zp)])):le("",!0)],512)]),default:it(()=>[C[12]||(C[12]=m("span",{class:"thread-tree-header"},"Threads",-1))]),_:1}),Ze.value&&ze.value.length===0?(w(),S("p",Jp,"No matching threads")):e.isLoading&&e.groups.length===0?(w(),S("p",Qp,"Loading threads...")):he.value?(w(),S("ul",Xp,[(w(!0),S(Ue,null,wt(Ee.value,R=>(w(),S("li",{key:R.id,class:"thread-row-item"},[Ce(cr,{class:"thread-row","data-active":R.id===e.selectedThreadId,"data-pinned":y(R.id),onMouseleave:q=>ee(R.id)},{left:it(()=>[m("span",Zp,[R.inProgress||R.unread?(w(),S("span",{key:0,class:"thread-status-indicator","data-state":Dn(R)},null,8,em)):le("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:q=>x(R.id)},[Ce(Ao,{class:"thread-icon"})],8,tm)])]),right:it(()=>[m("span",om,fe(p(R.createdAtIso||R.updatedAtIso)),1)]),"right-hover":it(()=>[m("div",{ref_for:!0,ref:q=>Pe(R.id,q),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Je(q=>V(R.id),["stop"])},[Ce(Xr,{class:"thread-icon"})],8,im),se(R.id)?(w(),S("div",{key:0,class:"thread-menu-panel",onClick:C[4]||(C[4]=Je(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:q=>we(R.id,R.title)}," Rename thread ",8,am),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:q=>ke(R.id,R.title)}," Delete thread ",8,lm)])):le("",!0)],512)]),default:it(()=>[m("button",{class:"thread-main-button",type:"button",onClick:q=>O(R.id)},[m("span",rm,[m("span",sm,fe(R.title),1),R.hasWorktree?(w(),dt(Ns,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):le("",!0)])],8,nm)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),S("div",{key:4,ref_key:"groupsContainerRef",ref:j,class:"thread-tree-groups",style:gr(De.value)},[(w(!0),S(Ue,null,wt(ze.value,R=>(w(),S("article",{key:R.projectName,ref_for:!0,ref:q=>qr(R.projectName,q),class:"project-group","data-project-name":R.projectName,"data-expanded":!ve(R.projectName),"data-dragging":Sr(R.projectName),style:gr(xr(R.projectName))},[Ce(cr,{as:"div",class:"project-header-row",role:"button",tabindex:"0",onClick:q=>Qe(R.projectName),onKeydown:[q=>re(q,R.projectName),Ht(Je(q=>Qe(R.projectName),["prevent"]),["enter"]),Ht(Je(q=>Qe(R.projectName),["prevent"]),["space"])]},{left:it(()=>[m("span",um,[m("span",dm,[ve(R.projectName)?(w(),dt(Kc,{key:0,class:"thread-icon"})):(w(),dt(wp,{key:1,class:"thread-icon"}))]),m("span",fm,[ve(R.projectName)?(w(),dt(qc,{key:0,class:"thread-icon"})):(w(),dt(ao,{key:1,class:"thread-icon"}))])])]),right:it(()=>[m("div",mm,[m("div",{ref_for:!0,ref:q=>ft(R.projectName,q),class:"project-menu-wrap"},[m("button",{class:"project-menu-trigger",type:"button",title:"project_menu",onClick:Je(q=>J(R.projectName),["stop"])},[Ce(Xr,{class:"thread-icon"})],8,gm),pt(R.projectName)?(w(),S("div",{key:0,class:"project-menu-panel",onClick:C[6]||(C[6]=Je(()=>{},["stop"]))},[d.value==="actions"?(w(),S(Ue,{key:0},[m("button",{class:"project-menu-item",type:"button",onClick:q=>M(R.projectName)}," Browse files ",8,vm),m("button",{class:"project-menu-item",type:"button",onClick:q=>Ye(R.projectName)}," Edit name ",8,ym),m("button",{class:"project-menu-item project-menu-item-danger",type:"button",onClick:q=>A(R.projectName)}," Remove ",8,wm)],64)):(w(),S(Ue,{key:1},[C[13]||(C[13]=m("label",{class:"project-menu-label"},"Project name",-1)),Rn(m("input",{"onUpdate:modelValue":C[5]||(C[5]=q=>u.value=q),class:"project-menu-input",type:"text",onInput:q=>b(R.projectName)},null,40,bm),[[$n,u.value]])],64))])):le("",!0)],512),m("button",{class:"thread-start-button",type:"button","aria-label":B(R.projectName),title:B(R.projectName),onClick:Je(q=>L(R.projectName),["stop"])},[Ce(Ws,{class:"thread-icon"})],8,_m)])]),default:it(()=>[m("span",{class:"project-main-button","data-dragging-handle":Sr(R.projectName),onMousedown:Je(q=>wr(q,R.projectName),["left"])},[m("span",pm,fe(Ie(R.projectName)),1)],40,hm)]),_:2},1032,["onClick","onKeydown"]),Cr(R)?(w(),S("ul",km,[(w(!0),S(Ue,null,wt(er(R),q=>(w(),S("li",{key:q.id,class:"thread-row-item"},[Ce(cr,{class:"thread-row","data-active":q.id===e.selectedThreadId,"data-pinned":y(q.id),onMouseleave:Le=>ee(q.id)},{left:it(()=>[m("span",Tm,[q.inProgress||q.unread?(w(),S("span",{key:0,class:"thread-status-indicator","data-state":Dn(q)},null,8,Sm)):le("",!0),m("button",{class:"thread-pin-button",type:"button",title:"pin",onClick:Le=>x(q.id)},[Ce(Ao,{class:"thread-icon"})],8,xm)])]),right:it(()=>[m("span",Im,fe(p(q.createdAtIso||q.updatedAtIso)),1)]),"right-hover":it(()=>[m("div",{ref_for:!0,ref:Le=>Pe(q.id,Le),class:"thread-menu-wrap"},[m("button",{class:"thread-menu-trigger",type:"button",title:"thread_menu",onClick:Je(Le=>V(q.id),["stop"])},[Ce(Xr,{class:"thread-icon"})],8,Rm),se(q.id)?(w(),S("div",{key:0,class:"thread-menu-panel",onClick:C[7]||(C[7]=Je(()=>{},["stop"]))},[m("button",{class:"thread-menu-item",type:"button",onClick:Le=>we(q.id,q.title)}," Rename thread ",8,$m),m("button",{class:"thread-menu-item thread-menu-item-danger",type:"button",onClick:Le=>ke(q.id,q.title)}," Delete thread ",8,Mm)])):le("",!0)],512)]),default:it(()=>[m("button",{class:"thread-main-button",type:"button",onClick:Le=>O(q.id)},[m("span",Em,[m("span",Am,fe(q.title),1),q.hasWorktree?(w(),dt(Ns,{key:0,class:"thread-row-worktree-icon",title:"Worktree thread"})):le("",!0)])],8,Cm)]),_:2},1032,["data-active","data-pinned","onMouseleave"])]))),128))])):(w(),dt(cr,{key:1,as:"p",class:"project-empty-row"},{left:it(()=>[...C[14]||(C[14]=[m("span",{class:"project-empty-spacer"},null,-1)])]),default:it(()=>[C[15]||(C[15]=m("span",{class:"project-empty"},"No threads",-1))]),_:1})),tr(R)?(w(),dt(cr,{key:2,class:"thread-show-more-row"},{left:it(()=>[...C[16]||(C[16]=[m("span",{class:"thread-show-more-spacer"},null,-1)])]),default:it(()=>[m("button",{class:"thread-show-more-button",type:"button",onClick:q=>mt(R.projectName)},fe(xe(R.projectName)?"Show less":"Show more"),9,Pm)]),_:2},1024)):le("",!0)],12,cm))),128))],4)),(w(),dt(Bs,{to:"body"},[f.value?(w(),S("div",{key:0,class:"rename-thread-overlay",onClick:Je(ie,["self"])},[m("div",Om,[C[17]||(C[17]=m("h3",{class:"rename-thread-title"},"Rename thread",-1)),C[18]||(C[18]=m("p",{class:"rename-thread-subtitle"},"Make it short and recognizable.",-1)),Rn(m("input",{ref_key:"renameThreadInputRef",ref:N,"onUpdate:modelValue":C[8]||(C[8]=R=>k.value=R),class:"rename-thread-input",type:"text",placeholder:"Add title...",onKeydown:[Ht(Je(ge,["prevent"]),["enter"]),Ht(Je(ie,["prevent"]),["esc"])]},null,40,Nm),[[$n,k.value]]),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:ie},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-primary",type:"button",onClick:ge},"Save")])])])):le("",!0)])),(w(),dt(Bs,{to:"body"},[I.value?(w(),S("div",{key:0,class:"rename-thread-overlay",onClick:Je(Ne,["self"])},[m("div",jm,[C[19]||(C[19]=m("h3",{class:"rename-thread-title"},"Delete thread?",-1)),m("p",Dm,' This will archive the thread "'+fe(z.value)+'". You can find it later in archived threads. ',1),m("div",{class:"rename-thread-actions"},[m("button",{class:"rename-thread-button",type:"button",onClick:Ne},"Cancel"),m("button",{class:"rename-thread-button rename-thread-button-danger",type:"button",onClick:We},"Delete")])])])):le("",!0)]))]))}}),Fm=Xe(Bm,[["__scopeId","data-v-7c022821"]]),Hm={class:"content-header"},Um={class:"content-leading"},Vm={class:"content-title"},Wm={class:"content-actions"},qm=Et({__name:"ContentHeader",props:{title:{}},setup(e){return(t,n)=>(w(),S("header",Hm,[m("div",Um,[fn(t.$slots,"leading",{},void 0)]),m("h1",Vm,fe(e.title),1),m("div",Wm,[fn(t.$slots,"actions",{},void 0)])]))}}),Km=Xe(qm,[["__scopeId","data-v-66ee223c"]]),Gm={},zm={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ym(e,t){return w(),S("svg",zm,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M18 6L6 18M6 6l12 12"},null,-1)])])}const Ri=Xe(Gm,[["render",Ym]]),Jm={},Qm={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Xm(e,t){return w(),S("svg",Qm,[...t[0]||(t[0]=[m("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 Zm=Xe(Jm,[["render",Xm]]),eg={class:"conversation-root"},tg={key:0,class:"conversation-loading"},ng={key:1,class:"conversation-empty"},rg={class:"message-row"},sg={class:"message-stack"},og={class:"request-card"},ig={class:"request-title"},ag={class:"request-meta"},lg={key:0,class:"request-reason"},cg={key:1,class:"request-actions"},ug=["onClick"],dg=["onClick"],fg=["onClick"],hg=["onClick"],pg={key:2,class:"request-actions"},mg=["onClick"],gg=["onClick"],vg=["onClick"],yg=["onClick"],wg={key:3,class:"request-user-input"},bg={class:"request-question-title"},_g={key:0,class:"request-question-text"},kg=["value","onChange"],Tg=["value"],Sg=["value","onInput"],xg=["onClick"],Cg={key:4,class:"request-actions"},Eg=["onClick"],Ag=["onClick"],Ig={key:5,class:"request-actions"},Rg=["onClick"],$g=["onClick"],Mg=["data-role","data-message-type"],Pg={key:0,class:"message-row","data-role":"system"},Og={class:"message-stack","data-role":"system"},Ng=["onClick"],jg={class:"cmd-label"},Dg={class:"cmd-status"},Lg={class:"cmd-output-inner"},Bg={class:"cmd-output"},Fg=["data-role","data-message-type"],Hg=["data-role"],Ug=["data-role"],Vg=["data-role"],Wg=["onClick"],qg=["src"],Kg={key:1,class:"message-file-attachments"},Gg=["href","title"],zg=["data-role"],Yg={key:0,class:"worked-separator-wrap","aria-live":"polite"},Jg=["onClick"],Qg={class:"worked-separator-text"},Xg={key:0,class:"worked-details"},Zg=["onClick"],ev={class:"cmd-label"},tv={class:"cmd-status"},nv={class:"cmd-output-inner"},rv={class:"cmd-output"},sv={key:1,class:"message-text-flow"},ov={key:0,class:"message-text"},iv={key:0},av=["href","title"],lv={key:2,class:"message-inline-code"},cv={key:1,class:"message-text"},uv=["onClick"],dv=["src","alt","onError"],fv=["onClick"],hv={key:0,class:"conversation-item conversation-item-overlay"},pv={class:"message-row"},mv={class:"message-stack"},gv={class:"live-overlay-inline","aria-live":"polite"},vv={class:"live-overlay-label"},yv={key:1,class:"live-overlay-error"},wv=["src"],bv=16,_v=Et({__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=P(new Set),r=P(new Set),s=P(new Set),o=P({});function i(b){return b.messageType==="commandExecution"&&!!b.commandExecution}function a(b){var A;return((A=b.commandExecution)==null?void 0:A.status)==="inProgress"||r.value.has(b.id)?!0:n.value.has(b.id)}function l(b){return r.value.has(b.id)}function d(b){var M;if(((M=b.commandExecution)==null?void 0:M.status)==="inProgress")return;const A=new Set(n.value);A.has(b.id)?A.delete(b.id):A.add(b.id),n.value=A}function u(b){const A=new Set(s.value);A.has(b.id)?A.delete(b.id):A.add(b.id),s.value=A}function f(b){return s.value.has(b.id)}function g(b){const A=b.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 k(b){var M,re;const A=(M=b.commandExecution)==null?void 0:M.status;return A==="inProgress"?"cmd-status-running":A==="completed"&&((re=b.commandExecution)==null?void 0:re.exitCode)===0?"cmd-status-ok":"cmd-status-error"}function N(b){const A=new Set(r.value);A.add(b),r.value=A,setTimeout(()=>{const M=new Set(r.value);M.delete(b),r.value=M},1e3)}function I(b,A){const M=[];for(let re=A-1;re>=0;re--){const xe=b[re];if(xe.messageType==="commandExecution")M.unshift(xe);else if(xe.role==="user"||xe.messageType==="worked")break}return M}const F=e,z=t,j=P(null),U=P(null),D=P(null),ae=P(""),ue=P({}),de=P({});let Te=0,oe=0,X=0;const me=new WeakSet,ne=P(new Set);function Fe(b){if(!b||/\s/u.test(b)||b.endsWith("/")||b.endsWith("\\")||/^[A-Za-z][A-Za-z0-9+.-]*:\/\//u.test(b))return!1;const A=b.startsWith("/"),M=/^[A-Za-z]:[\\/]/u.test(b),re=b.startsWith("./")||b.startsWith("../")||b.startsWith("~/"),xe=b.includes("/")||b.includes("\\");return A||M||re||xe}function He(b){return b.replace(/\\/gu,"/").split("/").filter(Boolean).pop()||b}function Ge(b){if(!b)return null;let A=b,M=null;const re=A.match(/^(.*)#L(\d+)(?:C\d+)?$/u);if(re)A=re[1],M=Number(re[2]);else{const xe=A.match(/^(.*):(\d+)(?::\d+)?$/u);xe&&(A=xe[1],M=Number(xe[2]))}return Fe(A)?{path:A,line:M}:null}function Ae(b){if(!b.includes("`"))return[{kind:"text",value:b}];const A=[];let M=0,re=0;for(;M<b.length;){if(b[M]!=="`"){M+=1;continue}let xe=1;for(;M+xe<b.length&&b[M+xe]==="`";)xe+=1;const ve="`".repeat(xe);let mt=M+xe,Qe=-1;for(;mt<b.length;){const ft=b.indexOf(ve,mt);if(ft<0)break;const Pe=ft>0&&b[ft-1]==="`",Me=ft+xe<b.length&&b[ft+xe]==="`",pn=b.slice(M+xe,ft).includes(`
|
|
26
|
-
`);if(!Pe&&!Me&&!pn){Qe=ft;break}mt=ft+1}if(Qe<0){M+=xe;continue}M>re&&A.push({kind:"text",value:b.slice(re,M)});const ut=b.slice(M+xe,Qe);if(ut.length>0){const ft=Ge(ut);if(ft){const Pe=ft.line?`${ft.path}:${String(ft.line)}`:ft.path;A.push({kind:"file",value:ut,path:ft.path,displayPath:Pe,downloadName:He(ft.path)})}else A.push({kind:"code",value:ut})}else A.push({kind:"text",value:`${ve}${ve}`});M=Qe+xe,re=M}return re<b.length&&A.push({kind:"text",value:b.slice(re)}),A}function _e(b){const A=b.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 M=A.startsWith("/"),re=/^[A-Za-z]:[\\/]/u.test(A);return M||re?`/codex-local-image?path=${encodeURIComponent(A)}`:A}function Oe(b){const A=b.trim();if(!A)return"#";const M=xe=>xe.startsWith("/")||/^[A-Za-z]:[\\/]/u.test(xe),re=Ge(A);return re!=null&&re.path&&M(re.path)?`/codex-local-browse${encodeURI(re.path)}`:M(A)?`/codex-local-browse${encodeURI(A)}`:"#"}function vt(b){if(!b.includes(")return[{kind:"text",value:b}];const A=[],M=/!\[([^\]]*)\]\(([^)\n]+)\)/gu;let re=0;for(const xe of b.matchAll(M)){const[ve,mt,Qe]=xe;if(typeof xe.index!="number")continue;const ut=xe.index,ft=ut+ve.length,Pe=_e(Qe.trim());Pe&&(ut>re&&A.push({kind:"text",value:b.slice(re,ut)}),A.push({kind:"image",url:Pe,alt:mt.trim(),markdown:ve}),re=ft)}return re<b.length&&A.push({kind:"text",value:b.slice(re)}),A.length>0?A:[{kind:"text",value:b}]}function Ze(b){return b!==null&&typeof b=="object"&&!Array.isArray(b)?b:null}function ct(b){const A=new Date(b);return Number.isNaN(A.getTime())?b:A.toLocaleTimeString()}function tt(b){const A=Ze(b.params),M=A==null?void 0:A.reason;return typeof M=="string"?M.trim():""}function ze(b,A){return`${String(b)}:${A}`}function he(b){const A=Ze(b.params),M=Array.isArray(A==null?void 0:A.questions)?A.questions:[],re=[];for(const xe of M){const ve=Ze(xe);if(!ve)continue;const mt=typeof ve.id=="string"?ve.id:"";if(!mt)continue;const Qe=Array.isArray(ve.options)?ve.options.map(ut=>Ze(ut)).map(ut=>ut==null?void 0:ut.label).filter(ut=>typeof ut=="string"&&ut.length>0):[];re.push({id:mt,header:typeof ve.header=="string"?ve.header:"",question:typeof ve.question=="string"?ve.question:"",isOther:ve.isOther===!0,options:Qe})}return re}function Ee(b,A,M){const re=ze(b,A),xe=ue.value[re];return typeof xe=="string"&&xe.length>0?xe:M}function Se(b,A){const M=ze(b,A);return de.value[M]??""}function E(b,A,M){const re=M.target;if(!(re instanceof HTMLSelectElement))return;const xe=ze(b,A);ue.value={...ue.value,[xe]:re.value}}function Z(b,A,M){const re=M.target;if(!(re instanceof HTMLInputElement))return;const xe=ze(b,A);de.value={...de.value,[xe]:re.value}}function Y(b,A){z("respondServerRequest",{id:b,result:{decision:A}})}function ye(b){const A=he(b),M={};for(const re of A){const xe=Ee(b.id,re.id,re.options[0]||""),ve=Se(b.id,re.id).trim(),mt=[xe,ve].map(Qe=>Qe.trim()).filter(Qe=>Qe.length>0);M[re.id]={answers:mt}}z("respondServerRequest",{id:b.id,result:{answers:M}})}function De(b){z("respondServerRequest",{id:b,result:{success:!1,contentItems:[{type:"inputText",text:"Tool call rejected from codex-web-local UI."}]}})}function p(b){z("respondServerRequest",{id:b,result:{success:!0,contentItems:[]}})}function y(b){z("respondServerRequest",{id:b,result:{}})}function x(b){z("respondServerRequest",{id:b,error:{code:-32e3,message:"Rejected from codex-web-local UI."}})}function O(b){return!(b.role!=="user"&&b.role!=="assistant"||typeof b.turnIndex!="number"||F.isTurnInProgress||F.isRollingBack)}function B(b){O(b)&&z("rollback",{turnIndex:b.turnIndex})}function L(){const b=j.value,A=U.value;!b||!A||(b.scrollTop=b.scrollHeight,A.scrollIntoView({block:"end"}))}function ee(b){return b.scrollHeight-(b.scrollTop+b.clientHeight)<=bv}function se(b){if(!F.activeThreadId)return;const A=Math.max(b.scrollHeight-b.clientHeight,0),M=A>0?Math.min(Math.max(b.scrollTop/A,0),1):1;z("updateScrollState",{threadId:F.activeThreadId,state:{scrollTop:b.scrollTop,isAtBottom:ee(b),scrollRatio:M}})}function Q(){const b=j.value;if(!b)return;const A=F.scrollState;if(!A||A.isAtBottom){V();return}const M=Math.max(b.scrollHeight-b.clientHeight,0),re=typeof A.scrollRatio=="number"?A.scrollRatio*M:A.scrollTop;b.scrollTop=Math.min(Math.max(re,0),M),se(b)}function V(){const b=j.value;b&&(L(),se(b))}function we(){const b=F.scrollState;return!b||b.isAtBottom===!0}function ie(){if(!we()){X=0,oe=0;return}if(V(),X-=1,X<=0){oe=0;return}oe=requestAnimationFrame(ie)}function ge(b=6){we()&&(oe&&(cancelAnimationFrame(oe),oe=0),X=Math.max(b,1),oe=requestAnimationFrame(ie))}function ke(){ge(3)}function Ne(){if(!we())return;const b=j.value;if(!b)return;const A=b.querySelectorAll("img.message-image-preview");for(const M of A)M.complete||me.has(M)||(me.add(M),M.addEventListener("load",ke,{once:!0}),M.addEventListener("error",ke,{once:!0}))}async function We(){await zt(),Te&&cancelAnimationFrame(Te),Te=requestAnimationFrame(()=>{Te=0,Q(),Ne(),ge()})}at(()=>F.messages,async b=>{if(!F.isLoading){for(const A of b){if(A.messageType!=="commandExecution"||!A.commandExecution)continue;const M=o.value[A.id],re=A.commandExecution.status;M==="inProgress"&&re!=="inProgress"&&N(A.id),o.value[A.id]=re}await We()}}),at(()=>F.liveOverlay,async b=>{b&&(await zt(),V(),ge(8))},{deep:!0}),at(()=>F.isLoading,async b=>{b||await We()}),at(()=>F.activeThreadId,()=>{ae.value="",ne.value=new Set},{flush:"post"});function Ie(){const b=j.value;!b||F.isLoading||se(b)}function pt(b){ae.value=_e(b)}function Ke(b,A){return`${b}:${String(A)}`}function H(b,A){const M=new Set(ne.value);M.add(Ke(b,A)),ne.value=M}function W(b,A){return ne.value.has(Ke(b,A))}function J(){ae.value=""}function Ye(){const b=D.value;b&&(b.scrollTop=b.scrollHeight)}return at(()=>{var b;return(b=F.liveOverlay)==null?void 0:b.reasoningText},async b=>{b&&(await zt(),Ye())}),On(()=>{Te&&cancelAnimationFrame(Te),oe&&cancelAnimationFrame(oe)}),(b,A)=>(w(),S("section",eg,[e.isLoading?(w(),S("p",tg,"Loading messages...")):e.messages.length===0&&e.pendingRequests.length===0&&!e.liveOverlay?(w(),S("p",ng," No messages in this thread yet. ")):(w(),S("ul",{key:2,ref_key:"conversationListRef",ref:j,class:"conversation-list",onScroll:Ie},[(w(!0),S(Ue,null,wt(e.pendingRequests,M=>(w(),S("li",{key:`server-request:${M.id}`,class:"conversation-item conversation-item-request"},[m("div",rg,[m("div",sg,[m("article",og,[m("p",ig,fe(M.method),1),m("p",ag,"Request #"+fe(M.id)+" · "+fe(ct(M.receivedAtIso)),1),tt(M)?(w(),S("p",lg,fe(tt(M)),1)):le("",!0),M.method==="item/commandExecution/requestApproval"?(w(),S("section",cg,[m("button",{type:"button",class:"request-button request-button-primary",onClick:re=>Y(M.id,"accept")},"Accept",8,ug),m("button",{type:"button",class:"request-button",onClick:re=>Y(M.id,"acceptForSession")},"Accept for Session",8,dg),m("button",{type:"button",class:"request-button",onClick:re=>Y(M.id,"decline")},"Decline",8,fg),m("button",{type:"button",class:"request-button",onClick:re=>Y(M.id,"cancel")},"Cancel",8,hg)])):M.method==="item/fileChange/requestApproval"?(w(),S("section",pg,[m("button",{type:"button",class:"request-button request-button-primary",onClick:re=>Y(M.id,"accept")},"Accept",8,mg),m("button",{type:"button",class:"request-button",onClick:re=>Y(M.id,"acceptForSession")},"Accept for Session",8,gg),m("button",{type:"button",class:"request-button",onClick:re=>Y(M.id,"decline")},"Decline",8,vg),m("button",{type:"button",class:"request-button",onClick:re=>Y(M.id,"cancel")},"Cancel",8,yg)])):M.method==="item/tool/requestUserInput"?(w(),S("section",wg,[(w(!0),S(Ue,null,wt(he(M),re=>(w(),S("div",{key:`${M.id}:${re.id}`,class:"request-question"},[m("p",bg,fe(re.header||re.question),1),re.header&&re.question?(w(),S("p",_g,fe(re.question),1)):le("",!0),m("select",{class:"request-select",value:Ee(M.id,re.id,re.options[0]||""),onChange:xe=>E(M.id,re.id,xe)},[(w(!0),S(Ue,null,wt(re.options,xe=>(w(),S("option",{key:`${M.id}:${re.id}:${xe}`,value:xe},fe(xe),9,Tg))),128))],40,kg),re.isOther?(w(),S("input",{key:1,class:"request-input",type:"text",value:Se(M.id,re.id),placeholder:"Other answer",onInput:xe=>Z(M.id,re.id,xe)},null,40,Sg)):le("",!0)]))),128)),m("button",{type:"button",class:"request-button request-button-primary",onClick:re=>ye(M)}," Submit Answers ",8,xg)])):M.method==="item/tool/call"?(w(),S("section",Cg,[m("button",{type:"button",class:"request-button request-button-primary",onClick:re=>De(M.id)},"Fail Tool Call",8,Eg),m("button",{type:"button",class:"request-button",onClick:re=>p(M.id)},"Success (Empty)",8,Ag)])):(w(),S("section",Ig,[m("button",{type:"button",class:"request-button request-button-primary",onClick:re=>y(M.id)},"Return Empty Result",8,Rg),m("button",{type:"button",class:"request-button",onClick:re=>x(M.id)},"Reject Request",8,$g)]))])])])]))),128)),(w(!0),S(Ue,null,wt(e.messages,M=>{var re,xe;return w(),S("li",{key:M.id,class:lt(["conversation-item",{"conversation-item-rollbackable":O(M)}]),"data-role":M.role,"data-message-type":M.messageType||""},[i(M)?(w(),S("div",Pg,[m("div",Og,[m("button",{type:"button",class:lt(["cmd-row",[k(M),{"cmd-expanded":a(M)}]]),onClick:ve=>d(M)},[m("span",{class:lt(["cmd-chevron",{"cmd-chevron-open":a(M)}])},"▶",2),m("code",jg,fe(((re=M.commandExecution)==null?void 0:re.command)||"(command)"),1),m("span",Dg,fe(g(M)),1)],10,Ng),m("div",{class:lt(["cmd-output-wrap",{"cmd-output-visible":a(M),"cmd-output-collapsing":l(M)}])},[m("div",Lg,[m("pre",Bg,fe(((xe=M.commandExecution)==null?void 0:xe.aggregatedOutput)||"(no output)"),1)])],2)])])):(w(),S("div",{key:1,class:"message-row","data-role":M.role,"data-message-type":M.messageType||""},[m("div",{class:"message-stack","data-role":M.role},[m("article",{class:"message-body","data-role":M.role},[M.images&&M.images.length>0?(w(),S("ul",{key:0,class:"message-image-list","data-role":M.role},[(w(!0),S(Ue,null,wt(M.images,ve=>(w(),S("li",{key:ve,class:"message-image-item"},[m("button",{class:"message-image-button",type:"button",onClick:mt=>pt(ve)},[m("img",{class:"message-image-preview",src:_e(ve),alt:"Message image preview",loading:"lazy"},null,8,qg)],8,Wg)]))),128))],8,Vg)):le("",!0),M.fileAttachments&&M.fileAttachments.length>0?(w(),S("div",Kg,[(w(!0),S(Ue,null,wt(M.fileAttachments,ve=>(w(),S("span",{key:ve.path,class:"message-file-chip"},[A[1]||(A[1]=m("span",{class:"message-file-chip-icon"},"📄",-1)),m("a",{class:"message-file-link message-file-chip-name",href:Oe(ve.path),target:"_blank",rel:"noopener noreferrer",title:ve.path},fe(ve.path),9,Gg)]))),128))])):le("",!0),M.text.length>0?(w(),S("article",{key:2,class:"message-card","data-role":M.role},[M.messageType==="worked"?(w(),S("div",Yg,[m("button",{type:"button",class:"worked-separator",onClick:ve=>u(M)},[A[2]||(A[2]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1)),m("span",{class:lt(["worked-chevron",{"worked-chevron-open":f(M)}])},"▶",2),m("p",Qg,fe(M.text),1),A[3]||(A[3]=m("span",{class:"worked-separator-line","aria-hidden":"true"},null,-1))],8,Jg),f(M)?(w(),S("div",Xg,[(w(!0),S(Ue,null,wt(I(e.messages,e.messages.indexOf(M)),ve=>{var mt,Qe;return w(),S("div",{key:`worked-cmd-${ve.id}`,class:"worked-cmd-item"},[m("button",{type:"button",class:lt(["cmd-row",[k(ve),{"cmd-expanded":a(ve)}]]),onClick:ut=>d(ve)},[m("span",{class:lt(["cmd-chevron",{"cmd-chevron-open":a(ve)}])},"▶",2),m("code",ev,fe(((mt=ve.commandExecution)==null?void 0:mt.command)||"(command)"),1),m("span",tv,fe(g(ve)),1)],10,Zg),m("div",{class:lt(["cmd-output-wrap",{"cmd-output-visible":a(ve),"cmd-output-collapsing":l(ve)}])},[m("div",nv,[m("pre",rv,fe(((Qe=ve.commandExecution)==null?void 0:Qe.aggregatedOutput)||"(no output)"),1)])],2)])}),128))])):le("",!0)])):(w(),S("div",sv,[(w(!0),S(Ue,null,wt(vt(M.text),(ve,mt)=>(w(),S(Ue,{key:`block-${mt}`},[ve.kind==="text"?(w(),S("p",ov,[(w(!0),S(Ue,null,wt(Ae(ve.value),(Qe,ut)=>(w(),S(Ue,{key:`seg-${mt}-${ut}`},[Qe.kind==="text"?(w(),S("span",iv,fe(Qe.value),1)):Qe.kind==="file"?(w(),S("a",{key:1,class:"message-file-link",href:Oe(Qe.path),target:"_blank",rel:"noopener noreferrer",title:Qe.path},fe(Qe.displayPath),9,av)):(w(),S("code",lv,fe(Qe.value),1))],64))),128))])):W(M.id,mt)?(w(),S("p",cv,fe(ve.markdown),1)):(w(),S("button",{key:2,class:"message-image-button",type:"button",onClick:Qe=>pt(ve.url)},[m("img",{class:"message-image-preview message-markdown-image",src:ve.url,alt:ve.alt||"Embedded message image",loading:"lazy",onError:Qe=>H(M.id,mt)},null,40,dv)],8,uv))],64))),128))]))],8,zg)):le("",!0)],8,Ug),O(M)?(w(),S("button",{key:0,class:"rollback-button",type:"button",title:"Rollback to this message (remove this turn and all after it)",onClick:ve=>B(M)},[Ce(Zm,{class:"rollback-icon"}),A[4]||(A[4]=m("span",{class:"rollback-label"},"Rollback",-1))],8,fv)):le("",!0)],8,Hg)],8,Fg))],10,Mg)}),128)),e.liveOverlay?(w(),S("li",hv,[m("div",pv,[m("div",mv,[m("article",gv,[m("p",vv,fe(e.liveOverlay.activityLabel),1),e.liveOverlay.reasoningText?(w(),S("p",{key:0,class:"live-overlay-reasoning",ref_key:"liveOverlayReasoningRef",ref:D},fe(e.liveOverlay.reasoningText),513)):le("",!0),e.liveOverlay.errorText?(w(),S("p",yv,fe(e.liveOverlay.errorText),1)):le("",!0)])])])])):le("",!0),m("li",{ref_key:"bottomAnchorRef",ref:U,class:"conversation-bottom-anchor"},null,512)],544)),ae.value.length>0?(w(),S("div",{key:3,class:"image-modal-backdrop",onClick:J},[m("div",{class:"image-modal-content",onClick:A[0]||(A[0]=Je(()=>{},["stop"]))},[m("button",{class:"image-modal-close",type:"button","aria-label":"Close image preview",onClick:J},[Ce(Ri,{class:"icon-svg"})]),m("img",{class:"image-modal-image",src:ae.value,alt:"Expanded message image"},null,8,wv)])])):le("",!0)]))}}),kv=Xe(_v,[["__scopeId","data-v-454a8117"]]);function Tv(e){var u;const t=P("idle"),n=P(typeof navigator<"u"&&!!((u=navigator.mediaDevices)!=null&&u.getUserMedia));let r=null,s=null,o=[];async function i(){var f;if(!(t.value!=="idle"||!n.value))try{s=await navigator.mediaDevices.getUserMedia({audio:{channelCount:1}}),o=[],r=new MediaRecorder(s),r.ondataavailable=g=>{g.data.size>0&&o.push(g.data)},r.onstop=()=>{var N;const g=o,k=(r==null?void 0:r.mimeType)||((N=g[0])==null?void 0:N.type)||"audio/webm";d(),t.value="idle",l(g,k)},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 N;if(f.length===0)return;const k=new Blob(f,{type:g});try{const I=g.split(/[/;]/)[1]??"webm",F=`----codex-transcribe-${crypto.randomUUID()}`,z=new Uint8Array(await k.arrayBuffer()),j=new TextEncoder,U=[];U.push(j.encode(`--${F}\r
|
|
27
|
-
`)),U.push(j.encode(`Content-Disposition: form-data; name="file"; filename="codex.${I}"\r
|
|
28
|
-
`)),U.push(j.encode(`Content-Type: ${g}\r
|
|
29
|
-
\r
|
|
30
|
-
`)),U.push(z),U.push(j.encode(`\r
|
|
31
|
-
--${F}--\r
|
|
32
|
-
`));let D=0;for(const X of U)D+=X.byteLength;const ae=new Uint8Array(D);let ue=0;for(const X of U)ae.set(X,ue),ue+=X.byteLength;const de=await fetch("/codex-api/transcribe",{method:"POST",headers:{"Content-Type":`multipart/form-data; boundary=${F}`},body:ae});if(!de.ok)throw new Error(`Transcription failed: ${de.status}`);const oe=((await de.json()).text??"").trim();oe.length>0&&e.onTranscript(oe)}catch(I){(N=e.onError)==null||N.call(e,I)}finally{t.value!=="recording"&&(t.value="idle")}}function d(){r&&(r.ondataavailable=null,r.onstop=null,r=null),s&&(s.getTracks().forEach(f=>f.stop()),s=null),o=[]}return On(d),{state:t,isSupported:n,startRecording:i,stopRecording:a}}function Xa(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}class Cn extends Error{constructor(t,n){super(t),this.name="CodexApiError",this.code=n.code,this.method=n.method,this.status=n.status}}function $i(e,t){const n=Xa(e);if(!n)return t;const r=n.error;if(typeof r=="string"&&r.length>0)return r;const s=Xa(r);return s&&typeof s.message=="string"&&s.message.length>0?s.message:t}function Wr(e,t,n){return e instanceof Cn?e:e instanceof Error?new Cn(e.message||t,{code:"unknown_error",method:n}):new Cn(t,{code:"unknown_error",method:n})}function Gc(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)?e:null}async function Sv(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 Cn(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 Cn($i(s,`RPC ${e} failed with HTTP ${r.status}`),{code:"http_error",method:e,status:r.status});const o=s;if(!o||typeof o!="object"||!("result"in o))throw new Cn(`RPC ${e} returned malformed envelope`,{code:"invalid_response",method:e,status:r.status});return o.result}function Za(e){const t=Gc(e);if(!t||typeof t.method!="string"||t.method.length===0)return null;const n=typeof t.atIso=="string"&&t.atIso.length>0?t.atIso:new Date().toISOString();return{method:t.method,params:t.params??null,atIso:n}}function xv(e){if(typeof window>"u")return()=>{};let t=null,n=!1;const r=()=>{if(typeof EventSource>"u"||n)return;const s=new EventSource("/codex-api/events");s.onmessage=o=>{try{const i=JSON.parse(o.data),a=Za(i);a&&e(a)}catch{}},t=()=>s.close()};if(typeof WebSocket<"u"){const s=window.location.protocol==="https:"?"wss:":"ws:",o=new WebSocket(`${s}//${window.location.host}/codex-api/ws`);let i=!1,a=window.setTimeout(()=>{i||n||(o.close(),r())},2500);o.onopen=()=>{i=!0,a!==null&&(window.clearTimeout(a),a=null)},o.onmessage=l=>{try{const d=JSON.parse(String(l.data)),u=Za(d);u&&e(u)}catch{}},o.onerror=()=>{!i&&!n&&r()},o.onclose=()=>{a!==null&&(window.clearTimeout(a),a=null),!i&&!n&&r()},t=()=>o.close()}else r();return()=>{n=!0,t==null||t()}}async function Cv(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 Cn(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 Cn($i(n,`Server request reply failed with HTTP ${t.status}`),{code:"http_error",method:"server-requests/respond",status:t.status})}async function Ev(){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 Cn($i(t,`Pending server requests failed with HTTP ${e.status}`),{code:"http_error",method:"server-requests/pending",status:e.status});const n=Gc(t),r=n==null?void 0:n.data;return Array.isArray(r)?r:[]}function el(e){return new Date(e*1e3).toISOString()}function Av(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function Iv(e){try{return JSON.stringify(e,null,2)}catch{return String(e)}}const Rv=/^##\s+(.+?):\s+(.+?)\s*$/,$v=/^#\s*files mentioned by the user\s*:?\s*$/i;function Mv(e){var s,o;const t=e.split(`
|
|
33
|
-
`).findIndex(i=>$v.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(Rv);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 Ov(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:Iv(l),isUnhandled:!0});const o=n.join(`
|
|
35
|
-
`),i=Mv(o);return{text:Pv(o),images:r,fileAttachments:i,rawBlocks:s}}function Nv(e){if(e.type==="agentMessage")return[{id:e.id,role:"assistant",text:e.text,messageType:e.type}];if(e.type==="userMessage"){const t=Ov(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=jv(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 jv(e){return e==="completed"||e==="failed"||e==="declined"||e==="interrupted"?e:e==="inProgress"||e==="in_progress"?"inProgress":"completed"}function Dv(e){const t=[e.preview];for(const n of t)if(typeof n=="string"&&n.trim().length>0)return n.trim();return""}function Lv(e){const t=Dv(e);return t.length>0?t:"Untitled thread"}function zc(e){return(e==null?void 0:e.status)==="inProgress"}function Bv(e){const t=e;if(t.inProgress===!0||t.status==="inProgress"||t.turnStatus==="inProgress")return!0;const r=(Array.isArray(e.turns)?e.turns:[]).at(-1);return zc(r)}function Fv(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:Lv(e),projectName:Av(e.cwd),cwd:e.cwd,hasWorktree:r,createdAtIso:el(e.createdAt),updatedAtIso:el(e.updatedAt),preview:e.preview,unread:!1,inProgress:Bv(e)}}function Hv(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 Uv(e){const t=e.data.map(Fv);return Hv(t)}function Yc(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[],n=[];for(let r=0;r<t.length;r++){const s=t[r],o=Array.isArray(s.items)?s.items:[];for(const i of o)for(const a of Nv(i))n.push({...a,turnIndex:r})}return n}function Vv(e){const t=Array.isArray(e.thread.turns)?e.thread.turns:[];return zc(t.at(-1))}async function qt(e,t){try{return await Sv(e,t)}catch(n){throw Wr(n,`RPC ${e} failed`,e)}}function Wv(e){return typeof e=="string"&&["none","minimal","low","medium","high","xhigh"].includes(e)?e:""}async function qv(){const e=await qt("thread/list",{archived:!1,limit:100,sortKey:"updated_at"});return Uv(e)}async function Kv(e){const t=await qt("thread/read",{threadId:e,includeTurns:!0});return{messages:Yc(t),inProgress:Vv(t)}}async function Gv(){try{return await qv()}catch(e){throw Wr(e,"Failed to load thread groups","thread/list")}}async function zv(e){try{return await Kv(e)}catch(t){throw Wr(t,`Failed to load thread ${e}`,"thread/read")}}function Yv(e){return xv(e)}async function Jv(e,t){await Cv({id:e,...t})}async function Qv(){return Ev()}async function Io(e){await qt("thread/resume",{threadId:e})}async function Xv(e){await qt("thread/archive",{threadId:e})}async function Zv(e,t){await qt("thread/name/set",{threadId:e,name:t})}async function tl(e,t){const n=await qt("thread/rollback",{threadId:e,numTurns:t});return Yc(n)}function ey(e){if(!e||typeof e!="object")return"";const n=e.thread;if(n&&typeof n=="object"){const r=n.id;if(typeof r=="string"&&r.length>0)return r}return""}async function nl(e,t){try{const n={};typeof e=="string"&&e.trim().length>0&&(n.cwd=e.trim()),typeof t=="string"&&t.trim().length>0&&(n.model=t.trim());const r=await qt("thread/start",n),s=ey(r);if(!s)throw new Error("thread/start did not return a thread id");return s}catch(n){throw Wr(n,"Failed to start a new thread","thread/start")}}function ty(e,t){if(t.length===0)return e;let n=`# Files mentioned by the user:
|
|
36
|
-
`;for(const r of t)n+=`
|
|
37
|
-
## ${r.label}: ${r.path}
|
|
38
|
-
`;return`${n}
|
|
39
|
-
## My request for Codex:
|
|
40
|
-
|
|
41
|
-
${e}
|
|
42
|
-
`}async function Ro(e,t,n=[],r,s,o,i=[]){try{const l=[{type:"text",text:ty(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 qt("turn/start",u)}catch(a){throw Wr(a,`Failed to start turn for thread ${e}`,"turn/start")}}async function ny(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 qt("turn/interrupt",{threadId:n,turnId:r})}catch(s){throw Wr(s,`Failed to interrupt turn for thread ${n}`,"turn/interrupt")}}async function ry(e){await qt("setDefaultModel",{model:e})}async function sy(){const e=await qt("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 oy(){const e=await qt("config/read",{}),t=e.config.model??"",n=Wv(e.config.model_reasoning_effort);return{model:t,reasoningEffort:n}}function iy(e){const t=e&&typeof e=="object"&&!Array.isArray(e)?e:{},n=o=>{if(!Array.isArray(o))return[];const i=[];for(const a of o)typeof a=="string"&&a.length>0&&!i.includes(a)&&i.push(a);return i},r=t.labels,s={};if(r&&typeof r=="object"&&!Array.isArray(r))for(const[o,i]of Object.entries(r))typeof o=="string"&&o.length>0&&typeof i=="string"&&(s[o]=i);return{order:n(t.order),labels:s,active:n(t.active)}}async function ni(){const e=await fetch("/codex-api/workspace-roots-state"),t=await e.json();if(!e.ok)throw new Error("Failed to load workspace roots state");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{};return iy(n.data)}async function ay(e){const t=await fetch("/codex-api/worktree/create",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceCwd:e})}),n=await t.json();if(!t.ok||!n.data)throw new Error(n.error||"Failed to create worktree");return n.data}async function rl(){const e=await fetch("/codex-api/home-directory"),t=await e.json();if(!e.ok)throw new Error("Failed to load home directory");const n=t&&typeof t=="object"&&!Array.isArray(t)?t:{},r=n.data&&typeof n.data=="object"&&!Array.isArray(n.data)?n.data:{};return typeof r.path=="string"?r.path.trim():""}async function ly(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 cy(e,t){const n=await fetch("/codex-api/project-root",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,createIfMissing:(t==null?void 0:t.createIfMissing)===!0,label:(t==null?void 0:t.label)??""})}),r=await n.json();if(!n.ok){const a=Mi(r,"Failed to open project root");throw new Error(a)}const s=r&&typeof r=="object"&&!Array.isArray(r)?r:{},o=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{};return typeof o.path=="string"?o.path.trim():""}async function uy(e){const t=new URLSearchParams({basePath:e}),n=await fetch(`/codex-api/project-root-suggestion?${t.toString()}`),r=await n.json();if(!n.ok){const i=Mi(r,"Failed to suggest project name");throw new Error(i)}const s=r&&typeof r=="object"&&!Array.isArray(r)?r:{},o=s.data&&typeof s.data=="object"&&!Array.isArray(s.data)?s.data:{};return{name:typeof o.name=="string"?o.name.trim():"",path:typeof o.path=="string"?o.path.trim():""}}async function dy(e,t,n=20){const r=e.trim();if(!r)return[];const s=await fetch("/codex-api/composer-file-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:r,query:t.trim(),limit:n})}),o=await s.json();if(!s.ok){const d=Mi(o,"Failed to search files");throw new Error(d)}const i=o&&typeof o=="object"&&!Array.isArray(o)?o:{},a=Array.isArray(i.data)?i.data:[],l=[];for(const d of a){if(!d||typeof d!="object"||Array.isArray(d))continue;const f=d.path,g=typeof f=="string"?f.trim():"";g&&l.push({path:g})}return l}async function fy(e,t=200){const n=await fetch("/codex-api/thread-search",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:e,limit:t})}),r=await n.json();if(!n.ok)throw new Error(r.error||"Failed to search threads");return r.data??{threadIds:[],indexedThreadCount:0}}function Mi(e,t){const r=(e&&typeof e=="object"&&!Array.isArray(e)?e:{}).error;return typeof r=="string"&&r.trim().length>0?r:t}async function hy(){try{const e=await fetch("/codex-api/thread-titles");return e.ok?(await e.json()).data??{titles:{},order:[]}:{titles:{},order:[]}}catch{return{titles:{},order:[]}}}async function $o(e,t){try{await fetch("/codex-api/thread-titles",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e,title:t})})}catch{}}async function py(e,t){var n;try{return((n=(await qt("generate-thread-title",{prompt:e,cwd:t})).title)==null?void 0:n.trim())??""}catch{return""}}async function my(e){try{const t={};e&&e.length>0&&(t.cwds=e);const n=await qt("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 gy(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 vy={},yy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function wy(e,t){return w(),S("svg",yy,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m12 5l0 14m-6-8l6-6l6 6"},null,-1)])])}const by=Xe(vy,[["render",wy]]),_y={},ky={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ty(e,t){return w(),S("svg",ky,[...t[0]||(t[0]=[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 2m0 3a3 3 0 0 1 3-3h0a3 3 0 0 1 3 3v5a3 3 0 0 1-3 3h0a3 3 0 0 1-3-3zM5 10a7 7 0 0 0 14 0M8 21h8M12 17v4"},null,-1)])])}const Sy=Xe(_y,[["render",Ty]]),xy={},Cy={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"};function Ey(e,t){return w(),S("svg",Cy,[...t[0]||(t[0]=[m("path",{stroke:"none",fill:"none",d:"M0 0h24v24H0z"},null,-1),m("path",{fill:"currentColor",d:"M8 5a3 3 0 0 0 -3 3v8a3 3 0 0 0 3 3h8a3 3 0 0 0 3 -3v-8a3 3 0 0 0 -3 -3h-8z"},null,-1)])])}const Ay=Xe(xy,[["render",Ey]]),Iy=["disabled"],Ry={class:"composer-dropdown-value"},$y={class:"composer-dropdown-menu"},My={key:0,class:"composer-dropdown-search-wrap"},Py=["placeholder","onKeydown"],Oy={class:"composer-dropdown-options",role:"listbox"},Ny=["onClick"],jy={key:0,class:"composer-dropdown-empty"},Dy={key:1,class:"composer-dropdown-add-wrap"},Ly=["placeholder","onKeydown"],By=Et({__name:"ComposerDropdown",props:{modelValue:{},options:{},placeholder:{},disabled:{type:Boolean},openDirection:{},enableSearch:{type:Boolean},searchPlaceholder:{},showAddAction:{type:Boolean},addActionLabel:{},defaultAddValue:{},addPlaceholder:{}},emits:["update:modelValue","add"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(null),i=P(null),a=P(!1),l=P(""),d=P(!1),u=P(""),f=ce(()=>{var me;const X=n.options.find(ne=>ne.value===n.modelValue);return X?X.label:((me=n.placeholder)==null?void 0:me.trim())||""}),g=ce(()=>n.openDirection??"down"),k=ce(()=>n.enableSearch===!0),N=ce(()=>n.showAddAction===!0),I=ce(()=>{var X;return((X=n.searchPlaceholder)==null?void 0:X.trim())||"Quick search projects"}),F=ce(()=>{var X;return((X=n.addActionLabel)==null?void 0:X.trim())||"Add new project"}),z=ce(()=>{var X;return((X=n.addPlaceholder)==null?void 0:X.trim())||"Project name or absolute path"}),j=ce(()=>{const X=l.value.trim().toLowerCase();return X?n.options.filter(me=>me.label.toLowerCase().includes(X)||me.value.toLowerCase().includes(X)):n.options});function U(){n.disabled||(a.value=!a.value)}function D(X){r("update:modelValue",X),a.value=!1,l.value=""}function ae(){var X;d.value=!0,u.value=((X=n.defaultAddValue)==null?void 0:X.trim())||"",zt(()=>{var me;return(me=i.value)==null?void 0:me.focus()})}function ue(){if(l.value.length>0){l.value="";return}a.value=!1}function de(){const X=u.value.trim();X&&(r("add",X),d.value=!1,u.value="",a.value=!1,l.value="")}function Te(){d.value=!1,u.value="",a.value=!1,l.value=""}function oe(X){if(!a.value)return;const me=s.value;if(!me)return;const ne=X.target;ne instanceof Node&&(me.contains(ne)||(a.value=!1,l.value="",d.value=!1,u.value=""))}return at(a,X=>{if(!X){d.value=!1,u.value="";return}k.value&&zt(()=>{var me;return(me=o.value)==null?void 0:me.focus()})}),Pn(()=>{window.addEventListener("pointerdown",oe)}),On(()=>{window.removeEventListener("pointerdown",oe)}),(X,me)=>(w(),S("div",{ref_key:"rootRef",ref:s,class:"composer-dropdown"},[m("button",{class:"composer-dropdown-trigger",type:"button",disabled:e.disabled,onClick:U},[m("span",Ry,fe(f.value),1),Ce(ao,{class:"composer-dropdown-chevron"})],8,Iy),a.value?(w(),S("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"}])},[m("div",$y,[k.value?(w(),S("div",My,[Rn(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":me[0]||(me[0]=ne=>l.value=ne),class:"composer-dropdown-search-input",type:"text",placeholder:I.value,onKeydown:Ht(Je(ue,["prevent"]),["esc"])},null,40,Py),[[$n,l.value]])])):le("",!0),m("ul",Oy,[(w(!0),S(Ue,null,wt(j.value,ne=>(w(),S("li",{key:ne.value},[m("button",{class:lt(["composer-dropdown-option",{"is-selected":ne.value===e.modelValue}]),type:"button",onClick:Fe=>D(ne.value)},fe(ne.label),11,Ny)]))),128)),j.value.length===0?(w(),S("li",jy," No matching projects ")):le("",!0)]),N.value?(w(),S("div",Dy,[d.value?(w(),S(Ue,{key:0},[Rn(m("input",{ref_key:"addInputRef",ref:i,"onUpdate:modelValue":me[1]||(me[1]=ne=>u.value=ne),class:"composer-dropdown-add-input",type:"text",placeholder:z.value,onKeydown:[Ht(Je(de,["prevent"]),["enter"]),Ht(Je(Te,["prevent"]),["esc"])]},null,40,Ly),[[$n,u.value]]),m("div",{class:"composer-dropdown-add-actions"},[m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:de},"Open"),m("button",{type:"button",class:"composer-dropdown-add-btn",onClick:Te},"Cancel")])],64)):(w(),S("button",{key:1,type:"button",class:"composer-dropdown-add",onClick:ae},fe(F.value),1))])):le("",!0)])],2)):le("",!0)],512))}}),ri=Xe(By,[["__scopeId","data-v-7cfa2012"]]),Fy=["disabled"],Hy={class:"search-dropdown-value"},Uy={class:"search-dropdown-search-wrap"},Vy=["placeholder","onKeydown"],Wy={key:0,class:"search-dropdown-list",role:"listbox"},qy=["onClick","onPointerenter"],Ky={class:"search-dropdown-option-check"},Gy={class:"search-dropdown-option-label"},zy={key:0,class:"search-dropdown-option-desc"},Yy={key:1,class:"search-dropdown-empty"},Jy=Et({__name:"ComposerSearchDropdown",props:{options:{},selectedValues:{},placeholder:{},searchPlaceholder:{},disabled:{type:Boolean},openDirection:{}},emits:["toggle"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(null),i=P(!1),a=P(""),l=P(0),d=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 j=n.options.find(U=>U.value===n.selectedValues[0]);return(j==null?void 0:j.label)||n.placeholder||"Select..."}return`${n.selectedValues.length} selected`}),g=ce(()=>{const j=a.value.toLowerCase().trim();return j?n.options.filter(U=>{var D;return U.label.toLowerCase().includes(j)||(((D=U.description)==null?void 0:D.toLowerCase().includes(j))??!1)}):n.options});function k(){n.disabled||(i.value=!i.value,i.value&&(a.value="",l.value=0,zt(()=>{var j;return(j=o.value)==null?void 0:j.focus()})))}function N(j){r("toggle",j.value,!u.value.has(j.value))}function I(j){g.value.length!==0&&(l.value=(l.value+j+g.value.length)%g.value.length)}function F(){const j=g.value[l.value];j&&N(j)}function z(j){if(!i.value)return;const U=s.value;if(!U)return;const D=j.target;D instanceof Node&&(U.contains(D)||(i.value=!1))}return at(a,()=>{l.value=0}),Pn(()=>window.addEventListener("pointerdown",z)),On(()=>window.removeEventListener("pointerdown",z)),(j,U)=>(w(),S("div",{ref_key:"rootRef",ref:s,class:"search-dropdown"},[m("button",{class:"search-dropdown-trigger",type:"button",disabled:e.disabled,onClick:k},[m("span",Hy,fe(f.value),1),Ce(ao,{class:"search-dropdown-chevron"})],8,Fy),i.value?(w(),S("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"}])},[m("div",Uy,[Rn(m("input",{ref_key:"searchRef",ref:o,"onUpdate:modelValue":U[0]||(U[0]=D=>a.value=D),class:"search-dropdown-search",type:"text",placeholder:e.searchPlaceholder,onKeydown:[U[1]||(U[1]=Ht(Je(D=>i.value=!1,["prevent"]),["escape"])),Ht(Je(F,["prevent"]),["enter"]),U[2]||(U[2]=Ht(Je(D=>I(1),["prevent"]),["arrow-down"])),U[3]||(U[3]=Ht(Je(D=>I(-1),["prevent"]),["arrow-up"]))]},null,40,Vy),[[$n,a.value]])]),g.value.length>0?(w(),S("ul",Wy,[(w(!0),S(Ue,null,wt(g.value,(D,ae)=>(w(),S("li",{key:D.value},[m("button",{class:lt(["search-dropdown-option",{"is-selected":u.value.has(D.value),"is-highlighted":ae===l.value}]),type:"button",onClick:ue=>N(D),onPointerenter:ue=>l.value=ae},[m("span",Ky,fe(u.value.has(D.value)?"✓":""),1),m("span",Gy,fe(D.label),1),D.description?(w(),S("span",zy,fe(D.description),1)):le("",!0)],42,qy)]))),128))])):(w(),S("div",Yy,"No results"))],2)):le("",!0)],512))}}),Qy=Xe(Jy,[["__scopeId","data-v-a0f2edd4"]]),Xy={class:"skill-picker-header"},Zy=["onKeydown"],ew={key:0,class:"skill-picker-list",role:"listbox"},tw=["onClick","onPointerenter"],nw={class:"skill-picker-name"},rw={key:0,class:"skill-picker-desc"},sw={key:1,class:"skill-picker-empty"},ow=Et({__name:"ComposerSkillPicker",props:{skills:{},visible:{type:Boolean},anchorBottom:{},anchorLeft:{}},emits:["select","close"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(null),i=P(""),a=P(0),l=ce(()=>{const g=i.value.toLowerCase().trim();return g?n.skills.filter(k=>k.name.toLowerCase().includes(g)||k.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 at(()=>n.visible,g=>{g&&(i.value="",a.value=0,zt(()=>{var k;return(k=o.value)==null?void 0:k.focus()}))}),at(i,()=>{a.value=0}),(g,k)=>e.visible?(w(),S("div",{key:0,ref_key:"rootRef",ref:s,class:"skill-picker",style:gr(d.value)},[m("div",Xy,[Rn(m("input",{ref_key:"searchInputRef",ref:o,"onUpdate:modelValue":k[0]||(k[0]=N=>i.value=N),class:"skill-picker-search",type:"text",placeholder:"Search skills...",onKeydown:[k[1]||(k[1]=Ht(Je(N=>g.$emit("close"),["prevent"]),["escape"])),Ht(Je(f,["prevent"]),["enter"]),k[2]||(k[2]=Ht(Je(N=>u(1),["prevent"]),["arrow-down"])),k[3]||(k[3]=Ht(Je(N=>u(-1),["prevent"]),["arrow-up"]))]},null,40,Zy),[[$n,i.value]])]),l.value.length>0?(w(),S("ul",ew,[(w(!0),S(Ue,null,wt(l.value,(N,I)=>(w(),S("li",{key:N.path},[m("button",{class:lt(["skill-picker-item",{"is-highlighted":I===a.value}]),type:"button",onClick:F=>g.$emit("select",N),onPointerenter:F=>a.value=I},[m("span",nw,fe(N.name),1),N.description?(w(),S("span",rw,fe(N.description),1)):le("",!0)],42,tw)]))),128))])):(w(),S("div",sw,"No skills found"))],4)):le("",!0)}}),iw=Xe(ow,[["__scopeId","data-v-d6a08788"]]),aw={key:0,class:"thread-composer-attachments"},lw=["src","alt"],cw=["aria-label","disabled","onClick"],uw={key:1,class:"thread-composer-file-chips"},dw=["title"],fw=["aria-label","disabled","onClick"],hw={key:2,class:"thread-composer-skill-chips"},pw={class:"thread-composer-skill-chip-name"},mw=["aria-label","onClick"],gw={class:"thread-composer-input-wrap"},vw={key:0,class:"thread-composer-file-mentions"},yw=["onMousedown"],ww={key:1,class:"thread-composer-file-mention-icon-markdown"},bw={class:"thread-composer-file-mention-text"},_w={class:"thread-composer-file-mention-name"},kw={key:0,class:"thread-composer-file-mention-dir"},Tw={key:1,class:"thread-composer-file-mention-empty"},Sw=["placeholder","disabled"],xw={class:"thread-composer-controls"},Cw=["disabled"],Ew={key:0,class:"thread-composer-attach-menu"},Aw=["disabled"],Iw=["disabled"],Rw={class:"thread-composer-actions"},$w=["aria-label","title","disabled"],Mw=["disabled"],Pw=["aria-label","title","disabled"],Ow=["disabled"],Nw=["disabled"],jw=Et({__name:"ThreadComposer",props:{activeThreadId:{},cwd:{},models:{},selectedModel:{},selectedReasoningEffort:{},skills:{},isTurnInProgress:{type:Boolean},isInterruptingTurn:{type:Boolean},disabled:{type:Boolean},hasQueueAbove:{type:Boolean},sendWithEnter:{type:Boolean},inProgressSubmitMode:{}},emits:["submit","interrupt","update:selected-model","update:selected-reasoning-effort"],setup(e,{emit:t}){const n=e,r=t,s=P(""),o=P([]),i=P([]),a=P([]),{state:l,isSupported:d,startRecording:u,stopRecording:f}=Tv({onTranscript:H=>{s.value=s.value?`${s.value}
|
|
43
|
-
${H}`:H}}),g=P(null),k=P(null),N=P(null),I=P(null),F=P(!1),z=P(!1),j=P(null),U=P(""),D=P([]),ae=P(!1),ue=P(0);let de=0,Te=null;const oe=typeof navigator<"u"&&/Android/i.test(navigator.userAgent),X=[{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"}],me=ce(()=>n.models.map(H=>({value:H,label:H}))),ne=ce(()=>n.skills??[]),Fe=ce(()=>i.value.map(H=>H.path)),He=ce(()=>(n.skills??[]).map(H=>({value:H.path,label:H.name,description:H.description}))),Ge=ce(()=>n.disabled||!n.activeThreadId?!1:s.value.trim().length>0||o.value.length>0||a.value.length>0),Ae=ce(()=>n.disabled||!n.activeThreadId),_e=ce(()=>n.inProgressSubmitMode==="steer"?"steer":"queue"),Oe=ce(()=>n.activeThreadId?"Type a message... (@ for files, / for skills)":"Select a thread to send a message");function vt(H="steer"){var J;const W=s.value.trim();if(Ge.value){if(r("submit",{text:W,imageUrls:o.value.map(Ye=>Ye.url),fileAttachments:[...a.value],skills:i.value.map(Ye=>({name:Ye.name,path:Ye.path})),mode:H}),s.value="",o.value=[],i.value=[],a.value=[],F.value=!1,z.value=!1,ee(),oe){(J=I.value)==null||J.blur();return}zt(()=>{var Ye;return(Ye=I.value)==null?void 0:Ye.focus()})}}function Ze(){r("interrupt")}function ct(H){r("update:selected-model",H)}function tt(H){r("update:selected-reasoning-effort",H)}function ze(){Ae.value||(F.value=!F.value)}function he(){var H;(H=k.value)==null||H.click()}function Ee(){var H;(H=N.value)==null||H.click()}function Se(H){o.value=o.value.filter(W=>W.id!==H)}function E(H){i.value=i.value.filter(W=>W.path!==H)}function Z(H){a.value=a.value.filter(W=>W.fsPath!==H)}function Y(H){const W=H.replace(/\\/g,"/");if(a.value.some(b=>b.fsPath===W))return;const J=W.split("/").filter(Boolean),Ye=J[J.length-1]??W;a.value=[...a.value,{label:Ye,path:W,fsPath:W}]}function ye(H){return H.type.startsWith("image/")?!0:/\.(png|jpe?g|gif|webp)$/i.test(H.name)}function De(H){if(!(!H||H.length===0))for(const W of Array.from(H))if(ye(W)){const J=new FileReader;J.onload=()=>{typeof J.result=="string"&&o.value.push({id:`${Date.now()}-${Math.random().toString(36).slice(2)}`,name:W.name,url:J.result})},J.readAsDataURL(W)}else gy(W).then(J=>{J&&Y(J)}).catch(()=>{})}function p(H){H&&(H.value="")}function y(H){const W=H.target;De((W==null?void 0:W.files)??null),p(W),F.value=!1}function x(H){const W=H.target;De((W==null?void 0:W.files)??null),p(W),F.value=!1}function O(){const W=s.value.startsWith("/");W!==z.value&&(z.value=W),se()}function B(H){if(ae.value){if(H.key==="Escape"){H.preventDefault(),ee();return}if(H.key==="ArrowDown"){H.preventDefault(),D.value.length>0&&(ue.value=(ue.value+1)%D.value.length);return}if(H.key==="ArrowUp"){if(H.preventDefault(),D.value.length>0){const J=D.value.length;ue.value=(ue.value+J-1)%J}return}if(H.key==="Enter"||H.key==="Tab"){H.preventDefault();const J=D.value[ue.value];J?V(J):ee();return}}if(n.sendWithEnter!==!1?H.key==="Enter"&&!H.shiftKey:H.key==="Enter"&&(H.metaKey||H.ctrlKey)){H.preventDefault(),vt(n.isTurnInProgress?_e.value:"steer");return}if(z.value){if(H.key==="Escape"){H.preventDefault(),L();return}if(H.key==="ArrowDown"||H.key==="ArrowUp"){H.preventDefault();return}}}function L(){var H;z.value=!1,(H=I.value)==null||H.focus()}function ee(){ae.value=!1,j.value=null,U.value="",D.value=[],ue.value=0}function se(){const H=I.value;if(!H){ee();return}const W=H.selectionStart??s.value.length,Ye=s.value.slice(0,W).match(/(^|\s)(@[^\s@]*)$/);if(!Ye){ee();return}const b=Ye[2]??"",A=b.length,M=W-A;j.value=M,U.value=b.slice(1),ae.value=!0,Q()}async function Q(){if(!ae.value)return;const H=(n.cwd??"").trim();if(!H){D.value=[];return}Te&&clearTimeout(Te);const W=++de;Te=setTimeout(async()=>{try{const J=await dy(H,U.value,20);if(!ae.value||W!==de)return;D.value=J,ue.value=0}catch{if(!ae.value||W!==de)return;D.value=[]}},120)}function V(H){const W=I.value,J=j.value;if(J!==null&&W){const Ye=W.selectionStart??s.value.length;s.value=`${s.value.slice(0,J)}${s.value.slice(Ye)}`.trimEnd()}Y(H.path),ee(),zt(()=>W==null?void 0:W.focus())}function we(H){const W=H.lastIndexOf("/");return W<0?H:H.slice(W+1)}function ie(H){const W=H.lastIndexOf("/");return W<=0?"":H.slice(0,W)}function ge(H){const W=we(H),J=W.lastIndexOf(".");return J<=0?"":W.slice(J+1).toLowerCase()}function ke(H){const W=ge(H);return W==="ts"?"TS":W==="tsx"?"TSX":W==="js"?"JS":W==="jsx"?"JSX":W==="json"?"{}":""}function Ne(H){const W=ge(H);return W.startsWith("ts")?"ts":W.startsWith("js")?"js":W==="json"?"json":"default"}function We(H){const W=ge(H);return W==="md"||W==="mdx"}function Ie(H){var W;i.value.some(J=>J.path===H.path)||(i.value=[...i.value,H]),s.value=s.value.startsWith("/")?"":s.value,z.value=!1,(W=I.value)==null||W.focus()}function pt(H,W){if(W){const J=(n.skills??[]).find(Ye=>Ye.path===H);J&&!i.value.some(Ye=>Ye.path===H)&&(i.value=[...i.value,J])}else i.value=i.value.filter(J=>J.path!==H)}function Ke(H){if(!F.value)return;const W=g.value;if(!W)return;const J=H.target;!J||W.contains(J)||(F.value=!1)}return Pn(()=>{document.addEventListener("click",Ke)}),On(()=>{document.removeEventListener("click",Ke),Te&&clearTimeout(Te)}),at(()=>n.activeThreadId,()=>{s.value="",o.value=[],i.value=[],a.value=[],F.value=!1,z.value=!1,ee()}),at(()=>n.cwd,()=>{ae.value&&Q()}),(H,W)=>(w(),S("form",{class:"thread-composer",onSubmit:W[7]||(W[7]=Je(J=>vt("steer"),["prevent"]))},[m("div",{class:lt(["thread-composer-shell",{"thread-composer-shell--no-top-radius":e.hasQueueAbove}])},[o.value.length>0?(w(),S("div",aw,[(w(!0),S(Ue,null,wt(o.value,J=>(w(),S("div",{key:J.id,class:"thread-composer-attachment"},[m("img",{class:"thread-composer-attachment-image",src:J.url,alt:J.name||"Selected image"},null,8,lw),m("button",{class:"thread-composer-attachment-remove",type:"button","aria-label":`Remove ${J.name||"image"}`,disabled:Ae.value,onClick:Ye=>Se(J.id)}," x ",8,cw)]))),128))])):le("",!0),a.value.length>0?(w(),S("div",uw,[(w(!0),S(Ue,null,wt(a.value,J=>(w(),S("span",{key:J.fsPath,class:"thread-composer-file-chip"},[Ce(Ws,{class:"thread-composer-file-chip-icon"}),m("span",{class:"thread-composer-file-chip-name",title:J.fsPath},fe(J.label),9,dw),m("button",{class:"thread-composer-file-chip-remove",type:"button","aria-label":`Remove ${J.label}`,disabled:Ae.value,onClick:Ye=>Z(J.fsPath)},"×",8,fw)]))),128))])):le("",!0),i.value.length>0?(w(),S("div",hw,[(w(!0),S(Ue,null,wt(i.value,J=>(w(),S("span",{key:J.path,class:"thread-composer-skill-chip"},[m("span",pw,fe(J.name),1),m("button",{class:"thread-composer-skill-chip-remove",type:"button","aria-label":`Remove skill ${J.name}`,onClick:Ye=>E(J.path)},"×",8,mw)]))),128))])):le("",!0),m("div",gw,[ae.value?(w(),S("div",vw,[D.value.length>0?(w(!0),S(Ue,{key:0},wt(D.value,(J,Ye)=>(w(),S("button",{key:J.path,class:lt(["thread-composer-file-mention-row",{"is-active":Ye===ue.value}]),type:"button",onMousedown:Je(b=>V(J),["prevent"])},[ke(J.path)?(w(),S("span",{key:0,class:lt(["thread-composer-file-mention-icon-badge",`is-${Ne(J.path)}`])},fe(ke(J.path)),3)):We(J.path)?(w(),S("span",ww,"↓")):(w(),dt(Ws,{key:2,class:"thread-composer-file-mention-icon-file"})),m("span",bw,[m("span",_w,fe(we(J.path)),1),ie(J.path)?(w(),S("span",kw,fe(ie(J.path)),1)):le("",!0)])],42,yw))),128)):(w(),S("div",Tw,"No matching files"))])):le("",!0),Rn(m("textarea",{ref_key:"inputRef",ref:I,"onUpdate:modelValue":W[0]||(W[0]=J=>s.value=J),class:"thread-composer-input",placeholder:Oe.value,disabled:Ae.value,onInput:O,onKeydown:B},null,40,Sw),[[$n,s.value]]),Ce(iw,{skills:ne.value,visible:z.value,"anchor-bottom":44,"anchor-left":0,onSelect:Ie,onClose:L},null,8,["skills","visible"])]),m("div",xw,[m("div",{ref_key:"attachMenuRootRef",ref:g,class:"thread-composer-attach"},[m("button",{class:"thread-composer-attach-trigger",type:"button","aria-label":"Add photos & files",disabled:Ae.value,onClick:ze}," + ",8,Cw),F.value?(w(),S("div",Ew,[m("button",{class:"thread-composer-attach-item",type:"button",disabled:Ae.value,onClick:he}," Add photos & files ",8,Aw),m("button",{class:"thread-composer-attach-item",type:"button",disabled:Ae.value,onClick:Ee}," Take photo ",8,Iw)])):le("",!0)],512),Ce(ri,{class:"thread-composer-control","model-value":e.selectedModel,options:me.value,placeholder:"Model","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.models.length===0||e.isTurnInProgress,"onUpdate:modelValue":ct},null,8,["model-value","options","disabled"]),Ce(Qy,{class:"thread-composer-control",options:He.value,"selected-values":Fe.value,placeholder:"Skills","search-placeholder":"Search skills...","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,onToggle:pt},null,8,["options","selected-values","disabled"]),Ce(ri,{class:"thread-composer-control","model-value":e.selectedReasoningEffort,options:X,placeholder:"Thinking","open-direction":"up",disabled:e.disabled||!e.activeThreadId||e.isTurnInProgress,"onUpdate:modelValue":tt},null,8,["model-value","disabled"]),m("div",Rw,[je(d)&&!e.isTurnInProgress?(w(),S("button",{key:0,class:lt(["thread-composer-mic",{"thread-composer-mic--active":je(l)!=="idle"}]),type:"button","aria-label":je(l)==="recording"?"Stop dictation":"Hold to dictate",title:je(l)==="recording"?"Release to transcribe":"Hold to dictate",disabled:Ae.value,onMousedown:W[1]||(W[1]=Je((...J)=>je(u)&&je(u)(...J),["prevent"])),onMouseup:W[2]||(W[2]=(...J)=>je(f)&&je(f)(...J)),onMouseleave:W[3]||(W[3]=J=>je(l)==="recording"&&je(f)()),onTouchstart:W[4]||(W[4]=Je((...J)=>je(u)&&je(u)(...J),["prevent"])),onTouchend:W[5]||(W[5]=(...J)=>je(f)&&je(f)(...J))},[Ce(Sy,{class:"thread-composer-mic-icon"})],42,$w)):le("",!0),e.isTurnInProgress?(w(),S("button",{key:1,class:"thread-composer-stop",type:"button","aria-label":"Stop",disabled:e.disabled||!e.activeThreadId||e.isInterruptingTurn,onClick:Ze},[Ce(Ay,{class:"thread-composer-stop-icon"})],8,Mw)):le("",!0),m("button",{class:lt(["thread-composer-submit",{"thread-composer-submit--queue":e.isTurnInProgress&&_e.value==="queue"}]),type:"button","aria-label":e.isTurnInProgress&&_e.value==="queue"?"Queue message":"Send message",title:e.isTurnInProgress?`Send as ${_e.value}`:"Send",disabled:!Ge.value,onClick:W[6]||(W[6]=J=>vt(e.isTurnInProgress?_e.value:"steer"))},[Ce(by,{class:"thread-composer-submit-icon"})],10,Pw)])])],2),m("input",{ref_key:"photoLibraryInputRef",ref:k,class:"thread-composer-hidden-input",type:"file",multiple:"",disabled:Ae.value,onChange:y},null,40,Ow),m("input",{ref_key:"cameraCaptureInputRef",ref:N,class:"thread-composer-hidden-input",type:"file",accept:"image/*",capture:"environment",disabled:Ae.value,onChange:x},null,40,Nw)],32))}}),sl=Xe(jw,[["__scopeId","data-v-983e7906"]]),Dw={key:0,class:"queued-messages"},Lw={class:"queued-messages-inner"},Bw={class:"queued-row-text"},Fw={class:"queued-row-actions"},Hw=["onClick"],Uw=["onClick"],Vw=Et({__name:"QueuedMessages",props:{messages:{}},emits:["steer","delete"],setup(e){return(t,n)=>e.messages.length>0?(w(),S("div",Dw,[m("div",Lw,[(w(!0),S(Ue,null,wt(e.messages,r=>(w(),S("div",{key:r.id,class:"queued-row"},[n[1]||(n[1]=m("svg",{class:"queued-row-icon",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})],-1)),m("span",Bw,fe(r.text),1),m("div",Fw,[m("button",{class:"queued-row-steer",type:"button",title:"Send now without interrupting work",onClick:s=>t.$emit("steer",r.id)},"Steer",8,Hw),m("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]=[m("svg",{xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24","aria-hidden":"true"},[m("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 7h16M10 11v6M14 11v6M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2l1-12M9 7V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3"})],-1)])],8,Uw)])]))),128))])])):le("",!0)}}),Ww=Xe(Vw,[["__scopeId","data-v-ea583733"]]),qw={class:"runtime-dropdown-trigger-label"},Kw={key:0,class:"runtime-dropdown-menu-wrap"},Gw={class:"runtime-dropdown-menu"},zw=["onClick"],Yw={class:"runtime-dropdown-option-label"},Jw={key:0,class:"runtime-dropdown-option-check"},Qw=Et({__name:"ComposerRuntimeDropdown",props:{modelValue:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(!1),i=[{value:"local",label:"Local project",icon:Kc},{value:"worktree",label:"New worktree",icon:Ns}],a=ce(()=>i.find(u=>u.value===n.modelValue)??i[0]);function l(u){r("update:modelValue",u),o.value=!1}function d(u){if(!o.value)return;const f=s.value;if(!f)return;const g=u.target;g instanceof Node&&(f.contains(g)||(o.value=!1))}return Pn(()=>{window.addEventListener("pointerdown",d)}),On(()=>{window.removeEventListener("pointerdown",d)}),(u,f)=>(w(),S("div",{ref_key:"rootRef",ref:s,class:"runtime-dropdown"},[m("button",{class:"runtime-dropdown-trigger",type:"button",onClick:f[0]||(f[0]=g=>o.value=!o.value)},[(w(),dt(qo(a.value.icon),{class:"runtime-dropdown-trigger-icon"})),m("span",qw,fe(a.value.label),1),Ce(ao,{class:"runtime-dropdown-trigger-chevron"})]),o.value?(w(),S("div",Kw,[m("div",Gw,[f[1]||(f[1]=m("div",{class:"runtime-dropdown-title"},"Continue in",-1)),(w(),S(Ue,null,wt(i,g=>m("button",{key:g.value,class:lt(["runtime-dropdown-option",{"is-selected":e.modelValue===g.value}]),type:"button",onClick:k=>l(g.value)},[(w(),dt(qo(g.icon),{class:"runtime-dropdown-option-icon"})),m("span",Yw,fe(g.label),1),e.modelValue===g.value?(w(),S("span",Jw,"✓")):le("",!0)],10,zw)),64))])])):le("",!0)],512))}}),Xw=Xe(Qw,[["__scopeId","data-v-9c9b71e5"]]),Zw={},eb={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function tb(e,t){return w(),S("svg",eb,[...t[0]||(t[0]=[m("circle",{cx:"11",cy:"11",r:"8"},null,-1),m("path",{d:"m21 21-4.35-4.35"},null,-1)])])}const si=Xe(Zw,[["render",tb]]),nb={class:"skill-card-top"},rb=["src","alt"],sb={key:1,class:"skill-card-avatar-fallback"},ob={class:"skill-card-info"},ib={class:"skill-card-header"},ab={class:"skill-card-name"},lb={key:0,class:"skill-card-badge-disabled"},cb={key:1,class:"skill-card-badge"},ub={class:"skill-card-owner"},db={key:0,class:"skill-card-desc"},fb={key:1,class:"skill-card-date"},hb=Et({__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)=>(w(),S("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))},[m("div",nb,[e.skill.avatarUrl?(w(),S("img",{key:0,class:"skill-card-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy",onError:r},null,40,rb)):(w(),S("div",sb,fe(e.skill.owner.charAt(0)),1)),m("div",ob,[m("div",ib,[m("span",ab,fe(e.skill.displayName||e.skill.name),1),e.skill.installed&&e.skill.enabled===!1?(w(),S("span",lb,"Disabled")):e.skill.installed?(w(),S("span",cb,"Installed")):le("",!0)]),m("span",ub,fe(e.skill.owner),1)])]),e.skill.description?(w(),S("p",db,fe(e.skill.description),1)):le("",!0),n.value?(w(),S("span",fb,fe(n.value),1)):le("",!0)],2))}}),ol=Xe(hb,[["__scopeId","data-v-2a1e8196"]]),pb={class:"sdm-panel"},mb={class:"sdm-header"},gb={class:"sdm-title-area"},vb=["src","alt"],yb={class:"sdm-title-col"},wb={class:"sdm-title-row"},bb={class:"sdm-title"},_b={key:0,class:"sdm-badge-disabled"},kb={class:"sdm-owner"},Tb={class:"sdm-body"},Sb={key:0,class:"sdm-desc"},xb={key:1,class:"sdm-readme-loading"},Cb=["innerHTML"],Eb=["href"],Ab={class:"sdm-footer"},Ib={class:"sdm-footer-actions"},Rb=["disabled"],$b=["disabled"],Mb=["disabled"],Pb=Et({__name:"SkillDetailModal",props:{skill:{},visible:{type:Boolean},isInstalling:{type:Boolean},isUninstalling:{type:Boolean}},emits:["close","install","uninstall","toggle-enabled"],setup(e,{emit:t}){const n=e,r=t,s=P(null),o=P(""),i=P(!1),a=ce(()=>s.value??n.skill.enabled??!0),l=ce(()=>n.isInstalling===!0||n.isUninstalling===!0),d=ce(()=>{const I=o.value;if(!I)return"";const F=I.replace(/^---[\s\S]*?---\s*/,"");return u(F)});function u(I){return I.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/^### (.+)$/gm,"<h4>$1</h4>").replace(/^## (.+)$/gm,"<h3>$1</h3>").replace(/^# (.+)$/gm,"<h2>$1</h2>").replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/`([^`]+)`/g,"<code>$1</code>").replace(/^- (.+)$/gm,"<li>$1</li>").replace(/(<li>.*<\/li>\n?)+/g,"<ul>$&</ul>").replace(/\n{2,}/g,"<br/><br/>").replace(/\n/g,"<br/>")}async function f(){if(!(!n.skill.owner||!n.skill.name)){i.value=!0,o.value="";try{const I=new URLSearchParams({owner:n.skill.owner,name:n.skill.name}),F=await fetch(`/codex-api/skills-hub/readme?${I}`);if(!F.ok)return;const z=await F.json();o.value=z.content??""}catch{}finally{i.value=!1}}}at(()=>n.visible,I=>{I&&(s.value=null,o.value="",f())});function g(){r("install",n.skill)}function k(){r("uninstall",n.skill)}function N(){const I=!a.value;s.value=I,r("toggle-enabled",n.skill,I)}return(I,F)=>(w(),dt(Bs,{to:"body"},[e.visible?(w(),S("div",{key:0,class:"sdm-overlay",onClick:F[1]||(F[1]=Je(z=>I.$emit("close"),["self"]))},[m("div",pb,[m("div",mb,[m("div",gb,[e.skill.avatarUrl?(w(),S("img",{key:0,class:"sdm-avatar",src:e.skill.avatarUrl,alt:e.skill.owner,loading:"lazy"},null,8,vb)):le("",!0),m("div",yb,[m("div",wb,[m("h3",bb,fe(e.skill.displayName||e.skill.name),1),e.skill.installed&&!a.value?(w(),S("span",_b,"Disabled")):le("",!0)]),m("span",kb,fe(e.skill.owner),1)])]),m("button",{class:"sdm-close",type:"button","aria-label":"Close",onClick:F[0]||(F[0]=z=>I.$emit("close"))},[Ce(Ri,{class:"sdm-close-icon"})])]),m("div",Tb,[e.skill.description?(w(),S("p",Sb,fe(e.skill.description),1)):le("",!0),i.value?(w(),S("div",xb,"Loading skill contents...")):o.value?(w(),S("div",{key:2,class:"sdm-readme",innerHTML:d.value},null,8,Cb)):le("",!0),m("a",{class:"sdm-link",href:e.skill.url,target:"_blank",rel:"noopener noreferrer"},"View on GitHub",8,Eb)]),m("div",Ab,[m("div",Ib,[e.skill.installed?(w(),S("button",{key:0,class:"sdm-btn sdm-btn-danger",type:"button",disabled:l.value,onClick:k},fe(n.isUninstalling?"Uninstalling...":"Uninstall"),9,Rb)):(w(),S("button",{key:1,class:"sdm-btn sdm-btn-primary",type:"button",disabled:l.value,onClick:g},fe(n.isInstalling?"Installing...":"Install"),9,$b)),e.skill.installed?(w(),S("button",{key:2,class:"sdm-btn sdm-btn-secondary",type:"button",disabled:l.value,onClick:N},fe(a.value?"Disable":"Enable"),9,Mb)):le("",!0)])])])])):le("",!0)]))}}),Ob=Xe(Pb,[["__scopeId","data-v-19a385ca"]]),Nb={class:"skills-hub"},jb={class:"skills-hub-toolbar"},Db={class:"skills-hub-search-wrap"},Lb={key:0,class:"skills-hub-count"},Bb={key:1,class:"skills-hub-section"},Fb={class:"skills-hub-section-title"},Hb={key:0,class:"skills-hub-grid"},Ub={class:"skills-hub-section"},Vb={key:0,class:"skills-hub-loading"},Wb={key:1,class:"skills-hub-error"},qb={key:0,class:"skills-hub-grid"},Kb={key:1,class:"skills-hub-empty"},Cs="codex-web-local.skills-hub.cache.v1",Gb=Et({__name:"SkillsHub",emits:["skills-changed"],setup(e,{emit:t}){const n={name:"",owner:"",description:"",url:"",installed:!1},r=P(null),s=P(""),o=P("date"),i=P([]),a=P([]),l=P(0),d=P(!1),u=P(""),f=P(!0),g=P(!1),k=P(n),N=P(null),I=P(""),F=P(!1),z=P(!1);let j=null,U=null;const D=t,ae=ce(()=>o.value==="date"?"Newest":"A-Z"),ue=ce(()=>{var he;return((he=N.value)==null?void 0:he.type)==="error"?"skills-hub-toast-error":"skills-hub-toast-success"}),de=ce(()=>`${k.value.owner}/${k.value.name}`),Te=ce(()=>F.value&&I.value===de.value),oe=ce(()=>z.value&&I.value===de.value),X=ce(()=>{const he=s.value.toLowerCase().trim();return he?a.value.filter(Ee=>Ee.name.toLowerCase().includes(he)||Ee.owner.toLowerCase().includes(he)||(Ee.displayName??"").toLowerCase().includes(he)):a.value});function me(he,Ee="success"){N.value={text:he,type:Ee},U&&clearTimeout(U),U=setTimeout(()=>{N.value=null},3e3)}function ne(){o.value=o.value==="date"?"name":"date",Oe(s.value)}function Fe(he){return`${o.value}::${he.trim().toLowerCase()}`}function He(he){var Ee;if(typeof window>"u")return null;try{const Se=window.localStorage.getItem(Cs);return Se?((Ee=JSON.parse(Se).byKey)==null?void 0:Ee[he])??null:null}catch{return null}}function Ge(he,Ee){if(!(typeof window>"u"))try{const Se=window.localStorage.getItem(Cs),Z=(Se?JSON.parse(Se):{}).byKey??{};Z[he]=Ee,window.localStorage.setItem(Cs,JSON.stringify({byKey:Z}))}catch{}}function Ae(){if(!(typeof window>"u"))try{window.localStorage.removeItem(Cs)}catch{}}function _e(he){const Ee=he.installed??[];a.value=Ee;const Se=new Set(Ee.map(E=>E.name));i.value=he.data.map(E=>{if(E.installed||Se.has(E.name)){const Z=Ee.find(Y=>Y.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=he.total}async function Oe(he){const Ee=Fe(he),Se=He(Ee);Se&&_e(Se),d.value=!Se,u.value="";try{const E=new URLSearchParams;he.trim()&&E.set("q",he.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 Y=await Z.json();_e(Y),Ge(Ee,Y)}catch(E){u.value=E instanceof Error?E.message:"Failed to load skills"}finally{d.value=!1}}function vt(){j&&clearTimeout(j),j=setTimeout(()=>Oe(s.value),300)}function Ze(he){k.value=he,g.value=!0}async function ct(he){I.value=`${he.owner}/${he.name}`,F.value=!0;try{const Se=await(await fetch("/codex-api/skills-hub/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({owner:he.owner,name:he.name})})).json();if(!Se.ok)throw new Error(Se.error||"Install failed");const E={...he,installed:!0,path:Se.path,enabled:!0};a.value=[...a.value,E],i.value=i.value.filter(Z=>Z.name!==he.name),k.value=E,me(`${he.displayName||he.name} skill installed`),g.value=!1,Ae(),D("skills-changed")}catch(Ee){me(Ee instanceof Error?Ee.message:"Failed to install skill","error")}finally{F.value=!1}}async function tt(he){I.value=`${he.owner}/${he.name}`,z.value=!0;try{const Se=await(await fetch("/codex-api/skills-hub/uninstall",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:he.name,path:he.path})})).json();if(!Se.ok)throw new Error(Se.error||"Uninstall failed");a.value=a.value.filter(E=>E.name!==he.name),he.owner!=="local"&&(i.value=[...i.value,{...he,installed:!1,path:void 0,enabled:void 0}]),me(`${he.displayName||he.name} skill uninstalled`),g.value=!1,Ae(),D("skills-changed")}catch(Ee){me(Ee instanceof Error?Ee.message:"Failed to uninstall skill","error")}finally{z.value=!1}}async function ze(he,Ee){try{if(!(await fetch("/codex-api/rpc",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({method:"skills/config/write",params:{path:he.path,enabled:Ee}})})).ok)throw new Error("Failed to update skill");me(`${he.displayName||he.name} skill ${Ee?"enabled":"disabled"}`),await Oe(s.value)}catch(Se){me(Se instanceof Error?Se.message:"Failed to update skill","error")}}return Pn(()=>{Oe("")}),(he,Ee)=>(w(),S("div",Nb,[Ee[3]||(Ee[3]=m("div",{class:"skills-hub-header"},[m("h2",{class:"skills-hub-title"},"Skills Hub"),m("p",{class:"skills-hub-subtitle"},"Browse and discover skills from the OpenClaw community")],-1)),m("div",jb,[m("div",Db,[Ce(si,{class:"skills-hub-search-icon"}),Rn(m("input",{ref_key:"searchRef",ref:r,"onUpdate:modelValue":Ee[0]||(Ee[0]=Se=>s.value=Se),class:"skills-hub-search",type:"text",placeholder:"Search skills... (e.g. flight, docker, react)",onInput:vt},null,544),[[$n,s.value]]),l.value>0?(w(),S("span",Lb,fe(l.value)+" skills",1)):le("",!0)]),m("button",{class:"skills-hub-sort",type:"button",onClick:ne},fe(ae.value),1)]),N.value?(w(),S("div",{key:0,class:lt(["skills-hub-toast",ue.value])},fe(N.value.text),3)):le("",!0),X.value.length>0?(w(),S("div",Bb,[m("button",{class:"skills-hub-section-toggle",type:"button",onClick:Ee[1]||(Ee[1]=Se=>f.value=!f.value)},[m("span",Fb,"Installed ("+fe(X.value.length)+")",1),Ce(qc,{class:lt(["skills-hub-section-chevron",{"is-open":f.value}])},null,8,["class"])]),f.value?(w(),S("div",Hb,[(w(!0),S(Ue,null,wt(X.value,Se=>(w(),dt(ol,{key:Se.name,skill:Se,onSelect:E=>Ze(E)},null,8,["skill","onSelect"]))),128))])):le("",!0)])):le("",!0),m("div",Ub,[d.value?(w(),S("div",Vb,"Loading skills...")):u.value?(w(),S("div",Wb,fe(u.value),1)):(w(),S(Ue,{key:2},[i.value.length>0?(w(),S("div",qb,[(w(!0),S(Ue,null,wt(i.value,Se=>(w(),dt(ol,{key:Se.url,skill:Se,onSelect:E=>Ze(E)},null,8,["skill","onSelect"]))),128))])):s.value.trim()?(w(),S("div",Kb,'No skills found for "'+fe(s.value)+'"',1)):le("",!0)],64))]),Ce(Ob,{skill:k.value,visible:g.value,"is-installing":Te.value,"is-uninstalling":oe.value,onClose:Ee[2]||(Ee[2]=Se=>g.value=!1),onInstall:ct,onUninstall:tt,onToggleEnabled:ze},null,8,["skill","visible","is-installing","is-uninstalling"])]))}}),zb=Xe(Gb,[["__scopeId","data-v-1967b404"]]),Yb={},Jb={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 Qb(e,t){return w(),S("svg",Jb,[...t[0]||(t[0]=[m("path",{d:"M4 6a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2l0 -12"},null,-1),m("path",{d:"M9 4l0 16"},null,-1)])])}const Xb=Xe(Yb,[["render",Qb]]),Zb={},e0={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true"};function t0(e,t){return w(),S("svg",e0,[...t[0]||(t[0]=[m("path",{d:"M6 21a3 3 0 0 1 -3 -3v-12a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3zm12 -16h-8v14h8a1 1 0 0 0 1 -1v-12a1 1 0 0 0 -1 -1"},null,-1)])])}const n0=Xe(Zb,[["render",t0]]),r0={},s0={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"};function o0(e,t){return w(),S("svg",s0,[...t[0]||(t[0]=[m("path",{d:"M20 11a8.1 8.1 0 0 0-15.5-2m-.5-4v4h4"},null,-1),m("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null,-1)])])}const i0=Xe(r0,[["render",o0]]),a0={class:"sidebar-thread-controls"},l0=["aria-label","title"],c0=["aria-pressed","aria-label","title"],u0=Et({__name:"SidebarThreadControls",props:{isSidebarCollapsed:{type:Boolean},isAutoRefreshEnabled:{type:Boolean},autoRefreshButtonLabel:{},showNewThreadButton:{type:Boolean}},emits:["toggle-sidebar","toggle-auto-refresh","start-new-thread"],setup(e){return(t,n)=>(w(),S("div",a0,[m("button",{class:"sidebar-thread-controls-button",type:"button","aria-label":e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",title:e.isSidebarCollapsed?"Expand sidebar":"Collapse sidebar",onClick:n[0]||(n[0]=r=>t.$emit("toggle-sidebar"))},[e.isSidebarCollapsed?(w(),dt(n0,{key:0,class:"sidebar-thread-controls-icon"})):(w(),dt(Xb,{key:1,class:"sidebar-thread-controls-icon"}))],8,l0),m("button",{class:"sidebar-thread-controls-button",type:"button","aria-pressed":e.isAutoRefreshEnabled,"aria-label":e.autoRefreshButtonLabel,title:e.autoRefreshButtonLabel,onClick:n[1]||(n[1]=r=>t.$emit("toggle-auto-refresh"))},[Ce(i0,{class:"sidebar-thread-controls-icon"})],8,c0),fn(t.$slots,"default",{},void 0),e.showNewThreadButton?(w(),S("button",{key:0,class:"sidebar-thread-controls-button",type:"button","aria-label":"Start new thread",title:"Start new thread",onClick:n[2]||(n[2]=r=>t.$emit("start-new-thread"))},[Ce(Ws,{class:"sidebar-thread-controls-icon"})])):le("",!0)]))}}),il=Xe(u0,[["__scopeId","data-v-57866500"]]),d0={},f0={xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24"};function h0(e,t){return w(),S("svg",f0,[...t[0]||(t[0]=[m("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[m("path",{d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 0 0-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 0 0-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 0 0-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 0 0-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 0 0 1.066-2.573c-.94-1.543.826-3.31 2.37-2.37c1 .608 2.296.07 2.572-1.065"}),m("path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0-6 0"})],-1)])])}const p0=Xe(d0,[["render",h0]]);function Kn(e){return e.flatMap(t=>t.threads)}const Jc="codex-web-local.thread-read-state.v1",Qc="codex-web-local.thread-scroll-state.v1",oi="codex-web-local.selected-thread-id.v1",Xc="codex-web-local.project-order.v1",Zc="codex-web-local.project-display-name.v1",eu="codex-web-local.auto-refresh-enabled.v1",Mo=220,Zr=4e3,al=["none","minimal","low","medium","high","xhigh"],es="__global__",Qt="gpt-5.2-codex";function m0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Jc);if(!e)return{};const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?{}:t}catch{return{}}}function ll(e){typeof window>"u"||window.localStorage.setItem(Jc,JSON.stringify(e))}function g0(){return typeof window>"u"?!1:window.localStorage.getItem(eu)==="1"}function cl(e){typeof window>"u"||window.localStorage.setItem(eu,e?"1":"0")}function tu(e,t,n){return Math.min(Math.max(e,t),n)}function v0(e){if(!e||typeof e!="object"||Array.isArray(e))return null;const t=e;if(typeof t.scrollTop!="number"||!Number.isFinite(t.scrollTop)||typeof t.isAtBottom!="boolean")return null;const n={scrollTop:Math.max(0,t.scrollTop),isAtBottom:t.isAtBottom};return typeof t.scrollRatio=="number"&&Number.isFinite(t.scrollRatio)&&(n.scrollRatio=tu(t.scrollRatio,0,1)),n}function y0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Qc);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t)){if(!r)continue;const o=v0(s);o&&(n[r]=o)}return n}catch{return{}}}function ul(e){typeof window>"u"||window.localStorage.setItem(Qc,JSON.stringify(e))}function w0(){return typeof window>"u"?"":window.localStorage.getItem(oi)??""}function b0(e){if(!(typeof window>"u")){if(!e){window.localStorage.removeItem(oi);return}window.localStorage.setItem(oi,e)}}function _0(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(Xc);if(!e)return[];const t=JSON.parse(e);if(!Array.isArray(t))return[];const n=[];for(const r of t)typeof r=="string"&&r.length>0&&!n.includes(r)&&n.push(r);return n}catch{return[]}}function Mr(e){typeof window>"u"||window.localStorage.setItem(Xc,JSON.stringify(e))}function k0(){if(typeof window>"u")return{};try{const e=window.localStorage.getItem(Zc);if(!e)return{};const t=JSON.parse(e);if(!t||typeof t!="object"||Array.isArray(t))return{};const n={};for(const[r,s]of Object.entries(t))typeof r=="string"&&r.length>0&&typeof s=="string"&&(n[r]=s);return n}catch{return{}}}function Po(e){typeof window>"u"||window.localStorage.setItem(Zc,JSON.stringify(e))}function Es(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 fr(e,n)?e:n}function Oo(e,t){const n=new Map(e.map(s=>[s.projectName,s])),r=t.map(s=>n.get(s)??{projectName:s,threads:[]});for(const s of e)t.includes(s.projectName)||r.push(s);return r}function fr(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 T0(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 S0(e,t){return!e&&!t?!0:!e||!t?!1:e.status===t.status&&e.aggregatedOutput===t.aggregatedOutput&&e.exitCode===t.exitCode}function As(e){if(!(e instanceof Error))return!1;const t=e.message.toLowerCase();return t.includes("not supported when using codex with a chatgpt account")||t.includes("model is not supported")}function ii(e,t){return e.id===t.id&&e.role===t.role&&e.text===t.text&&fr(e.images,t.images)&&e.messageType===t.messageType&&e.rawPayload===t.rawPayload&&e.isUnhandled===t.isUnhandled&&S0(e.commandExecution,t.commandExecution)&&e.turnIndex===t.turnIndex}function qs(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 x0(e,t,n={}){const r=new Map(e.map(u=>[u.id,u])),s=new Map(t.map(u=>[u.id,u])),o=t.map(u=>{const f=r.get(u.id);return f&&ii(f,u)?f:u});if(n.preserveMissing!==!0)return qs(e,o)?e:o;const i=e.map(u=>{const f=s.get(u.id);return!f||ii(u,f)?u:f}),a=new Set(e.map(u=>u.id)),l=o.filter(u=>!a.has(u.id)),d=[...i,...l];return qs(e,d)?e:d}function ai(e){return e.replace(/\s+/gu," ").trim()}function C0(e,t){const n=new Set(t.filter(s=>s.role==="assistant").map(s=>ai(s.text)).filter(s=>s.length>0));if(n.size===0)return e;const r=e.filter(s=>{if(s.messageType!=="agentMessage.live")return!0;const o=ai(s.text);return o.length===0?!1:!n.has(o)});return r.length===e.length?e:r}function dl(e,t){const n=e.findIndex(o=>o.id===t.id);if(n<0)return[...e,t];const r=e[n];if(ii(r,t))return e;const s=[...e];return s.splice(n,1,t),s}const nu="worked";function Un(e){if(!e)return null;const t=new Date(e).getTime();return Number.isNaN(t)?null:t}function E0(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 A0(e,t){return!e&&!t?!0:!e||!t?!1:e.turnId===t.turnId&&e.durationMs===t.durationMs}function I0(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 R0(e){return{id:`turn-summary:${e.turnId}`,role:"system",text:`Worked for ${E0(e.durationMs)}`,messageType:nu}}function $0(e){for(let t=e.length-1;t>=0;t-=1)if(e[t].role==="assistant")return t;return-1}function M0(e,t){const n=R0(t),r=e.filter(i=>i.messageType!==nu),s=$0(r);if(s<0)return[...r,n];const o=[...r];return o.splice(s,0,n),o}function At(e,t){if(!(t in e))return e;const n={...e};return delete n[t],n}function P0(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 O0(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 N0(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function Mt(e,t){const n=Object.entries(e).filter(([r])=>t.has(r));return n.length===Object.keys(e).length?e:Object.fromEntries(n)}function Is(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&&P0(d,l)?d:l});return o&&o.projectName===s.projectName&&O0(o.threads,a)?o:{projectName:s.projectName,threads:a}});return N0(e,r)?e:r}function j0(e,t,n){const r=new Set(Kn(t).map(a=>a.id)),s=Kn(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 D0(e){return e.split("/").filter(Boolean).at(-1)||e||"unknown-project"}function No(e){const t=e.replace(/\\/gu,"/");return t.split("/").filter(Boolean).at(-1)||t}function L0(e){const t=e.split(`
|
|
44
|
-
`).map(n=>n.trim()).find(n=>n.length>0);return t?t.slice(0,80):"Untitled thread"}function B0(){const e=P([]),t=P([]),n=P(w0()),r=P({}),s=P({}),o=P({}),i=P({}),a=P({}),l=P({}),d=P({}),u=P([]),f=P(""),g=P("medium"),k=P(m0()),N=P(y0()),I=P(_0()),F=P(k0()),z=P({}),j=P({}),U=P({}),D=P({}),ae=P({}),ue=P({}),de=P({}),Te=P({}),oe=P({}),X=P({}),me=P([]),ne=P(!1),Fe=P(!1),He=P(!1),Ge=P(!1),Ae=P(!1),_e=P(""),Oe=P(!1),vt=P(!1),Ze=P(g0()),ct=P(Math.floor(Zr/1e3));let tt=null,ze=null,he=null,Ee=null,Se=!1;const E=new Set;let Z=!1,Y=!1;const ye=new Map,De=new Set,p=ce(()=>Kn(e.value)),y=ce(()=>p.value.find(c=>c.id===n.value)??null),x=ce(()=>N.value[n.value]??null),O=ce(()=>{const c=[],h=n.value;return h&&Array.isArray(Te.value[h])&&c.push(...Te.value[h]),Array.isArray(Te.value[es])&&c.push(...Te.value[es]),c.sort((v,T)=>v.receivedAtIso.localeCompare(T.receivedAtIso))}),B=ce(()=>{var G;const c=n.value;if(!c)return null;const h=ae.value[c],v=(o.value[c]??"").trim(),T=(((G=ue.value[c])==null?void 0:G.message)??"").trim();return!h&&!v&&!T?null:{activityLabel:(h==null?void 0:h.label)||"Thinking",activityDetails:(h==null?void 0:h.details)??[],reasoningText:v,errorText:T}}),L=ce(()=>{const c=n.value;if(!c)return[];const h=r.value[c]??[],v=s.value[c]??[],T=i.value[c]??[],G=[...h,...T,...v],K=D.value[c];return K?M0(G,K):G});function ee(c){n.value!==c&&(n.value=c,b0(c),Y=!1)}function se(c){f.value=c.trim()}async function Q(){f.value=Qt,u.value.includes(Qt)||(u.value=[...u.value,Qt]);try{await ry(Qt)}catch{}}function V(c,h){oe.value={...oe.value,[c]:h}}function we(c){oe.value[c]&&(oe.value=At(oe.value,c))}async function ie(c){if(De.has(c))return;const h=oe.value[c];if(!(!h||h.fallbackRetried)){De.add(c),V(c,{...h,fallbackRetried:!0});try{await Q();try{const v=await tl(c,1);xe(c,v),ve(c,[]),ft(c),i.value[c]&&(i.value=At(i.value,c))}catch{}A(c,null),_e.value="",W(c,null),b(c,{label:"Thinking",details:ke(Qt,h.effort)}),J(c,!0),U.value[c]!==!0&&await Io(c),await Ro(c,h.text,h.imageUrls,Qt,h.effort||void 0,h.skills.length>0?h.skills:void 0,h.fileAttachments),U.value={...U.value,[c]:!0},E.add(c),Se=!0,await rr()}catch(v){const T=v instanceof Error?v.message:"Unknown application error";A(c,T),_e.value=T,J(c,!1),b(c,null)}finally{De.delete(c)}}}function ge(c){c&&!al.includes(c)||(g.value=c)}function ke(c,h){const v=c.trim()||"default",T=h||"default";return[`Model: ${v}`,`Thinking: ${T}`]}async function Ne(){try{const[c,h]=await Promise.all([sy(),oy()]);u.value=c,f.value.length>0&&c.includes(f.value)||(h.model&&c.includes(h.model)?f.value=h.model:c.length>0?f.value=c[0]:f.value=""),h.reasoningEffort&&al.includes(h.reasoningEffort)&&(g.value=h.reasoningEffort)}catch{}}function We(c){const h=X.value;return Object.keys(h).length===0?c:c.map(v=>({projectName:v.projectName,threads:v.threads.map(T=>{const G=h[T.id];return G?{...T,title:G}:T})}))}function Ie(){const h=We(t.value).map(v=>({projectName:v.projectName,threads:v.threads.map(T=>{const G=a.value[T.id]===!0,K=n.value===T.id,be=k.value[T.id],Re=d.value[T.id]===!0,pe=!K&&!G&&(Re||be!==T.updatedAtIso);return{...T,inProgress:G,unread:pe}})}));e.value=Is(e.value,h)}function pt(c,h,v){const T=new Date().toISOString(),G=h.trim(),K=D0(G),be={id:c,title:L0(v),projectName:K,cwd:G,hasWorktree:G.includes("/.codex/worktrees/")||G.includes("/.git/worktrees/"),createdAtIso:T,updatedAtIso:T,preview:v,unread:!1,inProgress:!1},Re=t.value.findIndex(et=>et.projectName===K);if(Re>=0){const yt=t.value[Re].threads.filter(Bn=>Bn.id!==c),Rr={projectName:K,threads:[be,...yt]},yn=[...t.value];yn.splice(Re,1,Rr),t.value=yn}else t.value=[{projectName:K,threads:[be]},...t.value];const pe=Es(I.value,t.value);fr(I.value,pe)||(I.value=pe,Mr(I.value)),Ie()}function Ke(c){const h=new Set(c.map(K=>K.id)),v=Mt(k.value,h);v!==k.value&&(k.value=v,ll(v));const T=Mt(N.value,h);T!==N.value&&(N.value=T,ul(T)),j.value=Mt(j.value,h),z.value=Mt(z.value,h),U.value=Mt(U.value,h),r.value=Mt(r.value,h),s.value=Mt(s.value,h),o.value=Mt(o.value,h),i.value=Mt(i.value,h),D.value=Mt(D.value,h),ae.value=Mt(ae.value,h),ue.value=Mt(ue.value,h),de.value=Mt(de.value,h),d.value=Mt(d.value,h),a.value=Mt(a.value,h);const G={};for(const[K,be]of Object.entries(Te.value))(K===es||h.has(K))&&(G[K]=be);Te.value=G}function H(c){const h=Kn(t.value).find(v=>v.id===c);h&&(k.value={...k.value,[c]:h.updatedAtIso},ll(k.value),d.value[c]&&(d.value=At(d.value,c)),Ie())}function W(c,h){if(!c)return;const v=D.value[c];if(h){if(A0(v,h))return;D.value={...D.value,[c]:h}}else v&&(D.value=At(D.value,c))}function J(c,h){!c||a.value[c]===!0===h||(h?a.value={...a.value,[c]:!0}:a.value=At(a.value,c),Ie())}function Ye(c){c&&c!==n.value&&d.value[c]!==!0&&(d.value={...d.value,[c]:!0},Ie())}function b(c,h){if(!c)return;const v=ae.value[c];if(!h){v&&(ae.value=At(ae.value,c));return}const T=wr(h.label)||"Thinking",G=h.details.map(Re=>wr(Re)).filter(Re=>Re.length>0&&Re!==T),K=Array.from(new Set([...(v==null?void 0:v.details)??[],...G])).slice(-3),be={label:T,details:K};I0(v,be)||(ae.value={...ae.value,[c]:be})}function A(c,h){if(!c)return;const v=ue.value[c],T=h?ai(h):"";if(!T){v&&(ue.value=At(ue.value,c));return}(v==null?void 0:v.message)!==T&&(ue.value={...ue.value,[c]:{message:T}})}function M(c){const h=Kn(t.value).find(v=>v.id===c);return(h==null?void 0:h.updatedAtIso)??""}function re(c,h){if(!c)return;const v={scrollTop:Math.max(0,h.scrollTop),isAtBottom:h.isAtBottom===!0};typeof h.scrollRatio=="number"&&Number.isFinite(h.scrollRatio)&&(v.scrollRatio=tu(h.scrollRatio,0,1));const T=N.value[c];T&&T.scrollTop===v.scrollTop&&T.isAtBottom===v.isAtBottom&&T.scrollRatio===v.scrollRatio||(N.value={...N.value,[c]:v},ul(N.value))}function xe(c,h){const v=r.value[c]??[];qs(v,h)||(r.value={...r.value,[c]:h})}function ve(c,h){const v=s.value[c]??[];qs(v,h)||(s.value={...s.value,[c]:h})}function mt(c,h){const v=s.value[c]??[],T=dl(v,h);ve(c,T)}function Qe(c,h){if(!c)return;const v=h.trim(),T=o.value[c]??"";if(v.length===0){if(!T)return;o.value=At(o.value,c);return}T!==v&&(o.value={...o.value,[c]:v})}function ut(c,h){if(!c)return;const v=o.value[c]??"";Qe(c,`${v}${h}`)}function ft(c){c&&c in o.value&&(o.value=At(o.value,c))}function Pe(c){return c!==null&&typeof c=="object"&&!Array.isArray(c)?c:null}function Me(c){return typeof c=="string"?c:""}function pn(c){return typeof c=="number"&&Number.isFinite(c)?c:null}function Ut(c){const h=Pe(c.params);if(!h)return"";const v=Me(h.threadId);if(v)return v;const T=Me(h.thread_id);if(T)return T;const G=Me(h.conversationId);if(G)return G;const K=Me(h.conversation_id);if(K)return K;const be=Pe(h.thread),Re=Me(be==null?void 0:be.id);if(Re)return Re;const pe=Pe(h.turn),et=Me(pe==null?void 0:pe.threadId);if(et)return et;const yt=Me(pe==null?void 0:pe.thread_id);return yt||""}function Jn(c){if(c.method!=="turn/completed")return"";const h=Pe(c.params),v=Pe(h==null?void 0:h.turn);if(!v||v.status!=="failed")return"";const T=Pe(v.error);return Me(T==null?void 0:T.message)}function vr(c){var v;if(c.method!=="error")return"";const h=Pe(c.params);return Me(h==null?void 0:h.message)||Me((v=Pe(h==null?void 0:h.error))==null?void 0:v.message)}function yr(c){const h=Pe(c);if(!h)return null;const v=h.id,T=Me(h.method),G=h.params;if(typeof v!="number"||!Number.isInteger(v)||!T)return null;const K=Pe(G),be=Me(K==null?void 0:K.threadId)||es,Re=Me(K==null?void 0:K.turnId),pe=Me(K==null?void 0:K.itemId),et=Me(h.receivedAtIso)||new Date().toISOString();return{id:v,method:T,threadId:be,turnId:Re,itemId:pe,receivedAtIso:et,params:G??null}}function Qn(c){const h=c.threadId||es,v=Te.value[h]??[],T=v.findIndex(K=>K.id===c.id),G=[...v];T>=0?G.splice(T,1,c):G.push(c),Te.value={...Te.value,[h]:G.sort((K,be)=>K.receivedAtIso.localeCompare(be.receivedAtIso))}}function Xn(c){const h={};for(const[v,T]of Object.entries(Te.value)){const G=T.filter(K=>K.id!==c);G.length>0&&(h[v]=G)}Te.value=h}function qr(c){if(c.method==="server/request"){const h=yr(c.params);return h&&Qn(h),!0}if(c.method==="server/request/resolved"){const h=Pe(c.params),v=h==null?void 0:h.id;return typeof v=="number"&&Number.isInteger(v)&&Xn(v),!0}return!1}function wr(c){return c.replace(/\s+/gu," ").trim()}function br(c){const h=Ut(c);if(!h)return null;if(c.method==="turn/started")return{threadId:h,activity:{label:"Thinking",details:[]}};if(c.method==="item/started"){const v=Pe(c.params),T=Pe(v==null?void 0:v.item),G=Me(T==null?void 0:T.type).toLowerCase();if(G==="reasoning")return{threadId:h,activity:{label:"Thinking",details:[]}};if(G==="agentmessage")return{threadId:h,activity:{label:"Writing response",details:[]}};if(G==="commandexecution"){const K=Me(T==null?void 0:T.command);return{threadId:h,activity:{label:"Running command",details:K?[K]:[]}}}}return c.method==="item/commandExecution/outputDelta"?{threadId:h,activity:{label:"Running command",details:[]}}:c.method==="item/reasoning/summaryTextDelta"||c.method==="item/reasoning/summaryPartAdded"?{threadId:h,activity:{label:"Thinking",details:[]}}:c.method==="item/agentMessage/delta"?{threadId:h,activity:{label:"Writing response",details:[]}}:null}function Kt(c){if(c.method!=="turn/started")return null;const h=Pe(c.params);if(!h)return null;const v=Ut(c);if(!v)return null;const T=Pe(h.turn),G=Me(T==null?void 0:T.id)||Me(h.turnId)||`${v}:unknown`;if(!G)return null;const K=Un(Me(T==null?void 0:T.startedAt))??Un(Me(h.startedAt))??Un(c.atIso)??Date.now();return{threadId:v,turnId:G,startedAtMs:K}}function Zn(c){if(c.method!=="turn/completed")return null;const h=Pe(c.params);if(!h)return null;const v=Ut(c);if(!v)return null;const T=Pe(h.turn),G=Me(T==null?void 0:T.id)||Me(h.turnId)||`${v}:unknown`;if(!G)return null;const K=Un(Me(T==null?void 0:T.completedAt))??Un(Me(h.completedAt))??Un(c.atIso)??Date.now(),be=Un(Me(T==null?void 0:T.startedAt))??Un(Me(h.startedAt))??void 0;return{threadId:v,turnId:G,completedAtMs:K,startedAtMs:be}}function mn(c){return`${c}:live-reasoning`}function _r(c){const h=Pe(c.params);if(!h)return"";if(c.method==="item/started"){const v=Pe(h.item);return!v||v.type!=="reasoning"?"":Me(v.id)}return""}function Nn(c){const h=Pe(c.params);if(!h)return null;if(c.method==="item/reasoning/summaryTextDelta"){const v=Me(h.itemId),T=Me(h.delta);return!v||!T?null:{messageId:mn(v),delta:T}}return null}function Kr(c){const h=Pe(c.params);if(!h)return"";if(c.method==="item/reasoning/summaryPartAdded"){const v=Me(h.itemId);return v?mn(v):""}return""}function kr(c){const h=Pe(c.params);if(!h)return"";if(c.method==="item/completed"){const v=Pe(h.item);return!v||v.type!=="reasoning"?"":mn(Me(v.id))}return""}function jn(c){const h=Pe(c.params);if(!h)return"";if(c.method==="item/started"){const v=Pe(h.item);return!v||v.type!=="agentMessage"?"":Me(v.id)}return""}function Tr(c){const h=Pe(c.params);if(!h)return null;if(c.method==="item/agentMessage/delta"){const v=Me(h.itemId),T=Me(h.delta);return!v||!T?null:{messageId:v,delta:T}}return null}function Sr(c){const h=Pe(c.params);if(!h)return null;if(c.method==="item/completed"){const v=Pe(h.item);if(!v||v.type!=="agentMessage")return null;const T=Me(v.id),G=Me(v.text);return!T||!G?null:{id:T,role:"assistant",text:G,messageType:"agentMessage.live"}}return null}function xr(c){if(c.method!=="item/started")return null;const h=Pe(c.params),v=Pe(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const T=Me(v.id),G=Me(v.command);if(!T)return null;const K=typeof v.cwd=="string"?v.cwd:null;return{id:T,role:"system",text:G,messageType:"commandExecution",commandExecution:{command:G,cwd:K,status:"inProgress",aggregatedOutput:"",exitCode:null}}}function gn(c){if(c.method!=="item/commandExecution/outputDelta")return null;const h=Pe(c.params);if(!h)return null;const v=Me(h.itemId),T=Me(h.delta);return!v||!T?null:{itemId:v,delta:T}}function er(c){if(c.method!=="item/completed")return null;const h=Pe(c.params),v=Pe(h==null?void 0:h.item);if(!v||v.type!=="commandExecution")return null;const T=Me(v.id),G=Me(v.command);if(!T)return null;const K=typeof v.cwd=="string"?v.cwd:null,be=Me(v.status),Re=be==="failed"?"failed":be==="declined"?"declined":be==="interrupted"?"interrupted":"completed",pe=typeof v.aggregatedOutput=="string"?v.aggregatedOutput:"",et=typeof v.exitCode=="number"?v.exitCode:null;return{id:T,role:"system",text:G,messageType:"commandExecution",commandExecution:{command:G,cwd:K,status:Re,aggregatedOutput:pe,exitCode:et}}}function tr(c,h){const v=i.value[c]??[],T=dl(v,h);T!==v&&(i.value={...i.value,[c]:T})}function Cr(c,h){const v=i.value[c];if(!v||v.length===0)return;const T=new Set(h.map(K=>K.id)),G=v.filter(K=>!T.has(K.id));G.length!==v.length&&(G.length===0?i.value=At(i.value,c):i.value={...i.value,[c]:G})}function Dn(c){if(c.method==="item/agentMessage/delta")return!0;const h=Pe(c.params);if(!h)return!1;if(c.method==="item/completed"){const v=Pe(h.item);return(v==null?void 0:v.type)==="agentMessage"}return!1}function Gr(c){var Di,Li,Bi,Fi;if(qr(c))return;if(c.method==="thread/name/updated"){const qe=Pe(c.params),an=Me(qe==null?void 0:qe.threadId),sr=Me(qe==null?void 0:qe.threadName);an&&sr&&(X.value={...X.value,[an]:sr},Ie(),$o(an,sr))}const h=br(c);h&&b(h.threadId,h.activity);const v=Kt(c);v&&(ye.set(v.turnId,v),de.value={...de.value,[v.threadId]:v.turnId},W(v.threadId,null),A(v.threadId,null),J(v.threadId,!0),d.value[v.threadId]&&(d.value=At(d.value,v.threadId)));const T=Zn(c),G=Jn(c),be=!!((T==null?void 0:T.threadId)??Ut(c))&&!!G&&f.value!==Qt&&As(new Error(G));if(T){const qe=ye.get(T.turnId);qe&&ye.delete(T.turnId);const an=pn((Di=Pe(c.params))==null?void 0:Di.durationMs)??pn((Bi=Pe((Li=Pe(c.params))==null?void 0:Li.turn))==null?void 0:Bi.durationMs)??(typeof T.startedAtMs=="number"?T.completedAtMs-T.startedAtMs:null)??(qe?T.completedAtMs-qe.startedAtMs:null),sr=typeof an=="number"?Math.max(0,an):0;W(T.threadId,{turnId:T.turnId,durationMs:sr}),de.value[T.threadId]&&(de.value=At(de.value,T.threadId)),J(T.threadId,!1),b(T.threadId,null),Ye(T.threadId),be||(we(T.threadId),$(T.threadId))}if(G){const qe=(T==null?void 0:T.threadId)||Ut(c);qe&&A(qe,G),_e.value=G,qe&&be&&ie(qe)}else T&&A(T.threadId,null);const Re=vr(c);if(Re){const qe=Ut(c);qe&&A(qe,Re),_e.value=Re,f.value!==Qt&&As(new Error(Re))&&(qe?ie(qe):Q())}const pe=Ut(c);if(!pe||pe!==n.value)return;jn(c);const et=Tr(c);if(et){const qe=(s.value[pe]??[]).find(sr=>sr.id===et.messageId),an=`${(qe==null?void 0:qe.text)??""}${et.delta}`;mt(pe,{id:et.messageId,role:"assistant",text:an,messageType:"agentMessage.live"})}const yt=Sr(c);yt&&mt(pe,yt),_r(c);const Rr=Nn(c);if(Rr&&ut(pe,Rr.delta),Kr(c)){const qe=o.value[pe]??"";qe.trim().length>0&&!qe.endsWith(`
|
|
45
|
-
|
|
46
|
-
`)&&Qe(pe,`${qe}
|
|
47
|
-
|
|
48
|
-
`)}kr(c);const Bn=xr(c);Bn&&(tr(pe,Bn),b(pe,{label:"Running command",details:[((Fi=Bn.commandExecution)==null?void 0:Fi.command)??""]}));const co=gn(c);if(co){const qe=(i.value[pe]??[]).find(an=>an.id===co.itemId);qe!=null&&qe.commandExecution&&tr(pe,{...qe,commandExecution:{...qe.commandExecution,aggregatedOutput:`${qe.commandExecution.aggregatedOutput}${co.delta}`}})}const ji=er(c);if(ji&&tr(pe,ji),Dn(c)&&(Y&&n.value&&re(n.value,{scrollTop:0,isAtBottom:!0,scrollRatio:1}),ft(pe)),c.method==="turn/completed"){Y=!1,ft(pe),i.value[pe]&&(i.value=At(i.value,pe));const qe=Ut(c);qe&&(J(qe,!1),b(qe,null),Ye(qe),be||(we(qe),$(qe)))}}function _(c){const h=Ut(c);h&&E.add(h);const v=c.method;(v.startsWith("thread/")||v.startsWith("turn/")||v.startsWith("item/"))&&(Se=!0),!(ze!==null||typeof window>"u")&&(ze=window.setTimeout(()=>{ze=null,rr()},Mo))}async function C(c){if(!Z){Z=!0;try{const h=await ni(),v=[];for(const T of h.order){const G=No(T);v.includes(G)||v.push(G)}if(v.length>0){const T=Es(v,c);fr(I.value,T)||(I.value=T,Mr(I.value))}if(Object.keys(h.labels).length>0){const T={...F.value};let G=!1;for(const[K,be]of Object.entries(h.labels)){const Re=No(K);T[Re]!==be&&(T[Re]=be,G=!0)}G&&(F.value=T,Po(T))}}catch{}}}async function R(){if(!(Object.keys(X.value).length>0))try{const c=await hy();Object.keys(c.titles).length>0&&(X.value=c.titles)}catch{}}async function q(c,h,v){if(X.value[c])return;const T=h.trim();if(!T)return;const G=T.length>300?T.slice(0,300):T;try{const K=await py(G,v);if(!K||X.value[c])return;X.value={...X.value,[c]:K},Ie(),$o(c,K)}catch{}}async function Le(){var c;vt.value||(ne.value=!0);try{const[h]=await Promise.all([Gv(),R()]);await C(h);const v=Es(I.value,h);fr(I.value,v)||(I.value=v,Mr(I.value));const T=Oo(h,I.value),G=j0(t.value,T,a.value);t.value=Is(t.value,G),a.value=Mt(a.value,new Set(Kn(t.value).map(Re=>Re.id))),Ie(),vt.value=!0;const K=Kn(e.value);Ke(K),K.some(Re=>Re.id===n.value)||ee(((c=K[0])==null?void 0:c.id)??"")}finally{ne.value=!1}}async function bt(c,h={}){if(!c)return;const v=j.value[c]===!0,T=h.silent!==!0&&!v;T&&(Fe.value=!0);try{U.value[c]!==!0&&(await Io(c),U.value={...U.value,[c]:!0});const{messages:G,inProgress:K}=await zv(c),be=r.value[c]??[],Re=x0(be,G,{preserveMissing:h.silent===!0});xe(c,Re);const pe=s.value[c]??[],et=C0(pe,G);ve(c,et),Cr(c,G),j.value={...j.value,[c]:!0};const yt=M(c);yt&&(z.value={...z.value,[c]:yt}),J(c,K),H(c)}finally{T&&(Fe.value=!1)}}async function Vt(){try{const c=t.value.flatMap(h=>h.threads.map(v=>v.cwd)).filter(Boolean);me.value=await my(c.length>0?[...new Set(c)]:void 0)}catch{}}async function vn(){_e.value="";try{await Le(),await Promise.all([Ne(),Vt()]),await bt(n.value)}catch(c){_e.value=c instanceof Error?c.message:"Unknown application error"}}async function Er(c){ee(c);try{await bt(c)}catch(h){_e.value=h instanceof Error?h.message:"Unknown application error"}}async function Yt(c){try{await Xv(c),await Le(),n.value===c&&await bt(n.value)}catch(h){_e.value=h instanceof Error?h.message:"Unknown application error"}}async function Ln(c,h){const v=h.trim();if(!(!c||!v))try{await Zv(c,v),X.value={...X.value,[c]:v},Ie(),$o(c,v)}catch(T){_e.value=T instanceof Error?T.message:"Unknown application error"}}async function nr(c,h=[],v=[],T="steer",G=[]){const K=n.value,be=c.trim();if(!K||!be&&h.length===0&&G.length===0)return;const Re=a.value[K]===!0;if(Re&&T==="queue"){const pe=l.value[K]??[],et=`q-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;l.value={...l.value,[K]:[...pe,{id:et,text:be,imageUrls:h,skills:v,fileAttachments:G}]};return}if(Re){Y=!0,Ir(K,be,h,v,G).catch(pe=>{const et=pe instanceof Error?pe.message:"Unknown application error";A(K,et),_e.value=et});return}_e.value="",Y=!0,W(K,null),b(K,{label:"Thinking",details:ke(f.value,g.value)}),A(K,null),J(K,!0);try{await Ir(K,be,h,v,G)}catch(pe){Y=!1,J(K,!1),b(K,null);const et=pe instanceof Error?pe.message:"Unknown application error";throw A(K,et),_e.value=et,pe}}async function Ar(c,h,v=[],T=[],G=[]){const K=c.trim(),be=h.trim(),Re=f.value.trim();if(!K&&v.length===0&&G.length===0)return"";He.value=!0,_e.value="";let pe="";try{try{pe=await nl(be||void 0,Re||void 0)}catch(yn){if(Re&&Re!==Qt&&As(yn))await Q(),pe=await nl(be||void 0,Qt);else throw yn}if(!pe)return"";pt(pe,be,K||"[Image]"),U.value={...U.value,[pe]:!0},ee(pe),Y=!0,W(pe,null),b(pe,{label:"Thinking",details:ke(f.value,g.value)}),A(pe,null),J(pe,!0);const et=pe,yt=be||null,Rr=K;return Ir(pe,K,v,T,G).catch(yn=>{Y=!1,J(pe,!1),b(pe,null);const Bn=yn instanceof Error?yn.message:"Unknown application error";A(pe,Bn),_e.value=Bn}).finally(()=>{He.value=!1}),q(et,Rr,yt),pe}catch(et){Y=!1,pe&&(J(pe,!1),b(pe,null));const yt=et instanceof Error?et.message:"Unknown application error";throw pe&&A(pe,yt),_e.value=yt,He.value=!1,et}}async function Ir(c,h,v=[],T=[],G=[]){const K=f.value.trim(),be=g.value,Re=h.trim(),pe=T.map(yt=>({name:yt.name,path:yt.path})),et=G.map(yt=>({...yt}));V(c,{text:Re,imageUrls:[...v],skills:pe,fileAttachments:et,effort:be,fallbackRetried:!1});try{U.value[c]!==!0&&await Io(c);try{await Ro(c,h,v,K||void 0,be||void 0,T.length>0?T:void 0,G)}catch(yt){if(K&&K!==Qt&&As(yt))await Q(),V(c,{text:Re,imageUrls:[...v],skills:pe,fileAttachments:et,effort:be,fallbackRetried:!0}),await Ro(c,h,v,Qt,be||void 0,T.length>0?T:void 0,G);else throw yt}U.value={...U.value,[c]:!0},E.add(c),Se=!0,await rr()}catch(yt){throw yt}}async function $(c){const h=l.value[c];if(!h||h.length===0)return;const[v,...T]=h;l.value=T.length>0?{...l.value,[c]:T}:At(l.value,c),He.value=!0,_e.value="",Y=!0,W(c,null),b(c,{label:"Thinking",details:ke(f.value,g.value)}),A(c,null),J(c,!0);try{await Ir(c,v.text,v.imageUrls,v.skills,v.fileAttachments)}catch{J(c,!1),b(c,null)}finally{He.value=!1}}async function te(){const c=n.value;if(!c||a.value[c]!==!0)return;const h=de.value[c];Ge.value=!0,_e.value="";try{await ny(c,h),J(c,!1),b(c,null),A(c,null),de.value[c]&&(de.value=At(de.value,c)),E.add(c),Se=!0,await rr()}catch(v){const T=v instanceof Error?v.message:"Failed to interrupt active turn";A(c,T),_e.value=T}finally{Ge.value=!1}}async function $e(c){const h=n.value;if(!h||Ae.value)return;const T=(r.value[h]??[]).reduce((K,be)=>typeof be.turnIndex=="number"&&be.turnIndex>K?be.turnIndex:K,-1);if(T<0||c>T)return;const G=T-c+1;if(!(G<1)){Ae.value=!0,_e.value="";try{const K=await tl(h,G);xe(h,K),ve(h,[]),ft(h),i.value[h]&&(i.value=At(i.value,h)),W(h,null),b(h,null),A(h,null),Se=!0,await rr()}catch(K){_e.value=K instanceof Error?K.message:"Failed to rollback thread"}finally{Ae.value=!1}}}function Tt(c,h){c.length===0||(F.value[c]??"")===h||(F.value={...F.value,[c]:h},Po(F.value))}function Rt(c){var G;if(c.length===0)return;const h=I.value.filter(K=>K!==c);if(fr(I.value,h)||(I.value=h,Mr(I.value)),t.value=t.value.filter(K=>K.projectName!==c),F.value[c]!==void 0){const K={...F.value};delete K[c],F.value=K,Po(K)}Ie();const v=Kn(e.value);Ke(v),v.some(K=>K.id===n.value)||ee(((G=v[0])==null?void 0:G.id)??""),lo()}function Ct(c,h){if(c.length===0||t.value.length===0)return;const v=t.value.map(pe=>pe.projectName),T=v.indexOf(c);if(T===-1)return;const G=Math.max(0,Math.min(h,v.length-1)),K=T0(v,T,G);if(K===v)return;const be=Es(K,t.value);I.value=be,Mr(I.value);const Re=Oo(t.value,I.value);t.value=Is(t.value,Re),Ie(),lo()}function $t(c){const h=c.trim();if(!h)return;const v=[h,...I.value.filter(G=>G!==h)];if(fr(I.value,v))return;I.value=v,Mr(I.value);const T=Oo(t.value,I.value);t.value=Is(t.value,T),Ie(),lo()}async function lo(){var c,h;try{const v=await ni(),T=new Map;for(const be of v.order){const Re=No(be);T.has(Re)||T.set(Re,be)}for(const be of t.value){const Re=((h=(c=be.threads[0])==null?void 0:c.cwd)==null?void 0:h.trim())??"";Re&&T.set(be.projectName,Re)}const G=[];for(const be of I.value){const Re=T.get(be);Re&&!G.includes(Re)&&G.push(Re)}for(const be of v.order)G.includes(be)||G.push(be);const K=v.active.filter(be=>G.includes(be));K.length===0&&G.length>0&&K.push(G[0]),await ly({order:G,labels:v.labels,active:K})}catch{}}async function ru(){if(!Oe.value){Oe.value=!0;try{if(await Le(),!n.value)return;const c=n.value,h=M(c),v=z.value[c]??"",T=h.length>0&&h!==v;(a.value[c]===!0||T)&&await bt(c,{silent:!0})}catch{}finally{Oe.value=!1}}}async function rr(){if(Oe.value){typeof window<"u"&&ze===null&&(ze=window.setTimeout(()=>{ze=null,rr()},Mo));return}Oe.value=!0;const c=Se,h=new Set(E);Se=!1,E.clear();try{c&&await Le();const v=n.value;if(!v)return;const T=h.has(v),G=a.value[v]===!0,K=M(v),be=z.value[v]??"",Re=K.length>0&&K!==be;(T||G||Re||c)&&await bt(v,{silent:!0})}catch{}finally{Oe.value=!1,(Se||E.size>0)&&typeof window<"u"&&ze===null&&(ze=window.setTimeout(()=>{ze=null,rr()},Mo))}}function su(){typeof window>"u"||tt||(Ze.value&&Oi(),ou(),tt=Yv(c=>{Gr(c),_(c)}))}async function ou(){try{const c=await Qv();for(const h of c){const v=yr(h);v&&Qn(v)}}catch{}}async function iu(c){try{await Jv(c.id,{result:c.result,error:c.error}),Xn(c.id)}catch(h){_e.value=h instanceof Error?h.message:"Failed to reply to server request"}}function Pi(c={}){const h=c.updatePreference??!0;he!==null&&typeof window<"u"&&(window.clearInterval(he),he=null),Ee!==null&&typeof window<"u"&&(window.clearInterval(Ee),Ee=null),h&&(Ze.value=!1,cl(!1)),ct.value=Math.floor(Zr/1e3)}function Oi(){typeof window>"u"||he!==null||Ee!==null||(Ze.value=!0,cl(!0),ct.value=Math.floor(Zr/1e3),he=window.setInterval(()=>{ct.value=Math.floor(Zr/1e3),ru()},Zr),Ee=window.setInterval(()=>{ct.value=Math.max(0,ct.value-1)},1e3))}function au(){if(Ze.value){Pi();return}Oi()}function lu(){Pi({updatePreference:!1}),tt&&(tt(),tt=null),Se=!1,E.clear(),ye.clear(),ze!==null&&typeof window<"u"&&(window.clearTimeout(ze),ze=null),Y=!1,r.value={},s.value={},o.value={},i.value={},ae.value={},D.value={},ue.value={},de.value={},l.value={}}const cu=ce(()=>{const c=n.value;return c?l.value[c]??[]:[]});function Ni(c){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const T=v.filter(G=>G.id!==c);l.value=T.length>0?{...l.value,[h]:T}:At(l.value,h)}function uu(c){const h=n.value;if(!h)return;const v=l.value[h];if(!v)return;const T=v.find(G=>G.id===c);T&&(Ni(c),nr(T.text,T.imageUrls,T.skills,"steer",T.fileAttachments))}return{projectGroups:e,projectDisplayNameById:F,selectedThread:y,selectedThreadScrollState:x,selectedThreadServerRequests:O,selectedLiveOverlay:B,selectedThreadId:n,availableModelIds:u,selectedModelId:f,selectedReasoningEffort:g,installedSkills:me,messages:L,isLoadingThreads:ne,isLoadingMessages:Fe,isSendingMessage:He,isInterruptingTurn:Ge,isAutoRefreshEnabled:Ze,autoRefreshSecondsLeft:ct,error:_e,refreshAll:vn,refreshSkills:Vt,selectThread:Er,setThreadScrollState:re,archiveThreadById:Yt,renameThreadById:Ln,sendMessageToSelectedThread:nr,sendMessageToNewThread:Ar,interruptSelectedThreadTurn:te,rollbackSelectedThread:$e,isRollingBack:Ae,selectedThreadQueuedMessages:cu,removeQueuedMessage:Ni,steerQueuedMessage:uu,setSelectedModelId:se,setSelectedReasoningEffort:ge,respondToPendingServerRequest:iu,renameProject:Tt,removeProject:Rt,reorderProject:Ct,pinProjectToTop:$t,toggleAutoRefreshTimer:au,startPolling:su,stopPolling:lu}}const F0={class:"sidebar-root"},H0={class:"sidebar-scrollable"},U0=["aria-pressed"],V0={key:1,class:"sidebar-search-bar"},W0={key:0,class:"sidebar-settings-area"},q0={key:0,class:"sidebar-settings-panel"},K0={class:"sidebar-settings-value"},G0={class:"sidebar-settings-value"},z0={class:"content-root"},Y0={class:"content-body"},J0={key:1,class:"content-grid"},Q0={class:"new-thread-empty"},X0={class:"worktree-init-status-title"},Z0={class:"worktree-init-status-message"},e_={key:2,class:"content-grid"},t_={class:"content-thread"},n_={class:"composer-with-queue"},r_={class:"build-badge","aria-label":"Worktree name"},fl="codex-web-local.sidebar-collapsed.v1",hl="codex-web-local.send-with-enter.v1",pl="codex-web-local.in-progress-send-mode.v1",ml="codex-web-local.dark-mode.v1",s_=Et({__name:"App",setup(e){const t="codex-web-local",{projectGroups:n,projectDisplayNameById:r,selectedThread:s,selectedThreadScrollState:o,selectedThreadServerRequests:i,selectedLiveOverlay:a,selectedThreadId:l,availableModelIds:d,selectedModelId:u,selectedReasoningEffort:f,installedSkills:g,messages:k,isLoadingThreads:N,isLoadingMessages:I,isInterruptingTurn:F,isAutoRefreshEnabled:z,autoRefreshSecondsLeft:j,refreshAll:U,refreshSkills:D,selectThread:ae,setThreadScrollState:ue,archiveThreadById:de,renameThreadById:Te,sendMessageToSelectedThread:oe,sendMessageToNewThread:X,interruptSelectedThreadTurn:me,rollbackSelectedThread:ne,isRollingBack:Fe,selectedThreadQueuedMessages:He,removeQueuedMessage:Ge,steerQueuedMessage:Ae,setSelectedModelId:_e,setSelectedReasoningEffort:Oe,respondToPendingServerRequest:vt,renameProject:Ze,removeProject:ct,reorderProject:tt,pinProjectToTop:ze,toggleAutoRefreshTimer:he,startPolling:Ee,stopPolling:Se}=B0(),E=zh(),Z=Gh(),{isMobile:Y}=Wc(),ye=P(!1),De=P(!1),p=P(""),y=P("local"),x=P({order:[],labels:{}}),O=P({phase:"idle",title:"",message:""}),B=P(Er()),L=P(""),ee=P(!1),se=P(null),Q=P(null);let V=null;const we=P("New Project (1)"),ie=P(""),ge=P(!1),ke=P(C(hl,!0)),Ne=P(q()),We=P(R()),Ie=ce(()=>{const $=E.params.threadId;return typeof $=="string"?$:""}),pt=ce(()=>{const $=new Set;for(const te of n.value)for(const $e of te.threads)$.add($e.id);return $}),Ke=ce(()=>E.name==="home"),H=ce(()=>E.name==="skills"),W=ce(()=>{var $;return H.value?"Skills":Ke.value?"New thread":(($=s.value)==null?void 0:$.title)??"Choose a thread"}),J=ce(()=>z.value?`Auto refresh in ${String(j.value)}s`:"Enable 4s refresh"),Ye=ce(()=>k.value.filter($=>{const te=Ln($.messageType,$.role);return te==="worked"?!0:!(te==="turnActivity.live"||te==="turnError.live"||te==="agentReasoning.live")})),b=ce(()=>a.value),A=ce(()=>Ke.value?"__new-thread__":l.value),M=ce(()=>{var $,te;return Ke.value?p.value.trim():((te=($=s.value)==null?void 0:$.cwd)==null?void 0:te.trim())??""}),re=ce(()=>{var $;return!Ke.value&&(($=s.value)==null?void 0:$.inProgress)===!0}),xe=ce(()=>{var Tt,Rt;const $=[],te=new Set;for(const Ct of x.value.order){const $t=Ct.trim();!$t||te.has($t)||(te.add($t),$.push({value:$t,label:x.value.labels[$t]||er($t)}))}for(const Ct of n.value){const $t=((Rt=(Tt=Ct.threads[0])==null?void 0:Tt.cwd)==null?void 0:Rt.trim())??"";!$t||te.has($t)||(te.add($t),$.push({value:$t,label:r.value[Ct.projectName]??Ct.projectName}))}const $e=p.value.trim();return $e&&!te.has($e)&&$.unshift({value:$e,label:er($e)}),$}),ve=typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)"):null;Pn(()=>{window.addEventListener("keydown",Zn),vn(),ve==null||ve.addEventListener("change",vn),nr(),Sr(),xr(),jn()}),to(()=>{window.removeEventListener("keydown",Zn),ve==null||ve.removeEventListener("change",vn),V&&(clearTimeout(V),V=null),Se()}),at(L,$=>{const te=$.trim();if(V&&(clearTimeout(V),V=null),!te){Q.value=null;return}V=setTimeout(()=>{fy(te,1e3).then($e=>{L.value.trim()===te&&(Q.value=$e.threadIds)}).catch(()=>{L.value.trim()===te&&(Q.value=null)})},220)});function mt(){D()}function Qe(){ee.value=!ee.value,ee.value?zt(()=>{var $;return($=se.value)==null?void 0:$.focus()}):L.value=""}function ut(){var $;L.value="",($=se.value)==null||$.focus()}function ft($){$.key==="Escape"&&(ee.value=!1,L.value="")}function Pe($){$&&(E.name==="thread"&&Ie.value===$||(Z.push({name:"thread",params:{threadId:$}}),Y.value&&Kt(!0)))}function Me($){de($)}function pn($){var Tt,Rt;const te=n.value.find(Ct=>Ct.projectName===$),$e=((Rt=(Tt=te==null?void 0:te.threads[0])==null?void 0:Tt.cwd)==null?void 0:Rt.trim())??"";$e&&(p.value=$e),Y.value&&Kt(!0),!Ke.value&&Z.push({name:"home"})}function Ut($){var Tt,Rt;const te=n.value.find(Ct=>Ct.projectName===$),$e=((Rt=(Tt=te==null?void 0:te.threads[0])==null?void 0:Tt.cwd)==null?void 0:Rt.trim())??"";!$e||typeof window>"u"||window.open(`/codex-local-browse${encodeURI($e)}`,"_blank","noopener,noreferrer")}function Jn(){var te,$e;const $=(($e=(te=s.value)==null?void 0:te.cwd)==null?void 0:$e.trim())??"";$&&(p.value=$),Y.value&&Kt(!0),!Ke.value&&Z.push({name:"home"})}function vr($){Ze($.projectName,$.displayName)}function yr($){Te($.threadId,$.title)}function Qn($){ct($)}function Xn($){tt($.projectName,$.toIndex)}function qr($){ue($.threadId,$.state)}function wr($){vt($)}function br(){he()}function Kt($){B.value!==$&&(B.value=$,Yt($))}function Zn($){$.defaultPrevented||!$.ctrlKey&&!$.metaKey||$.shiftKey||$.altKey||$.key.toLowerCase()==="b"&&($.preventDefault(),Kt(!B.value))}function mn($){const te=$.text;if(Ke.value){Ir(te,$.imageUrls,$.skills,$.fileAttachments);return}oe(te,$.imageUrls,$.skills,$.mode,$.fileAttachments)}function _r($){p.value=$.trim()}async function Nn($){const te=$.trim();if(!te)return;const $e=kr(te),Tt=await Kr(),Rt=$e?te:tr(Tt,te);if(Rt)try{const Ct=await cy(Rt,{createIfMissing:!$e,label:$e?"":te});Ct&&(p.value=Ct,ze(er(Ct)),xr(),jn())}catch{}}async function Kr(){const $=Tr();if($)return $;try{const te=await rl();if(te)return ie.value=te,te}catch{}return""}function kr($){return $?$.startsWith("~/")||$.startsWith("/")?!0:/^[a-zA-Z]:[\\/]/.test($):!1}async function jn(){const $=Tr();if(!$){we.value="New Project (1)";return}try{const te=await uy($);we.value=te.name||"New Project (1)"}catch{we.value="New Project (1)"}}function Tr(){var $e,Tt;const $=p.value.trim();if($)return gn($);const te=((Tt=($e=xe.value[0])==null?void 0:$e.value)==null?void 0:Tt.trim())??"";return te?gn(te):ie.value.trim()}async function Sr(){try{ie.value=await rl()}catch{ie.value=""}}async function xr(){try{const $=await ni();x.value={order:[...$.order],labels:{...$.labels}}}catch{x.value={order:[],labels:{}}}}function gn($){const te=$.trim().replace(/\/+$/,"");if(!te)return"";const $e=te.lastIndexOf("/");return $e<=0?"":te.slice(0,$e)}function er($){const te=$.trim().replace(/\/+$/,"");if(!te)return"";const $e=te.lastIndexOf("/");return $e<0?te:te.slice($e+1)}function tr($,te){const $e=$.trim().replace(/\/+$/,""),Tt=te.trim().replace(/^\/+/,"");return!$e||!Tt?"":`${$e}/${Tt}`}function Cr($){_e($)}function Dn($){Oe($)}function Gr(){me()}function _($){ne($.turnIndex)}function C($,te){if(typeof window>"u")return te;const $e=window.localStorage.getItem($);return $e===null?te:$e==="1"}function R(){if(typeof window>"u")return"system";const $=window.localStorage.getItem(ml);return $==="light"||$==="dark"?$:"system"}function q(){return typeof window>"u"?"queue":window.localStorage.getItem(pl)==="steer"?"steer":"queue"}function Le(){ke.value=!ke.value,window.localStorage.setItem(hl,ke.value?"1":"0")}function bt(){Ne.value=Ne.value==="steer"?"queue":"steer",window.localStorage.setItem(pl,Ne.value)}function Vt(){const $=["system","light","dark"],te=$.indexOf(We.value);We.value=$[(te+1)%$.length],window.localStorage.setItem(ml,We.value),vn()}function vn(){const $=document.documentElement;if(We.value==="dark")$.classList.add("dark");else if(We.value==="light")$.classList.remove("dark");else{const te=window.matchMedia("(prefers-color-scheme: dark)").matches;$.classList.toggle("dark",te)}}function Er(){return typeof window>"u"?!1:window.localStorage.getItem(fl)==="1"}function Yt($){typeof window>"u"||window.localStorage.setItem(fl,$?"1":"0")}function Ln($,te){const $e=($??"").trim();return $e.length>0?$e:te.trim()||"message"}async function nr(){await U(),De.value=!0,await Ar(),Ee()}async function Ar(){if(!ye.value){ye.value=!0;try{if(E.name==="home"||E.name==="skills"){l.value!==""&&await ae("");return}if(E.name==="thread"){const $=Ie.value;if(!$)return;if(!pt.value.has($)){await Z.replace({name:"home"});return}l.value!==$&&await ae($);return}}finally{ye.value=!1}}}at(()=>[E.name,Ie.value,N.value,pt.value.has(Ie.value),l.value],async()=>{De.value&&await Ar()}),at(()=>l.value,async $=>{if(De.value&&!ye.value&&!(Ke.value||H.value)){if(!$){E.name!=="home"&&await Z.replace({name:"home"});return}E.name==="thread"&&Ie.value===$||await Z.replace({name:"thread",params:{threadId:$}})}}),at(()=>xe.value,$=>{if($.length===0){p.value="";return}$.some($e=>$e.value===p.value)||(p.value=$[0].value),jn()},{immediate:!0}),at(()=>p.value,()=>{O.value={phase:"idle",title:"",message:""},jn()}),at(()=>y.value,$=>{$==="local"&&(O.value={phase:"idle",title:"",message:""})}),at(()=>E.name,$=>{$!=="home"&&(O.value={phase:"idle",title:"",message:""})}),at(()=>l.value,()=>{O.value={phase:"idle",title:"",message:""}}),at(Y,$=>{$&&!B.value&&Kt(!0)});async function Ir($,te=[],$e=[],Tt=[]){try{O.value={phase:"idle",title:"",message:""};let Rt=p.value;if(y.value==="worktree"){O.value={phase:"running",title:"Creating worktree",message:"Creating a worktree and running setup."};try{const $t=await ay(p.value);Rt=$t.cwd,p.value=$t.cwd,O.value={phase:"idle",title:"",message:""}}catch{O.value={phase:"error",title:"Worktree setup failed",message:"Unable to create worktree. Try again or switch to Local project."};return}}const Ct=await X($,Rt,te,$e,Tt);if(!Ct)return;await Z.replace({name:"thread",params:{threadId:Ct}})}catch{}}return($,te)=>(w(),S(Ue,null,[Ce(ep,{"is-sidebar-collapsed":B.value,onCloseSidebar:te[6]||(te[6]=$e=>Kt(!0))},{sidebar:it(()=>[m("section",F0,[m("div",H0,[B.value?le("",!0):(w(),dt(il,{key:0,class:"sidebar-thread-controls-host","is-sidebar-collapsed":B.value,"is-auto-refresh-enabled":je(z),"auto-refresh-button-label":J.value,"show-new-thread-button":!0,onToggleSidebar:te[0]||(te[0]=$e=>Kt(!B.value)),onToggleAutoRefresh:br,onStartNewThread:Jn},{default:it(()=>[m("button",{class:"sidebar-search-toggle",type:"button","aria-pressed":ee.value,"aria-label":"Search threads",title:"Search threads",onClick:Qe},[Ce(si,{class:"sidebar-search-toggle-icon"})],8,U0)]),_:1},8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])),!B.value&&ee.value?(w(),S("div",V0,[Ce(si,{class:"sidebar-search-bar-icon"}),Rn(m("input",{ref_key:"sidebarSearchInputRef",ref:se,"onUpdate:modelValue":te[1]||(te[1]=$e=>L.value=$e),class:"sidebar-search-input",type:"text",placeholder:"Filter threads...",onKeydown:ft},null,544),[[$n,L.value]]),L.value.length>0?(w(),S("button",{key:0,class:"sidebar-search-clear",type:"button","aria-label":"Clear search",onClick:ut},[Ce(Ri,{class:"sidebar-search-clear-icon"})])):le("",!0)])):le("",!0),B.value?le("",!0):(w(),S("button",{key:2,class:lt(["sidebar-skills-link",{"is-active":H.value}]),type:"button",onClick:te[2]||(te[2]=$e=>{je(Z).push({name:"skills"}),je(Y)&&Kt(!0)})}," Skills Hub ",2)),B.value?le("",!0):(w(),dt(Fm,{key:3,groups:je(n),"project-display-name-by-id":je(r),"selected-thread-id":je(l),"is-loading":je(N),"search-query":L.value,"search-matched-thread-ids":Q.value,onSelect:Pe,onArchive:Me,onStartNewThread:pn,onRenameProject:vr,onBrowseProjectFiles:Ut,onRenameThread:yr,onRemoveProject:Qn,onReorderProject:Xn},null,8,["groups","project-display-name-by-id","selected-thread-id","is-loading","search-query","search-matched-thread-ids"]))]),B.value?le("",!0):(w(),S("div",W0,[Ce($c,{name:"settings-panel"},{default:it(()=>[ge.value?(w(),S("div",q0,[m("button",{class:"sidebar-settings-row",type:"button",onClick:Le},[te[7]||(te[7]=m("span",{class:"sidebar-settings-label"},"Require ⌘ + enter to send",-1)),m("span",{class:lt(["sidebar-settings-toggle",{"is-on":!ke.value}])},null,2)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:bt},[te[8]||(te[8]=m("span",{class:"sidebar-settings-label"},"When busy, send as",-1)),m("span",K0,fe(Ne.value==="steer"?"Steer":"Queue"),1)]),m("button",{class:"sidebar-settings-row",type:"button",onClick:Vt},[te[9]||(te[9]=m("span",{class:"sidebar-settings-label"},"Appearance",-1)),m("span",G0,fe(We.value==="system"?"System":We.value==="dark"?"Dark":"Light"),1)])])):le("",!0)]),_:1}),m("button",{class:"sidebar-settings-button",type:"button",onClick:te[3]||(te[3]=$e=>ge.value=!ge.value)},[Ce(p0,{class:"sidebar-settings-icon"}),te[10]||(te[10]=m("span",null,"Settings",-1))])]))])]),content:it(()=>[m("section",z0,[Ce(Km,{title:W.value},{leading:it(()=>[B.value||je(Y)?(w(),dt(il,{key:0,class:"sidebar-thread-controls-header-host","is-sidebar-collapsed":B.value,"is-auto-refresh-enabled":je(z),"auto-refresh-button-label":J.value,"show-new-thread-button":!0,onToggleSidebar:te[4]||(te[4]=$e=>Kt(!B.value)),onToggleAutoRefresh:br,onStartNewThread:Jn},null,8,["is-sidebar-collapsed","is-auto-refresh-enabled","auto-refresh-button-label"])):le("",!0)]),_:1},8,["title"]),m("section",Y0,[H.value?(w(),dt(zb,{key:0,onSkillsChanged:mt})):Ke.value?(w(),S("div",J0,[m("div",Q0,[te[11]||(te[11]=m("p",{class:"new-thread-hero"},"Let's build",-1)),Ce(ri,{class:"new-thread-folder-dropdown","model-value":p.value,options:xe.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":we.value,"add-placeholder":"Project name or absolute path",disabled:!1,"onUpdate:modelValue":_r,onAdd:Nn},null,8,["model-value","options","default-add-value"]),Ce(Xw,{class:"new-thread-runtime-dropdown",modelValue:y.value,"onUpdate:modelValue":te[5]||(te[5]=$e=>y.value=$e)},null,8,["modelValue"]),O.value.phase!=="idle"?(w(),S("div",{key:0,class:lt(["worktree-init-status",{"is-running":O.value.phase==="running","is-error":O.value.phase==="error"}])},[m("strong",X0,fe(O.value.title),1),m("span",Z0,fe(O.value.message),1)],2)):le("",!0)]),Ce(sl,{"active-thread-id":A.value,cwd:M.value,models:je(d),"selected-model":je(u),"selected-reasoning-effort":je(f),skills:je(g),"is-turn-in-progress":!1,"is-interrupting-turn":!1,"send-with-enter":ke.value,"in-progress-submit-mode":Ne.value,onSubmit:mn,"onUpdate:selectedModel":Cr,"onUpdate:selectedReasoningEffort":Dn},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","send-with-enter","in-progress-submit-mode"])])):(w(),S("div",e_,[m("div",t_,[Ce(kv,{messages:Ye.value,"is-loading":je(I),"active-thread-id":A.value,"scroll-state":je(o),"live-overlay":b.value,"pending-requests":je(i),"is-turn-in-progress":re.value,"is-rolling-back":je(Fe),onUpdateScrollState:qr,onRespondServerRequest:wr,onRollback:_},null,8,["messages","is-loading","active-thread-id","scroll-state","live-overlay","pending-requests","is-turn-in-progress","is-rolling-back"])]),m("div",n_,[Ce(Ww,{messages:je(He),onSteer:je(Ae),onDelete:je(Ge)},null,8,["messages","onSteer","onDelete"]),Ce(sl,{"active-thread-id":A.value,cwd:M.value,models:je(d),"selected-model":je(u),"selected-reasoning-effort":je(f),skills:je(g),"is-turn-in-progress":re.value,"is-interrupting-turn":je(F),"has-queue-above":je(He).length>0,"send-with-enter":ke.value,"in-progress-submit-mode":Ne.value,onSubmit:mn,"onUpdate:selectedModel":Cr,"onUpdate:selectedReasoningEffort":Dn,onInterrupt:Gr},null,8,["active-thread-id","cwd","models","selected-model","selected-reasoning-effort","skills","is-turn-in-progress","is-interrupting-turn","has-queue-above","send-with-enter","in-progress-submit-mode"])])]))])])]),_:1},8,["is-sidebar-collapsed"]),m("div",r_," WT "+fe(je(t)),1)],64))}}),o_=Xe(s_,[["__scopeId","data-v-87bf8c64"]]),jo={render:()=>null},i_=Kh({history:Sh(),routes:[{path:"/",name:"home",component:jo},{path:"/thread/:threadId",name:"thread",component:jo},{path:"/skills",name:"skills",component:jo},{path:"/new-thread",redirect:{name:"home"}},{path:"/:pathMatch(.*)*",redirect:{name:"home"}}]});console.log("Welcome to codexapp. GitHub: https://github.com/friuns2/codexui");Df(o_).use(i_).mount("#app");
|