vestige/apps/dashboard/build/_app/immutable/nodes/0.CFcocLwc.js
Sam Valladares c433ae8b8d chore(release): v2.0.8 "Pulse"
Bundled release: Reasoning Theater wired to the 8-stage deep_reference
cognitive pipeline, Pulse InsightToast, Memory Birth Ritual (v2.3
Terrarium), 7 new dashboard surfaces (/duplicates, /dreams, /schedule,
/importance, /activation, /contradictions, /patterns), 3D graph
brightness system with auto distance-compensation + user slider, and
contradiction-detection + primary-selection hardening in the
cross_reference tool. Intel Mac (x86_64-apple-darwin) also flows through
to the release matrix from PR #43.

Added:
- POST /api/deep_reference — HTTP surface for the 8-stage pipeline
- DeepReferenceCompleted WebSocket event (primary + supporting +
  contradicting memory IDs for downstream graph animation)
- /reasoning route, full UI + Cmd+K Ask palette
- 7 new dashboard surfaces exposing the cognitive engine
- Graph brightness slider + localStorage persistence + distance-based
  emissive compensation so nodes don't disappear into fog at zoom-out

Fixed:
- Contradiction-detection false positives: adjacent-domain memories no
  longer flagged as conflicts (NEGATION_PAIRS wildcards removed,
  shared-words floor 2 → 4, topic-sim floor 0.15 → 0.55, STAGE 5
  overlap floor 0.15 → 0.4)
- Primary-memory selection: unified composite 0.5 × relevance + 0.2 ×
  trust + 0.3 × term_presence with hard topic-term filter, closing the
  class of bug where off-topic high-trust memories won queries about
  specific subjects
- Graph default-load fallback from sort=recent to sort=connected when
  the newest memory is isolated, both backend and client

Changed:
- Reasoning page information hierarchy: chain renders first as hero,
  confidence meter + Primary Source citation footer below
- Cargo feature split: embeddings code-only + ort-download | ort-dynamic
  backends; defaults preserve identical behavior for existing consumers
- CI release-build now gates PRs too so multi-platform regressions
  surface pre-merge
2026-04-23 02:09:21 -05:00

86 lines
26 KiB
JavaScript

