sensorium-mcp 3.0.70 → 3.0.72
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/config.d.ts +48 -6
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +123 -21
- package/dist/config.js.map +1 -1
- package/dist/dashboard/presets.d.ts.map +1 -1
- package/dist/dashboard/presets.js +0 -6
- package/dist/dashboard/presets.js.map +1 -1
- package/dist/dashboard/routes/claude.d.ts +12 -0
- package/dist/dashboard/routes/claude.d.ts.map +1 -0
- package/dist/dashboard/routes/claude.js +80 -0
- package/dist/dashboard/routes/claude.js.map +1 -0
- package/dist/dashboard/routes/copilot.d.ts +17 -0
- package/dist/dashboard/routes/copilot.d.ts.map +1 -0
- package/dist/dashboard/routes/copilot.js +153 -0
- package/dist/dashboard/routes/copilot.js.map +1 -0
- package/dist/dashboard/routes/threads.d.ts.map +1 -1
- package/dist/dashboard/routes/threads.js +1 -2
- package/dist/dashboard/routes/threads.js.map +1 -1
- package/dist/dashboard/routes.d.ts.map +1 -1
- package/dist/dashboard/routes.js +9 -0
- package/dist/dashboard/routes.js.map +1 -1
- package/dist/dashboard/spa.html +11 -11
- package/dist/data/memory/bootstrap.js +3 -3
- package/dist/data/memory/bootstrap.js.map +1 -1
- package/dist/data/memory/narrative.d.ts.map +1 -1
- package/dist/data/memory/narrative.js +3 -4
- package/dist/data/memory/narrative.js.map +1 -1
- package/dist/data/memory/reflection.d.ts.map +1 -1
- package/dist/data/memory/reflection.js +2 -3
- package/dist/data/memory/reflection.js.map +1 -1
- package/dist/data/memory/thread-registry.d.ts.map +1 -1
- package/dist/data/memory/thread-registry.js +7 -2
- package/dist/data/memory/thread-registry.js.map +1 -1
- package/dist/services/agent-spawn.service.d.ts +13 -27
- package/dist/services/agent-spawn.service.d.ts.map +1 -1
- package/dist/services/agent-spawn.service.js +32 -397
- package/dist/services/agent-spawn.service.js.map +1 -1
- package/dist/services/claude-spawn.service.d.ts +9 -0
- package/dist/services/claude-spawn.service.d.ts.map +1 -0
- package/dist/services/claude-spawn.service.js +113 -0
- package/dist/services/claude-spawn.service.js.map +1 -0
- package/dist/services/codex-spawn.service.d.ts +9 -0
- package/dist/services/codex-spawn.service.d.ts.map +1 -0
- package/dist/services/codex-spawn.service.js +106 -0
- package/dist/services/codex-spawn.service.js.map +1 -0
- package/dist/services/consolidation.service.d.ts.map +1 -1
- package/dist/services/consolidation.service.js +1 -2
- package/dist/services/consolidation.service.js.map +1 -1
- package/dist/services/copilot-spawn.service.d.ts +10 -0
- package/dist/services/copilot-spawn.service.d.ts.map +1 -0
- package/dist/services/copilot-spawn.service.js +89 -0
- package/dist/services/copilot-spawn.service.js.map +1 -0
- package/dist/services/process.service.d.ts +0 -1
- package/dist/services/process.service.d.ts.map +1 -1
- package/dist/services/process.service.js.map +1 -1
- package/dist/services/spawn-common.d.ts +55 -0
- package/dist/services/spawn-common.d.ts.map +1 -0
- package/dist/services/spawn-common.js +202 -0
- package/dist/services/spawn-common.js.map +1 -0
- package/dist/tools/defs/session-defs.d.ts.map +1 -1
- package/dist/tools/defs/session-defs.js +2 -5
- package/dist/tools/defs/session-defs.js.map +1 -1
- package/dist/tools/delegate-tool.d.ts.map +1 -1
- package/dist/tools/delegate-tool.js +2 -16
- package/dist/tools/delegate-tool.js.map +1 -1
- package/dist/tools/memory-tools.d.ts.map +1 -1
- package/dist/tools/memory-tools.js +4 -5
- package/dist/tools/memory-tools.js.map +1 -1
- package/dist/tools/wait/message-delivery.js +5 -5
- package/dist/tools/wait/message-delivery.js.map +1 -1
- package/package.json +1 -1
- package/templates/plan-mode.default.md +2 -2
package/dist/dashboard/spa.html
CHANGED
|
@@ -45,31 +45,31 @@
|
|
|
45
45
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
46
46
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet">
|
|
47
47
|
|
|
48
|
-
<script type="module" crossorigin>(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const
|
|
48
|
+
<script type="module" crossorigin>(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const l of r)if(l.type==="childList")for(const a of l.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function s(r){const l={};return r.integrity&&(l.integrity=r.integrity),r.referrerPolicy&&(l.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?l.credentials="include":r.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function n(r){if(r.ep)return;r.ep=!0;const l=s(r);fetch(r.href,l)}})();/**
|
|
49
49
|
* @vue/shared v3.5.31
|
|
50
50
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
51
51
|
* @license MIT
|
|
52
|
-
**/function
|
|
52
|
+
**/function cn(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const ge={},Dt=[],nt=()=>{},po=()=>!1,Es=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ps=e=>e.startsWith("onUpdate:"),Pe=Object.assign,un=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},yr=Object.prototype.hasOwnProperty,ue=(e,t)=>yr.call(e,t),ee=Array.isArray,Rt=e=>us(e)==="[object Map]",Ft=e=>us(e)==="[object Set]",In=e=>us(e)==="[object Date]",oe=e=>typeof e=="function",Se=e=>typeof e=="string",rt=e=>typeof e=="symbol",pe=e=>e!==null&&typeof e=="object",mo=e=>(pe(e)||oe(e))&&oe(e.then)&&oe(e.catch),xo=Object.prototype.toString,us=e=>xo.call(e),br=e=>us(e).slice(8,-1),vo=e=>us(e)==="[object Object]",dn=e=>Se(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Zt=cn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),As=e=>{const t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},_r=/-\w/g,Re=As(e=>e.replace(_r,t=>t.slice(1).toUpperCase())),wr=/\B([A-Z])/g,St=As(e=>e.replace(wr,"-$1").toLowerCase()),Is=As(e=>e.charAt(0).toUpperCase()+e.slice(1)),Vs=As(e=>e?`on${Is(e)}`:""),st=(e,t)=>!Object.is(e,t),hs=(e,...t)=>{for(let s=0;s<e.length;s++)e[s](...t)},ho=(e,t,s,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},Ms=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Mn;const Os=()=>Mn||(Mn=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ut(e){if(ee(e)){const t={};for(let s=0;s<e.length;s++){const n=e[s],r=Se(n)?Cr(n):Ut(n);if(r)for(const l in r)t[l]=r[l]}return t}else if(Se(e)||pe(e))return e}const kr=/;(?![^(]*\))/g,Sr=/:([^]+)/,$r=/\/\*[^]*?\*\//g;function Cr(e){const t={};return e.replace($r,"").split(kr).forEach(s=>{if(s){const n=s.split(Sr);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function q(e){let t="";if(Se(e))t=e;else if(ee(e))for(let s=0;s<e.length;s++){const n=q(e[s]);n&&(t+=n+" ")}else if(pe(e))for(const s in e)e[s]&&(t+=s+" ");return t.trim()}const Tr="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Er=cn(Tr);function go(e){return!!e||e===""}function Pr(e,t){if(e.length!==t.length)return!1;let s=!0;for(let n=0;s&&n<e.length;n++)s=Ht(e[n],t[n]);return s}function Ht(e,t){if(e===t)return!0;let s=In(e),n=In(t);if(s||n)return s&&n?e.getTime()===t.getTime():!1;if(s=rt(e),n=rt(t),s||n)return e===t;if(s=ee(e),n=ee(t),s||n)return s&&n?Pr(e,t):!1;if(s=pe(e),n=pe(t),s||n){if(!s||!n)return!1;const r=Object.keys(e).length,l=Object.keys(t).length;if(r!==l)return!1;for(const a in e){const u=e.hasOwnProperty(a),d=t.hasOwnProperty(a);if(u&&!d||!u&&d||!Ht(e[a],t[a]))return!1}}return String(e)===String(t)}function fn(e,t){return e.findIndex(s=>Ht(s,t))}const yo=e=>!!(e&&e.__v_isRef===!0),b=e=>Se(e)?e:e==null?"":ee(e)||pe(e)&&(e.toString===xo||!oe(e.toString))?yo(e)?b(e.value):JSON.stringify(e,bo,2):String(e),bo=(e,t)=>yo(t)?bo(e,t.value):Rt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,r],l)=>(s[Bs(n,l)+" =>"]=r,s),{})}:Ft(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>Bs(s))}:rt(t)?Bs(t):pe(t)&&!ee(t)&&!vo(t)?String(t):t,Bs=(e,t="")=>{var s;return rt(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};/**
|
|
53
53
|
* @vue/reactivity v3.5.31
|
|
54
54
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
55
55
|
* @license MIT
|
|
56
|
-
**/let Le;class Ir{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=Le,!t&&Le&&(this.index=(Le.scopes||(Le.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].pause();for(t=0,s=this.effects.length;t<s;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].resume();for(t=0,s=this.effects.length;t<s;t++)this.effects[t].resume()}}run(t){if(this._active){const s=Le;try{return Le=this,t()}finally{Le=s}}}on(){++this._on===1&&(this.prevScope=Le,Le=this)}off(){this._on>0&&--this._on===0&&(Le=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s<n;s++)this.effects[s].stop();for(this.effects.length=0,s=0,n=this.cleanups.length;s<n;s++)this.cleanups[s]();if(this.cleanups.length=0,this.scopes){for(s=0,n=this.scopes.length;s<n;s++)this.scopes[s].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function Pr(){return Le}let ge;const Bs=new WeakSet;class _o{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,Le&&Le.active&&Le.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Bs.has(this)&&(Bs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ko(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Mn(this),So(this);const t=ge,s=He;ge=this,He=!0;try{return this.fn()}finally{$o(this),ge=t,He=s,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)mn(t);this.deps=this.depsTail=void 0,Mn(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Bs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ys(this)&&this.run()}get dirty(){return Ys(this)}}let wo=0,Qt,Xt;function ko(e,t=!1){if(e.flags|=8,t){e.next=Xt,Xt=e;return}e.next=Qt,Qt=e}function fn(){wo++}function pn(){if(--wo>0)return;if(Xt){let t=Xt;for(Xt=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;Qt;){let t=Qt;for(Qt=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function So(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function $o(e){let t,s=e.depsTail,n=s;for(;n;){const o=n.prevDep;n.version===-1?(n===s&&(s=o),mn(n),Mr(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=o}e.deps=t,e.depsTail=s}function Ys(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Co(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Co(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===os)||(e.globalVersion=os,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ys(e))))return;e.flags|=2;const t=e.dep,s=ge,n=He;ge=e,He=!0;try{So(e);const o=e.fn(e._value);(t.version===0||st(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{ge=s,He=n,$o(e),e.flags&=-3}}function mn(e,t=!1){const{dep:s,prevSub:n,nextSub:o}=e;if(n&&(n.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let l=s.computed.deps;l;l=l.nextDep)mn(l,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function Mr(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let He=!0;const To=[];function xt(){To.push(He),He=!1}function gt(){const e=To.pop();He=e===void 0?!0:e}function Mn(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=ge;ge=void 0;try{t()}finally{ge=s}}}let os=0;class Or{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class hn{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(!ge||!He||ge===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==ge)s=this.activeLink=new Or(ge,this),ge.deps?(s.prevDep=ge.depsTail,ge.depsTail.nextDep=s,ge.depsTail=s):ge.deps=ge.depsTail=s,Ao(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=ge.depsTail,s.nextDep=void 0,ge.depsTail.nextDep=s,ge.depsTail=s,ge.deps===s&&(ge.deps=n)}return s}trigger(t){this.version++,os++,this.notify(t)}notify(t){fn();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{pn()}}}function Ao(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)Ao(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const Zs=new WeakMap,At=Symbol(""),Qs=Symbol(""),rs=Symbol("");function Ie(e,t,s){if(He&&ge){let n=Zs.get(e);n||Zs.set(e,n=new Map);let o=n.get(s);o||(n.set(s,o=new hn),o.map=n,o.key=s),o.track()}}function pt(e,t,s,n,o,l){const a=Zs.get(e);if(!a){os++;return}const c=u=>{u&&u.trigger()};if(fn(),t==="clear")a.forEach(c);else{const u=Q(e),h=u&&un(s);if(u&&s==="length"){const d=Number(n);a.forEach((m,b)=>{(b==="length"||b===rs||!rt(b)&&b>=d)&&c(m)})}else switch((s!==void 0||a.has(void 0))&&c(a.get(s)),h&&c(a.get(rs)),t){case"add":u?h&&c(a.get("length")):(c(a.get(At)),Rt(e)&&c(a.get(Qs)));break;case"delete":u||(c(a.get(At)),Rt(e)&&c(a.get(Qs)));break;case"set":Rt(e)&&c(a.get(At));break}}pn()}function Mt(e){const t=ae(e);return t===e?t:(Ie(t,"iterate",rs),Be(e)?t:t.map(Ke))}function Ds(e){return Ie(e=ae(e),"iterate",rs),e}function Xe(e,t){return vt(e)?Ut(Et(e)?Ke(t):t):Ke(t)}const Dr={__proto__:null,[Symbol.iterator](){return Hs(this,Symbol.iterator,e=>Xe(this,e))},concat(...e){return Mt(this).concat(...e.map(t=>Q(t)?Mt(t):t))},entries(){return Hs(this,"entries",e=>(e[1]=Xe(this,e[1]),e))},every(e,t){return ut(this,"every",e,t,void 0,arguments)},filter(e,t){return ut(this,"filter",e,t,s=>s.map(n=>Xe(this,n)),arguments)},find(e,t){return ut(this,"find",e,t,s=>Xe(this,s),arguments)},findIndex(e,t){return ut(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return ut(this,"findLast",e,t,s=>Xe(this,s),arguments)},findLastIndex(e,t){return ut(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return ut(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ks(this,"includes",e)},indexOf(...e){return Ks(this,"indexOf",e)},join(e){return Mt(this).join(e)},lastIndexOf(...e){return Ks(this,"lastIndexOf",e)},map(e,t){return ut(this,"map",e,t,void 0,arguments)},pop(){return zt(this,"pop")},push(...e){return zt(this,"push",e)},reduce(e,...t){return On(this,"reduce",e,t)},reduceRight(e,...t){return On(this,"reduceRight",e,t)},shift(){return zt(this,"shift")},some(e,t){return ut(this,"some",e,t,void 0,arguments)},splice(...e){return zt(this,"splice",e)},toReversed(){return Mt(this).toReversed()},toSorted(e){return Mt(this).toSorted(e)},toSpliced(...e){return Mt(this).toSpliced(...e)},unshift(...e){return zt(this,"unshift",e)},values(){return Hs(this,"values",e=>Xe(this,e))}};function Hs(e,t,s){const n=Ds(e),o=n[t]();return n!==e&&!Be(e)&&(o._next=o.next,o.next=()=>{const l=o._next();return l.done||(l.value=s(l.value)),l}),o}const Rr=Array.prototype;function ut(e,t,s,n,o,l){const a=Ds(e),c=a!==e&&!Be(e),u=a[t];if(u!==Rr[t]){const m=u.apply(e,l);return c?Ke(m):m}let h=s;a!==e&&(c?h=function(m,b){return s.call(this,Xe(e,m),b,e)}:s.length>2&&(h=function(m,b){return s.call(this,m,b,e)}));const d=u.call(a,h,n);return c&&o?o(d):d}function On(e,t,s,n){const o=Ds(e),l=o!==e&&!Be(e);let a=s,c=!1;o!==e&&(l?(c=n.length===0,a=function(h,d,m){return c&&(c=!1,h=Xe(e,h)),s.call(this,h,Xe(e,d),m,e)}):s.length>3&&(a=function(h,d,m){return s.call(this,h,d,m,e)}));const u=o[t](a,...n);return c?Xe(e,u):u}function Ks(e,t,s){const n=ae(e);Ie(n,"iterate",rs);const o=n[t](...s);return(o===-1||o===!1)&&yn(s[0])?(s[0]=ae(s[0]),n[t](...s)):o}function zt(e,t,s=[]){xt(),fn();const n=ae(e)[t].apply(e,s);return pn(),gt(),n}const jr=an("__proto__,__v_isRef,__isVue"),Eo=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(rt));function Nr(e){rt(e)||(e=String(e));const t=ae(this);return Ie(t,"has",e),t.hasOwnProperty(e)}class Io{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){if(s==="__v_skip")return t.__v_skip;const o=this._isReadonly,l=this._isShallow;if(s==="__v_isReactive")return!o;if(s==="__v_isReadonly")return o;if(s==="__v_isShallow")return l;if(s==="__v_raw")return n===(o?l?Jr:Do:l?Oo:Mo).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const a=Q(t);if(!o){let u;if(a&&(u=Dr[s]))return u;if(s==="hasOwnProperty")return Nr}const c=Reflect.get(t,s,Me(t)?t:n);if((rt(s)?Eo.has(s):jr(s))||(o||Ie(t,"get",s),l))return c;if(Me(c)){const u=a&&un(s)?c:c.value;return o&&fe(u)?en(u):u}return fe(c)?o?en(c):gn(c):c}}class Po extends Io{constructor(t=!1){super(!1,t)}set(t,s,n,o){let l=t[s];const a=Q(t)&&un(s);if(!this._isShallow){const h=vt(l);if(!Be(n)&&!vt(n)&&(l=ae(l),n=ae(n)),!a&&Me(l)&&!Me(n))return h||(l.value=n),!0}const c=a?Number(s)<t.length:ce(t,s),u=Reflect.set(t,s,n,Me(t)?t:o);return t===ae(o)&&(c?st(n,l)&&pt(t,"set",s,n):pt(t,"add",s,n)),u}deleteProperty(t,s){const n=ce(t,s);t[s];const o=Reflect.deleteProperty(t,s);return o&&n&&pt(t,"delete",s,void 0),o}has(t,s){const n=Reflect.has(t,s);return(!rt(s)||!Eo.has(s))&&Ie(t,"has",s),n}ownKeys(t){return Ie(t,"iterate",Q(t)?"length":At),Reflect.ownKeys(t)}}class Lr extends Io{constructor(t=!1){super(!0,t)}set(t,s){return!0}deleteProperty(t,s){return!0}}const Ur=new Po,Vr=new Lr,Fr=new Po(!0);const Xs=e=>e,ps=e=>Reflect.getPrototypeOf(e);function Br(e,t,s){return function(...n){const o=this.__v_raw,l=ae(o),a=Rt(l),c=e==="entries"||e===Symbol.iterator&&a,u=e==="keys"&&a,h=o[e](...n),d=s?Xs:t?Ut:Ke;return!t&&Ie(l,"iterate",u?Qs:At),Ee(Object.create(h),{next(){const{value:m,done:b}=h.next();return b?{value:m,done:b}:{value:c?[d(m[0]),d(m[1])]:d(m),done:b}}})}}function ms(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Hr(e,t){const s={get(o){const l=this.__v_raw,a=ae(l),c=ae(o);e||(st(o,c)&&Ie(a,"get",o),Ie(a,"get",c));const{has:u}=ps(a),h=t?Xs:e?Ut:Ke;if(u.call(a,o))return h(l.get(o));if(u.call(a,c))return h(l.get(c));l!==a&&l.get(o)},get size(){const o=this.__v_raw;return!e&&Ie(ae(o),"iterate",At),o.size},has(o){const l=this.__v_raw,a=ae(l),c=ae(o);return e||(st(o,c)&&Ie(a,"has",o),Ie(a,"has",c)),o===c?l.has(o):l.has(o)||l.has(c)},forEach(o,l){const a=this,c=a.__v_raw,u=ae(c),h=t?Xs:e?Ut:Ke;return!e&&Ie(u,"iterate",At),c.forEach((d,m)=>o.call(l,h(d),h(m),a))}};return Ee(s,e?{add:ms("add"),set:ms("set"),delete:ms("delete"),clear:ms("clear")}:{add(o){const l=ae(this),a=ps(l),c=ae(o),u=!t&&!Be(o)&&!vt(o)?c:o;return a.has.call(l,u)||st(o,u)&&a.has.call(l,o)||st(c,u)&&a.has.call(l,c)||(l.add(u),pt(l,"add",u,u)),this},set(o,l){!t&&!Be(l)&&!vt(l)&&(l=ae(l));const a=ae(this),{has:c,get:u}=ps(a);let h=c.call(a,o);h||(o=ae(o),h=c.call(a,o));const d=u.call(a,o);return a.set(o,l),h?st(l,d)&&pt(a,"set",o,l):pt(a,"add",o,l),this},delete(o){const l=ae(this),{has:a,get:c}=ps(l);let u=a.call(l,o);u||(o=ae(o),u=a.call(l,o)),c&&c.call(l,o);const h=l.delete(o);return u&&pt(l,"delete",o,void 0),h},clear(){const o=ae(this),l=o.size!==0,a=o.clear();return l&&pt(o,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(o=>{s[o]=Br(o,e,t)}),s}function xn(e,t){const s=Hr(e,t);return(n,o,l)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_raw"?n:Reflect.get(ce(s,o)&&o in n?s:n,o,l)}const Kr={get:xn(!1,!1)},Wr={get:xn(!1,!0)},zr={get:xn(!0,!1)};const Mo=new WeakMap,Oo=new WeakMap,Do=new WeakMap,Jr=new WeakMap;function qr(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Gr(e){return e.__v_skip||!Object.isExtensible(e)?0:qr(br(e))}function gn(e){return vt(e)?e:vn(e,!1,Ur,Kr,Mo)}function Yr(e){return vn(e,!1,Fr,Wr,Oo)}function en(e){return vn(e,!0,Vr,zr,Do)}function vn(e,t,s,n,o){if(!fe(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const l=Gr(e);if(l===0)return e;const a=o.get(e);if(a)return a;const c=new Proxy(e,l===2?n:s);return o.set(e,c),c}function Et(e){return vt(e)?Et(e.__v_raw):!!(e&&e.__v_isReactive)}function vt(e){return!!(e&&e.__v_isReadonly)}function Be(e){return!!(e&&e.__v_isShallow)}function yn(e){return e?!!e.__v_raw:!1}function ae(e){const t=e&&e.__v_raw;return t?ae(t):e}function Zr(e){return!ce(e,"__v_skip")&&Object.isExtensible(e)&&go(e,"__v_skip",!0),e}const Ke=e=>fe(e)?gn(e):e,Ut=e=>fe(e)?en(e):e;function Me(e){return e?e.__v_isRef===!0:!1}function $(e){return Qr(e,!1)}function Qr(e,t){return Me(e)?e:new Xr(e,t)}class Xr{constructor(t,s){this.dep=new hn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:ae(t),this._value=s?t:Ke(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,n=this.__v_isShallow||Be(t)||vt(t);t=n?t:ae(t),st(t,s)&&(this._rawValue=t,this._value=n?t:Ke(t),this.dep.trigger())}}function el(e){return Me(e)?e.value:e}const tl={get:(e,t,s)=>t==="__v_raw"?e:el(Reflect.get(e,t,s)),set:(e,t,s,n)=>{const o=e[t];return Me(o)&&!Me(s)?(o.value=s,!0):Reflect.set(e,t,s,n)}};function Ro(e){return Et(e)?e:new Proxy(e,tl)}class sl{constructor(t,s,n){this.fn=t,this.setter=s,this._value=void 0,this.dep=new hn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=os-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&ge!==this)return ko(this,!0),!0}get value(){const t=this.dep.track();return Co(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function nl(e,t,s=!1){let n,o;return te(e)?n=e:(n=e.get,o=e.set),new sl(n,o,s)}const hs={},ws=new WeakMap;let Tt;function ol(e,t=!1,s=Tt){if(s){let n=ws.get(s);n||ws.set(s,n=[]),n.push(e)}}function rl(e,t,s=he){const{immediate:n,deep:o,once:l,scheduler:a,augmentJob:c,call:u}=s,h=P=>o?P:Be(P)||o===!1||o===0?mt(P,1):mt(P);let d,m,b,A,H=!1,C=!1;if(Me(e)?(m=()=>e.value,H=Be(e)):Et(e)?(m=()=>h(e),H=!0):Q(e)?(C=!0,H=e.some(P=>Et(P)||Be(P)),m=()=>e.map(P=>{if(Me(P))return P.value;if(Et(P))return h(P);if(te(P))return u?u(P,2):P()})):te(e)?t?m=u?()=>u(e,2):e:m=()=>{if(b){xt();try{b()}finally{gt()}}const P=Tt;Tt=d;try{return u?u(e,3,[A]):e(A)}finally{Tt=P}}:m=nt,t&&o){const P=m,Z=o===!0?1/0:o;m=()=>mt(P(),Z)}const w=Pr(),k=()=>{d.stop(),w&&w.active&&cn(w.effects,d)};if(l&&t){const P=t;t=(...Z)=>{P(...Z),k()}}let S=C?new Array(e.length).fill(hs):hs;const O=P=>{if(!(!(d.flags&1)||!d.dirty&&!P))if(t){const Z=d.run();if(o||H||(C?Z.some((X,K)=>st(X,S[K])):st(Z,S))){b&&b();const X=Tt;Tt=d;try{const K=[Z,S===hs?void 0:C&&S[0]===hs?[]:S,A];S=Z,u?u(t,3,K):t(...K)}finally{Tt=X}}}else d.run()};return c&&c(O),d=new _o(m),d.scheduler=a?()=>a(O,!1):O,A=P=>ol(P,!1,d),b=d.onStop=()=>{const P=ws.get(d);if(P){if(u)u(P,4);else for(const Z of P)Z();ws.delete(d)}},t?n?O(!0):S=d.run():a?a(O.bind(null,!0),!0):d.run(),k.pause=d.pause.bind(d),k.resume=d.resume.bind(d),k.stop=k,k}function mt(e,t=1/0,s){if(t<=0||!fe(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,Me(e))mt(e.value,t,s);else if(Q(e))for(let n=0;n<e.length;n++)mt(e[n],t,s);else if(Ht(e)||Rt(e))e.forEach(n=>{mt(n,t,s)});else if(xo(e)){for(const n in e)mt(e[n],t,s);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&mt(e[n],t,s)}return e}/**
|
|
56
|
+
**/let Le;class Ar{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=Le,!t&&Le&&(this.index=(Le.scopes||(Le.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].pause();for(t=0,s=this.effects.length;t<s;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,s;if(this.scopes)for(t=0,s=this.scopes.length;t<s;t++)this.scopes[t].resume();for(t=0,s=this.effects.length;t<s;t++)this.effects[t].resume()}}run(t){if(this._active){const s=Le;try{return Le=this,t()}finally{Le=s}}}on(){++this._on===1&&(this.prevScope=Le,Le=this)}off(){this._on>0&&--this._on===0&&(Le=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s<n;s++)this.effects[s].stop();for(this.effects.length=0,s=0,n=this.cleanups.length;s<n;s++)this.cleanups[s]();if(this.cleanups.length=0,this.scopes){for(s=0,n=this.scopes.length;s<n;s++)this.scopes[s].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function Ir(){return Le}let be;const Fs=new WeakSet;class _o{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,Le&&Le.active&&Le.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Fs.has(this)&&(Fs.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ko(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,On(this),So(this);const t=be,s=We;be=this,We=!0;try{return this.fn()}finally{$o(this),be=t,We=s,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)xn(t);this.deps=this.depsTail=void 0,On(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Fs.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Ys(this)&&this.run()}get dirty(){return Ys(this)}}let wo=0,Qt,Xt;function ko(e,t=!1){if(e.flags|=8,t){e.next=Xt,Xt=e;return}e.next=Qt,Qt=e}function pn(){wo++}function mn(){if(--wo>0)return;if(Xt){let t=Xt;for(Xt=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;Qt;){let t=Qt;for(Qt=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function So(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function $o(e){let t,s=e.depsTail,n=s;for(;n;){const r=n.prevDep;n.version===-1?(n===s&&(s=r),xn(n),Mr(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=r}e.deps=t,e.depsTail=s}function Ys(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Co(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Co(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===os)||(e.globalVersion=os,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Ys(e))))return;e.flags|=2;const t=e.dep,s=be,n=We;be=e,We=!0;try{So(e);const r=e.fn(e._value);(t.version===0||st(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{be=s,We=n,$o(e),e.flags&=-3}}function xn(e,t=!1){const{dep:s,prevSub:n,nextSub:r}=e;if(n&&(n.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let l=s.computed.deps;l;l=l.nextDep)xn(l,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function Mr(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let We=!0;const To=[];function xt(){To.push(We),We=!1}function vt(){const e=To.pop();We=e===void 0?!0:e}function On(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=be;be=void 0;try{t()}finally{be=s}}}let os=0;class Or{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class vn{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(!be||!We||be===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==be)s=this.activeLink=new Or(be,this),be.deps?(s.prevDep=be.depsTail,be.depsTail.nextDep=s,be.depsTail=s):be.deps=be.depsTail=s,Eo(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=be.depsTail,s.nextDep=void 0,be.depsTail.nextDep=s,be.depsTail=s,be.deps===s&&(be.deps=n)}return s}trigger(t){this.version++,os++,this.notify(t)}notify(t){pn();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{mn()}}}function Eo(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)Eo(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const Zs=new WeakMap,Et=Symbol(""),Qs=Symbol(""),rs=Symbol("");function Ae(e,t,s){if(We&&be){let n=Zs.get(e);n||Zs.set(e,n=new Map);let r=n.get(s);r||(n.set(s,r=new vn),r.map=n,r.key=s),r.track()}}function ft(e,t,s,n,r,l){const a=Zs.get(e);if(!a){os++;return}const u=d=>{d&&d.trigger()};if(pn(),t==="clear")a.forEach(u);else{const d=ee(e),x=d&&dn(s);if(d&&s==="length"){const f=Number(n);a.forEach((m,v)=>{(v==="length"||v===rs||!rt(v)&&v>=f)&&u(m)})}else switch((s!==void 0||a.has(void 0))&&u(a.get(s)),x&&u(a.get(rs)),t){case"add":d?x&&u(a.get("length")):(u(a.get(Et)),Rt(e)&&u(a.get(Qs)));break;case"delete":d||(u(a.get(Et)),Rt(e)&&u(a.get(Qs)));break;case"set":Rt(e)&&u(a.get(Et));break}}mn()}function Mt(e){const t=ce(e);return t===e?t:(Ae(t,"iterate",rs),Fe(e)?t:t.map(ze))}function Ds(e){return Ae(e=ce(e),"iterate",rs),e}function et(e,t){return ht(e)?Nt(Pt(e)?ze(t):t):ze(t)}const Dr={__proto__:null,[Symbol.iterator](){return Hs(this,Symbol.iterator,e=>et(this,e))},concat(...e){return Mt(this).concat(...e.map(t=>ee(t)?Mt(t):t))},entries(){return Hs(this,"entries",e=>(e[1]=et(this,e[1]),e))},every(e,t){return it(this,"every",e,t,void 0,arguments)},filter(e,t){return it(this,"filter",e,t,s=>s.map(n=>et(this,n)),arguments)},find(e,t){return it(this,"find",e,t,s=>et(this,s),arguments)},findIndex(e,t){return it(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return it(this,"findLast",e,t,s=>et(this,s),arguments)},findLastIndex(e,t){return it(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return it(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ks(this,"includes",e)},indexOf(...e){return Ks(this,"indexOf",e)},join(e){return Mt(this).join(e)},lastIndexOf(...e){return Ks(this,"lastIndexOf",e)},map(e,t){return it(this,"map",e,t,void 0,arguments)},pop(){return zt(this,"pop")},push(...e){return zt(this,"push",e)},reduce(e,...t){return Dn(this,"reduce",e,t)},reduceRight(e,...t){return Dn(this,"reduceRight",e,t)},shift(){return zt(this,"shift")},some(e,t){return it(this,"some",e,t,void 0,arguments)},splice(...e){return zt(this,"splice",e)},toReversed(){return Mt(this).toReversed()},toSorted(e){return Mt(this).toSorted(e)},toSpliced(...e){return Mt(this).toSpliced(...e)},unshift(...e){return zt(this,"unshift",e)},values(){return Hs(this,"values",e=>et(this,e))}};function Hs(e,t,s){const n=Ds(e),r=n[t]();return n!==e&&!Fe(e)&&(r._next=r.next,r.next=()=>{const l=r._next();return l.done||(l.value=s(l.value)),l}),r}const Rr=Array.prototype;function it(e,t,s,n,r,l){const a=Ds(e),u=a!==e&&!Fe(e),d=a[t];if(d!==Rr[t]){const m=d.apply(e,l);return u?ze(m):m}let x=s;a!==e&&(u?x=function(m,v){return s.call(this,et(e,m),v,e)}:s.length>2&&(x=function(m,v){return s.call(this,m,v,e)}));const f=d.call(a,x,n);return u&&r?r(f):f}function Dn(e,t,s,n){const r=Ds(e),l=r!==e&&!Fe(e);let a=s,u=!1;r!==e&&(l?(u=n.length===0,a=function(x,f,m){return u&&(u=!1,x=et(e,x)),s.call(this,x,et(e,f),m,e)}):s.length>3&&(a=function(x,f,m){return s.call(this,x,f,m,e)}));const d=r[t](a,...n);return u?et(e,d):d}function Ks(e,t,s){const n=ce(e);Ae(n,"iterate",rs);const r=n[t](...s);return(r===-1||r===!1)&&bn(s[0])?(s[0]=ce(s[0]),n[t](...s)):r}function zt(e,t,s=[]){xt(),pn();const n=ce(e)[t].apply(e,s);return mn(),vt(),n}const jr=cn("__proto__,__v_isRef,__isVue"),Po=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(rt));function Lr(e){rt(e)||(e=String(e));const t=ce(this);return Ae(t,"has",e),t.hasOwnProperty(e)}class Ao{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){if(s==="__v_skip")return t.__v_skip;const r=this._isReadonly,l=this._isShallow;if(s==="__v_isReactive")return!r;if(s==="__v_isReadonly")return r;if(s==="__v_isShallow")return l;if(s==="__v_raw")return n===(r?l?Jr:Do:l?Oo:Mo).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const a=ee(t);if(!r){let d;if(a&&(d=Dr[s]))return d;if(s==="hasOwnProperty")return Lr}const u=Reflect.get(t,s,Me(t)?t:n);if((rt(s)?Po.has(s):jr(s))||(r||Ae(t,"get",s),l))return u;if(Me(u)){const d=a&&dn(s)?u:u.value;return r&&pe(d)?en(d):d}return pe(u)?r?en(u):gn(u):u}}class Io extends Ao{constructor(t=!1){super(!1,t)}set(t,s,n,r){let l=t[s];const a=ee(t)&&dn(s);if(!this._isShallow){const x=ht(l);if(!Fe(n)&&!ht(n)&&(l=ce(l),n=ce(n)),!a&&Me(l)&&!Me(n))return x||(l.value=n),!0}const u=a?Number(s)<t.length:ue(t,s),d=Reflect.set(t,s,n,Me(t)?t:r);return t===ce(r)&&(u?st(n,l)&&ft(t,"set",s,n):ft(t,"add",s,n)),d}deleteProperty(t,s){const n=ue(t,s);t[s];const r=Reflect.deleteProperty(t,s);return r&&n&&ft(t,"delete",s,void 0),r}has(t,s){const n=Reflect.has(t,s);return(!rt(s)||!Po.has(s))&&Ae(t,"has",s),n}ownKeys(t){return Ae(t,"iterate",ee(t)?"length":Et),Reflect.ownKeys(t)}}class Ur extends Ao{constructor(t=!1){super(!0,t)}set(t,s){return!0}deleteProperty(t,s){return!0}}const Nr=new Io,Vr=new Ur,Br=new Io(!0);const Xs=e=>e,ps=e=>Reflect.getPrototypeOf(e);function Fr(e,t,s){return function(...n){const r=this.__v_raw,l=ce(r),a=Rt(l),u=e==="entries"||e===Symbol.iterator&&a,d=e==="keys"&&a,x=r[e](...n),f=s?Xs:t?Nt:ze;return!t&&Ae(l,"iterate",d?Qs:Et),Pe(Object.create(x),{next(){const{value:m,done:v}=x.next();return v?{value:m,done:v}:{value:u?[f(m[0]),f(m[1])]:f(m),done:v}}})}}function ms(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Hr(e,t){const s={get(r){const l=this.__v_raw,a=ce(l),u=ce(r);e||(st(r,u)&&Ae(a,"get",r),Ae(a,"get",u));const{has:d}=ps(a),x=t?Xs:e?Nt:ze;if(d.call(a,r))return x(l.get(r));if(d.call(a,u))return x(l.get(u));l!==a&&l.get(r)},get size(){const r=this.__v_raw;return!e&&Ae(ce(r),"iterate",Et),r.size},has(r){const l=this.__v_raw,a=ce(l),u=ce(r);return e||(st(r,u)&&Ae(a,"has",r),Ae(a,"has",u)),r===u?l.has(r):l.has(r)||l.has(u)},forEach(r,l){const a=this,u=a.__v_raw,d=ce(u),x=t?Xs:e?Nt:ze;return!e&&Ae(d,"iterate",Et),u.forEach((f,m)=>r.call(l,x(f),x(m),a))}};return Pe(s,e?{add:ms("add"),set:ms("set"),delete:ms("delete"),clear:ms("clear")}:{add(r){const l=ce(this),a=ps(l),u=ce(r),d=!t&&!Fe(r)&&!ht(r)?u:r;return a.has.call(l,d)||st(r,d)&&a.has.call(l,r)||st(u,d)&&a.has.call(l,u)||(l.add(d),ft(l,"add",d,d)),this},set(r,l){!t&&!Fe(l)&&!ht(l)&&(l=ce(l));const a=ce(this),{has:u,get:d}=ps(a);let x=u.call(a,r);x||(r=ce(r),x=u.call(a,r));const f=d.call(a,r);return a.set(r,l),x?st(l,f)&&ft(a,"set",r,l):ft(a,"add",r,l),this},delete(r){const l=ce(this),{has:a,get:u}=ps(l);let d=a.call(l,r);d||(r=ce(r),d=a.call(l,r)),u&&u.call(l,r);const x=l.delete(r);return d&&ft(l,"delete",r,void 0),x},clear(){const r=ce(this),l=r.size!==0,a=r.clear();return l&&ft(r,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(r=>{s[r]=Fr(r,e,t)}),s}function hn(e,t){const s=Hr(e,t);return(n,r,l)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?n:Reflect.get(ue(s,r)&&r in n?s:n,r,l)}const Kr={get:hn(!1,!1)},Wr={get:hn(!1,!0)},zr={get:hn(!0,!1)};const Mo=new WeakMap,Oo=new WeakMap,Do=new WeakMap,Jr=new WeakMap;function qr(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Gr(e){return e.__v_skip||!Object.isExtensible(e)?0:qr(br(e))}function gn(e){return ht(e)?e:yn(e,!1,Nr,Kr,Mo)}function Yr(e){return yn(e,!1,Br,Wr,Oo)}function en(e){return yn(e,!0,Vr,zr,Do)}function yn(e,t,s,n,r){if(!pe(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const l=Gr(e);if(l===0)return e;const a=r.get(e);if(a)return a;const u=new Proxy(e,l===2?n:s);return r.set(e,u),u}function Pt(e){return ht(e)?Pt(e.__v_raw):!!(e&&e.__v_isReactive)}function ht(e){return!!(e&&e.__v_isReadonly)}function Fe(e){return!!(e&&e.__v_isShallow)}function bn(e){return e?!!e.__v_raw:!1}function ce(e){const t=e&&e.__v_raw;return t?ce(t):e}function Zr(e){return!ue(e,"__v_skip")&&Object.isExtensible(e)&&ho(e,"__v_skip",!0),e}const ze=e=>pe(e)?gn(e):e,Nt=e=>pe(e)?en(e):e;function Me(e){return e?e.__v_isRef===!0:!1}function w(e){return Qr(e,!1)}function Qr(e,t){return Me(e)?e:new Xr(e,t)}class Xr{constructor(t,s){this.dep=new vn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:ce(t),this._value=s?t:ze(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,n=this.__v_isShallow||Fe(t)||ht(t);t=n?t:ce(t),st(t,s)&&(this._rawValue=t,this._value=n?t:ze(t),this.dep.trigger())}}function el(e){return Me(e)?e.value:e}const tl={get:(e,t,s)=>t==="__v_raw"?e:el(Reflect.get(e,t,s)),set:(e,t,s,n)=>{const r=e[t];return Me(r)&&!Me(s)?(r.value=s,!0):Reflect.set(e,t,s,n)}};function Ro(e){return Pt(e)?e:new Proxy(e,tl)}class sl{constructor(t,s,n){this.fn=t,this.setter=s,this._value=void 0,this.dep=new vn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=os-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&be!==this)return ko(this,!0),!0}get value(){const t=this.dep.track();return Co(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function nl(e,t,s=!1){let n,r;return oe(e)?n=e:(n=e.get,r=e.set),new sl(n,r,s)}const xs={},ws=new WeakMap;let Tt;function ol(e,t=!1,s=Tt){if(s){let n=ws.get(s);n||ws.set(s,n=[]),n.push(e)}}function rl(e,t,s=ge){const{immediate:n,deep:r,once:l,scheduler:a,augmentJob:u,call:d}=s,x=I=>r?I:Fe(I)||r===!1||r===0?pt(I,1):pt(I);let f,m,v,k,F=!1,$=!1;if(Me(e)?(m=()=>e.value,F=Fe(e)):Pt(e)?(m=()=>x(e),F=!0):ee(e)?($=!0,F=e.some(I=>Pt(I)||Fe(I)),m=()=>e.map(I=>{if(Me(I))return I.value;if(Pt(I))return x(I);if(oe(I))return d?d(I,2):I()})):oe(e)?t?m=d?()=>d(e,2):e:m=()=>{if(v){xt();try{v()}finally{vt()}}const I=Tt;Tt=f;try{return d?d(e,3,[k]):e(k)}finally{Tt=I}}:m=nt,t&&r){const I=m,U=r===!0?1/0:r;m=()=>pt(I(),U)}const N=Ir(),C=()=>{f.stop(),N&&N.active&&un(N.effects,f)};if(l&&t){const I=t;t=(...U)=>{I(...U),C()}}let E=$?new Array(e.length).fill(xs):xs;const R=I=>{if(!(!(f.flags&1)||!f.dirty&&!I))if(t){const U=f.run();if(r||F||($?U.some((y,S)=>st(y,E[S])):st(U,E))){v&&v();const y=Tt;Tt=f;try{const S=[U,E===xs?void 0:$&&E[0]===xs?[]:E,k];E=U,d?d(t,3,S):t(...S)}finally{Tt=y}}}else f.run()};return u&&u(R),f=new _o(m),f.scheduler=a?()=>a(R,!1):R,k=I=>ol(I,!1,f),v=f.onStop=()=>{const I=ws.get(f);if(I){if(d)d(I,4);else for(const U of I)U();ws.delete(f)}},t?n?R(!0):E=f.run():a?a(R.bind(null,!0),!0):f.run(),C.pause=f.pause.bind(f),C.resume=f.resume.bind(f),C.stop=C,C}function pt(e,t=1/0,s){if(t<=0||!pe(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,Me(e))pt(e.value,t,s);else if(ee(e))for(let n=0;n<e.length;n++)pt(e[n],t,s);else if(Ft(e)||Rt(e))e.forEach(n=>{pt(n,t,s)});else if(vo(e)){for(const n in e)pt(e[n],t,s);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&pt(e[n],t,s)}return e}/**
|
|
57
57
|
* @vue/runtime-core v3.5.31
|
|
58
58
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
59
59
|
* @license MIT
|
|
60
|
-
**/function ds(e,t,s,n){try{return n?e(...n):e()}catch(o){Rs(o,t,s)}}function lt(e,t,s,n){if(te(e)){const o=ds(e,t,s,n);return o&&mo(o)&&o.catch(l=>{Rs(l,t,s)}),o}if(Q(e)){const o=[];for(let l=0;l<e.length;l++)o.push(lt(e[l],t,s,n));return o}}function Rs(e,t,s,n=!0){const o=t?t.vnode:null,{errorHandler:l,throwUnhandledErrorInProduction:a}=t&&t.appContext.config||he;if(t){let c=t.parent;const u=t.proxy,h=`https://vuejs.org/error-reference/#runtime-${s}`;for(;c;){const d=c.ec;if(d){for(let m=0;m<d.length;m++)if(d[m](e,u,h)===!1)return}c=c.parent}if(l){xt(),ds(l,null,10,[e,u,h]),gt();return}}ll(e,s,o,n,a)}function ll(e,t,s,n=!0,o=!1){if(o)throw e;console.error(e)}const De=[];let Ze=-1;const jt=[];let _t=null,Ot=0;const jo=Promise.resolve();let ks=null;function No(e){const t=ks||jo;return e?t.then(this?e.bind(this):e):t}function il(e){let t=Ze+1,s=De.length;for(;t<s;){const n=t+s>>>1,o=De[n],l=ls(o);l<e||l===e&&o.flags&2?t=n+1:s=n}return t}function bn(e){if(!(e.flags&1)){const t=ls(e),s=De[De.length-1];!s||!(e.flags&2)&&t>=ls(s)?De.push(e):De.splice(il(t),0,e),e.flags|=1,Lo()}}function Lo(){ks||(ks=jo.then(Vo))}function al(e){Q(e)?jt.push(...e):_t&&e.id===-1?_t.splice(Ot+1,0,e):e.flags&1||(jt.push(e),e.flags|=1),Lo()}function Dn(e,t,s=Ze+1){for(;s<De.length;s++){const n=De[s];if(n&&n.flags&2){if(e&&n.id!==e.uid)continue;De.splice(s,1),s--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function Uo(e){if(jt.length){const t=[...new Set(jt)].sort((s,n)=>ls(s)-ls(n));if(jt.length=0,_t){_t.push(...t);return}for(_t=t,Ot=0;Ot<_t.length;Ot++){const s=_t[Ot];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}_t=null,Ot=0}}const ls=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Vo(e){try{for(Ze=0;Ze<De.length;Ze++){const t=De[Ze];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),ds(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Ze<De.length;Ze++){const t=De[Ze];t&&(t.flags&=-2)}Ze=-1,De.length=0,Uo(),ks=null,(De.length||jt.length)&&Vo()}}let Ve=null,Fo=null;function Ss(e){const t=Ve;return Ve=e,Fo=e&&e.type.__scopeId||null,t}function cl(e,t=Ve,s){if(!t||e._n)return e;const n=(...o)=>{n._d&&zn(-1);const l=Ss(t);let a;try{a=e(...o)}finally{Ss(l),n._d&&zn(1)}return a};return n._n=!0,n._c=!0,n._d=!0,n}function se(e,t){if(Ve===null)return e;const s=Us(Ve),n=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[l,a,c,u=he]=t[o];l&&(te(l)&&(l={mounted:l,updated:l}),l.deep&&mt(a),n.push({dir:l,instance:s,value:a,oldValue:void 0,arg:c,modifiers:u}))}return e}function $t(e,t,s,n){const o=e.dirs,l=t&&t.dirs;for(let a=0;a<o.length;a++){const c=o[a];l&&(c.oldValue=l[a].value);let u=c.dir[n];u&&(xt(),lt(u,s,8,[e.el,c,e,t]),gt())}}function ul(e,t){if(Pe){let s=Pe.provides;const n=Pe.parent&&Pe.parent.provides;n===s&&(s=Pe.provides=Object.create(n)),s[e]=t}}function vs(e,t,s=!1){const n=ui();if(n||Nt){let o=Nt?Nt._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return s&&te(t)?t.call(n&&n.proxy):t}}const dl=Symbol.for("v-scx"),fl=()=>vs(dl);function Ws(e,t,s){return Bo(e,t,s)}function Bo(e,t,s=he){const{immediate:n,deep:o,flush:l,once:a}=s,c=Ee({},s),u=t&&n||!t&&l!=="post";let h;if(as){if(l==="sync"){const A=fl();h=A.__watcherHandles||(A.__watcherHandles=[])}else if(!u){const A=()=>{};return A.stop=nt,A.resume=nt,A.pause=nt,A}}const d=Pe;c.call=(A,H,C)=>lt(A,d,H,C);let m=!1;l==="post"?c.scheduler=A=>{Ne(A,d&&d.suspense)}:l!=="sync"&&(m=!0,c.scheduler=(A,H)=>{H?A():bn(A)}),c.augmentJob=A=>{t&&(A.flags|=4),m&&(A.flags|=2,d&&(A.id=d.uid,A.i=d))};const b=rl(e,t,c);return as&&(h?h.push(b):u&&b()),b}function pl(e,t,s){const n=this.proxy,o=$e(e)?e.includes(".")?Ho(n,e):()=>n[e]:e.bind(n,n);let l;te(t)?l=t:(l=t.handler,s=t);const a=fs(this),c=Bo(o,l.bind(n),s);return a(),c}function Ho(e,t){const s=t.split(".");return()=>{let n=e;for(let o=0;o<s.length&&n;o++)n=n[s[o]];return n}}const ml=Symbol("_vte"),hl=e=>e.__isTeleport,xl=Symbol("_leaveCb");function _n(e,t){e.shapeFlag&6&&e.component?(e.transition=t,_n(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 it(e,t){return te(e)?Ee({name:e.name},t,{setup:e}):e}function Ko(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function Rn(e,t){let s;return!!((s=Object.getOwnPropertyDescriptor(e,t))&&!s.configurable)}const $s=new WeakMap;function es(e,t,s,n,o=!1){if(Q(e)){e.forEach((C,w)=>es(C,t&&(Q(t)?t[w]:t),s,n,o));return}if(ts(n)&&!o){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&es(e,t,s,n.component.subTree);return}const l=n.shapeFlag&4?Us(n.component):n.el,a=o?null:l,{i:c,r:u}=e,h=t&&t.r,d=c.refs===he?c.refs={}:c.refs,m=c.setupState,b=ae(m),A=m===he?po:C=>Rn(d,C)?!1:ce(b,C),H=(C,w)=>!(w&&Rn(d,w));if(h!=null&&h!==u){if(jn(t),$e(h))d[h]=null,A(h)&&(m[h]=null);else if(Me(h)){const C=t;H(h,C.k)&&(h.value=null),C.k&&(d[C.k]=null)}}if(te(u))ds(u,c,12,[a,d]);else{const C=$e(u),w=Me(u);if(C||w){const k=()=>{if(e.f){const S=C?A(u)?m[u]:d[u]:H()||!e.k?u.value:d[e.k];if(o)Q(S)&&cn(S,l);else if(Q(S))S.includes(l)||S.push(l);else if(C)d[u]=[l],A(u)&&(m[u]=d[u]);else{const O=[l];H(u,e.k)&&(u.value=O),e.k&&(d[e.k]=O)}}else C?(d[u]=a,A(u)&&(m[u]=a)):w&&(H(u,e.k)&&(u.value=a),e.k&&(d[e.k]=a))};if(a){const S=()=>{k(),$s.delete(e)};S.id=-1,$s.set(e,S),Ne(S,s)}else jn(e),k()}}}function jn(e){const t=$s.get(e);t&&(t.flags|=8,$s.delete(e))}Os().requestIdleCallback;Os().cancelIdleCallback;const ts=e=>!!e.type.__asyncLoader,Wo=e=>e.type.__isKeepAlive;function gl(e,t){zo(e,"a",t)}function vl(e,t){zo(e,"da",t)}function zo(e,t,s=Pe){const n=e.__wdc||(e.__wdc=()=>{let o=s;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(js(t,n,s),s){let o=s.parent;for(;o&&o.parent;)Wo(o.parent.vnode)&&yl(n,t,s,o),o=o.parent}}function yl(e,t,s,n){const o=js(t,e,n,!0);wn(()=>{cn(n[t],o)},s)}function js(e,t,s=Pe,n=!1){if(s){const o=s[e]||(s[e]=[]),l=t.__weh||(t.__weh=(...a)=>{xt();const c=fs(s),u=lt(t,s,e,a);return c(),gt(),u});return n?o.unshift(l):o.push(l),l}}const yt=e=>(t,s=Pe)=>{(!as||e==="sp")&&js(e,(...n)=>t(...n),s)},bl=yt("bm"),We=yt("m"),_l=yt("bu"),wl=yt("u"),kl=yt("bum"),wn=yt("um"),Sl=yt("sp"),$l=yt("rtg"),Cl=yt("rtc");function Tl(e,t=Pe){js("ec",e,t)}const Al="components",Jo=Symbol.for("v-ndc");function El(e){return $e(e)?Il(Al,e,!1)||e:e||Jo}function Il(e,t,s=!0,n=!1){const o=Ve||Pe;if(o){const l=o.type;{const c=hi(l,!1);if(c&&(c===t||c===je(t)||c===Ps(je(t))))return l}const a=Nn(o[e]||l[e],t)||Nn(o.appContext[e],t);return!a&&n?l:a}}function Nn(e,t){return e&&(e[t]||e[je(t)]||e[Ps(je(t))])}function ve(e,t,s,n){let o;const l=s,a=Q(e);if(a||$e(e)){const c=a&&Et(e);let u=!1,h=!1;c&&(u=!Be(e),h=vt(e),e=Ds(e)),o=new Array(e.length);for(let d=0,m=e.length;d<m;d++)o[d]=t(u?h?Ut(Ke(e[d])):Ke(e[d]):e[d],d,void 0,l)}else if(typeof e=="number"){o=new Array(e);for(let c=0;c<e;c++)o[c]=t(c+1,c,void 0,l)}else if(fe(e))if(e[Symbol.iterator])o=Array.from(e,(c,u)=>t(c,u,void 0,l));else{const c=Object.keys(e);o=new Array(c.length);for(let u=0,h=c.length;u<h;u++){const d=c[u];o[u]=t(e[d],d,u,l)}}else o=[];return o}const tn=e=>e?hr(e)?Us(e):tn(e.parent):null,ss=Ee(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=>tn(e.parent),$root:e=>tn(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Go(e),$forceUpdate:e=>e.f||(e.f=()=>{bn(e.update)}),$nextTick:e=>e.n||(e.n=No.bind(e.proxy)),$watch:e=>pl.bind(e)}),zs=(e,t)=>e!==he&&!e.__isScriptSetup&&ce(e,t),Pl={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:o,props:l,accessCache:a,type:c,appContext:u}=e;if(t[0]!=="$"){const b=a[t];if(b!==void 0)switch(b){case 1:return n[t];case 2:return o[t];case 4:return s[t];case 3:return l[t]}else{if(zs(n,t))return a[t]=1,n[t];if(o!==he&&ce(o,t))return a[t]=2,o[t];if(ce(l,t))return a[t]=3,l[t];if(s!==he&&ce(s,t))return a[t]=4,s[t];sn&&(a[t]=0)}}const h=ss[t];let d,m;if(h)return t==="$attrs"&&Ie(e.attrs,"get",""),h(e);if((d=c.__cssModules)&&(d=d[t]))return d;if(s!==he&&ce(s,t))return a[t]=4,s[t];if(m=u.config.globalProperties,ce(m,t))return m[t]},set({_:e},t,s){const{data:n,setupState:o,ctx:l}=e;return zs(o,t)?(o[t]=s,!0):n!==he&&ce(n,t)?(n[t]=s,!0):ce(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(l[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:n,appContext:o,props:l,type:a}},c){let u;return!!(s[c]||e!==he&&c[0]!=="$"&&ce(e,c)||zs(t,c)||ce(l,c)||ce(n,c)||ce(ss,c)||ce(o.config.globalProperties,c)||(u=a.__cssModules)&&u[c])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:ce(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function Ln(e){return Q(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let sn=!0;function Ml(e){const t=Go(e),s=e.proxy,n=e.ctx;sn=!1,t.beforeCreate&&Un(t.beforeCreate,e,"bc");const{data:o,computed:l,methods:a,watch:c,provide:u,inject:h,created:d,beforeMount:m,mounted:b,beforeUpdate:A,updated:H,activated:C,deactivated:w,beforeDestroy:k,beforeUnmount:S,destroyed:O,unmounted:P,render:Z,renderTracked:X,renderTriggered:K,errorCaptured:R,serverPrefetch:z,expose:ue,inheritAttrs:F,components:L,directives:J,filters:oe}=t;if(h&&Ol(h,n,null),a)for(const pe in a){const le=a[pe];te(le)&&(n[pe]=le.bind(s))}if(o){const pe=o.call(s,s);fe(pe)&&(e.data=gn(pe))}if(sn=!0,l)for(const pe in l){const le=l[pe],B=te(le)?le.bind(s,s):te(le.get)?le.get.bind(s,s):nt,D=!te(le)&&te(le.set)?le.set.bind(s):nt,Ce=Re({get:B,set:D});Object.defineProperty(n,pe,{enumerable:!0,configurable:!0,get:()=>Ce.value,set:ke=>Ce.value=ke})}if(c)for(const pe in c)qo(c[pe],n,s,pe);if(u){const pe=te(u)?u.call(s):u;Reflect.ownKeys(pe).forEach(le=>{ul(le,pe[le])})}d&&Un(d,e,"c");function Se(pe,le){Q(le)?le.forEach(B=>pe(B.bind(s))):le&&pe(le.bind(s))}if(Se(bl,m),Se(We,b),Se(_l,A),Se(wl,H),Se(gl,C),Se(vl,w),Se(Tl,R),Se(Cl,X),Se($l,K),Se(kl,S),Se(wn,P),Se(Sl,z),Q(ue))if(ue.length){const pe=e.exposed||(e.exposed={});ue.forEach(le=>{Object.defineProperty(pe,le,{get:()=>s[le],set:B=>s[le]=B,enumerable:!0})})}else e.exposed||(e.exposed={});Z&&e.render===nt&&(e.render=Z),F!=null&&(e.inheritAttrs=F),L&&(e.components=L),J&&(e.directives=J),z&&Ko(e)}function Ol(e,t,s=nt){Q(e)&&(e=nn(e));for(const n in e){const o=e[n];let l;fe(o)?"default"in o?l=vs(o.from||n,o.default,!0):l=vs(o.from||n):l=vs(o),Me(l)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>l.value,set:a=>l.value=a}):t[n]=l}}function Un(e,t,s){lt(Q(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function qo(e,t,s,n){let o=n.includes(".")?Ho(s,n):()=>s[n];if($e(e)){const l=t[e];te(l)&&Ws(o,l)}else if(te(e))Ws(o,e.bind(s));else if(fe(e))if(Q(e))e.forEach(l=>qo(l,t,s,n));else{const l=te(e.handler)?e.handler.bind(s):t[e.handler];te(l)&&Ws(o,l,e)}}function Go(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:o,optionsCache:l,config:{optionMergeStrategies:a}}=e.appContext,c=l.get(t);let u;return c?u=c:!o.length&&!s&&!n?u=t:(u={},o.length&&o.forEach(h=>Cs(u,h,a,!0)),Cs(u,t,a)),fe(t)&&l.set(t,u),u}function Cs(e,t,s,n=!1){const{mixins:o,extends:l}=t;l&&Cs(e,l,s,!0),o&&o.forEach(a=>Cs(e,a,s,!0));for(const a in t)if(!(n&&a==="expose")){const c=Dl[a]||s&&s[a];e[a]=c?c(e[a],t[a]):t[a]}return e}const Dl={data:Vn,props:Fn,emits:Fn,methods:Yt,computed:Yt,beforeCreate:Oe,created:Oe,beforeMount:Oe,mounted:Oe,beforeUpdate:Oe,updated:Oe,beforeDestroy:Oe,beforeUnmount:Oe,destroyed:Oe,unmounted:Oe,activated:Oe,deactivated:Oe,errorCaptured:Oe,serverPrefetch:Oe,components:Yt,directives:Yt,watch:jl,provide:Vn,inject:Rl};function Vn(e,t){return t?e?function(){return Ee(te(e)?e.call(this,this):e,te(t)?t.call(this,this):t)}:t:e}function Rl(e,t){return Yt(nn(e),nn(t))}function nn(e){if(Q(e)){const t={};for(let s=0;s<e.length;s++)t[e[s]]=e[s];return t}return e}function Oe(e,t){return e?[...new Set([].concat(e,t))]:t}function Yt(e,t){return e?Ee(Object.create(null),e,t):t}function Fn(e,t){return e?Q(e)&&Q(t)?[...new Set([...e,...t])]:Ee(Object.create(null),Ln(e),Ln(t??{})):t}function jl(e,t){if(!e)return t;if(!t)return e;const s=Ee(Object.create(null),e);for(const n in t)s[n]=Oe(e[n],t[n]);return s}function Yo(){return{app:null,config:{isNativeTag:po,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 Nl=0;function Ll(e,t){return function(n,o=null){te(n)||(n=Ee({},n)),o!=null&&!fe(o)&&(o=null);const l=Yo(),a=new WeakSet,c=[];let u=!1;const h=l.app={_uid:Nl++,_component:n,_props:o,_container:null,_context:l,_instance:null,version:gi,get config(){return l.config},set config(d){},use(d,...m){return a.has(d)||(d&&te(d.install)?(a.add(d),d.install(h,...m)):te(d)&&(a.add(d),d(h,...m))),h},mixin(d){return l.mixins.includes(d)||l.mixins.push(d),h},component(d,m){return m?(l.components[d]=m,h):l.components[d]},directive(d,m){return m?(l.directives[d]=m,h):l.directives[d]},mount(d,m,b){if(!u){const A=h._ceVNode||ot(n,o);return A.appContext=l,b===!0?b="svg":b===!1&&(b=void 0),e(A,d,b),u=!0,h._container=d,d.__vue_app__=h,Us(A.component)}},onUnmount(d){c.push(d)},unmount(){u&&(lt(c,h._instance,16),e(null,h._container),delete h._container.__vue_app__)},provide(d,m){return l.provides[d]=m,h},runWithContext(d){const m=Nt;Nt=h;try{return d()}finally{Nt=m}}};return h}}let Nt=null;const Ul=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${je(t)}Modifiers`]||e[`${St(t)}Modifiers`];function Vl(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||he;let o=s;const l=t.startsWith("update:"),a=l&&Ul(n,t.slice(7));a&&(a.trim&&(o=s.map(d=>$e(d)?d.trim():d)),a.number&&(o=s.map(Ms)));let c,u=n[c=Vs(t)]||n[c=Vs(je(t))];!u&&l&&(u=n[c=Vs(St(t))]),u&<(u,e,6,o);const h=n[c+"Once"];if(h){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,lt(h,e,6,o)}}const Fl=new WeakMap;function Zo(e,t,s=!1){const n=s?Fl:t.emitsCache,o=n.get(e);if(o!==void 0)return o;const l=e.emits;let a={},c=!1;if(!te(e)){const u=h=>{const d=Zo(h,t,!0);d&&(c=!0,Ee(a,d))};!s&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!l&&!c?(fe(e)&&n.set(e,null),null):(Q(l)?l.forEach(u=>a[u]=null):Ee(a,l),fe(e)&&n.set(e,a),a)}function Ns(e,t){return!e||!As(t)?!1:(t=t.slice(2).replace(/Once$/,""),ce(e,t[0].toLowerCase()+t.slice(1))||ce(e,St(t))||ce(e,t))}function Bn(e){const{type:t,vnode:s,proxy:n,withProxy:o,propsOptions:[l],slots:a,attrs:c,emit:u,render:h,renderCache:d,props:m,data:b,setupState:A,ctx:H,inheritAttrs:C}=e,w=Ss(e);let k,S;try{if(s.shapeFlag&4){const P=o||n,Z=P;k=tt(h.call(Z,P,d,m,A,b,H)),S=c}else{const P=t;k=tt(P.length>1?P(m,{attrs:c,slots:a,emit:u}):P(m,null)),S=t.props?c:Bl(c)}}catch(P){ns.length=0,Rs(P,e,1),k=ot(kt)}let O=k;if(S&&C!==!1){const P=Object.keys(S),{shapeFlag:Z}=O;P.length&&Z&7&&(l&&P.some(Es)&&(S=Hl(S,l)),O=Vt(O,S,!1,!0))}return s.dirs&&(O=Vt(O,null,!1,!0),O.dirs=O.dirs?O.dirs.concat(s.dirs):s.dirs),s.transition&&_n(O,s.transition),k=O,Ss(w),k}const Bl=e=>{let t;for(const s in e)(s==="class"||s==="style"||As(s))&&((t||(t={}))[s]=e[s]);return t},Hl=(e,t)=>{const s={};for(const n in e)(!Es(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function Kl(e,t,s){const{props:n,children:o,component:l}=e,{props:a,children:c,patchFlag:u}=t,h=l.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&u>=0){if(u&1024)return!0;if(u&16)return n?Hn(n,a,h):!!a;if(u&8){const d=t.dynamicProps;for(let m=0;m<d.length;m++){const b=d[m];if(Qo(a,n,b)&&!Ns(h,b))return!0}}}else return(o||c)&&(!c||!c.$stable)?!0:n===a?!1:n?a?Hn(n,a,h):!0:!!a;return!1}function Hn(e,t,s){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let o=0;o<n.length;o++){const l=n[o];if(Qo(t,e,l)&&!Ns(s,l))return!0}return!1}function Qo(e,t,s){const n=e[s],o=t[s];return s==="style"&&fe(n)&&fe(o)?!Kt(n,o):n!==o}function Wl({vnode:e,parent:t,suspense:s},n){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=n,e=o),o===e)(e=t.vnode).el=n,t=t.parent;else break}s&&s.activeBranch===e&&(s.vnode.el=n)}const Xo={},er=()=>Object.create(Xo),tr=e=>Object.getPrototypeOf(e)===Xo;function zl(e,t,s,n=!1){const o={},l=er();e.propsDefaults=Object.create(null),sr(e,t,o,l);for(const a in e.propsOptions[0])a in o||(o[a]=void 0);s?e.props=n?o:Yr(o):e.type.props?e.props=o:e.props=l,e.attrs=l}function Jl(e,t,s,n){const{props:o,attrs:l,vnode:{patchFlag:a}}=e,c=ae(o),[u]=e.propsOptions;let h=!1;if((n||a>0)&&!(a&16)){if(a&8){const d=e.vnode.dynamicProps;for(let m=0;m<d.length;m++){let b=d[m];if(Ns(e.emitsOptions,b))continue;const A=t[b];if(u)if(ce(l,b))A!==l[b]&&(l[b]=A,h=!0);else{const H=je(b);o[H]=on(u,c,H,A,e,!1)}else A!==l[b]&&(l[b]=A,h=!0)}}}else{sr(e,t,o,l)&&(h=!0);let d;for(const m in c)(!t||!ce(t,m)&&((d=St(m))===m||!ce(t,d)))&&(u?s&&(s[m]!==void 0||s[d]!==void 0)&&(o[m]=on(u,c,m,void 0,e,!0)):delete o[m]);if(l!==c)for(const m in l)(!t||!ce(t,m))&&(delete l[m],h=!0)}h&&pt(e.attrs,"set","")}function sr(e,t,s,n){const[o,l]=e.propsOptions;let a=!1,c;if(t)for(let u in t){if(Zt(u))continue;const h=t[u];let d;o&&ce(o,d=je(u))?!l||!l.includes(d)?s[d]=h:(c||(c={}))[d]=h:Ns(e.emitsOptions,u)||(!(u in n)||h!==n[u])&&(n[u]=h,a=!0)}if(l){const u=ae(s),h=c||he;for(let d=0;d<l.length;d++){const m=l[d];s[m]=on(o,u,m,h[m],e,!ce(h,m))}}return a}function on(e,t,s,n,o,l){const a=e[s];if(a!=null){const c=ce(a,"default");if(c&&n===void 0){const u=a.default;if(a.type!==Function&&!a.skipFactory&&te(u)){const{propsDefaults:h}=o;if(s in h)n=h[s];else{const d=fs(o);n=h[s]=u.call(null,t),d()}}else n=u;o.ce&&o.ce._setProp(s,n)}a[0]&&(l&&!c?n=!1:a[1]&&(n===""||n===St(s))&&(n=!0))}return n}const ql=new WeakMap;function nr(e,t,s=!1){const n=s?ql:t.propsCache,o=n.get(e);if(o)return o;const l=e.props,a={},c=[];let u=!1;if(!te(e)){const d=m=>{u=!0;const[b,A]=nr(m,t,!0);Ee(a,b),A&&c.push(...A)};!s&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!l&&!u)return fe(e)&&n.set(e,Dt),Dt;if(Q(l))for(let d=0;d<l.length;d++){const m=je(l[d]);Kn(m)&&(a[m]=he)}else if(l)for(const d in l){const m=je(d);if(Kn(m)){const b=l[d],A=a[m]=Q(b)||te(b)?{type:b}:Ee({},b),H=A.type;let C=!1,w=!0;if(Q(H))for(let k=0;k<H.length;++k){const S=H[k],O=te(S)&&S.name;if(O==="Boolean"){C=!0;break}else O==="String"&&(w=!1)}else C=te(H)&&H.name==="Boolean";A[0]=C,A[1]=w,(C||ce(A,"default"))&&c.push(m)}}const h=[a,c];return fe(e)&&n.set(e,h),h}function Kn(e){return e[0]!=="$"&&!Zt(e)}const kn=e=>e==="_"||e==="_ctx"||e==="$stable",Sn=e=>Q(e)?e.map(tt):[tt(e)],Gl=(e,t,s)=>{if(t._n)return t;const n=cl((...o)=>Sn(t(...o)),s);return n._c=!1,n},or=(e,t,s)=>{const n=e._ctx;for(const o in e){if(kn(o))continue;const l=e[o];if(te(l))t[o]=Gl(o,l,n);else if(l!=null){const a=Sn(l);t[o]=()=>a}}},rr=(e,t)=>{const s=Sn(t);e.slots.default=()=>s},lr=(e,t,s)=>{for(const n in t)(s||!kn(n))&&(e[n]=t[n])},Yl=(e,t,s)=>{const n=e.slots=er();if(e.vnode.shapeFlag&32){const o=t._;o?(lr(n,t,s),s&&go(n,"_",o,!0)):or(t,n)}else t&&rr(e,t)},Zl=(e,t,s)=>{const{vnode:n,slots:o}=e;let l=!0,a=he;if(n.shapeFlag&32){const c=t._;c?s&&c===1?l=!1:lr(o,t,s):(l=!t.$stable,or(t,o)),a=t}else t&&(rr(e,t),a={default:1});if(l)for(const c in o)!kn(c)&&a[c]==null&&delete o[c]},Ne=si;function Ql(e){return Xl(e)}function Xl(e,t){const s=Os();s.__VUE__=!0;const{insert:n,remove:o,patchProp:l,createElement:a,createText:c,createComment:u,setText:h,setElementText:d,parentNode:m,nextSibling:b,setScopeId:A=nt,insertStaticContent:H}=e,C=(i,p,y,f=null,T=null,E=null,M=void 0,U=null,j=!!p.dynamicChildren)=>{if(i===p)return;i&&!Jt(i,p)&&(f=Pt(i),ke(i,T,E,!0),i=null),p.patchFlag===-2&&(j=!1,p.dynamicChildren=null);const{type:I,ref:Y,shapeFlag:V}=p;switch(I){case Ls:w(i,p,y,f);break;case kt:k(i,p,y,f);break;case ys:i==null&&S(p,y,f,M);break;case ne:L(i,p,y,f,T,E,M,U,j);break;default:V&1?Z(i,p,y,f,T,E,M,U,j):V&6?J(i,p,y,f,T,E,M,U,j):(V&64||V&128)&&I.process(i,p,y,f,T,E,M,U,j,N)}Y!=null&&T?es(Y,i&&i.ref,E,p||i,!p):Y==null&&i&&i.ref!=null&&es(i.ref,null,E,i,!0)},w=(i,p,y,f)=>{if(i==null)n(p.el=c(p.children),y,f);else{const T=p.el=i.el;p.children!==i.children&&h(T,p.children)}},k=(i,p,y,f)=>{i==null?n(p.el=u(p.children||""),y,f):p.el=i.el},S=(i,p,y,f)=>{[i.el,i.anchor]=H(i.children,p,y,f,i.el,i.anchor)},O=({el:i,anchor:p},y,f)=>{let T;for(;i&&i!==p;)T=b(i),n(i,y,f),i=T;n(p,y,f)},P=({el:i,anchor:p})=>{let y;for(;i&&i!==p;)y=b(i),o(i),i=y;o(p)},Z=(i,p,y,f,T,E,M,U,j)=>{if(p.type==="svg"?M="svg":p.type==="math"&&(M="mathml"),i==null)X(p,y,f,T,E,M,U,j);else{const I=i.el&&i.el._isVueCE?i.el:null;try{I&&I._beginPatch(),z(i,p,T,E,M,U,j)}finally{I&&I._endPatch()}}},X=(i,p,y,f,T,E,M,U)=>{let j,I;const{props:Y,shapeFlag:V,transition:q,dirs:ee}=i;if(j=i.el=a(i.type,E,Y&&Y.is,Y),V&8?d(j,i.children):V&16&&R(i.children,j,null,f,T,Js(i,E),M,U),ee&&$t(i,null,f,"created"),K(j,i,i.scopeId,M,f),Y){for(const me in Y)me!=="value"&&!Zt(me)&&l(j,me,null,Y[me],E,f);"value"in Y&&l(j,"value",null,Y.value,E),(I=Y.onVnodeBeforeMount)&&Ye(I,f,i)}ee&&$t(i,null,f,"beforeMount");const ie=ei(T,q);ie&&q.beforeEnter(j),n(j,p,y),((I=Y&&Y.onVnodeMounted)||ie||ee)&&Ne(()=>{try{I&&Ye(I,f,i),ie&&q.enter(j),ee&&$t(i,null,f,"mounted")}finally{}},T)},K=(i,p,y,f,T)=>{if(y&&A(i,y),f)for(let E=0;E<f.length;E++)A(i,f[E]);if(T){let E=T.subTree;if(p===E||ur(E.type)&&(E.ssContent===p||E.ssFallback===p)){const M=T.vnode;K(i,M,M.scopeId,M.slotScopeIds,T.parent)}}},R=(i,p,y,f,T,E,M,U,j=0)=>{for(let I=j;I<i.length;I++){const Y=i[I]=U?ft(i[I]):tt(i[I]);C(null,Y,p,y,f,T,E,M,U)}},z=(i,p,y,f,T,E,M)=>{const U=p.el=i.el;let{patchFlag:j,dynamicChildren:I,dirs:Y}=p;j|=i.patchFlag&16;const V=i.props||he,q=p.props||he;let ee;if(y&&Ct(y,!1),(ee=q.onVnodeBeforeUpdate)&&Ye(ee,y,p,i),Y&&$t(p,i,y,"beforeUpdate"),y&&Ct(y,!0),(V.innerHTML&&q.innerHTML==null||V.textContent&&q.textContent==null)&&d(U,""),I?ue(i.dynamicChildren,I,U,y,f,Js(p,T),E):M||le(i,p,U,null,y,f,Js(p,T),E,!1),j>0){if(j&16)F(U,V,q,y,T);else if(j&2&&V.class!==q.class&&l(U,"class",null,q.class,T),j&4&&l(U,"style",V.style,q.style,T),j&8){const ie=p.dynamicProps;for(let me=0;me<ie.length;me++){const xe=ie[me],Te=V[xe],Ae=q[xe];(Ae!==Te||xe==="value")&&l(U,xe,Te,Ae,T,y)}}j&1&&i.children!==p.children&&d(U,p.children)}else!M&&I==null&&F(U,V,q,y,T);((ee=q.onVnodeUpdated)||Y)&&Ne(()=>{ee&&Ye(ee,y,p,i),Y&&$t(p,i,y,"updated")},f)},ue=(i,p,y,f,T,E,M)=>{for(let U=0;U<p.length;U++){const j=i[U],I=p[U],Y=j.el&&(j.type===ne||!Jt(j,I)||j.shapeFlag&198)?m(j.el):y;C(j,I,Y,null,f,T,E,M,!0)}},F=(i,p,y,f,T)=>{if(p!==y){if(p!==he)for(const E in p)!Zt(E)&&!(E in y)&&l(i,E,p[E],null,T,f);for(const E in y){if(Zt(E))continue;const M=y[E],U=p[E];M!==U&&E!=="value"&&l(i,E,U,M,T,f)}"value"in y&&l(i,"value",p.value,y.value,T)}},L=(i,p,y,f,T,E,M,U,j)=>{const I=p.el=i?i.el:c(""),Y=p.anchor=i?i.anchor:c("");let{patchFlag:V,dynamicChildren:q,slotScopeIds:ee}=p;ee&&(U=U?U.concat(ee):ee),i==null?(n(I,y,f),n(Y,y,f),R(p.children||[],y,Y,T,E,M,U,j)):V>0&&V&64&&q&&i.dynamicChildren&&i.dynamicChildren.length===q.length?(ue(i.dynamicChildren,q,y,T,E,M,U),(p.key!=null||T&&p===T.subTree)&&ir(i,p,!0)):le(i,p,y,Y,T,E,M,U,j)},J=(i,p,y,f,T,E,M,U,j)=>{p.slotScopeIds=U,i==null?p.shapeFlag&512?T.ctx.activate(p,y,f,M,j):oe(p,y,f,T,E,M,j):_e(i,p,j)},oe=(i,p,y,f,T,E,M)=>{const U=i.component=ci(i,f,T);if(Wo(i)&&(U.ctx.renderer=N),di(U,!1,M),U.asyncDep){if(T&&T.registerDep(U,Se,M),!i.el){const j=U.subTree=ot(kt);k(null,j,p,y),i.placeholder=j.el}}else Se(U,i,p,y,T,E,M)},_e=(i,p,y)=>{const f=p.component=i.component;if(Kl(i,p,y))if(f.asyncDep&&!f.asyncResolved){pe(f,p,y);return}else f.next=p,f.update();else p.el=i.el,f.vnode=p},Se=(i,p,y,f,T,E,M)=>{const U=()=>{if(i.isMounted){let{next:V,bu:q,u:ee,parent:ie,vnode:me}=i;{const qe=ar(i);if(qe){V&&(V.el=me.el,pe(i,V,M)),qe.asyncDep.then(()=>{Ne(()=>{i.isUnmounted||I()},T)});return}}let xe=V,Te;Ct(i,!1),V?(V.el=me.el,pe(i,V,M)):V=me,q&&gs(q),(Te=V.props&&V.props.onVnodeBeforeUpdate)&&Ye(Te,ie,V,me),Ct(i,!0);const Ae=Bn(i),Je=i.subTree;i.subTree=Ae,C(Je,Ae,m(Je.el),Pt(Je),i,T,E),V.el=Ae.el,xe===null&&Wl(i,Ae.el),ee&&Ne(ee,T),(Te=V.props&&V.props.onVnodeUpdated)&&Ne(()=>Ye(Te,ie,V,me),T)}else{let V;const{el:q,props:ee}=p,{bm:ie,m:me,parent:xe,root:Te,type:Ae}=i,Je=ts(p);Ct(i,!1),ie&&gs(ie),!Je&&(V=ee&&ee.onVnodeBeforeMount)&&Ye(V,xe,p),Ct(i,!0);{Te.ce&&Te.ce._hasShadowRoot()&&Te.ce._injectChildStyle(Ae,i.parent?i.parent.type:void 0);const qe=i.subTree=Bn(i);C(null,qe,y,f,i,T,E),p.el=qe.el}if(me&&Ne(me,T),!Je&&(V=ee&&ee.onVnodeMounted)){const qe=p;Ne(()=>Ye(V,xe,qe),T)}(p.shapeFlag&256||xe&&ts(xe.vnode)&&xe.vnode.shapeFlag&256)&&i.a&&Ne(i.a,T),i.isMounted=!0,p=y=f=null}};i.scope.on();const j=i.effect=new _o(U);i.scope.off();const I=i.update=j.run.bind(j),Y=i.job=j.runIfDirty.bind(j);Y.i=i,Y.id=i.uid,j.scheduler=()=>bn(Y),Ct(i,!0),I()},pe=(i,p,y)=>{p.component=i;const f=i.vnode.props;i.vnode=p,i.next=null,Jl(i,p.props,f,y),Zl(i,p.children,y),xt(),Dn(i),gt()},le=(i,p,y,f,T,E,M,U,j=!1)=>{const I=i&&i.children,Y=i?i.shapeFlag:0,V=p.children,{patchFlag:q,shapeFlag:ee}=p;if(q>0){if(q&128){D(I,V,y,f,T,E,M,U,j);return}else if(q&256){B(I,V,y,f,T,E,M,U,j);return}}ee&8?(Y&16&&at(I,T,E),V!==I&&d(y,V)):Y&16?ee&16?D(I,V,y,f,T,E,M,U,j):at(I,T,E,!0):(Y&8&&d(y,""),ee&16&&R(V,y,f,T,E,M,U,j))},B=(i,p,y,f,T,E,M,U,j)=>{i=i||Dt,p=p||Dt;const I=i.length,Y=p.length,V=Math.min(I,Y);let q;for(q=0;q<V;q++){const ee=p[q]=j?ft(p[q]):tt(p[q]);C(i[q],ee,y,null,T,E,M,U,j)}I>Y?at(i,T,E,!0,!1,V):R(p,y,f,T,E,M,U,j,V)},D=(i,p,y,f,T,E,M,U,j)=>{let I=0;const Y=p.length;let V=i.length-1,q=Y-1;for(;I<=V&&I<=q;){const ee=i[I],ie=p[I]=j?ft(p[I]):tt(p[I]);if(Jt(ee,ie))C(ee,ie,y,null,T,E,M,U,j);else break;I++}for(;I<=V&&I<=q;){const ee=i[V],ie=p[q]=j?ft(p[q]):tt(p[q]);if(Jt(ee,ie))C(ee,ie,y,null,T,E,M,U,j);else break;V--,q--}if(I>V){if(I<=q){const ee=q+1,ie=ee<Y?p[ee].el:f;for(;I<=q;)C(null,p[I]=j?ft(p[I]):tt(p[I]),y,ie,T,E,M,U,j),I++}}else if(I>q)for(;I<=V;)ke(i[I],T,E,!0),I++;else{const ee=I,ie=I,me=new Map;for(I=ie;I<=q;I++){const Ue=p[I]=j?ft(p[I]):tt(p[I]);Ue.key!=null&&me.set(Ue.key,I)}let xe,Te=0;const Ae=q-ie+1;let Je=!1,qe=0;const Wt=new Array(Ae);for(I=0;I<Ae;I++)Wt[I]=0;for(I=ee;I<=V;I++){const Ue=i[I];if(Te>=Ae){ke(Ue,T,E,!0);continue}let Ge;if(Ue.key!=null)Ge=me.get(Ue.key);else for(xe=ie;xe<=q;xe++)if(Wt[xe-ie]===0&&Jt(Ue,p[xe])){Ge=xe;break}Ge===void 0?ke(Ue,T,E,!0):(Wt[Ge-ie]=I+1,Ge>=qe?qe=Ge:Je=!0,C(Ue,p[Ge],y,null,T,E,M,U,j),Te++)}const Tn=Je?ti(Wt):Dt;for(xe=Tn.length-1,I=Ae-1;I>=0;I--){const Ue=ie+I,Ge=p[Ue],An=p[Ue+1],En=Ue+1<Y?An.el||cr(An):f;Wt[I]===0?C(null,Ge,y,En,T,E,M,U,j):Je&&(xe<0||I!==Tn[xe]?Ce(Ge,y,En,2):xe--)}}},Ce=(i,p,y,f,T=null)=>{const{el:E,type:M,transition:U,children:j,shapeFlag:I}=i;if(I&6){Ce(i.component.subTree,p,y,f);return}if(I&128){i.suspense.move(p,y,f);return}if(I&64){M.move(i,p,y,N);return}if(M===ne){n(E,p,y);for(let V=0;V<j.length;V++)Ce(j[V],p,y,f);n(i.anchor,p,y);return}if(M===ys){O(i,p,y);return}if(f!==2&&I&1&&U)if(f===0)U.beforeEnter(E),n(E,p,y),Ne(()=>U.enter(E),T);else{const{leave:V,delayLeave:q,afterLeave:ee}=U,ie=()=>{i.ctx.isUnmounted?o(E):n(E,p,y)},me=()=>{E._isLeaving&&E[xl](!0),V(E,()=>{ie(),ee&&ee()})};q?q(E,ie,me):me()}else n(E,p,y)},ke=(i,p,y,f=!1,T=!1)=>{const{type:E,props:M,ref:U,children:j,dynamicChildren:I,shapeFlag:Y,patchFlag:V,dirs:q,cacheIndex:ee,memo:ie}=i;if(V===-2&&(T=!1),U!=null&&(xt(),es(U,null,y,i,!0),gt()),ee!=null&&(p.renderCache[ee]=void 0),Y&256){p.ctx.deactivate(i);return}const me=Y&1&&q,xe=!ts(i);let Te;if(xe&&(Te=M&&M.onVnodeBeforeUnmount)&&Ye(Te,p,i),Y&6)It(i.component,y,f);else{if(Y&128){i.suspense.unmount(y,f);return}me&&$t(i,null,p,"beforeUnmount"),Y&64?i.type.remove(i,p,y,N,f):I&&!I.hasOnce&&(E!==ne||V>0&&V&64)?at(I,p,y,!1,!0):(E===ne&&V&384||!T&&Y&16)&&at(j,p,y),f&&de(i)}const Ae=ie!=null&&ee==null;(xe&&(Te=M&&M.onVnodeUnmounted)||me||Ae)&&Ne(()=>{Te&&Ye(Te,p,i),me&&$t(i,null,p,"unmounted"),Ae&&(i.el=null)},y)},de=i=>{const{type:p,el:y,anchor:f,transition:T}=i;if(p===ne){ze(y,f);return}if(p===ys){P(i);return}const E=()=>{o(y),T&&!T.persisted&&T.afterLeave&&T.afterLeave()};if(i.shapeFlag&1&&T&&!T.persisted){const{leave:M,delayLeave:U}=T,j=()=>M(y,E);U?U(i.el,E,j):j()}else E()},ze=(i,p)=>{let y;for(;i!==p;)y=b(i),o(i),i=y;o(p)},It=(i,p,y)=>{const{bum:f,scope:T,job:E,subTree:M,um:U,m:j,a:I}=i;Wn(j),Wn(I),f&&gs(f),T.stop(),E&&(E.flags|=8,ke(M,i,p,y)),U&&Ne(U,p),Ne(()=>{i.isUnmounted=!0},p)},at=(i,p,y,f=!1,T=!1,E=0)=>{for(let M=E;M<i.length;M++)ke(i[M],p,y,f,T)},Pt=i=>{if(i.shapeFlag&6)return Pt(i.component.subTree);if(i.shapeFlag&128)return i.suspense.next();const p=b(i.anchor||i.el),y=p&&p[ml];return y?b(y):p};let ct=!1;const bt=(i,p,y)=>{let f;i==null?p._vnode&&(ke(p._vnode,null,null,!0),f=p._vnode.component):C(p._vnode||null,i,p,null,null,null,y),p._vnode=i,ct||(ct=!0,Dn(f),Uo(),ct=!1)},N={p:C,um:ke,m:Ce,r:de,mt:oe,mc:R,pc:le,pbc:ue,n:Pt,o:e};return{render:bt,hydrate:void 0,createApp:Ll(bt)}}function Js({type:e,props:t},s){return s==="svg"&&e==="foreignObject"||s==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:s}function Ct({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function ei(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ir(e,t,s=!1){const n=e.children,o=t.children;if(Q(n)&&Q(o))for(let l=0;l<n.length;l++){const a=n[l];let c=o[l];c.shapeFlag&1&&!c.dynamicChildren&&((c.patchFlag<=0||c.patchFlag===32)&&(c=o[l]=ft(o[l]),c.el=a.el),!s&&c.patchFlag!==-2&&ir(a,c)),c.type===Ls&&(c.patchFlag===-1&&(c=o[l]=ft(c)),c.el=a.el),c.type===kt&&!c.el&&(c.el=a.el)}}function ti(e){const t=e.slice(),s=[0];let n,o,l,a,c;const u=e.length;for(n=0;n<u;n++){const h=e[n];if(h!==0){if(o=s[s.length-1],e[o]<h){t[n]=o,s.push(n);continue}for(l=0,a=s.length-1;l<a;)c=l+a>>1,e[s[c]]<h?l=c+1:a=c;h<e[s[l]]&&(l>0&&(t[n]=s[l-1]),s[l]=n)}}for(l=s.length,a=s[l-1];l-- >0;)s[l]=a,a=t[a];return s}function ar(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ar(t)}function Wn(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function cr(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?cr(t.subTree):null}const ur=e=>e.__isSuspense;function si(e,t){t&&t.pendingBranch?Q(e)?t.effects.push(...e):t.effects.push(e):al(e)}const ne=Symbol.for("v-fgt"),Ls=Symbol.for("v-txt"),kt=Symbol.for("v-cmt"),ys=Symbol.for("v-stc"),ns=[];let Fe=null;function x(e=!1){ns.push(Fe=e?null:[])}function ni(){ns.pop(),Fe=ns[ns.length-1]||null}let is=1;function zn(e,t=!1){is+=e,e<0&&Fe&&t&&(Fe.hasOnce=!0)}function dr(e){return e.dynamicChildren=is>0?Fe||Dt:null,ni(),is>0&&Fe&&Fe.push(e),e}function g(e,t,s,n,o,l){return dr(r(e,t,s,n,o,l,!0))}function fr(e,t,s,n,o){return dr(ot(e,t,s,n,o,!0))}function pr(e){return e?e.__v_isVNode===!0:!1}function Jt(e,t){return e.type===t.type&&e.key===t.key}const mr=({key:e})=>e??null,bs=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?$e(e)||Me(e)||te(e)?{i:Ve,r:e,k:t,f:!!s}:e:null);function r(e,t=null,s=null,n=0,o=null,l=e===ne?0:1,a=!1,c=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&mr(t),ref:t&&bs(t),scopeId:Fo,slotScopeIds:null,children:s,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:l,patchFlag:n,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:Ve};return c?($n(u,s),l&128&&e.normalize(u)):s&&(u.shapeFlag|=$e(s)?8:16),is>0&&!a&&Fe&&(u.patchFlag>0||l&6)&&u.patchFlag!==32&&Fe.push(u),u}const ot=oi;function oi(e,t=null,s=null,n=0,o=null,l=!1){if((!e||e===Jo)&&(e=kt),pr(e)){const c=Vt(e,t,!0);return s&&$n(c,s),is>0&&!l&&Fe&&(c.shapeFlag&6?Fe[Fe.indexOf(e)]=c:Fe.push(c)),c.patchFlag=-2,c}if(xi(e)&&(e=e.__vccOpts),t){t=ri(t);let{class:c,style:u}=t;c&&!$e(c)&&(t.class=G(c)),fe(u)&&(yn(u)&&!Q(u)&&(u=Ee({},u)),t.style=Lt(u))}const a=$e(e)?1:ur(e)?128:hl(e)?64:fe(e)?4:te(e)?2:0;return r(e,t,s,n,o,a,l,!0)}function ri(e){return e?yn(e)||tr(e)?Ee({},e):e:null}function Vt(e,t,s=!1,n=!1){const{props:o,ref:l,patchFlag:a,children:c,transition:u}=e,h=t?li(o||{},t):o,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:h,key:h&&mr(h),ref:t&&t.ref?s&&l?Q(l)?l.concat(bs(t)):[l,bs(t)]:bs(t):l,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:c,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==ne?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Vt(e.ssContent),ssFallback:e.ssFallback&&Vt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&n&&_n(d,u.clone(d)),d}function we(e=" ",t=0){return ot(Ls,null,e,t)}function et(e,t){const s=ot(ys,null,e);return s.staticCount=t,s}function W(e="",t=!1){return t?(x(),fr(kt,null,e)):ot(kt,null,e)}function tt(e){return e==null||typeof e=="boolean"?ot(kt):Q(e)?ot(ne,null,e.slice()):pr(e)?ft(e):ot(Ls,null,String(e))}function ft(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Vt(e)}function $n(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(Q(t))s=16;else if(typeof t=="object")if(n&65){const o=t.default;o&&(o._c&&(o._d=!1),$n(e,o()),o._c&&(o._d=!0));return}else{s=32;const o=t._;!o&&!tr(t)?t._ctx=Ve:o===3&&Ve&&(Ve.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else te(t)?(t={default:t,_ctx:Ve},s=32):(t=String(t),n&64?(s=16,t=[we(t)]):s=8);e.children=t,e.shapeFlag|=s}function li(...e){const t={};for(let s=0;s<e.length;s++){const n=e[s];for(const o in n)if(o==="class")t.class!==n.class&&(t.class=G([t.class,n.class]));else if(o==="style")t.style=Lt([t.style,n.style]);else if(As(o)){const l=t[o],a=n[o];a&&l!==a&&!(Q(l)&&l.includes(a))?t[o]=l?[].concat(l,a):a:a==null&&l==null&&!Es(o)&&(t[o]=a)}else o!==""&&(t[o]=n[o])}return t}function Ye(e,t,s,n=null){lt(e,t,7,[s,n])}const ii=Yo();let ai=0;function ci(e,t,s){const n=e.type,o=(t?t.appContext:e.appContext)||ii,l={uid:ai++,vnode:e,type:n,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ir(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:nr(n,o),emitsOptions:Zo(n,o),emit:null,emitted:null,propsDefaults:he,inheritAttrs:n.inheritAttrs,ctx:he,data:he,props:he,attrs:he,slots:he,refs:he,setupState:he,setupContext:null,suspense:s,suspenseId:s?s.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 l.ctx={_:l},l.root=t?t.root:l,l.emit=Vl.bind(null,l),e.ce&&e.ce(l),l}let Pe=null;const ui=()=>Pe||Ve;let Ts,rn;{const e=Os(),t=(s,n)=>{let o;return(o=e[s])||(o=e[s]=[]),o.push(n),l=>{o.length>1?o.forEach(a=>a(l)):o[0](l)}};Ts=t("__VUE_INSTANCE_SETTERS__",s=>Pe=s),rn=t("__VUE_SSR_SETTERS__",s=>as=s)}const fs=e=>{const t=Pe;return Ts(e),e.scope.on(),()=>{e.scope.off(),Ts(t)}},Jn=()=>{Pe&&Pe.scope.off(),Ts(null)};function hr(e){return e.vnode.shapeFlag&4}let as=!1;function di(e,t=!1,s=!1){t&&rn(t);const{props:n,children:o}=e.vnode,l=hr(e);zl(e,n,l,t),Yl(e,o,s||t);const a=l?fi(e,t):void 0;return t&&rn(!1),a}function fi(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Pl);const{setup:n}=s;if(n){xt();const o=e.setupContext=n.length>1?mi(e):null,l=fs(e),a=ds(n,e,0,[e.props,o]),c=mo(a);if(gt(),l(),(c||e.sp)&&!ts(e)&&Ko(e),c){if(a.then(Jn,Jn),t)return a.then(u=>{qn(e,u)}).catch(u=>{Rs(u,e,0)});e.asyncDep=a}else qn(e,a)}else xr(e)}function qn(e,t,s){te(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:fe(t)&&(e.setupState=Ro(t)),xr(e)}function xr(e,t,s){const n=e.type;e.render||(e.render=n.render||nt);{const o=fs(e);xt();try{Ml(e)}finally{gt(),o()}}}const pi={get(e,t){return Ie(e,"get",""),e[t]}};function mi(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,pi),slots:e.slots,emit:e.emit,expose:t}}function Us(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Ro(Zr(e.exposed)),{get(t,s){if(s in t)return t[s];if(s in ss)return ss[s](e)},has(t,s){return s in t||s in ss}})):e.proxy}function hi(e,t=!0){return te(e)?e.displayName||e.name:e.name||t&&e.__name}function xi(e){return te(e)&&"__vccOpts"in e}const Re=(e,t)=>nl(e,t,as),gi="3.5.31";/**
|
|
60
|
+
**/function ds(e,t,s,n){try{return n?e(...n):e()}catch(r){Rs(r,t,s)}}function lt(e,t,s,n){if(oe(e)){const r=ds(e,t,s,n);return r&&mo(r)&&r.catch(l=>{Rs(l,t,s)}),r}if(ee(e)){const r=[];for(let l=0;l<e.length;l++)r.push(lt(e[l],t,s,n));return r}}function Rs(e,t,s,n=!0){const r=t?t.vnode:null,{errorHandler:l,throwUnhandledErrorInProduction:a}=t&&t.appContext.config||ge;if(t){let u=t.parent;const d=t.proxy,x=`https://vuejs.org/error-reference/#runtime-${s}`;for(;u;){const f=u.ec;if(f){for(let m=0;m<f.length;m++)if(f[m](e,d,x)===!1)return}u=u.parent}if(l){xt(),ds(l,null,10,[e,d,x]),vt();return}}ll(e,s,r,n,a)}function ll(e,t,s,n=!0,r=!1){if(r)throw e;console.error(e)}const De=[];let Qe=-1;const jt=[];let _t=null,Ot=0;const jo=Promise.resolve();let ks=null;function Lo(e){const t=ks||jo;return e?t.then(this?e.bind(this):e):t}function al(e){let t=Qe+1,s=De.length;for(;t<s;){const n=t+s>>>1,r=De[n],l=ls(r);l<e||l===e&&r.flags&2?t=n+1:s=n}return t}function _n(e){if(!(e.flags&1)){const t=ls(e),s=De[De.length-1];!s||!(e.flags&2)&&t>=ls(s)?De.push(e):De.splice(al(t),0,e),e.flags|=1,Uo()}}function Uo(){ks||(ks=jo.then(Vo))}function il(e){ee(e)?jt.push(...e):_t&&e.id===-1?_t.splice(Ot+1,0,e):e.flags&1||(jt.push(e),e.flags|=1),Uo()}function Rn(e,t,s=Qe+1){for(;s<De.length;s++){const n=De[s];if(n&&n.flags&2){if(e&&n.id!==e.uid)continue;De.splice(s,1),s--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function No(e){if(jt.length){const t=[...new Set(jt)].sort((s,n)=>ls(s)-ls(n));if(jt.length=0,_t){_t.push(...t);return}for(_t=t,Ot=0;Ot<_t.length;Ot++){const s=_t[Ot];s.flags&4&&(s.flags&=-2),s.flags&8||s(),s.flags&=-2}_t=null,Ot=0}}const ls=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Vo(e){try{for(Qe=0;Qe<De.length;Qe++){const t=De[Qe];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),ds(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;Qe<De.length;Qe++){const t=De[Qe];t&&(t.flags&=-2)}Qe=-1,De.length=0,No(),ks=null,(De.length||jt.length)&&Vo()}}let Ne=null,Bo=null;function Ss(e){const t=Ne;return Ne=e,Bo=e&&e.type.__scopeId||null,t}function cl(e,t=Ne,s){if(!t||e._n)return e;const n=(...r)=>{n._d&&Jn(-1);const l=Ss(t);let a;try{a=e(...r)}finally{Ss(l),n._d&&Jn(1)}return a};return n._n=!0,n._c=!0,n._d=!0,n}function Z(e,t){if(Ne===null)return e;const s=Ns(Ne),n=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[l,a,u,d=ge]=t[r];l&&(oe(l)&&(l={mounted:l,updated:l}),l.deep&&pt(a),n.push({dir:l,instance:s,value:a,oldValue:void 0,arg:u,modifiers:d}))}return e}function $t(e,t,s,n){const r=e.dirs,l=t&&t.dirs;for(let a=0;a<r.length;a++){const u=r[a];l&&(u.oldValue=l[a].value);let d=u.dir[n];d&&(xt(),lt(d,s,8,[e.el,u,e,t]),vt())}}function ul(e,t){if(Ie){let s=Ie.provides;const n=Ie.parent&&Ie.parent.provides;n===s&&(s=Ie.provides=Object.create(n)),s[e]=t}}function gs(e,t,s=!1){const n=ua();if(n||Lt){let r=Lt?Lt._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return s&&oe(t)?t.call(n&&n.proxy):t}}const dl=Symbol.for("v-scx"),fl=()=>gs(dl);function Ws(e,t,s){return Fo(e,t,s)}function Fo(e,t,s=ge){const{immediate:n,deep:r,flush:l,once:a}=s,u=Pe({},s),d=t&&n||!t&&l!=="post";let x;if(is){if(l==="sync"){const k=fl();x=k.__watcherHandles||(k.__watcherHandles=[])}else if(!d){const k=()=>{};return k.stop=nt,k.resume=nt,k.pause=nt,k}}const f=Ie;u.call=(k,F,$)=>lt(k,f,F,$);let m=!1;l==="post"?u.scheduler=k=>{je(k,f&&f.suspense)}:l!=="sync"&&(m=!0,u.scheduler=(k,F)=>{F?k():_n(k)}),u.augmentJob=k=>{t&&(k.flags|=4),m&&(k.flags|=2,f&&(k.id=f.uid,k.i=f))};const v=rl(e,t,u);return is&&(x?x.push(v):d&&v()),v}function pl(e,t,s){const n=this.proxy,r=Se(e)?e.includes(".")?Ho(n,e):()=>n[e]:e.bind(n,n);let l;oe(t)?l=t:(l=t.handler,s=t);const a=fs(this),u=Fo(r,l.bind(n),s);return a(),u}function Ho(e,t){const s=t.split(".");return()=>{let n=e;for(let r=0;r<s.length&&n;r++)n=n[s[r]];return n}}const ml=Symbol("_vte"),xl=e=>e.__isTeleport,vl=Symbol("_leaveCb");function wn(e,t){e.shapeFlag&6&&e.component?(e.transition=t,wn(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 He(e,t){return oe(e)?Pe({name:e.name},t,{setup:e}):e}function Ko(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function jn(e,t){let s;return!!((s=Object.getOwnPropertyDescriptor(e,t))&&!s.configurable)}const $s=new WeakMap;function es(e,t,s,n,r=!1){if(ee(e)){e.forEach(($,N)=>es($,t&&(ee(t)?t[N]:t),s,n,r));return}if(ts(n)&&!r){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&es(e,t,s,n.component.subTree);return}const l=n.shapeFlag&4?Ns(n.component):n.el,a=r?null:l,{i:u,r:d}=e,x=t&&t.r,f=u.refs===ge?u.refs={}:u.refs,m=u.setupState,v=ce(m),k=m===ge?po:$=>jn(f,$)?!1:ue(v,$),F=($,N)=>!(N&&jn(f,N));if(x!=null&&x!==d){if(Ln(t),Se(x))f[x]=null,k(x)&&(m[x]=null);else if(Me(x)){const $=t;F(x,$.k)&&(x.value=null),$.k&&(f[$.k]=null)}}if(oe(d))ds(d,u,12,[a,f]);else{const $=Se(d),N=Me(d);if($||N){const C=()=>{if(e.f){const E=$?k(d)?m[d]:f[d]:F()||!e.k?d.value:f[e.k];if(r)ee(E)&&un(E,l);else if(ee(E))E.includes(l)||E.push(l);else if($)f[d]=[l],k(d)&&(m[d]=f[d]);else{const R=[l];F(d,e.k)&&(d.value=R),e.k&&(f[e.k]=R)}}else $?(f[d]=a,k(d)&&(m[d]=a)):N&&(F(d,e.k)&&(d.value=a),e.k&&(f[e.k]=a))};if(a){const E=()=>{C(),$s.delete(e)};E.id=-1,$s.set(e,E),je(E,s)}else Ln(e),C()}}}function Ln(e){const t=$s.get(e);t&&(t.flags|=8,$s.delete(e))}Os().requestIdleCallback;Os().cancelIdleCallback;const ts=e=>!!e.type.__asyncLoader,Wo=e=>e.type.__isKeepAlive;function hl(e,t){zo(e,"a",t)}function gl(e,t){zo(e,"da",t)}function zo(e,t,s=Ie){const n=e.__wdc||(e.__wdc=()=>{let r=s;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(js(t,n,s),s){let r=s.parent;for(;r&&r.parent;)Wo(r.parent.vnode)&&yl(n,t,s,r),r=r.parent}}function yl(e,t,s,n){const r=js(t,e,n,!0);kn(()=>{un(n[t],r)},s)}function js(e,t,s=Ie,n=!1){if(s){const r=s[e]||(s[e]=[]),l=t.__weh||(t.__weh=(...a)=>{xt();const u=fs(s),d=lt(t,s,e,a);return u(),vt(),d});return n?r.unshift(l):r.push(l),l}}const gt=e=>(t,s=Ie)=>{(!is||e==="sp")&&js(e,(...n)=>t(...n),s)},bl=gt("bm"),Be=gt("m"),_l=gt("bu"),wl=gt("u"),kl=gt("bum"),kn=gt("um"),Sl=gt("sp"),$l=gt("rtg"),Cl=gt("rtc");function Tl(e,t=Ie){js("ec",e,t)}const El="components",Jo=Symbol.for("v-ndc");function Pl(e){return Se(e)?Al(El,e,!1)||e:e||Jo}function Al(e,t,s=!0,n=!1){const r=Ne||Ie;if(r){const l=r.type;{const u=xa(l,!1);if(u&&(u===t||u===Re(t)||u===Is(Re(t))))return l}const a=Un(r[e]||l[e],t)||Un(r.appContext[e],t);return!a&&n?l:a}}function Un(e,t){return e&&(e[t]||e[Re(t)]||e[Is(Re(t))])}function ve(e,t,s,n){let r;const l=s,a=ee(e);if(a||Se(e)){const u=a&&Pt(e);let d=!1,x=!1;u&&(d=!Fe(e),x=ht(e),e=Ds(e)),r=new Array(e.length);for(let f=0,m=e.length;f<m;f++)r[f]=t(d?x?Nt(ze(e[f])):ze(e[f]):e[f],f,void 0,l)}else if(typeof e=="number"){r=new Array(e);for(let u=0;u<e;u++)r[u]=t(u+1,u,void 0,l)}else if(pe(e))if(e[Symbol.iterator])r=Array.from(e,(u,d)=>t(u,d,void 0,l));else{const u=Object.keys(e);r=new Array(u.length);for(let d=0,x=u.length;d<x;d++){const f=u[d];r[d]=t(e[f],f,d,l)}}else r=[];return r}const tn=e=>e?xr(e)?Ns(e):tn(e.parent):null,ss=Pe(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=>tn(e.parent),$root:e=>tn(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Go(e),$forceUpdate:e=>e.f||(e.f=()=>{_n(e.update)}),$nextTick:e=>e.n||(e.n=Lo.bind(e.proxy)),$watch:e=>pl.bind(e)}),zs=(e,t)=>e!==ge&&!e.__isScriptSetup&&ue(e,t),Il={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:r,props:l,accessCache:a,type:u,appContext:d}=e;if(t[0]!=="$"){const v=a[t];if(v!==void 0)switch(v){case 1:return n[t];case 2:return r[t];case 4:return s[t];case 3:return l[t]}else{if(zs(n,t))return a[t]=1,n[t];if(r!==ge&&ue(r,t))return a[t]=2,r[t];if(ue(l,t))return a[t]=3,l[t];if(s!==ge&&ue(s,t))return a[t]=4,s[t];sn&&(a[t]=0)}}const x=ss[t];let f,m;if(x)return t==="$attrs"&&Ae(e.attrs,"get",""),x(e);if((f=u.__cssModules)&&(f=f[t]))return f;if(s!==ge&&ue(s,t))return a[t]=4,s[t];if(m=d.config.globalProperties,ue(m,t))return m[t]},set({_:e},t,s){const{data:n,setupState:r,ctx:l}=e;return zs(r,t)?(r[t]=s,!0):n!==ge&&ue(n,t)?(n[t]=s,!0):ue(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(l[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:n,appContext:r,props:l,type:a}},u){let d;return!!(s[u]||e!==ge&&u[0]!=="$"&&ue(e,u)||zs(t,u)||ue(l,u)||ue(n,u)||ue(ss,u)||ue(r.config.globalProperties,u)||(d=a.__cssModules)&&d[u])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:ue(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function Nn(e){return ee(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let sn=!0;function Ml(e){const t=Go(e),s=e.proxy,n=e.ctx;sn=!1,t.beforeCreate&&Vn(t.beforeCreate,e,"bc");const{data:r,computed:l,methods:a,watch:u,provide:d,inject:x,created:f,beforeMount:m,mounted:v,beforeUpdate:k,updated:F,activated:$,deactivated:N,beforeDestroy:C,beforeUnmount:E,destroyed:R,unmounted:I,render:U,renderTracked:y,renderTriggered:S,errorCaptured:j,serverPrefetch:G,expose:ae,inheritAttrs:z,components:M,directives:J,filters:re}=t;if(x&&Ol(x,n,null),a)for(const me in a){const ie=a[me];oe(ie)&&(n[me]=ie.bind(s))}if(r){const me=r.call(s,s);pe(me)&&(e.data=gn(me))}if(sn=!0,l)for(const me in l){const ie=l[me],W=oe(ie)?ie.bind(s,s):oe(ie.get)?ie.get.bind(s,s):nt,D=!oe(ie)&&oe(ie.set)?ie.set.bind(s):nt,Ce=Ee({get:W,set:D});Object.defineProperty(n,me,{enumerable:!0,configurable:!0,get:()=>Ce.value,set:we=>Ce.value=we})}if(u)for(const me in u)qo(u[me],n,s,me);if(d){const me=oe(d)?d.call(s):d;Reflect.ownKeys(me).forEach(ie=>{ul(ie,me[ie])})}f&&Vn(f,e,"c");function ke(me,ie){ee(ie)?ie.forEach(W=>me(W.bind(s))):ie&&me(ie.bind(s))}if(ke(bl,m),ke(Be,v),ke(_l,k),ke(wl,F),ke(hl,$),ke(gl,N),ke(Tl,j),ke(Cl,y),ke($l,S),ke(kl,E),ke(kn,I),ke(Sl,G),ee(ae))if(ae.length){const me=e.exposed||(e.exposed={});ae.forEach(ie=>{Object.defineProperty(me,ie,{get:()=>s[ie],set:W=>s[ie]=W,enumerable:!0})})}else e.exposed||(e.exposed={});U&&e.render===nt&&(e.render=U),z!=null&&(e.inheritAttrs=z),M&&(e.components=M),J&&(e.directives=J),G&&Ko(e)}function Ol(e,t,s=nt){ee(e)&&(e=nn(e));for(const n in e){const r=e[n];let l;pe(r)?"default"in r?l=gs(r.from||n,r.default,!0):l=gs(r.from||n):l=gs(r),Me(l)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>l.value,set:a=>l.value=a}):t[n]=l}}function Vn(e,t,s){lt(ee(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function qo(e,t,s,n){let r=n.includes(".")?Ho(s,n):()=>s[n];if(Se(e)){const l=t[e];oe(l)&&Ws(r,l)}else if(oe(e))Ws(r,e.bind(s));else if(pe(e))if(ee(e))e.forEach(l=>qo(l,t,s,n));else{const l=oe(e.handler)?e.handler.bind(s):t[e.handler];oe(l)&&Ws(r,l,e)}}function Go(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:r,optionsCache:l,config:{optionMergeStrategies:a}}=e.appContext,u=l.get(t);let d;return u?d=u:!r.length&&!s&&!n?d=t:(d={},r.length&&r.forEach(x=>Cs(d,x,a,!0)),Cs(d,t,a)),pe(t)&&l.set(t,d),d}function Cs(e,t,s,n=!1){const{mixins:r,extends:l}=t;l&&Cs(e,l,s,!0),r&&r.forEach(a=>Cs(e,a,s,!0));for(const a in t)if(!(n&&a==="expose")){const u=Dl[a]||s&&s[a];e[a]=u?u(e[a],t[a]):t[a]}return e}const Dl={data:Bn,props:Fn,emits:Fn,methods:Yt,computed:Yt,beforeCreate:Oe,created:Oe,beforeMount:Oe,mounted:Oe,beforeUpdate:Oe,updated:Oe,beforeDestroy:Oe,beforeUnmount:Oe,destroyed:Oe,unmounted:Oe,activated:Oe,deactivated:Oe,errorCaptured:Oe,serverPrefetch:Oe,components:Yt,directives:Yt,watch:jl,provide:Bn,inject:Rl};function Bn(e,t){return t?e?function(){return Pe(oe(e)?e.call(this,this):e,oe(t)?t.call(this,this):t)}:t:e}function Rl(e,t){return Yt(nn(e),nn(t))}function nn(e){if(ee(e)){const t={};for(let s=0;s<e.length;s++)t[e[s]]=e[s];return t}return e}function Oe(e,t){return e?[...new Set([].concat(e,t))]:t}function Yt(e,t){return e?Pe(Object.create(null),e,t):t}function Fn(e,t){return e?ee(e)&&ee(t)?[...new Set([...e,...t])]:Pe(Object.create(null),Nn(e),Nn(t??{})):t}function jl(e,t){if(!e)return t;if(!t)return e;const s=Pe(Object.create(null),e);for(const n in t)s[n]=Oe(e[n],t[n]);return s}function Yo(){return{app:null,config:{isNativeTag:po,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 Ll=0;function Ul(e,t){return function(n,r=null){oe(n)||(n=Pe({},n)),r!=null&&!pe(r)&&(r=null);const l=Yo(),a=new WeakSet,u=[];let d=!1;const x=l.app={_uid:Ll++,_component:n,_props:r,_container:null,_context:l,_instance:null,version:ha,get config(){return l.config},set config(f){},use(f,...m){return a.has(f)||(f&&oe(f.install)?(a.add(f),f.install(x,...m)):oe(f)&&(a.add(f),f(x,...m))),x},mixin(f){return l.mixins.includes(f)||l.mixins.push(f),x},component(f,m){return m?(l.components[f]=m,x):l.components[f]},directive(f,m){return m?(l.directives[f]=m,x):l.directives[f]},mount(f,m,v){if(!d){const k=x._ceVNode||ot(n,r);return k.appContext=l,v===!0?v="svg":v===!1&&(v=void 0),e(k,f,v),d=!0,x._container=f,f.__vue_app__=x,Ns(k.component)}},onUnmount(f){u.push(f)},unmount(){d&&(lt(u,x._instance,16),e(null,x._container),delete x._container.__vue_app__)},provide(f,m){return l.provides[f]=m,x},runWithContext(f){const m=Lt;Lt=x;try{return f()}finally{Lt=m}}};return x}}let Lt=null;const Nl=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Re(t)}Modifiers`]||e[`${St(t)}Modifiers`];function Vl(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||ge;let r=s;const l=t.startsWith("update:"),a=l&&Nl(n,t.slice(7));a&&(a.trim&&(r=s.map(f=>Se(f)?f.trim():f)),a.number&&(r=s.map(Ms)));let u,d=n[u=Vs(t)]||n[u=Vs(Re(t))];!d&&l&&(d=n[u=Vs(St(t))]),d&<(d,e,6,r);const x=n[u+"Once"];if(x){if(!e.emitted)e.emitted={};else if(e.emitted[u])return;e.emitted[u]=!0,lt(x,e,6,r)}}const Bl=new WeakMap;function Zo(e,t,s=!1){const n=s?Bl:t.emitsCache,r=n.get(e);if(r!==void 0)return r;const l=e.emits;let a={},u=!1;if(!oe(e)){const d=x=>{const f=Zo(x,t,!0);f&&(u=!0,Pe(a,f))};!s&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}return!l&&!u?(pe(e)&&n.set(e,null),null):(ee(l)?l.forEach(d=>a[d]=null):Pe(a,l),pe(e)&&n.set(e,a),a)}function Ls(e,t){return!e||!Es(t)?!1:(t=t.slice(2).replace(/Once$/,""),ue(e,t[0].toLowerCase()+t.slice(1))||ue(e,St(t))||ue(e,t))}function Hn(e){const{type:t,vnode:s,proxy:n,withProxy:r,propsOptions:[l],slots:a,attrs:u,emit:d,render:x,renderCache:f,props:m,data:v,setupState:k,ctx:F,inheritAttrs:$}=e,N=Ss(e);let C,E;try{if(s.shapeFlag&4){const I=r||n,U=I;C=tt(x.call(U,I,f,m,k,v,F)),E=u}else{const I=t;C=tt(I.length>1?I(m,{attrs:u,slots:a,emit:d}):I(m,null)),E=t.props?u:Fl(u)}}catch(I){ns.length=0,Rs(I,e,1),C=ot(kt)}let R=C;if(E&&$!==!1){const I=Object.keys(E),{shapeFlag:U}=R;I.length&&U&7&&(l&&I.some(Ps)&&(E=Hl(E,l)),R=Vt(R,E,!1,!0))}return s.dirs&&(R=Vt(R,null,!1,!0),R.dirs=R.dirs?R.dirs.concat(s.dirs):s.dirs),s.transition&&wn(R,s.transition),C=R,Ss(N),C}const Fl=e=>{let t;for(const s in e)(s==="class"||s==="style"||Es(s))&&((t||(t={}))[s]=e[s]);return t},Hl=(e,t)=>{const s={};for(const n in e)(!Ps(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function Kl(e,t,s){const{props:n,children:r,component:l}=e,{props:a,children:u,patchFlag:d}=t,x=l.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&d>=0){if(d&1024)return!0;if(d&16)return n?Kn(n,a,x):!!a;if(d&8){const f=t.dynamicProps;for(let m=0;m<f.length;m++){const v=f[m];if(Qo(a,n,v)&&!Ls(x,v))return!0}}}else return(r||u)&&(!u||!u.$stable)?!0:n===a?!1:n?a?Kn(n,a,x):!0:!!a;return!1}function Kn(e,t,s){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let r=0;r<n.length;r++){const l=n[r];if(Qo(t,e,l)&&!Ls(s,l))return!0}return!1}function Qo(e,t,s){const n=e[s],r=t[s];return s==="style"&&pe(n)&&pe(r)?!Ht(n,r):n!==r}function Wl({vnode:e,parent:t,suspense:s},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.suspense.vnode.el=r.el=n,e=r),r===e)(e=t.vnode).el=n,t=t.parent;else break}s&&s.activeBranch===e&&(s.vnode.el=n)}const Xo={},er=()=>Object.create(Xo),tr=e=>Object.getPrototypeOf(e)===Xo;function zl(e,t,s,n=!1){const r={},l=er();e.propsDefaults=Object.create(null),sr(e,t,r,l);for(const a in e.propsOptions[0])a in r||(r[a]=void 0);s?e.props=n?r:Yr(r):e.type.props?e.props=r:e.props=l,e.attrs=l}function Jl(e,t,s,n){const{props:r,attrs:l,vnode:{patchFlag:a}}=e,u=ce(r),[d]=e.propsOptions;let x=!1;if((n||a>0)&&!(a&16)){if(a&8){const f=e.vnode.dynamicProps;for(let m=0;m<f.length;m++){let v=f[m];if(Ls(e.emitsOptions,v))continue;const k=t[v];if(d)if(ue(l,v))k!==l[v]&&(l[v]=k,x=!0);else{const F=Re(v);r[F]=on(d,u,F,k,e,!1)}else k!==l[v]&&(l[v]=k,x=!0)}}}else{sr(e,t,r,l)&&(x=!0);let f;for(const m in u)(!t||!ue(t,m)&&((f=St(m))===m||!ue(t,f)))&&(d?s&&(s[m]!==void 0||s[f]!==void 0)&&(r[m]=on(d,u,m,void 0,e,!0)):delete r[m]);if(l!==u)for(const m in l)(!t||!ue(t,m))&&(delete l[m],x=!0)}x&&ft(e.attrs,"set","")}function sr(e,t,s,n){const[r,l]=e.propsOptions;let a=!1,u;if(t)for(let d in t){if(Zt(d))continue;const x=t[d];let f;r&&ue(r,f=Re(d))?!l||!l.includes(f)?s[f]=x:(u||(u={}))[f]=x:Ls(e.emitsOptions,d)||(!(d in n)||x!==n[d])&&(n[d]=x,a=!0)}if(l){const d=ce(s),x=u||ge;for(let f=0;f<l.length;f++){const m=l[f];s[m]=on(r,d,m,x[m],e,!ue(x,m))}}return a}function on(e,t,s,n,r,l){const a=e[s];if(a!=null){const u=ue(a,"default");if(u&&n===void 0){const d=a.default;if(a.type!==Function&&!a.skipFactory&&oe(d)){const{propsDefaults:x}=r;if(s in x)n=x[s];else{const f=fs(r);n=x[s]=d.call(null,t),f()}}else n=d;r.ce&&r.ce._setProp(s,n)}a[0]&&(l&&!u?n=!1:a[1]&&(n===""||n===St(s))&&(n=!0))}return n}const ql=new WeakMap;function nr(e,t,s=!1){const n=s?ql:t.propsCache,r=n.get(e);if(r)return r;const l=e.props,a={},u=[];let d=!1;if(!oe(e)){const f=m=>{d=!0;const[v,k]=nr(m,t,!0);Pe(a,v),k&&u.push(...k)};!s&&t.mixins.length&&t.mixins.forEach(f),e.extends&&f(e.extends),e.mixins&&e.mixins.forEach(f)}if(!l&&!d)return pe(e)&&n.set(e,Dt),Dt;if(ee(l))for(let f=0;f<l.length;f++){const m=Re(l[f]);Wn(m)&&(a[m]=ge)}else if(l)for(const f in l){const m=Re(f);if(Wn(m)){const v=l[f],k=a[m]=ee(v)||oe(v)?{type:v}:Pe({},v),F=k.type;let $=!1,N=!0;if(ee(F))for(let C=0;C<F.length;++C){const E=F[C],R=oe(E)&&E.name;if(R==="Boolean"){$=!0;break}else R==="String"&&(N=!1)}else $=oe(F)&&F.name==="Boolean";k[0]=$,k[1]=N,($||ue(k,"default"))&&u.push(m)}}const x=[a,u];return pe(e)&&n.set(e,x),x}function Wn(e){return e[0]!=="$"&&!Zt(e)}const Sn=e=>e==="_"||e==="_ctx"||e==="$stable",$n=e=>ee(e)?e.map(tt):[tt(e)],Gl=(e,t,s)=>{if(t._n)return t;const n=cl((...r)=>$n(t(...r)),s);return n._c=!1,n},or=(e,t,s)=>{const n=e._ctx;for(const r in e){if(Sn(r))continue;const l=e[r];if(oe(l))t[r]=Gl(r,l,n);else if(l!=null){const a=$n(l);t[r]=()=>a}}},rr=(e,t)=>{const s=$n(t);e.slots.default=()=>s},lr=(e,t,s)=>{for(const n in t)(s||!Sn(n))&&(e[n]=t[n])},Yl=(e,t,s)=>{const n=e.slots=er();if(e.vnode.shapeFlag&32){const r=t._;r?(lr(n,t,s),s&&ho(n,"_",r,!0)):or(t,n)}else t&&rr(e,t)},Zl=(e,t,s)=>{const{vnode:n,slots:r}=e;let l=!0,a=ge;if(n.shapeFlag&32){const u=t._;u?s&&u===1?l=!1:lr(r,t,s):(l=!t.$stable,or(t,r)),a=t}else t&&(rr(e,t),a={default:1});if(l)for(const u in r)!Sn(u)&&a[u]==null&&delete r[u]},je=sa;function Ql(e){return Xl(e)}function Xl(e,t){const s=Os();s.__VUE__=!0;const{insert:n,remove:r,patchProp:l,createElement:a,createText:u,createComment:d,setText:x,setElementText:f,parentNode:m,nextSibling:v,setScopeId:k=nt,insertStaticContent:F}=e,$=(i,c,_,T=null,p=null,P=null,B=void 0,O=null,L=!!c.dynamicChildren)=>{if(i===c)return;i&&!Jt(i,c)&&(T=yt(i),we(i,p,P,!0),i=null),c.patchFlag===-2&&(L=!1,c.dynamicChildren=null);const{type:A,ref:Q,shapeFlag:H}=c;switch(A){case Us:N(i,c,_,T);break;case kt:C(i,c,_,T);break;case ys:i==null&&E(c,_,T,B);break;case se:M(i,c,_,T,p,P,B,O,L);break;default:H&1?U(i,c,_,T,p,P,B,O,L):H&6?J(i,c,_,T,p,P,B,O,L):(H&64||H&128)&&A.process(i,c,_,T,p,P,B,O,L,Ke)}Q!=null&&p?es(Q,i&&i.ref,P,c||i,!c):Q==null&&i&&i.ref!=null&&es(i.ref,null,P,i,!0)},N=(i,c,_,T)=>{if(i==null)n(c.el=u(c.children),_,T);else{const p=c.el=i.el;c.children!==i.children&&x(p,c.children)}},C=(i,c,_,T)=>{i==null?n(c.el=d(c.children||""),_,T):c.el=i.el},E=(i,c,_,T)=>{[i.el,i.anchor]=F(i.children,c,_,T,i.el,i.anchor)},R=({el:i,anchor:c},_,T)=>{let p;for(;i&&i!==c;)p=v(i),n(i,_,T),i=p;n(c,_,T)},I=({el:i,anchor:c})=>{let _;for(;i&&i!==c;)_=v(i),r(i),i=_;r(c)},U=(i,c,_,T,p,P,B,O,L)=>{if(c.type==="svg"?B="svg":c.type==="math"&&(B="mathml"),i==null)y(c,_,T,p,P,B,O,L);else{const A=i.el&&i.el._isVueCE?i.el:null;try{A&&A._beginPatch(),G(i,c,p,P,B,O,L)}finally{A&&A._endPatch()}}},y=(i,c,_,T,p,P,B,O)=>{let L,A;const{props:Q,shapeFlag:H,transition:Y,dirs:te}=i;if(L=i.el=a(i.type,P,Q&&Q.is,Q),H&8?f(L,i.children):H&16&&j(i.children,L,null,T,p,Js(i,P),B,O),te&&$t(i,null,T,"created"),S(L,i,i.scopeId,B,T),Q){for(const xe in Q)xe!=="value"&&!Zt(xe)&&l(L,xe,null,Q[xe],P,T);"value"in Q&&l(L,"value",null,Q.value,P),(A=Q.onVnodeBeforeMount)&&Ze(A,T,i)}te&&$t(i,null,T,"beforeMount");const le=ea(p,Y);le&&Y.beforeEnter(L),n(L,c,_),((A=Q&&Q.onVnodeMounted)||le||te)&&je(()=>{try{A&&Ze(A,T,i),le&&Y.enter(L),te&&$t(i,null,T,"mounted")}finally{}},p)},S=(i,c,_,T,p)=>{if(_&&k(i,_),T)for(let P=0;P<T.length;P++)k(i,T[P]);if(p){let P=p.subTree;if(c===P||ur(P.type)&&(P.ssContent===c||P.ssFallback===c)){const B=p.vnode;S(i,B,B.scopeId,B.slotScopeIds,p.parent)}}},j=(i,c,_,T,p,P,B,O,L=0)=>{for(let A=L;A<i.length;A++){const Q=i[A]=O?dt(i[A]):tt(i[A]);$(null,Q,c,_,T,p,P,B,O)}},G=(i,c,_,T,p,P,B)=>{const O=c.el=i.el;let{patchFlag:L,dynamicChildren:A,dirs:Q}=c;L|=i.patchFlag&16;const H=i.props||ge,Y=c.props||ge;let te;if(_&&Ct(_,!1),(te=Y.onVnodeBeforeUpdate)&&Ze(te,_,c,i),Q&&$t(c,i,_,"beforeUpdate"),_&&Ct(_,!0),(H.innerHTML&&Y.innerHTML==null||H.textContent&&Y.textContent==null)&&f(O,""),A?ae(i.dynamicChildren,A,O,_,T,Js(c,p),P):B||ie(i,c,O,null,_,T,Js(c,p),P,!1),L>0){if(L&16)z(O,H,Y,_,p);else if(L&2&&H.class!==Y.class&&l(O,"class",null,Y.class,p),L&4&&l(O,"style",H.style,Y.style,p),L&8){const le=c.dynamicProps;for(let xe=0;xe<le.length;xe++){const ye=le[xe],$e=H[ye],Te=Y[ye];(Te!==$e||ye==="value")&&l(O,ye,$e,Te,p,_)}}L&1&&i.children!==c.children&&f(O,c.children)}else!B&&A==null&&z(O,H,Y,_,p);((te=Y.onVnodeUpdated)||Q)&&je(()=>{te&&Ze(te,_,c,i),Q&&$t(c,i,_,"updated")},T)},ae=(i,c,_,T,p,P,B)=>{for(let O=0;O<c.length;O++){const L=i[O],A=c[O],Q=L.el&&(L.type===se||!Jt(L,A)||L.shapeFlag&198)?m(L.el):_;$(L,A,Q,null,T,p,P,B,!0)}},z=(i,c,_,T,p)=>{if(c!==_){if(c!==ge)for(const P in c)!Zt(P)&&!(P in _)&&l(i,P,c[P],null,p,T);for(const P in _){if(Zt(P))continue;const B=_[P],O=c[P];B!==O&&P!=="value"&&l(i,P,O,B,p,T)}"value"in _&&l(i,"value",c.value,_.value,p)}},M=(i,c,_,T,p,P,B,O,L)=>{const A=c.el=i?i.el:u(""),Q=c.anchor=i?i.anchor:u("");let{patchFlag:H,dynamicChildren:Y,slotScopeIds:te}=c;te&&(O=O?O.concat(te):te),i==null?(n(A,_,T),n(Q,_,T),j(c.children||[],_,Q,p,P,B,O,L)):H>0&&H&64&&Y&&i.dynamicChildren&&i.dynamicChildren.length===Y.length?(ae(i.dynamicChildren,Y,_,p,P,B,O),(c.key!=null||p&&c===p.subTree)&&ar(i,c,!0)):ie(i,c,_,Q,p,P,B,O,L)},J=(i,c,_,T,p,P,B,O,L)=>{c.slotScopeIds=O,i==null?c.shapeFlag&512?p.ctx.activate(c,_,T,B,L):re(c,_,T,p,P,B,L):_e(i,c,L)},re=(i,c,_,T,p,P,B)=>{const O=i.component=ca(i,T,p);if(Wo(i)&&(O.ctx.renderer=Ke),da(O,!1,B),O.asyncDep){if(p&&p.registerDep(O,ke,B),!i.el){const L=O.subTree=ot(kt);C(null,L,c,_),i.placeholder=L.el}}else ke(O,i,c,_,p,P,B)},_e=(i,c,_)=>{const T=c.component=i.component;if(Kl(i,c,_))if(T.asyncDep&&!T.asyncResolved){me(T,c,_);return}else T.next=c,T.update();else c.el=i.el,T.vnode=c},ke=(i,c,_,T,p,P,B)=>{const O=()=>{if(i.isMounted){let{next:H,bu:Y,u:te,parent:le,vnode:xe}=i;{const Ge=ir(i);if(Ge){H&&(H.el=xe.el,me(i,H,B)),Ge.asyncDep.then(()=>{je(()=>{i.isUnmounted||A()},p)});return}}let ye=H,$e;Ct(i,!1),H?(H.el=xe.el,me(i,H,B)):H=xe,Y&&hs(Y),($e=H.props&&H.props.onVnodeBeforeUpdate)&&Ze($e,le,H,xe),Ct(i,!0);const Te=Hn(i),qe=i.subTree;i.subTree=Te,$(qe,Te,m(qe.el),yt(qe),i,p,P),H.el=Te.el,ye===null&&Wl(i,Te.el),te&&je(te,p),($e=H.props&&H.props.onVnodeUpdated)&&je(()=>Ze($e,le,H,xe),p)}else{let H;const{el:Y,props:te}=c,{bm:le,m:xe,parent:ye,root:$e,type:Te}=i,qe=ts(c);Ct(i,!1),le&&hs(le),!qe&&(H=te&&te.onVnodeBeforeMount)&&Ze(H,ye,c),Ct(i,!0);{$e.ce&&$e.ce._hasShadowRoot()&&$e.ce._injectChildStyle(Te,i.parent?i.parent.type:void 0);const Ge=i.subTree=Hn(i);$(null,Ge,_,T,i,p,P),c.el=Ge.el}if(xe&&je(xe,p),!qe&&(H=te&&te.onVnodeMounted)){const Ge=c;je(()=>Ze(H,ye,Ge),p)}(c.shapeFlag&256||ye&&ts(ye.vnode)&&ye.vnode.shapeFlag&256)&&i.a&&je(i.a,p),i.isMounted=!0,c=_=T=null}};i.scope.on();const L=i.effect=new _o(O);i.scope.off();const A=i.update=L.run.bind(L),Q=i.job=L.runIfDirty.bind(L);Q.i=i,Q.id=i.uid,L.scheduler=()=>_n(Q),Ct(i,!0),A()},me=(i,c,_)=>{c.component=i;const T=i.vnode.props;i.vnode=c,i.next=null,Jl(i,c.props,T,_),Zl(i,c.children,_),xt(),Rn(i),vt()},ie=(i,c,_,T,p,P,B,O,L=!1)=>{const A=i&&i.children,Q=i?i.shapeFlag:0,H=c.children,{patchFlag:Y,shapeFlag:te}=c;if(Y>0){if(Y&128){D(A,H,_,T,p,P,B,O,L);return}else if(Y&256){W(A,H,_,T,p,P,B,O,L);return}}te&8?(Q&16&&Je(A,p,P),H!==A&&f(_,H)):Q&16?te&16?D(A,H,_,T,p,P,B,O,L):Je(A,p,P,!0):(Q&8&&f(_,""),te&16&&j(H,_,T,p,P,B,O,L))},W=(i,c,_,T,p,P,B,O,L)=>{i=i||Dt,c=c||Dt;const A=i.length,Q=c.length,H=Math.min(A,Q);let Y;for(Y=0;Y<H;Y++){const te=c[Y]=L?dt(c[Y]):tt(c[Y]);$(i[Y],te,_,null,p,P,B,O,L)}A>Q?Je(i,p,P,!0,!1,H):j(c,_,T,p,P,B,O,L,H)},D=(i,c,_,T,p,P,B,O,L)=>{let A=0;const Q=c.length;let H=i.length-1,Y=Q-1;for(;A<=H&&A<=Y;){const te=i[A],le=c[A]=L?dt(c[A]):tt(c[A]);if(Jt(te,le))$(te,le,_,null,p,P,B,O,L);else break;A++}for(;A<=H&&A<=Y;){const te=i[H],le=c[Y]=L?dt(c[Y]):tt(c[Y]);if(Jt(te,le))$(te,le,_,null,p,P,B,O,L);else break;H--,Y--}if(A>H){if(A<=Y){const te=Y+1,le=te<Q?c[te].el:T;for(;A<=Y;)$(null,c[A]=L?dt(c[A]):tt(c[A]),_,le,p,P,B,O,L),A++}}else if(A>Y)for(;A<=H;)we(i[A],p,P,!0),A++;else{const te=A,le=A,xe=new Map;for(A=le;A<=Y;A++){const Ue=c[A]=L?dt(c[A]):tt(c[A]);Ue.key!=null&&xe.set(Ue.key,A)}let ye,$e=0;const Te=Y-le+1;let qe=!1,Ge=0;const Wt=new Array(Te);for(A=0;A<Te;A++)Wt[A]=0;for(A=te;A<=H;A++){const Ue=i[A];if($e>=Te){we(Ue,p,P,!0);continue}let Ye;if(Ue.key!=null)Ye=xe.get(Ue.key);else for(ye=le;ye<=Y;ye++)if(Wt[ye-le]===0&&Jt(Ue,c[ye])){Ye=ye;break}Ye===void 0?we(Ue,p,P,!0):(Wt[Ye-le]=A+1,Ye>=Ge?Ge=Ye:qe=!0,$(Ue,c[Ye],_,null,p,P,B,O,L),$e++)}const En=qe?ta(Wt):Dt;for(ye=En.length-1,A=Te-1;A>=0;A--){const Ue=le+A,Ye=c[Ue],Pn=c[Ue+1],An=Ue+1<Q?Pn.el||cr(Pn):T;Wt[A]===0?$(null,Ye,_,An,p,P,B,O,L):qe&&(ye<0||A!==En[ye]?Ce(Ye,_,An,2):ye--)}}},Ce=(i,c,_,T,p=null)=>{const{el:P,type:B,transition:O,children:L,shapeFlag:A}=i;if(A&6){Ce(i.component.subTree,c,_,T);return}if(A&128){i.suspense.move(c,_,T);return}if(A&64){B.move(i,c,_,Ke);return}if(B===se){n(P,c,_);for(let H=0;H<L.length;H++)Ce(L[H],c,_,T);n(i.anchor,c,_);return}if(B===ys){R(i,c,_);return}if(T!==2&&A&1&&O)if(T===0)O.beforeEnter(P),n(P,c,_),je(()=>O.enter(P),p);else{const{leave:H,delayLeave:Y,afterLeave:te}=O,le=()=>{i.ctx.isUnmounted?r(P):n(P,c,_)},xe=()=>{P._isLeaving&&P[vl](!0),H(P,()=>{le(),te&&te()})};Y?Y(P,le,xe):xe()}else n(P,c,_)},we=(i,c,_,T=!1,p=!1)=>{const{type:P,props:B,ref:O,children:L,dynamicChildren:A,shapeFlag:Q,patchFlag:H,dirs:Y,cacheIndex:te,memo:le}=i;if(H===-2&&(p=!1),O!=null&&(xt(),es(O,null,_,i,!0),vt()),te!=null&&(c.renderCache[te]=void 0),Q&256){c.ctx.deactivate(i);return}const xe=Q&1&&Y,ye=!ts(i);let $e;if(ye&&($e=B&&B.onVnodeBeforeUnmount)&&Ze($e,c,i),Q&6)It(i.component,_,T);else{if(Q&128){i.suspense.unmount(_,T);return}xe&&$t(i,null,c,"beforeUnmount"),Q&64?i.type.remove(i,c,_,Ke,T):A&&!A.hasOnce&&(P!==se||H>0&&H&64)?Je(A,c,_,!1,!0):(P===se&&H&384||!p&&Q&16)&&Je(L,c,_),T&&fe(i)}const Te=le!=null&&te==null;(ye&&($e=B&&B.onVnodeUnmounted)||xe||Te)&&je(()=>{$e&&Ze($e,c,i),xe&&$t(i,null,c,"unmounted"),Te&&(i.el=null)},_)},fe=i=>{const{type:c,el:_,anchor:T,transition:p}=i;if(c===se){at(_,T);return}if(c===ys){I(i);return}const P=()=>{r(_),p&&!p.persisted&&p.afterLeave&&p.afterLeave()};if(i.shapeFlag&1&&p&&!p.persisted){const{leave:B,delayLeave:O}=p,L=()=>B(_,P);O?O(i.el,P,L):L()}else P()},at=(i,c)=>{let _;for(;i!==c;)_=v(i),r(i),i=_;r(c)},It=(i,c,_)=>{const{bum:T,scope:p,job:P,subTree:B,um:O,m:L,a:A}=i;zn(L),zn(A),T&&hs(T),p.stop(),P&&(P.flags|=8,we(B,i,c,_)),O&&je(O,c),je(()=>{i.isUnmounted=!0},c)},Je=(i,c,_,T=!1,p=!1,P=0)=>{for(let B=P;B<i.length;B++)we(i[B],c,_,T,p)},yt=i=>{if(i.shapeFlag&6)return yt(i.component.subTree);if(i.shapeFlag&128)return i.suspense.next();const c=v(i.anchor||i.el),_=c&&c[ml];return _?v(_):c};let Kt=!1;const bt=(i,c,_)=>{let T;i==null?c._vnode&&(we(c._vnode,null,null,!0),T=c._vnode.component):$(c._vnode||null,i,c,null,null,null,_),c._vnode=i,Kt||(Kt=!0,Rn(T),No(),Kt=!1)},Ke={p:$,um:we,m:Ce,r:fe,mt:re,mc:j,pc:ie,pbc:ae,n:yt,o:e};return{render:bt,hydrate:void 0,createApp:Ul(bt)}}function Js({type:e,props:t},s){return s==="svg"&&e==="foreignObject"||s==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:s}function Ct({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function ea(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ar(e,t,s=!1){const n=e.children,r=t.children;if(ee(n)&&ee(r))for(let l=0;l<n.length;l++){const a=n[l];let u=r[l];u.shapeFlag&1&&!u.dynamicChildren&&((u.patchFlag<=0||u.patchFlag===32)&&(u=r[l]=dt(r[l]),u.el=a.el),!s&&u.patchFlag!==-2&&ar(a,u)),u.type===Us&&(u.patchFlag===-1&&(u=r[l]=dt(u)),u.el=a.el),u.type===kt&&!u.el&&(u.el=a.el)}}function ta(e){const t=e.slice(),s=[0];let n,r,l,a,u;const d=e.length;for(n=0;n<d;n++){const x=e[n];if(x!==0){if(r=s[s.length-1],e[r]<x){t[n]=r,s.push(n);continue}for(l=0,a=s.length-1;l<a;)u=l+a>>1,e[s[u]]<x?l=u+1:a=u;x<e[s[l]]&&(l>0&&(t[n]=s[l-1]),s[l]=n)}}for(l=s.length,a=s[l-1];l-- >0;)s[l]=a,a=t[a];return s}function ir(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ir(t)}function zn(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function cr(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?cr(t.subTree):null}const ur=e=>e.__isSuspense;function sa(e,t){t&&t.pendingBranch?ee(e)?t.effects.push(...e):t.effects.push(e):il(e)}const se=Symbol.for("v-fgt"),Us=Symbol.for("v-txt"),kt=Symbol.for("v-cmt"),ys=Symbol.for("v-stc"),ns=[];let Ve=null;function h(e=!1){ns.push(Ve=e?null:[])}function na(){ns.pop(),Ve=ns[ns.length-1]||null}let as=1;function Jn(e,t=!1){as+=e,e<0&&Ve&&t&&(Ve.hasOnce=!0)}function dr(e){return e.dynamicChildren=as>0?Ve||Dt:null,na(),as>0&&Ve&&Ve.push(e),e}function g(e,t,s,n,r,l){return dr(o(e,t,s,n,r,l,!0))}function fr(e,t,s,n,r){return dr(ot(e,t,s,n,r,!0))}function pr(e){return e?e.__v_isVNode===!0:!1}function Jt(e,t){return e.type===t.type&&e.key===t.key}const mr=({key:e})=>e??null,bs=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?Se(e)||Me(e)||oe(e)?{i:Ne,r:e,k:t,f:!!s}:e:null);function o(e,t=null,s=null,n=0,r=null,l=e===se?0:1,a=!1,u=!1){const d={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&mr(t),ref:t&&bs(t),scopeId:Bo,slotScopeIds:null,children:s,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:l,patchFlag:n,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Ne};return u?(Cn(d,s),l&128&&e.normalize(d)):s&&(d.shapeFlag|=Se(s)?8:16),as>0&&!a&&Ve&&(d.patchFlag>0||l&6)&&d.patchFlag!==32&&Ve.push(d),d}const ot=oa;function oa(e,t=null,s=null,n=0,r=null,l=!1){if((!e||e===Jo)&&(e=kt),pr(e)){const u=Vt(e,t,!0);return s&&Cn(u,s),as>0&&!l&&Ve&&(u.shapeFlag&6?Ve[Ve.indexOf(e)]=u:Ve.push(u)),u.patchFlag=-2,u}if(va(e)&&(e=e.__vccOpts),t){t=ra(t);let{class:u,style:d}=t;u&&!Se(u)&&(t.class=q(u)),pe(d)&&(bn(d)&&!ee(d)&&(d=Pe({},d)),t.style=Ut(d))}const a=Se(e)?1:ur(e)?128:xl(e)?64:pe(e)?4:oe(e)?2:0;return o(e,t,s,n,r,a,l,!0)}function ra(e){return e?bn(e)||tr(e)?Pe({},e):e:null}function Vt(e,t,s=!1,n=!1){const{props:r,ref:l,patchFlag:a,children:u,transition:d}=e,x=t?la(r||{},t):r,f={__v_isVNode:!0,__v_skip:!0,type:e.type,props:x,key:x&&mr(x),ref:t&&t.ref?s&&l?ee(l)?l.concat(bs(t)):[l,bs(t)]:bs(t):l,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:u,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==se?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:d,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Vt(e.ssContent),ssFallback:e.ssFallback&&Vt(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return d&&n&&wn(f,d.clone(f)),f}function X(e=" ",t=0){return ot(Us,null,e,t)}function ut(e,t){const s=ot(ys,null,e);return s.staticCount=t,s}function K(e="",t=!1){return t?(h(),fr(kt,null,e)):ot(kt,null,e)}function tt(e){return e==null||typeof e=="boolean"?ot(kt):ee(e)?ot(se,null,e.slice()):pr(e)?dt(e):ot(Us,null,String(e))}function dt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Vt(e)}function Cn(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(ee(t))s=16;else if(typeof t=="object")if(n&65){const r=t.default;r&&(r._c&&(r._d=!1),Cn(e,r()),r._c&&(r._d=!0));return}else{s=32;const r=t._;!r&&!tr(t)?t._ctx=Ne:r===3&&Ne&&(Ne.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else oe(t)?(t={default:t,_ctx:Ne},s=32):(t=String(t),n&64?(s=16,t=[X(t)]):s=8);e.children=t,e.shapeFlag|=s}function la(...e){const t={};for(let s=0;s<e.length;s++){const n=e[s];for(const r in n)if(r==="class")t.class!==n.class&&(t.class=q([t.class,n.class]));else if(r==="style")t.style=Ut([t.style,n.style]);else if(Es(r)){const l=t[r],a=n[r];a&&l!==a&&!(ee(l)&&l.includes(a))?t[r]=l?[].concat(l,a):a:a==null&&l==null&&!Ps(r)&&(t[r]=a)}else r!==""&&(t[r]=n[r])}return t}function Ze(e,t,s,n=null){lt(e,t,7,[s,n])}const aa=Yo();let ia=0;function ca(e,t,s){const n=e.type,r=(t?t.appContext:e.appContext)||aa,l={uid:ia++,vnode:e,type:n,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ar(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:nr(n,r),emitsOptions:Zo(n,r),emit:null,emitted:null,propsDefaults:ge,inheritAttrs:n.inheritAttrs,ctx:ge,data:ge,props:ge,attrs:ge,slots:ge,refs:ge,setupState:ge,setupContext:null,suspense:s,suspenseId:s?s.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 l.ctx={_:l},l.root=t?t.root:l,l.emit=Vl.bind(null,l),e.ce&&e.ce(l),l}let Ie=null;const ua=()=>Ie||Ne;let Ts,rn;{const e=Os(),t=(s,n)=>{let r;return(r=e[s])||(r=e[s]=[]),r.push(n),l=>{r.length>1?r.forEach(a=>a(l)):r[0](l)}};Ts=t("__VUE_INSTANCE_SETTERS__",s=>Ie=s),rn=t("__VUE_SSR_SETTERS__",s=>is=s)}const fs=e=>{const t=Ie;return Ts(e),e.scope.on(),()=>{e.scope.off(),Ts(t)}},qn=()=>{Ie&&Ie.scope.off(),Ts(null)};function xr(e){return e.vnode.shapeFlag&4}let is=!1;function da(e,t=!1,s=!1){t&&rn(t);const{props:n,children:r}=e.vnode,l=xr(e);zl(e,n,l,t),Yl(e,r,s||t);const a=l?fa(e,t):void 0;return t&&rn(!1),a}function fa(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Il);const{setup:n}=s;if(n){xt();const r=e.setupContext=n.length>1?ma(e):null,l=fs(e),a=ds(n,e,0,[e.props,r]),u=mo(a);if(vt(),l(),(u||e.sp)&&!ts(e)&&Ko(e),u){if(a.then(qn,qn),t)return a.then(d=>{Gn(e,d)}).catch(d=>{Rs(d,e,0)});e.asyncDep=a}else Gn(e,a)}else vr(e)}function Gn(e,t,s){oe(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:pe(t)&&(e.setupState=Ro(t)),vr(e)}function vr(e,t,s){const n=e.type;e.render||(e.render=n.render||nt);{const r=fs(e);xt();try{Ml(e)}finally{vt(),r()}}}const pa={get(e,t){return Ae(e,"get",""),e[t]}};function ma(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,pa),slots:e.slots,emit:e.emit,expose:t}}function Ns(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Ro(Zr(e.exposed)),{get(t,s){if(s in t)return t[s];if(s in ss)return ss[s](e)},has(t,s){return s in t||s in ss}})):e.proxy}function xa(e,t=!0){return oe(e)?e.displayName||e.name:e.name||t&&e.__name}function va(e){return oe(e)&&"__vccOpts"in e}const Ee=(e,t)=>nl(e,t,is),ha="3.5.31";/**
|
|
61
61
|
* @vue/runtime-dom v3.5.31
|
|
62
62
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
63
63
|
* @license MIT
|
|
64
|
-
**/let ln;const Gn=typeof window<"u"&&window.trustedTypes;if(Gn)try{ln=Gn.createPolicy("vue",{createHTML:e=>e})}catch{}const gr=ln?e=>ln.createHTML(e):e=>e,vi="http://www.w3.org/2000/svg",yi="http://www.w3.org/1998/Math/MathML",dt=typeof document<"u"?document:null,Yn=dt&&dt.createElement("template"),bi={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const o=t==="svg"?dt.createElementNS(vi,e):t==="mathml"?dt.createElementNS(yi,e):s?dt.createElement(e,{is:s}):dt.createElement(e);return e==="select"&&n&&n.multiple!=null&&o.setAttribute("multiple",n.multiple),o},createText:e=>dt.createTextNode(e),createComment:e=>dt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>dt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,o,l){const a=s?s.previousSibling:t.lastChild;if(o&&(o===l||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),s),!(o===l||!(o=o.nextSibling)););else{Yn.innerHTML=gr(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const c=Yn.content;if(n==="svg"||n==="mathml"){const u=c.firstChild;for(;u.firstChild;)c.appendChild(u.firstChild);c.removeChild(u)}t.insertBefore(c,s)}return[a?a.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},_i=Symbol("_vtc");function wi(e,t,s){const n=e[_i];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Zn=Symbol("_vod"),ki=Symbol("_vsh"),Si=Symbol(""),$i=/(?:^|;)\s*display\s*:/;function Ci(e,t,s){const n=e.style,o=$e(s);let l=!1;if(s&&!o){if(t)if($e(t))for(const a of t.split(";")){const c=a.slice(0,a.indexOf(":")).trim();s[c]==null&&_s(n,c,"")}else for(const a in t)s[a]==null&&_s(n,a,"");for(const a in s)a==="display"&&(l=!0),_s(n,a,s[a])}else if(o){if(t!==s){const a=n[Si];a&&(s+=";"+a),n.cssText=s,l=$i.test(s)}}else t&&e.removeAttribute("style");Zn in e&&(e[Zn]=l?n.display:"",e[ki]&&(n.display="none"))}const Qn=/\s*!important$/;function _s(e,t,s){if(Q(s))s.forEach(n=>_s(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=Ti(e,t);Qn.test(s)?e.setProperty(St(n),s.replace(Qn,""),"important"):e[n]=s}}const Xn=["Webkit","Moz","ms"],qs={};function Ti(e,t){const s=qs[t];if(s)return s;let n=je(t);if(n!=="filter"&&n in e)return qs[t]=n;n=Ps(n);for(let o=0;o<Xn.length;o++){const l=Xn[o]+n;if(l in e)return qs[t]=l}return t}const eo="http://www.w3.org/1999/xlink";function to(e,t,s,n,o,l=Ar(t)){n&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(eo,t.slice(6,t.length)):e.setAttributeNS(eo,t,s):s==null||l&&!vo(s)?e.removeAttribute(t):e.setAttribute(t,l?"":rt(s)?String(s):s)}function so(e,t,s,n,o){if(t==="innerHTML"||t==="textContent"){s!=null&&(e[t]=t==="innerHTML"?gr(s):s);return}const l=e.tagName;if(t==="value"&&l!=="PROGRESS"&&!l.includes("-")){const c=l==="OPTION"?e.getAttribute("value")||"":e.value,u=s==null?e.type==="checkbox"?"on":"":String(s);(c!==u||!("_value"in e))&&(e.value=u),s==null&&e.removeAttribute(t),e._value=s;return}let a=!1;if(s===""||s==null){const c=typeof e[t];c==="boolean"?s=vo(s):s==null&&c==="string"?(s="",a=!0):c==="number"&&(s=0,a=!0)}try{e[t]=s}catch{}a&&e.removeAttribute(o||t)}function wt(e,t,s,n){e.addEventListener(t,s,n)}function Ai(e,t,s,n){e.removeEventListener(t,s,n)}const no=Symbol("_vei");function Ei(e,t,s,n,o=null){const l=e[no]||(e[no]={}),a=l[t];if(n&&a)a.value=n;else{const[c,u]=Ii(t);if(n){const h=l[t]=Oi(n,o);wt(e,c,h,u)}else a&&(Ai(e,c,a,u),l[t]=void 0)}}const oo=/(?:Once|Passive|Capture)$/;function Ii(e){let t;if(oo.test(e)){t={};let n;for(;n=e.match(oo);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):St(e.slice(2)),t]}let Gs=0;const Pi=Promise.resolve(),Mi=()=>Gs||(Pi.then(()=>Gs=0),Gs=Date.now());function Oi(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;lt(Di(n,s.value),t,5,[n])};return s.value=e,s.attached=Mi(),s}function Di(e,t){if(Q(t)){const s=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{s.call(e),e._stopped=!0},t.map(n=>o=>!o._stopped&&n&&n(o))}else return t}const ro=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ri=(e,t,s,n,o,l)=>{const a=o==="svg";t==="class"?wi(e,n,a):t==="style"?Ci(e,s,n):As(t)?Es(t)||Ei(e,t,s,n,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ji(e,t,n,a))?(so(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&to(e,t,n,a,l,t!=="value")):e._isVueCE&&(Ni(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!$e(n)))?so(e,je(t),n,l,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),to(e,t,n,a))};function ji(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&ro(t)&&te(s));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 o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return ro(t)&&$e(s)?!1:t in e}function Ni(e,t){const s=e._def.props;if(!s)return!1;const n=je(t);return Array.isArray(s)?s.some(o=>je(o)===n):Object.keys(s).some(o=>je(o)===n)}const Ft=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Q(t)?s=>gs(t,s):t};function Li(e){e.target.composing=!0}function lo(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const ht=Symbol("_assign");function io(e,t,s){return t&&(e=e.trim()),s&&(e=Ms(e)),e}const re={created(e,{modifiers:{lazy:t,trim:s,number:n}},o){e[ht]=Ft(o);const l=n||o.props&&o.props.type==="number";wt(e,t?"change":"input",a=>{a.target.composing||e[ht](io(e.value,s,l))}),(s||l)&&wt(e,"change",()=>{e.value=io(e.value,s,l)}),t||(wt(e,"compositionstart",Li),wt(e,"compositionend",lo),wt(e,"change",lo))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:o,number:l}},a){if(e[ht]=Ft(a),e.composing)return;const c=(l||e.type==="number")&&!/^0\d/.test(e.value)?Ms(e.value):e.value,u=t??"";if(c===u)return;const h=e.getRootNode();(h instanceof Document||h instanceof ShadowRoot)&&h.activeElement===e&&e.type!=="range"&&(n&&t===s||o&&e.value.trim()===u)||(e.value=u)}},ao={deep:!0,created(e,t,s){e[ht]=Ft(s),wt(e,"change",()=>{const n=e._modelValue,o=cs(e),l=e.checked,a=e[ht];if(Q(n)){const c=dn(n,o),u=c!==-1;if(l&&!u)a(n.concat(o));else if(!l&&u){const h=[...n];h.splice(c,1),a(h)}}else if(Ht(n)){const c=new Set(n);l?c.add(o):c.delete(o),a(c)}else a(vr(e,l))})},mounted:co,beforeUpdate(e,t,s){e[ht]=Ft(s),co(e,t,s)}};function co(e,{value:t,oldValue:s},n){e._modelValue=t;let o;if(Q(t))o=dn(t,n.props.value)>-1;else if(Ht(t))o=t.has(n.props.value);else{if(t===s)return;o=Kt(t,vr(e,!0))}e.checked!==o&&(e.checked=o)}const Bt={deep:!0,created(e,{value:t,modifiers:{number:s}},n){const o=Ht(t);wt(e,"change",()=>{const l=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>s?Ms(cs(a)):cs(a));e[ht](e.multiple?o?new Set(l):l:l[0]),e._assigning=!0,No(()=>{e._assigning=!1})}),e[ht]=Ft(n)},mounted(e,{value:t}){uo(e,t)},beforeUpdate(e,t,s){e[ht]=Ft(s)},updated(e,{value:t}){e._assigning||uo(e,t)}};function uo(e,t){const s=e.multiple,n=Q(t);if(!(s&&!n&&!Ht(t))){for(let o=0,l=e.options.length;o<l;o++){const a=e.options[o],c=cs(a);if(s)if(n){const u=typeof c;u==="string"||u==="number"?a.selected=t.some(h=>String(h)===String(c)):a.selected=dn(t,c)>-1}else a.selected=t.has(c);else if(Kt(cs(a),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function cs(e){return"_value"in e?e._value:e.value}function vr(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const Ui={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Qe=(e,t)=>{const s=e._withKeys||(e._withKeys={}),n=t.join(".");return s[n]||(s[n]=(o=>{if(!("key"in o))return;const l=St(o.key);if(t.some(a=>a===l||Ui[a]===l))return e(o)}))},Vi=Ee({patchProp:Ri},bi);let fo;function Fi(){return fo||(fo=Ql(Vi))}const Bi=((...e)=>{const t=Fi().createApp(...e),{mount:s}=t;return t.mount=n=>{const o=Ki(n);if(!o)return;const l=t._component;!te(l)&&!l.render&&!l.template&&(l.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const a=s(o,!1,Hi(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),a},t});function Hi(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ki(e){return $e(e)?document.querySelector(e):e}let Cn="";function qt(e){Cn=e}function ye(){return Cn}async function be(e,t){const s=await fetch(e,{...t,headers:{Authorization:`Bearer ${Cn}`,"Content-Type":"application/json",...(t==null?void 0:t.headers)??{}}});if(!s.ok){const n=new Error(s.statusText);throw n.status=s.status,n}return s.json()}const Wi={class:"animate-fade-in"},zi={key:0,class:"text-center py-12 text-textSecondary"},Ji={key:1,class:"text-center text-textSecondary py-12"},qi={key:2,class:"space-y-3"},Gi={class:"flex items-center justify-between"},Yi={class:"flex items-center gap-3"},Zi={class:"font-medium"},Qi={class:"text-accentLight"},Xi={class:"text-textSecondary text-xs"},ea={key:2,class:"text-muted italic"},ta={class:"text-xs text-textSecondary font-mono"},sa={class:"text-right"},na={class:"flex items-center gap-2 justify-end"},oa={class:"text-xs text-textSecondary"},ra=it({__name:"SessionsTab",props:{status:{}},setup(e){const t=e,s=$([]),n=$(!0);async function o(){n.value=!0;try{const h=await be("/api/status");s.value=(h.sessions||[]).slice().sort((d,m)=>d.status==="active"&&m.status!=="active"?-1:d.status!=="active"&&m.status==="active"?1:m.lastActivity-d.lastActivity)}finally{n.value=!1}}const l=Re(()=>{var d;return(((d=t.status)==null?void 0:d.sessions)??s.value).slice().sort((m,b)=>m.status==="active"&&b.status!=="active"?-1:m.status!=="active"&&b.status==="active"?1:b.lastActivity-m.lastActivity)});function a(h){const d=Math.floor((Date.now()-h.lastActivity)/6e4);return h.status==="disconnected"?{label:`Disconnected${d>0?` — ${d}m ago`:""}`,color:"text-muted"}:d<5?{label:"Active",color:"text-success"}:d<30?{label:`Idle ${d}m`,color:"text-warn"}:{label:`Dormant ${d}m`,color:"text-danger"}}function c(h){if(!h.lastWaitCallAt)return"";const d=Math.floor((Date.now()-h.lastWaitCallAt)/6e4);return d<5?`Polling — ${d===0?"just now":d+"m ago"}`:`Last poll — ${d}m ago`}function u(h){return h.lastWaitCallAt?Math.floor((Date.now()-h.lastWaitCallAt)/6e4)<5?"text-success":"text-warn":""}return We(o),(h,d)=>(x(),g("div",Wi,[n.value&&l.value.length===0?(x(),g("div",zi,"Loading sessions...")):l.value.length===0?(x(),g("div",Ji,"No sessions")):(x(),g("div",qi,[(x(!0),g(ne,null,ve(l.value,m=>(x(),g("div",{key:m.mcpSessionId,class:G(["glass rounded-xl p-4 animate-slide-up",m.status==="disconnected"?"opacity-60":""])},[r("div",Gi,[r("div",Yi,[r("span",{class:G(["w-2.5 h-2.5 rounded-full",m.status==="disconnected"?"bg-muted":Math.floor((Date.now()-m.lastActivity)/6e4)<5?"bg-success":Math.floor((Date.now()-m.lastActivity)/6e4)<30?"bg-warn":"bg-danger"])},null,2),r("div",null,[r("div",Zi,[m.topicName?(x(),g(ne,{key:0},[r("span",Qi,v(m.topicName),1),r("span",Xi," (thread "+v(m.threadId)+")",1)],64)):m.threadId!=null?(x(),g(ne,{key:1},[we("Thread "+v(m.threadId),1)],64)):(x(),g("span",ea,"Awaiting start_session…"))]),r("div",ta,v(m.mcpSessionId.slice(0,12))+"...",1)])]),r("div",sa,[r("div",na,[r("span",{class:G(["text-sm font-medium",a(m).color])},v(a(m).label),3),c(m)?(x(),g("span",{key:0,class:G(["text-xs ml-2",u(m)])},v(c(m)),3)):W("",!0)]),r("div",oa,v(m.transportType),1)])])],2))),128))]))]))}}),la={class:"animate-fade-in"},ia={class:"flex flex-wrap items-center gap-3 mb-4"},aa={key:0,class:"text-center py-12 text-textSecondary"},ca={key:1,class:"text-center py-12 text-textSecondary"},ua={key:2,class:"space-y-2"},da={class:"flex items-start justify-between gap-3"},fa={class:"flex-1 min-w-0"},pa={class:"flex items-center gap-2 mb-1"},ma={key:0,class:"type-badge",style:{background:"rgba(239,68,68,0.15)",color:"#f87171"}},ha={key:1,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},xa={class:"text-xs text-textSecondary"},ga={class:"text-sm text-textPrimary leading-relaxed"},va={class:"flex flex-wrap gap-1.5 mt-2"},ya={class:"text-right shrink-0"},ba={class:"text-sm font-mono text-textSecondary"},_a={class:"text-xs text-muted"},wa={class:"text-xs text-muted"},ka=it({__name:"MemoryNotesTab",setup(e){const t=$([]),s=$(!1),n=$(""),o=$("created_at"),l=$("");let a=null;async function c(){s.value=!0;try{const d=l.value.trim();let m;if(d)m=await be(`/api/search?q=${encodeURIComponent(d)}&limit=50`);else{const b=new URLSearchParams({limit:"50",sort:o.value});n.value&&b.set("type",n.value),m=await be(`/api/notes?${b}`)}t.value=m}finally{s.value=!1}}function u(){a&&clearTimeout(a),a=setTimeout(c,300)}function h(d){if(!d)return"never";const m=Date.now()-new Date(d).getTime(),b=Math.floor(m/6e4);if(b<1)return"just now";if(b<60)return`${b}m ago`;const A=Math.floor(b/60);return A<24?`${A}h ago`:`${Math.floor(A/24)}d ago`}return We(c),(d,m)=>(x(),g("div",la,[r("div",ia,[se(r("input",{"onUpdate:modelValue":m[0]||(m[0]=b=>l.value=b),onInput:u,type:"text",placeholder:"Search notes...",class:"flex-1 min-w-[200px] px-4 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,544),[[re,l.value]]),se(r("select",{"onUpdate:modelValue":m[1]||(m[1]=b=>n.value=b),onChange:c,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...m[3]||(m[3]=[et('<option value="">All types</option><option value="fact">Facts</option><option value="preference">Preferences</option><option value="pattern">Patterns</option><option value="entity">Entities</option><option value="relationship">Relationships</option>',6)])],544),[[Bt,n.value]]),se(r("select",{"onUpdate:modelValue":m[2]||(m[2]=b=>o.value=b),onChange:c,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...m[4]||(m[4]=[r("option",{value:"created_at"},"Newest",-1),r("option",{value:"confidence"},"Confidence",-1),r("option",{value:"access_count"},"Most accessed",-1)])],544),[[Bt,o.value]])]),s.value?(x(),g("div",aa,"Loading notes...")):t.value.length===0?(x(),g("div",ca,"No notes found")):(x(),g("div",ua,[(x(!0),g(ne,null,ve(t.value,b=>(x(),g("div",{key:b.noteId,class:G(["glass rounded-xl p-4 animate-fade-in",`priority-${b.priority||0}`])},[r("div",da,[r("div",fa,[r("div",pa,[r("span",{class:G(["type-badge",`type-${b.type}`])},v(b.type),3),b.priority>=2?(x(),g("span",ma,"HIGH IMPORTANCE")):b.priority===1?(x(),g("span",ha,"NOTABLE")):W("",!0),r("span",xa,v(b.noteId),1)]),r("p",ga,v(b.content),1),r("div",va,[(x(!0),g(ne,null,ve(b.keywords||[],A=>(x(),g("span",{key:A,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},v(A),1))),128))])]),r("div",ya,[r("div",ba,v(((Number(b.confidence)||0)*100).toFixed(0))+"%",1),r("div",_a,v(h(b.createdAt)),1),r("div",wa,v(b.accessCount??0)+" hits",1)])])],2))),128))]))]))}}),Sa={class:"animate-fade-in space-y-6"},$a={class:"glass rounded-xl p-4"},Ca={class:"flex flex-wrap items-center gap-4 mb-4"},Ta={key:0,class:"text-sm text-success"},Aa={class:"flex flex-wrap items-center gap-3 mb-4"},Ea={key:0,class:"text-sm text-success"},Ia={class:"glass rounded-xl p-6"},Pa={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ma={class:"flex items-center gap-2"},Oa={key:0,class:"text-sm text-success"},Da={key:0,class:"mb-3"},Ra={class:"mt-4"},ja=["innerHTML"],Na={class:"glass rounded-xl p-6"},La={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ua={class:"flex items-center gap-2"},Va={key:0,class:"text-sm text-success"},Fa={class:"flex gap-2 mb-4"},Ba=["onClick"],Ha={key:0,class:"mb-3"},Ka=["value","placeholder"],Wa={class:"glass rounded-xl p-6"},za={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ja={class:"flex items-center gap-2"},qa={key:0,class:"text-sm text-success"},Ga={class:"mb-4 flex flex-wrap items-center gap-3"},Ya={class:"flex items-center gap-2"},Za={class:"font-mono text-sm text-textPrimary"},Qa={key:0,class:"mb-3"},Xa={class:"flex flex-wrap gap-2 mb-3"},ec=["onClick"],tc={class:"mt-4"},sc=["innerHTML"],nc=it({__name:"TemplatesTab",setup(e){function t(B){return B.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\{\{([A-Z_]+)\}\}/g,'<span class="text-accentLight" style="background:rgba(99,102,241,0.1);padding:0 2px;border-radius:3px">{{$1}}</span>')}const s=$("copilot"),n=$(""),o=$(50),l=$(""),a=$(""),c=$(!0),u=$(""),h=$(!1),d=$({}),m=$("copilot"),b=$(""),A=$(""),H=$(!0),C=$(""),w=$(!1),k=$([]),S=$("");async function O(){await Promise.all([P(),Z(),X(),K()])}async function P(){try{const B=await be("/api/settings/agent-type");s.value=B.agentType||"copilot"}catch{}}async function Z(){try{const B=await be("/api/settings/bootstrap-message-count");o.value=B.count??50}catch{}}async function X(){try{const B=await be("/api/templates");if(B.templates&&B.templates.length>0){const D=B.templates[0];a.value=D.content||"",c.value=D.isDefault??!0}B.agentReminders&&(d.value=B.agentReminders)}catch{}}async function K(){try{const[B,D,Ce]=await Promise.all([be("/api/templates/drive"),be("/api/templates/drive-presets"),be("/api/settings/dmn-activation-hours")]);k.value=D.presets||[],S.value=String(Ce.value??"not set"),B.custom?(A.value=B.custom,H.value=!1):(A.value=B.default||"",H.value=!0)}catch{}}async function R(){try{await be("/api/settings/agent-type",{method:"POST",body:JSON.stringify({agentType:s.value})}),await be("/api/templates/reminders",{method:"DELETE"}),n.value="Saved ✓",setTimeout(()=>{n.value=""},3e3),await X()}catch(B){n.value="Error: "+B.message}}async function z(){try{await be("/api/settings/bootstrap-message-count",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:o.value})}),l.value="Saved ✓",setTimeout(()=>{l.value=""},3e3)}catch(B){l.value="Error: "+B.message}}async function ue(){try{const B=await fetch("/api/templates/reminders",{method:"POST",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({content:a.value})});if(!B.ok)throw new Error(B.statusText);c.value=!1,u.value="Saved ✓",setTimeout(()=>{u.value=""},3e3)}catch(B){u.value="Error: "+B.message}}async function F(){if(confirm("Reset to default template? Your customizations will be lost."))try{const B=await fetch("/api/templates/reminders",{method:"DELETE",headers:{Authorization:`Bearer ${ye()}`}});if(!B.ok)throw new Error(B.statusText);await X(),u.value="Reset to default ✓",setTimeout(()=>{u.value=""},3e3)}catch(B){u.value="Error: "+B.message}}async function L(){var Ce;const B=m.value,D=((Ce=d.value[B])==null?void 0:Ce.content)??"";try{const ke=await fetch(`/api/templates/reminders-${B}`,{method:"POST",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({content:D})});if(!ke.ok)throw new Error(ke.statusText);d.value[B]={content:D,isDefault:!1},b.value=`Saved ${B} ✓`,setTimeout(()=>{b.value=""},3e3)}catch(ke){b.value="Error: "+ke.message}}async function J(){const B=m.value;if(confirm(`Reset ${B} agent reminder? The custom template will be removed.`))try{const D=await fetch(`/api/templates/reminders-${B}`,{method:"DELETE",headers:{Authorization:`Bearer ${ye()}`}});if(!D.ok)throw new Error(D.statusText);await X(),b.value=`Reset ${B} ✓`,setTimeout(()=>{b.value=""},3e3)}catch(D){b.value="Error: "+D.message}}async function oe(){const B=A.value;if(!B.trim()){C.value="Template is empty — load a preset first",setTimeout(()=>{C.value=""},3e3);return}try{const D=await fetch("/api/templates/drive",{method:"POST",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({content:B})});if(!D.ok)throw new Error(D.statusText);H.value=!1,C.value="Saved ✓",setTimeout(()=>{C.value=""},3e3)}catch(D){C.value="Error: "+D.message}}async function _e(){if(confirm("Reset drive template? The custom template will be removed."))try{const B=await fetch("/api/templates/drive",{method:"DELETE",headers:{Authorization:`Bearer ${ye()}`}});if(!B.ok)throw new Error(B.statusText);await K(),C.value="Reset to default ✓",setTimeout(()=>{C.value=""},3e3)}catch(B){C.value="Error: "+B.message}}function Se(B){A.value=B.content,H.value=!1}const pe=Re(()=>t(a.value)),le=Re(()=>A.value?t(A.value):'<span style="color:#6b7280">(no template loaded)</span>');return We(O),(B,D)=>{var Ce,ke;return x(),g("div",Sa,[r("div",$a,[r("div",Ca,[D[8]||(D[8]=r("label",{class:"text-sm font-medium text-textSecondary"},"Agent Type",-1)),se(r("select",{"onUpdate:modelValue":D[0]||(D[0]=de=>s.value=de),onChange:R,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...D[7]||(D[7]=[et('<option value="copilot">Copilot</option><option value="copilot_claude">Copilot (Claude)</option><option value="copilot_codex">Copilot (Codex)</option><option value="claude">Claude</option><option value="cursor">Cursor</option><option value="codex">Codex</option><option value="openai_codex">OpenAI Codex</option>',7)])],544),[[Bt,s.value]]),n.value?(x(),g("span",Ta,v(n.value),1)):W("",!0),D[9]||(D[9]=r("span",{class:"text-xs text-muted"},"Changes which default reminders template is used",-1))]),r("div",Aa,[D[10]||(D[10]=r("label",{class:"text-sm font-medium text-textSecondary"},"Bootstrap Messages",-1)),se(r("input",{"onUpdate:modelValue":D[1]||(D[1]=de=>o.value=de),type:"number",min:"0",max:"500",class:"w-24 px-3 py-2 rounded-xl bg-card border border-gray-700 text-text text-sm focus:border-accent focus:outline-none"},null,512),[[re,o.value,void 0,{number:!0}]]),r("button",{onClick:z,class:"px-4 py-2 rounded-xl bg-accent text-white text-sm font-medium hover:bg-accent/80 transition-colors"},"Save"),l.value?(x(),g("span",Ea,v(l.value),1)):W("",!0),D[11]||(D[11]=r("span",{class:"text-xs text-muted"},"Number of recent messages injected as warm context (0 = off)",-1))])]),r("div",Ia,[r("div",Pa,[D[12]||(D[12]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Reminders Template"),r("p",{class:"text-sm text-textSecondary mt-1"},"Edit the system prompt template sent with every reminder")],-1)),r("div",Ma,[u.value?(x(),g("span",Oa,v(u.value),1)):W("",!0),r("button",{onClick:F,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset to Default"),r("button",{onClick:ue,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),c.value?(x(),g("div",Da,[...D[13]||(D[13]=[r("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"USING DEFAULT — edit and save to customize",-1)])])):W("",!0),se(r("textarea",{"onUpdate:modelValue":D[2]||(D[2]=de=>a.value=de),rows:"20",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:"Loading..."},null,512),[[re,a.value]]),r("div",Ra,[r("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:D[3]||(D[3]=de=>h.value=!h.value)},[(x(),g("svg",{class:G(["w-4 h-4 text-textSecondary transition-transform",h.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...D[14]||(D[14]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),D[15]||(D[15]=r("span",{class:"text-sm font-medium text-textSecondary"},"Preview with highlighted variables",-1))]),h.value?(x(),g("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:pe.value},null,8,ja)):W("",!0)]),D[16]||(D[16]=et('<details class="mt-4"><summary class="text-sm font-medium text-textSecondary cursor-pointer hover:text-textPrimary transition">Available Variables</summary><div class="mt-2 glass rounded-xl p-4 grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"><div><code class="text-accentLight">{{OPERATOR_MESSAGE}}</code> <span class="text-textSecondary">— latest operator message</span></div><div><code class="text-accentLight">{{THREAD_ID}}</code> <span class="text-textSecondary">— Telegram thread ID</span></div><div><code class="text-accentLight">{{TIME}}</code> <span class="text-textSecondary">— formatted timestamp</span></div><div><code class="text-accentLight">{{UPTIME}}</code> <span class="text-textSecondary">— session uptime</span></div><div><code class="text-accentLight">{{VERSION}}</code> <span class="text-textSecondary">— package version</span></div><div><code class="text-accentLight">{{MODE}}</code> <span class="text-textSecondary">— "autonomous" or "standard"</span></div></div></details>',1))]),r("div",Na,[r("div",La,[D[17]||(D[17]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Agent-Specific Reminders"),r("p",{class:"text-sm text-textSecondary mt-1"},"Appended after the base reminders template — per agent type")],-1)),r("div",Ua,[b.value?(x(),g("span",Va,v(b.value),1)):W("",!0),r("button",{onClick:J,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset"),r("button",{onClick:L,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),r("div",Fa,[(x(),g(ne,null,ve(["copilot","claude","cursor","codex"],de=>r("button",{key:de,onClick:ze=>m.value=de,class:G(["px-4 py-2 rounded-xl text-sm font-medium transition",m.value===de?"bg-accent text-white":"bg-card hover:bg-cardHover border border-gray-700 text-textSecondary hover:text-textPrimary"])},v(de.charAt(0).toUpperCase()+de.slice(1)),11,Ba)),64))]),((Ce=d.value[m.value])==null?void 0:Ce.isDefault)!==!1?(x(),g("div",Ha,[...D[18]||(D[18]=[r("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"NO CUSTOM OVERRIDE — this agent uses only the base reminders",-1)])])):W("",!0),r("textarea",{value:((ke=d.value[m.value])==null?void 0:ke.content)??"",onInput:D[4]||(D[4]=de=>{const ze=de.target;d.value[m.value]={content:ze.value,isDefault:!1}}),rows:"8",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:`Add ${m.value}-specific reminders (e.g. orchestrator hints, subagent policies)...`},null,40,Ka)]),r("div",Wa,[r("div",za,[D[19]||(D[19]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Drive Framing Template"),r("p",{class:"text-sm text-textSecondary mt-1"},"Customize the autonomous drive prompt sent when the operator is away")],-1)),r("div",Ja,[C.value?(x(),g("span",qa,v(C.value),1)):W("",!0),r("button",{onClick:_e,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset to Default"),r("button",{onClick:oe,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),r("div",Ga,[D[21]||(D[21]=r("label",{class:"text-sm text-textSecondary"},"Drive Activation Period:",-1)),r("div",Ya,[r("span",Za,v(S.value),1),D[20]||(D[20]=r("span",{class:"text-sm text-textSecondary"},"hours",-1))]),D[22]||(D[22]=r("span",{class:"text-xs text-muted"},"(informational — set via DMN_ACTIVATION_HOURS env var)",-1))]),H.value?(x(),g("div",Qa,[...D[23]||(D[23]=[r("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"(Default — edit to override)",-1)])])):W("",!0),r("div",Xa,[D[24]||(D[24]=r("span",{class:"text-sm text-textSecondary self-center"},"Presets:",-1)),(x(!0),g(ne,null,ve(k.value,de=>(x(),g("button",{key:de.key,onClick:ze=>Se(de),class:"px-3 py-1.5 rounded-lg bg-card hover:bg-cardHover border border-gray-700 text-xs text-textSecondary hover:text-textPrimary transition"},v(de.label),9,ec))),128))]),se(r("textarea",{"onUpdate:modelValue":D[5]||(D[5]=de=>A.value=de),rows:"15",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:"Load a preset or type a custom drive template..."},null,512),[[re,A.value]]),r("div",tc,[r("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:D[6]||(D[6]=de=>w.value=!w.value)},[(x(),g("svg",{class:G(["w-4 h-4 text-textSecondary transition-transform",w.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...D[25]||(D[25]=[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),D[26]||(D[26]=r("span",{class:"text-sm font-medium text-textSecondary"},"Preview with sample values",-1))]),w.value?(x(),g("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:le.value},null,8,sc)):W("",!0)]),D[27]||(D[27]=et('<details class="mt-4"><summary class="text-sm font-medium text-textSecondary cursor-pointer hover:text-textPrimary transition">Available Variables</summary><div class="mt-2 glass rounded-xl p-4 grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"><div><code class="text-accentLight">{{IDLE_HOURS}}</code> <span class="text-textSecondary">— hours since last operator interaction</span></div><div><code class="text-accentLight">{{TIME}}</code> <span class="text-textSecondary">— ISO timestamp</span></div><div><code class="text-accentLight">{{PROBABILITY}}</code> <span class="text-textSecondary">— drive activation probability (0.2–1.0)</span></div></div></details>',1))])])}}}),oc={class:"animate-fade-in"},rc={class:"glass rounded-xl p-6 mb-6"},lc={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},ic={key:0,class:"glass rounded-xl p-4 mb-4 border border-accent/30"},ac={class:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-3"},cc={class:"flex items-center gap-4 mb-3"},uc={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer"},dc={class:"flex items-center gap-2"},fc={key:0,class:"text-sm text-warn"},pc={key:1,class:"text-center py-8 text-textSecondary text-sm"},mc={key:2,class:"text-center text-textSecondary py-12"},hc={key:3,class:"space-y-2"},xc=["onClick"],gc={class:"flex items-start justify-between gap-3"},vc={class:"flex-1 min-w-0"},yc={class:"flex items-center gap-2 mb-1"},bc={class:"font-medium text-sm"},_c={key:0,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},wc={class:"flex flex-wrap gap-1.5 mt-1"},kc=["title"],Sc={key:0,class:"glass rounded-xl p-6"},$c={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Cc={class:"text-lg font-semibold"},Tc={class:"text-sm text-textSecondary mt-1"},Ac={class:"flex items-center gap-2"},Ec={key:0,class:"text-sm text-success"},Ic={key:1,class:"text-sm text-warn"},Pc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-4"},Mc=["value"],Oc={class:"flex items-end"},Dc={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer pb-2"},Rc=it({__name:"SkillsTab",setup(e){const t=$([]),s=$(!0),n=$(null),o=$(""),l=$(""),a=$(!1),c=$(""),u=$(""),h=$(!1),d=$(""),m=$(""),b=$(!1),A=$("");async function H(){s.value=!0;try{const K=await be("/api/skills");t.value=K.skills||[]}finally{s.value=!1}}function C(K){return K?K.includes(".remote-copilot-mcp")&&K.includes("skills")?"user":K.endsWith(".default.md")?"default":K.endsWith(".skill.md")?"project":"unknown":"unknown"}function w(K){const R={user:"background:rgba(99,102,241,0.15);color:#818cf8",default:"background:rgba(107,114,128,0.15);color:#9ca3af",project:"background:rgba(34,197,94,0.15);color:#4ade80",unknown:"background:rgba(107,114,128,0.15);color:#9ca3af"};return R[K]||R.unknown}function k(K){n.value=K,o.value=K.content,l.value=(K.triggers||[]).join(", "),a.value=!!K.replacesOrchestrator,h.value=!1}function S(){n.value=null,u.value=""}function O(K,R,z,ue){let F=`---
|
|
65
|
-
name: ${
|
|
64
|
+
**/let ln;const Yn=typeof window<"u"&&window.trustedTypes;if(Yn)try{ln=Yn.createPolicy("vue",{createHTML:e=>e})}catch{}const hr=ln?e=>ln.createHTML(e):e=>e,ga="http://www.w3.org/2000/svg",ya="http://www.w3.org/1998/Math/MathML",ct=typeof document<"u"?document:null,Zn=ct&&ct.createElement("template"),ba={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const r=t==="svg"?ct.createElementNS(ga,e):t==="mathml"?ct.createElementNS(ya,e):s?ct.createElement(e,{is:s}):ct.createElement(e);return e==="select"&&n&&n.multiple!=null&&r.setAttribute("multiple",n.multiple),r},createText:e=>ct.createTextNode(e),createComment:e=>ct.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ct.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,r,l){const a=s?s.previousSibling:t.lastChild;if(r&&(r===l||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),s),!(r===l||!(r=r.nextSibling)););else{Zn.innerHTML=hr(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const u=Zn.content;if(n==="svg"||n==="mathml"){const d=u.firstChild;for(;d.firstChild;)u.appendChild(d.firstChild);u.removeChild(d)}t.insertBefore(u,s)}return[a?a.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},_a=Symbol("_vtc");function wa(e,t,s){const n=e[_a];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const Qn=Symbol("_vod"),ka=Symbol("_vsh"),Sa=Symbol(""),$a=/(?:^|;)\s*display\s*:/;function Ca(e,t,s){const n=e.style,r=Se(s);let l=!1;if(s&&!r){if(t)if(Se(t))for(const a of t.split(";")){const u=a.slice(0,a.indexOf(":")).trim();s[u]==null&&_s(n,u,"")}else for(const a in t)s[a]==null&&_s(n,a,"");for(const a in s)a==="display"&&(l=!0),_s(n,a,s[a])}else if(r){if(t!==s){const a=n[Sa];a&&(s+=";"+a),n.cssText=s,l=$a.test(s)}}else t&&e.removeAttribute("style");Qn in e&&(e[Qn]=l?n.display:"",e[ka]&&(n.display="none"))}const Xn=/\s*!important$/;function _s(e,t,s){if(ee(s))s.forEach(n=>_s(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))e.setProperty(t,s);else{const n=Ta(e,t);Xn.test(s)?e.setProperty(St(n),s.replace(Xn,""),"important"):e[n]=s}}const eo=["Webkit","Moz","ms"],qs={};function Ta(e,t){const s=qs[t];if(s)return s;let n=Re(t);if(n!=="filter"&&n in e)return qs[t]=n;n=Is(n);for(let r=0;r<eo.length;r++){const l=eo[r]+n;if(l in e)return qs[t]=l}return t}const to="http://www.w3.org/1999/xlink";function so(e,t,s,n,r,l=Er(t)){n&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(to,t.slice(6,t.length)):e.setAttributeNS(to,t,s):s==null||l&&!go(s)?e.removeAttribute(t):e.setAttribute(t,l?"":rt(s)?String(s):s)}function no(e,t,s,n,r){if(t==="innerHTML"||t==="textContent"){s!=null&&(e[t]=t==="innerHTML"?hr(s):s);return}const l=e.tagName;if(t==="value"&&l!=="PROGRESS"&&!l.includes("-")){const u=l==="OPTION"?e.getAttribute("value")||"":e.value,d=s==null?e.type==="checkbox"?"on":"":String(s);(u!==d||!("_value"in e))&&(e.value=d),s==null&&e.removeAttribute(t),e._value=s;return}let a=!1;if(s===""||s==null){const u=typeof e[t];u==="boolean"?s=go(s):s==null&&u==="string"?(s="",a=!0):u==="number"&&(s=0,a=!0)}try{e[t]=s}catch{}a&&e.removeAttribute(r||t)}function wt(e,t,s,n){e.addEventListener(t,s,n)}function Ea(e,t,s,n){e.removeEventListener(t,s,n)}const oo=Symbol("_vei");function Pa(e,t,s,n,r=null){const l=e[oo]||(e[oo]={}),a=l[t];if(n&&a)a.value=n;else{const[u,d]=Aa(t);if(n){const x=l[t]=Oa(n,r);wt(e,u,x,d)}else a&&(Ea(e,u,a,d),l[t]=void 0)}}const ro=/(?:Once|Passive|Capture)$/;function Aa(e){let t;if(ro.test(e)){t={};let n;for(;n=e.match(ro);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):St(e.slice(2)),t]}let Gs=0;const Ia=Promise.resolve(),Ma=()=>Gs||(Ia.then(()=>Gs=0),Gs=Date.now());function Oa(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;lt(Da(n,s.value),t,5,[n])};return s.value=e,s.attached=Ma(),s}function Da(e,t){if(ee(t)){const s=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{s.call(e),e._stopped=!0},t.map(n=>r=>!r._stopped&&n&&n(r))}else return t}const lo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ra=(e,t,s,n,r,l)=>{const a=r==="svg";t==="class"?wa(e,n,a):t==="style"?Ca(e,s,n):Es(t)?Ps(t)||Pa(e,t,s,n,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):ja(e,t,n,a))?(no(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&so(e,t,n,a,l,t!=="value")):e._isVueCE&&(La(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Se(n)))?no(e,Re(t),n,l,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),so(e,t,n,a))};function ja(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&lo(t)&&oe(s));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 r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return lo(t)&&Se(s)?!1:t in e}function La(e,t){const s=e._def.props;if(!s)return!1;const n=Re(t);return Array.isArray(s)?s.some(r=>Re(r)===n):Object.keys(s).some(r=>Re(r)===n)}const Bt=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ee(t)?s=>hs(t,s):t};function Ua(e){e.target.composing=!0}function ao(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const mt=Symbol("_assign");function io(e,t,s){return t&&(e=e.trim()),s&&(e=Ms(e)),e}const ne={created(e,{modifiers:{lazy:t,trim:s,number:n}},r){e[mt]=Bt(r);const l=n||r.props&&r.props.type==="number";wt(e,t?"change":"input",a=>{a.target.composing||e[mt](io(e.value,s,l))}),(s||l)&&wt(e,"change",()=>{e.value=io(e.value,s,l)}),t||(wt(e,"compositionstart",Ua),wt(e,"compositionend",ao),wt(e,"change",ao))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:r,number:l}},a){if(e[mt]=Bt(a),e.composing)return;const u=(l||e.type==="number")&&!/^0\d/.test(e.value)?Ms(e.value):e.value,d=t??"";if(u===d)return;const x=e.getRootNode();(x instanceof Document||x instanceof ShadowRoot)&&x.activeElement===e&&e.type!=="range"&&(n&&t===s||r&&e.value.trim()===d)||(e.value=d)}},an={deep:!0,created(e,t,s){e[mt]=Bt(s),wt(e,"change",()=>{const n=e._modelValue,r=cs(e),l=e.checked,a=e[mt];if(ee(n)){const u=fn(n,r),d=u!==-1;if(l&&!d)a(n.concat(r));else if(!l&&d){const x=[...n];x.splice(u,1),a(x)}}else if(Ft(n)){const u=new Set(n);l?u.add(r):u.delete(r),a(u)}else a(gr(e,l))})},mounted:co,beforeUpdate(e,t,s){e[mt]=Bt(s),co(e,t,s)}};function co(e,{value:t,oldValue:s},n){e._modelValue=t;let r;if(ee(t))r=fn(t,n.props.value)>-1;else if(Ft(t))r=t.has(n.props.value);else{if(t===s)return;r=Ht(t,gr(e,!0))}e.checked!==r&&(e.checked=r)}const At={deep:!0,created(e,{value:t,modifiers:{number:s}},n){const r=Ft(t);wt(e,"change",()=>{const l=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>s?Ms(cs(a)):cs(a));e[mt](e.multiple?r?new Set(l):l:l[0]),e._assigning=!0,Lo(()=>{e._assigning=!1})}),e[mt]=Bt(n)},mounted(e,{value:t}){uo(e,t)},beforeUpdate(e,t,s){e[mt]=Bt(s)},updated(e,{value:t}){e._assigning||uo(e,t)}};function uo(e,t){const s=e.multiple,n=ee(t);if(!(s&&!n&&!Ft(t))){for(let r=0,l=e.options.length;r<l;r++){const a=e.options[r],u=cs(a);if(s)if(n){const d=typeof u;d==="string"||d==="number"?a.selected=t.some(x=>String(x)===String(u)):a.selected=fn(t,u)>-1}else a.selected=t.has(u);else if(Ht(cs(a),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function cs(e){return"_value"in e?e._value:e.value}function gr(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const Na={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Xe=(e,t)=>{const s=e._withKeys||(e._withKeys={}),n=t.join(".");return s[n]||(s[n]=(r=>{if(!("key"in r))return;const l=St(r.key);if(t.some(a=>a===l||Na[a]===l))return e(r)}))},Va=Pe({patchProp:Ra},ba);let fo;function Ba(){return fo||(fo=Ql(Va))}const Fa=((...e)=>{const t=Ba().createApp(...e),{mount:s}=t;return t.mount=n=>{const r=Ka(n);if(!r)return;const l=t._component;!oe(l)&&!l.render&&!l.template&&(l.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const a=s(r,!1,Ha(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),a},t});function Ha(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Ka(e){return Se(e)?document.querySelector(e):e}let Tn="";function qt(e){Tn=e}function de(){return Tn}async function he(e,t){const s=await fetch(e,{...t,headers:{Authorization:`Bearer ${Tn}`,"Content-Type":"application/json",...(t==null?void 0:t.headers)??{}}});if(!s.ok){const n=new Error(s.statusText);throw n.status=s.status,n}return s.json()}const Wa={class:"animate-fade-in"},za={key:0,class:"text-center py-12 text-textSecondary"},Ja={key:1,class:"text-center text-textSecondary py-12"},qa={key:2,class:"space-y-3"},Ga={class:"flex items-center justify-between"},Ya={class:"flex items-center gap-3"},Za={class:"font-medium"},Qa={class:"text-accentLight"},Xa={class:"text-textSecondary text-xs"},ei={key:2,class:"text-muted italic"},ti={class:"text-xs text-textSecondary font-mono"},si={class:"text-right"},ni={class:"flex items-center gap-2 justify-end"},oi={class:"text-xs text-textSecondary"},ri=He({__name:"SessionsTab",props:{status:{}},setup(e){const t=e,s=w([]),n=w(!0);async function r(){n.value=!0;try{const x=await he("/api/status");s.value=(x.sessions||[]).slice().sort((f,m)=>f.status==="active"&&m.status!=="active"?-1:f.status!=="active"&&m.status==="active"?1:m.lastActivity-f.lastActivity)}finally{n.value=!1}}const l=Ee(()=>{var f;return(((f=t.status)==null?void 0:f.sessions)??s.value).slice().sort((m,v)=>m.status==="active"&&v.status!=="active"?-1:m.status!=="active"&&v.status==="active"?1:v.lastActivity-m.lastActivity)});function a(x){const f=Math.floor((Date.now()-x.lastActivity)/6e4);return x.status==="disconnected"?{label:`Disconnected${f>0?` — ${f}m ago`:""}`,color:"text-muted"}:f<5?{label:"Active",color:"text-success"}:f<30?{label:`Idle ${f}m`,color:"text-warn"}:{label:`Dormant ${f}m`,color:"text-danger"}}function u(x){if(!x.lastWaitCallAt)return"";const f=Math.floor((Date.now()-x.lastWaitCallAt)/6e4);return f<5?`Polling — ${f===0?"just now":f+"m ago"}`:`Last poll — ${f}m ago`}function d(x){return x.lastWaitCallAt?Math.floor((Date.now()-x.lastWaitCallAt)/6e4)<5?"text-success":"text-warn":""}return Be(r),(x,f)=>(h(),g("div",Wa,[n.value&&l.value.length===0?(h(),g("div",za,"Loading sessions...")):l.value.length===0?(h(),g("div",Ja,"No sessions")):(h(),g("div",qa,[(h(!0),g(se,null,ve(l.value,m=>(h(),g("div",{key:m.mcpSessionId,class:q(["glass rounded-xl p-4 animate-slide-up",m.status==="disconnected"?"opacity-60":""])},[o("div",Ga,[o("div",Ya,[o("span",{class:q(["w-2.5 h-2.5 rounded-full",m.status==="disconnected"?"bg-muted":Math.floor((Date.now()-m.lastActivity)/6e4)<5?"bg-success":Math.floor((Date.now()-m.lastActivity)/6e4)<30?"bg-warn":"bg-danger"])},null,2),o("div",null,[o("div",Za,[m.topicName?(h(),g(se,{key:0},[o("span",Qa,b(m.topicName),1),o("span",Xa," (thread "+b(m.threadId)+")",1)],64)):m.threadId!=null?(h(),g(se,{key:1},[X("Thread "+b(m.threadId),1)],64)):(h(),g("span",ei,"Awaiting start_session…"))]),o("div",ti,b(m.mcpSessionId.slice(0,12))+"...",1)])]),o("div",si,[o("div",ni,[o("span",{class:q(["text-sm font-medium",a(m).color])},b(a(m).label),3),u(m)?(h(),g("span",{key:0,class:q(["text-xs ml-2",d(m)])},b(u(m)),3)):K("",!0)]),o("div",oi,b(m.transportType),1)])])],2))),128))]))]))}}),li={class:"animate-fade-in"},ai={class:"flex flex-wrap items-center gap-3 mb-4"},ii={key:0,class:"text-center py-12 text-textSecondary"},ci={key:1,class:"text-center py-12 text-textSecondary"},ui={key:2,class:"space-y-2"},di={class:"flex items-start justify-between gap-3"},fi={class:"flex-1 min-w-0"},pi={class:"flex items-center gap-2 mb-1"},mi={key:0,class:"type-badge",style:{background:"rgba(239,68,68,0.15)",color:"#f87171"}},xi={key:1,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},vi={class:"text-xs text-textSecondary"},hi={class:"text-sm text-textPrimary leading-relaxed"},gi={class:"flex flex-wrap gap-1.5 mt-2"},yi={class:"text-right shrink-0"},bi={class:"text-sm font-mono text-textSecondary"},_i={class:"text-xs text-muted"},wi={class:"text-xs text-muted"},ki=He({__name:"MemoryNotesTab",setup(e){const t=w([]),s=w(!1),n=w(""),r=w("created_at"),l=w("");let a=null;async function u(){s.value=!0;try{const f=l.value.trim();let m;if(f)m=await he(`/api/search?q=${encodeURIComponent(f)}&limit=50`);else{const v=new URLSearchParams({limit:"50",sort:r.value});n.value&&v.set("type",n.value),m=await he(`/api/notes?${v}`)}t.value=m}finally{s.value=!1}}function d(){a&&clearTimeout(a),a=setTimeout(u,300)}function x(f){if(!f)return"never";const m=Date.now()-new Date(f).getTime(),v=Math.floor(m/6e4);if(v<1)return"just now";if(v<60)return`${v}m ago`;const k=Math.floor(v/60);return k<24?`${k}h ago`:`${Math.floor(k/24)}d ago`}return Be(u),(f,m)=>(h(),g("div",li,[o("div",ai,[Z(o("input",{"onUpdate:modelValue":m[0]||(m[0]=v=>l.value=v),onInput:d,type:"text",placeholder:"Search notes...",class:"flex-1 min-w-[200px] px-4 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,544),[[ne,l.value]]),Z(o("select",{"onUpdate:modelValue":m[1]||(m[1]=v=>n.value=v),onChange:u,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...m[3]||(m[3]=[ut('<option value="">All types</option><option value="fact">Facts</option><option value="preference">Preferences</option><option value="pattern">Patterns</option><option value="entity">Entities</option><option value="relationship">Relationships</option>',6)])],544),[[At,n.value]]),Z(o("select",{"onUpdate:modelValue":m[2]||(m[2]=v=>r.value=v),onChange:u,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none"},[...m[4]||(m[4]=[o("option",{value:"created_at"},"Newest",-1),o("option",{value:"confidence"},"Confidence",-1),o("option",{value:"access_count"},"Most accessed",-1)])],544),[[At,r.value]])]),s.value?(h(),g("div",ii,"Loading notes...")):t.value.length===0?(h(),g("div",ci,"No notes found")):(h(),g("div",ui,[(h(!0),g(se,null,ve(t.value,v=>(h(),g("div",{key:v.noteId,class:q(["glass rounded-xl p-4 animate-fade-in",`priority-${v.priority||0}`])},[o("div",di,[o("div",fi,[o("div",pi,[o("span",{class:q(["type-badge",`type-${v.type}`])},b(v.type),3),v.priority>=2?(h(),g("span",mi,"HIGH IMPORTANCE")):v.priority===1?(h(),g("span",xi,"NOTABLE")):K("",!0),o("span",vi,b(v.noteId),1)]),o("p",hi,b(v.content),1),o("div",gi,[(h(!0),g(se,null,ve(v.keywords||[],k=>(h(),g("span",{key:k,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},b(k),1))),128))])]),o("div",yi,[o("div",bi,b(((Number(v.confidence)||0)*100).toFixed(0))+"%",1),o("div",_i,b(x(v.createdAt)),1),o("div",wi,b(v.accessCount??0)+" hits",1)])])],2))),128))]))]))}}),Si={class:"animate-fade-in space-y-6"},$i={class:"glass rounded-xl p-4"},Ci={class:"flex flex-wrap items-center gap-4 mb-4"},Ti={key:0,class:"text-sm text-success"},Ei={class:"flex flex-wrap items-center gap-3 mb-4"},Pi={key:0,class:"text-sm text-success"},Ai={class:"glass rounded-xl p-6"},Ii={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Mi={class:"flex items-center gap-2"},Oi={key:0,class:"text-sm text-success"},Di={key:0,class:"mb-3"},Ri={class:"mt-4"},ji=["innerHTML"],Li={class:"glass rounded-xl p-6"},Ui={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ni={class:"flex items-center gap-2"},Vi={key:0,class:"text-sm text-success"},Bi={class:"flex gap-2 mb-4"},Fi=["onClick"],Hi={key:0,class:"mb-3"},Ki=["value","placeholder"],Wi={class:"glass rounded-xl p-6"},zi={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ji={class:"flex items-center gap-2"},qi={key:0,class:"text-sm text-success"},Gi={class:"mb-4 flex flex-wrap items-center gap-3"},Yi={class:"flex items-center gap-2"},Zi={class:"font-mono text-sm text-textPrimary"},Qi={key:0,class:"mb-3"},Xi={class:"flex flex-wrap gap-2 mb-3"},ec=["onClick"],tc={class:"mt-4"},sc=["innerHTML"],nc=He({__name:"TemplatesTab",setup(e){function t(W){return W.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/\{\{([A-Z_]+)\}\}/g,'<span class="text-accentLight" style="background:rgba(99,102,241,0.1);padding:0 2px;border-radius:3px">{{$1}}</span>')}const s=w("copilot"),n=w(""),r=w(50),l=w(""),a=w(""),u=w(!0),d=w(""),x=w(!1),f=w({}),m=w("copilot"),v=w(""),k=w(""),F=w(!0),$=w(""),N=w(!1),C=w([]),E=w("");async function R(){await Promise.all([I(),U(),y(),S()])}async function I(){try{const W=await he("/api/settings/agent-type");s.value=W.agentType||"copilot"}catch{}}async function U(){try{const W=await he("/api/settings/bootstrap-message-count");r.value=W.count??50}catch{}}async function y(){try{const W=await he("/api/templates");if(W.templates&&W.templates.length>0){const D=W.templates[0];a.value=D.content||"",u.value=D.isDefault??!0}W.agentReminders&&(f.value=W.agentReminders)}catch{}}async function S(){try{const[W,D,Ce]=await Promise.all([he("/api/templates/drive"),he("/api/templates/drive-presets"),he("/api/settings/dmn-activation-hours")]);C.value=D.presets||[],E.value=String(Ce.value??"not set"),W.custom?(k.value=W.custom,F.value=!1):(k.value=W.default||"",F.value=!0)}catch{}}async function j(){try{await he("/api/settings/agent-type",{method:"POST",body:JSON.stringify({agentType:s.value})}),await he("/api/templates/reminders",{method:"DELETE"}),n.value="Saved ✓",setTimeout(()=>{n.value=""},3e3),await y()}catch(W){n.value="Error: "+W.message}}async function G(){try{await he("/api/settings/bootstrap-message-count",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({count:r.value})}),l.value="Saved ✓",setTimeout(()=>{l.value=""},3e3)}catch(W){l.value="Error: "+W.message}}async function ae(){try{const W=await fetch("/api/templates/reminders",{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({content:a.value})});if(!W.ok)throw new Error(W.statusText);u.value=!1,d.value="Saved ✓",setTimeout(()=>{d.value=""},3e3)}catch(W){d.value="Error: "+W.message}}async function z(){if(confirm("Reset to default template? Your customizations will be lost."))try{const W=await fetch("/api/templates/reminders",{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!W.ok)throw new Error(W.statusText);await y(),d.value="Reset to default ✓",setTimeout(()=>{d.value=""},3e3)}catch(W){d.value="Error: "+W.message}}async function M(){var Ce;const W=m.value,D=((Ce=f.value[W])==null?void 0:Ce.content)??"";try{const we=await fetch(`/api/templates/reminders-${W}`,{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({content:D})});if(!we.ok)throw new Error(we.statusText);f.value[W]={content:D,isDefault:!1},v.value=`Saved ${W} ✓`,setTimeout(()=>{v.value=""},3e3)}catch(we){v.value="Error: "+we.message}}async function J(){const W=m.value;if(confirm(`Reset ${W} agent reminder? The custom template will be removed.`))try{const D=await fetch(`/api/templates/reminders-${W}`,{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!D.ok)throw new Error(D.statusText);await y(),v.value=`Reset ${W} ✓`,setTimeout(()=>{v.value=""},3e3)}catch(D){v.value="Error: "+D.message}}async function re(){const W=k.value;if(!W.trim()){$.value="Template is empty — load a preset first",setTimeout(()=>{$.value=""},3e3);return}try{const D=await fetch("/api/templates/drive",{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({content:W})});if(!D.ok)throw new Error(D.statusText);F.value=!1,$.value="Saved ✓",setTimeout(()=>{$.value=""},3e3)}catch(D){$.value="Error: "+D.message}}async function _e(){if(confirm("Reset drive template? The custom template will be removed."))try{const W=await fetch("/api/templates/drive",{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!W.ok)throw new Error(W.statusText);await S(),$.value="Reset to default ✓",setTimeout(()=>{$.value=""},3e3)}catch(W){$.value="Error: "+W.message}}function ke(W){k.value=W.content,F.value=!1}const me=Ee(()=>t(a.value)),ie=Ee(()=>k.value?t(k.value):'<span style="color:#6b7280">(no template loaded)</span>');return Be(R),(W,D)=>{var Ce,we;return h(),g("div",Si,[o("div",$i,[o("div",Ci,[D[8]||(D[8]=o("label",{class:"text-sm font-medium text-textSecondary"},"Agent Type",-1)),Z(o("select",{"onUpdate:modelValue":D[0]||(D[0]=fe=>s.value=fe),onChange:j,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...D[7]||(D[7]=[o("option",{value:"claude"},"Claude",-1),o("option",{value:"copilot"},"Copilot",-1),o("option",{value:"codex"},"Codex",-1)])],544),[[At,s.value]]),n.value?(h(),g("span",Ti,b(n.value),1)):K("",!0),D[9]||(D[9]=o("span",{class:"text-xs text-muted"},"Changes which default reminders template is used",-1))]),o("div",Ei,[D[10]||(D[10]=o("label",{class:"text-sm font-medium text-textSecondary"},"Bootstrap Messages",-1)),Z(o("input",{"onUpdate:modelValue":D[1]||(D[1]=fe=>r.value=fe),type:"number",min:"0",max:"500",class:"w-24 px-3 py-2 rounded-xl bg-card border border-gray-700 text-text text-sm focus:border-accent focus:outline-none"},null,512),[[ne,r.value,void 0,{number:!0}]]),o("button",{onClick:G,class:"px-4 py-2 rounded-xl bg-accent text-white text-sm font-medium hover:bg-accent/80 transition-colors"},"Save"),l.value?(h(),g("span",Pi,b(l.value),1)):K("",!0),D[11]||(D[11]=o("span",{class:"text-xs text-muted"},"Number of recent messages injected as warm context (0 = off)",-1))])]),o("div",Ai,[o("div",Ii,[D[12]||(D[12]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Reminders Template"),o("p",{class:"text-sm text-textSecondary mt-1"},"Edit the system prompt template sent with every reminder")],-1)),o("div",Mi,[d.value?(h(),g("span",Oi,b(d.value),1)):K("",!0),o("button",{onClick:z,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset to Default"),o("button",{onClick:ae,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),u.value?(h(),g("div",Di,[...D[13]||(D[13]=[o("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"USING DEFAULT — edit and save to customize",-1)])])):K("",!0),Z(o("textarea",{"onUpdate:modelValue":D[2]||(D[2]=fe=>a.value=fe),rows:"20",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:"Loading..."},null,512),[[ne,a.value]]),o("div",Ri,[o("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:D[3]||(D[3]=fe=>x.value=!x.value)},[(h(),g("svg",{class:q(["w-4 h-4 text-textSecondary transition-transform",x.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...D[14]||(D[14]=[o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),D[15]||(D[15]=o("span",{class:"text-sm font-medium text-textSecondary"},"Preview with highlighted variables",-1))]),x.value?(h(),g("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:me.value},null,8,ji)):K("",!0)]),D[16]||(D[16]=ut('<details class="mt-4"><summary class="text-sm font-medium text-textSecondary cursor-pointer hover:text-textPrimary transition">Available Variables</summary><div class="mt-2 glass rounded-xl p-4 grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"><div><code class="text-accentLight">{{OPERATOR_MESSAGE}}</code> <span class="text-textSecondary">— latest operator message</span></div><div><code class="text-accentLight">{{THREAD_ID}}</code> <span class="text-textSecondary">— Telegram thread ID</span></div><div><code class="text-accentLight">{{TIME}}</code> <span class="text-textSecondary">— formatted timestamp</span></div><div><code class="text-accentLight">{{UPTIME}}</code> <span class="text-textSecondary">— session uptime</span></div><div><code class="text-accentLight">{{VERSION}}</code> <span class="text-textSecondary">— package version</span></div><div><code class="text-accentLight">{{MODE}}</code> <span class="text-textSecondary">— "autonomous" or "standard"</span></div></div></details>',1))]),o("div",Li,[o("div",Ui,[D[17]||(D[17]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Agent-Specific Reminders"),o("p",{class:"text-sm text-textSecondary mt-1"},"Appended after the base reminders template — per agent type")],-1)),o("div",Ni,[v.value?(h(),g("span",Vi,b(v.value),1)):K("",!0),o("button",{onClick:J,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset"),o("button",{onClick:M,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),o("div",Bi,[(h(),g(se,null,ve(["claude","copilot","codex"],fe=>o("button",{key:fe,onClick:at=>m.value=fe,class:q(["px-4 py-2 rounded-xl text-sm font-medium transition",m.value===fe?"bg-accent text-white":"bg-card hover:bg-cardHover border border-gray-700 text-textSecondary hover:text-textPrimary"])},b(fe.charAt(0).toUpperCase()+fe.slice(1)),11,Fi)),64))]),((Ce=f.value[m.value])==null?void 0:Ce.isDefault)!==!1?(h(),g("div",Hi,[...D[18]||(D[18]=[o("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"NO CUSTOM OVERRIDE — this agent uses only the base reminders",-1)])])):K("",!0),o("textarea",{value:((we=f.value[m.value])==null?void 0:we.content)??"",onInput:D[4]||(D[4]=fe=>{const at=fe.target;f.value[m.value]={content:at.value,isDefault:!1}}),rows:"8",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:`Add ${m.value}-specific reminders (e.g. orchestrator hints, subagent policies)...`},null,40,Ki)]),o("div",Wi,[o("div",zi,[D[19]||(D[19]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Drive Framing Template"),o("p",{class:"text-sm text-textSecondary mt-1"},"Customize the autonomous drive prompt sent when the operator is away")],-1)),o("div",Ji,[$.value?(h(),g("span",qi,b($.value),1)):K("",!0),o("button",{onClick:_e,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Reset to Default"),o("button",{onClick:re,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),o("div",Gi,[D[21]||(D[21]=o("label",{class:"text-sm text-textSecondary"},"Drive Activation Period:",-1)),o("div",Yi,[o("span",Zi,b(E.value),1),D[20]||(D[20]=o("span",{class:"text-sm text-textSecondary"},"hours",-1))]),D[22]||(D[22]=o("span",{class:"text-xs text-muted"},"(informational — set via DMN_ACTIVATION_HOURS env var)",-1))]),F.value?(h(),g("div",Qi,[...D[23]||(D[23]=[o("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"(Default — edit to override)",-1)])])):K("",!0),o("div",Xi,[D[24]||(D[24]=o("span",{class:"text-sm text-textSecondary self-center"},"Presets:",-1)),(h(!0),g(se,null,ve(C.value,fe=>(h(),g("button",{key:fe.key,onClick:at=>ke(fe),class:"px-3 py-1.5 rounded-lg bg-card hover:bg-cardHover border border-gray-700 text-xs text-textSecondary hover:text-textPrimary transition"},b(fe.label),9,ec))),128))]),Z(o("textarea",{"onUpdate:modelValue":D[5]||(D[5]=fe=>k.value=fe),rows:"15",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:"Load a preset or type a custom drive template..."},null,512),[[ne,k.value]]),o("div",tc,[o("div",{class:"flex items-center gap-2 mb-2 cursor-pointer select-none",onClick:D[6]||(D[6]=fe=>N.value=!N.value)},[(h(),g("svg",{class:q(["w-4 h-4 text-textSecondary transition-transform",N.value?"rotate-90":""]),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[...D[25]||(D[25]=[o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"},null,-1)])],2)),D[26]||(D[26]=o("span",{class:"text-sm font-medium text-textSecondary"},"Preview with sample values",-1))]),N.value?(h(),g("div",{key:0,class:"glass rounded-xl p-4 font-mono text-sm leading-relaxed whitespace-pre-wrap break-words",innerHTML:ie.value},null,8,sc)):K("",!0)]),D[27]||(D[27]=ut('<details class="mt-4"><summary class="text-sm font-medium text-textSecondary cursor-pointer hover:text-textPrimary transition">Available Variables</summary><div class="mt-2 glass rounded-xl p-4 grid grid-cols-1 sm:grid-cols-2 gap-2 text-sm"><div><code class="text-accentLight">{{IDLE_HOURS}}</code> <span class="text-textSecondary">— hours since last operator interaction</span></div><div><code class="text-accentLight">{{TIME}}</code> <span class="text-textSecondary">— ISO timestamp</span></div><div><code class="text-accentLight">{{PROBABILITY}}</code> <span class="text-textSecondary">— drive activation probability (0.2–1.0)</span></div></div></details>',1))])])}}}),oc={class:"animate-fade-in"},rc={class:"glass rounded-xl p-6 mb-6"},lc={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},ac={key:0,class:"glass rounded-xl p-4 mb-4 border border-accent/30"},ic={class:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-3"},cc={class:"flex items-center gap-4 mb-3"},uc={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer"},dc={class:"flex items-center gap-2"},fc={key:0,class:"text-sm text-warn"},pc={key:1,class:"text-center py-8 text-textSecondary text-sm"},mc={key:2,class:"text-center text-textSecondary py-12"},xc={key:3,class:"space-y-2"},vc=["onClick"],hc={class:"flex items-start justify-between gap-3"},gc={class:"flex-1 min-w-0"},yc={class:"flex items-center gap-2 mb-1"},bc={class:"font-medium text-sm"},_c={key:0,class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},wc={class:"flex flex-wrap gap-1.5 mt-1"},kc=["title"],Sc={key:0,class:"glass rounded-xl p-6"},$c={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Cc={class:"text-lg font-semibold"},Tc={class:"text-sm text-textSecondary mt-1"},Ec={class:"flex items-center gap-2"},Pc={key:0,class:"text-sm text-success"},Ac={key:1,class:"text-sm text-warn"},Ic={class:"grid grid-cols-1 sm:grid-cols-3 gap-3 mb-4"},Mc=["value"],Oc={class:"flex items-end"},Dc={class:"flex items-center gap-2 text-sm text-textSecondary cursor-pointer pb-2"},Rc=He({__name:"SkillsTab",setup(e){const t=w([]),s=w(!0),n=w(null),r=w(""),l=w(""),a=w(!1),u=w(""),d=w(""),x=w(!1),f=w(""),m=w(""),v=w(!1),k=w("");async function F(){s.value=!0;try{const S=await he("/api/skills");t.value=S.skills||[]}finally{s.value=!1}}function $(S){return S?S.includes(".remote-copilot-mcp")&&S.includes("skills")?"user":S.endsWith(".default.md")?"default":S.endsWith(".skill.md")?"project":"unknown":"unknown"}function N(S){const j={user:"background:rgba(99,102,241,0.15);color:#818cf8",default:"background:rgba(107,114,128,0.15);color:#9ca3af",project:"background:rgba(34,197,94,0.15);color:#4ade80",unknown:"background:rgba(107,114,128,0.15);color:#9ca3af"};return j[S]||j.unknown}function C(S){n.value=S,r.value=S.content,l.value=(S.triggers||[]).join(", "),a.value=!!S.replacesOrchestrator,x.value=!1}function E(){n.value=null,d.value=""}function R(S,j,G,ae){let z=`---
|
|
65
|
+
name: ${S}
|
|
66
66
|
triggers:
|
|
67
|
-
`;return
|
|
68
|
-
`}),
|
|
69
|
-
`),
|
|
67
|
+
`;return j.forEach(M=>{z+=` - ${M.trim()}
|
|
68
|
+
`}),G&&(z+=`replaces_orchestrator: true
|
|
69
|
+
`),z+=`---
|
|
70
70
|
|
|
71
|
-
`,
|
|
72
|
-
`);try{const F=await fetch(`/api/skills/${encodeURIComponent(K)}`,{method:"PUT",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ue})});if(!F.ok)throw new Error(F.statusText);A.value="Created ✓",h.value=!1,await H();const L=t.value.find(J=>J.name===K);L&&k(L)}catch(F){A.value="Error: "+F.message}}return We(H),(K,R)=>(x(),g("div",oc,[r("div",rc,[r("div",lc,[R[8]||(R[8]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Skill Library"),r("p",{class:"text-sm text-textSecondary mt-1"},"Manage intent-routing skills — user overrides, defaults, and project skills")],-1)),r("button",{onClick:R[0]||(R[0]=z=>{h.value=!h.value,n.value=null}),class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + New Skill ")]),h.value?(x(),g("div",ic,[R[12]||(R[12]=r("h4",{class:"text-sm font-semibold mb-3"},"Create New Skill",-1)),r("div",ac,[r("div",null,[R[9]||(R[9]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),se(r("input",{"onUpdate:modelValue":R[1]||(R[1]=z=>d.value=z),type:"text",placeholder:"my-skill",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,d.value]])]),r("div",null,[R[10]||(R[10]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),se(r("input",{"onUpdate:modelValue":R[2]||(R[2]=z=>m.value=z),type:"text",placeholder:"trigger1, trigger2",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},null,512),[[re,m.value]])])]),r("div",cc,[r("label",uc,[se(r("input",{"onUpdate:modelValue":R[3]||(R[3]=z=>b.value=z),type:"checkbox",class:"rounded"},null,512),[[ao,b.value]]),R[11]||(R[11]=r("span",null,"Replaces orchestrator",-1))])]),r("div",dc,[r("button",{onClick:X,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Create"),r("button",{onClick:R[4]||(R[4]=z=>h.value=!1),class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Cancel"),A.value?(x(),g("span",fc,v(A.value),1)):W("",!0)])])):W("",!0),s.value?(x(),g("div",pc,"Loading...")):t.value.length===0?(x(),g("div",mc,"No skills loaded")):(x(),g("div",hc,[(x(!0),g(ne,null,ve(t.value,z=>{var ue;return x(),g("div",{key:z.name,onClick:F=>k(z),class:G(["glass rounded-xl p-4 cursor-pointer hover:bg-cardHover transition border",((ue=n.value)==null?void 0:ue.name)===z.name?"border-accent":"border-transparent"])},[r("div",gc,[r("div",vc,[r("div",yc,[r("span",bc,v(z.name),1),r("span",{class:"type-badge",style:Lt(w(C(z.source)))},v(C(z.source)),5),z.replacesOrchestrator?(x(),g("span",_c,"REPLACES ORCH")):W("",!0)]),r("div",wc,[(x(!0),g(ne,null,ve(z.triggers||[],F=>(x(),g("span",{key:F,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},v(F),1))),128))])]),r("div",{class:"text-xs text-muted font-mono shrink-0 max-w-[200px] truncate",title:z.source||""},v((z.source||"").split(/[\\/]/).pop()||""),9,kc)])],10,xc)}),128))]))]),n.value?(x(),g("div",Sc,[r("div",$c,[r("div",null,[r("h3",Cc,"Edit: "+v(n.value.name),1),r("p",Tc,v(n.value.source||"(unknown source)"),1)]),r("div",Ac,[c.value?(x(),g("span",Ec,v(c.value),1)):W("",!0),u.value?(x(),g("span",Ic,v(u.value),1)):W("",!0),C(n.value.source)==="user"?(x(),g("button",{key:2,onClick:Z,class:"px-4 py-2 rounded-xl bg-card hover:bg-red-900/40 border border-gray-700 hover:border-red-700 text-sm text-textSecondary hover:text-red-400 transition",title:"Remove user override (reverts to default)"},"Remove override")):W("",!0),r("button",{onClick:S,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Close"),r("button",{onClick:P,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),r("div",Pc,[r("div",null,[R[13]||(R[13]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),r("input",{value:n.value.name,type:"text",readonly:"",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono opacity-60 cursor-not-allowed"},null,8,Mc)]),r("div",null,[R[14]||(R[14]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),se(r("input",{"onUpdate:modelValue":R[5]||(R[5]=z=>l.value=z),type:"text",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},null,512),[[re,l.value]])]),r("div",Oc,[r("label",Dc,[se(r("input",{"onUpdate:modelValue":R[6]||(R[6]=z=>a.value=z),type:"checkbox",class:"rounded"},null,512),[[ao,a.value]]),R[15]||(R[15]=r("span",null,"Replaces orchestrator",-1))])])]),se(r("textarea",{"onUpdate:modelValue":R[7]||(R[7]=z=>o.value=z),rows:"20",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:"Skill body (markdown)..."},null,512),[[re,o.value]])])):W("",!0)]))}}),jc={class:"animate-fade-in space-y-6"},Nc={class:"glass rounded-xl p-6"},Lc={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},Uc={class:"flex items-center gap-3"},Vc={key:0,class:"mt-4 p-4 rounded-xl bg-surface border border-gray-700/50 space-y-3"},Fc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3"},Bc=["value"],Hc={class:"flex justify-end"},Kc=["disabled"],Wc={key:0,class:"text-center py-12 text-textSecondary"},zc={key:1,class:"text-center py-8 text-danger text-sm"},Jc={key:2,class:"text-center py-12 text-textSecondary"},qc={key:3},Gc={class:"space-y-3"},Yc={class:"p-4"},Zc={class:"flex flex-wrap items-center gap-3"},Qc=["onBlur"],Xc=["onDblclick"],eu={class:"text-xs text-muted font-mono"},tu=["value","onChange"],su=["value"],nu={class:"text-xs text-muted"},ou=["onKeyup","onBlur"],ru=["title","onDblclick"],lu={class:"ml-auto flex items-center gap-3"},iu=["onClick","disabled"],au={class:"flex items-center gap-1.5"},cu=["onClick"],uu={class:"flex items-center gap-1.5"},du=["onClick"],fu={class:"flex items-center gap-1.5"},pu=["onClick"],mu=["onClick"],hu=["onClick"],xu=["onClick"],gu={key:0,class:"mt-3 p-3 rounded-lg bg-surface border border-purple-500/20 space-y-2"},vu={class:"grid grid-cols-1 sm:grid-cols-3 gap-2"},yu=["value"],bu={class:"flex items-center gap-2"},_u=["onClick","disabled"],wu={key:0,class:"border-t border-gray-700/30 bg-surface/30 px-4 py-3 space-y-2"},ku={key:0,class:"text-xs text-muted py-1"},Su={class:"text-sm font-medium"},$u={class:"text-xs text-muted font-mono"},Cu=["value","onChange"],Tu=["value"],Au={class:"text-xs text-muted"},Eu=["onBlur","onKeyup"],Iu=["title","onDblclick"],Pu={class:"ml-auto flex items-center gap-3"},Mu=["onClick","disabled"],Ou=["onClick","disabled"],Du=["onClick","disabled"],Ru={key:2,class:"flex items-center gap-1.5"},ju=["onClick"],Nu={key:3,class:"flex items-center gap-1.5"},Lu=["onClick"],Uu={key:4,class:"flex items-center gap-1.5"},Vu=["onClick"],Fu=["onClick"],Bu={key:4},Hu={class:"space-y-2"},Ku={class:"font-medium"},Wu={class:"text-xs text-muted font-mono"},zu={class:"text-xs text-textSecondary"},Ju={class:"text-xs text-muted"},qu={class:"ml-auto flex items-center gap-2"},Gu=["onClick","disabled"],Yu=["onClick","disabled"],Zu=["onClick"],Qu={key:5},Xu={class:"space-y-2"},ed={class:"font-medium"},td={class:"text-xs text-muted font-mono"},sd=["value","onChange"],nd=["value"],od={class:"text-xs text-muted"},rd=["onBlur","onKeyup"],ld=["title","onDblclick"],id={class:"ml-auto flex items-center gap-3"},ad=["onClick","disabled"],cd=["onClick","disabled"],ud={class:"flex items-center gap-1.5"},dd=["onClick"],fd={class:"flex items-center gap-1.5"},pd=["onClick"],md={class:"flex items-center gap-1.5"},hd=["onClick"],xd=["onClick"],gd={key:6},vd={class:"space-y-2"},yd={class:"font-medium"},bd={class:"text-xs text-muted font-mono"},_d=["value","onChange"],wd=["value"],kd={class:"text-xs text-muted"},Sd=it({__name:"ThreadsTab",setup(e){const t=$([]),s=$(!0),n=$(""),o=$({}),l=$(new Set),a=$(!1),c=$({name:"",threadId:0,client:"claude",workingDirectory:""}),u=$(""),h=$(!1),d=$(null),m=$(""),b=$(null),A=$(""),H=$(null),C=$({name:"",threadId:0,client:"claude",workingDirectory:""}),w=$(""),k=$(!1),S=$(null),O=$(null),P=$(null),Z=["claude","copilot","codex","openai_codex","copilot_claude","copilot_codex","cursor"],X={root:{emoji:"🟢",classes:"bg-green-500/20 text-green-400 border-green-500/30"},daily:{emoji:"🔵",classes:"bg-blue-500/20 text-blue-400 border-blue-500/30"},branch:{emoji:"🟣",classes:"bg-purple-500/20 text-purple-400 border-purple-500/30"},worker:{emoji:"🟡",classes:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30"}},K=Re(()=>t.value.filter(N=>N.type==="root")),R=Re(()=>t.value.filter(N=>N.type==="daily")),z=Re(()=>t.value.filter(N=>N.type==="branch")),ue=Re(()=>t.value.filter(N=>N.type==="worker"));async function F(){s.value=!0,n.value="";try{const N=await be("/api/threads");t.value=N.threads??[]}catch(N){n.value=N.message||"Failed to load threads"}finally{s.value=!1}}async function L(N){try{const _=await be(`/api/threads/${N}/children`);o.value[N]=_.threads??[]}catch{o.value[N]=[]}}function J(N){l.value.has(N)?l.value.delete(N):(l.value.add(N),L(N))}async function oe(){if(!(!c.value.name.trim()||!c.value.threadId)){h.value=!0,u.value="";try{const N=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:c.value.threadId,name:c.value.name.trim(),type:"root",client:c.value.client,keepAlive:!0,...c.value.workingDirectory.trim()?{workingDirectory:c.value.workingDirectory.trim()}:{}})});if(!N.ok){const _=await N.json().catch(()=>({error:N.statusText}));throw new Error(_.error??N.statusText)}u.value="Created ✓",c.value={name:"",threadId:0,client:"claude",workingDirectory:""},a.value=!1,setTimeout(()=>{u.value=""},3e3),await F()}catch(N){u.value="Error: "+N.message}finally{h.value=!1}}}async function _e(N){if(!(!C.value.name.trim()||!C.value.threadId)){k.value=!0,w.value="";try{const _=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:C.value.threadId,name:C.value.name.trim(),type:"branch",rootThreadId:N,client:C.value.client,...C.value.workingDirectory.trim()?{workingDirectory:C.value.workingDirectory.trim()}:{}})});if(!_.ok){const i=await _.json().catch(()=>({error:_.statusText}));throw new Error(i.error??_.statusText)}w.value="Branch created ✓",C.value={name:"",threadId:0,client:"claude",workingDirectory:""},H.value=null,setTimeout(()=>{w.value=""},3e3),await F(),L(N)}catch(_){w.value="Error: "+_.message}finally{k.value=!1}}}function Se(N){d.value=N.threadId,m.value=N.name}async function pe(N){const _=m.value.trim();if(d.value=null,!!_)try{const i=await fetch(`/api/threads/${N}`,{method:"PATCH",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({name:_})});if(!i.ok)throw new Error(i.statusText);await F()}catch(i){n.value="Failed to rename thread: "+i.message}}function le(N){b.value=N.threadId,A.value=N.workingDirectory??""}async function B(N){const _=A.value.trim();b.value=null;try{const i=await fetch(`/api/threads/${N}`,{method:"PATCH",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({workingDirectory:_||null})});if(!i.ok)throw new Error(i.statusText);await F()}catch(i){n.value="Failed to update working directory: "+i.message}}async function D(N){try{const _=await fetch(`/api/threads/${N.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({keepAlive:!N.keepAlive})});if(!_.ok)throw new Error(_.statusText);await F()}catch(_){n.value="Failed to toggle keep-alive: "+_.message}}async function Ce(N,_){try{const i=await fetch(`/api/threads/${N.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({client:_})});if(!i.ok)throw new Error(i.statusText);await F()}catch(i){n.value="Failed to change agent type: "+i.message}}async function ke(N){try{const _=await fetch(`/api/threads/${N.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({dailyRotation:!N.dailyRotation})});if(!_.ok)throw new Error(_.statusText);await F()}catch(_){n.value="Failed to toggle daily rotation: "+_.message}}async function de(N){try{const _=await fetch(`/api/threads/${N.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({autonomousMode:!N.autonomousMode})});if(!_.ok)throw new Error(_.statusText);await F()}catch(_){n.value="Failed to toggle autonomous mode: "+_.message}}async function ze(N){if(confirm(`Archive thread "${N.name}" (${N.threadId})?`))try{const _=await fetch(`/api/threads/${N.threadId}`,{method:"DELETE",headers:{Authorization:`Bearer ${ye()}`}});if(!_.ok)throw new Error(_.statusText);await F()}catch(_){n.value="Failed to archive: "+_.message}}async function It(N){if(confirm(`Start thread "${N.name}" (${N.threadId})?`)){S.value=N.threadId;try{const _=await fetch(`/api/threads/${N.threadId}/start`,{method:"POST",headers:{Authorization:`Bearer ${ye()}`}});if(!_.ok){const i=await _.json().catch(()=>({error:_.statusText}));throw new Error(i.error??_.statusText)}await F()}catch(_){n.value="Failed to start thread: "+_.message}finally{S.value=null}}}function at(N){u.value="Sync to Root — not yet implemented",setTimeout(()=>{u.value=""},3e3)}async function Pt(N){if(confirm(`Convert "${N.name}" to a root thread? This will detach it from its parent.`)){P.value=N.threadId;try{const _=await fetch(`/api/threads/${N.threadId}/convert-to-root`,{method:"POST",headers:{Authorization:`Bearer ${ye()}`}});if(!_.ok){const i=await _.json().catch(()=>({error:_.statusText}));throw new Error(i.error??_.statusText)}n.value="",u.value=`Converted "${N.name}" to root ✓`,setTimeout(()=>{u.value=""},3e3),await F()}catch(_){n.value="Failed to convert: "+_.message}finally{P.value=null}}}function ct(N){if(!N)return"—";const _=new Date(N),p=Date.now()-_.getTime();return p<6e4?"just now":p<36e5?`${Math.floor(p/6e4)}m ago`:p<864e5?`${Math.floor(p/36e5)}h ago`:_.toLocaleDateString()}function bt(N){return N==="active"?"text-success":N==="archived"?"text-muted":"text-warn"}return We(F),(N,_)=>(x(),g("div",jc,[r("div",Nc,[r("div",Lc,[_[18]||(_[18]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Thread Registry"),r("p",{class:"text-sm text-textSecondary mt-1"},"Manage conversation threads, branches, and daily sessions")],-1)),r("div",Uc,[u.value?(x(),g("span",{key:0,class:G([u.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},v(u.value),3)):W("",!0),r("button",{onClick:_[0]||(_[0]=i=>a.value=!a.value),class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},v(a.value?"Cancel":"+ New Root Thread"),1),r("button",{onClick:F,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),a.value?(x(),g("div",Vc,[r("div",Fc,[r("div",null,[_[19]||(_[19]=r("label",{class:"block text-xs text-textSecondary mb-1"},"Name",-1)),se(r("input",{"onUpdate:modelValue":_[1]||(_[1]=i=>c.value.name=i),type:"text",placeholder:"e.g. Main Workspace",class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[re,c.value.name]])]),r("div",null,[_[20]||(_[20]=r("label",{class:"block text-xs text-textSecondary mb-1"},"Thread ID",-1)),se(r("input",{"onUpdate:modelValue":_[2]||(_[2]=i=>c.value.threadId=i),type:"number",min:"1",placeholder:"Telegram thread ID",class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[re,c.value.threadId,void 0,{number:!0}]])]),r("div",null,[_[21]||(_[21]=r("label",{class:"block text-xs text-textSecondary mb-1"},"Client",-1)),se(r("select",{"onUpdate:modelValue":_[3]||(_[3]=i=>c.value.client=i),class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition appearance-none"},[(x(),g(ne,null,ve(Z,i=>r("option",{key:i,value:i},v(i),9,Bc)),64))],512),[[Bt,c.value.client]])])]),r("div",null,[_[22]||(_[22]=r("label",{class:"block text-xs text-textSecondary mb-1"},"Working Directory (optional)",-1)),se(r("input",{"onUpdate:modelValue":_[4]||(_[4]=i=>c.value.workingDirectory=i),type:"text",placeholder:"e.g. C:\\src\\my-project",class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition font-mono"},null,512),[[re,c.value.workingDirectory]])]),r("div",Hc,[r("button",{onClick:oe,disabled:h.value||!c.value.name.trim()||!c.value.threadId,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},v(h.value?"Creating…":"Create Root Thread"),9,Kc)])])):W("",!0)]),s.value&&t.value.length===0?(x(),g("div",Wc,"Loading threads…")):n.value?(x(),g("div",zc,v(n.value),1)):t.value.length===0?(x(),g("div",Jc,"No threads registered")):W("",!0),K.value.length>0?(x(),g("div",qc,[_[29]||(_[29]=r("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟢 Root Threads",-1)),r("div",Gc,[(x(!0),g(ne,null,ve(K.value,i=>{var p,y;return x(),g("div",{key:i.id,class:"glass rounded-xl overflow-hidden"},[r("div",Yc,[r("div",Zc,[r("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(p=X[i.type])==null?void 0:p.classes])},v((y=X[i.type])==null?void 0:y.emoji)+" "+v(i.type.toUpperCase()),3),d.value===i.threadId?se((x(),g("input",{key:0,"onUpdate:modelValue":_[5]||(_[5]=f=>m.value=f),onBlur:f=>pe(i.threadId),onKeyup:[_[6]||(_[6]=Qe(f=>f.target.blur(),["enter"])),_[7]||(_[7]=Qe(f=>d.value=null,["escape"]))],class:"font-semibold bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-40",ref_for:!0,ref:"nameInput"},null,40,Qc)),[[re,m.value]]):(x(),g("span",{key:1,class:"font-semibold cursor-pointer hover:text-accent transition",onDblclick:f=>Se(i),title:"Double-click to rename"},v(i.name),41,Xc)),r("span",{class:G(["text-xs font-medium",bt(i.status)])},v(i.status),3),r("span",eu,"ID: "+v(i.threadId),1),r("select",{value:i.client,onChange:f=>Ce(i,f.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(x(),g(ne,null,ve(Z,f=>r("option",{key:f,value:f},v(f),9,su)),64))],40,tu),r("span",nu,v(ct(i.lastActiveAt)),1),b.value===i.threadId?se((x(),g("input",{key:2,"onUpdate:modelValue":_[8]||(_[8]=f=>A.value=f),onKeyup:[Qe(f=>B(i.threadId),["enter"]),_[9]||(_[9]=Qe(f=>b.value=null,["escape"]))],onBlur:f=>B(i.threadId),type:"text",placeholder:"Set working directory…",class:"text-xs font-mono bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-48"},null,40,ou)),[[re,A.value]]):(x(),g("span",{key:3,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(i.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:f=>le(i)},"📁 "+v(i.workingDirectory??"—"),41,ru)),r("div",lu,[r("button",{onClick:f=>It(i),disabled:S.value===i.threadId||i.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},v(S.value===i.threadId?"Starting…":"▶ Start"),9,iu),r("div",au,[r("button",{onClick:f=>D(i),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[r("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,cu),_[23]||(_[23]=r("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),r("div",uu,[r("button",{onClick:f=>ke(i),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[r("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,du),_[24]||(_[24]=r("span",{class:"text-xs text-muted"},"Daily",-1))]),r("div",fu,[r("button",{onClick:f=>de(i),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[r("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,pu),_[25]||(_[25]=r("span",{class:"text-xs text-muted"},"Auto",-1))]),r("button",{onClick:f=>J(i.threadId),class:"px-2 py-1 rounded-lg text-xs bg-card border border-gray-700 hover:bg-surface transition"},v(l.value.has(i.threadId)?"▾ Children":"▸ Children"),9,mu),r("button",{onClick:f=>{H.value=H.value===i.threadId?null:i.threadId,C.value={name:"",threadId:0,client:"claude",workingDirectory:""},w.value=""},class:"px-2 py-1 rounded-lg text-xs bg-purple-500/20 text-purple-400 border border-purple-500/30 hover:bg-purple-500/30 transition"}," + Branch ",8,hu),r("button",{onClick:f=>ze(i),class:"px-2 py-1 rounded-lg text-xs bg-red-500/20 text-red-400 border border-red-500/30 hover:bg-red-500/30 transition"}," Archive ",8,xu)])]),H.value===i.threadId?(x(),g("div",gu,[r("div",vu,[se(r("input",{"onUpdate:modelValue":_[10]||(_[10]=f=>C.value.name=f),type:"text",placeholder:"Branch name",class:"px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[re,C.value.name]]),se(r("input",{"onUpdate:modelValue":_[11]||(_[11]=f=>C.value.threadId=f),type:"number",min:"1",placeholder:"Thread ID",class:"px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[re,C.value.threadId,void 0,{number:!0}]]),se(r("select",{"onUpdate:modelValue":_[12]||(_[12]=f=>C.value.client=f),class:"px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition appearance-none"},[(x(),g(ne,null,ve(Z,f=>r("option",{key:f,value:f},v(f),9,yu)),64))],512),[[Bt,C.value.client]])]),se(r("input",{"onUpdate:modelValue":_[13]||(_[13]=f=>C.value.workingDirectory=f),type:"text",placeholder:"Working directory (optional)",class:"w-full px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition font-mono"},null,512),[[re,C.value.workingDirectory]]),r("div",bu,[r("button",{onClick:f=>_e(i.threadId),disabled:k.value||!C.value.name.trim()||!C.value.threadId,class:"px-3 py-1.5 rounded-lg bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-xs font-medium transition"},v(k.value?"Creating…":"Create Branch"),9,_u),w.value?(x(),g("span",{key:0,class:G([w.value.startsWith("Error")?"text-danger":"text-success","text-xs"])},v(w.value),3)):W("",!0)])])):W("",!0)]),l.value.has(i.threadId)&&o.value[i.threadId]?(x(),g("div",wu,[o.value[i.threadId].length===0?(x(),g("div",ku,"No children")):W("",!0),(x(!0),g(ne,null,ve(o.value[i.threadId],f=>{var T,E;return x(),g("div",{key:f.id,class:"flex flex-wrap items-center gap-2 px-3 py-2 rounded-lg bg-card/50 border border-gray-700/30"},[r("span",{class:G(["inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-xs font-medium border",(T=X[f.type])==null?void 0:T.classes])},v((E=X[f.type])==null?void 0:E.emoji)+" "+v(f.type.toUpperCase()),3),r("span",Su,v(f.name),1),r("span",{class:G(["text-xs",bt(f.status)])},v(f.status),3),r("span",$u,"ID: "+v(f.threadId),1),r("select",{value:f.client,onChange:M=>Ce(f,M.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(x(),g(ne,null,ve(Z,M=>r("option",{key:M,value:M},v(M),9,Tu)),64))],40,Cu),r("span",Au,v(ct(f.lastActiveAt)),1),f.type==="branch"&&b.value===f.threadId?se((x(),g("input",{key:0,"onUpdate:modelValue":_[14]||(_[14]=M=>A.value=M),onBlur:M=>B(f.threadId),onKeyup:[Qe(M=>B(f.threadId),["enter"]),_[15]||(_[15]=Qe(M=>b.value=null,["escape"]))],type:"text",placeholder:"Set working directory…",class:"text-xs font-mono bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-48"},null,40,Eu)),[[re,A.value]]):f.type==="branch"?(x(),g("span",{key:1,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(f.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:M=>le(f)},"📁 "+v(f.workingDirectory??"—"),41,Iu)):W("",!0),r("div",Pu,[r("button",{onClick:M=>It(f),disabled:S.value===f.threadId||f.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},v(S.value===f.threadId?"Starting…":"▶ Start"),9,Mu),f.rootThreadId?(x(),g("button",{key:0,onClick:M=>at(),disabled:O.value===f.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},v(O.value===f.threadId?"Syncing…":"⟳ Sync to Root"),9,Ou)):W("",!0),f.type==="branch"||f.type==="daily"?(x(),g("button",{key:1,onClick:M=>Pt(f),disabled:P.value===f.threadId,class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Convert to independent root thread"},v(P.value===f.threadId?"Converting…":"↑ To Root"),9,Du)):W("",!0),f.type==="branch"?(x(),g("div",Ru,[r("button",{onClick:M=>D(f),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",f.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[r("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",f.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,ju),_[26]||(_[26]=r("span",{class:"text-xs text-muted"},"Keep-alive",-1))])):W("",!0),f.type==="branch"?(x(),g("div",Nu,[r("button",{onClick:M=>ke(f),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",f.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[r("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",f.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,Lu),_[27]||(_[27]=r("span",{class:"text-xs text-muted"},"Daily",-1))])):W("",!0),f.type==="branch"?(x(),g("div",Uu,[r("button",{onClick:M=>de(f),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",f.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[r("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",f.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,Vu),_[28]||(_[28]=r("span",{class:"text-xs text-muted"},"Auto",-1))])):W("",!0),f.type!=="root"?(x(),g("button",{key:5,onClick:M=>ze(f),class:"px-2 py-0.5 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,Fu)):W("",!0)])])}),128))])):W("",!0)])}),128))])])):W("",!0),R.value.length>0?(x(),g("div",Bu,[_[30]||(_[30]=r("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🔵 Daily Sessions",-1)),r("div",Hu,[(x(!0),g(ne,null,ve(R.value,i=>{var p,y;return x(),g("div",{key:i.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[r("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(p=X[i.type])==null?void 0:p.classes])},v((y=X[i.type])==null?void 0:y.emoji)+" "+v(i.type.toUpperCase()),3),r("span",Ku,v(i.name),1),r("span",{class:G(["text-xs font-medium",bt(i.status)])},v(i.status),3),r("span",Wu,"ID: "+v(i.threadId),1),r("span",zu,v(i.client),1),r("span",Ju,v(ct(i.lastActiveAt)),1),r("div",qu,[r("button",{onClick:f=>It(i),disabled:S.value===i.threadId||i.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},v(S.value===i.threadId?"Starting…":"▶ Start"),9,Gu),i.rootThreadId?(x(),g("button",{key:0,onClick:f=>at(),disabled:O.value===i.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},v(O.value===i.threadId?"Syncing…":"⟳ Sync to Root"),9,Yu)):W("",!0),r("button",{onClick:f=>ze(i),class:"px-2 py-1 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,Zu)])])}),128))])])):W("",!0),z.value.length>0?(x(),g("div",Qu,[_[34]||(_[34]=r("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟣 Branches",-1)),r("div",Xu,[(x(!0),g(ne,null,ve(z.value,i=>{var p,y;return x(),g("div",{key:i.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[r("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(p=X[i.type])==null?void 0:p.classes])},v((y=X[i.type])==null?void 0:y.emoji)+" "+v(i.type.toUpperCase()),3),r("span",ed,v(i.name),1),r("span",{class:G(["text-xs font-medium",bt(i.status)])},v(i.status),3),r("span",td,"ID: "+v(i.threadId),1),r("select",{value:i.client,onChange:f=>Ce(i,f.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(x(),g(ne,null,ve(Z,f=>r("option",{key:f,value:f},v(f),9,nd)),64))],40,sd),r("span",od,v(ct(i.lastActiveAt)),1),b.value===i.threadId?se((x(),g("input",{key:0,"onUpdate:modelValue":_[16]||(_[16]=f=>A.value=f),onBlur:f=>B(i.threadId),onKeyup:[Qe(f=>B(i.threadId),["enter"]),_[17]||(_[17]=Qe(f=>b.value=null,["escape"]))],type:"text",placeholder:"Set working directory…",class:"text-xs font-mono bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-48"},null,40,rd)),[[re,A.value]]):(x(),g("span",{key:1,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(i.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:f=>le(i)},"📁 "+v(i.workingDirectory??"—"),41,ld)),r("div",id,[r("button",{onClick:f=>It(i),disabled:S.value===i.threadId||i.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},v(S.value===i.threadId?"Starting…":"▶ Start"),9,ad),i.rootThreadId?(x(),g("button",{key:0,onClick:f=>at(),disabled:O.value===i.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},v(O.value===i.threadId?"Syncing…":"⟳ Sync to Root"),9,cd)):W("",!0),r("div",ud,[r("button",{onClick:f=>D(i),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[r("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,dd),_[31]||(_[31]=r("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),r("div",fd,[r("button",{onClick:f=>ke(i),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[r("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,pd),_[32]||(_[32]=r("span",{class:"text-xs text-muted"},"Daily",-1))]),r("div",md,[r("button",{onClick:f=>de(i),class:G(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",i.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[r("span",{class:G(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",i.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,hd),_[33]||(_[33]=r("span",{class:"text-xs text-muted"},"Auto",-1))]),r("button",{onClick:f=>ze(i),class:"px-2 py-1 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,xd)])])}),128))])])):W("",!0),ue.value.length>0?(x(),g("div",gd,[_[36]||(_[36]=r("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟡 Workers",-1)),r("div",vd,[(x(!0),g(ne,null,ve(ue.value,i=>{var p,y;return x(),g("div",{key:i.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[r("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(p=X[i.type])==null?void 0:p.classes])},v((y=X[i.type])==null?void 0:y.emoji)+" "+v(i.type.toUpperCase()),3),r("span",yd,v(i.name),1),r("span",{class:G(["text-xs font-medium",bt(i.status)])},v(i.status),3),r("span",bd,"ID: "+v(i.threadId),1),r("select",{value:i.client,onChange:f=>Ce(i,f.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[(x(),g(ne,null,ve(Z,f=>r("option",{key:f,value:f},v(f),9,wd)),64))],40,_d),r("span",kd,v(ct(i.lastActiveAt)),1),_[35]||(_[35]=r("span",{class:"ml-auto text-xs text-muted italic"},"auto-managed",-1))])}),128))])])):W("",!0)]))}}),$d={class:"animate-fade-in"},Cd={class:"glass rounded-xl p-6 mb-6"},Td={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ad={class:"flex items-center gap-3"},Ed={key:0,class:"text-center py-8 text-textSecondary text-sm"},Id={key:1,class:"text-center py-8 text-danger text-sm"},Pd={key:2,class:"text-center text-textSecondary py-12"},Md={key:3,class:"space-y-2"},Od={key:0,class:"glass rounded-xl p-4 border border-gray-700/50 opacity-75"},Dd={class:"flex items-center justify-between gap-3"},Rd={class:"flex items-center gap-2 min-w-0"},jd={class:"flex items-center justify-between gap-3"},Nd={class:"flex-1 min-w-0"},Ld={class:"flex items-center gap-2 mb-1"},Ud={class:"font-medium text-sm font-mono"},Vd={class:"text-xs text-muted font-mono truncate"},Fd={class:"flex items-center gap-2 shrink-0"},Bd=["onClick"],Hd=["onClick","disabled"],Kd={key:0,class:"glass rounded-xl p-6 border border-accent/30"},Wd={class:"text-lg font-semibold mb-4"},zd={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Jd=["readonly"],qd={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Gd={class:"mb-4"},Yd={class:"flex items-center justify-between mb-2"},Zd=["onUpdate:modelValue"],Qd=["onUpdate:modelValue"],Xd=["onClick"],ef={key:0,class:"text-xs text-muted italic"},tf={class:"mb-4"},sf={class:"mb-4"},nf={class:"flex items-center justify-between mb-2"},of=["onUpdate:modelValue"],rf=["onUpdate:modelValue"],lf=["onClick"],af={key:0,class:"text-xs text-muted italic"},cf={class:"flex items-center gap-3 flex-wrap"},uf=["disabled"],df={key:0,class:"text-sm text-danger"},Gt="sensorium-mcp",ff=it({__name:"McpServersTab",setup(e){const t=$({}),s=$(!0),n=$(""),o=$(""),l=$(!0),a=$(!1),c=$(null),u=$(!1),h=$(null),d=$(""),m=$("stdio"),b=$(""),A=$(""),H=$(""),C=$([]),w=$([]),k=$(""),S=Re(()=>Object.entries(t.value).filter(([F])=>F!==Gt));async function O(){s.value=!0,n.value="";try{const F=await be("/api/mcp-servers");t.value=F.servers||{}}catch(F){n.value="Failed to load MCP servers: "+F.message}finally{s.value=!1}}function P(F){return F==="stdio"?"background:rgba(99,102,241,0.15);color:#818cf8":"background:rgba(34,197,94,0.15);color:#4ade80"}function Z(){h.value=null,d.value="",m.value="stdio",b.value="",A.value="",H.value="",C.value=[],w.value=[],k.value="",u.value=!0}function X(F,L){h.value=F,d.value=F,m.value=L.type,b.value=L.command||"",A.value=(L.args||[]).join(" "),H.value=L.url||"",C.value=Object.entries(L.env||{}).map(([J,oe])=>({k:J,v:oe})),w.value=Object.entries(L.headers||{}).map(([J,oe])=>({k:J,v:oe})),k.value="",u.value=!0}function K(){u.value=!1,h.value=null}function R(){if(k.value="",!d.value.trim())return k.value="Name is required",!1;if(m.value==="stdio"&&!b.value.trim())return k.value="Command is required for stdio type",!1;if(m.value==="http"){const F=H.value.trim();if(!F)return k.value="URL is required for http type",!1;if(!/^https?:\/\/.+/.test(F))return k.value="URL must start with http:// or https://",!1}return!0}async function z(){if(!R()||a.value)return;a.value=!0;const F=d.value.trim(),L={type:m.value};if(m.value==="stdio"){L.command=b.value.trim();const J=A.value.trim();J&&(L.args=J.split(/\s+/));const oe=Object.fromEntries(C.value.filter(_e=>_e.k.trim()).map(_e=>[_e.k.trim(),_e.v]));Object.keys(oe).length&&(L.env=oe)}else{L.url=H.value.trim();const J=Object.fromEntries(w.value.filter(oe=>oe.k.trim()).map(oe=>[oe.k.trim(),oe.v]));Object.keys(J).length&&(L.headers=J)}try{const J=await fetch("/api/mcp-servers",{method:"POST",headers:{Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},body:JSON.stringify({name:F,config:L})});if(!J.ok)throw new Error(J.statusText);o.value="Saved ✓",l.value=!0,setTimeout(()=>{o.value=""},3e3),K(),await O()}catch(J){k.value="Error: "+J.message}finally{a.value=!1}}async function ue(F){if(confirm(`Delete MCP server "${F}"?`)&&!c.value){c.value=F;try{const L=await fetch(`/api/mcp-servers/${encodeURIComponent(F)}`,{method:"DELETE",headers:{Authorization:`Bearer ${ye()}`}});if(!L.ok)throw new Error(L.statusText);o.value="Deleted ✓",l.value=!0,setTimeout(()=>{o.value=""},3e3),await O()}catch(L){o.value="Error: "+L.message,l.value=!1}finally{c.value=null}}}return We(O),(F,L)=>(x(),g("div",$d,[r("div",Cd,[r("div",Td,[L[7]||(L[7]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"MCP Servers"),r("p",{class:"text-sm text-textSecondary mt-1"},"Manage external MCP server connections (stdio and HTTP)")],-1)),r("div",Ad,[o.value?(x(),g("span",{key:0,class:G(["text-sm",l.value?"text-success":"text-danger"])},v(o.value),3)):W("",!0),r("button",{onClick:Z,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + Add Server ")])]),s.value?(x(),g("div",Ed,"Loading...")):n.value?(x(),g("div",Id,v(n.value),1)):Object.keys(t.value).length===0?(x(),g("div",Pd,"No MCP servers configured")):(x(),g("div",Md,[t.value[Gt]?(x(),g("div",Od,[r("div",Dd,[r("div",Rd,[r("span",{class:"font-medium text-sm font-mono"},v(Gt)),r("span",{class:"type-badge",style:Lt(P(t.value[Gt].type))},v(t.value[Gt].type),5),L[8]||(L[8]=r("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"built-in",-1))]),L[9]||(L[9]=r("span",{class:"text-xs text-muted italic"},"read-only",-1))])])):W("",!0),(x(!0),g(ne,null,ve(S.value,([J,oe])=>{var _e;return x(),g("div",{key:J,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[r("div",jd,[r("div",Nd,[r("div",Ld,[r("span",Ud,v(J),1),r("span",{class:"type-badge",style:Lt(P(oe.type))},v(oe.type),5)]),r("div",Vd,[oe.type==="stdio"?(x(),g(ne,{key:0},[we(v(oe.command)+v((_e=oe.args)!=null&&_e.length?" "+oe.args.join(" "):""),1)],64)):(x(),g(ne,{key:1},[we(v(oe.url),1)],64))])]),r("div",Fd,[r("button",{onClick:Se=>X(J,oe),class:"px-3 py-1.5 rounded-lg bg-card hover:bg-cardHover border border-gray-700 text-xs text-textSecondary hover:text-textPrimary transition"},"Edit",8,Bd),r("button",{onClick:Se=>ue(J),disabled:c.value===J,class:"px-3 py-1.5 rounded-lg bg-card hover:bg-red-900/40 border border-gray-700 hover:border-red-700 text-xs text-textSecondary hover:text-red-400 transition disabled:opacity-50"},v(c.value===J?"…":"Delete"),9,Hd)])])])}),128))]))]),u.value?(x(),g("div",Kd,[r("h3",Wd,v(h.value?`Edit: ${h.value}`:"Add MCP Server"),1),r("div",zd,[r("div",null,[L[10]||(L[10]=r("label",{class:"text-xs text-textSecondary block mb-1"},[we("Name "),r("span",{class:"text-danger"},"*")],-1)),se(r("input",{"onUpdate:modelValue":L[0]||(L[0]=J=>d.value=J),type:"text",readonly:!!h.value,placeholder:"my-server",class:G(["w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition",h.value?"opacity-60 cursor-not-allowed":""])},null,10,Jd),[[re,d.value]])]),r("div",null,[L[12]||(L[12]=r("label",{class:"text-xs text-textSecondary block mb-1"},[we("Type "),r("span",{class:"text-danger"},"*")],-1)),se(r("select",{"onUpdate:modelValue":L[1]||(L[1]=J=>m.value=J),class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...L[11]||(L[11]=[r("option",{value:"stdio"},"stdio",-1),r("option",{value:"http"},"http",-1)])],512),[[Bt,m.value]])])]),m.value==="stdio"?(x(),g(ne,{key:0},[r("div",qd,[r("div",null,[L[13]||(L[13]=r("label",{class:"text-xs text-textSecondary block mb-1"},[we("Command "),r("span",{class:"text-danger"},"*")],-1)),se(r("input",{"onUpdate:modelValue":L[2]||(L[2]=J=>b.value=J),type:"text",placeholder:"node",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,b.value]])]),r("div",null,[L[14]||(L[14]=r("label",{class:"text-xs text-textSecondary block mb-1"},"Args (space-separated)",-1)),se(r("input",{"onUpdate:modelValue":L[3]||(L[3]=J=>A.value=J),type:"text",placeholder:"./server.js --port 3000",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,A.value]])])]),r("div",Gd,[r("div",Yd,[L[15]||(L[15]=r("label",{class:"text-xs text-textSecondary"},"Environment Variables",-1)),r("button",{onClick:L[4]||(L[4]=J=>C.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(x(!0),g(ne,null,ve(C.value,(J,oe)=>(x(),g("div",{key:oe,class:"flex items-center gap-2 mb-2"},[se(r("input",{"onUpdate:modelValue":_e=>J.k=_e,type:"text",placeholder:"KEY",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,Zd),[[re,J.k]]),L[16]||(L[16]=r("span",{class:"text-muted text-xs"},"=",-1)),se(r("input",{"onUpdate:modelValue":_e=>J.v=_e,type:"text",placeholder:"value",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,Qd),[[re,J.v]]),r("button",{onClick:_e=>C.value.splice(oe,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,Xd)]))),128)),C.value.length===0?(x(),g("div",ef,"No env vars")):W("",!0)])],64)):(x(),g(ne,{key:1},[r("div",tf,[L[17]||(L[17]=r("label",{class:"text-xs text-textSecondary block mb-1"},[we("URL "),r("span",{class:"text-danger"},"*")],-1)),se(r("input",{"onUpdate:modelValue":L[5]||(L[5]=J=>H.value=J),type:"text",placeholder:"http://localhost:3000/mcp",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,H.value]])]),r("div",sf,[r("div",nf,[L[18]||(L[18]=r("label",{class:"text-xs text-textSecondary"},"Headers",-1)),r("button",{onClick:L[6]||(L[6]=J=>w.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(x(!0),g(ne,null,ve(w.value,(J,oe)=>(x(),g("div",{key:oe,class:"flex items-center gap-2 mb-2"},[se(r("input",{"onUpdate:modelValue":_e=>J.k=_e,type:"text",placeholder:"Header-Name",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,of),[[re,J.k]]),L[19]||(L[19]=r("span",{class:"text-muted text-xs"},":",-1)),se(r("input",{"onUpdate:modelValue":_e=>J.v=_e,type:"text",placeholder:"value",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,rf),[[re,J.v]]),r("button",{onClick:_e=>w.value.splice(oe,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,lf)]))),128)),w.value.length===0?(x(),g("div",af,"No headers")):W("",!0)])],64)),r("div",cf,[r("button",{onClick:z,disabled:a.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},v(a.value?"Saving…":h.value?"Save Changes":"Add Server"),9,uf),r("button",{onClick:K,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"}," Cancel "),k.value?(x(),g("span",df,v(k.value),1)):W("",!0)])])):W("",!0)]))}}),pf={class:"animate-fade-in"},mf={class:"glass rounded-xl p-6 mb-6"},hf={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},xf={class:"flex items-center gap-3"},gf=["disabled"],vf={key:0,class:"text-center py-8 text-textSecondary text-sm"},yf={key:1,class:"space-y-6"},bf={class:"glass rounded-xl p-4 border border-gray-700/50"},_f={class:"flex items-center gap-4"},wf={class:"flex justify-between text-xs text-muted mt-2"},kf={class:"font-mono"},Sf={key:0,class:"mt-3 px-3 py-2 rounded-lg bg-warn/10 border border-warn/20 text-xs text-warn"},$f={class:"glass rounded-xl p-4 border border-gray-700/50"},Cf={class:"flex items-center gap-4"},Tf={class:"flex justify-between text-xs text-muted mt-2"},Af={class:"font-mono"},Ef={class:"glass rounded-xl p-4 border border-gray-700/50"},If={class:"glass rounded-xl p-4 border border-gray-700/50"},Pf={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},Mf={class:"grid grid-cols-2 gap-4"},Of={class:"text-sm font-medium text-textSecondary"},Df={class:"text-sm font-medium font-mono text-textSecondary"},Rf={class:"text-sm font-medium font-mono text-textSecondary"},jf={class:"mt-3"},Nf=it({__name:"SettingsTab",setup(e){const t=$(!0),s=$(!1),n=$(""),o=$(50),l=$(50),a=$(1440),c=$(1440),u=$("claude-opus-4-6"),h=$("claude-opus-4-6"),d=$("claude-sonnet-4-5"),m=$("claude-sonnet-4-5"),b=Re(()=>o.value!==l.value||a.value!==c.value||u.value!==h.value||d.value!==m.value);async function A(){t.value=!0;try{const[C,w,k,S]=await Promise.all([be("/api/settings/bootstrap-message-count"),be("/api/settings/wait-timeout"),be("/api/settings/default-thread-model"),be("/api/settings/default-worker-model")]);o.value=C.count,l.value=C.count,a.value=w.minutes,c.value=w.minutes,u.value=k.defaultThreadModel,h.value=k.defaultThreadModel,d.value=S.defaultWorkerModel,m.value=S.defaultWorkerModel}finally{t.value=!1}}async function H(){if(s.value=!0,n.value="",!u.value){n.value="Error: Thread model cannot be empty",s.value=!1;return}if(!d.value){n.value="Error: Worker model cannot be empty",s.value=!1;return}try{const C={Authorization:`Bearer ${ye()}`,"Content-Type":"application/json"},[w,k,S,O]=await Promise.all([fetch("/api/settings/bootstrap-message-count",{method:"POST",headers:C,body:JSON.stringify({count:o.value})}),fetch("/api/settings/wait-timeout",{method:"POST",headers:C,body:JSON.stringify({minutes:a.value})}),fetch("/api/settings/default-thread-model",{method:"POST",headers:C,body:JSON.stringify({model:u.value})}),fetch("/api/settings/default-worker-model",{method:"POST",headers:C,body:JSON.stringify({model:d.value})})]);for(const R of[w,k,S,O])if(!R.ok){const z=await R.json().catch(()=>({error:R.statusText}));throw new Error(z.error??R.statusText)}const P=await w.json(),Z=await k.json(),X=await S.json(),K=await O.json();l.value=P.count,o.value=P.count,c.value=Z.minutes,a.value=Z.minutes,h.value=X.defaultThreadModel,u.value=X.defaultThreadModel,m.value=K.defaultWorkerModel,d.value=K.defaultWorkerModel,n.value="Saved ✓",setTimeout(()=>{n.value=""},3e3)}catch(C){n.value="Error: "+C.message}finally{s.value=!1}}return We(A),(C,w)=>(x(),g("div",pf,[r("div",mf,[r("div",hf,[w[6]||(w[6]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Settings"),r("p",{class:"text-sm text-textSecondary mt-1"},"Configure agent behavior and context injection")],-1)),r("div",xf,[n.value?(x(),g("span",{key:0,class:G([n.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},v(n.value),3)):W("",!0),r("button",{onClick:H,disabled:s.value||t.value||!b.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},v(s.value?"Saving…":"Save"),9,gf)])]),t.value?(x(),g("div",vf,"Loading…")):(x(),g("div",yf,[r("div",bf,[w[10]||(w[10]=r("label",{class:"block text-sm font-medium mb-1"},"Recent Conversation Buffer",-1)),w[11]||(w[11]=r("p",{class:"text-xs text-textSecondary mb-3"},[we(" Number of recent messages injected into the agent's bootstrap context. Set to "),r("span",{class:"font-mono text-accentLight"},"0"),we(" to disable (useful when using VS Code, which maintains its own conversation history). ")],-1)),r("div",_f,[se(r("input",{"onUpdate:modelValue":w[0]||(w[0]=k=>o.value=k),type:"range",min:"0",max:"100",step:"5",class:"flex-1 accent-accent"},null,512),[[re,o.value,void 0,{number:!0}]]),se(r("input",{"onUpdate:modelValue":w[1]||(w[1]=k=>o.value=k),type:"number",min:"0",max:"200",class:"w-20 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono text-center focus:outline-none focus:border-accent transition"},null,512),[[re,o.value,void 0,{number:!0}]])]),r("div",wf,[w[7]||(w[7]=r("span",null,"Off",-1)),r("span",kf,v(o.value)+" messages",1),w[8]||(w[8]=r("span",null,"Max",-1))]),o.value===0?(x(),g("div",Sf,[...w[9]||(w[9]=[we(" Message buffer injection is ",-1),r("strong",null,"disabled",-1),we(". The agent will not see recent conversation history in its bootstrap context. Use this when VS Code (or another IDE) already provides conversation history. ",-1)])])):W("",!0)]),r("div",$f,[w[14]||(w[14]=r("label",{class:"block text-sm font-medium mb-1"},"Poll Timeout (wait_for_instructions)",-1)),w[15]||(w[15]=r("p",{class:"text-xs text-textSecondary mb-3"},[we(" Maximum time (in minutes) a single "),r("span",{class:"font-mono text-accentLight"},"wait_for_instructions"),we(" call will poll before timing out. Claude Code agents use the full value; Copilot agents are capped at 10 min. ")],-1)),r("div",Cf,[se(r("input",{"onUpdate:modelValue":w[2]||(w[2]=k=>a.value=k),type:"range",min:"1",max:"1440",step:"10",class:"flex-1 accent-accent"},null,512),[[re,a.value,void 0,{number:!0}]]),se(r("input",{"onUpdate:modelValue":w[3]||(w[3]=k=>a.value=k),type:"number",min:"1",max:"10080",class:"w-24 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono text-center focus:outline-none focus:border-accent transition"},null,512),[[re,a.value,void 0,{number:!0}]])]),r("div",Tf,[w[12]||(w[12]=r("span",null,"1 min",-1)),r("span",Af,v(a.value>=60?Math.floor(a.value/60)+"h "+a.value%60+"m":a.value+" min"),1),w[13]||(w[13]=r("span",null,"24h",-1))])]),r("div",Ef,[w[16]||(w[16]=r("label",{class:"block text-sm font-medium mb-1"},"Default Thread Model",-1)),w[17]||(w[17]=r("p",{class:"text-xs text-textSecondary mb-3"},[we(" Model used when spawning a normal (orchestrator) Claude thread. Overridden by the "),r("span",{class:"font-mono text-accentLight"},"CLAUDE_MODEL"),we(" env var if set. ")],-1)),se(r("input",{"onUpdate:modelValue":w[4]||(w[4]=k=>u.value=k),type:"text",placeholder:"claude-opus-4-6",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,u.value,void 0,{trim:!0}]])]),r("div",If,[w[18]||(w[18]=r("label",{class:"block text-sm font-medium mb-1"},"Default Worker Model",-1)),w[19]||(w[19]=r("p",{class:"text-xs text-textSecondary mb-3"},[we(" Model used when spawning a worker Claude thread. Overridden by the "),r("span",{class:"font-mono text-accentLight"},"CLAUDE_WORKER_MODEL"),we(" env var if set. ")],-1)),se(r("input",{"onUpdate:modelValue":w[5]||(w[5]=k=>d.value=k),type:"text",placeholder:"claude-sonnet-4-5",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[re,d.value,void 0,{trim:!0}]])]),r("div",Pf,[w[24]||(w[24]=r("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),r("div",Mf,[r("div",null,[w[20]||(w[20]=r("div",{class:"text-xs text-muted mb-1"},"Message Buffer",-1)),r("span",{class:G(["text-sm font-medium",l.value>0?"text-success":"text-textSecondary"])},v(l.value>0?`${l.value} messages`:"Disabled"),3)]),r("div",null,[w[21]||(w[21]=r("div",{class:"text-xs text-muted mb-1"},"Poll Timeout",-1)),r("span",Of,v(c.value>=60?Math.floor(c.value/60)+"h "+c.value%60+"m":c.value+" min"),1)]),r("div",null,[w[22]||(w[22]=r("div",{class:"text-xs text-muted mb-1"},"Thread Model",-1)),r("span",Df,v(h.value),1)]),r("div",null,[w[23]||(w[23]=r("div",{class:"text-xs text-muted mb-1"},"Worker Model",-1)),r("span",Rf,v(m.value),1)])]),r("div",jf,[r("span",{class:G(["text-sm font-medium",b.value?"text-warn":"text-textSecondary"])},v(b.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),Lf={class:"animate-fade-in"},Uf={class:"glass rounded-xl p-6 mb-6"},Vf={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Ff={class:"flex flex-wrap gap-3 items-center"},Bf=["disabled"],Hf={key:0,class:"flex items-center gap-2"},Kf={key:1},Wf={class:"glass rounded-xl p-6"},zf={key:0,class:"text-center py-8 text-textSecondary text-sm"},Jf={key:1,class:"text-center py-12 text-textSecondary text-sm"},qf={key:2,class:"space-y-2"},Gf={class:"flex items-center justify-between gap-3"},Yf={class:"flex-1 min-w-0"},Zf={class:"flex flex-wrap items-center gap-2 mb-1"},Qf={class:"font-medium text-sm font-mono"},Xf={class:"type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},ep={class:"text-xs text-muted"},tp={class:"text-xs text-muted"},sp=["onClick","disabled"],np={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/80 backdrop-blur-sm"},op={class:"glass rounded-2xl p-6 max-w-sm w-full mx-4"},rp={class:"text-sm text-textSecondary mb-4"},lp={class:"font-mono text-textPrimary"},ip=it({__name:"SnapshotsTab",setup(e){const t=$([]),s=$(!0),n=$(!1),o=$(null),l=$(""),a=$(""),c=$(!0),u=$(null);function h(k){return k<1024?`${k} B`:k<1024*1024?`${(k/1024).toFixed(1)} KB`:`${(k/(1024*1024)).toFixed(1)} MB`}function d(k){try{return new Date(k).toLocaleString()}catch{return k}}function m(k,S){a.value=k,c.value=S,setTimeout(()=>{a.value=""},4e3)}async function b(){s.value=!0;try{const k=await be("/api/snapshots");t.value=k.snapshots}catch(k){m("Failed to load snapshots: "+k.message,!1)}finally{s.value=!1}}async function A(){if(!n.value){n.value=!0;try{await be("/api/snapshots",{method:"POST",body:JSON.stringify({description:l.value})}),l.value="",m("Snapshot created ✓",!0),await b()}catch(k){m("Error: "+k.message,!1)}finally{n.value=!1}}}function H(k){u.value=k}function C(){u.value=null}async function w(){const k=u.value;if(!(!k||o.value)){u.value=null,o.value=k;try{await be(`/api/snapshots/${encodeURIComponent(k)}`,{method:"DELETE"}),m("Deleted ✓",!0),await b()}catch(S){m("Error: "+S.message,!1)}finally{o.value=null}}}return We(b),(k,S)=>(x(),g("div",Lf,[r("div",Uf,[r("div",Vf,[S[1]||(S[1]=r("div",null,[r("h3",{class:"text-lg font-semibold"},"Snapshots"),r("p",{class:"text-sm text-textSecondary mt-1"},"Create and manage data directory snapshots")],-1)),a.value?(x(),g("span",{key:0,class:G(["text-sm",c.value?"text-success":"text-danger"])},v(a.value),3)):W("",!0)]),r("div",Ff,[se(r("input",{"onUpdate:modelValue":S[0]||(S[0]=O=>l.value=O),type:"text",placeholder:"Description (optional)",class:"flex-1 min-w-48 px-3 py-2 rounded-xl bg-surface border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition",onKeydown:Qe(A,["enter"])},null,544),[[re,l.value]]),r("button",{onClick:A,disabled:n.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition whitespace-nowrap"},[n.value?(x(),g("span",Hf,[...S[2]||(S[2]=[r("svg",{class:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 12a8 8 0 018-8v8H4z"})],-1),we(" Creating… ",-1)])])):(x(),g("span",Kf,"+ Create Snapshot"))],8,Bf)])]),r("div",Wf,[s.value?(x(),g("div",zf,"Loading…")):t.value.length===0?(x(),g("div",Jf,"No snapshots yet")):(x(),g("div",qf,[(x(!0),g(ne,null,ve(t.value,O=>(x(),g("div",{key:O.name,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[r("div",Gf,[r("div",Yf,[r("div",Zf,[r("span",Qf,v(O.name),1),r("span",Xf,"v"+v(O.mcpVersion),1),r("span",ep,v(h(O.sizeBytes)),1)]),r("div",tp,[we(v(d(O.createdAt)),1),O.description?(x(),g(ne,{key:0},[we(" · "+v(O.description),1)],64)):W("",!0)])]),r("button",{onClick:P=>H(O.name),disabled:o.value===O.name,class:"px-3 py-1.5 rounded-lg bg-card hover:bg-red-900/40 border border-gray-700 hover:border-red-700 text-xs text-textSecondary hover:text-red-400 transition disabled:opacity-50 shrink-0"},v(o.value===O.name?"…":"Delete"),9,sp)])]))),128))]))]),u.value?(x(),g("div",np,[r("div",op,[S[5]||(S[5]=r("h3",{class:"text-base font-semibold mb-2"},"Delete Snapshot",-1)),r("p",rp,[S[3]||(S[3]=we(" Delete ",-1)),r("span",lp,v(u.value),1),S[4]||(S[4]=we("? This cannot be undone. ",-1))]),r("div",{class:"flex gap-3"},[r("button",{onClick:w,class:"flex-1 px-4 py-2 rounded-xl bg-danger hover:opacity-80 text-white text-sm font-medium transition"},"Delete"),r("button",{onClick:C,class:"flex-1 px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Cancel")])])])):W("",!0)]))}}),ap={class:"animate-fade-in space-y-6"},cp={class:"glass rounded-xl p-6"},up={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},dp={class:"text-sm text-textSecondary mt-1"},fp={class:"flex items-center gap-3"},pp={key:0,class:"text-xs text-accentLight animate-pulse"},mp={key:0,class:"flex flex-wrap gap-2 mt-3"},hp=["onClick"],xp={class:"ml-1 opacity-60"},gp={key:0,class:"text-center py-12 text-textSecondary"},vp={key:1,class:"text-center py-8 text-danger text-sm"},yp={key:2,class:"text-center py-12 text-textSecondary"},bp={key:3,class:"space-y-3"},_p={class:"flex flex-wrap items-start gap-3"},wp={class:"flex-1 min-w-0 space-y-2"},kp={class:"flex flex-wrap items-center gap-2"},Sp={class:"font-semibold truncate"},$p={class:"text-xs text-muted font-mono"},Cp={class:"flex flex-wrap items-center gap-4 text-xs text-textSecondary"},Tp={title:"Created"},Ap={title:"Archived"},Ep={key:0,class:"text-muted"},Ip={key:0,class:"text-sm text-textSecondary mt-1 leading-relaxed"},Pp={key:1,class:"text-sm text-muted mt-1 italic animate-pulse"},Mp={class:"flex items-center gap-2 shrink-0"},Op=["onClick","disabled"],Dp=3,Rp=it({__name:"ArchivedThreadsTab",setup(e){const t=$([]),s=$(!0),n=$(""),o=$({}),l=$({}),a=$({done:0,total:0}),c=$(null),u=$("all");let h=0;const d={root:{emoji:"🟢",classes:"bg-green-500/20 text-green-400 border-green-500/30"},daily:{emoji:"🔵",classes:"bg-blue-500/20 text-blue-400 border-blue-500/30"},branch:{emoji:"🟣",classes:"bg-purple-500/20 text-purple-400 border-purple-500/30"}},m=Re(()=>u.value==="all"?t.value:t.value.filter(S=>S.type===u.value)),b=Re(()=>{const S={all:t.value.length};for(const O of t.value)S[O.type]=(S[O.type]??0)+1;return S}),A=Re(()=>Object.values(l.value).some(Boolean));async function H(){s.value=!0,n.value="";try{const S=await be("/api/threads/archived");t.value=S.threads??[],o.value={},l.value={},t.value.length>0&&C()}catch(S){n.value=S.message||"Failed to load archived threads"}finally{s.value=!1}}async function C(){const S=++h,O=[...t.value];a.value={done:0,total:O.length};async function P(){for(;O.length>0&&S===h;){const X=O.shift();l.value={...l.value,[X.threadId]:!0};try{const K=await fetch(`/api/threads/${X.threadId}/summary`,{method:"POST",headers:{Authorization:`Bearer ${ye()}`}});if(S!==h)return;if(K.ok){const R=await K.json();R.summary&&(o.value={...o.value,[X.threadId]:R.summary})}}catch{}finally{if(S===h){const{[X.threadId]:K,...R}=l.value;l.value=R,a.value={...a.value,done:a.value.done+1}}}}}const Z=Array.from({length:Math.min(Dp,O.length)},()=>P());await Promise.all(Z)}function w(S){if(!S)return"—";const O=new Date(S),Z=Date.now()-O.getTime(),X=Math.floor(Z/6e4),K=Math.floor(Z/36e5),R=Math.floor(Z/864e5),z=Math.floor(R/30);return X<1?"just now":X<60?`${X}m ago`:K<24?`${K}h ago`:R<30?`${R}d ago`:z<12?`${z}mo ago`:`${Math.floor(z/12)}y ago`}async function k(S){if(confirm(`Unarchive thread "${S.name}" (${S.threadId})?`)){c.value=S.threadId;try{const O=await fetch(`/api/threads/${S.threadId}/unarchive`,{method:"POST",headers:{Authorization:`Bearer ${ye()}`}});if(!O.ok){const P=await O.json().catch(()=>({error:O.statusText}));throw new Error(P.error??O.statusText)}await H()}catch(O){n.value="Failed to unarchive: "+O.message}finally{c.value=null}}}return We(H),(S,O)=>(x(),g("div",ap,[r("div",cp,[r("div",up,[r("div",null,[O[0]||(O[0]=r("h3",{class:"text-lg font-semibold"},"Archived Threads",-1)),r("p",dp,v(t.value.length)+" archived thread"+v(t.value.length!==1?"s":"")+" — auto-purged after 180 days",1)]),r("div",fp,[A.value?(x(),g("span",pp," Building summaries… "+v(a.value.done)+"/"+v(a.value.total),1)):W("",!0),r("button",{onClick:H,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),t.value.length>0?(x(),g("div",mp,[(x(),g(ne,null,ve(["all","root","branch","daily"],P=>r("button",{key:P,onClick:Z=>u.value=P,class:G(["px-3 py-1 rounded-full text-xs font-medium border transition",u.value===P?"bg-accent/20 text-accent border-accent/30":"bg-card border-gray-700 text-textSecondary hover:border-gray-600"])},[we(v(P==="all"?"All":P.charAt(0).toUpperCase()+P.slice(1))+" ",1),r("span",xp,"("+v(b.value[P]??0)+")",1)],10,hp)),64))])):W("",!0)]),s.value&&t.value.length===0?(x(),g("div",gp,"Loading archived threads…")):n.value?(x(),g("div",vp,v(n.value),1)):t.value.length===0?(x(),g("div",yp,"No archived threads")):W("",!0),m.value.length>0?(x(),g("div",bp,[(x(!0),g(ne,null,ve(m.value,P=>{var Z,X;return x(),g("div",{key:P.id,class:"glass rounded-xl p-4"},[r("div",_p,[r("div",wp,[r("div",kp,[r("span",{class:G(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(Z=d[P.type])==null?void 0:Z.classes])},v((X=d[P.type])==null?void 0:X.emoji)+" "+v(P.type.toUpperCase()),3),r("span",Sp,v(P.name),1),r("span",$p,"ID: "+v(P.threadId),1)]),r("div",Cp,[r("span",Tp,"Created "+v(w(P.createdAt)),1),r("span",Ap,"Archived "+v(w(P.archivedAt??P.lastActiveAt)),1),P.client?(x(),g("span",Ep,v(P.client),1)):W("",!0)]),o.value[P.threadId]?(x(),g("div",Ip,v(o.value[P.threadId]),1)):l.value[P.threadId]?(x(),g("div",Pp," Generating summary… ")):W("",!0)]),r("div",Mp,[r("button",{onClick:K=>k(P),disabled:c.value===P.threadId,class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition"},v(c.value===P.threadId?"Restoring…":"↩ Unarchive"),9,Op)])])])}),128))])):W("",!0)]))}}),jp={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/95 backdrop-blur-sm"},Np={class:"glass rounded-2xl p-8 max-w-md w-full mx-4 animate-slide-up"},Lp=["disabled"],Up={key:0,class:"mt-3 text-sm text-danger"},Vp={key:1,class:"min-h-screen font-sans text-textPrimary animate-fade-in"},Fp={class:"glass sticky top-0 z-40 border-b border-gray-800/50"},Bp={class:"max-w-7xl mx-auto px-4 sm:px-6 py-4 flex items-center justify-between"},Hp={class:"flex items-center gap-4"},Kp={class:"text-sm text-textSecondary font-mono"},Wp={class:"max-w-7xl mx-auto px-4 sm:px-6 py-6"},zp={class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3"},Jp={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},qp={class:"text-2xl font-bold font-mono"},Gp={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Yp={class:"text-2xl font-bold font-mono"},Zp={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Qp={class:"text-2xl font-bold font-mono"},Xp={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},em={class:"flex items-center gap-2 mb-2"},tm={class:"text-2xl font-bold font-mono"},sm={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},nm={class:"text-2xl font-bold font-mono"},om={class:"max-w-7xl mx-auto px-4 sm:px-6"},rm={class:"flex gap-6 border-b border-gray-800/50 mb-6"},lm=["onClick"],im={class:"max-w-7xl mx-auto px-4 sm:px-6 pb-12"},xs="sensorium_token",am=it({__name:"App",setup(e){const t=$(!1),s=$(""),n=$(""),o=$(!1),l=$(null),a=$("sessions");let c=null;const u=[{id:"sessions",label:"Sessions"},{id:"notes",label:"Memory Notes"},{id:"templates",label:"Templates"},{id:"skills",label:"Skills"},{id:"threads",label:"Threads"},{id:"archived",label:"Archived"},{id:"mcp",label:"MCP Servers"},{id:"snapshots",label:"Snapshots"},{id:"settings",label:"Settings"}],h={sessions:ra,notes:ka,templates:nc,skills:Rc,threads:Sd,archived:Rp,mcp:ff,snapshots:ip,settings:Nf},d=Re(()=>h[a.value]),m=Re(()=>{if(!l.value)return"—";const w=Math.floor(l.value.uptime),k=Math.floor(w/86400),S=Math.floor(w%86400/3600),O=Math.floor(w%3600/60);return k>0?`${k}d ${S}h`:S>0?`${S}h ${O}m`:`${O}m`});async function b(){const w=s.value.trim()||"no-auth";o.value=!0,n.value="";try{qt(w),await H(),localStorage.setItem(xs,w),t.value=!0,C()}catch(k){const S=k;S.status===401?n.value="Invalid token":n.value=S.message??"Connection failed",qt("")}finally{o.value=!1}}function A(){localStorage.removeItem(xs),t.value=!1,s.value="",l.value=null,c&&clearInterval(c),qt("")}async function H(){l.value=await be("/api/status")}function C(){c&&clearInterval(c),c=setInterval(H,3e4)}return We(async()=>{const w=localStorage.getItem(xs);if(w){s.value=w;try{qt(w),await H(),t.value=!0,C()}catch{localStorage.removeItem(xs),qt("")}}}),wn(()=>{c&&clearInterval(c)}),(w,k)=>{var S,O,P,Z,X,K,R,z,ue;return t.value?(x(),g("div",Vp,[r("header",Fp,[r("div",Bp,[k[3]||(k[3]=et('<div class="flex items-center gap-3"><div class="w-8 h-8 rounded-lg bg-gradient-to-br from-accent to-purple-500 flex items-center justify-center"><span class="text-white text-sm font-bold">S</span></div><div><h1 class="text-lg font-semibold tracking-tight">Sensorium MCP</h1><p class="text-xs text-textSecondary">Agent Dashboard</p></div></div>',1)),r("div",Hp,[k[2]||(k[2]=r("div",{class:"flex items-center gap-2 text-sm"},[r("span",{class:"w-2 h-2 rounded-full bg-success animate-pulse-slow"}),r("span",{class:"text-textSecondary"},"Connected")],-1)),r("div",Kp,v(m.value),1),r("button",{onClick:A,class:"text-sm text-muted hover:text-textSecondary transition"},"Disconnect")])])]),r("div",Wp,[r("div",zp,[r("div",Jp,[k[4]||(k[4]=et('<div class="flex items-center gap-2 mb-2"><span class="text-success"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Sessions</span></div>',1)),r("div",qp,v(((S=l.value)==null?void 0:S.activeSessions)??0),1)]),r("div",Gp,[k[5]||(k[5]=et('<div class="flex items-center gap-2 mb-2"><span class="text-accentLight"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Notes</span></div>',1)),r("div",Yp,v(((P=(O=l.value)==null?void 0:O.memory)==null?void 0:P.totalSemanticNotes)??0),1)]),r("div",Zp,[k[6]||(k[6]=et('<div class="flex items-center gap-2 mb-2"><span class="text-warn"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Episodes</span></div>',1)),r("div",Qp,v(((X=(Z=l.value)==null?void 0:Z.memory)==null?void 0:X.totalEpisodes)??0),1)]),r("div",Xp,[r("div",em,[r("span",{class:G((((R=(K=l.value)==null?void 0:K.memory)==null?void 0:R.unconsolidatedEpisodes)??0)>10?"text-danger":"text-success")},[...k[7]||(k[7]=[r("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[r("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)])],2),k[8]||(k[8]=r("span",{class:"text-xs text-textSecondary font-medium uppercase tracking-wider"},"Unconsolidated",-1))]),r("div",tm,v(((ue=(z=l.value)==null?void 0:z.memory)==null?void 0:ue.unconsolidatedEpisodes)??0),1)]),r("div",sm,[k[9]||(k[9]=et('<div class="flex items-center gap-2 mb-2"><span class="text-success"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14M12 5l7 7-7 7"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Uptime</span></div>',1)),r("div",nm,v(m.value),1)])])]),r("div",om,[r("nav",rm,[(x(),g(ne,null,ve(u,F=>r("button",{key:F.id,onClick:L=>a.value=F.id,class:G(["pb-3 text-sm font-medium transition",a.value===F.id?"tab-active":"tab-inactive"])},v(F.label),11,lm)),64))])]),r("div",im,[(x(),fr(El(d.value),{status:l.value},null,8,["status"]))])])):(x(),g("div",jp,[r("div",Np,[k[1]||(k[1]=et('<div class="flex items-center gap-3 mb-6"><div class="w-10 h-10 rounded-xl bg-accent/20 flex items-center justify-center"><svg class="w-5 h-5 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"></path></svg></div><div><h2 class="text-lg font-semibold">Sensorium MCP</h2><p class="text-sm text-textSecondary">Enter your API token</p></div></div>',1)),se(r("input",{"onUpdate:modelValue":k[0]||(k[0]=F=>s.value=F),type:"password",placeholder:"MCP_HTTP_SECRET",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary placeholder-muted focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition font-mono text-sm",onKeydown:Qe(b,["enter"])},null,544),[[re,s.value]]),r("button",{onClick:b,disabled:o.value,class:"w-full mt-4 px-4 py-3 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white font-medium transition"},v(o.value?"Connecting...":"Connect"),9,Lp),n.value?(x(),g("p",Up,v(n.value),1)):W("",!0)])]))}}});Bi(am).mount("#app");</script>
|
|
71
|
+
`,z+ae}async function I(){if(!n.value)return;const S=n.value.name;try{const j=l.value.split(",").map(M=>M.trim()).filter(Boolean),G=r.value;let ae;G.trimStart().startsWith("---")?ae=G:ae=R(S,j,a.value,G);const z=await fetch(`/api/skills/${encodeURIComponent(S)}`,{method:"PUT",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ae})});if(!z.ok)throw new Error(z.statusText);u.value="Saved ✓",setTimeout(()=>{u.value=""},3e3),await F()}catch(j){u.value="Error: "+j.message}}async function U(){if(!n.value)return;const S=n.value.name;try{const j=await fetch(`/api/skills/${encodeURIComponent(S)}`,{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!j.ok)throw new Error(j.statusText);E(),await F()}catch(j){d.value="Error: "+j.message}}async function y(){const S=f.value.trim(),j=m.value;if(!S){k.value="Name is required";return}const G=j.split(",").map(z=>z.trim()).filter(Boolean);if(!G.length){k.value="At least one trigger is required";return}const ae=R(S,G,v.value,`\x3C!-- Write your skill instructions here -->
|
|
72
|
+
`);try{const z=await fetch(`/api/skills/${encodeURIComponent(S)}`,{method:"PUT",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({content:ae})});if(!z.ok)throw new Error(z.statusText);k.value="Created ✓",x.value=!1,await F();const M=t.value.find(J=>J.name===S);M&&C(M)}catch(z){k.value="Error: "+z.message}}return Be(F),(S,j)=>(h(),g("div",oc,[o("div",rc,[o("div",lc,[j[8]||(j[8]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Skill Library"),o("p",{class:"text-sm text-textSecondary mt-1"},"Manage intent-routing skills — user overrides, defaults, and project skills")],-1)),o("button",{onClick:j[0]||(j[0]=G=>{x.value=!x.value,n.value=null}),class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + New Skill ")]),x.value?(h(),g("div",ac,[j[12]||(j[12]=o("h4",{class:"text-sm font-semibold mb-3"},"Create New Skill",-1)),o("div",ic,[o("div",null,[j[9]||(j[9]=o("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),Z(o("input",{"onUpdate:modelValue":j[1]||(j[1]=G=>f.value=G),type:"text",placeholder:"my-skill",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[ne,f.value]])]),o("div",null,[j[10]||(j[10]=o("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),Z(o("input",{"onUpdate:modelValue":j[2]||(j[2]=G=>m.value=G),type:"text",placeholder:"trigger1, trigger2",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},null,512),[[ne,m.value]])])]),o("div",cc,[o("label",uc,[Z(o("input",{"onUpdate:modelValue":j[3]||(j[3]=G=>v.value=G),type:"checkbox",class:"rounded"},null,512),[[an,v.value]]),j[11]||(j[11]=o("span",null,"Replaces orchestrator",-1))])]),o("div",dc,[o("button",{onClick:y,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Create"),o("button",{onClick:j[4]||(j[4]=G=>x.value=!1),class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Cancel"),k.value?(h(),g("span",fc,b(k.value),1)):K("",!0)])])):K("",!0),s.value?(h(),g("div",pc,"Loading...")):t.value.length===0?(h(),g("div",mc,"No skills loaded")):(h(),g("div",xc,[(h(!0),g(se,null,ve(t.value,G=>{var ae;return h(),g("div",{key:G.name,onClick:z=>C(G),class:q(["glass rounded-xl p-4 cursor-pointer hover:bg-cardHover transition border",((ae=n.value)==null?void 0:ae.name)===G.name?"border-accent":"border-transparent"])},[o("div",hc,[o("div",gc,[o("div",yc,[o("span",bc,b(G.name),1),o("span",{class:"type-badge",style:Ut(N($(G.source)))},b($(G.source)),5),G.replacesOrchestrator?(h(),g("span",_c,"REPLACES ORCH")):K("",!0)]),o("div",wc,[(h(!0),g(se,null,ve(G.triggers||[],z=>(h(),g("span",{key:z,class:"text-xs px-2 py-0.5 rounded-full bg-accent/10 text-accentLight"},b(z),1))),128))])]),o("div",{class:"text-xs text-muted font-mono shrink-0 max-w-[200px] truncate",title:G.source||""},b((G.source||"").split(/[\\/]/).pop()||""),9,kc)])],10,vc)}),128))]))]),n.value?(h(),g("div",Sc,[o("div",$c,[o("div",null,[o("h3",Cc,"Edit: "+b(n.value.name),1),o("p",Tc,b(n.value.source||"(unknown source)"),1)]),o("div",Ec,[u.value?(h(),g("span",Pc,b(u.value),1)):K("",!0),d.value?(h(),g("span",Ac,b(d.value),1)):K("",!0),$(n.value.source)==="user"?(h(),g("button",{key:2,onClick:U,class:"px-4 py-2 rounded-xl bg-card hover:bg-red-900/40 border border-gray-700 hover:border-red-700 text-sm text-textSecondary hover:text-red-400 transition",title:"Remove user override (reverts to default)"},"Remove override")):K("",!0),o("button",{onClick:E,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Close"),o("button",{onClick:I,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},"Save")])]),o("div",Ic,[o("div",null,[j[13]||(j[13]=o("label",{class:"text-xs text-textSecondary block mb-1"},"Name",-1)),o("input",{value:n.value.name,type:"text",readonly:"",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono opacity-60 cursor-not-allowed"},null,8,Mc)]),o("div",null,[j[14]||(j[14]=o("label",{class:"text-xs text-textSecondary block mb-1"},"Triggers (comma-separated)",-1)),Z(o("input",{"onUpdate:modelValue":j[5]||(j[5]=G=>l.value=G),type:"text",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},null,512),[[ne,l.value]])]),o("div",Oc,[o("label",Dc,[Z(o("input",{"onUpdate:modelValue":j[6]||(j[6]=G=>a.value=G),type:"checkbox",class:"rounded"},null,512),[[an,a.value]]),j[15]||(j[15]=o("span",null,"Replaces orchestrator",-1))])])]),Z(o("textarea",{"onUpdate:modelValue":j[7]||(j[7]=G=>r.value=G),rows:"20",spellcheck:"false",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary font-mono text-sm leading-relaxed focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition resize-y",placeholder:"Skill body (markdown)..."},null,512),[[ne,r.value]])])):K("",!0)]))}}),jc={class:"animate-fade-in space-y-6"},Lc={class:"glass rounded-xl p-6"},Uc={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},Nc={class:"flex items-center gap-3"},Vc={key:0,class:"mt-4 p-4 rounded-xl bg-surface border border-gray-700/50 space-y-3"},Bc={class:"grid grid-cols-1 sm:grid-cols-3 gap-3"},Fc=["value"],Hc={class:"flex justify-end"},Kc=["disabled"],Wc={key:0,class:"text-center py-12 text-textSecondary"},zc={key:1,class:"text-center py-8 text-danger text-sm"},Jc={key:2,class:"text-center py-12 text-textSecondary"},qc={key:3},Gc={class:"space-y-3"},Yc={class:"p-4"},Zc={class:"flex flex-wrap items-center gap-3"},Qc=["onBlur"],Xc=["onDblclick"],eu={class:"text-xs text-muted font-mono"},tu=["value","onChange"],su=["value"],nu=["value"],ou={class:"text-xs text-muted"},ru=["onKeyup","onBlur"],lu=["title","onDblclick"],au={class:"ml-auto flex items-center gap-3"},iu=["onClick","disabled"],cu={class:"flex items-center gap-1.5"},uu=["onClick"],du={class:"flex items-center gap-1.5"},fu=["onClick"],pu={class:"flex items-center gap-1.5"},mu=["onClick"],xu=["onClick"],vu=["onClick"],hu=["onClick"],gu={key:0,class:"mt-3 p-3 rounded-lg bg-surface border border-purple-500/20 space-y-2"},yu={class:"grid grid-cols-1 sm:grid-cols-3 gap-2"},bu=["value"],_u={class:"flex items-center gap-2"},wu=["onClick","disabled"],ku={key:0,class:"border-t border-gray-700/30 bg-surface/30 px-4 py-3 space-y-2"},Su={key:0,class:"text-xs text-muted py-1"},$u={class:"text-sm font-medium"},Cu={class:"text-xs text-muted font-mono"},Tu=["value","onChange"],Eu=["value"],Pu=["value"],Au={class:"text-xs text-muted"},Iu=["onBlur","onKeyup"],Mu=["title","onDblclick"],Ou={class:"ml-auto flex items-center gap-3"},Du=["onClick","disabled"],Ru=["onClick","disabled"],ju=["onClick","disabled"],Lu={key:2,class:"flex items-center gap-1.5"},Uu=["onClick"],Nu={key:3,class:"flex items-center gap-1.5"},Vu=["onClick"],Bu={key:4,class:"flex items-center gap-1.5"},Fu=["onClick"],Hu=["onClick"],Ku={key:4},Wu={class:"space-y-2"},zu={class:"font-medium"},Ju={class:"text-xs text-muted font-mono"},qu={class:"text-xs text-textSecondary"},Gu={class:"text-xs text-muted"},Yu={class:"ml-auto flex items-center gap-2"},Zu=["onClick","disabled"],Qu=["onClick","disabled"],Xu=["onClick"],ed={key:5},td={class:"space-y-2"},sd={class:"font-medium"},nd={class:"text-xs text-muted font-mono"},od=["value","onChange"],rd=["value"],ld=["value"],ad={class:"text-xs text-muted"},id=["onBlur","onKeyup"],cd=["title","onDblclick"],ud={class:"ml-auto flex items-center gap-3"},dd=["onClick","disabled"],fd=["onClick","disabled"],pd={class:"flex items-center gap-1.5"},md=["onClick"],xd={class:"flex items-center gap-1.5"},vd=["onClick"],hd={class:"flex items-center gap-1.5"},gd=["onClick"],yd=["onClick"],bd={key:6},_d={class:"space-y-2"},wd={class:"font-medium"},kd={class:"text-xs text-muted font-mono"},Sd=["value","onChange"],$d=["value"],Cd=["value"],Td={class:"text-xs text-muted"},Ed=He({__name:"ThreadsTab",setup(e){const t=w([]),s=w(!0),n=w(""),r=w({}),l=w(new Set),a=w(!1),u=w({name:"",threadId:0,client:"claude",workingDirectory:""}),d=w(""),x=w(!1),f=w(null),m=w(""),v=w(null),k=w(""),F=w(null),$=w({name:"",threadId:0,client:"claude",workingDirectory:""}),N=w(""),C=w(!1),E=w(null),R=w(null),I=w(null),U=["claude","copilot","codex"];function y(V){return U.includes(V)}const S={root:{emoji:"🟢",classes:"bg-green-500/20 text-green-400 border-green-500/30"},daily:{emoji:"🔵",classes:"bg-blue-500/20 text-blue-400 border-blue-500/30"},branch:{emoji:"🟣",classes:"bg-purple-500/20 text-purple-400 border-purple-500/30"},worker:{emoji:"🟡",classes:"bg-yellow-500/20 text-yellow-400 border-yellow-500/30"}},j=Ee(()=>t.value.filter(V=>V.type==="root")),G=Ee(()=>t.value.filter(V=>V.type==="daily")),ae=Ee(()=>t.value.filter(V=>V.type==="branch")),z=Ee(()=>t.value.filter(V=>V.type==="worker"));async function M(){s.value=!0,n.value="";try{const V=await he("/api/threads");t.value=V.threads??[]}catch(V){n.value=V.message||"Failed to load threads"}finally{s.value=!1}}async function J(V){try{const i=await he(`/api/threads/${V}/children`);r.value[V]=i.threads??[]}catch{r.value[V]=[]}}function re(V){l.value.has(V)?l.value.delete(V):(l.value.add(V),J(V))}async function _e(){if(!(!u.value.name.trim()||!u.value.threadId)){x.value=!0,d.value="";try{const V=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:u.value.threadId,name:u.value.name.trim(),type:"root",client:u.value.client,keepAlive:!0,...u.value.workingDirectory.trim()?{workingDirectory:u.value.workingDirectory.trim()}:{}})});if(!V.ok){const i=await V.json().catch(()=>({error:V.statusText}));throw new Error(i.error??V.statusText)}d.value="Created ✓",u.value={name:"",threadId:0,client:"claude",workingDirectory:""},a.value=!1,setTimeout(()=>{d.value=""},3e3),await M()}catch(V){d.value="Error: "+V.message}finally{x.value=!1}}}async function ke(V){if(!(!$.value.name.trim()||!$.value.threadId)){C.value=!0,N.value="";try{const i=await fetch("/api/threads",{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({threadId:$.value.threadId,name:$.value.name.trim(),type:"branch",rootThreadId:V,client:$.value.client,...$.value.workingDirectory.trim()?{workingDirectory:$.value.workingDirectory.trim()}:{}})});if(!i.ok){const c=await i.json().catch(()=>({error:i.statusText}));throw new Error(c.error??i.statusText)}N.value="Branch created ✓",$.value={name:"",threadId:0,client:"claude",workingDirectory:""},F.value=null,setTimeout(()=>{N.value=""},3e3),await M(),J(V)}catch(i){N.value="Error: "+i.message}finally{C.value=!1}}}function me(V){f.value=V.threadId,m.value=V.name}async function ie(V){const i=m.value.trim();if(f.value=null,!!i)try{const c=await fetch(`/api/threads/${V}`,{method:"PATCH",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({name:i})});if(!c.ok)throw new Error(c.statusText);await M()}catch(c){n.value="Failed to rename thread: "+c.message}}function W(V){v.value=V.threadId,k.value=V.workingDirectory??""}async function D(V){const i=k.value.trim();v.value=null;try{const c=await fetch(`/api/threads/${V}`,{method:"PATCH",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({workingDirectory:i||null})});if(!c.ok)throw new Error(c.statusText);await M()}catch(c){n.value="Failed to update working directory: "+c.message}}async function Ce(V){try{const i=await fetch(`/api/threads/${V.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({keepAlive:!V.keepAlive})});if(!i.ok)throw new Error(i.statusText);await M()}catch(i){n.value="Failed to toggle keep-alive: "+i.message}}async function we(V,i){try{const c=await fetch(`/api/threads/${V.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({client:i})});if(!c.ok)throw new Error(c.statusText);await M()}catch(c){n.value="Failed to change agent type: "+c.message}}async function fe(V){try{const i=await fetch(`/api/threads/${V.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({dailyRotation:!V.dailyRotation})});if(!i.ok)throw new Error(i.statusText);await M()}catch(i){n.value="Failed to toggle daily rotation: "+i.message}}async function at(V){try{const i=await fetch(`/api/threads/${V.threadId}`,{method:"PATCH",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({autonomousMode:!V.autonomousMode})});if(!i.ok)throw new Error(i.statusText);await M()}catch(i){n.value="Failed to toggle autonomous mode: "+i.message}}async function It(V){if(confirm(`Archive thread "${V.name}" (${V.threadId})?`))try{const i=await fetch(`/api/threads/${V.threadId}`,{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!i.ok)throw new Error(i.statusText);await M()}catch(i){n.value="Failed to archive: "+i.message}}async function Je(V){if(confirm(`Start thread "${V.name}" (${V.threadId})?`)){E.value=V.threadId;try{const i=await fetch(`/api/threads/${V.threadId}/start`,{method:"POST",headers:{Authorization:`Bearer ${de()}`}});if(!i.ok){const c=await i.json().catch(()=>({error:i.statusText}));throw new Error(c.error??i.statusText)}await M()}catch(i){n.value="Failed to start thread: "+i.message}finally{E.value=null}}}function yt(V){d.value="Sync to Root — not yet implemented",setTimeout(()=>{d.value=""},3e3)}async function Kt(V){if(confirm(`Convert "${V.name}" to a root thread? This will detach it from its parent.`)){I.value=V.threadId;try{const i=await fetch(`/api/threads/${V.threadId}/convert-to-root`,{method:"POST",headers:{Authorization:`Bearer ${de()}`}});if(!i.ok){const c=await i.json().catch(()=>({error:i.statusText}));throw new Error(c.error??i.statusText)}n.value="",d.value=`Converted "${V.name}" to root ✓`,setTimeout(()=>{d.value=""},3e3),await M()}catch(i){n.value="Failed to convert: "+i.message}finally{I.value=null}}}function bt(V){if(!V)return"—";const i=new Date(V),_=Date.now()-i.getTime();return _<6e4?"just now":_<36e5?`${Math.floor(_/6e4)}m ago`:_<864e5?`${Math.floor(_/36e5)}h ago`:i.toLocaleDateString()}function Ke(V){return V==="active"?"text-success":V==="archived"?"text-muted":"text-warn"}return Be(M),(V,i)=>(h(),g("div",jc,[o("div",Lc,[o("div",Uc,[i[18]||(i[18]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Thread Registry"),o("p",{class:"text-sm text-textSecondary mt-1"},"Manage conversation threads, branches, and daily sessions")],-1)),o("div",Nc,[d.value?(h(),g("span",{key:0,class:q([d.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},b(d.value),3)):K("",!0),o("button",{onClick:i[0]||(i[0]=c=>a.value=!a.value),class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"},b(a.value?"Cancel":"+ New Root Thread"),1),o("button",{onClick:M,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),a.value?(h(),g("div",Vc,[o("div",Bc,[o("div",null,[i[19]||(i[19]=o("label",{class:"block text-xs text-textSecondary mb-1"},"Name",-1)),Z(o("input",{"onUpdate:modelValue":i[1]||(i[1]=c=>u.value.name=c),type:"text",placeholder:"e.g. Main Workspace",class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[ne,u.value.name]])]),o("div",null,[i[20]||(i[20]=o("label",{class:"block text-xs text-textSecondary mb-1"},"Thread ID",-1)),Z(o("input",{"onUpdate:modelValue":i[2]||(i[2]=c=>u.value.threadId=c),type:"number",min:"1",placeholder:"Telegram thread ID",class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[ne,u.value.threadId,void 0,{number:!0}]])]),o("div",null,[i[21]||(i[21]=o("label",{class:"block text-xs text-textSecondary mb-1"},"Client",-1)),Z(o("select",{"onUpdate:modelValue":i[3]||(i[3]=c=>u.value.client=c),class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition appearance-none"},[(h(),g(se,null,ve(U,c=>o("option",{key:c,value:c},b(c),9,Fc)),64))],512),[[At,u.value.client]])])]),o("div",null,[i[22]||(i[22]=o("label",{class:"block text-xs text-textSecondary mb-1"},"Working Directory (optional)",-1)),Z(o("input",{"onUpdate:modelValue":i[4]||(i[4]=c=>u.value.workingDirectory=c),type:"text",placeholder:"e.g. C:\\src\\my-project",class:"w-full px-3 py-2 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition font-mono"},null,512),[[ne,u.value.workingDirectory]])]),o("div",Hc,[o("button",{onClick:_e,disabled:x.value||!u.value.name.trim()||!u.value.threadId,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},b(x.value?"Creating…":"Create Root Thread"),9,Kc)])])):K("",!0)]),s.value&&t.value.length===0?(h(),g("div",Wc,"Loading threads…")):n.value?(h(),g("div",zc,b(n.value),1)):t.value.length===0?(h(),g("div",Jc,"No threads registered")):K("",!0),j.value.length>0?(h(),g("div",qc,[i[29]||(i[29]=o("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟢 Root Threads",-1)),o("div",Gc,[(h(!0),g(se,null,ve(j.value,c=>{var _,T;return h(),g("div",{key:c.id,class:"glass rounded-xl overflow-hidden"},[o("div",Yc,[o("div",Zc,[o("span",{class:q(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(_=S[c.type])==null?void 0:_.classes])},b((T=S[c.type])==null?void 0:T.emoji)+" "+b(c.type.toUpperCase()),3),f.value===c.threadId?Z((h(),g("input",{key:0,"onUpdate:modelValue":i[5]||(i[5]=p=>m.value=p),onBlur:p=>ie(c.threadId),onKeyup:[i[6]||(i[6]=Xe(p=>p.target.blur(),["enter"])),i[7]||(i[7]=Xe(p=>f.value=null,["escape"]))],class:"font-semibold bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-40",ref_for:!0,ref:"nameInput"},null,40,Qc)),[[ne,m.value]]):(h(),g("span",{key:1,class:"font-semibold cursor-pointer hover:text-accent transition",onDblclick:p=>me(c),title:"Double-click to rename"},b(c.name),41,Xc)),o("span",{class:q(["text-xs font-medium",Ke(c.status)])},b(c.status),3),o("span",eu,"ID: "+b(c.threadId),1),o("select",{value:c.client,onChange:p=>we(c,p.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[y(c.client)?K("",!0):(h(),g("option",{key:0,value:c.client,disabled:""},b(c.client)+" (legacy)",9,su)),(h(),g(se,null,ve(U,p=>o("option",{key:p,value:p},b(p),9,nu)),64))],40,tu),o("span",ou,b(bt(c.lastActiveAt)),1),v.value===c.threadId?Z((h(),g("input",{key:2,"onUpdate:modelValue":i[8]||(i[8]=p=>k.value=p),onKeyup:[Xe(p=>D(c.threadId),["enter"]),i[9]||(i[9]=Xe(p=>v.value=null,["escape"]))],onBlur:p=>D(c.threadId),type:"text",placeholder:"Set working directory…",class:"text-xs font-mono bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-48"},null,40,ru)),[[ne,k.value]]):(h(),g("span",{key:3,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(c.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:p=>W(c)},"📁 "+b(c.workingDirectory??"—"),41,lu)),o("div",au,[o("button",{onClick:p=>Je(c),disabled:E.value===c.threadId||c.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},b(E.value===c.threadId?"Starting…":"▶ Start"),9,iu),o("div",cu,[o("button",{onClick:p=>Ce(c),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",c.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[o("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",c.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,uu),i[23]||(i[23]=o("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),o("div",du,[o("button",{onClick:p=>fe(c),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",c.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[o("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",c.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,fu),i[24]||(i[24]=o("span",{class:"text-xs text-muted"},"Daily",-1))]),o("div",pu,[o("button",{onClick:p=>at(c),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",c.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[o("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",c.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,mu),i[25]||(i[25]=o("span",{class:"text-xs text-muted"},"Auto",-1))]),o("button",{onClick:p=>re(c.threadId),class:"px-2 py-1 rounded-lg text-xs bg-card border border-gray-700 hover:bg-surface transition"},b(l.value.has(c.threadId)?"▾ Children":"▸ Children"),9,xu),o("button",{onClick:p=>{F.value=F.value===c.threadId?null:c.threadId,$.value={name:"",threadId:0,client:"claude",workingDirectory:""},N.value=""},class:"px-2 py-1 rounded-lg text-xs bg-purple-500/20 text-purple-400 border border-purple-500/30 hover:bg-purple-500/30 transition"}," + Branch ",8,vu),o("button",{onClick:p=>It(c),class:"px-2 py-1 rounded-lg text-xs bg-red-500/20 text-red-400 border border-red-500/30 hover:bg-red-500/30 transition"}," Archive ",8,hu)])]),F.value===c.threadId?(h(),g("div",gu,[o("div",yu,[Z(o("input",{"onUpdate:modelValue":i[10]||(i[10]=p=>$.value.name=p),type:"text",placeholder:"Branch name",class:"px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[ne,$.value.name]]),Z(o("input",{"onUpdate:modelValue":i[11]||(i[11]=p=>$.value.threadId=p),type:"number",min:"1",placeholder:"Thread ID",class:"px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition"},null,512),[[ne,$.value.threadId,void 0,{number:!0}]]),Z(o("select",{"onUpdate:modelValue":i[12]||(i[12]=p=>$.value.client=p),class:"px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition appearance-none"},[(h(),g(se,null,ve(U,p=>o("option",{key:p,value:p},b(p),9,bu)),64))],512),[[At,$.value.client]])]),Z(o("input",{"onUpdate:modelValue":i[13]||(i[13]=p=>$.value.workingDirectory=p),type:"text",placeholder:"Working directory (optional)",class:"w-full px-3 py-1.5 rounded-lg bg-card border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition font-mono"},null,512),[[ne,$.value.workingDirectory]]),o("div",_u,[o("button",{onClick:p=>ke(c.threadId),disabled:C.value||!$.value.name.trim()||!$.value.threadId,class:"px-3 py-1.5 rounded-lg bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-xs font-medium transition"},b(C.value?"Creating…":"Create Branch"),9,wu),N.value?(h(),g("span",{key:0,class:q([N.value.startsWith("Error")?"text-danger":"text-success","text-xs"])},b(N.value),3)):K("",!0)])])):K("",!0)]),l.value.has(c.threadId)&&r.value[c.threadId]?(h(),g("div",ku,[r.value[c.threadId].length===0?(h(),g("div",Su,"No children")):K("",!0),(h(!0),g(se,null,ve(r.value[c.threadId],p=>{var P,B;return h(),g("div",{key:p.id,class:"flex flex-wrap items-center gap-2 px-3 py-2 rounded-lg bg-card/50 border border-gray-700/30"},[o("span",{class:q(["inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-xs font-medium border",(P=S[p.type])==null?void 0:P.classes])},b((B=S[p.type])==null?void 0:B.emoji)+" "+b(p.type.toUpperCase()),3),o("span",$u,b(p.name),1),o("span",{class:q(["text-xs",Ke(p.status)])},b(p.status),3),o("span",Cu,"ID: "+b(p.threadId),1),o("select",{value:p.client,onChange:O=>we(p,O.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[y(p.client)?K("",!0):(h(),g("option",{key:0,value:p.client,disabled:""},b(p.client)+" (legacy)",9,Eu)),(h(),g(se,null,ve(U,O=>o("option",{key:O,value:O},b(O),9,Pu)),64))],40,Tu),o("span",Au,b(bt(p.lastActiveAt)),1),p.type==="branch"&&v.value===p.threadId?Z((h(),g("input",{key:0,"onUpdate:modelValue":i[14]||(i[14]=O=>k.value=O),onBlur:O=>D(p.threadId),onKeyup:[Xe(O=>D(p.threadId),["enter"]),i[15]||(i[15]=Xe(O=>v.value=null,["escape"]))],type:"text",placeholder:"Set working directory…",class:"text-xs font-mono bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-48"},null,40,Iu)),[[ne,k.value]]):p.type==="branch"?(h(),g("span",{key:1,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(p.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:O=>W(p)},"📁 "+b(p.workingDirectory??"—"),41,Mu)):K("",!0),o("div",Ou,[o("button",{onClick:O=>Je(p),disabled:E.value===p.threadId||p.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},b(E.value===p.threadId?"Starting…":"▶ Start"),9,Du),p.rootThreadId?(h(),g("button",{key:0,onClick:O=>yt(),disabled:R.value===p.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},b(R.value===p.threadId?"Syncing…":"⟳ Sync to Root"),9,Ru)):K("",!0),p.type==="branch"||p.type==="daily"?(h(),g("button",{key:1,onClick:O=>Kt(p),disabled:I.value===p.threadId,class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Convert to independent root thread"},b(I.value===p.threadId?"Converting…":"↑ To Root"),9,ju)):K("",!0),p.type==="branch"?(h(),g("div",Lu,[o("button",{onClick:O=>Ce(p),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",p.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[o("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",p.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,Uu),i[26]||(i[26]=o("span",{class:"text-xs text-muted"},"Keep-alive",-1))])):K("",!0),p.type==="branch"?(h(),g("div",Nu,[o("button",{onClick:O=>fe(p),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",p.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[o("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",p.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,Vu),i[27]||(i[27]=o("span",{class:"text-xs text-muted"},"Daily",-1))])):K("",!0),p.type==="branch"?(h(),g("div",Bu,[o("button",{onClick:O=>at(p),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",p.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[o("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",p.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,Fu),i[28]||(i[28]=o("span",{class:"text-xs text-muted"},"Auto",-1))])):K("",!0),p.type!=="root"?(h(),g("button",{key:5,onClick:O=>It(p),class:"px-2 py-0.5 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,Hu)):K("",!0)])])}),128))])):K("",!0)])}),128))])])):K("",!0),G.value.length>0?(h(),g("div",Ku,[i[30]||(i[30]=o("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🔵 Daily Sessions",-1)),o("div",Wu,[(h(!0),g(se,null,ve(G.value,c=>{var _,T;return h(),g("div",{key:c.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[o("span",{class:q(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(_=S[c.type])==null?void 0:_.classes])},b((T=S[c.type])==null?void 0:T.emoji)+" "+b(c.type.toUpperCase()),3),o("span",zu,b(c.name),1),o("span",{class:q(["text-xs font-medium",Ke(c.status)])},b(c.status),3),o("span",Ju,"ID: "+b(c.threadId),1),o("span",qu,b(c.client),1),o("span",Gu,b(bt(c.lastActiveAt)),1),o("div",Yu,[o("button",{onClick:p=>Je(c),disabled:E.value===c.threadId||c.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},b(E.value===c.threadId?"Starting…":"▶ Start"),9,Zu),c.rootThreadId?(h(),g("button",{key:0,onClick:p=>yt(),disabled:R.value===c.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},b(R.value===c.threadId?"Syncing…":"⟳ Sync to Root"),9,Qu)):K("",!0),o("button",{onClick:p=>It(c),class:"px-2 py-1 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,Xu)])])}),128))])])):K("",!0),ae.value.length>0?(h(),g("div",ed,[i[34]||(i[34]=o("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟣 Branches",-1)),o("div",td,[(h(!0),g(se,null,ve(ae.value,c=>{var _,T;return h(),g("div",{key:c.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[o("span",{class:q(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(_=S[c.type])==null?void 0:_.classes])},b((T=S[c.type])==null?void 0:T.emoji)+" "+b(c.type.toUpperCase()),3),o("span",sd,b(c.name),1),o("span",{class:q(["text-xs font-medium",Ke(c.status)])},b(c.status),3),o("span",nd,"ID: "+b(c.threadId),1),o("select",{value:c.client,onChange:p=>we(c,p.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[y(c.client)?K("",!0):(h(),g("option",{key:0,value:c.client,disabled:""},b(c.client)+" (legacy)",9,rd)),(h(),g(se,null,ve(U,p=>o("option",{key:p,value:p},b(p),9,ld)),64))],40,od),o("span",ad,b(bt(c.lastActiveAt)),1),v.value===c.threadId?Z((h(),g("input",{key:0,"onUpdate:modelValue":i[16]||(i[16]=p=>k.value=p),onBlur:p=>D(c.threadId),onKeyup:[Xe(p=>D(c.threadId),["enter"]),i[17]||(i[17]=Xe(p=>v.value=null,["escape"]))],type:"text",placeholder:"Set working directory…",class:"text-xs font-mono bg-card border border-accent rounded px-1 py-0 text-textPrimary focus:outline-none w-48"},null,40,id)),[[ne,k.value]]):(h(),g("span",{key:1,class:"text-xs text-muted font-mono truncate max-w-[200px] cursor-pointer hover:text-accent transition",title:(c.workingDirectory??"Click to set CWD")+" (dblclick to edit)",onDblclick:p=>W(c)},"📁 "+b(c.workingDirectory??"—"),41,cd)),o("div",ud,[o("button",{onClick:p=>Je(c),disabled:E.value===c.threadId||c.status==="active",class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition",title:"Start thread"},b(E.value===c.threadId?"Starting…":"▶ Start"),9,dd),c.rootThreadId?(h(),g("button",{key:0,onClick:p=>yt(),disabled:R.value===c.threadId,class:"px-2 py-1 rounded-lg text-xs bg-cyan-500/20 text-cyan-400 border border-cyan-500/30 hover:bg-cyan-500/30 disabled:opacity-50 transition",title:"Sync memory to root thread"},b(R.value===c.threadId?"Syncing…":"⟳ Sync to Root"),9,fd)):K("",!0),o("div",pd,[o("button",{onClick:p=>Ce(c),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",c.keepAlive?"bg-accent":"bg-gray-700"]),title:"Toggle keep-alive"},[o("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",c.keepAlive?"translate-x-4":"translate-x-0.5"])},null,2)],10,md),i[31]||(i[31]=o("span",{class:"text-xs text-muted"},"Keep-alive",-1))]),o("div",xd,[o("button",{onClick:p=>fe(c),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",c.dailyRotation?"bg-blue-500":"bg-gray-700"]),title:"Toggle daily rotation"},[o("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",c.dailyRotation?"translate-x-4":"translate-x-0.5"])},null,2)],10,vd),i[32]||(i[32]=o("span",{class:"text-xs text-muted"},"Daily",-1))]),o("div",hd,[o("button",{onClick:p=>at(c),class:q(["relative inline-flex h-5 w-9 items-center rounded-full transition-colors",c.autonomousMode?"bg-orange-500":"bg-gray-700"]),title:"Toggle autonomous mode"},[o("span",{class:q(["inline-block h-3.5 w-3.5 transform rounded-full bg-white shadow transition-transform",c.autonomousMode?"translate-x-4":"translate-x-0.5"])},null,2)],10,gd),i[33]||(i[33]=o("span",{class:"text-xs text-muted"},"Auto",-1))]),o("button",{onClick:p=>It(c),class:"px-2 py-1 rounded-lg text-xs bg-red-500/10 text-red-400 border border-red-500/20 hover:bg-red-500/20 transition"}," Archive ",8,yd)])])}),128))])])):K("",!0),z.value.length>0?(h(),g("div",bd,[i[36]||(i[36]=o("h4",{class:"text-sm font-medium text-textSecondary uppercase tracking-wider mb-3"},"🟡 Workers",-1)),o("div",_d,[(h(!0),g(se,null,ve(z.value,c=>{var _,T;return h(),g("div",{key:c.id,class:"glass rounded-xl p-4 flex flex-wrap items-center gap-3"},[o("span",{class:q(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(_=S[c.type])==null?void 0:_.classes])},b((T=S[c.type])==null?void 0:T.emoji)+" "+b(c.type.toUpperCase()),3),o("span",wd,b(c.name),1),o("span",{class:q(["text-xs font-medium",Ke(c.status)])},b(c.status),3),o("span",kd,"ID: "+b(c.threadId),1),o("select",{value:c.client,onChange:p=>we(c,p.target.value),class:"px-2 py-0.5 rounded-lg bg-card border border-gray-700 text-xs text-textPrimary focus:outline-none focus:border-accent transition appearance-none cursor-pointer",title:"Agent type"},[y(c.client)?K("",!0):(h(),g("option",{key:0,value:c.client,disabled:""},b(c.client)+" (legacy)",9,$d)),(h(),g(se,null,ve(U,p=>o("option",{key:p,value:p},b(p),9,Cd)),64))],40,Sd),o("span",Td,b(bt(c.lastActiveAt)),1),i[35]||(i[35]=o("span",{class:"ml-auto text-xs text-muted italic"},"auto-managed",-1))])}),128))])])):K("",!0)]))}}),Pd={class:"animate-fade-in"},Ad={class:"glass rounded-xl p-6 mb-6"},Id={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Md={class:"flex items-center gap-3"},Od={key:0,class:"text-center py-8 text-textSecondary text-sm"},Dd={key:1,class:"text-center py-8 text-danger text-sm"},Rd={key:2,class:"text-center text-textSecondary py-12"},jd={key:3,class:"space-y-2"},Ld={key:0,class:"glass rounded-xl p-4 border border-gray-700/50 opacity-75"},Ud={class:"flex items-center justify-between gap-3"},Nd={class:"flex items-center gap-2 min-w-0"},Vd={class:"flex items-center justify-between gap-3"},Bd={class:"flex-1 min-w-0"},Fd={class:"flex items-center gap-2 mb-1"},Hd={class:"font-medium text-sm font-mono"},Kd={class:"text-xs text-muted font-mono truncate"},Wd={class:"flex items-center gap-2 shrink-0"},zd=["onClick"],Jd=["onClick","disabled"],qd={key:0,class:"glass rounded-xl p-6 border border-accent/30"},Gd={class:"text-lg font-semibold mb-4"},Yd={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Zd=["readonly"],Qd={class:"grid grid-cols-1 sm:grid-cols-2 gap-4 mb-4"},Xd={class:"mb-4"},ef={class:"flex items-center justify-between mb-2"},tf=["onUpdate:modelValue"],sf=["onUpdate:modelValue"],nf=["onClick"],of={key:0,class:"text-xs text-muted italic"},rf={class:"mb-4"},lf={class:"mb-4"},af={class:"flex items-center justify-between mb-2"},cf=["onUpdate:modelValue"],uf=["onUpdate:modelValue"],df=["onClick"],ff={key:0,class:"text-xs text-muted italic"},pf={class:"flex items-center gap-3 flex-wrap"},mf=["disabled"],xf={key:0,class:"text-sm text-danger"},Gt="sensorium-mcp",vf=He({__name:"McpServersTab",setup(e){const t=w({}),s=w(!0),n=w(""),r=w(""),l=w(!0),a=w(!1),u=w(null),d=w(!1),x=w(null),f=w(""),m=w("stdio"),v=w(""),k=w(""),F=w(""),$=w([]),N=w([]),C=w(""),E=Ee(()=>Object.entries(t.value).filter(([z])=>z!==Gt));async function R(){s.value=!0,n.value="";try{const z=await he("/api/mcp-servers");t.value=z.servers||{}}catch(z){n.value="Failed to load MCP servers: "+z.message}finally{s.value=!1}}function I(z){return z==="stdio"?"background:rgba(99,102,241,0.15);color:#818cf8":"background:rgba(34,197,94,0.15);color:#4ade80"}function U(){x.value=null,f.value="",m.value="stdio",v.value="",k.value="",F.value="",$.value=[],N.value=[],C.value="",d.value=!0}function y(z,M){x.value=z,f.value=z,m.value=M.type,v.value=M.command||"",k.value=(M.args||[]).join(" "),F.value=M.url||"",$.value=Object.entries(M.env||{}).map(([J,re])=>({k:J,v:re})),N.value=Object.entries(M.headers||{}).map(([J,re])=>({k:J,v:re})),C.value="",d.value=!0}function S(){d.value=!1,x.value=null}function j(){if(C.value="",!f.value.trim())return C.value="Name is required",!1;if(m.value==="stdio"&&!v.value.trim())return C.value="Command is required for stdio type",!1;if(m.value==="http"){const z=F.value.trim();if(!z)return C.value="URL is required for http type",!1;if(!/^https?:\/\/.+/.test(z))return C.value="URL must start with http:// or https://",!1}return!0}async function G(){if(!j()||a.value)return;a.value=!0;const z=f.value.trim(),M={type:m.value};if(m.value==="stdio"){M.command=v.value.trim();const J=k.value.trim();J&&(M.args=J.split(/\s+/));const re=Object.fromEntries($.value.filter(_e=>_e.k.trim()).map(_e=>[_e.k.trim(),_e.v]));Object.keys(re).length&&(M.env=re)}else{M.url=F.value.trim();const J=Object.fromEntries(N.value.filter(re=>re.k.trim()).map(re=>[re.k.trim(),re.v]));Object.keys(J).length&&(M.headers=J)}try{const J=await fetch("/api/mcp-servers",{method:"POST",headers:{Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},body:JSON.stringify({name:z,config:M})});if(!J.ok)throw new Error(J.statusText);r.value="Saved ✓",l.value=!0,setTimeout(()=>{r.value=""},3e3),S(),await R()}catch(J){C.value="Error: "+J.message}finally{a.value=!1}}async function ae(z){if(confirm(`Delete MCP server "${z}"?`)&&!u.value){u.value=z;try{const M=await fetch(`/api/mcp-servers/${encodeURIComponent(z)}`,{method:"DELETE",headers:{Authorization:`Bearer ${de()}`}});if(!M.ok)throw new Error(M.statusText);r.value="Deleted ✓",l.value=!0,setTimeout(()=>{r.value=""},3e3),await R()}catch(M){r.value="Error: "+M.message,l.value=!1}finally{u.value=null}}}return Be(R),(z,M)=>(h(),g("div",Pd,[o("div",Ad,[o("div",Id,[M[7]||(M[7]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"MCP Servers"),o("p",{class:"text-sm text-textSecondary mt-1"},"Manage external MCP server connections (stdio and HTTP)")],-1)),o("div",Md,[r.value?(h(),g("span",{key:0,class:q(["text-sm",l.value?"text-success":"text-danger"])},b(r.value),3)):K("",!0),o("button",{onClick:U,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight text-white text-sm font-medium transition"}," + Add Server ")])]),s.value?(h(),g("div",Od,"Loading...")):n.value?(h(),g("div",Dd,b(n.value),1)):Object.keys(t.value).length===0?(h(),g("div",Rd,"No MCP servers configured")):(h(),g("div",jd,[t.value[Gt]?(h(),g("div",Ld,[o("div",Ud,[o("div",Nd,[o("span",{class:"font-medium text-sm font-mono"},b(Gt)),o("span",{class:"type-badge",style:Ut(I(t.value[Gt].type))},b(t.value[Gt].type),5),M[8]||(M[8]=o("span",{class:"type-badge",style:{background:"rgba(245,158,11,0.15)",color:"#fbbf24"}},"built-in",-1))]),M[9]||(M[9]=o("span",{class:"text-xs text-muted italic"},"read-only",-1))])])):K("",!0),(h(!0),g(se,null,ve(E.value,([J,re])=>{var _e;return h(),g("div",{key:J,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[o("div",Vd,[o("div",Bd,[o("div",Fd,[o("span",Hd,b(J),1),o("span",{class:"type-badge",style:Ut(I(re.type))},b(re.type),5)]),o("div",Kd,[re.type==="stdio"?(h(),g(se,{key:0},[X(b(re.command)+b((_e=re.args)!=null&&_e.length?" "+re.args.join(" "):""),1)],64)):(h(),g(se,{key:1},[X(b(re.url),1)],64))])]),o("div",Wd,[o("button",{onClick:ke=>y(J,re),class:"px-3 py-1.5 rounded-lg bg-card hover:bg-cardHover border border-gray-700 text-xs text-textSecondary hover:text-textPrimary transition"},"Edit",8,zd),o("button",{onClick:ke=>ae(J),disabled:u.value===J,class:"px-3 py-1.5 rounded-lg bg-card hover:bg-red-900/40 border border-gray-700 hover:border-red-700 text-xs text-textSecondary hover:text-red-400 transition disabled:opacity-50"},b(u.value===J?"…":"Delete"),9,Jd)])])])}),128))]))]),d.value?(h(),g("div",qd,[o("h3",Gd,b(x.value?`Edit: ${x.value}`:"Add MCP Server"),1),o("div",Yd,[o("div",null,[M[10]||(M[10]=o("label",{class:"text-xs text-textSecondary block mb-1"},[X("Name "),o("span",{class:"text-danger"},"*")],-1)),Z(o("input",{"onUpdate:modelValue":M[0]||(M[0]=J=>f.value=J),type:"text",readonly:!!x.value,placeholder:"my-server",class:q(["w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition",x.value?"opacity-60 cursor-not-allowed":""])},null,10,Zd),[[ne,f.value]])]),o("div",null,[M[12]||(M[12]=o("label",{class:"text-xs text-textSecondary block mb-1"},[X("Type "),o("span",{class:"text-danger"},"*")],-1)),Z(o("select",{"onUpdate:modelValue":M[1]||(M[1]=J=>m.value=J),class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...M[11]||(M[11]=[o("option",{value:"stdio"},"stdio",-1),o("option",{value:"http"},"http",-1)])],512),[[At,m.value]])])]),m.value==="stdio"?(h(),g(se,{key:0},[o("div",Qd,[o("div",null,[M[13]||(M[13]=o("label",{class:"text-xs text-textSecondary block mb-1"},[X("Command "),o("span",{class:"text-danger"},"*")],-1)),Z(o("input",{"onUpdate:modelValue":M[2]||(M[2]=J=>v.value=J),type:"text",placeholder:"node",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[ne,v.value]])]),o("div",null,[M[14]||(M[14]=o("label",{class:"text-xs text-textSecondary block mb-1"},"Args (space-separated)",-1)),Z(o("input",{"onUpdate:modelValue":M[3]||(M[3]=J=>k.value=J),type:"text",placeholder:"./server.js --port 3000",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[ne,k.value]])])]),o("div",Xd,[o("div",ef,[M[15]||(M[15]=o("label",{class:"text-xs text-textSecondary"},"Environment Variables",-1)),o("button",{onClick:M[4]||(M[4]=J=>$.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(h(!0),g(se,null,ve($.value,(J,re)=>(h(),g("div",{key:re,class:"flex items-center gap-2 mb-2"},[Z(o("input",{"onUpdate:modelValue":_e=>J.k=_e,type:"text",placeholder:"KEY",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,tf),[[ne,J.k]]),M[16]||(M[16]=o("span",{class:"text-muted text-xs"},"=",-1)),Z(o("input",{"onUpdate:modelValue":_e=>J.v=_e,type:"text",placeholder:"value",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,sf),[[ne,J.v]]),o("button",{onClick:_e=>$.value.splice(re,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,nf)]))),128)),$.value.length===0?(h(),g("div",of,"No env vars")):K("",!0)])],64)):(h(),g(se,{key:1},[o("div",rf,[M[17]||(M[17]=o("label",{class:"text-xs text-textSecondary block mb-1"},[X("URL "),o("span",{class:"text-danger"},"*")],-1)),Z(o("input",{"onUpdate:modelValue":M[5]||(M[5]=J=>F.value=J),type:"text",placeholder:"http://localhost:3000/mcp",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[ne,F.value]])]),o("div",lf,[o("div",af,[M[18]||(M[18]=o("label",{class:"text-xs text-textSecondary"},"Headers",-1)),o("button",{onClick:M[6]||(M[6]=J=>N.value.push({k:"",v:""})),class:"text-xs text-accent hover:text-accentLight transition"},"+ Add")]),(h(!0),g(se,null,ve(N.value,(J,re)=>(h(),g("div",{key:re,class:"flex items-center gap-2 mb-2"},[Z(o("input",{"onUpdate:modelValue":_e=>J.k=_e,type:"text",placeholder:"Header-Name",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,cf),[[ne,J.k]]),M[19]||(M[19]=o("span",{class:"text-muted text-xs"},":",-1)),Z(o("input",{"onUpdate:modelValue":_e=>J.v=_e,type:"text",placeholder:"value",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,uf),[[ne,J.v]]),o("button",{onClick:_e=>N.value.splice(re,1),class:"text-muted hover:text-danger transition text-xs px-2"},"✕",8,df)]))),128)),N.value.length===0?(h(),g("div",ff,"No headers")):K("",!0)])],64)),o("div",pf,[o("button",{onClick:G,disabled:a.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},b(a.value?"Saving…":x.value?"Save Changes":"Add Server"),9,mf),o("button",{onClick:S,class:"px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"}," Cancel "),C.value?(h(),g("span",xf,b(C.value),1)):K("",!0)])])):K("",!0)]))}}),hf={class:"animate-fade-in"},gf={class:"glass rounded-xl p-6 mb-6"},yf={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},bf={class:"flex items-center gap-3"},_f=["disabled"],wf={key:0,class:"text-center py-8 text-textSecondary text-sm"},kf={key:1,class:"space-y-6"},Sf={class:"glass rounded-xl p-4 border border-gray-700/50"},$f={class:"glass rounded-xl p-4 border border-gray-700/50"},Cf={class:"glass rounded-xl p-4 border border-gray-700/50"},Tf={class:"glass rounded-xl p-4 border border-gray-700/50"},Ef={class:"glass rounded-xl p-4 border border-gray-700/50"},Pf={class:"glass rounded-xl p-4 border border-gray-700/50"},Af={class:"text-xs text-textSecondary mb-3"},If={class:"flex items-center gap-2"},Mf=["placeholder"],Of=["disabled"],Df={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},Rf={class:"grid grid-cols-2 gap-4"},jf={class:"text-sm font-medium font-mono text-textSecondary"},Lf={class:"text-sm font-medium font-mono text-textSecondary"},Uf={class:"mt-3"},Nf=He({__name:"ClaudeTab",setup(e){const t=w(!0),s=w(!1),n=w(""),r=w("claude-opus-4-6"),l=w("claude-opus-4-6"),a=w("claude-sonnet-4-5"),u=w("claude-sonnet-4-5"),d=w(!1),x=w(""),f=w(""),m=w(""),v=w(""),k=w(20),F=w(20),$=w(""),N=w(!1),C=Ee(()=>r.value!==l.value||a.value!==u.value||x.value!==f.value||m.value!==v.value||k.value!==F.value||$.value.length>0);async function E(){t.value=!0;try{const[U,y,S]=await Promise.all([he("/api/settings/default-thread-model"),he("/api/settings/default-worker-model"),he("/api/settings/claude")]);r.value=U.defaultThreadModel,l.value=U.defaultThreadModel,a.value=y.defaultWorkerModel,u.value=y.defaultWorkerModel,x.value=S.cliPath,f.value=S.cliPath,m.value=S.gitBashPath,v.value=S.gitBashPath,k.value=S.maxConcurrentThreads,F.value=S.maxConcurrentThreads,N.value=S.oauthTokenSet,$.value=""}finally{t.value=!1}}async function R(){if(s.value=!0,n.value="",!r.value){n.value="Error: Thread model cannot be empty",s.value=!1;return}if(!a.value){n.value="Error: Worker model cannot be empty",s.value=!1;return}if(!Number.isFinite(k.value)||k.value<1){n.value="Error: Max concurrent threads must be at least 1",s.value=!1;return}try{const U={Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},y={cliPath:x.value,gitBashPath:m.value,maxConcurrentThreads:k.value};$.value.length>0&&(y.oauthToken=$.value);const[S,j,G]=await Promise.all([fetch("/api/settings/default-thread-model",{method:"POST",headers:U,body:JSON.stringify({model:r.value})}),fetch("/api/settings/default-worker-model",{method:"POST",headers:U,body:JSON.stringify({model:a.value})}),fetch("/api/settings/claude",{method:"POST",headers:U,body:JSON.stringify(y)})]);for(const J of[S,j,G])if(!J.ok){const re=await J.json().catch(()=>({error:J.statusText}));throw new Error(re.error??J.statusText)}const ae=await S.json(),z=await j.json(),M=await G.json();l.value=ae.defaultThreadModel,r.value=ae.defaultThreadModel,u.value=z.defaultWorkerModel,a.value=z.defaultWorkerModel,x.value=M.cliPath,f.value=M.cliPath,m.value=M.gitBashPath,v.value=M.gitBashPath,k.value=M.maxConcurrentThreads,F.value=M.maxConcurrentThreads,N.value=M.oauthTokenSet,$.value="",n.value="Saved ✓",setTimeout(()=>{n.value=""},3e3)}catch(U){n.value="Error: "+U.message}finally{s.value=!1}}async function I(){d.value=!0,n.value="";try{const U={Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},y=await fetch("/api/settings/claude",{method:"POST",headers:U,body:JSON.stringify({clearOauthToken:!0})});if(!y.ok){const j=await y.json().catch(()=>({error:y.statusText}));throw new Error(j.error??y.statusText)}const S=await y.json();N.value=S.oauthTokenSet,$.value="",n.value="Token cleared ✓",setTimeout(()=>{n.value=""},3e3)}catch(U){n.value="Error: "+U.message}finally{d.value=!1}}return Be(E),(U,y)=>(h(),g("div",hf,[o("div",gf,[o("div",yf,[y[6]||(y[6]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Claude"),o("p",{class:"text-sm text-textSecondary mt-1"},"Default models for Claude Code threads and workers")],-1)),o("div",bf,[n.value?(h(),g("span",{key:0,class:q([n.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},b(n.value),3)):K("",!0),o("button",{onClick:R,disabled:s.value||t.value||!C.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},b(s.value?"Saving…":"Save"),9,_f)])]),t.value?(h(),g("div",wf,"Loading…")):(h(),g("div",kf,[o("div",Sf,[y[7]||(y[7]=o("label",{class:"block text-sm font-medium mb-1"},"Default Thread Model",-1)),y[8]||(y[8]=o("p",{class:"text-xs text-textSecondary mb-3"},[X(" Model used when spawning a normal (orchestrator) Claude thread. Overridden by the "),o("span",{class:"font-mono text-accentLight"},"CLAUDE_MODEL"),X(" env var if set. ")],-1)),Z(o("input",{"onUpdate:modelValue":y[0]||(y[0]=S=>r.value=S),type:"text",placeholder:"claude-opus-4-6",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[ne,r.value,void 0,{trim:!0}]])]),o("div",$f,[y[9]||(y[9]=o("label",{class:"block text-sm font-medium mb-1"},"Default Worker Model",-1)),y[10]||(y[10]=o("p",{class:"text-xs text-textSecondary mb-3"},[X(" Model used when spawning a worker Claude thread. Overridden by the "),o("span",{class:"font-mono text-accentLight"},"CLAUDE_WORKER_MODEL"),X(" env var if set. ")],-1)),Z(o("input",{"onUpdate:modelValue":y[1]||(y[1]=S=>a.value=S),type:"text",placeholder:"claude-sonnet-4-5",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[ne,a.value,void 0,{trim:!0}]])]),o("div",Cf,[y[11]||(y[11]=o("label",{class:"block text-sm font-medium mb-1"},"Claude CLI Path",-1)),y[12]||(y[12]=o("p",{class:"text-xs text-textSecondary mb-3"},[X(" Explicit path to the Claude binary. Leave empty to auto-detect. Overridden by the "),o("span",{class:"font-mono text-accentLight"},"CLAUDE_CLI_CMD"),X(" env var if set. ")],-1)),Z(o("input",{"onUpdate:modelValue":y[2]||(y[2]=S=>x.value=S),type:"text",placeholder:"(auto-detect)",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[ne,x.value,void 0,{trim:!0}]])]),o("div",Tf,[y[13]||(y[13]=o("label",{class:"block text-sm font-medium mb-1"},"Git Bash Path (Windows)",-1)),y[14]||(y[14]=o("p",{class:"text-xs text-textSecondary mb-3"},[X(" Path to "),o("span",{class:"font-mono text-accentLight"},"bash.exe"),X(" passed to Claude via "),o("span",{class:"font-mono text-accentLight"},"CLAUDE_CODE_GIT_BASH_PATH"),X(". Leave empty to auto-detect. ")],-1)),Z(o("input",{"onUpdate:modelValue":y[3]||(y[3]=S=>m.value=S),type:"text",placeholder:"(auto-detect)",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[ne,m.value,void 0,{trim:!0}]])]),o("div",Ef,[y[15]||(y[15]=o("label",{class:"block text-sm font-medium mb-1"},"Max Concurrent Threads",-1)),y[16]||(y[16]=o("p",{class:"text-xs text-textSecondary mb-3"}," Upper limit on simultaneously spawned agent processes. Raising this increases memory and CPU load. ",-1)),Z(o("input",{"onUpdate:modelValue":y[4]||(y[4]=S=>k.value=S),type:"number",min:"1",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[ne,k.value,void 0,{number:!0}]])]),o("div",Pf,[y[20]||(y[20]=o("label",{class:"block text-sm font-medium mb-1"},"Claude OAuth Token",-1)),o("p",Af,[y[17]||(y[17]=X(" Long-lived setup token used instead of the OAuth refresh flow. Overridden by the ",-1)),y[18]||(y[18]=o("span",{class:"font-mono text-accentLight"},"CLAUDE_CODE_OAUTH_TOKEN",-1)),y[19]||(y[19]=X(" env var if set. ",-1)),o("span",{class:q(N.value?"text-success":"text-muted")},b(N.value?"A token is currently stored.":"No token stored."),3)]),o("div",If,[Z(o("input",{"onUpdate:modelValue":y[5]||(y[5]=S=>$.value=S),type:"password",placeholder:N.value?"•••••••• (leave empty to keep)":"Paste token to store",class:"flex-1 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,Mf),[[ne,$.value]]),N.value?(h(),g("button",{key:0,onClick:I,disabled:d.value,class:"px-3 py-2 rounded-lg border border-gray-700 hover:border-danger hover:text-danger disabled:opacity-50 text-sm transition whitespace-nowrap"},b(d.value?"Clearing…":"Clear"),9,Of)):K("",!0)])]),o("div",Df,[y[23]||(y[23]=o("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),o("div",Rf,[o("div",null,[y[21]||(y[21]=o("div",{class:"text-xs text-muted mb-1"},"Thread Model",-1)),o("span",jf,b(l.value),1)]),o("div",null,[y[22]||(y[22]=o("div",{class:"text-xs text-muted mb-1"},"Worker Model",-1)),o("span",Lf,b(u.value),1)])]),o("div",Uf,[o("span",{class:q(["text-sm font-medium",C.value?"text-warn":"text-textSecondary"])},b(C.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),Vf={class:"animate-fade-in"},Bf={class:"glass rounded-xl p-6 mb-6"},Ff={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},Hf={class:"flex items-center gap-3"},Kf=["disabled"],Wf={key:0,class:"text-center py-8 text-textSecondary text-sm"},zf={key:1,class:"space-y-6"},Jf={class:"glass rounded-xl p-4 border border-gray-700/50"},qf={id:"copilot-models"},Gf=["value"],Yf={key:0,class:"text-xs text-success mt-2"},Zf={class:"glass rounded-xl p-4 border border-gray-700/50"},Qf={class:"flex items-center justify-between cursor-pointer"},Xf={class:"glass rounded-xl p-4 border border-gray-700/50"},ep=["disabled"],tp={class:"glass rounded-xl p-4 border border-gray-700/50"},sp=["disabled"],np={class:"glass rounded-xl p-4 border border-gray-700/50"},op={class:"text-xs text-textSecondary mb-3"},rp={key:0,class:"text-success"},lp={key:1,class:"text-warn"},ap=["disabled","placeholder"],ip={class:"glass rounded-xl p-4 border border-gray-700/50"},cp={key:0,class:"mt-4 space-y-4"},up=["disabled"],dp=["disabled"],fp={class:"glass rounded-xl p-4 border border-gray-700/50"},pp={class:"flex items-center justify-between gap-3"},mp=["disabled"],xp={key:1,class:"mt-3 max-h-48 overflow-y-auto rounded-lg bg-surface/50 border border-gray-700/50 p-3"},vp={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},hp={class:"grid grid-cols-2 gap-4"},gp={class:"text-sm font-medium font-mono text-textSecondary"},yp=He({__name:"CopilotTab",setup(e){const t=w(!0),s=w(!1),n=w(""),r=w(""),l=w(!1),a=w("openai"),u=w(""),d=w(""),x=w(""),f=w(""),m=w(!1),v=w(!1),k=w(!1),F=w(""),$=w([]);async function N(){t.value=!0;try{const U=await he("/api/settings/copilot");C(U),l.value&&m.value&&I(!0)}finally{t.value=!1}}function C(U){r.value=U.model,l.value=U.byok.enabled,a.value=U.byok.providerType,u.value=U.byok.baseUrl,d.value=U.byok.modelId,x.value=U.byok.wireModel,m.value=U.byok.apiKeySet,f.value=""}const E=Ee(()=>!(!r.value.trim()||l.value&&(!u.value.trim()||!m.value&&!f.value.trim())));async function R(){if(s.value=!0,n.value="",!r.value.trim()){n.value="Error: Model cannot be empty",s.value=!1;return}try{const U={enabled:l.value,providerType:a.value,baseUrl:u.value.trim(),modelId:d.value.trim(),wireModel:x.value.trim()};f.value.trim()&&(U.apiKey=f.value.trim());const y={Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},S=await fetch("/api/settings/copilot",{method:"POST",headers:y,body:JSON.stringify({model:r.value.trim(),byok:U})});if(!S.ok){const G=await S.json().catch(()=>({error:S.statusText}));throw new Error(G.error??S.statusText)}const j=await S.json();C(j),n.value="Saved ✓",setTimeout(()=>{n.value=""},3e3)}catch(U){n.value="Error: "+U.message}finally{s.value=!1}}async function I(U=!1){k.value=!0,F.value="",$.value=[];try{const y=await fetch("/api/settings/copilot/models",{headers:{Authorization:`Bearer ${de()}`}}),S=await y.json();if(!y.ok||!S.ok)throw new Error(S.error??y.statusText);$.value=S.models??[],F.value=`OK — ${S.count??$.value.length} models`}catch(y){U||(F.value="Error: "+y.message)}finally{k.value=!1}}return Be(N),(U,y)=>(h(),g("div",Vf,[o("div",Bf,[o("div",Ff,[y[9]||(y[9]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Copilot"),o("p",{class:"text-sm text-textSecondary mt-1"},"Model and bring-your-own-key provider (OpenRouter, DeepSeek, Kimi)")],-1)),o("div",Hf,[n.value?(h(),g("span",{key:0,class:q([n.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},b(n.value),3)):K("",!0),o("button",{onClick:R,disabled:s.value||t.value||!E.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},b(s.value?"Saving…":"Save"),9,Kf)])]),t.value?(h(),g("div",Wf,"Loading…")):(h(),g("div",zf,[o("div",Jf,[y[10]||(y[10]=o("label",{class:"block text-sm font-medium mb-1"},"Copilot Model",-1)),y[11]||(y[11]=o("p",{class:"text-xs text-textSecondary mb-3"},[X(" Model passed to the Copilot CLI via "),o("span",{class:"font-mono text-accentLight"},"--model"),X(" / "),o("span",{class:"font-mono text-accentLight"},"COPILOT_MODEL"),X(". ")],-1)),Z(o("input",{"onUpdate:modelValue":y[0]||(y[0]=S=>r.value=S),type:"text",list:"copilot-models",placeholder:"claude-opus-4-6",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,512),[[ne,r.value,void 0,{trim:!0}]]),o("datalist",qf,[(h(!0),g(se,null,ve($.value,S=>(h(),g("option",{key:S,value:S},null,8,Gf))),128))]),$.value.length?(h(),g("p",Yf,b($.value.length)+" models loaded from provider — pick one from the dropdown. ",1)):K("",!0)]),o("div",Zf,[o("label",Qf,[y[12]||(y[12]=o("div",null,[o("div",{class:"text-sm font-medium"},"Custom Provider (BYOK)"),o("p",{class:"text-xs text-textSecondary mt-1"}," Route Copilot through an OpenAI-compatible endpoint. GitHub auth is not used while enabled. ")],-1)),Z(o("input",{"onUpdate:modelValue":y[1]||(y[1]=S=>l.value=S),type:"checkbox",class:"w-5 h-5 accent-accent"},null,512),[[an,l.value]])])]),o("div",{class:q(["space-y-4 transition",l.value?"":"opacity-40 pointer-events-none select-none"])},[o("div",Xf,[y[14]||(y[14]=o("label",{class:"block text-sm font-medium mb-1"},"Provider Type",-1)),y[15]||(y[15]=o("p",{class:"text-xs text-textSecondary mb-3"},[X(" Wire protocol of the endpoint ("),o("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_TYPE"),X("). ")],-1)),Z(o("select",{"onUpdate:modelValue":y[2]||(y[2]=S=>a.value=S),disabled:!l.value,class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary focus:outline-none focus:border-accent transition"},[...y[13]||(y[13]=[o("option",{value:"openai"},"openai",-1),o("option",{value:"azure"},"azure",-1),o("option",{value:"anthropic"},"anthropic",-1)])],8,ep),[[At,a.value]])]),o("div",tp,[y[16]||(y[16]=o("label",{class:"block text-sm font-medium mb-1"},"Base URL",-1)),y[17]||(y[17]=o("p",{class:"text-xs text-textSecondary mb-3"},[X(" e.g. "),o("span",{class:"font-mono text-accentLight"},"https://openrouter.ai/api/v1"),X(" ("),o("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_BASE_URL"),X("). ")],-1)),Z(o("input",{"onUpdate:modelValue":y[3]||(y[3]=S=>u.value=S),type:"text",disabled:!l.value,placeholder:"https://openrouter.ai/api/v1",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,sp),[[ne,u.value,void 0,{trim:!0}]])]),o("div",np,[y[21]||(y[21]=o("label",{class:"block text-sm font-medium mb-1"},"API Key",-1)),o("p",op,[y[18]||(y[18]=X(" Stored server-side and never echoed back (",-1)),y[19]||(y[19]=o("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_API_KEY",-1)),y[20]||(y[20]=X("). ",-1)),m.value?(h(),g("span",rp,"A key is currently set — leave blank to keep it.")):(h(),g("span",lp,"No key set."))]),Z(o("input",{"onUpdate:modelValue":y[4]||(y[4]=S=>f.value=S),type:"password",disabled:!l.value,placeholder:m.value?"•••••••• (unchanged)":"sk-…",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,ap),[[ne,f.value]])]),o("div",ip,[o("button",{type:"button",onClick:y[5]||(y[5]=S=>v.value=!v.value),class:"text-sm font-medium text-textSecondary hover:text-textPrimary transition flex items-center gap-2"},[o("span",null,b(v.value?"▾":"▸"),1),y[22]||(y[22]=X(" Advanced (model mapping) ",-1))]),v.value?(h(),g("div",cp,[o("div",null,[y[23]||(y[23]=o("label",{class:"block text-sm font-medium mb-1"},"Model ID",-1)),y[24]||(y[24]=o("p",{class:"text-xs text-textSecondary mb-2"},[X(" Well-known base model for tool config ("),o("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_MODEL_ID"),X("). Defaults to Copilot Model. ")],-1)),Z(o("input",{"onUpdate:modelValue":y[6]||(y[6]=S=>d.value=S),type:"text",disabled:!l.value,placeholder:"(defaults to Copilot Model)",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,up),[[ne,d.value,void 0,{trim:!0}]])]),o("div",null,[y[25]||(y[25]=o("label",{class:"block text-sm font-medium mb-1"},"Wire Model",-1)),y[26]||(y[26]=o("p",{class:"text-xs text-textSecondary mb-2"},[X(" Exact model name sent to the provider ("),o("span",{class:"font-mono text-accentLight"},"COPILOT_PROVIDER_WIRE_MODEL"),X("). Defaults to Copilot Model. ")],-1)),Z(o("input",{"onUpdate:modelValue":y[7]||(y[7]=S=>x.value=S),type:"text",disabled:!l.value,placeholder:"(defaults to Copilot Model)",class:"w-full px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono focus:outline-none focus:border-accent transition"},null,8,dp),[[ne,x.value,void 0,{trim:!0}]])])])):K("",!0)]),o("div",fp,[o("div",pp,[y[27]||(y[27]=o("div",null,[o("div",{class:"text-sm font-medium"},"Test Connection"),o("p",{class:"text-xs text-textSecondary mt-1"},[X(" Lists models from "),o("span",{class:"font-mono text-accentLight"},"{baseUrl}/models"),X(" using the stored key. Save first — this sends the stored key to the configured endpoint. ")])],-1)),o("button",{onClick:y[8]||(y[8]=S=>I()),disabled:k.value||!l.value,class:"px-4 py-2 rounded-xl bg-surface border border-gray-700 hover:border-accent disabled:opacity-50 text-sm font-medium transition whitespace-nowrap"},b(k.value?"Testing…":"Test"),9,mp)]),F.value?(h(),g("div",{key:0,class:q([F.value.startsWith("Error")?"text-danger":"text-success","text-sm mt-3"])},b(F.value),3)):K("",!0),$.value.length?(h(),g("div",xp,[(h(!0),g(se,null,ve($.value,S=>(h(),g("div",{key:S,class:"text-xs font-mono text-textSecondary py-0.5"},b(S),1))),128))])):K("",!0)])],2),o("div",vp,[y[30]||(y[30]=o("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),o("div",hp,[o("div",null,[y[28]||(y[28]=o("div",{class:"text-xs text-muted mb-1"},"Model",-1)),o("span",gp,b(r.value||"—"),1)]),o("div",null,[y[29]||(y[29]=o("div",{class:"text-xs text-muted mb-1"},"Custom Provider",-1)),o("span",{class:q(["text-sm font-medium",l.value?"text-success":"text-textSecondary"])},b(l.value?"Enabled":"Disabled"),3)])])])]))])]))}}),bp={class:"animate-fade-in"},_p={class:"glass rounded-xl p-6 mb-6"},wp={class:"flex flex-wrap items-center justify-between gap-4 mb-6"},kp={class:"flex items-center gap-3"},Sp=["disabled"],$p={key:0,class:"text-center py-8 text-textSecondary text-sm"},Cp={key:1,class:"space-y-6"},Tp={class:"glass rounded-xl p-4 border border-gray-700/50"},Ep={class:"flex items-center gap-4"},Pp={class:"flex justify-between text-xs text-muted mt-2"},Ap={class:"font-mono"},Ip={key:0,class:"mt-3 px-3 py-2 rounded-lg bg-warn/10 border border-warn/20 text-xs text-warn"},Mp={class:"glass rounded-xl p-4 border border-gray-700/50"},Op={class:"flex items-center gap-4"},Dp={class:"flex justify-between text-xs text-muted mt-2"},Rp={class:"font-mono"},jp={class:"glass rounded-xl p-4 border border-gray-700/30 bg-surface/30"},Lp={class:"grid grid-cols-2 gap-4"},Up={class:"text-sm font-medium text-textSecondary"},Np={class:"mt-3"},Vp=He({__name:"SettingsTab",setup(e){const t=w(!0),s=w(!1),n=w(""),r=w(50),l=w(50),a=w(1440),u=w(1440),d=Ee(()=>r.value!==l.value||a.value!==u.value);async function x(){t.value=!0;try{const[m,v]=await Promise.all([he("/api/settings/bootstrap-message-count"),he("/api/settings/wait-timeout")]);r.value=m.count,l.value=m.count,a.value=v.minutes,u.value=v.minutes}finally{t.value=!1}}async function f(){s.value=!0,n.value="";try{const m={Authorization:`Bearer ${de()}`,"Content-Type":"application/json"},[v,k]=await Promise.all([fetch("/api/settings/bootstrap-message-count",{method:"POST",headers:m,body:JSON.stringify({count:r.value})}),fetch("/api/settings/wait-timeout",{method:"POST",headers:m,body:JSON.stringify({minutes:a.value})})]);for(const N of[v,k])if(!N.ok){const C=await N.json().catch(()=>({error:N.statusText}));throw new Error(C.error??N.statusText)}const F=await v.json(),$=await k.json();l.value=F.count,r.value=F.count,u.value=$.minutes,a.value=$.minutes,n.value="Saved ✓",setTimeout(()=>{n.value=""},3e3)}catch(m){n.value="Error: "+m.message}finally{s.value=!1}}return Be(x),(m,v)=>(h(),g("div",bp,[o("div",_p,[o("div",wp,[v[4]||(v[4]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Settings"),o("p",{class:"text-sm text-textSecondary mt-1"},"Configure agent behavior and context injection")],-1)),o("div",kp,[n.value?(h(),g("span",{key:0,class:q([n.value.startsWith("Error")?"text-danger":"text-success","text-sm"])},b(n.value),3)):K("",!0),o("button",{onClick:f,disabled:s.value||t.value||!d.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition"},b(s.value?"Saving…":"Save"),9,Sp)])]),t.value?(h(),g("div",$p,"Loading…")):(h(),g("div",Cp,[o("div",Tp,[v[8]||(v[8]=o("label",{class:"block text-sm font-medium mb-1"},"Recent Conversation Buffer",-1)),v[9]||(v[9]=o("p",{class:"text-xs text-textSecondary mb-3"},[X(" Number of recent messages injected into the agent's bootstrap context. Set to "),o("span",{class:"font-mono text-accentLight"},"0"),X(" to disable (useful when using VS Code, which maintains its own conversation history). ")],-1)),o("div",Ep,[Z(o("input",{"onUpdate:modelValue":v[0]||(v[0]=k=>r.value=k),type:"range",min:"0",max:"100",step:"5",class:"flex-1 accent-accent"},null,512),[[ne,r.value,void 0,{number:!0}]]),Z(o("input",{"onUpdate:modelValue":v[1]||(v[1]=k=>r.value=k),type:"number",min:"0",max:"200",class:"w-20 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono text-center focus:outline-none focus:border-accent transition"},null,512),[[ne,r.value,void 0,{number:!0}]])]),o("div",Pp,[v[5]||(v[5]=o("span",null,"Off",-1)),o("span",Ap,b(r.value)+" messages",1),v[6]||(v[6]=o("span",null,"Max",-1))]),r.value===0?(h(),g("div",Ip,[...v[7]||(v[7]=[X(" Message buffer injection is ",-1),o("strong",null,"disabled",-1),X(". The agent will not see recent conversation history in its bootstrap context. Use this when VS Code (or another IDE) already provides conversation history. ",-1)])])):K("",!0)]),o("div",Mp,[v[12]||(v[12]=o("label",{class:"block text-sm font-medium mb-1"},"Poll Timeout (wait_for_instructions)",-1)),v[13]||(v[13]=o("p",{class:"text-xs text-textSecondary mb-3"},[X(" Maximum time (in minutes) a single "),o("span",{class:"font-mono text-accentLight"},"wait_for_instructions"),X(" call will poll before timing out. Claude Code agents use the full value; Copilot agents are capped at 10 min. ")],-1)),o("div",Op,[Z(o("input",{"onUpdate:modelValue":v[2]||(v[2]=k=>a.value=k),type:"range",min:"1",max:"1440",step:"10",class:"flex-1 accent-accent"},null,512),[[ne,a.value,void 0,{number:!0}]]),Z(o("input",{"onUpdate:modelValue":v[3]||(v[3]=k=>a.value=k),type:"number",min:"1",max:"10080",class:"w-24 px-3 py-2 rounded-lg bg-surface border border-gray-700 text-sm text-textPrimary font-mono text-center focus:outline-none focus:border-accent transition"},null,512),[[ne,a.value,void 0,{number:!0}]])]),o("div",Dp,[v[10]||(v[10]=o("span",null,"1 min",-1)),o("span",Rp,b(a.value>=60?Math.floor(a.value/60)+"h "+a.value%60+"m":a.value+" min"),1),v[11]||(v[11]=o("span",null,"24h",-1))])]),o("div",jp,[v[16]||(v[16]=o("div",{class:"text-xs font-medium text-textSecondary uppercase tracking-wider mb-3"},"Current State",-1)),o("div",Lp,[o("div",null,[v[14]||(v[14]=o("div",{class:"text-xs text-muted mb-1"},"Message Buffer",-1)),o("span",{class:q(["text-sm font-medium",l.value>0?"text-success":"text-textSecondary"])},b(l.value>0?`${l.value} messages`:"Disabled"),3)]),o("div",null,[v[15]||(v[15]=o("div",{class:"text-xs text-muted mb-1"},"Poll Timeout",-1)),o("span",Up,b(u.value>=60?Math.floor(u.value/60)+"h "+u.value%60+"m":u.value+" min"),1)])]),o("div",Np,[o("span",{class:q(["text-sm font-medium",d.value?"text-warn":"text-textSecondary"])},b(d.value?"Unsaved changes":"Saved"),3)])])]))])]))}}),Bp={class:"animate-fade-in"},Fp={class:"glass rounded-xl p-6 mb-6"},Hp={class:"flex flex-wrap items-center justify-between gap-4 mb-4"},Kp={class:"flex flex-wrap gap-3 items-center"},Wp=["disabled"],zp={key:0,class:"flex items-center gap-2"},Jp={key:1},qp={class:"glass rounded-xl p-6"},Gp={key:0,class:"text-center py-8 text-textSecondary text-sm"},Yp={key:1,class:"text-center py-12 text-textSecondary text-sm"},Zp={key:2,class:"space-y-2"},Qp={class:"flex items-center justify-between gap-3"},Xp={class:"flex-1 min-w-0"},em={class:"flex flex-wrap items-center gap-2 mb-1"},tm={class:"font-medium text-sm font-mono"},sm={class:"type-badge",style:{background:"rgba(99,102,241,0.15)",color:"#818cf8"}},nm={class:"text-xs text-muted"},om={class:"text-xs text-muted"},rm=["onClick","disabled"],lm={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/80 backdrop-blur-sm"},am={class:"glass rounded-2xl p-6 max-w-sm w-full mx-4"},im={class:"text-sm text-textSecondary mb-4"},cm={class:"font-mono text-textPrimary"},um=He({__name:"SnapshotsTab",setup(e){const t=w([]),s=w(!0),n=w(!1),r=w(null),l=w(""),a=w(""),u=w(!0),d=w(null);function x(C){return C<1024?`${C} B`:C<1024*1024?`${(C/1024).toFixed(1)} KB`:`${(C/(1024*1024)).toFixed(1)} MB`}function f(C){try{return new Date(C).toLocaleString()}catch{return C}}function m(C,E){a.value=C,u.value=E,setTimeout(()=>{a.value=""},4e3)}async function v(){s.value=!0;try{const C=await he("/api/snapshots");t.value=C.snapshots}catch(C){m("Failed to load snapshots: "+C.message,!1)}finally{s.value=!1}}async function k(){if(!n.value){n.value=!0;try{await he("/api/snapshots",{method:"POST",body:JSON.stringify({description:l.value})}),l.value="",m("Snapshot created ✓",!0),await v()}catch(C){m("Error: "+C.message,!1)}finally{n.value=!1}}}function F(C){d.value=C}function $(){d.value=null}async function N(){const C=d.value;if(!(!C||r.value)){d.value=null,r.value=C;try{await he(`/api/snapshots/${encodeURIComponent(C)}`,{method:"DELETE"}),m("Deleted ✓",!0),await v()}catch(E){m("Error: "+E.message,!1)}finally{r.value=null}}}return Be(v),(C,E)=>(h(),g("div",Bp,[o("div",Fp,[o("div",Hp,[E[1]||(E[1]=o("div",null,[o("h3",{class:"text-lg font-semibold"},"Snapshots"),o("p",{class:"text-sm text-textSecondary mt-1"},"Create and manage data directory snapshots")],-1)),a.value?(h(),g("span",{key:0,class:q(["text-sm",u.value?"text-success":"text-danger"])},b(a.value),3)):K("",!0)]),o("div",Kp,[Z(o("input",{"onUpdate:modelValue":E[0]||(E[0]=R=>l.value=R),type:"text",placeholder:"Description (optional)",class:"flex-1 min-w-48 px-3 py-2 rounded-xl bg-surface border border-gray-700 text-sm text-textPrimary placeholder-muted focus:outline-none focus:border-accent transition",onKeydown:Xe(k,["enter"])},null,544),[[ne,l.value]]),o("button",{onClick:k,disabled:n.value,class:"px-4 py-2 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white text-sm font-medium transition whitespace-nowrap"},[n.value?(h(),g("span",zp,[...E[2]||(E[2]=[o("svg",{class:"w-4 h-4 animate-spin",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 12a8 8 0 018-8v8H4z"})],-1),X(" Creating… ",-1)])])):(h(),g("span",Jp,"+ Create Snapshot"))],8,Wp)])]),o("div",qp,[s.value?(h(),g("div",Gp,"Loading…")):t.value.length===0?(h(),g("div",Yp,"No snapshots yet")):(h(),g("div",Zp,[(h(!0),g(se,null,ve(t.value,R=>(h(),g("div",{key:R.name,class:"glass rounded-xl p-4 border border-transparent hover:border-gray-700 transition"},[o("div",Qp,[o("div",Xp,[o("div",em,[o("span",tm,b(R.name),1),o("span",sm,"v"+b(R.mcpVersion),1),o("span",nm,b(x(R.sizeBytes)),1)]),o("div",om,[X(b(f(R.createdAt)),1),R.description?(h(),g(se,{key:0},[X(" · "+b(R.description),1)],64)):K("",!0)])]),o("button",{onClick:I=>F(R.name),disabled:r.value===R.name,class:"px-3 py-1.5 rounded-lg bg-card hover:bg-red-900/40 border border-gray-700 hover:border-red-700 text-xs text-textSecondary hover:text-red-400 transition disabled:opacity-50 shrink-0"},b(r.value===R.name?"…":"Delete"),9,rm)])]))),128))]))]),d.value?(h(),g("div",lm,[o("div",am,[E[5]||(E[5]=o("h3",{class:"text-base font-semibold mb-2"},"Delete Snapshot",-1)),o("p",im,[E[3]||(E[3]=X(" Delete ",-1)),o("span",cm,b(d.value),1),E[4]||(E[4]=X("? This cannot be undone. ",-1))]),o("div",{class:"flex gap-3"},[o("button",{onClick:N,class:"flex-1 px-4 py-2 rounded-xl bg-danger hover:opacity-80 text-white text-sm font-medium transition"},"Delete"),o("button",{onClick:$,class:"flex-1 px-4 py-2 rounded-xl bg-card hover:bg-cardHover border border-gray-700 text-sm text-textSecondary hover:text-textPrimary transition"},"Cancel")])])])):K("",!0)]))}}),dm={class:"animate-fade-in space-y-6"},fm={class:"glass rounded-xl p-6"},pm={class:"flex flex-wrap items-center justify-between gap-4 mb-2"},mm={class:"text-sm text-textSecondary mt-1"},xm={class:"flex items-center gap-3"},vm={key:0,class:"text-xs text-accentLight animate-pulse"},hm={key:0,class:"flex flex-wrap gap-2 mt-3"},gm=["onClick"],ym={class:"ml-1 opacity-60"},bm={key:0,class:"text-center py-12 text-textSecondary"},_m={key:1,class:"text-center py-8 text-danger text-sm"},wm={key:2,class:"text-center py-12 text-textSecondary"},km={key:3,class:"space-y-3"},Sm={class:"flex flex-wrap items-start gap-3"},$m={class:"flex-1 min-w-0 space-y-2"},Cm={class:"flex flex-wrap items-center gap-2"},Tm={class:"font-semibold truncate"},Em={class:"text-xs text-muted font-mono"},Pm={class:"flex flex-wrap items-center gap-4 text-xs text-textSecondary"},Am={title:"Created"},Im={title:"Archived"},Mm={key:0,class:"text-muted"},Om={key:0,class:"text-sm text-textSecondary mt-1 leading-relaxed"},Dm={key:1,class:"text-sm text-muted mt-1 italic animate-pulse"},Rm={class:"flex items-center gap-2 shrink-0"},jm=["onClick","disabled"],Lm=3,Um=He({__name:"ArchivedThreadsTab",setup(e){const t=w([]),s=w(!0),n=w(""),r=w({}),l=w({}),a=w({done:0,total:0}),u=w(null),d=w("all");let x=0;const f={root:{emoji:"🟢",classes:"bg-green-500/20 text-green-400 border-green-500/30"},daily:{emoji:"🔵",classes:"bg-blue-500/20 text-blue-400 border-blue-500/30"},branch:{emoji:"🟣",classes:"bg-purple-500/20 text-purple-400 border-purple-500/30"}},m=Ee(()=>d.value==="all"?t.value:t.value.filter(E=>E.type===d.value)),v=Ee(()=>{const E={all:t.value.length};for(const R of t.value)E[R.type]=(E[R.type]??0)+1;return E}),k=Ee(()=>Object.values(l.value).some(Boolean));async function F(){s.value=!0,n.value="";try{const E=await he("/api/threads/archived");t.value=E.threads??[],r.value={},l.value={},t.value.length>0&&$()}catch(E){n.value=E.message||"Failed to load archived threads"}finally{s.value=!1}}async function $(){const E=++x,R=[...t.value];a.value={done:0,total:R.length};async function I(){for(;R.length>0&&E===x;){const y=R.shift();l.value={...l.value,[y.threadId]:!0};try{const S=await fetch(`/api/threads/${y.threadId}/summary`,{method:"POST",headers:{Authorization:`Bearer ${de()}`}});if(E!==x)return;if(S.ok){const j=await S.json();j.summary&&(r.value={...r.value,[y.threadId]:j.summary})}}catch{}finally{if(E===x){const{[y.threadId]:S,...j}=l.value;l.value=j,a.value={...a.value,done:a.value.done+1}}}}}const U=Array.from({length:Math.min(Lm,R.length)},()=>I());await Promise.all(U)}function N(E){if(!E)return"—";const R=new Date(E),U=Date.now()-R.getTime(),y=Math.floor(U/6e4),S=Math.floor(U/36e5),j=Math.floor(U/864e5),G=Math.floor(j/30);return y<1?"just now":y<60?`${y}m ago`:S<24?`${S}h ago`:j<30?`${j}d ago`:G<12?`${G}mo ago`:`${Math.floor(G/12)}y ago`}async function C(E){if(confirm(`Unarchive thread "${E.name}" (${E.threadId})?`)){u.value=E.threadId;try{const R=await fetch(`/api/threads/${E.threadId}/unarchive`,{method:"POST",headers:{Authorization:`Bearer ${de()}`}});if(!R.ok){const I=await R.json().catch(()=>({error:R.statusText}));throw new Error(I.error??R.statusText)}await F()}catch(R){n.value="Failed to unarchive: "+R.message}finally{u.value=null}}}return Be(F),(E,R)=>(h(),g("div",dm,[o("div",fm,[o("div",pm,[o("div",null,[R[0]||(R[0]=o("h3",{class:"text-lg font-semibold"},"Archived Threads",-1)),o("p",mm,b(t.value.length)+" archived thread"+b(t.value.length!==1?"s":"")+" — auto-purged after 180 days",1)]),o("div",xm,[k.value?(h(),g("span",vm," Building summaries… "+b(a.value.done)+"/"+b(a.value.total),1)):K("",!0),o("button",{onClick:F,class:"px-3 py-2 rounded-xl bg-card border border-gray-700 text-sm hover:bg-surface transition"}," ↻ Refresh ")])]),t.value.length>0?(h(),g("div",hm,[(h(),g(se,null,ve(["all","root","branch","daily"],I=>o("button",{key:I,onClick:U=>d.value=I,class:q(["px-3 py-1 rounded-full text-xs font-medium border transition",d.value===I?"bg-accent/20 text-accent border-accent/30":"bg-card border-gray-700 text-textSecondary hover:border-gray-600"])},[X(b(I==="all"?"All":I.charAt(0).toUpperCase()+I.slice(1))+" ",1),o("span",ym,"("+b(v.value[I]??0)+")",1)],10,gm)),64))])):K("",!0)]),s.value&&t.value.length===0?(h(),g("div",bm,"Loading archived threads…")):n.value?(h(),g("div",_m,b(n.value),1)):t.value.length===0?(h(),g("div",wm,"No archived threads")):K("",!0),m.value.length>0?(h(),g("div",km,[(h(!0),g(se,null,ve(m.value,I=>{var U,y;return h(),g("div",{key:I.id,class:"glass rounded-xl p-4"},[o("div",Sm,[o("div",$m,[o("div",Cm,[o("span",{class:q(["inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium border",(U=f[I.type])==null?void 0:U.classes])},b((y=f[I.type])==null?void 0:y.emoji)+" "+b(I.type.toUpperCase()),3),o("span",Tm,b(I.name),1),o("span",Em,"ID: "+b(I.threadId),1)]),o("div",Pm,[o("span",Am,"Created "+b(N(I.createdAt)),1),o("span",Im,"Archived "+b(N(I.archivedAt??I.lastActiveAt)),1),I.client?(h(),g("span",Mm,b(I.client),1)):K("",!0)]),r.value[I.threadId]?(h(),g("div",Om,b(r.value[I.threadId]),1)):l.value[I.threadId]?(h(),g("div",Dm," Generating summary… ")):K("",!0)]),o("div",Rm,[o("button",{onClick:S=>C(I),disabled:u.value===I.threadId,class:"px-2 py-1 rounded-lg text-xs bg-green-500/20 text-green-400 border border-green-500/30 hover:bg-green-500/30 disabled:opacity-50 transition"},b(u.value===I.threadId?"Restoring…":"↩ Unarchive"),9,jm)])])])}),128))])):K("",!0)]))}}),Nm={key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-surface/95 backdrop-blur-sm"},Vm={class:"glass rounded-2xl p-8 max-w-md w-full mx-4 animate-slide-up"},Bm=["disabled"],Fm={key:0,class:"mt-3 text-sm text-danger"},Hm={key:1,class:"min-h-screen font-sans text-textPrimary animate-fade-in"},Km={class:"glass sticky top-0 z-40 border-b border-gray-800/50"},Wm={class:"max-w-7xl mx-auto px-4 sm:px-6 py-4 flex items-center justify-between"},zm={class:"flex items-center gap-4"},Jm={class:"text-sm text-textSecondary font-mono"},qm={class:"max-w-7xl mx-auto px-4 sm:px-6 py-6"},Gm={class:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 gap-3"},Ym={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Zm={class:"text-2xl font-bold font-mono"},Qm={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},Xm={class:"text-2xl font-bold font-mono"},ex={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},tx={class:"text-2xl font-bold font-mono"},sx={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},nx={class:"flex items-center gap-2 mb-2"},ox={class:"text-2xl font-bold font-mono"},rx={class:"glass rounded-xl p-4 stat-glow animate-slide-up"},lx={class:"text-2xl font-bold font-mono"},ax={class:"max-w-7xl mx-auto px-4 sm:px-6"},ix={class:"flex gap-6 border-b border-gray-800/50 mb-6"},cx=["onClick"],ux={class:"max-w-7xl mx-auto px-4 sm:px-6 pb-12"},vs="sensorium_token",dx=He({__name:"App",setup(e){const t=w(!1),s=w(""),n=w(""),r=w(!1),l=w(null),a=w("sessions");let u=null;const d=[{id:"sessions",label:"Sessions"},{id:"notes",label:"Memory Notes"},{id:"templates",label:"Templates"},{id:"skills",label:"Skills"},{id:"threads",label:"Threads"},{id:"archived",label:"Archived"},{id:"mcp",label:"MCP Servers"},{id:"snapshots",label:"Snapshots"},{id:"claude",label:"Claude"},{id:"copilot",label:"Copilot"},{id:"settings",label:"Settings"}],x={sessions:ri,notes:ki,templates:nc,skills:Rc,threads:Ed,archived:Um,mcp:vf,snapshots:um,claude:Nf,copilot:yp,settings:Vp},f=Ee(()=>x[a.value]),m=Ee(()=>{if(!l.value)return"—";const N=Math.floor(l.value.uptime),C=Math.floor(N/86400),E=Math.floor(N%86400/3600),R=Math.floor(N%3600/60);return C>0?`${C}d ${E}h`:E>0?`${E}h ${R}m`:`${R}m`});async function v(){const N=s.value.trim()||"no-auth";r.value=!0,n.value="";try{qt(N),await F(),localStorage.setItem(vs,N),t.value=!0,$()}catch(C){const E=C;E.status===401?n.value="Invalid token":n.value=E.message??"Connection failed",qt("")}finally{r.value=!1}}function k(){localStorage.removeItem(vs),t.value=!1,s.value="",l.value=null,u&&clearInterval(u),qt("")}async function F(){l.value=await he("/api/status")}function $(){u&&clearInterval(u),u=setInterval(F,3e4)}return Be(async()=>{const N=localStorage.getItem(vs);if(N){s.value=N;try{qt(N),await F(),t.value=!0,$()}catch{localStorage.removeItem(vs),qt("")}}}),kn(()=>{u&&clearInterval(u)}),(N,C)=>{var E,R,I,U,y,S,j,G,ae;return t.value?(h(),g("div",Hm,[o("header",Km,[o("div",Wm,[C[3]||(C[3]=ut('<div class="flex items-center gap-3"><div class="w-8 h-8 rounded-lg bg-gradient-to-br from-accent to-purple-500 flex items-center justify-center"><span class="text-white text-sm font-bold">S</span></div><div><h1 class="text-lg font-semibold tracking-tight">Sensorium MCP</h1><p class="text-xs text-textSecondary">Agent Dashboard</p></div></div>',1)),o("div",zm,[C[2]||(C[2]=o("div",{class:"flex items-center gap-2 text-sm"},[o("span",{class:"w-2 h-2 rounded-full bg-success animate-pulse-slow"}),o("span",{class:"text-textSecondary"},"Connected")],-1)),o("div",Jm,b(m.value),1),o("button",{onClick:k,class:"text-sm text-muted hover:text-textSecondary transition"},"Disconnect")])])]),o("div",qm,[o("div",Gm,[o("div",Ym,[C[4]||(C[4]=ut('<div class="flex items-center gap-2 mb-2"><span class="text-success"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Sessions</span></div>',1)),o("div",Zm,b(((E=l.value)==null?void 0:E.activeSessions)??0),1)]),o("div",Qm,[C[5]||(C[5]=ut('<div class="flex items-center gap-2 mb-2"><span class="text-accentLight"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Notes</span></div>',1)),o("div",Xm,b(((I=(R=l.value)==null?void 0:R.memory)==null?void 0:I.totalSemanticNotes)??0),1)]),o("div",ex,[C[6]||(C[6]=ut('<div class="flex items-center gap-2 mb-2"><span class="text-warn"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Episodes</span></div>',1)),o("div",tx,b(((y=(U=l.value)==null?void 0:U.memory)==null?void 0:y.totalEpisodes)??0),1)]),o("div",sx,[o("div",nx,[o("span",{class:q((((j=(S=l.value)==null?void 0:S.memory)==null?void 0:j.unconsolidatedEpisodes)??0)>10?"text-danger":"text-success")},[...C[7]||(C[7]=[o("svg",{class:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[o("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"})],-1)])],2),C[8]||(C[8]=o("span",{class:"text-xs text-textSecondary font-medium uppercase tracking-wider"},"Unconsolidated",-1))]),o("div",ox,b(((ae=(G=l.value)==null?void 0:G.memory)==null?void 0:ae.unconsolidatedEpisodes)??0),1)]),o("div",rx,[C[9]||(C[9]=ut('<div class="flex items-center gap-2 mb-2"><span class="text-success"><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14M12 5l7 7-7 7"></path></svg></span><span class="text-xs text-textSecondary font-medium uppercase tracking-wider">Uptime</span></div>',1)),o("div",lx,b(m.value),1)])])]),o("div",ax,[o("nav",ix,[(h(),g(se,null,ve(d,z=>o("button",{key:z.id,onClick:M=>a.value=z.id,class:q(["pb-3 text-sm font-medium transition",a.value===z.id?"tab-active":"tab-inactive"])},b(z.label),11,cx)),64))])]),o("div",ux,[(h(),fr(Pl(f.value),{status:l.value},null,8,["status"]))])])):(h(),g("div",Nm,[o("div",Vm,[C[1]||(C[1]=ut('<div class="flex items-center gap-3 mb-6"><div class="w-10 h-10 rounded-xl bg-accent/20 flex items-center justify-center"><svg class="w-5 h-5 text-accent" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"></path></svg></div><div><h2 class="text-lg font-semibold">Sensorium MCP</h2><p class="text-sm text-textSecondary">Enter your API token</p></div></div>',1)),Z(o("input",{"onUpdate:modelValue":C[0]||(C[0]=z=>s.value=z),type:"password",placeholder:"MCP_HTTP_SECRET",class:"w-full px-4 py-3 rounded-xl bg-surface border border-gray-700 text-textPrimary placeholder-muted focus:outline-none focus:border-accent focus:ring-1 focus:ring-accent transition font-mono text-sm",onKeydown:Xe(v,["enter"])},null,544),[[ne,s.value]]),o("button",{onClick:v,disabled:r.value,class:"w-full mt-4 px-4 py-3 rounded-xl bg-accent hover:bg-accentLight disabled:opacity-50 text-white font-medium transition"},b(r.value?"Connecting...":"Connect"),9,Bm),n.value?(h(),g("p",Fm,b(n.value),1)):K("",!0)])]))}}});Fa(dx).mount("#app");</script>
|
|
73
73
|
<style rel="stylesheet" crossorigin>body{background:#0f1419}::-webkit-scrollbar{width:6px}::-webkit-scrollbar-track{background:#1a1f2e}::-webkit-scrollbar-thumb{background:#374151;border-radius:3px}::-webkit-scrollbar-thumb:hover{background:#4b5563}.glass{background:#1a1f2ecc;-webkit-backdrop-filter:blur(12px);backdrop-filter:blur(12px);border:1px solid rgba(99,102,241,.1)}.stat-glow{box-shadow:0 0 20px #6366f114}.priority-2{border-left:3px solid #ef4444}.priority-1{border-left:3px solid #f59e0b}.priority-0{border-left:3px solid transparent}.type-badge{font-size:.65rem;padding:2px 6px;border-radius:9999px;font-weight:600;text-transform:uppercase;letter-spacing:.05em}.type-fact{background:#3b82f626;color:#60a5fa}.type-preference{background:#a855f726;color:#c084fc}.type-pattern{background:#22c55e26;color:#4ade80}.type-entity{background:#fbbf2426;color:#fbbf24}.type-relationship{background:#f472b626;color:#f472b6}.tab-active{border-bottom:2px solid #6366f1;color:#e5e7eb}.tab-inactive{border-bottom:2px solid transparent;color:#6b7280}.tab-inactive:hover{color:#9ca3af}</style>
|
|
74
74
|
</head>
|
|
75
75
|
<body class="font-sans text-textPrimary min-h-screen">
|