import"../chunks/Bzak7iHL.js";import{o as tt}from"../chunks/CNjeV5xa.js";import{f as de,d as o,e as s,r as t,t as I,p as Oe,a as Pe,n as W,g as e,s as ce,c as ut,h as C,u as B}from"../chunks/CvjSAYrz.js";import{s as y,d as Ye,a as Q,e as Ee}from"../chunks/FzvEaXMa.js";import{i as V}from"../chunks/ciN1mm2W.js";import{e as _e,i as Fe}from"../chunks/DTnG8poT.js";import{c as mt,a as h,f as x}from"../chunks/BsvCUYx-.js";import{s as ft}from"../chunks/ckF4CxmX.js";import{s as te,r as ht}from"../chunks/CNfQDikv.js";import{s as R}from"../chunks/DPl3NjBv.js";import{b as gt}from"../chunks/CVpUe0w3.js";import{b as bt}from"../chunks/D3XWCg9-.js";import{a as j,s as ye}from"../chunks/D81f-o_I.js";import{s as xt,g as Qe}from"../chunks/S0ILvWpb.js";import{b as U}from"../chunks/DJWRm1Ki.js";import{s as at,m as st,e as kt,a as rt,w as Xe,u as _t,i as yt,f as wt}from"../chunks/CtkE7HV2.js";import{i as $t}from"../chunks/Bz1l2A_1.js";import{s as nt}from"../chunks/Bhad70Ss.js";import{t as ee}from"../chunks/Casl2yrL.js";import{a as Ze}from"../chunks/DNjM5a-l.js";import{d as Mt,w as it,g as ot}from"../chunks/DfQhL-hC.js";const Ct=()=>{const a=xt;return{page:{subscribe:a.page.subscribe},navigating:{subscribe:a.navigating.subscribe},updated:a.updated}},At={subscribe(a){return Ct().page.subscribe(a)}};var Dt=x('<div class="flex items-center gap-2 rounded-full border border-[#A33FFF]/40 bg-[#A33FFF]/10 px-3 py-1.5 text-xs shadow-[0_0_12px_rgba(163,63,255,0.15)]" title="Memories currently under top-down suppression (Anderson 2025 SIF)"><div class="relative flex h-2 w-2 items-center justify-center"><span class="absolute inline-flex h-full w-full animate-ping rounded-full bg-[#A33FFF] opacity-75"></span> <span class="relative inline-flex h-2 w-2 rounded-full bg-[#A33FFF]"></span></div> <span class="font-medium text-[#E4C8FF]"> </span></div>');function Tt(a){const r=()=>j(at,"$suppressedCount",l),[l,u]=ye();var g=mt(),$=de(g);{var w=A=>{var _=Dt(),b=o(s(_),2),m=s(b);t(b),t(_),I(()=>y(m,`Actively forgetting ${r()??""} ${r()===1?"memory":"memories"}`)),h(A,_)};V($,A=>{r()>0&&A(w)})}h(a,g),u()}var Et=x('<button type="button" class="toast-item svelte-pry2ep"><div class="toast-accent svelte-pry2ep" aria-hidden="true"></div> <div class="toast-body svelte-pry2ep"><div class="toast-head svelte-pry2ep"><span class="toast-icon svelte-pry2ep" aria-hidden="true"> </span> <span class="toast-title svelte-pry2ep"> </span></div> <div class="toast-sub svelte-pry2ep"> </div></div> <div class="toast-progress svelte-pry2ep" aria-hidden="true"><div class="toast-progress-fill svelte-pry2ep"></div></div></button>'),Ft=x('<div class="toast-layer svelte-pry2ep" aria-live="polite" aria-atomic="false"></div>');function St(a,r){Oe(r,!1);const l=()=>j(ee,"$toasts",u),[u,g]=ye(),$={DreamCompleted:"✦",ConsolidationCompleted:"◉",ConnectionDiscovered:"⟷",MemoryPromoted:"↑",MemoryDemoted:"↓",MemorySuppressed:"◬",MemoryUnsuppressed:"◉",Rac1CascadeSwept:"✺",MemoryDeleted:"✕"};function w(m){return $[m]??"◆"}function A(m){ee.dismiss(m.id)}function _(m,d){(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),ee.dismiss(d.id))}$t();var b=Ft();_e(b,5,l,m=>m.id,(m,d)=>{var k=Et(),D=o(s(k),2),S=s(D),G=s(S),L=s(G,!0);t(G);var N=o(G,2),Z=s(N,!0);t(N),t(S);var H=o(S,2),q=s(H,!0);t(H),t(D),W(2),t(k),I(z=>{te(k,"aria-label",`${e(d).title??""}: ${e(d).body??""}. Click to dismiss.`),nt(k,`--toast-color: ${e(d).color??""}; --toast-dwell: ${e(d).dwellMs??""}ms;`),y(L,z),y(Z,e(d).title),y(q,e(d).body)},[()=>w(e(d).type)]),Q("click",k,()=>A(e(d))),Q("keydown",k,z=>_(z,e(d))),Ee("mouseenter",k,()=>ee.pauseDwell(e(d).id,e(d).dwellMs)),Ee("mouseleave",k,()=>ee.resumeDwell(e(d).id)),Ee("focus",k,()=>ee.pauseDwell(e(d).id,e(d).dwellMs)),Ee("blur",k,()=>ee.resumeDwell(e(d).id)),h(m,k)}),t(b),h(a,b),Pe(),g()}Ye(["click","keydown"]);function ve(a){const r=a.data;if(!r||typeof r!="object")return null;const l=r.timestamp??r.at??r.occurred_at;if(l==null)return null;if(typeof l=="number")return Number.isFinite(l)?l>1e12?l:l*1e3:null;if(typeof l!="string")return null;const u=Date.parse(l);return Number.isFinite(u)?u:null}const qe=10,lt=3e4,It=qe*lt;function Lt(a,r){const l=r-It,u=new Array(qe).fill(0);for(const $ of a){if($.type==="Heartbeat")continue;const w=ve($);if(w===null||w<l||w>r)continue;const A=Math.min(qe-1,Math.floor((w-l)/lt));u[A]+=1}const g=Math.max(1,...u);return u.map($=>({count:$,ratio:$/g}))}function Nt(a,r){const l=r-864e5;for(const u of a){if(u.type!=="DreamCompleted")continue;return(ve(u)??r)>=l?u:null}return null}function Rt(a){if(!a||!a.data)return null;const r=a.data,l=typeof r.insights_generated=="number"?r.insights_generated:typeof r.insightsGenerated=="number"?r.insightsGenerated:null;return l!==null&&Number.isFinite(l)?l:null}function jt(a,r){let l=null,u=null;for(const A of a)if(!l&&A.type==="DreamStarted"&&(l=A),!u&&A.type==="DreamCompleted"&&(u=A),l&&u)break;if(!l)return!1;const g=ve(l)??r,$=r-300*1e3;return g<$?!1:u?(ve(u)??r)<g:!0}function Kt(a){const r=Math.max(0,a),l=Math.floor(r/1e3);if(l<60)return`${l}s ago`;const u=Math.floor(l/60);if(u<60)return`${u}m ago`;const g=Math.floor(u/60);return g<24?`${g}h ago`:`${Math.floor(g/24)}d ago`}function Vt(a,r,l=1e4){const u=r-l;for(const g of a){if(g.type!=="MemorySuppressed")continue;return(ve(g)??r)>=u}return!1}var Bt=x('<span class="font-semibold tabular-nums text-decay svelte-1kk3799"> </span> <span class="text-muted svelte-1kk3799">at risk</span>',1),Gt=x('<span class="text-muted tabular-nums svelte-1kk3799">0</span> <span class="text-muted svelte-1kk3799">at risk</span>',1),Ht=x('<span class="text-muted/60 svelte-1kk3799">—</span> <span class="text-muted svelte-1kk3799">at risk</span>',1),qt=x('<span></span> <span> </span> <span class="text-muted svelte-1kk3799">intentions</span>',1),zt=x('<span class="text-muted/60 svelte-1kk3799">— intentions</span>'),Ot=x('<span class="text-muted/60 svelte-1kk3799">·</span> <span class="text-text/80 tabular-nums svelte-1kk3799"> </span> <span class="text-muted svelte-1kk3799">insights</span>',1),Pt=x('<span class="text-dream/80 svelte-1kk3799">✦</span> <span class="text-muted svelte-1kk3799">Last dream:</span> <span class="text-text/80 svelte-1kk3799"> </span> <!>',1),Yt=x('<span class="text-muted svelte-1kk3799">No recent dream</span>'),Wt=x('<div class="w-[3px] rounded-sm bg-synapse/70 svelte-1kk3799"></div>'),Qt=x('<div class="strip-divider svelte-1kk3799" aria-hidden="true"></div> <div class="strip-item svelte-1kk3799" title="A Dream cycle is currently in progress"><span class="relative inline-flex h-2 w-2 items-center justify-center svelte-1kk3799"><span class="absolute inline-flex h-full w-full animate-ping rounded-full bg-dream opacity-75 svelte-1kk3799"></span> <span class="relative inline-flex h-2 w-2 rounded-full bg-dream svelte-1kk3799"></span></span> <span class="font-semibold tracking-wider text-dream-glow svelte-1kk3799">DREAMING...</span></div>',1),Xt=x('<div class="strip-item hidden md:inline-flex svelte-1kk3799" title="A memory was just suppressed (Sanhedrin veto)"><span class="inline-flex h-2 w-2 animate-pulse rounded-full bg-decay shadow-[0_0_10px_rgba(239,68,68,0.7)] svelte-1kk3799"></span> <span class="font-medium text-decay svelte-1kk3799">Veto triggered</span></div>'),Zt=x('<div aria-label="Ambient cognitive vitals"><div class="strip-item svelte-1kk3799" title="Total memories and average retention strength"><span class="relative inline-flex h-2 w-2 items-center justify-center svelte-1kk3799"><span></span> <span></span></span> <span class="text-text/80 tabular-nums svelte-1kk3799"> </span> <span class="text-muted svelte-1kk3799">memories</span> <span class="text-muted/60 svelte-1kk3799">·</span> <span> </span> <span class="text-muted svelte-1kk3799">avg retention</span></div> <div class="strip-divider svelte-1kk3799" aria-hidden="true"></div> <div class="strip-item svelte-1kk3799" title="Memories with retention below 30%"><!></div> <div class="strip-divider hidden md:block svelte-1kk3799" aria-hidden="true"></div> <div class="strip-item hidden md:inline-flex svelte-1kk3799" title="Active intentions (prospective memory)"><!></div> <div class="strip-divider hidden md:block svelte-1kk3799" aria-hidden="true"></div> <div class="strip-item hidden md:inline-flex svelte-1kk3799" title="Most recent Dream cycle completion"><!></div> <div class="strip-divider hidden md:block svelte-1kk3799" aria-hidden="true"></div> <div class="strip-item hidden md:inline-flex svelte-1kk3799" title="Event throughput over the last 5 minutes (events per 30s)"><span class="text-muted svelte-1kk3799">activity</span> <div class="flex h-4 items-end gap-[2px] svelte-1kk3799" aria-hidden="true"></div></div> <!> <div class="flex-1 svelte-1kk3799"></div> <!></div>');function Jt(a,r){Oe(r,!0);const l=()=>j(rt,"$avgRetention",$),u=()=>j(kt,"$eventFeed",$),g=()=>j(st,"$memoryCount",$),[$,w]=ye(),A=B(()=>Math.round((l()??0)*100)),_=B(()=>(l()??0)>=.5);let b=ce(null);async function m(){try{const n=await Ze.retentionDistribution();if(Array.isArray(n.endangered)&&n.endangered.length>0){C(b,n.endangered.length,!0);return}const v=n.distribution??[];let M=0;for(const i of v){const c=/^(\d+)/.exec(i.range);if(!c)continue;const p=Number.parseInt(c[1],10);Number.isFinite(p)&&p<30&&(M+=i.count??0)}C(b,M,!0)}catch{C(b,null)}}let d=ce(null);async function k(){var n;try{const v=await Ze.intentions("active");C(d,v.total??((n=v.intentions)==null?void 0:n.length)??0,!0)}catch{C(d,null)}}let D=ce(ut(Date.now()));const S=B(()=>{const n=u(),v=Nt(n,e(D)),M=v?ve(v)??e(D):null,i=M!==null?e(D)-M:null;return{isDreaming:jt(n,e(D)),recent:v,recentMsAgo:i,insights:Rt(v)}}),G=B(()=>Lt(u(),e(D))),L=B(()=>Vt(u(),e(D)));tt(()=>{m(),k();const n=setInterval(()=>{C(D,Date.now(),!0)},1e3),v=setInterval(()=>{m(),k()},6e4);return()=>{clearInterval(n),clearInterval(v)}});var N=Zt();let Z;var H=s(N),q=s(H),z=s(q);let ae;var ue=o(z,2);let we;t(q);var se=o(q,2),me=s(se,!0);t(se);var re=o(se,6);let ne;var Se=s(re);t(re),W(2),t(H);var ie=o(H,4),Ie=s(ie);{var fe=n=>{var v=Bt(),M=de(v),i=s(M,!0);t(M),W(2),I(()=>y(i,e(b))),h(n,v)},he=n=>{var v=Gt();W(2),h(n,v)},Le=n=>{var v=Ht();W(2),h(n,v)};V(Ie,n=>{e(b)!==null&&e(b)>0?n(fe):e(b)===0?n(he,1):n(Le,!1)})}t(ie);var J=o(ie,4),Ne=s(J);{var Re=n=>{var v=qt(),M=de(v);let i;var c=o(M,2);let p;var f=s(c,!0);t(c),W(2),I(()=>{i=R(M,1,"inline-flex h-2 w-2 rounded-full svelte-1kk3799",null,i,{"bg-node-pattern":e(d)>5,"animate-ping-slow":e(d)>5,"bg-muted":e(d)<=5}),p=R(c,1,"tabular-nums svelte-1kk3799",null,p,{"text-node-pattern":e(d)>5,"text-text":e(d)>0&&e(d)<=5,"text-muted":e(d)===0}),y(f,e(d))}),h(n,v)},je=n=>{var v=zt();h(n,v)};V(Ne,n=>{e(d)!==null?n(Re):n(je,!1)})}t(J);var ge=o(J,4),Ke=s(ge);{var be=n=>{var v=Pt(),M=o(de(v),4),i=s(M,!0);t(M);var c=o(M,2);{var p=f=>{var T=Ot(),F=o(de(T),2),K=s(F,!0);t(F),W(2),I(()=>y(K,e(S).insights)),h(f,T)};V(c,f=>{e(S).insights!==null&&f(p)})}I(f=>y(i,f),[()=>Kt(e(S).recentMsAgo)]),h(n,v)},$e=n=>{var v=Yt();h(n,v)};V(Ke,n=>{e(S).recent&&e(S).recentMsAgo!==null?n(be):n($e,!1)})}t(ge);var oe=o(ge,4),Me=o(s(oe),2);_e(Me,21,()=>e(G),Fe,(n,v)=>{var M=Wt();I(i=>nt(M,`height: ${i??""}%; opacity: ${e(v).count===0?.18:.5+e(v).ratio*.5};`),[()=>Math.max(10,e(v).ratio*100)]),h(n,M)}),t(Me),t(oe);var xe=o(oe,2);{var Ce=n=>{var v=Qt();W(2),h(n,v)};V(xe,n=>{e(S).isDreaming&&n(Ce)})}var Ae=o(xe,4);{var Ve=n=>{var v=Xt();h(n,v)};V(Ae,n=>{e(L)&&n(Ve)})}t(N),I(()=>{Z=R(N,1,"ambient-strip relative flex h-9 w-full items-center gap-0 overflow-hidden border-b border-synapse/15 bg-black/40 px-3 text-[11px] text-dim backdrop-blur-md svelte-1kk3799",null,Z,{"ambient-flash":e(L)}),ae=R(z,1,"absolute inline-flex h-full w-full animate-ping rounded-full opacity-75 svelte-1kk3799",null,ae,{"bg-recall":e(_),"bg-warning":!e(_)}),we=R(ue,1,"relative inline-flex h-2 w-2 rounded-full svelte-1kk3799",null,we,{"bg-recall":e(_),"bg-warning":!e(_)}),y(me,g()),ne=R(re,1,"svelte-1kk3799",null,ne,{"text-recall":e(_),"text-warning":!e(_)}),y(Se,`${e(A)??""}%`)}),h(a,N),Pe(),w()}const dt="vestige.theme",Je="vestige-theme-light",pe=it("dark"),ze=it(!0),Ue=Mt([pe,ze],([a,r])=>a==="auto"?r?"dark":"light":a);function Ut(a){return a==="dark"||a==="light"||a==="auto"}function ea(a){if(Ut(a)){pe.set(a);try{localStorage.setItem(dt,a)}catch{}}}function He(){const a=ot(pe);ea(a==="dark"?"light":a==="light"?"auto":"dark")}function ta(){if(document.getElementById(Je))return;const a=document.createElement("style");a.id=Je,a.textContent=`
/* Vestige light-mode overrides — injected by theme.ts.
* Activated by [data-theme='light'] on <html>.
* Tokens mirror the real names used in app.css so the cascade stays clean. */
[data-theme='light'] {
/* Core surface palette (slate scale) */
--color-void: #f8fafc; /* slate-50 — page background */
--color-abyss: #f1f5f9; /* slate-100 */
--color-deep: #e2e8f0; /* slate-200 */
--color-surface: #f1f5f9; /* slate-100 */
--color-elevated: #e2e8f0; /* slate-200 */
--color-subtle: #cbd5e1; /* slate-300 */
--color-muted: #94a3b8; /* slate-400 */
--color-dim: #475569; /* slate-600 */
--color-text: #0f172a; /* slate-900 */
--color-bright: #020617; /* slate-950 */
}
/* Baseline body/html wiring — app.css sets these against the dark
* tokens; we just let the variables do the work. Reassert for clarity. */
[data-theme='light'] html,
html[data-theme='light'] {
background: var(--color-void);
color: var(--color-text);
}
/* Glass surfaces — recompose on a light canvas. The original alphas
* are tuned for dark; invert-and-tint for light so panels still read
* as elevated instead of vanishing. */
[data-theme='light'] .glass {
background: rgba(255, 255, 255, 0.65);
border: 1px solid rgba(99, 102, 241, 0.12);
box-shadow:
inset 0 1px 0 0 rgba(255, 255, 255, 0.6),
0 4px 24px rgba(15, 23, 42, 0.08);
}
[data-theme='light'] .glass-subtle {
background: rgba(255, 255, 255, 0.55);
border: 1px solid rgba(99, 102, 241, 0.1);
box-shadow:
inset 0 1px 0 0 rgba(255, 255, 255, 0.5),
0 2px 12px rgba(15, 23, 42, 0.06);
}
[data-theme='light'] .glass-sidebar {
background: rgba(248, 250, 252, 0.82);
border-right: 1px solid rgba(99, 102, 241, 0.14);
box-shadow:
inset -1px 0 0 0 rgba(255, 255, 255, 0.4),
4px 0 24px rgba(15, 23, 42, 0.08);
}
[data-theme='light'] .glass-panel {
background: rgba(255, 255, 255, 0.75);
border: 1px solid rgba(99, 102, 241, 0.14);
box-shadow:
inset 0 1px 0 0 rgba(255, 255, 255, 0.5),
0 8px 32px rgba(15, 23, 42, 0.1);
}
/* Halve glow intensity — neon accents stay recognizable without
* washing out on slate-50. */
[data-theme='light'] .glow-synapse {
box-shadow: 0 0 10px rgba(99, 102, 241, 0.15), 0 0 30px rgba(99, 102, 241, 0.05);
}
[data-theme='light'] .glow-dream {
box-shadow: 0 0 10px rgba(168, 85, 247, 0.15), 0 0 30px rgba(168, 85, 247, 0.05);
}
[data-theme='light'] .glow-memory {
box-shadow: 0 0 10px rgba(59, 130, 246, 0.15), 0 0 30px rgba(59, 130, 246, 0.05);
}
/* Ambient orbs are gorgeous on black and blinding on white. Tame them. */
[data-theme='light'] .ambient-orb {
opacity: 0.18;
filter: blur(100px);
}
/* Scrollbar recolor for the lighter surface. */
[data-theme='light'] ::-webkit-scrollbar-thumb {
background: #cbd5e1;
}
[data-theme='light'] ::-webkit-scrollbar-thumb:hover {
background: #94a3b8;
}
`,document.head.appendChild(a)}function et(a){document.documentElement.dataset.theme=a}let O=null,X=null,P=null,Y=null;function aa(){O&&X&&O.removeEventListener("change",X),Y==null||Y(),P==null||P(),O=null,X=null,Y=null,P=null,ta();let a="dark";try{const r=localStorage.getItem(dt);(r==="dark"||r==="light"||r==="auto")&&(a=r)}catch{}return pe.set(a),O=window.matchMedia("(prefers-color-scheme: dark)"),ze.set(O.matches),X=r=>ze.set(r.matches),O.addEventListener("change",X),et(ot(Ue)),Y=Ue.subscribe(et),P=pe.subscribe(()=>{}),()=>{O&&X&&O.removeEventListener("change",X),O=null,X=null,Y==null||Y(),P==null||P(),Y=null,P=null}}var sa=x('<button type="button" class="theme-toggle svelte-1cmi4dh"><span class="icon-wrap svelte-1cmi4dh"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="4"></circle><path d="M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"></path></svg> <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="8"></circle><path d="M12 4 A8 8 0 0 0 12 20 Z" fill="currentColor" stroke="none"></path><path d="M12 2v1.5M12 20.5V22M3.5 12H2M22 12h-1.5"></path></svg></span></button>');function ra(a){const r=()=>j(pe,"$theme",l),[l,u]=ye(),g={dark:"Dark",light:"Light",auto:"Auto (system)"},$={dark:"light",light:"auto",auto:"dark"};let w=B(r),A=B(()=>$[e(w)]),_=B(()=>`Toggle theme: ${g[e(w)]} (click for ${g[e(A)]})`);var b=sa(),m=s(b),d=s(m);let k;var D=o(d,2);let S;var G=o(D,2);let L;t(m),t(b),I(()=>{te(b,"aria-label",e(_)),te(b,"title",e(_)),te(b,"data-mode",e(w)),k=R(d,0,"icon svelte-1cmi4dh",null,k,{active:e(w)==="dark"}),S=R(D,0,"icon svelte-1cmi4dh",null,S,{active:e(w)==="light"}),L=R(G,0,"icon svelte-1cmi4dh",null,L,{active:e(w)==="auto"})}),Q("click",b,function(...N){He==null||He.apply(this,N)}),h(a,b),u()}Ye(["click"]);var na=x('<a><span class="text-base w-5 text-center"> </span> <span class="hidden lg:block"> </span> <span class="hidden lg:block ml-auto text-[10px] text-muted/50 font-mono"> </span></a>'),ia=x('<div title="MCP server uptime"> </div>'),oa=x('<div class="hidden lg:block pt-1"><!></div>'),la=x('<a><span class="text-lg"> </span> <span class="text-[9px]"> </span></a>'),da=x('<button class="w-full flex items-center gap-3 px-4 py-2.5 text-sm text-dim hover:text-text hover:bg-white/[0.04] transition"><span class="text-base w-5 text-center"> </span> <span> </span> <span class="ml-auto text-[10px] text-muted/50 font-mono hidden md:block"> </span></button>'),ca=x('<div class="px-4 py-6 text-center text-sm text-muted">No matches</div>'),va=x('<div class="fixed inset-0 z-50 flex items-start justify-center pt-[10vh] md:pt-[15vh] px-4 bg-void/60 backdrop-blur-sm"><div class="w-full max-w-lg glass-panel rounded-xl shadow-2xl shadow-synapse/10 overflow-hidden"><div class="flex items-center gap-3 px-4 py-3 border-b border-synapse/10"><span class="text-synapse text-sm">◎</span> <input type="text" placeholder="Navigate to..." class="flex-1 bg-transparent text-text text-sm placeholder:text-muted focus:outline-none"/> <span class="text-[10px] text-muted font-mono bg-white/[0.04] px-1.5 py-0.5 rounded">esc</span></div> <div class="max-h-72 overflow-y-auto py-1"><!> <!></div></div></div>'),pa=x('<div class="ambient-orb ambient-orb-1" aria-hidden="true"></div> <div class="ambient-orb ambient-orb-2" aria-hidden="true"></div> <div class="ambient-orb ambient-orb-3" aria-hidden="true"></div> <div class="flex flex-col md:flex-row h-screen overflow-hidden bg-void relative z-[1]"><nav class="hidden md:flex w-16 lg:w-56 flex-shrink-0 glass-sidebar flex-col"><a class="flex items-center gap-3 px-4 py-5 border-b border-synapse/10"><div class="w-8 h-8 rounded-lg bg-gradient-to-br from-dream to-synapse flex items-center justify-center text-bright text-sm font-bold shadow-lg shadow-synapse/20">V</div> <span class="hidden lg:block text-sm font-semibold text-bright tracking-wide">VESTIGE</span></a> <div class="flex-1 min-h-0 overflow-y-auto py-3 flex flex-col gap-1 px-2"></div> <div class="px-2 pb-2"><button class="w-full flex items-center gap-2 px-3 py-2 rounded-lg text-xs text-muted hover:text-dim hover:bg-white/[0.03] transition border border-subtle/15"><span class="text-[10px] font-mono bg-white/[0.04] px-1.5 py-0.5 rounded">⌘K</span> <span class="hidden lg:block">Command</span></button></div> <div class="px-3 py-4 border-t border-synapse/10 space-y-2"><div class="flex items-center gap-2 text-xs"><div></div> <span class="hidden lg:block text-dim"> </span> <div class="ml-auto"><!></div></div> <div class="hidden lg:block text-xs text-muted space-y-0.5"><div> </div> <div> </div> <!></div> <!></div></nav> <main class="flex-1 flex flex-col min-h-0 pb-16 md:pb-0"><!> <div class="animate-page-in flex-1 min-h-0 overflow-y-auto svelte-12qhfyh"><!></div></main> <nav class="md:hidden fixed bottom-0 inset-x-0 glass border-t border-synapse/10 z-40 safe-bottom svelte-12qhfyh"><div class="flex items-center justify-around px-2 py-1"><!> <button class="flex flex-col items-center gap-0.5 px-3 py-2 rounded-lg text-muted min-w-[3.5rem]"><span class="text-lg">⋯</span> <span class="text-[9px]">More</span></button></div></nav></div> <!> <!>',1);function La(a,r){Oe(r,!0);const l=()=>j(At,"$page",_),u=()=>j(yt,"$isConnected",_),g=()=>j(st,"$memoryCount",_),$=()=>j(rt,"$avgRetention",_),w=()=>j(_t,"$uptimeSeconds",_),A=()=>j(at,"$suppressedCount",_),[_,b]=ye();let m=ce(!1),d=ce(""),k=ce(void 0);tt(()=>{Xe.connect();const i=aa();function c(p){if((p.metaKey||p.ctrlKey)&&p.key==="k"){p.preventDefault(),C(m,!e(m)),C(d,""),e(m)&&requestAnimationFrame(()=>{var F;return(F=e(k))==null?void 0:F.focus()});return}if(p.key==="Escape"&&e(m)){C(m,!1);return}if(p.target instanceof HTMLInputElement||p.target instanceof HTMLTextAreaElement)return;if(p.key==="/"){p.preventDefault();const F=document.querySelector('input[type="text"]');F==null||F.focus();return}const T={g:"/graph",m:"/memories",t:"/timeline",f:"/feed",e:"/explore",i:"/intentions",s:"/stats",r:"/reasoning",a:"/activation",d:"/dreams",c:"/schedule",p:"/importance",u:"/duplicates",x:"/contradictions",n:"/patterns"}[p.key.toLowerCase()];T&&!p.metaKey&&!p.ctrlKey&&!p.altKey&&(p.preventDefault(),Qe(`${U}${T}`))}return window.addEventListener("keydown",c),()=>{Xe.disconnect(),window.removeEventListener("keydown",c),i()}});const D=[{href:"/graph",label:"Graph",icon:"◎",shortcut:"G"},{href:"/reasoning",label:"Reasoning",icon:"✦",shortcut:"R"},{href:"/memories",label:"Memories",icon:"◈",shortcut:"M"},{href:"/timeline",label:"Timeline",icon:"◷",shortcut:"T"},{href:"/feed",label:"Feed",icon:"◉",shortcut:"F"},{href:"/explore",label:"Explore",icon:"◬",shortcut:"E"},{href:"/activation",label:"Activation",icon:"◈",shortcut:"A"},{href:"/dreams",label:"Dreams",icon:"✧",shortcut:"D"},{href:"/schedule",label:"Schedule",icon:"◷",shortcut:"C"},{href:"/importance",label:"Importance",icon:"◎",shortcut:"P"},{href:"/duplicates",label:"Duplicates",icon:"◉",shortcut:"U"},{href:"/contradictions",label:"Contradictions",icon:"⚠",shortcut:"X"},{href:"/patterns",label:"Patterns",icon:"▦",shortcut:"N"},{href:"/intentions",label:"Intentions",icon:"◇",shortcut:"I"},{href:"/stats",label:"Stats",icon:"◫",shortcut:"S"},{href:"/settings",label:"Settings",icon:"⚙",shortcut:","}],S=D.slice(0,5);function G(i,c){const p=c.startsWith(U)?c.slice(U.length)||"/":c;return i==="/graph"?p==="/"||p==="/graph":p.startsWith(i)}let L=B(()=>e(d)?D.filter(i=>i.label.toLowerCase().includes(e(d).toLowerCase())):D);function N(i){C(m,!1),C(d,""),Qe(`${U}${i}`)}var Z=pa(),H=o(de(Z),6),q=s(H),z=s(q),ae=o(z,2);_e(ae,21,()=>D,Fe,(i,c)=>{const p=B(()=>G(e(c).href,l().url.pathname));var f=na(),T=s(f),F=s(T,!0);t(T);var K=o(T,2),ke=s(K,!0);t(K);var De=o(K,2),E=s(De,!0);t(De),t(f),I(()=>{te(f,"href",`${U??""}${e(c).href??""}`),R(f,1,`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-all duration-200 text-sm
${e(p)?"bg-synapse/15 text-synapse-glow border border-synapse/30 shadow-[0_0_12px_rgba(99,102,241,0.15)] nav-active-border":"text-dim hover:text-text hover:bg-white/[0.03] border border-transparent"}`),y(F,e(c).icon),y(ke,e(c).label),y(E,e(c).shortcut)}),h(i,f)}),t(ae);var ue=o(ae,2),we=s(ue);t(ue);var se=o(ue,2),me=s(se),re=s(me),ne=o(re,2),Se=s(ne,!0);t(ne);var ie=o(ne,2),Ie=s(ie);ra(Ie),t(ie),t(me);var fe=o(me,2),he=s(fe),Le=s(he);t(he);var J=o(he,2),Ne=s(J);t(J);var Re=o(J,2);{var je=i=>{var c=ia(),p=s(c);t(c),I(f=>y(p,`up ${f??""}`),[()=>wt(w())]),h(i,c)};V(Re,i=>{w()>0&&i(je)})}t(fe);var ge=o(fe,2);{var Ke=i=>{var c=oa(),p=s(c);Tt(p),t(c),h(i,c)};V(ge,i=>{A()>0&&i(Ke)})}t(se),t(q);var be=o(q,2),$e=s(be);Jt($e,{});var oe=o($e,2),Me=s(oe);ft(Me,()=>r.children),t(oe),t(be);var xe=o(be,2),Ce=s(xe),Ae=s(Ce);_e(Ae,17,()=>S,Fe,(i,c)=>{const p=B(()=>G(e(c).href,l().url.pathname));var f=la(),T=s(f),F=s(T,!0);t(T);var K=o(T,2),ke=s(K,!0);t(K),t(f),I(()=>{te(f,"href",`${U??""}${e(c).href??""}`),R(f,1,`flex flex-col items-center gap-0.5 px-3 py-2 rounded-lg transition-all min-w-[3.5rem]
${e(p)?"text-synapse-glow":"text-muted"}`),y(F,e(c).icon),y(ke,e(c).label)}),h(i,f)});var Ve=o(Ae,2);t(Ce),t(xe),t(H);var n=o(H,2);St(n,{});var v=o(n,2);{var M=i=>{var c=va(),p=s(c),f=s(p),T=o(s(f),2);ht(T),bt(T,E=>C(k,E),()=>e(k)),W(2),t(f);var F=o(f,2),K=s(F);_e(K,17,()=>e(L),Fe,(E,le)=>{var Te=da(),Be=s(Te),ct=s(Be,!0);t(Be);var Ge=o(Be,2),vt=s(Ge,!0);t(Ge);var We=o(Ge,2),pt=s(We,!0);t(We),t(Te),I(()=>{y(ct,e(le).icon),y(vt,e(le).label),y(pt,e(le).shortcut)}),Q("click",Te,()=>N(e(le).href)),h(E,Te)});var ke=o(K,2);{var De=E=>{var le=ca();h(E,le)};V(ke,E=>{e(L).length===0&&E(De)})}t(F),t(p),t(c),Q("keydown",c,E=>{E.key==="Escape"&&C(m,!1)}),Q("click",c,E=>{E.target===E.currentTarget&&C(m,!1)}),Q("keydown",T,E=>{E.key==="Enter"&&e(L).length>0&&N(e(L)[0].href)}),gt(T,()=>e(d),E=>C(d,E)),h(i,c)};V(v,i=>{e(m)&&i(M)})}I(i=>{te(z,"href",`${U??""}/graph`),R(re,1,`w-2 h-2 rounded-full ${u()?"bg-recall animate-pulse-glow":"bg-decay"}`),y(Se,u()?"Connected":"Offline"),y(Le,`${g()??""} memories`),y(Ne,`${i??""}% retention`)},[()=>($()*100).toFixed(0)]),Q("click",we,()=>{C(m,!0),C(d,""),requestAnimationFrame(()=>{var i;return(i=e(k))==null?void 0:i.focus()})}),Q("click",Ve,()=>{C(m,!0),C(d,""),requestAnimationFrame(()=>{var i;return(i=e(k))==null?void 0:i.focus()})}),h(a,Z),Pe(),b()}Ye(["click","keydown"]);export{La as component};