geneseed 4.23.0 → 4.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-gYZLE4r3.js","assets/rolldown-runtime-hePW80VL.js","assets/react-DlYQp10C.js","assets/api-BfpZmUMI.js","assets/motion-CXaUMNkg.js","assets/sections-ChwaobfW.js","assets/Activity-D0GfEonq.js","assets/EmptyState-1sPNleqv.js","assets/usePoll-bDFN-Hr6.js","assets/ActivityDetail-Bf5sBm8_.js","assets/Library-CWjWbVwS.js","assets/RailCats-BtIstKaH.js","assets/FilterInput-CZREvrjX.js","assets/Markdown-DpmmtW2Y.js","assets/Kits-BpUFbYHr.js","assets/KitApply-DCBS0ZWz.js","assets/DataTable-BWbUx4bY.js","assets/Loops-BRuz2YFL.js","assets/Laws-Qnzc5Lp7.js","assets/Personal-d5Ssk-SW.js","assets/Tabs-DQLuylEi.js","assets/Installs-DBH3NEOC.js","assets/Docs-CQifoJkX.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n,r,t as i}from"./react-DlYQp10C.js";import{t as a}from"./api-BfpZmUMI.js";import{A as o,C as s,D as c,E as l,F as u,G as d,H as f,I as p,L as m,O as h,P as g,T as _,U as v,_ as y,b,d as x,f as S,i as C,j as w,l as T,n as E,o as D,r as O,s as k,t as A,u as ee,v as j,z as te}from"./motion-CXaUMNkg.js";import{i as M,n as N,r as P}from"./sections-ChwaobfW.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var ne=(e,t)=>{if(m(t,`<`)){let n=t[1]===`<`,r=e._tail,i=r?r._offset+r._delay:0;return n?i:i+r.duration}},re=(e,t)=>{let n=e.iterationDuration;if(n===1e-11&&(n=0),w(t))return n;if(h(+t))return+t;let r=t,i=e?e.labels:null,a=!c(i),o=ne(e,r),s=!w(o),l=v.exec(r);if(l){let e=l[0],t=r.split(e),c=a&&t[0]?i[t[0]]:n,u=s?o:a?c:n,d=+t[1];return j(u,d,e[0])}return s?o:a?w(i[r])?n:i[r]:n},F=(e=0,t=1,n=0)=>{let r=10**n;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},ie=0,I=(e,t=0,n=1,r=0)=>{let i=e===void 0?ie++:e;return(e=t,a=n,o=r)=>{i+=1831565813,i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61);let s=10**o;return Math.floor((((i^i>>>14)>>>0)/4294967296*(a-e+1/s)+e)*s)/s}},L=(e,t=F)=>{let n=e.length,r,i;for(;n;)i=t(0,--n),r=e[n],e[n]=e[i],e[i]=r;return e},ae=(e,t={})=>{let n=[],r=0,i,a=null,c=t.from,f=t.reversed,m=t.ease,v=!w(m),x=v&&!w(m.ease)?m.ease:v?ee(m):null,C=t.grid,T=C===!0,E=t.axis,D=t.total,O=w(c)||c===0||c===`first`,k=c===`center`,A=c===`last`,j=c===`random`,te=_(c),M=_(e),N=t.use,P=g(M?e[0]:e),ne=M?g(e[1]):0,ie=d.exec((M?e[1]:e)+``),ae=t.start||0+(M?P:0),R=t.seed,oe=!w(R)&&R!==!1?I(R===!0?0:R):F,z=t.jitter,se=!w(z),ce=_(z),B=ce?z[0]:z||0,le=ce?z[1]:z||0,V=O?0:h(c)?c:0;return(e,d,m,g,_)=>{let[v]=S(e),O=w(D)?m.length:D,ee=w(N)?!1:l(N)?N(v,d,O):y(v,N),F=h(ee)||o(ee)&&h(+ee)?+ee:d,I=F>=0&&F<O?F:d;if(k&&(V=(O-1)/2),A&&(V=O-1),!n.length){if(T){let e=!0,t=!1,r=1/0,i=1/0,a=1/0,o=-1/0,s=-1/0,u=-1/0,d=[],f=[],g=[];for(let n=0;n<O;n++){let c=m[n],p=0,_=0,v=0,y=!1;if(c&&l(c.getBoundingClientRect)){let e=c.getBoundingClientRect();p=e.left+e.width/2,_=e.top+e.height/2,y=!0}else{let e=c;e&&h(e.x)&&h(e.y)&&(p=e.x,_=e.y,h(e.z)&&(v=e.z,t=!0),y=!0)}if(!y){e=!1;break}d.push(p),f.push(_),g.push(v),p<r&&(r=p),_<i&&(i=_),v<a&&(a=v),p>o&&(o=p),_>s&&(s=_),v>u&&(u=v)}if(e){let e=d[0],l=f[0],m=g[0];te?(e=r+c[0]*(o-r),l=i+c[1]*(s-i),m=t?a+(c.length>=3?c[2]:.5)*(u-a):0):k?(e=(r+o)/2,l=(i+s)/2,m=(a+u)/2):A?(e=d[O-1],l=f[O-1],m=g[O-1]):h(c)&&(e=d[c],l=f[c],m=g[c]);for(let r=0;r<O;r++){let i=e-d[r],a=l-f[r],o=m-g[r],s=p(i*i+a*a+(t?o*o:0));E===`x`&&(s=-i),E===`y`&&(s=-a),E===`z`&&(s=-o),n.push(s)}let _=1/0;for(let e=0;e<O;e++){let t=b(n[e]);t>0&&t<_&&(_=t)}if(_>0&&_<1/0)for(let e=0;e<O;e++)n[e]=n[e]/_}else for(let e=0;e<O;e++)n.push(b(V-e))}else for(let e=0;e<O;e++)if(!C)n.push(b(V-e));else{let t=C.length,r=C[0]*C[1],i,a,o;te?(i=c[0]*(C[0]-1),a=c[1]*(C[1]-1),o=t===3?(c.length>=3?c[2]:.5)*(C[2]-1):0):k?(i=(C[0]-1)/2,a=(C[1]-1)/2,o=t===3?(C[2]-1)/2:0):(i=V%C[0],a=s(V/C[0])%C[1],o=t===3?s(V/r):0);let l=e%C[0],u=s(e/C[0])%C[1],d=t===3?s(e/r):0,f=i-l,m=a-u,h=o-d,g=p(f*f+m*m+(t===3?h*h:0));E===`x`&&(g=-f),E===`y`&&(g=-m),E===`z`&&(g=-h),n.push(g)}r=n[0];for(let e=1;e<O;e++)n[e]>r&&(r=n[e]);if(x||f)for(let e=0;e<O;e++){let t=n[e];x&&(t=x(t/r)*r),f&&(t=E?-t:b(r-t)),n[e]=t}if(se){a=Array(O);for(let e=0;e<O;e++)a[e]=oe(-1,1,4)}j&&(n=L(n,oe))}let R=M?(ne-P)/r:P;w(i)&&(i=_?re(_,w(t.start)?_.iterationDuration:ae):ae);let z=i+(R*u(n[I],2)||0);if(se){let e=r?n[I]/r:0,t=B+(le-B)*e;z+=a[I]*t}return t.modifier&&(z=t.modifier(z)),ie&&(z=`${z}${ie[2]}`),z}},R=e=>{let t=1;if(e&&e.getCTM){let n=e.getCTM();n&&(t=(p(n.a*n.a+n.b*n.b)+p(n.c*n.c+n.d*n.d))/2)}return t},oe=(e,t,n)=>{let r=te,i=getComputedStyle(e),a=i.strokeLinecap,o=i.vectorEffect===`non-scaling-stroke`?e:null,s=a,c=new Proxy(e,{get(e,t){let n=e[t];return t===f?e:t===`setAttribute`?(...t)=>{if(t[0]===`draw`){let n=t[1].split(` `),i=+n[0],c=+n[1],l=R(o),u=i*-r*l,d=c*r*l+u,f=r*l+(i===0&&c===1||i===1&&c===0?0:10*l)-d;if(a!==`butt`){let t=i===c?`butt`:a;s!==t&&(e.style.strokeLinecap=`${t}`,s=t)}e.setAttribute(`stroke-dashoffset`,`${u}`),e.setAttribute(`stroke-dasharray`,`${d} ${f}`)}return Reflect.apply(n,e,t)}:l(n)?(...t)=>Reflect.apply(n,e,t):n}});return e.getAttribute(`pathLength`)!==`${r}`&&(e.setAttribute(`pathLength`,`${r}`),c.setAttribute(`draw`,`${t} ${n}`)),c},z=(e,t=0,n=0)=>x(e).map(e=>oe(e,t,n)),se=r(),ce=n(),B=e(t(),1),le={overview:`Overview`,laws:`Constitution`,library:`Library`,kits:`Kits`,loops:`Loops`,personal:`Personal`,installs:`Installs`,docs:`Docs`,activity:`Activity`},V={loops:[`templates`,`bricks`,`active`],personal:[`rules`,`profile`,`memory`,`notebook`],installs:[`hosts`,`kits`,`edits`,`doctor`,`server`]},ue={templates:`Templates`,bricks:`Bricks`,active:`Active`,rules:`Rules`,profile:`Profile`,memory:`Memory`,notebook:`Notebook`,hosts:`Hosts`,kits:`Kits`,edits:`Local edits`,doctor:`Doctor`,server:`Server`},de={dashboard:[`overview`],constitution:[`laws`],rules:[`personal`,`rules`],profile:[`personal`,`profile`],harness:[`installs`,`hosts`],harnesses:[`installs`,`hosts`],themes:[`installs`,`hosts`],diff:[`installs`,`edits`],doctor:[`installs`,`doctor`],settings:[`installs`,`server`],about:[`installs`,`server`]},fe=(e,t)=>t!==void 0&&Object.hasOwn(e,t),pe=(e,t)=>V[e].includes(t)?t:V[e][0];function me(e){let t=(e||`#/`).slice(2).split(`/`).filter(Boolean),[n,r,i]=t,a=e=>{try{return decodeURIComponent(e||``)}catch{return e||``}};if(n===`section`||n===`item`){let e=n===`item`&&fe(M,r)?M[r]:r,t=n===`item`?a(i):void 0;return{page:e===`laws`?`laws`:`library`,section:e,item:t}}if(n===`docs`)return{page:`docs`,item:a(t.slice(1).join(`/`))};if(n===`kits`)return r?{page:`kits`,item:a(r)}:{page:`kits`};if(n===`activity`&&r)return{page:`activity`,item:a(r)};if(n===`skills`||n===`agents`)return{page:`library`,section:n};if(fe(V,n)){let e=pe(n,r);return i&&e===r?{page:n,tab:e,item:a(i)}:{page:n,tab:e}}if(fe(de,n)){let[e,t]=de[n];return t?{page:e,tab:t}:{page:e}}return{page:fe(le,n)?n:`overview`}}var he=new Set;function ge(e){return he.add(e),()=>he.delete(e)}function _e(){let e=()=>me(typeof window<`u`?window.location.hash:``),[t,n]=(0,B.useState)(e);(0,B.useEffect)(()=>{let t=window.location.hash,r=()=>{let r=window.location.hash;if(r!==t){for(let e of he)if(e({from:t,to:r})===!1){window.history.replaceState(window.history.state,``,t||`#/`);return}t=r,n(e())}};return window.addEventListener(`hashchange`,r),()=>window.removeEventListener(`hashchange`,r)},[]);let r=(0,B.useRef)(!1);return(0,B.useEffect)(()=>{if(document.title=`${le[t.page]} · Geneseed`,!r.current){r.current=!0;return}let e=document.getElementById(`main`);e?.focus();for(let t of[e,document.scrollingElement||document.documentElement])t&&(t.scrollTop=0)},[t.page]),t}var ve=e=>{window.location.hash=e},ye={red:`#FF5C57`,green:`#4ED888`,yellow:`#E8B53D`,blue:`#5B8CFF`,magenta:`#C77DFF`,cyan:`#3AD4C4`,white:`#E9EFEA`},be={red:`#C53A36`,green:`#2FA864`,yellow:`#B8862A`,blue:`#3C66D8`,magenta:`#9A52D6`,cyan:`#2BA89B`,white:`#AEB8B0`},xe=e=>ye[e]||ye.cyan,Se={red:`#A92F2B`,green:`#1E7A47`,yellow:`#8A6414`,blue:`#2F55C0`,magenta:`#7E3FB8`,cyan:`#15766C`,white:`#465A51`};function Ce(e,t,n){if(!e)return;let r=n===`light`,i=r?be[t]||be.cyan:xe(t);r&&t===`white`&&(i=`#566B62`);let a=r?Se[t]||Se.cyan:i;Ve(e,Le(i,be[t]||be.cyan,Oe,a,r),r)}var we={cultivar:{dark:`#3AD4C4`,light:`#127E73`,ink:`#06100D`},operator:{dark:`#E8A23B`,light:`#8F5E10`,ink:`#1A1306`},matrix:{dark:`#19E37C`,light:`#0B7A47`,ink:`#04140C`},atlas:{dark:`#8FD694`,light:`#1C8450`,ink:`#14200F`}};function Te(e,t,n){let r=we[t];if(!e||!r)return!1;let i=n===`light`,a=i?r.light:r.dark;return Ve(e,Le(a,r.light,r.ink,a,i),i),!0}var Ee={dark:{worst:`#232A31`,soft:[`#14181D`,`#1B2026`,`#11151A`,`#171C22`,`#0B1116`,`#121A21`,`#1C1A12`,`#211E15`]},light:{worst:`#EBE6D8`,soft:[`#FBFDFC`,`#F3F6F6`,`#F4F6F8`,`#E9F4ED`,`#FCFAF4`,`#F6F2E7`]}},De=.13,Oe=`#06100D`,ke=e=>{let t=e.replace(`#`,``);return[0,2,4].map(e=>parseInt(t.slice(e,e+2),16))},Ae=e=>`#`+e.map(e=>Math.round(e).toString(16).padStart(2,`0`)).join(``).toUpperCase(),je=e=>{let[t,n,r]=ke(e).map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r},Me=(e,t)=>{let[n,r]=[je(e),je(t)].sort((e,t)=>t-e);return(n+.05)/(r+.05)},Ne=(e,t,n)=>{let r=ke(e),i=ke(t);return Ae(r.map((e,t)=>e+(i[t]-e)*n))},Pe=(e,t,n,r)=>{let i=e=>Math.min(...[].concat(t).map(t=>Me(e,t))),a=e;for(let t=.05;i(a)<n&&t<=1.0001;t+=.05)a=Ne(e,r,t);return a},Fe=e=>{let[t,n,r]=ke(e).map(e=>e/255),i=Math.max(t,n,r),a=Math.min(t,n,r),o=i-a;if(o===0)return{h:0,s:0};let s=o/(1-Math.abs(i+a-1));return{h:((i===t?(n-r)/o%6:i===n?(r-t)/o+2:(t-n)/o+4)*60+360)%360,s}},Ie=(e,t)=>{let n=Math.abs(e-t)%360;return n>180?360-n:n};function Le(e,t,n,r,i){let a=i?`#000000`:`#FFFFFF`,o=e=>Me(e,n)>=Me(e,`#FFFFFF`)?n:`#FFFFFF`,s=Me(e,o(e))>=4.5?e:Pe(e,i?`#FFFFFF`:n,4.5,a),c=i?Ee.light:Ee.dark,l=[c.worst,...c.soft.map(e=>Ne(e,s,De))];return{accent:s,accent2:t,ink:o(s),text:Pe(r,l,4.5,a)}}var Re=39,ze={dark:[`#FF8A4C`,`#FF8A4C`],light:[`#B4441F`,`#9B3A1B`]};function Be(e,t,n){let[r,i]=n?ze.light:ze.dark,{h:a,s:o}=Fe(t),s=Ie(a,Re);o>=.15&&s<=29&&Ie(a,Fe(r).h)>s?(e.style.setProperty(`--warn`,r),e.style.setProperty(`--warn-text`,i)):(e.style.removeProperty(`--warn`),e.style.removeProperty(`--warn-text`))}function Ve(e,t,n){e.style.setProperty(`--accent`,t.accent),e.style.setProperty(`--accent-2`,t.accent2),e.style.setProperty(`--accent-ink`,t.ink),e.style.setProperty(`--accent-text`,t.text),Be(e,t.accent,n)}var He=e=>typeof e==`string`&&/^#[0-9a-fA-F]{6}$/.test(e);function Ue(e,t){let n=t===`light`,r=n?Ee.light:Ee.dark,i=n?`#000000`:`#FFFFFF`,a=Pe(e,r.worst,3,i);return Le(a,Pe(a,r.worst,4.5,i),Oe,a,n)}function We(e,t,n){return!e||!He(t)?!1:(Ve(e,Ue(t,n),n===`light`),!0)}function Ge(e,t){let[n,r]=(0,B.useState)(()=>{try{return t(localStorage.getItem(e))}catch{return t(null)}});return[n,(0,B.useCallback)(t=>r(n=>{let r=typeof t==`function`?t(n):t;try{localStorage.setItem(e,r)}catch{}return r}),[e])]}var Ke=`geneseed-mode`;function qe(){let[e,t]=Ge(Ke,e=>e===`light`?`light`:`dark`);return[e,()=>t(e=>e===`light`?`dark`:`light`)]}var Je=`geneseed-flavour`,Ye=[{id:`cultivar`,short:`Cultivar`,name:`Cultivar Evolved`,tagline:`The calm default — cool teal ink, geometric sans, soft flat cards lit by one quiet shadow.`},{id:`operator`,short:`Operator`,name:`Operator HUD`,tagline:`Amber phosphor on cool charcoal — all-mono, zero-radius instrument readout.`},{id:`matrix`,short:`Matrix`,name:`Matrix`,tagline:`Acid-green order-book terminal on pure black — all Space Mono, square 2px, a faint code-grid.`},{id:`atlas`,short:`Atlas`,name:`Atlas`,tagline:`The field journal — loam dark, sage ink, the codex as a living map.`}],Xe=new Set(Ye.map(e=>e.id)),Ze={a:`cultivar`,b:`atlas`,c:`operator`,d:`cultivar`,e:`matrix`,f:`cultivar`,g:`cultivar`,z:`cultivar`,cb:`matrix`,cm:`cultivar`,greenhouse:`atlas`,heirloom:`cultivar`,aurora:`cultivar`,perspective:`cultivar`,sequencer:`cultivar`,cobalt:`matrix`,cosmic:`cultivar`,neon:`matrix`};function Qe(){return Ge(Je,$e)}function $e(e){return Xe.has(e)?e:Ze[e]||`cultivar`}var et=1e3,tt=e=>new Promise(t=>setTimeout(t,e));async function nt(){try{return(await a.ping()).pid??null}catch{return null}}async function rt(e=0,t=null){await tt(e);for(let e=0;e<30;e++){let e=await nt();if(e!==null&&e!==t)break;await tt(et)}window.location.reload()}async function it(){let e=await nt();try{await a.restart()}catch(e){if(e.status)throw e}await rt(et,e)}var at=`geneseed-accent`,ot=[{id:`curated`,short:`Curated`,tagline:`Each theme's own signature colour.`}],st=[[`cyan`,`Cyan`],[`blue`,`Blue`],[`magenta`,`Violet`],[`yellow`,`Amber`],[`green`,`Green`]].map(([e,t])=>({id:`custom:${e}`,name:e,short:t,hex:xe(e),tagline:`Always ${t.toLowerCase()}, whatever the voice or skin.`})),ct=[...ot,...st],lt=new Set(ct.map(e=>e.id)),ut=e=>{let t=typeof e==`string`&&e.startsWith(`hex:`)?e.slice(4):null;return He(t)?t.toUpperCase():null},dt=e=>e&&(lt.has(e)||ut(e))?e:`curated`,ft=e=>st.find(t=>t.id===e)?.name??null,pt=e=>{let t=ut(e);return t?`Your own colour, ${t}.`:ct.find(t=>t.id===e)?.tagline??``};function mt(){return Ge(at,dt)}var ht=`geneseed-layout`,gt=[{id:`overview`,short:`Overview`,tagline:`Every install, what needs you, cost, usage and gates.`},{id:`cultivar`,short:`Cultivar`,tagline:`Hero, KPIs & genome grid.`},{id:`greenhouse`,short:`Greenhouse`,tagline:`Ring, tiles & mix donut.`},{id:`operator`,short:`Operator`,tagline:`Dense terminal readout.`},{id:`journal`,short:`Journal`,tagline:`Growth rings & the constitution map.`}],_t=new Set(gt.map(e=>e.id));function vt(e){return e&&_t.has(e)?e:`overview`}function yt(){return Ge(ht,vt)}function bt(e){let[t,n]=(0,B.useState)(null),[r,i]=(0,B.useState)(null),[o,s]=(0,B.useState)([]),c=()=>a.overview().then(e=>{n(e),i(null)}).catch(t=>{i(t?.body?.message||t?.message||String(t)),e?.(t)});return(0,B.useEffect)(()=>{c()},[]),(0,B.useEffect)(()=>{a.themes().then(e=>s(e.themes)).catch(()=>{})},[]),{overview:t,error:r,themes:o,reload:c}}var xt=600;function St({onFinish:e,onError:t}={}){let[n,r]=(0,B.useState)([]),[i,o]=(0,B.useState)(null),[s,c]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{a.jobs().then(({jobs:e})=>{if(!e.length)return;r(e.map(e=>({id:e.id,action:e.action,status:e.status,output:e.output||``,duration:e.duration,started:e.started})));let t=e.find(e=>e.status===`running`);t&&(o(t.id),c(!0))}).catch(()=>{})},[]),(0,B.useEffect)(()=>{if(!i)return;let t=n.find(e=>e.id===i),s=t?.action===`update`||!!t?.restarts,c=null;s&&nt().then(e=>c=e);let l=setInterval(async()=>{if(!document.hidden)try{let t=await a.job(i);if(r(e=>{let n=e.findIndex(e=>e.id===i);if(n===-1)return e;let r=e[n],a=t.output||``;if(r.output===a&&r.status===t.status&&r.duration===t.duration)return e;let o=e.slice();return o[n]={...r,output:a,status:t.status,duration:t.duration},o}),t.status!==`running`){if(clearInterval(l),o(null),s&&t.status===`done`){rt(2e3,c);return}e?.(t.status)}}catch{if(!s)return;clearInterval(l),rt(0,c)}},xt);return()=>clearInterval(l)},[i]),{runs:n,activeId:i,consoleOpen:s,setConsoleOpen:c,runAction:async(e,n)=>{try{let{job_id:t,restarts:i}=await a.action(e,n),s=e===`build`&&n?.theme?`build (${n.theme} · ${n.emit})`:e;return r(e=>[...e,{id:t,action:s,status:`running`,output:``,started:Date.now()/1e3,restarts:!!i}]),o(t),c(!0),t}catch(e){t?.(e)}},cancelJob:e=>a.cancelJob(e).catch(e=>t?.(e)),clearRuns:()=>r([])}}var H=new Map,Ct=new Map;function wt(e){for(let t of H.keys())t.startsWith(`${e}|`)&&H.delete(t)}function U(e,t=[],n=null,{revalidate:r=!1}={}){let i=n===null?null:`${n}|${t.join(``)}`,[a,o]=(0,B.useState)(()=>i!==null&&H.has(i)?H.get(i):null),[s,c]=(0,B.useState)(``),[l,u]=(0,B.useState)(()=>!(i!==null&&H.has(i))),d=(0,B.useRef)(e),f=(0,B.useRef)(i);(0,B.useLayoutEffect)(()=>{d.current=e,f.current=i});let p=(0,B.useRef)(0),m=(0,B.useCallback)(()=>{let e=++p.current,t=()=>e===p.current;u(!0),c(``);let n=f.current;return Promise.resolve(d.current()).then(e=>{if(t()&&(o(e),n!==null)){H.set(n,e);for(let t of Ct.get(n)||[])t(e)}}).catch(e=>{t()&&c(e.message)}).finally(()=>{t()&&u(!1)})},t);return(0,B.useEffect)(()=>{let e=f.current;return e!==null&&(Ct.has(e)||Ct.set(e,new Set),Ct.get(e).add(o)),e!==null&&H.has(e)&&(p.current++,o(H.get(e)),c(``),u(!1),!r)||m(),()=>Ct.get(e)?.delete(o)},[m]),{data:a,error:s,loading:l,reload:m,setData:o}}var Tt=60,Et=3600,Dt=86400,Ot={seconds:90,minutes:5400,hours:36*Et};function kt(e){let t=Math.max(0,Date.now()/1e3-e);return t<Ot.seconds?`${Math.round(t)}s`:t<Ot.minutes?`${Math.round(t/Tt)}m`:t<Ot.hours?`${Math.round(t/Et)}h`:`${Math.round(t/Dt)}d`}function At(e){return e?e.replace(/\\/g,`/`).replace(/^\/?(home|Users)\/[^/]+/i,`~`).replace(/^[A-Z]:\/Users\/[^/]+/i,`~`):`~`}var W={deployed:.4,doctorClean:.25,doctorMinor:.15,doctorMinorMax:2,doctorFail:.05,versionSynced:.2,diskClean:.15},jt={warn:W.deployed+W.doctorClean,bad:W.deployed};function Mt(e,t,n){if(!e)return 0;let r=e.doctor?.problems?.length??99,i=e.doctor?.ok?W.doctorClean:r<=W.doctorMinorMax?W.doctorMinor:W.doctorFail,a=t&&t.installed_fp&&t.installed_fp===t.source_fp,o=(e.deployed?W.deployed:0)+i+(a?W.versionSynced:0)+(e.diff&&e.diff.missing===0?W.diskClean:0);return Math.min(o,jt[n]??1)}var Nt=e=>Math.max(...P.map(t=>e?.[t]??0),1),Pt=e=>(e?.edited??0)+(e?.added??0),G=e=>Pt(e)+(e?.missing??0),Ft=e=>(e?.laws??0)+(e?.doctrines?.rules??0),K=i(),It={dashboard:`M3 13h7V3H3v10Zm0 8h7v-6H3v6Zm11 0h7V11h-7v10Zm0-18v6h7V3h-7Z`,library:`M4 5h10v14H4zM16 7h4v12h-4M7 9h4M7 12h4`,loop:`M19.5 9A8 8 0 1 1 15 4.6M15 1.5l.2 3.3-3.2.8`,graph:`M6 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM18 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM18 20a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM7.5 14.5l8-8M16.7 15.2L8.8 16.6`,changes:`M4 6h10M4 12h7M4 18h12M17 4l3 3-3 3M20 7h-6`,doctor:`M12 3v6m0 0a4 4 0 0 1-4 4H7a3 3 0 0 0-3 3v2m8-9a4 4 0 0 0 4 4h1a3 3 0 0 1 3 3v2M12 3a1.5 1.5 0 1 0 0-.01`,themes:`M12 3a9 9 0 1 0 0 18c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3-.3-.4-.5-.8-.5-1.2 0-1 .8-1.5 1.7-1.5H17a4 4 0 0 0 4-4c0-4.4-4-8-9-8Z`,settings:`M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm8-3a8 8 0 0 0-.1-1.3l2-1.6-2-3.4-2.4 1a8 8 0 0 0-2.2-1.3L15 2H9l-.3 2.6a8 8 0 0 0-2.2 1.3l-2.4-1-2 3.4 2 1.6A8 8 0 0 0 4 12c0 .4 0 .9.1 1.3l-2 1.6 2 3.4 2.4-1a8 8 0 0 0 2.2 1.3L9 22h6l.3-2.6a8 8 0 0 0 2.2-1.3l2.4 1 2-3.4-2-1.6c.1-.4.1-.9.1-1.3Z`,search:`M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM21 21l-4.3-4.3`,chevron:`M9 6l6 6-6 6`,x:`M6 6l12 12M18 6L6 18`,menu:`M4 7h16M4 12h16M4 17h16`,play:`M7 5v14l11-7L7 5Z`,clear:`M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14`,download:`M12 3v12m0 0l-4-4m4 4l4-4M4 19h16`,refresh:`M21 12a9 9 0 1 1-3-6.7M21 4v5h-5`,folder:`M3 7a2 2 0 0 1 2-2h3.5l2 2H19a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z`,build:`M14 3l-1 4 4-1 3 3-4 1 1 4-3 3-1-4-4 1-3-3 4-1-1-4 3-3 5 0Z`,arrow:`M5 12h14M13 6l6 6-6 6`,external:`M14 5h5v5M19 5l-8 8M12 5H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-6`,copy:`M9 9h11v11H9zM5 15H4V4h11v1`,spark:`M12 3v3m0 12v3m9-9h-3M6 12H3m13.5-6.5-2 2m-7 7-2 2m11 0-2-2m-7-7-2-2`,activity:`M3 12h4l2.5-7 5 14 2.5-7H21`,agent:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM22 21v-2a4 4 0 0 0-3-3.9M16 3.1a4 4 0 0 1 0 7.8`,kit:`M21 8l-9-5-9 5v8l9 5 9-5V8ZM3 8l9 5 9-5M12 13v8`,layers:`M12 3l9 5-9 5-9-5 9-5ZM3 13l9 5 9-5M3 17l9 5 9-5`,sun:`M12 4V2M12 22v-2M4 12H2M22 12h-2M5.6 5.6 4.2 4.2M19.8 19.8l-1.4-1.4M18.4 5.6l1.4-1.4M4.2 19.8l1.4-1.4M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8Z`,moon:`M21 12.8A8.5 8.5 0 1 1 11.2 3a6.5 6.5 0 0 0 9.8 9.8Z`,power:`M12 3v9M7.5 6.5a7 7 0 1 0 9 0`,docs:`M5 4h9l5 5v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1ZM14 4v5h5M8 12h7M8 16h7`,skill:`M21.7 6.6a5 5 0 0 1-6.6 6.6l-7.4 7.4a2 2 0 1 1-2.8-2.8l7.4-7.4a5 5 0 0 1 6.6-6.6l-2.6 2.6a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0Z`,law:`M12 3v18M5 6h14M8 21h8M6 6l-3 6h6zM3 12a3 3 0 0 1 6 0M18 6l-3 6h6zM15 12a3 3 0 0 1 6 0`,rule:`M7 3h10a1 1 0 0 1 1 1v17l-6-3.5L6 21V4a1 1 0 0 1 1-1ZM9.5 9.5l1.8 1.8 3.4-3.6`,profile:`M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM5 20a7 7 0 0 1 14 0`,notebook:`M7 4h11v16H7zM4 8h3M4 12h3M4 16h3M11 9h5M11 13h5M11 17h3`,about:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM12 11v6M12 7.6h.01`,github:`M12 2a10 10 0 0 0-3.2 19.5c.5.1.7-.2.7-.5v-1.8c-2.8.6-3.4-1.2-3.4-1.2-.5-1.2-1.1-1.5-1.1-1.5-.9-.6.1-.6.1-.6 1 .1 1.5 1 1.5 1 .9 1.5 2.3 1.1 2.9.8.1-.6.3-1.1.6-1.3-2.2-.3-4.6-1.1-4.6-5 0-1.1.4-2 1-2.7-.1-.3-.4-1.3.1-2.7 0 0 .8-.3 2.7 1a9.4 9.4 0 0 1 5 0c1.9-1.3 2.7-1 2.7-1 .5 1.4.2 2.4.1 2.7.6.7 1 1.6 1 2.7 0 3.9-2.4 4.7-4.6 5 .4.3.7.9.7 1.8v2.6c0 .3.2.6.7.5A10 10 0 0 0 12 2Z`};function q({name:e,className:t=`glyph`,style:n}){return(0,K.jsx)(`svg`,{className:t,style:n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,K.jsx)(`path`,{d:It[e]||``})})}function Lt({className:e=`sprout`}){return(0,K.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,K.jsx)(`path`,{d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,K.jsx)(`path`,{d:`M12 13c0-4.5 3.2-7.5 7.5-7.5 0 4.5-3.2 7.5-7.5 7.5z`,fill:`var(--accent)`}),(0,K.jsx)(`path`,{d:`M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z`,fill:`var(--accent)`,opacity:`.42`}),(0,K.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})}var Rt=[{hash:`#/`,page:`overview`,label:`Overview`,icon:`dashboard`},{hash:`#/laws`,page:`laws`,label:`Constitution`,icon:`law`,count:e=>e?.counts?(e.counts.ontology??0)+(e.counts.laws??0)+(e.counts.doctrines?.rules??0):null},{hash:`#/library`,page:`library`,label:`Library`,icon:`library`,count:e=>e?.counts?[`skills`,`agents`,`memory`,`notebook`,`wiki`,`config`].reduce((t,n)=>t+(e.counts[n]??0),0):null},{hash:`#/kits`,page:`kits`,label:`Kits`,icon:`kit`},{hash:`#/loops`,page:`loops`,label:`Loops`,icon:`loop`,count:e=>e?.counts?.loops??null},{hash:`#/personal`,page:`personal`,label:`Personal`,icon:`profile`},{hash:`#/installs`,page:`installs`,label:`Installs`,icon:`layers`,count:(e,t)=>t?`${t.filter(e=>e.state===`active`).length}/${t.length}`:null}],zt=[{hash:`#/docs`,page:`docs`,label:`Docs`,icon:`docs`},{hash:`#/activity`,page:`activity`,label:`Activity`,icon:`activity`}];function Bt({n:e,lit:t,count:n,onNavigate:r}){return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`a`,{className:`sb-item${t?` on`:``}`,href:e.hash,"aria-current":t?`page`:void 0,onClick:()=>r?.(),children:[(0,K.jsx)(q,{name:e.icon}),(0,K.jsx)(`span`,{className:`sb-label`,children:e.label}),n==null?null:(0,K.jsx)(`span`,{className:`sb-count`,children:n})]})})}function Vt({overview:e,onOpenVoice:t}){if(!e)return null;let n=e.doctor,r=G(e.diff);return(0,K.jsxs)(`section`,{className:`sb-vitals`,"aria-label":`Install vitals`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{children:`doctor`}),(0,K.jsx)(`b`,{className:n?n.ok?`good`:`bad`:``,children:n?n.ok?`clean`:`${n.problems.length} to fix`:`not run`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{children:`drift`}),(0,K.jsx)(`b`,{className:r?`warn`:``,children:e.diff?r:`n/a`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{children:`built`}),(0,K.jsx)(`b`,{title:e.build_time||void 0,children:e.build_epoch?`${kt(e.build_epoch)} ago`:`never`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`sb-voice`,onClick:t,title:`Switch voice`,"aria-haspopup":`dialog`,children:[(0,K.jsxs)(`span`,{className:`sb-voice-name`,children:[(0,K.jsx)(`i`,{className:`sb-voice-swatch`,"aria-hidden":`true`}),`Voice · `,e.theme||`none`]}),(0,K.jsx)(q,{name:`chevron`})]})]})}function Ht({route:e,overview:t,installs:n,onOpenVoice:r,onNavigate:i}){return(0,K.jsxs)(`nav`,{className:`sidebar`,id:`rail-nav`,"aria-label":`Console`,tabIndex:-1,children:[(0,K.jsxs)(`button`,{type:`button`,className:`sb-brand`,onClick:()=>{ve(`#/`),i?.()},"aria-label":`Geneseed, go to the overview`,children:[(0,K.jsx)(`span`,{className:`sb-mark`,children:(0,K.jsx)(Lt,{})}),(0,K.jsxs)(`span`,{className:`sb-brand-text`,children:[(0,K.jsx)(`span`,{className:`sb-name`,children:`Geneseed`}),(0,K.jsx)(`span`,{className:`sb-ver`,children:[t?.version&&`v${t.version}`,t?.theme].filter(Boolean).join(` · `)})]})]}),(0,K.jsx)(`ul`,{className:`sb-list`,children:[...Rt,...zt].map(r=>(0,K.jsx)(Bt,{n:r,lit:e.page===r.page,count:r.count?.(t,n),onNavigate:i},r.page))}),(0,K.jsx)(`div`,{className:`sb-spacer`}),t?(0,K.jsx)(`button`,{type:`button`,className:`sb-voice-rail`,"aria-label":`Switch voice, now ${t.theme||`none`}`,title:`Switch voice`,onClick:r,children:(0,K.jsx)(q,{name:`spark`})}):null,(0,K.jsx)(Vt,{overview:t,onOpenVoice:r})]})}var Ut=[`overview`,`laws`,`library`,`installs`];function Wt({route:e,navOpen:t,onMore:n}){return(0,K.jsxs)(`nav`,{className:`tabbar`,"aria-label":`Console pages`,children:[Rt.filter(e=>Ut.includes(e.page)).map(t=>(0,K.jsxs)(`a`,{href:t.hash,className:e.page===t.page?`on`:``,"aria-current":e.page===t.page?`page`:void 0,children:[(0,K.jsx)(q,{name:t.icon}),t.label]},t.page)),(0,K.jsxs)(`button`,{type:`button`,className:`tab-more${Ut.includes(e.page)?``:` on`}`,"aria-controls":`rail-nav`,"aria-expanded":!!t,onClick:n,children:[(0,K.jsx)(q,{name:`menu`}),`More`]})]})}var Gt=[{id:`opencode`,label:`OpenCode`,deployAdds:`.opencode/ + AGENT.md`,removeProject:`.opencode/ + AGENT.md + the bundle`,removeGlobal:`~/.config/opencode's AGENT.md, agents, skills, plugins + the opencode.json entry`},{id:`claude`,label:`Claude Code`,deployAdds:`.claude/ + CLAUDE.md`,removeProject:`.claude/ + the CLAUDE.md block`,removeGlobal:`~/.claude's agents/skills + the CLAUDE.md block + settings hooks`},{id:`bob`,label:`BOB (IBM)`,deployAdds:`.bob/ + AGENTS.md`,removeProject:`.bob/ + the AGENTS.md block`,removeGlobal:`~/.bob's agents/skills + the AGENTS.md block + settings hooks`},{id:`openclaude`,label:`OpenClaude`,deployAdds:`.openclaude/ + its CLAUDE.md`,removeProject:`.openclaude/ + its CLAUDE.md block`,removeGlobal:`~/.openclaude's agents/skills + the CLAUDE.md block + settings hooks`}],Kt=e=>Gt.find(t=>t.id===e)||Gt[0],qt=(e,t)=>t===`project`?Kt(e).removeProject:Kt(e).removeGlobal,Jt=e=>String(e||``).replace(/[\\/]+$/,``).split(/[\\/]/).pop()||e,Yt=e=>e.scope===`global`?Kt(e.host).label:Jt(e.path),Xt=`geneseed-harness`,Zt=Gt.map(({id:e,label:t})=>({id:e,label:t}));function Qt(e=`opencode`){let[t,n]=Ge(Xt,e=>Zt.some(t=>t.id===e)?e:null);return[t??e,n]}function $t(e){let t=String(e||``);return Gt.find(e=>t.startsWith(e.id))?.id||`opencode`}var en=Object.entries(le).flatMap(([e,t])=>(V[e]||[``]).map(n=>{let r=n?t+` / `+ue[n]:t;return{kind:`Pages`,sortKey:-1,title:r,desc:``,hay:r.toLowerCase(),route:e===`overview`?`#/`:`#/`+e+(n?`/`+n:``)}}));function tn(e=0){let[t,n]=(0,B.useState)(null),[r,i]=(0,B.useState)(``),o=(0,B.useRef)(null),[s]=Qt(),c=`${e}|${s}`,[l,u]=(0,B.useState)(c);return l!==c&&(u(c),n(null)),(0,B.useEffect)(()=>{o.current=null},[c]),{index:t,error:r,prime:(0,B.useCallback)(()=>{if(t||o.current)return o.current;let e=(async()=>{let e=[],t=[`laws`,`skills`,...P],r=await Promise.all(t.map(async e=>{try{return{sec:e,items:(await a.catalog(e))?.items||[]}}catch{return{sec:e,items:[]}}}));for(let{sec:n,items:i}of r){let r=N[n];for(let a of i){let i=a.title||a.name;e.push({kind:r.label,sortKey:t.indexOf(n),title:i,desc:a.desc||``,hay:`${i} ${a.desc||``} ${a.name||``}`.toLowerCase(),route:`#/item/${r.type}/${encodeURIComponent(a.name)}`})}}try{let t=await a.mcp(),n=new Set;for(let r of t?.targets||[])for(let t of r.servers||[]){if(n.has(t.name))continue;n.add(t.name);let r=t.label||t.name;e.push({kind:`MCP servers`,sortKey:100,title:r,desc:t.desc||``,hay:`${r} ${t.desc||``} ${t.name||``} mcp`.toLowerCase(),route:`#/installs/hosts`})}}catch{}try{let t=await a.docs(s);for(let n of t?.groups||[])for(let t of n.pages||[])e.push({kind:`Docs`,sortKey:110,title:t.title,desc:n.label,hay:`${t.title||``} ${t.id||``} ${n.label||``} ${t.section||``} ${t.description||``}`.toLowerCase(),route:`#/docs/${encodeURIComponent(t.id)}`})}catch{}return n(e),o.current=null,e})().catch(e=>(o.current=null,i(e.message||String(e)),[]));return o.current=e,e},[t,s])}}function nn({open:e,title:t,children:n,confirmLabel:r,tone:i,onConfirm:a,onClose:o}){let s=(0,B.useRef)(null),c=(0,B.useRef)(null),l=(0,B.useRef)(null),u=(0,B.useId)(),d=i===`danger`;return(0,B.useEffect)(()=>{let t=s.current;t&&(e&&!t.open&&(typeof t.showModal==`function`?t.showModal():t.setAttribute(`open`,``)),e&&(d?c:l).current?.focus(),!e&&t.open&&(typeof t.close==`function`?t.close():t.removeAttribute(`open`)))},[e,d]),(0,K.jsxs)(`dialog`,{ref:s,className:`confirm`,"aria-labelledby":`${u}-title`,"aria-describedby":`${u}-body`,onCancel:o,onClose:o,children:[(0,K.jsx)(`h3`,{className:`confirm-title`,id:`${u}-title`,children:t}),(0,K.jsx)(`div`,{className:`confirm-body`,id:`${u}-body`,children:n}),(0,K.jsxs)(`div`,{className:`confirm-actions`,children:[(0,K.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:o,ref:c,children:`Cancel`}),(0,K.jsx)(`button`,{type:`button`,className:d?`btn danger`:`btn`,onClick:a,ref:l,children:r||`Confirm`})]})]})}var rn=(0,B.createContext)(null),an=()=>{throw Error(`useConfirm() needs a <ConfirmProvider> above it`)};function on(){return(0,B.useContext)(rn)||an}function sn({children:e}){let[t,n]=(0,B.useState)(null),r=(0,B.useRef)(null),i=e=>{let t=r.current;r.current=null,n(null),t?.(e)},a=(0,B.useCallback)((e,t={})=>new Promise(i=>{r.current?.(!1),r.current=i,n({msg:e,...t})}),[]);return(0,K.jsxs)(rn.Provider,{value:a,children:[e,(0,K.jsx)(nn,{open:!!t,title:t?.title||`Are you sure?`,confirmLabel:t?.confirmLabel,tone:t?.tone,onConfirm:()=>i(!0),onClose:()=>i(!1),children:t?.msg})]})}var cn=24;function ln(e,t){let n=e.title.toLowerCase();return n.startsWith(t)?0:n.includes(t)?1:e.hay.includes(t)?2:-1}function un(e,t){let n=t.toLowerCase().trim();if(!e)return[];if(!n)return e.filter(e=>e.sortKey<0).sort((e,t)=>e.sortKey-t.sortKey);let r=[];for(let t of e){let e=ln(t,n);e>=0&&r.push({e:t,s:e})}r.sort((e,t)=>e.e.sortKey-t.e.sortKey||e.s-t.s||e.e.title.localeCompare(t.e.title));let i=r.map(e=>e.e),a=i.filter(e=>e.sortKey>=0).slice(0,cn);return i.filter(e=>e.sortKey<0).concat(a)}function dn(e,t){let n=t.trim().toLowerCase(),r=n?e.toLowerCase().indexOf(n):-1;return r<0?e:(0,K.jsxs)(K.Fragment,{children:[e.slice(0,r),(0,K.jsx)(`mark`,{className:`spot-hit`,children:e.slice(r,r+n.length)}),e.slice(r+n.length)]})}function fn({query:e,index:t,loading:n,error:r,active:i,onActive:a,onPick:o}){let s=(0,B.useMemo)(()=>un(t,e),[t,e]),c=(0,B.useRef)(null),l=s.length>0;(0,B.useLayoutEffect)(()=>{let e=c.current?.querySelectorAll(`[data-spot-row]`);if(!l||!e?.length||!E())return;let t=T(e,{opacity:[0,1],translateY:[-4,0],duration:220,delay:ae(18),ease:`outQuart`});return O(t,220+18*e.length)},[l]),(0,B.useEffect)(()=>{i>=s.length&&a(0)},[s,i,a]),(0,B.useEffect)(()=>{(c.current?.querySelector(`[data-spot-row="${i}"]`))?.scrollIntoView({block:`nearest`})},[i]);let u=[],d=null;s.forEach((e,t)=>{(!d||d.kind!==e.kind)&&(d={kind:e.kind,rows:[]},u.push(d)),d.rows.push({entry:e,index:t})});let f=!!e.trim();return(0,K.jsxs)(`div`,{className:`spotlight`,ref:c,id:`spotlight-list`,role:`listbox`,"aria-label":`Search results`,children:[u.map(t=>(0,K.jsxs)(`div`,{className:`spot-group`,role:`group`,"aria-label":t.kind,children:[(0,K.jsx)(`div`,{className:`spot-group-head`,"aria-hidden":`true`,children:t.kind}),t.rows.map(({entry:t,index:n})=>(0,K.jsxs)(`div`,{id:`spot-opt-${n}`,"data-spot-row":n,role:`option`,"aria-selected":n===i,className:`spot-row ${n===i?`on`:``}`,onMouseDown:e=>{e.preventDefault(),o(t)},onMouseEnter:()=>a(n),children:[(0,K.jsx)(`div`,{className:`spot-title`,children:dn(t.title,e)}),t.desc?(0,K.jsx)(`div`,{className:`spot-desc`,children:t.desc}):null]},`${t.route||t.title}-${n}`))]},`${t.kind}-${t.rows[0].index}`)),f&&r&&(0,K.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`Could not load the search index — `,r]}),f&&n&&!r&&(0,K.jsx)(`div`,{className:`spot-empty`,role:`presentation`,children:`Loading…`}),f&&!n&&!r&&s.length===0&&(0,K.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`No matches for “`,e,`”.`]})]})}function pn({actions:e=[],dataRev:t}){let n=(0,B.useRef)(null),r=(0,B.useRef)(null),i=(0,B.useRef)(null),[a,o]=(0,B.useState)(!1),[s,c]=(0,B.useState)(``),[l,u]=(0,B.useState)(0),{index:d,error:f,prime:p}=tn(t),m=on(),h=()=>{o(!0),p()},g=()=>{let e=n.current;e?.open&&(typeof e.close==`function`?e.close():e.removeAttribute(`open`)),o(!1),c(``),u(0),i.current?.focus()};(0,B.useEffect)(()=>{let e=n.current;a&&e&&!e.open&&(typeof e.showModal==`function`?e.showModal():e.setAttribute(`open`,``),r.current?.focus())},[a]),(0,B.useEffect)(()=>{let e=e=>{((e.metaKey||e.ctrlKey)&&!e.altKey&&e.key.toLowerCase()===`k`||e.key===`/`&&!e.target.closest(`input, textarea, select`))&&(e.preventDefault(),o(!0),p())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[p]);let _=(0,B.useMemo)(()=>[...e.map(e=>({sortKey:-2,...e})),...en,...d||[]],[e,d]),v=a?un(_,s):[],y=l<v.length?`spot-opt-${l}`:void 0,b=async e=>{if(g(),!e.run)return ve(e.route);let t=e.confirm;(!t||await m(t.msg,{title:t.title,confirmLabel:t.confirmLabel,tone:t.tone}))&&e.run()};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`button`,{type:`button`,className:`tb-cmdk`,ref:i,"aria-haspopup":`dialog`,onClick:h,title:`Press / to open, or Ctrl-K / ⌘K from inside any field`,children:[(0,K.jsx)(q,{name:`search`,className:`mag glyph`}),(0,K.jsx)(`span`,{className:`tb-cmdk-label`,children:`Search or run…`}),(0,K.jsx)(`kbd`,{className:`tb-cmdk-key`,children:`Ctrl K`})]}),(0,K.jsx)(`dialog`,{ref:n,className:`palette`,"aria-label":`Search or run`,onCancel:e=>{e.preventDefault(),g()},onClose:()=>a&&g(),onClick:e=>e.target===n.current&&g(),children:a&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`palette-head`,children:[(0,K.jsx)(q,{name:`search`,className:`mag glyph`}),(0,K.jsx)(`input`,{ref:r,role:`combobox`,"aria-label":`Search or run`,"aria-autocomplete":`list`,"aria-expanded":`true`,"aria-controls":`spotlight-list`,"aria-activedescendant":y,value:s,onChange:e=>{c(e.target.value),u(0)},onKeyDown:e=>{if(e.key===`ArrowDown`)e.preventDefault(),u(e=>Math.min(e+1,Math.max(v.length-1,0)));else if(e.key===`ArrowUp`)e.preventDefault(),u(e=>Math.max(e-1,0));else if(e.key===`Enter`){let t=v[l];t&&(e.preventDefault(),b(t))}else e.key===`Escape`&&(e.preventDefault(),s?(c(``),u(0)):g())},placeholder:`Search or run…`}),(0,K.jsx)(`kbd`,{className:`palette-key`,children:`Esc`})]}),(0,K.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:v.length?`${v.length} results`:`no matches`}),(0,K.jsx)(fn,{query:s,index:_,loading:!d,error:d?``:f,active:l,onActive:u,onPick:b}),(0,K.jsxs)(`div`,{className:`palette-foot`,children:[(0,K.jsx)(`span`,{children:`↑↓ move`}),(0,K.jsx)(`span`,{children:`↵ open`}),(0,K.jsx)(`span`,{children:`actions that write always ask first`})]})]})})]})}function mn({installs:e,onSwitch:t,fallback:n=null}){let r=(e||[]).filter(e=>e.state===`active`);if(r.length<2)return n;let i=r.find(e=>e.selected)||r[0];return(0,K.jsx)(`select`,{className:`sel tb-harness`,"aria-label":`Harness to view`,title:`Harness the console is viewing`,value:i.id,onChange:async e=>{let n=r.find(t=>t.id===e.target.value);if(n)try{await a.selectView(n.host,n.path),t?.()}catch{}},children:r.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.scope===`global`?`${e.host} · global`:`${Yt(e)} · ${e.host}`},e.id))})}var hn=`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`;function gn({open:e,onClose:t,anchorRef:n,label:r,className:i,children:a}){let o=(0,B.useRef)(null);return(0,B.useEffect)(()=>{if(!e)return;let r=o.current,i=n?.current;(r.querySelector(hn)||r).focus();let a=e=>{e.key===`Escape`&&t()},s=e=>{r.contains(e.target)||i?.contains(e.target)||t()};return document.addEventListener(`keydown`,a),document.addEventListener(`mousedown`,s),()=>{document.removeEventListener(`keydown`,a),document.removeEventListener(`mousedown`,s);let e=document.activeElement;(!e||e===document.body||r.contains(e))&&i?.focus()}},[e]),e?(0,K.jsx)(`div`,{ref:o,className:i?`popover ${i}`:`popover`,role:`dialog`,"aria-label":r,tabIndex:-1,children:a}):null}function _n({children:e,...t}){let n=D(`button.on`);return(0,K.jsxs)(`div`,{className:`seg`,role:`group`,ref:n,...t,children:[(0,K.jsx)(`span`,{className:`glide`,"aria-hidden":`true`}),e]})}function vn({value:e,onChange:t,labelledBy:n}){let r=ut(e);return(0,K.jsxs)(`div`,{className:`accent-picker`,role:`group`,"aria-labelledby":n,children:[ot.map(n=>(0,K.jsx)(`button`,{type:`button`,className:`accent-src${e===n.id?` on`:``}`,"aria-pressed":e===n.id,title:n.tagline,onClick:()=>t(n.id),children:n.short},n.id)),(0,K.jsxs)(`div`,{className:`accent-swatches`,children:[st.map(n=>(0,K.jsx)(`button`,{type:`button`,className:`accent-swatch${e===n.id?` on`:``}`,style:{"--sw":n.hex},"aria-pressed":e===n.id,"aria-label":`${n.short} accent`,title:n.short,onClick:()=>t(n.id)},n.id)),(0,K.jsx)(`label`,{className:`accent-swatch accent-custom${r?` on picked`:``}`,style:r?{"--sw":r}:void 0,title:r?`Your colour, ${r}`:`Pick any colour`,children:(0,K.jsx)(`input`,{type:`color`,"aria-label":`Custom accent colour`,value:(r||`#3AD4C4`).toLowerCase(),onChange:e=>t(`hex:${e.target.value.toUpperCase()}`)})})]})]})}function yn({flavour:e,onFlavour:t,accentMode:n,onAccentMode:r,layout:i,onLayout:a,onClose:o,anchorRef:s}){let c=(e,t,n,r,i)=>(0,K.jsxs)(`div`,{className:`ap-group`,children:[(0,K.jsx)(`span`,{className:`ap-label`,id:e,children:t}),(0,K.jsx)(_n,{"aria-labelledby":e,children:n.map(e=>(0,K.jsx)(`button`,{type:`button`,className:r===e.id?`on`:``,"aria-pressed":r===e.id,title:e.tagline,onClick:()=>i(e.id),children:e.short},e.id))})]});return(0,se.createPortal)((0,K.jsxs)(gn,{open:!0,onClose:o,anchorRef:s,label:`Appearance`,className:`appearance-pop`,children:[c(`ap-skin`,`Skin`,Ye,e,t),(0,K.jsxs)(`div`,{className:`ap-group`,children:[(0,K.jsx)(`span`,{className:`ap-label`,id:`ap-accent`,children:`Accent`}),(0,K.jsx)(vn,{value:n,onChange:r,labelledBy:`ap-accent`})]}),c(`ap-view`,`Overview view`,gt,i,a)]}),document.querySelector(`.app`)||document.body)}function bn({route:e,navOpen:t,onToggleNav:n,overview:r,installs:i,actions:a,mode:o,onToggleMode:s,appearance:c,dataRev:l,onSwitch:u}){let[d,f]=(0,B.useState)(!1),p=(0,B.useRef)(null),m=r?.install,h=m?`${m.host}:${m.scope}`:At(r?.target),g=e.tab&&ue[e.tab];return(0,K.jsxs)(`header`,{className:`topbar`,children:[(0,K.jsx)(`button`,{type:`button`,className:`tb-menu iconbtn`,onClick:n,"aria-label":t?`Close navigation`:`Open navigation`,"aria-expanded":!!t,"aria-controls":`rail-nav`,children:(0,K.jsx)(q,{name:t?`x`:`menu`})}),(0,K.jsx)(`nav`,{className:`crumbs`,"aria-label":`Breadcrumb`,children:(0,K.jsxs)(`ol`,{children:[(0,K.jsx)(`li`,{className:`crumb-root mono`,children:(0,K.jsx)(mn,{installs:i,onSwitch:u,fallback:(0,K.jsx)(`a`,{href:`#/installs`,title:r?.target||void 0,children:h})})}),(0,K.jsx)(`li`,{children:g?(0,K.jsx)(`a`,{href:e.page===`overview`?`#/`:`#/${e.page}`,children:le[e.page]}):(0,K.jsx)(`span`,{className:`crumb-here`,"aria-current":`page`,children:le[e.page]})}),g?(0,K.jsx)(`li`,{children:(0,K.jsx)(`span`,{className:`crumb-here`,"aria-current":`page`,children:g})}):null]})}),(0,K.jsx)(`div`,{className:`topbar-spacer`}),(0,K.jsx)(pn,{actions:a,dataRev:l}),(0,K.jsx)(`button`,{type:`button`,className:`iconbtn`,ref:p,"aria-label":`Appearance`,title:`Appearance`,"aria-expanded":d,onClick:()=>f(e=>!e),children:(0,K.jsx)(q,{name:`themes`})}),d?(0,K.jsx)(yn,{...c,anchorRef:p,onClose:()=>f(!1)}):null,(0,K.jsx)(`button`,{type:`button`,className:`iconbtn`,title:o===`light`?`Switch to dark`:`Switch to light`,"aria-label":o===`light`?`Switch to dark mode`:`Switch to light mode`,onClick:s,children:(0,K.jsx)(q,{name:o===`light`?`moon`:`sun`})})]})}function xn({themes:e,current:t,onPick:n,onClose:r}){let i=on(),a=(0,B.useRef)(null);return(0,B.useEffect)(()=>{let e=e=>{a.current&&!a.current.contains(e.target)&&r()},t=e=>{e.key===`Escape`&&r()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]),(0,B.useEffect)(()=>{a.current?.querySelector(`button.pop-item`)?.focus()},[]),(0,K.jsxs)(`div`,{className:`pop`,ref:a,role:`dialog`,"aria-label":`Switch voice`,children:[(0,K.jsx)(`div`,{className:`tick`,style:{padding:`4px 10px 8px`},children:`Switch voice`}),e.map(e=>(0,K.jsxs)(`button`,{type:`button`,"aria-pressed":e.name===t,className:`pop-item ${e.name===t?`on`:``}`,onClick:async()=>{r(),await i(`Rebuild the deployed harness in the “${e.name}” voice? It rebuilds in place, non-destructive.`,{title:`Switch voice?`,confirmLabel:`Rebuild`})&&n(e.name)},children:[(0,K.jsx)(`span`,{className:`po`,style:{background:xe(e.accent),boxShadow:`0 0 8px ${xe(e.accent)}`}}),(0,K.jsx)(`span`,{className:`pn`,children:e.name})]},e.name))]})}var Sn=3500;function Cn({toast:e,onClose:t}){let[n,r]=(0,B.useState)(null),i=!!e&&e.kind!==`err`&&n!==e;(0,B.useEffect)(()=>{if(!i)return;let e=setTimeout(t,Sn);return()=>clearTimeout(e)},[e,i]);let a=()=>r(e),o=()=>r(null);return(0,K.jsx)(`div`,{className:`toast-region`,"aria-live":e?.kind===`err`?void 0:`polite`,children:e&&(0,K.jsxs)(`div`,{className:`toast ${e.kind}`,role:e.kind===`err`?`alert`:void 0,onMouseEnter:a,onMouseLeave:e=>{e.currentTarget.contains(document.activeElement)||o()},onFocus:a,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||o()},children:[(0,K.jsx)(`div`,{children:e.msg}),(0,K.jsx)(`div`,{style:{marginTop:8},children:(0,K.jsx)(`button`,{className:`btn ghost`,onClick:t,children:`Dismiss`})})]})})}function wn({runs:e,open:t,onToggle:n,onClear:r,onCancel:i,busy:a,finish:o}){let s=(0,B.useRef)(null),c=(0,B.useRef)(null);(0,B.useEffect)(()=>{let e=c.current;o&&e&&(e.classList.remove(`flash-ok`,`flash-bad`),e.offsetWidth,e.classList.add(o.status===`done`?`flash-ok`:`flash-bad`))},[o]);let l=e.length?e[e.length-1].output.length:0;return(0,B.useEffect)(()=>{let e=s.current;e&&t&&(e.scrollTop=e.scrollHeight)},[e.length,l,t]),(0,K.jsxs)(`div`,{className:`console`,style:{height:`42vh`,transform:t?`none`:`translateY(calc(42vh - 42px))`},children:[(0,K.jsxs)(`div`,{className:`console-head`,ref:c,onClick:n,onAnimationEnd:e=>{e.target===e.currentTarget&&e.currentTarget.classList.remove(`flash-ok`,`flash-bad`)},children:[a&&(0,K.jsx)(`span`,{className:`console-progress`,"aria-hidden":`true`}),(0,K.jsxs)(`span`,{className:`ttl`,children:[(0,K.jsx)(`span`,{className:`live ${a?`on`:``}`}),`terminal`]}),(0,K.jsx)(`span`,{className:`count`,children:e.length}),(0,K.jsxs)(`div`,{className:`right`,onClick:e=>e.stopPropagation(),children:[(0,K.jsx)(`button`,{className:`iconbtn`,title:`Clear`,"aria-label":`Clear run history`,onClick:r,disabled:!e.length,children:(0,K.jsx)(q,{name:`clear`})}),(0,K.jsx)(`button`,{className:`iconbtn`,title:t?`Collapse`:`Expand`,"aria-label":t?`Collapse console`:`Expand console`,"aria-expanded":t,onClick:n,children:(0,K.jsx)(q,{name:`chevron`,className:`glyph`,style:{transform:t?`rotate(90deg)`:`rotate(-90deg)`}})})]})]}),t&&(0,K.jsxs)(`div`,{className:`console-body`,ref:s,children:[e.length===0&&(0,K.jsx)(`div`,{className:`console-empty`,children:`No commands run yet. Actions you trigger stream here.`}),e.map(e=>(0,K.jsxs)(`div`,{className:`run`,children:[(0,K.jsxs)(`div`,{className:`run-head`,children:[(0,K.jsx)(`span`,{className:`pr`,children:`$`}),(0,K.jsx)(`span`,{className:`act`,children:e.action}),(0,K.jsx)(`span`,{className:`st ${e.status}`,children:e.status===`running`?`…running`:`${e.status===`done`?`✓ done`:`✗ failed`}${e.duration?` · ${e.duration}s`:``}`}),e.status===`running`&&i&&(0,K.jsx)(`button`,{className:`iconbtn run-cancel`,title:`Cancel this run`,"aria-label":`Cancel the ${e.action} run`,onClick:()=>i(e.id),children:(0,K.jsx)(q,{name:`x`})})]}),e.output&&(0,K.jsx)(`pre`,{className:`run-out`,children:e.output})]},e.id))]})]})}var Tn=550,En=`gs-splash-seen`;function Dn(){try{if(window.localStorage.getItem(En))return 0;window.localStorage.setItem(En,`1`)}catch{}return Tn}function On({ready:e,onDone:t}){let[n,r]=(0,B.useState)(!1),[i,a]=(0,B.useState)(!1);return(0,B.useEffect)(()=>{let e=setTimeout(()=>r(!0),Dn());return()=>clearTimeout(e)},[]),e&&n&&!i&&a(!0),(0,B.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>t?.(),700);return()=>clearTimeout(e)},[i]),(0,K.jsxs)(`div`,{className:`boot-splash${i?` fading`:``}`,"aria-hidden":`true`,onAnimationEnd:e=>{e.animationName===`splashOut`&&t?.()},children:[(0,K.jsxs)(`div`,{className:`boot-dial`,children:[(0,K.jsxs)(`svg`,{className:`boot-ring`,viewBox:`0 0 172 172`,children:[(0,K.jsx)(`circle`,{cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--surface-3)`,strokeWidth:`9`}),(0,K.jsx)(`circle`,{cx:`86`,cy:`86`,r:`50`,fill:`none`,stroke:`var(--line-2)`,strokeWidth:`8`,strokeDasharray:`1.2 5.3`,opacity:`.7`}),(0,K.jsx)(`circle`,{className:`boot-progress`,cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--accent)`,strokeWidth:`9`,strokeLinecap:`round`})]}),(0,K.jsxs)(`svg`,{className:`boot-sprout`,viewBox:`0 0 24 24`,children:[(0,K.jsx)(`path`,{className:`bs-stem`,d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,K.jsx)(`path`,{className:`bs-leaf bs-leaf-main`,d:`M12 13c0-4.5 3.2-7.5 7.5-7.5 0 4.5-3.2 7.5-7.5 7.5z`,fill:`var(--accent)`}),(0,K.jsx)(`path`,{className:`bs-leaf bs-leaf-back`,d:`M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z`,fill:`var(--accent)`,opacity:`.42`}),(0,K.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})]}),(0,K.jsxs)(`div`,{className:`boot-status`,children:[(0,K.jsx)(`span`,{children:`germinating harness`}),(0,K.jsx)(`span`,{className:`boot-caret`})]})]})}function kn({label:e=`Loading…`}){return(0,K.jsxs)(`div`,{className:`loading`,role:`status`,children:[e,(0,K.jsxs)(`div`,{className:`skel`,"aria-hidden":`true`,children:[(0,K.jsx)(`div`,{className:`skel-bar`}),(0,K.jsx)(`div`,{className:`skel-bar`}),(0,K.jsx)(`div`,{className:`skel-bar`})]})]})}function An({error:e,style:t,onRetry:n,role:r=`alert`}){return e?n?(0,K.jsxs)(`div`,{className:`error-state`,role:r,style:t,children:[(0,K.jsx)(`p`,{className:`badge bad`,children:e}),(0,K.jsx)(`button`,{type:`button`,className:`btn sm`,onClick:n,children:`Retry`})]}):(0,K.jsx)(`p`,{className:`badge bad`,role:r,style:t,children:e}):null}function jn(){let[e,t]=(0,B.useState)(!1),[n,r]=(0,B.useState)(null);return(0,K.jsxs)(`div`,{className:`stale-banner`,role:`alert`,children:[(0,K.jsx)(`span`,{children:n||`This console is running code from before your last upgrade.`}),(0,K.jsx)(`button`,{className:`btn sm`,onClick:async()=>{t(!0),r(null);try{await it()}catch(e){r(e.message),t(!1)}},disabled:e,children:e?`Restarting…`:`Restart`})]})}var Mn=/dynamically imported module|Importing a module script failed|Unable to preload CSS/i,Nn=e=>Mn.test(e?.message||``),Pn=class extends B.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}render(){let{error:e}=this.state;if(!e)return this.props.children;let t=Nn(e);return(0,K.jsxs)(`div`,{role:t?void 0:`alert`,children:[(0,K.jsx)(An,{error:e.message||String(e),role:null}),t?(0,K.jsx)(jn,{}):(0,K.jsx)(`button`,{type:`button`,className:`btn sm`,onClick:()=>this.setState({error:null}),children:`Retry`})]})}},Fn=(0,B.createContext)(null),In=e=>[...e].sort().join(`,`),Ln=e=>[...e.values()].some(e=>!e.applied&&In(e.value)!==e.base);function Rn(e,t){let[n,r]=(0,B.useState)(()=>({kits:new Map,rules:new Map})),[i,a]=(0,B.useState)(null),[o,s]=(0,B.useState)(t);if(o!==t&&(s(t),i&&t)){let e=t.status===`done`?{applied:!0}:{failed:!0};r(t=>{let n=t[i.kind].get(i.key);return n?{...t,[i.kind]:new Map(t[i.kind]).set(i.key,{...n,...e})}:t}),a(null)}let c=Ln(n.kits)||Ln(n.rules);return(0,B.useEffect)(()=>{if(!c)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[c]),{get:(e,t)=>n[e].get(t),put:(e,t,n,i)=>r(r=>{let a=new Map(r[e]);return In(n)===i?a.delete(t):a.set(t,{value:n,base:i}),{...r,[e]:a}}),drop:(e,t)=>r(n=>{let r=new Map(n[e]);return r.delete(t),{...n,[e]:r}}),prune:(0,B.useCallback)((e,t)=>r(n=>{let r=[...n[e]].filter(([e,n])=>t(e,n)).map(([e])=>e);if(!r.length)return n;let i=new Map(n[e]);return r.forEach(e=>i.delete(e)),{...n,[e]:i}}),[]),startApply:(e,t)=>{a({kind:e,key:t}),r(n=>{let r=n[e].get(t);return r?.failed?{...n,[e]:new Map(n[e]).set(t,{value:r.value,base:r.base})}:n})},running:(t,n)=>!!e&&i?.kind===t&&i?.key===n}}function zn({activeId:e,finish:t,children:n}){let r=Rn(e,t);return(0,K.jsx)(Fn.Provider,{value:r,children:n})}function Bn(){let e=Rn(null,null);return(0,B.useContext)(Fn)||e}function Vn({eyebrow:e,title:t,sub:n,primary:r,actions:i,crumbs:a}){return(0,K.jsxs)(`div`,{className:`page-head`,children:[(0,K.jsxs)(`div`,{children:[a?.length?(0,K.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:`page-crumbs`,children:(0,K.jsx)(`ol`,{children:a.map((e,t)=>(0,K.jsx)(`li`,{children:t===a.length-1?(0,K.jsx)(`span`,{"aria-current":`page`,children:e.label}):e.href?(0,K.jsx)(`a`,{href:e.href,children:e.label}):e.label},t))})}):null,e?(0,K.jsx)(`div`,{className:`eyebrow`,children:e}):null,(0,K.jsx)(`h1`,{className:`h`,children:t}),n?(0,K.jsx)(`p`,{className:`sub`,children:n}):null]}),r||i?(0,K.jsxs)(`div`,{className:`page-actions`,children:[i,r]}):null]})}var Hn=e=>!!e&&!e.endsWith(`-global`);function Un({onAction:e}){let{data:t,error:n}=U(()=>a.themes(),[]),[r,i]=(0,B.useState)(``),[o,s]=(0,B.useState)(``),[c,l]=(0,B.useState)(``),[u,d]=(0,B.useState)(``),[f,p]=(0,B.useState)(!1);if(n)return(0,K.jsx)(An,{error:n});if(!t)return(0,K.jsx)(kn,{});let m=r||t.current?.theme||`neutral`,h=(t.emits||[]).filter(e=>e.name!==`files`),g=t.emits?.some(e=>e.name===`opencode-global`),_=o||(g?`opencode-global`:t.current?.emit||h[0]?.name||``),v=i,y=s,b=Hn(_);return(0,K.jsxs)(`div`,{className:`narrow-lg`,children:[(0,K.jsx)(`div`,{className:`head-row mb-18`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h1`,{className:`h`,children:`Deploy your harness`}),(0,K.jsx)(`p`,{className:`sub`,children:`Geneseed isn't implanted on this machine yet. Pick a voice and an install mode, then deploy. The graft runs in the console below, and this dashboard lights up when it lands.`})]})}),(0,K.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,K.jsx)(`div`,{className:`card-head`,children:(0,K.jsx)(`h3`,{children:`1 · Choose a voice`})}),(0,K.jsx)(`div`,{className:`row wrap gap-10`,children:t.themes.map(e=>(0,K.jsxs)(`button`,{className:`btn ${e.name===m?`soft`:`ghost`}`,onClick:()=>v(e.name),title:e.blurb||e.tagline||e.name,children:[(0,K.jsx)(`span`,{className:`po`,style:{width:10,height:10,borderRadius:`50%`,background:xe(e.accent),boxShadow:`0 0 8px ${xe(e.accent)}`}}),(0,K.jsx)(`span`,{style:{textTransform:`capitalize`},children:e.name})]},e.name))})]}),(0,K.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,K.jsx)(`div`,{className:`card-head`,children:(0,K.jsx)(`h3`,{children:`2 · Install mode`})}),(0,K.jsxs)(`p`,{className:`sub mb-16`,children:[`A `,(0,K.jsx)(`code`,{children:`-global`}),` mode deploys once to that tool's global config, so every repo on this machine inherits the harness (recommended). A project mode installs into the repository folder you choose.`]}),(0,K.jsxs)(`label`,{className:`stack`,style:{gap:6,maxWidth:360},children:[(0,K.jsx)(`span`,{className:`tick`,children:`Mode`}),(0,K.jsx)(`select`,{className:`sel`,value:_,onChange:e=>y(e.target.value),children:h.map(e=>(0,K.jsxs)(`option`,{value:e.name,children:[e.name,e.desc?` · ${e.desc}`:``]},e.name))})]}),b&&(0,K.jsxs)(`div`,{className:`row gap-10`,style:{maxWidth:560,marginTop:12},children:[(0,K.jsx)(`input`,{className:`inp`,style:{flex:1},type:`text`,placeholder:`/path/to/project, or click Browse…`,value:c,onChange:e=>l(e.target.value),"aria-label":`Project folder to install into`}),(0,K.jsx)(`button`,{className:`btn ghost sm`,disabled:f,onClick:async()=>{p(!0),d(``);try{let e=await a.pickFolder();e.path?l(e.path):e.error&&d(e.error)}catch(e){d(e.message)}finally{p(!1)}},children:f?`Choosing…`:`Browse…`})]}),u&&(0,K.jsx)(`p`,{className:`sub`,style:{marginTop:12},children:u})]}),(0,K.jsxs)(`button`,{className:`btn btn-grid`,disabled:!m||!_||b&&!c.trim(),onClick:()=>{if(!b)return e(`build`,{theme:m,emit:_});let t=c.trim();return t?(d(``),e(`deploy`,{host:_,path:t,theme:m})):d(`Choose or type the project folder to install into.`)},children:[(0,K.jsx)(q,{name:`build`}),`Deploy harness`]})]})}var Wn=e=>U(()=>a.rules().catch(()=>null),[e],`rules`,{revalidate:!0}),Gn=()=>wt(`rules`);function Kn({segments:e,value:t,max:n,size:r=120,stroke:i=12,label:a,sweepMs:o=650}){let s=n>0?n:0,c=e||[{key:`v`,label:a,n:Math.min(Math.max(t||0,0),s),tone:`accent`}],l=e?c.reduce((e,t)=>e+t.n,0):s,u=e?c.map(e=>`${e.label}: ${e.n} of ${l}`).join(`, `):`${c[0].n} of ${l}`,d=r/2-i/2,f=r/2,p=e=>[f+d*Math.cos(e),f+d*Math.sin(e)],m=[],h=0;for(let e of c)m.push(h),h+=e.n;let g=(0,B.useRef)(null),_=c.map(e=>e.n).join(`,`);return(0,B.useLayoutEffect)(()=>{let e=g.current?.querySelectorAll(`path.ring-arc`);if(!o||!e?.length||!E())return;let t=c.map(e=>e.n/l).filter(e=>e>0),n=t.map((e,n)=>t.slice(0,n).reduce((e,t)=>e+t,0)),r=z(e);k(r,{draw:`0 0`});let i=T(r,{draw:[`0 0`,`0 1`],duration:(e,n)=>Math.max(o*t[n],60),delay:(e,t)=>o*n[t],ease:`linear`});return O(i,o)},[_,o]),(0,K.jsxs)(`svg`,{className:`ring`,width:r,height:r,viewBox:`0 0 ${r} ${r}`,role:`img`,"aria-label":a?`${a}: ${u}`:u,children:[(0,K.jsx)(`circle`,{className:`ring-track`,cx:f,cy:f,r:d,fill:`none`,strokeWidth:i}),(0,K.jsx)(`g`,{ref:g,children:l>0?c.map((e,t)=>{let n=e.n/l;if(!(n>0))return null;let r=m[t]/l*2*Math.PI-Math.PI/2,a=r+n*2*Math.PI,[o,s]=p(r),[c,u]=p(a),h=n>=.9999?`M ${o} ${s} A ${d} ${d} 0 1 1 ${2*f-o} ${2*f-s} A ${d} ${d} 0 1 1 ${o} ${s}`:`M ${o} ${s} A ${d} ${d} 0 ${+(n>.5)} 1 ${c} ${u}`;return(0,K.jsx)(`path`,{className:`ring-arc tone-${e.tone||`muted`}`,d:h,fill:`none`,strokeWidth:i,children:(0,K.jsxs)(`title`,{children:[e.label,`: `,e.n]})},e.key)}):null})]})}var qn=500;function Jn({parts:e,total:t,label:n,legend:r=!0}){let i=e.reduce((e,t)=>e+t.n,0),a=t??i,o=e=>a>0?`${e/a*100}%`:`0%`,s=e.map(e=>`${e.label}: ${e.n} of ${a}`).join(`, `),c=(0,B.useRef)(null),l=e.map(e=>e.n).join(`,`)+`/${a}`;return(0,B.useLayoutEffect)(()=>{if(c.current&&E())return k(c.current,{scaleX:0}),O(T(c.current,{scaleX:[0,1],duration:qn,ease:`outExpo`}),qn)},[l]),(0,K.jsxs)(`div`,{className:`stackbar-box`,children:[(0,K.jsx)(`div`,{className:`stackbar sweep`,role:`img`,"aria-label":n?`${n}: ${s}`:s,ref:c,children:e.map(e=>e.n>0?(0,K.jsx)(`span`,{className:`tone-${e.tone||`muted`}`,style:{width:o(e.n)},title:`${e.label}: ${e.n}`},e.key):null)}),r&&(0,K.jsx)(`ul`,{className:`stackbar-legend`,"aria-hidden":`true`,children:e.map(e=>(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`i`,{className:`tone-${e.tone||`muted`}`}),e.label,` `,(0,K.jsx)(`span`,{className:`mono`,children:e.n})]},e.key))})]})}function Yn({value:e,max:t,label:n=`value`,tone:r=`accent`}){let i=t>0?t:0;return(0,K.jsx)(Jn,{parts:[{key:`v`,label:n,n:Math.min(Math.max(e||0,0),i),tone:r}],total:i,legend:!1})}var Xn=864e5;function Zn(e,t=10,n=`today`){let r=Array(t).fill(0).map((e,r)=>({t:r===t-1?n:`${t-1-r}d`,v:0})),i=Date.now();for(let n of e){let e=n.started||n.finished||n.created||n.ts;if(!e)continue;let a=typeof e==`string`?Date.parse(e):e*1e3;if(!Number.isFinite(a))continue;let o=Math.floor((i-a)/Xn);o<0||o>=t||(r[t-1-o].v+=1)}return r}var Qn=(e,t)=>[...e||[]].sort((e,t)=>(t.started||0)-(e.started||0)).slice(0,t),$n=[`--emit`,`--theme`,`--scope`],er={done:`✓`,failed:`✗`};function tr(e){let t=(e.output||``).split(`
3
+ `).find(e=>e.startsWith(`$ `))||``,n=t.split(/\s+/),r=[];return n.forEach((e,t)=>{let[i,a]=e.split(`=`),o=a||n[t+1];$n.includes(i)&&o&&!o.startsWith(`--`)&&r.push(o)}),{verb:(e.action||`run`).split(/[\s(]/)[0],scope:r.join(` · `),result:er[e.status]||`…`,duration:e.duration?`${e.duration}s`:`—`,command:t}}var nr={busy:{cls:`acc`,label:`working`,accent:`var(--accent)`},"waiting-input":{cls:`warn`,label:`your move`,accent:`var(--warn)`},blocked:{cls:`bad`,label:`blocked`,accent:`var(--bad)`},idle:{cls:``,label:`idle`,accent:`var(--line)`}},rr={cls:``,label:`ended`};function ir(e){if(!e)return``;let t=e.replace(/\\/g,`/`).replace(/\/+$/,``).split(`/`);return t[t.length-1]||e}var ar=e=>e?e<1e3?String(e):e<1e5?(e/1e3).toFixed(1)+`k`:e<1e6?(e/1e3).toFixed(0)+`k`:(e/1e6).toFixed(1)+`M`:`0`;function or(e){if(e=Math.max(0,Math.floor(e)),e<60)return`${e}s`;let t=Math.floor(e/60);return t<60?`${t}m ${e%60}s`:`${Math.floor(t/60)}h ${t%60}m`}function sr({startedAt:e}){let[t,n]=(0,B.useState)(()=>Date.now()/1e3);return(0,B.useEffect)(()=>{let e=setInterval(()=>n(Date.now()/1e3),1e3);return()=>clearInterval(e)},[]),or(t-e)}function cr({done:e,total:t}){let n=Math.min(t,10),r=Math.min(n,Math.round(e/t*n));return(0,K.jsxs)(`span`,{className:`act-todo`,children:[(0,K.jsx)(`span`,{className:`on`,children:`●`.repeat(r)}),(0,K.jsx)(`span`,{className:`dim`,children:`○`.repeat(n-r)})]})}var lr=e=>e.ended?null:e.turn_started_at,ur=e=>!!(e.tokens>0||e.cost>0||lr(e)||e.files?.count>0);function dr({s:e,heading:t,id:n,children:r}){let i=e.ended?rr:nr[e.status]||nr.idle,a=e.files,o=ur(e),s=e=>n?`${n}-${e}`:void 0;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`row between wrap gap-12`,children:[t?(0,K.jsxs)(`div`,{className:`row gap-10 act-min`,children:[(0,K.jsx)(`span`,{className:`feed-dot act-dot ${e.ended?``:i.cls||`acc`}`}),(0,K.jsxs)(`div`,{className:`act-min`,children:[(0,K.jsx)(`h2`,{className:`act-title`,id:s(`t`),children:t}),e.cwd&&(0,K.jsx)(`div`,{className:`dim mono act-cwd`,title:e.cwd,children:e.cwd})]})]}):null,(0,K.jsxs)(`div`,{className:`row gap-8 act-fixed`,children:[e.model&&(0,K.jsx)(`span`,{className:`badge mono`,title:`model`,children:e.model}),e.agent&&(0,K.jsx)(`span`,{className:`badge`,children:e.agent}),(0,K.jsxs)(`span`,{className:`badge ${i.cls}`,id:s(`st`),children:[(0,K.jsx)(`span`,{className:`dot`}),i.label]}),r]})]}),e.phase&&(0,K.jsxs)(`div`,{className:`row gap-8 act-phase`,children:[(0,K.jsx)(q,{name:`activity`}),(0,K.jsx)(`span`,{className:`act-ell`,children:e.phase})]}),o&&(0,K.jsxs)(`div`,{className:`row wrap act-counters`,id:s(`c`),children:[e.tokens>0&&(0,K.jsxs)(`span`,{children:[ar(e.tokens),` tok`]}),e.cost>0&&(0,K.jsxs)(`span`,{children:[`$`,e.cost.toFixed(2)]}),lr(e)?(0,K.jsx)(`span`,{children:(0,K.jsx)(sr,{startedAt:e.turn_started_at})}):null,a&&a.count>0&&(0,K.jsxs)(`span`,{children:[a.count,` file`,a.count===1?``:`s`,` `,(0,K.jsxs)(`span`,{className:`t-good`,children:[`+`,a.additions]}),` `,(0,K.jsxs)(`span`,{className:`t-bad`,children:[`−`,a.deletions]})]})]}),(e.error||e.blocked_on)&&(0,K.jsx)(`div`,{className:`act-err-row`,children:(0,K.jsx)(`span`,{className:`badge bad act-ell`,title:e.error||e.blocked_on,children:e.error||e.blocked_on})})]})}var fr=e=>e?.status===`blocked`||e?.status===`waiting-input`,pr=864e5,J=e=>new Date(e).toISOString().slice(0,10),mr=(e,t)=>new Date(`${e}T00:00:00Z`).toLocaleDateString(`en-GB`,{...t,timeZone:`UTC`}),hr=e=>mr(e,{day:`numeric`,month:`short`});function gr(e,t=Date.now()){let n=mr(e,{weekday:`long`,day:`numeric`,month:`long`}),r=e===J(t)?`Today`:e===J(t-pr)?`Yesterday`:``;return r?`${r} · ${n}`:n}function _r(e,{now:t=Date.now(),days:n=14,cap:r}={}){let i=(e||[]).filter(e=>Number.isFinite(e.started)),a={};for(let e of i){let t=J(e.started*1e3);a[t]=(a[t]||0)+1}let o=i.length?J(Math.min(...i.map(e=>e.started))*1e3):null,s=i.filter(e=>e.status!==`running`).length,c=typeof r!=`number`||s>=r;return Array.from({length:n},(e,r)=>{let i=J(t-(n-1-r)*pr);return{key:i,n:a[i]||0,nodata:c&&(o===null||i<o)}})}var vr=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function yr(e,t,n,r=Date.now()){let i={},a=e=>i[e]||={key:e,runs:[],asks:[]};for(let t of Qn(e,(e||[]).length))Number.isFinite(t.started)&&a(J(t.started*1e3)).runs.push(t);return(n||[]).forEach((e,n)=>{for(let r of t||[])r.per_day?.[n]>0&&a(e).asks.push([r.name,r.per_day[n]])}),Object.values(i).sort((e,t)=>e.key<t.key?1:-1).map(({key:e,runs:t,asks:n})=>{n.sort((e,t)=>t[1]-e[1]);let i=n.reduce((e,t)=>e+t[1],0),a=n.map(([e,t],n)=>`${e}${n?``:` asked`} ${t}×`).join(`, `),o=[t.length&&vr(t.length,`run`),i&&vr(i,`gate ask`)];return{key:e,title:gr(e,r),sum:o.filter(Boolean).join(` · `),runs:t,gate:i?{title:a,n:i}:null}})}var br=500;function xr({vals:e,i:t,sweep:n=!1}){let r=(0,B.useRef)(null),i=e.join(`,`);(0,B.useLayoutEffect)(()=>{if(n&&r.current&&E())return k(r.current,{strokeDasharray:1,strokeDashoffset:1}),O(T(r.current,{strokeDashoffset:[1,0],duration:br,ease:`outExpo`}),br)},[i,n]);let a=Math.max(1,...e),o=96/(e.length-1),s=e.map((e,t)=>`${(t*o).toFixed(1)},${(20-e/a*17).toFixed(1)}`),[c,l]=s[s.length-1].split(`,`);return(0,K.jsxs)(`svg`,{className:`spark`,viewBox:`0 0 96 22`,"aria-hidden":`true`,style:{"--i":t},children:[(0,K.jsx)(`polyline`,{points:`0,21 96,21`,className:`spk-base`}),(0,K.jsx)(`polygon`,{className:`spk-area`,points:`0,21 ${s.join(` `)} 96,21`}),(0,K.jsx)(`polyline`,{className:`spk-line`,pathLength:`1`,points:s.join(` `),ref:r}),(0,K.jsx)(`circle`,{className:`spk-end`,cx:c,cy:l,r:`2.4`})]})}function Sr(e,t){let n=(0,B.useRef)(null);return(0,B.useLayoutEffect)(()=>{let e=n.current?[...n.current.querySelectorAll(`[data-sweep]`)]:[];if(e.length&&E())return k(e,{[t]:0}),O(T(e,{[t]:[0,1],duration:br,ease:`outExpo`}),br)},[e,t]),n}var Y={security:`oklch(0.74 0.085 45)`,verify:`oklch(0.78 0.075 200)`,process:`oklch(0.76 0.075 150)`,craft:`oklch(0.78 0.085 95)`,context:`oklch(0.74 0.08 280)`,comms:`oklch(0.76 0.085 345)`},Cr={security:{label:`Security`,c:Y.security},verify:{label:`Verification`,c:Y.verify},process:{label:`Process`,c:Y.process},craft:{label:`Craft`,c:Y.craft},context:{label:`Context`,c:Y.context},comms:{label:`Communication`,c:Y.comms}},wr={craft:Y.craft,rigor:Y.verify,ops:Y.process,process:Y.security,comms:Y.comms},Tr=e=>wr[e]||`var(--text-3)`,Er={design:{label:`Design`,c:Y.context},build:{label:`Build`,c:Y.craft},review:{label:`Review`,c:Y.security},ship:{label:`Ship`,c:Y.process},understand:{label:`Understand`,c:Y.verify},learn:{label:`Learn`,c:Y.comms},harness:{label:`Harness`,c:`oklch(0.76 0.07 250)`},personal:{label:`Personal`,c:`oklch(0.72 0.025 250)`}},Dr=Object.keys(Er);function Or(e){let t=String(e||``),n=/\(retired\)\s*$/i.test(t);t=t.replace(/\s*\(retired\)\s*$/i,``),t=t.replace(/^(?:Rule\s+[IVXLCDM\d]+|Doctrine\s+[a-z]+\s+\d+)\s*[—-]\s*/i,``);let r=t.indexOf(` · `);return r===-1?{latin:``,name:t.trim(),retired:n}:{latin:t.slice(0,r).trim(),name:t.slice(r+3).trim(),retired:n}}var kr=[[10,`X`],[9,`IX`],[5,`V`],[4,`IV`],[1,`I`]],Ar=e=>{let t=``;for(let[n,r]of kr)for(;e>=n;)t+=r,e-=n;return t};function jr(e){let t=/^([a-z]+)-(\d+)$/.exec(String(e));return t?t[1]===`law`?Ar(Number(t[2])):`${t[1]}.${t[2]}`:String(e)}var Mr=new Set([`I`,`III`,`IV`,`process.1`,`process.5`,`rigor.5`,`ops.2`]),Nr={I:{key:`secretsGate`,label:`Secrets gate`},III:{key:`doneGate`,label:`Done gate`},IV:{key:`deletionGate`,label:`Deletion gate`}},Pr={I:{arm:`Writes that would carry a credential-shaped string are refused again.`,off:`A write carrying a credential-shaped string (on OpenCode, also a write to a key file) stops being refused. Rule I’s text still binds the agent; protected checks, real data loss and commit/push consent stay gated.`},III:{arm:`A turn that edited files cannot end before the project’s declared checks pass.`,off:`A turn that edited files may end without the checks in .geneseed/done-checks.txt passing. Rule III’s text still binds the agent; every other gate stays.`},IV:{arm:`Commands that would lose data nothing else holds ask again.`,off:`Commands that would really lose data — discarding uncommitted work, deleting an unpushed branch, removing untracked files — stop asking. Rule IV’s text still binds the agent; secrets, root-wide scans and commit/push consent stay gated.`}},Fr=[{key:`invariants`,source:`{{LAWS}}`,against:`—`},{key:`yours`,source:`user-rules.md`,against:`may tighten a {{LAW}}, never repeal one`},{key:`ethos`,source:`{{ONTOLOGY}}`,against:`never against a user rule`},{key:`doctrines`,source:`{{DOCTRINES}}`,against:`may tighten, never repeal`}],Ir=[{source:`mode`,label:`Mode`,against:`binds how work runs`},{source:`PROFILE.md, posture, theme`,label:`Profile, posture, theme`,against:`inform only; never bind`}],Lr=(e,t={})=>Nr[e]&&t?.[Nr[e].key]===!1?`Gate off`:Mr.has(e)?`Hook gate`:`Instruction`;function Rr(e){let t={};for(let n of e||[]){let e=Er[n.klass]?n.klass:`personal`,r=t[e]||(t[e]={key:e,label:Er[e].label,ok:0,exp:0});n.status===`experimental`?r.exp+=1:r.ok+=1}let n=Dr.filter(e=>t[e]).map(e=>({...t[e],n:t[e].ok+t[e].exp}));return{rows:n,total:n.reduce((e,t)=>e+t.n,0),experimental:n.reduce((e,t)=>e+t.exp,0),max:Math.max(1,...n.map(e=>e.n))}}var X=(e,t,n=t+`s`)=>`${e} ${e===1?t:n}`;function zr({overview:e,setup:t,rules:n,activity:r,profile:i,skills:a,laws:o}){let s=[],c=e?.doctor;c&&!c.ok&&s.push({id:`doctor`,tag:`Doctor`,tone:`bad`,title:`Doctor found ${X(c.problems.length,`problem`)}`,detail:c.problems[0]||``,where:`installs/doctor`,verb:`Review`,href:`#/installs/doctor`});let l=e?.diff,u=G(l);u&&s.push({id:`drift`,tag:`Drift`,tone:`warn`,title:`${X(u,`file`)} drifted from the source`,detail:`${l.edited} edited, ${l.added} added, ${l.missing} missing`,where:`installs/edits`,verb:`Review`,href:`#/installs/edits`}),i?.seeded&&s.push({id:`profile`,tag:`Profile`,tone:`warn`,title:`Profile is still the seeded template`,detail:`every section holds placeholder text`,where:`personal/profile`,verb:`Fill in`,href:`#/personal/profile`});let d=n?.exists?n.stats:null;d&&d.rules===0&&s.push({id:`rules`,tag:`Rules`,tone:``,title:`No standing rules yet`,detail:`0 of ${d.max_rules} · ${d.tokens} of ${d.max_tokens} tokens`,where:`personal/rules`,verb:`Write a rule`,href:`#/personal/rules`});let f=Object.entries(t?.gates?.asks||{}).sort((e,t)=>t[1]-e[1]);if(f.length){let[e,n]=f[0],r=jr(e),i=(o?.items||[]).find(e=>e.name===r),a=i?Or(i.title).name:r;s.push({id:`gates`,tag:`Gates`,tone:``,title:`${a} asked ${X(n,`time`)}`,detail:`${n} of ${t.gates.total} gate asks`,where:r,verb:`Review`,href:`#/item/law/${encodeURIComponent(r)}`})}if(a){let{rows:e,experimental:t}=Rr(a.items);t&&s.push({id:`skills`,tag:`Skills`,tone:``,title:`${X(t,`skill`)} still experimental`,detail:e.filter(e=>e.exp).sort((e,t)=>t.exp-e.exp).map(e=>`${e.label.toLowerCase()} ${e.exp}`).join(`, `),where:`library/skills`,verb:`Triage`,href:`#/skills`})}return t&&t.facts===0&&s.push({id:`memory`,tag:`Memory`,tone:``,title:`Memory holds no facts`,detail:`MEMORY.md is an empty index`,where:`library/memory`,verb:`Open`,href:`#/section/memory`}),r&&r.enabled===!1&&s.push({id:`activity`,tag:`Activity`,tone:``,title:`Session tracking is off`,detail:`no per-session trace is kept`,where:`activity`,verb:`Turn on`,href:`#/activity`}),s}var Br=e=>G(e.drift),Vr=e=>e.drift?.stale??0;function Hr(e){let t=t=>new Set((e?.never||[]).filter(e=>e.kind===t).map(e=>e.name)).size;return{skills:t(`skill`),agents:t(`agent`)}}function Ur(e){let t=e?.installs||[],n=t.filter(e=>e.state===`active`),r=t.length-n.length,i=n.filter(e=>e.verdict===`behind`).length,a=n.reduce((e,t)=>e+Br(t),0),o=n.reduce((e,t)=>e+Vr(t),0),s=e?.doctor,c=s&&!s.ok?`bad`:i||a||o?`warn`:`good`,l={good:`Harness healthy.`,warn:`Harness needs a look.`,bad:`Harness has problems.`}[c],u=[X(n.length,`active install`)+(r?`, ${r} disabled`:``),s?s.ok?`doctor clean`:`doctor found ${X(s.problems.length,`problem`)}`:`doctor not run yet`,i?`${X(i,`install`)} behind source`:`all in step with source`,a?`${X(a,`file`)} hand-edited`:`no hand edits`];return o&&u.push(`${X(o,`file`)} behind source`),{tone:c,head:l,facts:u}}var Wr=[[`carrier`,`Root file`],[`skills`,`Skill list`],[`agents`,`Agent list`],[`context`,`Session files`]],Gr=e=>e?e.carrier+e.skills+e.agents+e.context:0,Kr=e=>e.state===`active`&&(e.verdict===`behind`||G(e.drift)>0||(e.drift?.stale??0)>0),Z=e=>`≈${(e/4/1e3).toFixed(1)}k`,qr=e=>`${e.host} · ${e.scope}`,Jr=e=>({id:e.id,host:e.host,path:e.path,label:qr(e)});function Yr({fleet:e,usage:t,...n}){let r=[],i=e?.doctor;i&&!i.ok&&r.push({id:`doctor`,tag:`Doctor`,tone:`bad`,title:`Doctor found ${X(i.problems.length,`problem`)}`,detail:i.problems[0]||``,where:`installs/doctor`,verb:`Review`,href:`#/installs/doctor`});for(let t of(e?.installs||[]).filter(e=>e.state===`active`)){if(t.verdict===`behind`){let e=t.built_epoch?`built ${kt(t.built_epoch)} ago`:`never built`,n=Vr(t);r.push({id:`behind:${t.id}`,tag:`Behind`,tone:`warn`,title:`${qr(t)} is behind its source`,detail:n?`${e} · ${X(n,`file`)} behind`:e,where:t.host,verb:`Rebuild`,act:`rebuild`,installs:[Jr(t)]})}let e=Br(t);e&&r.push({id:`drift:${t.id}`,tag:`Drift`,tone:`warn`,title:`${qr(t)}: ${X(e,`file`)} edited by hand`,detail:`${t.drift.edited} edited, ${t.drift.added} added, ${t.drift.missing} missing`,where:`installs/edits`,verb:`Review`,href:`#/installs/edits`})}if(t&&t.days_counted>=30&&t.never?.length){let{skills:e,agents:n}=Hr(t);r.push({id:`usage`,tag:`Usage`,tone:``,sugg:!0,title:`${X(e,`skill`)} never fired in 30 days`,detail:`${X(n,`agent`)} too`,where:`library/skills`,verb:`Triage`,href:`#/skills`})}let a=zr({...n,overview:n.overview&&{...n.overview,doctor:null,diff:null}});for(let e of a)r.push({...e,sugg:!0});return r}function Xr(e,t){return(e?.rules||[]).map(e=>{let n=jr(e.rule),r=(t?.items||[]).find(e=>e.name===n);return{...e,name:r?Or(r.title).name:e.rule===`wiki`?`Wiki guard`:n}})}var Zr=e=>(e||[]).filter(e=>e.state===`active`&&e.cost);function Qr(e){let t=Zr(e).filter(e=>e.cost.ceiling>0&&Number.isFinite(e.cost.carrier)),n=e=>e.cost.carrier/e.cost.ceiling,r=t.find(e=>e.selected)||t.reduce((e,t)=>!e||n(t)>n(e)?t:e,null);if(!r)return null;let{carrier:i,ceiling:a}=r.cost;return{label:`${r.host} · ${r.scope}`,carrier:i,ceiling:a,pct:Math.round(n(r)*100),selected:!!r.selected}}function $r(e){let t=Zr(e);if(!t.length)return null;let n=t.reduce((e,t)=>Gr(t.cost)>Gr(e.cost)?t:e),r=t.map(e=>Gr(e.cost)),i=t.find(e=>e.selected)||n;return{min:Math.min(...r),max:Math.max(...r),top:n,shown:i}}var ei=e=>(e?.per_day||[]).reduce((e,t)=>e+t,0);function ti(e,t){let n=Xr(e,t),r=n.reduce((e,t)=>e+t.n,0),i=n.reduce((e,t)=>!e||t.n>e.n?t:e,null),a=[];for(let e of n)(e.per_day||[]).forEach((e,t)=>{a[t]=(a[t]||0)+e});return{total:r,top:i?{name:i.name,n:i.n}:null,perDay:a}}var Q=e=>e.catch(()=>null),ni=(e,t)=>`${t?Math.min(100,e/t*100):0}%`,ri=36e5;function ii({update:e,onAction:t,canFill:n=!0}){if(!e)return null;let r=e.install??(e.git?`git`:`npm-global`),i=r===`git`&&typeof e.behind==`number`?e.behind:null,a=i===null?e.latest===null?(0,K.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current??``,` · update check unavailable`]}):e.available?(0,K.jsxs)(`span`,{className:`mono ver-chip`,children:[e.current,` `,(0,K.jsxs)(`span`,{className:`ver-new`,children:[e.latest,` available`]})]}):(0,K.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current,` · latest`]}):i>0?(0,K.jsxs)(`span`,{className:`mono ver-chip`,children:[e.current??``,` `,(0,K.jsxs)(`span`,{className:`ver-new`,children:[i,` commit`,i===1?``:`s`,` to pull`]})]}):(0,K.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current??``,` · up to date`]});if(r===`other`)return!e.available||!e.command?a:(0,K.jsxs)(K.Fragment,{children:[a,(0,K.jsxs)(`span`,{className:`dim`,children:[`update with `,(0,K.jsx)(`code`,{className:`mono`,children:e.command})]})]});if(r!==`git`&&!e.available)return a;let o=i===null?!!e.available:i>0;return(0,K.jsxs)(K.Fragment,{children:[a,(0,K.jsx)(`button`,{type:`button`,className:o&&n?`btn`:`btn ghost`,title:r===`git`?i===0?`Nothing to pull: up to date with upstream. Pulls and rebuilds every install anyway.`:`git pull, then rebuild every install`:`npm install -g geneseed@latest, then rebuild every install`,onClick:()=>t(`update`),children:`Update`})]})}var ai={good:`M8 12.5l2.7 2.7L16 9.5M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18z`,warn:`M12 3 22 20H2zM12 10v4M12 17v.5`,bad:`M9 9l6 6M15 9l-6 6M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18z`};function oi({tone:e}){return(0,K.jsx)(`svg`,{className:`health-ico`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,K.jsx)(`path`,{d:ai[e]||ai.warn})})}function si({fleet:e,error:t,behind:n,onAction:r,onRebuild:i}){let a=(0,K.jsx)(`button`,{type:`button`,className:`btn ghost ldg-doctor`,onClick:()=>r(`doctor`),children:`Run doctor`});if(!e)return t?(0,K.jsxs)(`section`,{className:`health unknown`,"aria-labelledby":`ldg-health`,children:[(0,K.jsx)(oi,{tone:`warn`}),(0,K.jsx)(`div`,{className:`health-text`,role:`status`,children:(0,K.jsx)(`h2`,{id:`ldg-health`,children:`Status unknown`})}),(0,K.jsx)(`div`,{className:`health-acts`,children:a})]}):(0,K.jsx)(`div`,{className:`health unknown`,"aria-busy":`true`});let o=Ur(e),s=[...o.facts,...e.version?[`Source is ${e.version}`]:[]];return(0,K.jsxs)(`section`,{className:`health ${o.tone}`,"aria-labelledby":`ldg-health`,children:[(0,K.jsx)(oi,{tone:o.tone}),(0,K.jsxs)(`div`,{className:`health-text`,role:`status`,children:[(0,K.jsx)(`h2`,{id:`ldg-health`,children:o.head}),(0,K.jsxs)(`p`,{className:`health-facts`,children:[s.join(` · `),`.`]})]}),(0,K.jsxs)(`div`,{className:`health-acts`,children:[a,n.length?(0,K.jsxs)(`button`,{type:`button`,className:`btn`,title:`Rebuilds ${n.map(e=>e.label).join(`, `)}`,onClick:()=>i(n),children:[`Rebuild all behind (`,n.length,`)`]}):null]})]})}function ci({chars:e}){let t=C(e);return(0,K.jsxs)(`span`,{className:`mono`,children:[Z(t??e),` tok`]})}var li=e=>Math.round(e/4),ui={carrier:`accent`,skills:`skill`,agents:`agent`,context:`context`},di=e=>Wr.map(([t,n])=>({key:t,label:n,n:li(e[t]),tone:ui[t]})),fi=e=>`${e.host} · ${e.scope}`;function pi({cost:e,i:t}){let n=2*Math.PI*14,r=e.ceiling?Math.min(1,e.carrier/e.ceiling):0;return(0,K.jsxs)(`svg`,{className:`ldg-ring`,viewBox:`0 0 36 36`,"aria-hidden":`true`,children:[(0,K.jsx)(`circle`,{className:`bg`,cx:`18`,cy:`18`,r:14}),(0,K.jsx)(`circle`,{className:`fg`+(e.ceiling&&e.carrier>e.ceiling?` over`:``),cx:`18`,cy:`18`,r:14,strokeDasharray:n.toFixed(2),strokeDashoffset:(n*(1-r)).toFixed(2),style:{"--circ":n.toFixed(2),"--i":t}})]})}function mi({id:e,title:t,aside:n,className:r=``,children:i}){return(0,K.jsxs)(`section`,{className:`panel ldg-kpi ${r}`,"aria-labelledby":e,children:[(0,K.jsxs)(`div`,{className:`ldg-kpi-head`,children:[(0,K.jsx)(`h3`,{id:e,children:t}),n]}),i]})}function hi({installs:e}){let t=Qr(e);return(0,K.jsx)(mi,{id:`ldg-k-root`,title:`Root file vs ceiling`,className:`ldg-kpi-root`,children:t?(0,K.jsxs)(`div`,{className:`ldg-kpi-ring`,children:[(0,K.jsxs)(`span`,{className:`ldg-ringbox`,children:[(0,K.jsx)(Kn,{value:li(t.carrier),max:li(t.ceiling),segments:t.pct>100?[{key:`v`,label:`root file`,n:li(t.carrier),tone:`bad`}]:void 0,size:64,stroke:7,label:`${t.selected?`Root file`:`Worst root file`}: ${t.label}, ${t.pct} percent of its ceiling`}),(0,K.jsxs)(`span`,{className:`mono ldg-ring-pct`,"aria-hidden":`true`,children:[t.pct,`%`]})]}),(0,K.jsxs)(`span`,{className:`ldg-kpi-stack`,children:[(0,K.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:`${Z(t.carrier)} / ${Z(t.ceiling)} tokens`}),(0,K.jsx)(`span`,{className:`dim`,children:t.label})]})]}):(0,K.jsx)(`p`,{className:`dim`,children:`No root file to measure.`})})}function gi({installs:e}){let t=$r(e),n=t&&(Z(t.min)===Z(t.max)?Z(t.max):`${Z(t.min)} – ${Z(t.max)}`);return(0,K.jsx)(mi,{id:`ldg-k-cost`,title:`Loaded every turn`,className:`ldg-kpi-cost`,children:t?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`span`,{className:`ldg-kpi-stack`,children:[(0,K.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:`${Z(Gr(t.shown.cost))} tokens`}),(0,K.jsx)(`span`,{className:`dim`,children:fi(t.shown)})]}),(0,K.jsx)(Jn,{parts:di(t.shown.cost),label:`Loaded every turn, ${fi(t.shown)}`}),(0,K.jsx)(`span`,{className:`dim ldg-kpi-cap`,children:`All installs: ${n} tokens`})]}):(0,K.jsx)(`p`,{className:`dim`,children:`No install has a root file to measure.`})})}function _i({usage:e}){let t=e?.enabled?e.days_counted<30&&e.since?`since ${e.since}`:`30 days`:null;return(0,K.jsx)(mi,{id:`ldg-k-calls`,title:`Skill and agent calls`,className:`ldg-kpi-calls`,aside:t?(0,K.jsx)(`span`,{className:`mono dim ldg-kpi-aside`,children:t}):null,children:e?e.enabled?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:(0,K.jsx)(A,{value:ei(e)})}),e.per_day?.length>1?(0,K.jsx)(xr,{vals:e.per_day,i:0}):null]}):(0,K.jsx)(`p`,{className:`dim`,children:`Usage counting is off on this machine.`}):(0,K.jsx)(`p`,{className:`dim`,children:`Usage could not be read.`})})}function vi({gates:e,laws:t}){let n=ti(e,t);return(0,K.jsx)(mi,{id:`ldg-k-gates`,title:`Gate asks · 30 days`,className:`ldg-kpi-gates`,aside:(0,K.jsx)(`a`,{className:`ldg-kpi-aside`,href:`#/laws`,"aria-label":`Open the Constitution`,children:`Constitution →`}),children:e?n.total?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`span`,{className:`ldg-kpi-line`,children:[(0,K.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:n.total}),` `,(0,K.jsx)(`span`,{className:`dim`,children:`· ${n.top.name} ${n.top.n}`})]}),n.perDay.length>1?(0,K.jsx)(xr,{vals:n.perDay,i:1}):null]}):(0,K.jsx)(`p`,{className:`dim`,children:`No gate asked in 30 days.`}):(0,K.jsx)(`p`,{className:`dim`,children:`Gate activity could not be read.`})})}var yi=6;function bi({i:e}){if(!e.diffable)return(0,K.jsx)(`span`,{className:`dim`,title:`Drift is only checked for global installs`,children:`not checkable`});let t=G(e.drift),n=e.drift?.stale??0;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`ldg-syncbar`,children:(0,K.jsx)(Jn,{parts:[{key:`stale`,label:`Behind source`,n,tone:`warn`},{key:`edited`,label:`Edited by hand`,n:t,tone:`bad`}],label:`Sync with source, ${fi(e)}`,legend:!1})}),t?(0,K.jsxs)(`span`,{className:`mono t-bad`,children:[t,` edited`]}):e.drift?.linked?(0,K.jsxs)(`span`,{className:`mono dim`,title:`Yours: links Geneseed leaves alone`,children:[e.drift.linked,` linked`]}):(0,K.jsx)(`span`,{className:`mono dim`,children:`none`}),n?(0,K.jsxs)(`div`,{className:`mono dim ldg-sub`,children:[n,` file`,n===1?``:`s`,` behind`]}):null]})}function xi(e){if(!e.diffable)return`Not checkable: drift is only checked for global installs.`;let t=e.drift||{},n=[t.stale?`${t.stale} behind`:null,t.edited?`${t.edited} edited`:null,t.added?`${t.added} added`:null,t.missing?`${t.missing} missing`:null,t.linked?`${t.linked} linked (yours)`:null].filter(Boolean);return n.length?n.join(` · `):`Nothing differs.`}function Si({i:e,n:t,onRebuild:n,onOpen:r,busy:i}){let[a,o]=(0,B.useState)(!1),s=fi(e),c=(0,K.jsxs)(`td`,{className:`ldg-where`,children:[i?(0,K.jsx)(`span`,{className:`console-progress`,role:`progressbar`,"aria-label":`Rebuilding ${s}`}):null,(0,K.jsxs)(`div`,{className:`ldg-who`,children:[Kr(e)?(0,K.jsx)(`svg`,{className:`ldg-glyph ${G(e.drift)?`bad`:`warn`}`,viewBox:`0 0 10 10`,role:`img`,"aria-label":G(e.drift)?`edited by hand`:`needs a rebuild`,children:(0,K.jsx)(`path`,{d:`M5 1 9 9H1z`,fill:`currentColor`})}):null,e.state===`active`&&e.cost?(0,K.jsx)(`span`,{className:`ldg-phone-ring`,"aria-hidden":`true`,children:(0,K.jsx)(pi,{cost:e.cost,i:t})}):null,(0,K.jsxs)(`div`,{className:`ldg-name`,children:[(0,K.jsx)(`span`,{className:`ldg-host`,children:e.host}),` `,(0,K.jsx)(`span`,{className:`dim`,children:e.scope}),(0,K.jsx)(`div`,{className:`mono dim ldg-path`,children:e.path})]})]})]});if(e.state!==`active`)return(0,K.jsxs)(`tr`,{className:`ldg-off`,children:[c,(0,K.jsx)(`td`,{className:`ldg-build`,children:(0,K.jsx)(`span`,{className:`pill off`,children:`disabled`})}),(0,K.jsx)(`td`,{className:`ldg-sync`}),(0,K.jsx)(`td`,{className:`ldg-root`}),(0,K.jsx)(`td`,{className:`ldg-total`}),(0,K.jsx)(`td`,{className:`ldg-act`,children:(0,K.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Open ${s}`,onClick:()=>r(e),children:`Open`})})]});let l={synced:(0,K.jsx)(`span`,{className:`pill good`,children:`in step`}),behind:(0,K.jsx)(`span`,{className:`pill warn`,children:`behind source`}),unknown:(0,K.jsx)(`span`,{className:`pill off`,children:`not checked`})}[e.verdict],u=Gr(e.cost),d=e.cost?.ceiling?Math.round(e.cost.carrier/e.cost.ceiling*100):null;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`tr`,{className:a?`ldg-open`:``,children:[c,(0,K.jsxs)(`td`,{className:`ldg-build`,children:[l,(0,K.jsx)(`div`,{className:`mono dim ldg-sub`,children:e.built_epoch?`built ${kt(e.built_epoch)} ago`:`never built`})]}),(0,K.jsx)(`td`,{className:`ldg-sync`,children:(0,K.jsx)(bi,{i:e})}),(0,K.jsx)(`td`,{className:`ldg-root`,children:e.cost?d===null?(0,K.jsx)(`span`,{className:`dim`,children:`no ceiling`}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`ldg-rootbar`,children:(0,K.jsx)(Yn,{value:li(e.cost.carrier),max:li(e.cost.ceiling),label:`Root file, ${s}`,tone:d>100?`bad`:`accent`})}),(0,K.jsx)(`span`,{className:`mono dim ldg-sub`,children:`${Z(e.cost.carrier)} / ${Z(e.cost.ceiling)} · ${d}%`})]}):(0,K.jsx)(`span`,{className:`dim`,children:`not measured`})}),(0,K.jsx)(`td`,{className:`ldg-total`,children:e.cost?(0,K.jsx)(ci,{chars:u}):null}),(0,K.jsxs)(`td`,{className:`ldg-act`,children:[Kr(e)?(0,K.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Rebuild ${s}`,title:`Rebuilds ${s} only`,onClick:()=>n([Jr(e)]),children:`Rebuild`}):(0,K.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Open ${s}`,onClick:()=>r(e),children:`Open`}),(0,K.jsx)(`button`,{type:`button`,className:`btn ghost sm ldg-toggle`,"aria-label":`Details for ${s}`,"aria-expanded":a,"aria-controls":a?`ldg-detail-${e.id}`:void 0,onClick:()=>o(e=>!e),children:(0,K.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`,children:(0,K.jsx)(`path`,{d:a?`M6 15l6-6 6 6`:`M6 9l6 6 6-6`})})})]})]}),a?(0,K.jsx)(`tr`,{className:`ldg-detail`,id:`ldg-detail-${e.id}`,children:(0,K.jsx)(`td`,{colSpan:yi,children:(0,K.jsxs)(`div`,{className:`ldg-detail-grid`,children:[(0,K.jsxs)(`div`,{className:`ldg-detail-col`,children:[e.cost?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`ldg-lbl`,children:`What rides every turn · ${Z(u)} tokens`}),(0,K.jsx)(Jn,{parts:di(e.cost),label:s})]}):(0,K.jsx)(`span`,{className:`dim`,children:`Always-on cost not measured.`}),(0,K.jsx)(`span`,{className:`dim`,children:`Voice ${e.theme} · ${e.footprint} footprint`})]}),(0,K.jsxs)(`div`,{className:`ldg-detail-col`,children:[(0,K.jsx)(`span`,{className:`ldg-lbl`,children:`Differs from source`}),(0,K.jsx)(`span`,{className:`muted`,children:xi(e)}),e.diffable?(0,K.jsx)(`span`,{children:(0,K.jsx)(`a`,{className:`btn ghost sm`,href:`#/installs/edits`,"aria-label":`View diff for ${s}`,children:`View diff`})}):null]})]})})}):null]})}function Ci({rows:e,onAction:t,onRebuild:n}){let r=e.filter(e=>!e.sugg).length;return(0,K.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-needs`,children:[(0,K.jsxs)(`div`,{className:`panel-head panel-head-rule`,children:[(0,K.jsx)(`h2`,{id:`ldg-needs`,children:`Needs you`}),(0,K.jsxs)(`span`,{className:`mono dim`,children:[r,` problem`,r===1?``:`s`,`, `,e.length-r,` suggestion`,e.length-r===1?``:`s`]})]}),e.length?(0,K.jsx)(`ul`,{className:`needs`,children:e.map(e=>(0,K.jsxs)(`li`,{className:e.sugg?`sugg`:``,children:[(0,K.jsx)(`span`,{className:`tag ${e.tone}`,children:e.tag}),(0,K.jsxs)(`span`,{className:`needs-what`,children:[(0,K.jsx)(`b`,{children:e.title}),e.detail?(0,K.jsxs)(`span`,{className:`dim`,children:[` · `,e.detail]}):null]}),(0,K.jsx)(`span`,{className:`mono dim needs-where`,children:e.where}),e.act?(0,K.jsx)(`button`,{type:`button`,className:`needs-verb linkish`,"aria-label":`${e.verb}: ${e.title}`,onClick:()=>e.installs?n(e.installs):t(e.act),children:e.verb}):(0,K.jsx)(`a`,{className:`needs-verb`,href:e.href,"aria-label":`${e.verb}: ${e.title}`,children:e.verb})]},e.id))}):(0,K.jsx)(`p`,{className:`needs-empty`,children:`Nothing needs you.`})]})}function wi({usage:e}){let t=(0,K.jsxs)(`div`,{className:`panel-head`,children:[(0,K.jsx)(`h2`,{id:`ldg-usage`,children:`What fires`}),(0,K.jsx)(`span`,{className:`mono dim`,children:`skills and agents, 30 d`})]});if(!e)return(0,K.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[t,(0,K.jsx)(`p`,{className:`dim`,children:`Usage could not be read.`})]});if(!e.enabled)return(0,K.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[t,(0,K.jsx)(`p`,{className:`dim`,children:`Usage counting is off on this machine.`})]});if(e.days_counted<30)return(0,K.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[t,(0,K.jsx)(`p`,{className:`muted`,children:e.since?(0,K.jsxs)(K.Fragment,{children:[`Counting since `,(0,K.jsx)(`b`,{children:e.since}),`, `,e.days_counted,` of 30 days`]}):`No skill or agent call counted yet`}),(0,K.jsx)(`div`,{className:`daytrack`,"aria-hidden":`true`,children:Array.from({length:30},(t,n)=>(0,K.jsx)(`i`,{className:n<e.days_counted?`on`:``},n))}),(0,K.jsx)(`p`,{className:`dim chart-foot`,children:`Rankings and the never-fired count appear once 30 days are counted, so a new install is not told every skill is unused.`})]});let n=e.rows.slice(0,7),r=Math.max(1,...n.map(e=>e.n));return(0,K.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[t,(0,K.jsx)(`ul`,{className:`ubars`,children:n.map((e,t)=>(0,K.jsxs)(`li`,{className:e.kind,children:[(0,K.jsxs)(`span`,{className:`ub-name`,children:[e.name,` `,(0,K.jsx)(`span`,{className:`dim`,children:e.kind})]}),(0,K.jsx)(`span`,{className:`ub-trk`,children:(0,K.jsx)(`i`,{style:{width:ni(e.n,r),"--i":t}})}),(0,K.jsx)(`span`,{className:`mono`,children:e.n})]},`${e.install}:${e.kind}:${e.name}`))}),e.never.length?(0,K.jsxs)(`div`,{className:`ub-never`,children:[(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`b`,{children:Hr(e).skills}),` skills never fired`]}),(0,K.jsx)(`a`,{className:`needs-verb`,href:`#/skills`,children:`Triage`})]}):null]})}function Ti({overview:e,setup:t,runs:n,onAction:r,onRetry:i,dataRev:o,banner:s,view:c}){let l=on(),[u,d]=(0,B.useState)({}),{data:f,error:p,reload:m}=U(()=>a.fleet(),[o]),{data:h}=U(()=>Q(a.usage()),[o]),{data:g}=U(()=>Q(a.gates()),[o]),_=(0,B.useRef)(null),{data:v,reload:y}=U(()=>Q(a.update()).then(e=>(e&&(_.current=e),_.current)),[o]);(0,B.useEffect)(()=>{let e=setInterval(y,ri),t=()=>{document.visibilityState===`visible`&&y()};return document.addEventListener(`visibilitychange`,t),()=>{clearInterval(e),document.removeEventListener(`visibilitychange`,t)}},[y]);let{data:b}=Wn(o),{data:x}=U(()=>Q(a.activity()),[o]),{data:S}=U(()=>Q(a.profile()),[o]),{data:C}=U(()=>Q(a.catalog(`skills`)),[o],`catalog:skills`),{data:w}=U(()=>Q(a.catalog(`laws`)),[o],`catalog:laws`),T=f?.installs||[],E=async e=>{try{await a.selectView(e.host,e.path)}catch{}i?.(),window.location.hash=`#/installs`},D=Yr({fleet:f,usage:h,overview:e,setup:t,rules:b,activity:x,profile:S,skills:C,laws:w}),O=T.filter(Kr).map(Jr),k=async e=>{let t=e.map(e=>e.label);if(!await l(`Rebuild ${t.join(`, `)}? Each is re-rendered from source with its own settings.`,{title:e.length===1?`Rebuild ${t[0]}?`:`Rebuild ${e.length} installs?`,confirmLabel:`Rebuild`}))return;let n=await r(`rebuild`,{installs:e.map(({host:e,path:t})=>({host:e,path:t}))});n&&d(t=>({...t,[n]:e.map(e=>e.id)}))},A=new Set(Object.entries(u).filter(([e])=>n?.find(t=>t.id===e)?.status===`running`).flatMap(([,e])=>e));return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Vn,{eyebrow:f?`${T.length} harness${T.length===1?``:`es`} installed on this machine`:null,title:`Overview`,actions:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(ii,{update:v,onAction:r,canFill:!O.length}),c]})}),s,(0,K.jsxs)(`div`,{className:`ov-stack ldg`,children:[(0,K.jsx)(si,{fleet:f,error:p,behind:O,onAction:r,onRebuild:k}),(0,K.jsxs)(`div`,{className:`ldg-kpis`,role:`group`,"aria-labelledby":`ldg-kpis-h`,children:[(0,K.jsx)(`h2`,{id:`ldg-kpis-h`,className:`sr-only`,children:`Key figures`}),(0,K.jsx)(hi,{installs:T}),(0,K.jsx)(gi,{installs:T}),(0,K.jsx)(_i,{usage:h}),(0,K.jsx)(vi,{gates:g,laws:w})]}),(0,K.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-fleet`,children:[(0,K.jsxs)(`div`,{className:`panel-head panel-head-rule`,children:[(0,K.jsx)(`h2`,{id:`ldg-fleet`,children:`Installed harnesses`}),f?.source_fp?(0,K.jsxs)(`span`,{className:`mono dim`,children:[`source `,f.source_fp]}):null]}),p&&f?(0,K.jsxs)(`p`,{className:`dim`,role:`status`,children:[`Could not refresh the installs — showing the last read.`,` `,(0,K.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:m,children:`Retry`})]}):null,(0,K.jsx)(`div`,{className:`ldg-scroll`,children:(0,K.jsxs)(`table`,{className:`ldg-fleet`,children:[(0,K.jsx)(`caption`,{className:`sr-only`,children:`Installs`}),(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{scope:`col`,children:`Install`}),(0,K.jsx)(`th`,{scope:`col`,className:`ldg-build`,children:`Build`}),(0,K.jsx)(`th`,{scope:`col`,className:`ldg-sync`,children:`Sync with source`}),(0,K.jsx)(`th`,{scope:`col`,className:`ldg-root`,children:`Root file · ceiling`}),(0,K.jsx)(`th`,{scope:`col`,className:`ldg-total`,children:`Always-on`}),(0,K.jsx)(`th`,{scope:`col`,children:(0,K.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,K.jsxs)(`tbody`,{children:[p&&!f?(0,K.jsx)(`tr`,{children:(0,K.jsxs)(`td`,{colSpan:yi,children:[(0,K.jsx)(`span`,{className:`dim`,role:`status`,children:`Could not read the installs`}),` `,(0,K.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:m,children:`Retry`})]})}):null,T.map((e,t)=>(0,K.jsx)(Si,{i:e,n:t,onRebuild:k,onOpen:E,busy:A.has(e.id)},e.id))]})]})})]}),(0,K.jsxs)(`div`,{className:`ldg-bottom`,children:[(0,K.jsx)(Ci,{rows:D,onAction:r,onRebuild:k}),(0,K.jsx)(wi,{usage:h})]})]})]})}var Ei=`geneseed-understand-seen`,Di=`understand`;function Oi(){try{let e=JSON.parse(localStorage.getItem(Ei));return Array.isArray(e)?e:[]}catch{return[]}}function ki(e){let t=Oi();if(t.includes(e))return t;let n=[...t,e];try{localStorage.setItem(Ei,JSON.stringify(n))}catch{}return n}function Ai(e,t){let n=e?.groups||[],r=n.findIndex(e=>e.id===Di),i=n[r]?.pages||[],a=i.findIndex(e=>e.id===t);if(a<0)return{prev:null,next:null};let o=n.slice(r+1).find(e=>e.pages.length);return{prev:i[a-1]||null,next:i[a+1]||o?.pages[0]||null}}function ji(e,t){for(let n of e?.groups||[]){let e=n.pages.find(e=>e.id===t);if(e)return{part:n,section:e.section||`General`,page:e}}return{part:null,section:null,page:null}}function Mi(e,t){let{part:n,section:r}=ji(e,t);if(!n)return{prev:null,next:null};if(n.id===`understand`)return Ai(e,t);let i=n.pages.filter(e=>(e.section||`General`)===r),a=i.findIndex(e=>e.id===t);return{prev:i[a-1]||null,next:i[a+1]||null}}var Ni=e=>`#/docs/`+encodeURIComponent(e);function Pi({pages:e,seen:t}){let n=e.filter(e=>t.includes(e.id)).length;return(0,K.jsx)(`div`,{className:`track-prog`,role:`progressbar`,"aria-label":`Pages read`,"aria-valuemin":0,"aria-valuemax":e.length,"aria-valuenow":n,children:(0,K.jsx)(`i`,{style:{width:`${n/(e.length||1)*100}%`}})})}function Fi({menu:e,pageId:t}){let{prev:n,next:r}=Mi(e,t);return!n&&!r?null:(0,K.jsxs)(`nav`,{className:`track-bar`,"aria-label":`Pages`,children:[n?(0,K.jsxs)(`a`,{className:`track-card`,href:Ni(n.id),children:[(0,K.jsx)(`span`,{className:`track-card-lbl`,"aria-hidden":`true`,children:`Previous`}),(0,K.jsxs)(`span`,{className:`track-card-title`,children:[`← `,n.title]})]}):(0,K.jsx)(`span`,{}),r&&(0,K.jsxs)(`a`,{className:`track-card next`,href:Ni(r.id),children:[(0,K.jsx)(`span`,{className:`track-card-lbl`,"aria-hidden":`true`,children:`Next`}),(0,K.jsxs)(`span`,{className:`track-card-title`,children:[`Next: `,r.title,` →`]})]})]})}var Ii=`modulepreload`,Li=function(e){return`/`+e},Ri={},zi=function(e){return e.pathname.endsWith(`.css`)},Bi=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},$=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Li(t,n);let r=s(t),i=zi(r);return Bi(Ri,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Ii,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Vi=`geneseed-newhere-dismissed`,Hi=(0,B.lazy)(()=>$(()=>import(`./Dashboard-gYZLE4r3.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5])));function Ui({harness:e}){let[t,n]=(0,B.useState)(()=>!!localStorage.getItem(Vi)),{data:r}=U(()=>t?Promise.resolve(null):a.docs(e).catch(()=>null),[t,e]),i=r?.groups?.find(e=>e.id===`understand`)?.pages||[],o=Oi(),s=i.findIndex(e=>!o.includes(e.id));if(t||!i.length||s<0)return null;let c=i.filter(e=>o.includes(e.id)).length;return(0,K.jsxs)(`section`,{className:`newhere`,"aria-label":`New here?`,children:[(0,K.jsxs)(`div`,{className:`newhere-body`,children:[(0,K.jsx)(`b`,{children:`New here? Understand your harness.`}),(0,K.jsxs)(`p`,{children:[i.length,` short pages: what a harness is, what was installed, what changes in your day, and what is guaranteed.`]}),(0,K.jsx)(`div`,{className:`newhere-dots`,"aria-label":`${c} of ${i.length} read`,children:i.map(e=>(0,K.jsx)(`i`,{className:o.includes(e.id)?`f`:``},e.id))})]}),(0,K.jsx)(`a`,{className:`btn ghost`,href:`#/docs/${encodeURIComponent(i[s].id)}`,children:c?`Continue · step ${s+1}`:`Start`}),(0,K.jsx)(`button`,{type:`button`,className:`newhere-x`,onClick:()=>{localStorage.setItem(Vi,`1`),n(!0)},title:`Dismiss for good`,"aria-label":`Dismiss`,children:`×`})]})}function Wi({layout:e,onLayout:t}){return(0,K.jsx)(_n,{"aria-label":`View`,children:gt.map(n=>(0,K.jsx)(`button`,{type:`button`,className:e===n.id?`on`:``,"aria-pressed":e===n.id,title:n.tagline,onClick:()=>t(n.id),children:n.short},n.id))})}function Gi({overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:a,onAction:o,layout:s=`overview`,onLayout:c,dataRev:l}){if(!e)return t?(0,K.jsx)(An,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,K.jsx)(kn,{});if(!e.deployed)return(0,K.jsx)(Un,{onAction:o});let u=(0,K.jsx)(Ui,{harness:$t(e.emit)}),d=c?(0,K.jsx)(Wi,{layout:s,onLayout:c}):null;return s===`overview`?(0,K.jsx)(Ti,{overview:e,setup:i,runs:a,onAction:o,onRetry:n,dataRev:l,view:d,banner:(0,K.jsxs)(K.Fragment,{children:[e.daemon_stale?(0,K.jsx)(jn,{}):null,u]})}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Vn,{title:`Overview`,sub:[e.theme&&`${e.theme} voice`,e.footprint&&`${e.footprint} footprint`,e.target].filter(Boolean).join(` · `),primary:(0,K.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>o(`build-all`),children:`Rebuild`}),actions:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>o(`update`),children:`Update`}),(0,K.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>o(`doctor`),children:`Run doctor`}),d]})}),u,(0,K.jsx)(B.Suspense,{fallback:(0,K.jsx)(kn,{}),children:(0,K.jsx)(Hi,{overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:a,onAction:o,layout:s,dataRev:l})})]})}var Ki=(0,B.lazy)(()=>$(()=>import(`./Activity-D0GfEonq.js`),__vite__mapDeps([6,1,2,3,4,7,8]))),qi=(0,B.lazy)(()=>$(()=>import(`./ActivityDetail-Bf5sBm8_.js`),__vite__mapDeps([9,1,2,3,7,8]))),Ji=(0,B.lazy)(()=>$(()=>import(`./Library-CWjWbVwS.js`),__vite__mapDeps([10,1,2,3,4,5,7,11,12,13]))),Yi=(0,B.lazy)(()=>$(()=>import(`./Kits-BpUFbYHr.js`),__vite__mapDeps([14,1,2,3,7,13,15,16]))),Xi=(0,B.lazy)(()=>$(()=>import(`./Loops-BRuz2YFL.js`),__vite__mapDeps([17,1,2,3,7,8,11,12,13,16]))),Zi=(0,B.lazy)(()=>$(()=>import(`./Laws-Qnzc5Lp7.js`),__vite__mapDeps([18,1,2,3,7,12,13]))),Qi=(0,B.lazy)(()=>$(()=>import(`./Personal-d5Ssk-SW.js`),__vite__mapDeps([19,1,2,3,7,13,20,10,4,5,11,12]))),$i=(0,B.lazy)(()=>$(()=>import(`./Installs-DBH3NEOC.js`),__vite__mapDeps([21,1,2,3,4,7,20,15]))),ea=(0,B.lazy)(()=>$(()=>import(`./Docs-CQifoJkX.js`),__vite__mapDeps([22,1,2,3,7,11,12,13])));function ta(){let e=_e(),[t,n]=(0,B.useState)(null),[r,i]=(0,B.useState)(!1),[o,s]=qe(),[c,l]=Qe(),u=e=>{if(!document.startViewTransition||!E())return l(e);document.startViewTransition(()=>(0,se.flushSync)(()=>l(e)))},[d,f]=mt(),[p,m]=yt(),[h,g]=(0,B.useState)(()=>{try{return!window.sessionStorage.getItem(`gs-booted`)}catch{return!0}}),[_,v]=(0,B.useState)(!1),y=(0,B.useRef)(null),b=(0,B.useRef)(null);(0,B.useEffect)(()=>{if(!_)return;let e=e=>{e.key===`Escape`&&v(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]),(0,B.useEffect)(()=>{if(!_)return;let e=b.current,t=document.activeElement;return e&&(e.inert=!0),document.getElementById(`rail-nav`)?.focus(),()=>{e&&(e.inert=!1),t instanceof HTMLElement&&t.focus()}},[_]);let x=e=>n({kind:e?.body?.kind||`err`,msg:e?.body?.message||e.message}),{overview:S,error:C,themes:w,reload:T}=bt(x),[D,O]=(0,B.useState)(0),k=()=>{T(),O(e=>e+1)},[A,ee]=(0,B.useState)(null),{runs:j,activeId:te,consoleOpen:M,setConsoleOpen:N,runAction:P,cancelJob:ne,clearRuns:re}=St({onFinish:e=>{k(),ee({status:e,at:Date.now()})},onError:x}),{data:F}=U(()=>a.setup().catch(()=>null),[D],`setup`),{data:ie}=U(()=>a.installs().catch(()=>null),[D],`installs`),I=ie?.installs||null,L=j[j.length-1],ae=L?L.status===`running`?`${L.action} running`:`${L.action} ${L.status}`:``;(0,B.useEffect)(()=>{let e=y.current;if(e){if(!We(e,ut(d),o)){let t=ft(d);t?Ce(e,t,o):!Te(e,c,o)&&S?.accent&&Ce(e,S.accent,o)}document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,getComputedStyle(e).getPropertyValue(`--bg`).trim())}},[S,o,d,c]);let R=[{title:`Rebuild all`,desc:`Re-emit every install`,run:()=>P(`build-all`),confirm:{msg:`Rebuild every install from the current sources?`,title:`Rebuild all?`,confirmLabel:`Rebuild all`}},{title:`Update`,desc:`Pull the latest Geneseed; the server restarts after`,run:()=>P(`update`),confirm:{msg:`Update Geneseed? The server restarts when the update ends.`,title:`Update Geneseed?`,confirmLabel:`Update`}},{title:`Run doctor`,desc:`Read-only health check`,run:()=>P(`doctor`)},{title:`Restart server`,desc:`Restart the local Geneseed server`,run:()=>it().catch(x),confirm:{msg:`Restart the local Geneseed server? The console reconnects in a moment.`,title:`Restart the server?`,confirmLabel:`Restart`}},{title:o===`light`?`Switch to dark mode`:`Switch to light mode`,desc:`Appearance`,run:s},...Ye.filter(e=>e.id!==c).map(e=>({title:`Flavour: ${e.name}`,desc:e.tagline,run:()=>u(e.id)}))].map(e=>({kind:`Actions`,hay:`${e.title} ${e.desc}`.toLowerCase(),...e})),oe={flavour:c,onFlavour:u,accentMode:d,onAccentMode:f,layout:p,onLayout:m};return(0,K.jsx)(`div`,{className:`app fl-${c} ${o===`light`?`light`:``}${_?` nav-open`:``}`,ref:y,children:(0,K.jsxs)(sn,{children:[(0,K.jsx)(`div`,{className:`atmos`,"aria-hidden":`true`}),(0,K.jsx)(`a`,{className:`skip-link`,href:`#main`,onClick:e=>{e.preventDefault(),document.getElementById(`main`)?.focus()},children:`Skip to content`}),(0,K.jsx)(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:ae}),_&&(0,K.jsx)(`button`,{type:`button`,className:`nav-scrim`,"aria-label":`Close navigation`,onClick:()=>v(!1)}),(0,K.jsx)(Ht,{route:e,overview:S,installs:I,onOpenVoice:()=>i(e=>!e),onNavigate:()=>v(!1)}),r&&(0,K.jsx)(xn,{themes:w,current:S?.theme,onPick:e=>{i(!1),P(`build`,{theme:e,emit:S?.emit})},onClose:()=>i(!1)}),(0,K.jsxs)(`div`,{className:`col`,ref:b,children:[(0,K.jsx)(bn,{route:e,navOpen:_,onToggleNav:()=>v(e=>!e),overview:S,installs:I,actions:R,mode:o,onToggleMode:s,appearance:oe,dataRev:D,onSwitch:k}),(0,K.jsx)(`main`,{className:`page`,id:`main`,tabIndex:-1,children:(0,K.jsx)(`div`,{className:[`library`,`kits`,`loops`,`docs`].includes(e.page)?`pad pad-wide`:`pad`,children:(0,K.jsx)(zn,{activeId:te,finish:A,children:(0,K.jsx)(Pn,{children:(0,K.jsx)(B.Suspense,{fallback:(0,K.jsx)(kn,{}),children:{overview:()=>(0,K.jsx)(Gi,{overview:S,overviewError:C,onRetry:T,themes:w,setup:F,runs:j,onAction:P,layout:p,onLayout:m,dataRev:D}),laws:()=>(0,K.jsx)(Zi,{selected:e.item,overview:S,setup:F,onAction:P,dataRev:D}),library:()=>(0,K.jsx)(Ji,{overview:S,section:e.section,selected:e.item,dataRev:D}),kits:()=>(0,K.jsx)(Yi,{item:e.item,onAction:P,dataRev:D}),loops:()=>(0,K.jsx)(Xi,{tab:e.tab,item:e.item,dataRev:D}),personal:()=>(0,K.jsx)(Qi,{tab:e.tab,item:e.item,setup:F,dataRev:D}),installs:()=>(0,K.jsx)($i,{tab:e.tab,overview:S,setup:F,themes:w,onAction:P,onMutated:k,dataRev:D,appearance:oe}),activity:()=>e.item?(0,K.jsx)(qi,{sid:e.item},e.item):(0,K.jsx)(Ki,{}),docs:()=>(0,K.jsx)(ea,{page:e.item,onAction:P,overview:S})}[e.page]?.()})},e.page)})})}),(0,K.jsx)(Wt,{route:e,navOpen:_,onMore:()=>v(!0)}),(0,K.jsx)(wn,{runs:j,open:M,busy:!!te,finish:A,onToggle:()=>N(e=>!e),onClear:re,onCancel:ne})]}),(0,K.jsx)(Cn,{toast:t,onClose:()=>n(null)}),h&&(0,K.jsx)(On,{ready:!!S||!!C,onDone:()=>{try{window.sessionStorage.setItem(`gs-booted`,`1`)}catch{}g(!1)}})]})})}(0,ce.createRoot)(document.getElementById(`root`)).render((0,K.jsx)(ta,{})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`).catch(()=>{})});export{$t as $,fr as A,Gn as B,dr as C,re as Ct,ar as D,ir as E,tr as F,Bn as G,Un as H,Qn as I,kn as J,jn as K,Yn as L,hr as M,Sr as N,yr as O,Zn as P,Zt as Q,Jn as R,Tr as S,ae as St,cr as T,Vn as U,Wn as V,In as W,_n as X,vn as Y,on as Z,Or as _,V as _t,Ni as a,q as at,Er as b,ge as bt,Oi as c,Nt as ct,Pr as d,Ft as dt,Qt as et,Nr as f,U as ft,jr as g,Ye as gt,Lr as h,it as ht,Pi as i,qt as it,_r as j,ur as k,Ur as l,Mt as lt,Ir as m,pt as mt,Fi as n,Kt as nt,ki as o,G as ot,Fr as p,gt as pt,An as q,Di as r,Yt as rt,ji as s,Pt as st,$ as t,Gt as tt,Xr as u,kt as ut,Cr as v,ue as vt,xr as w,Dr as x,z as xt,wr as y,ve as yt,Kn as z};
@@ -11,7 +11,7 @@
11
11
  <!-- The brand sprout as an inline SVG favicon (no extra asset to serve). -->
12
12
  <link rel="icon" type="image/svg+xml"
13
13
  href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21.5v-9' stroke='%233AD4C4' stroke-width='2' stroke-linecap='round' fill='none'/%3E%3Cpath d='M12 13c0-4.5 3.2-7.5 7.5-7.5 0 4.5-3.2 7.5-7.5 7.5z' fill='%233AD4C4'/%3E%3Cpath d='M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z' fill='%233AD4C4' opacity='.42'/%3E%3C/svg%3E" />
14
- <script type="module" crossorigin src="/assets/index-D2VlAlpK.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-DMDF5Y3Y.js"></script>
15
15
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-hePW80VL.js">
16
16
  <link rel="modulepreload" crossorigin href="/assets/react-DlYQp10C.js">
17
17
  <link rel="modulepreload" crossorigin href="/assets/api-BfpZmUMI.js">
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Dashboard-CnO_bsfz.js","assets/rolldown-runtime-hePW80VL.js","assets/react-DlYQp10C.js","assets/api-BfpZmUMI.js","assets/motion-CXaUMNkg.js","assets/sections-ChwaobfW.js","assets/Activity-GdsfJgQQ.js","assets/EmptyState-1sPNleqv.js","assets/usePoll-bDFN-Hr6.js","assets/ActivityDetail-BsVbLWoA.js","assets/Library-BXHx4pFJ.js","assets/RailCats-BtIstKaH.js","assets/FilterInput-CZREvrjX.js","assets/Markdown-DpmmtW2Y.js","assets/Kits-BtNHZ7_Z.js","assets/KitApply-Bz6_5yec.js","assets/DataTable-BWbUx4bY.js","assets/Loops-B_wNVFEN.js","assets/Laws-B2X2jIE9.js","assets/Personal-BwZ33bqc.js","assets/Tabs-ByiD3mPQ.js","assets/Installs-D3fE87tF.js","assets/Docs-DctLhPHX.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-hePW80VL.js";import{i as t,n,r,t as i}from"./react-DlYQp10C.js";import{t as a}from"./api-BfpZmUMI.js";import{A as o,C as s,D as c,E as l,F as u,G as d,H as f,I as p,L as m,O as h,P as g,T as _,U as v,_ as y,b,d as x,f as S,i as C,j as w,l as T,n as E,o as D,r as O,s as k,t as A,u as j,v as M,z as ee}from"./motion-CXaUMNkg.js";import{i as N,n as te,r as P}from"./sections-ChwaobfW.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var ne=(e,t)=>{if(m(t,`<`)){let n=t[1]===`<`,r=e._tail,i=r?r._offset+r._delay:0;return n?i:i+r.duration}},re=(e,t)=>{let n=e.iterationDuration;if(n===1e-11&&(n=0),w(t))return n;if(h(+t))return+t;let r=t,i=e?e.labels:null,a=!c(i),o=ne(e,r),s=!w(o),l=v.exec(r);if(l){let e=l[0],t=r.split(e),c=a&&t[0]?i[t[0]]:n,u=s?o:a?c:n,d=+t[1];return M(u,d,e[0])}return s?o:a?w(i[r])?n:i[r]:n},F=(e=0,t=1,n=0)=>{let r=10**n;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},ie=0,ae=(e,t=0,n=1,r=0)=>{let i=e===void 0?ie++:e;return(e=t,a=n,o=r)=>{i+=1831565813,i=Math.imul(i^i>>>15,i|1),i^=i+Math.imul(i^i>>>7,i|61);let s=10**o;return Math.floor((((i^i>>>14)>>>0)/4294967296*(a-e+1/s)+e)*s)/s}},oe=(e,t=F)=>{let n=e.length,r,i;for(;n;)i=t(0,--n),r=e[n],e[n]=e[i],e[i]=r;return e},se=(e,t={})=>{let n=[],r=0,i,a=null,c=t.from,f=t.reversed,m=t.ease,v=!w(m),x=v&&!w(m.ease)?m.ease:v?j(m):null,C=t.grid,T=C===!0,E=t.axis,D=t.total,O=w(c)||c===0||c===`first`,k=c===`center`,A=c===`last`,M=c===`random`,ee=_(c),N=_(e),te=t.use,P=g(N?e[0]:e),ne=N?g(e[1]):0,ie=d.exec((N?e[1]:e)+``),se=t.start||0+(N?P:0),I=t.seed,ce=!w(I)&&I!==!1?ae(I===!0?0:I):F,L=t.jitter,le=!w(L),ue=_(L),R=ue?L[0]:L||0,z=ue?L[1]:L||0,B=O?0:h(c)?c:0;return(e,d,m,g,_)=>{let[v]=S(e),O=w(D)?m.length:D,j=w(te)?!1:l(te)?te(v,d,O):y(v,te),F=h(j)||o(j)&&h(+j)?+j:d,ae=F>=0&&F<O?F:d;if(k&&(B=(O-1)/2),A&&(B=O-1),!n.length){if(T){let e=!0,t=!1,r=1/0,i=1/0,a=1/0,o=-1/0,s=-1/0,u=-1/0,d=[],f=[],g=[];for(let n=0;n<O;n++){let c=m[n],p=0,_=0,v=0,y=!1;if(c&&l(c.getBoundingClientRect)){let e=c.getBoundingClientRect();p=e.left+e.width/2,_=e.top+e.height/2,y=!0}else{let e=c;e&&h(e.x)&&h(e.y)&&(p=e.x,_=e.y,h(e.z)&&(v=e.z,t=!0),y=!0)}if(!y){e=!1;break}d.push(p),f.push(_),g.push(v),p<r&&(r=p),_<i&&(i=_),v<a&&(a=v),p>o&&(o=p),_>s&&(s=_),v>u&&(u=v)}if(e){let e=d[0],l=f[0],m=g[0];ee?(e=r+c[0]*(o-r),l=i+c[1]*(s-i),m=t?a+(c.length>=3?c[2]:.5)*(u-a):0):k?(e=(r+o)/2,l=(i+s)/2,m=(a+u)/2):A?(e=d[O-1],l=f[O-1],m=g[O-1]):h(c)&&(e=d[c],l=f[c],m=g[c]);for(let r=0;r<O;r++){let i=e-d[r],a=l-f[r],o=m-g[r],s=p(i*i+a*a+(t?o*o:0));E===`x`&&(s=-i),E===`y`&&(s=-a),E===`z`&&(s=-o),n.push(s)}let _=1/0;for(let e=0;e<O;e++){let t=b(n[e]);t>0&&t<_&&(_=t)}if(_>0&&_<1/0)for(let e=0;e<O;e++)n[e]=n[e]/_}else for(let e=0;e<O;e++)n.push(b(B-e))}else for(let e=0;e<O;e++)if(!C)n.push(b(B-e));else{let t=C.length,r=C[0]*C[1],i,a,o;ee?(i=c[0]*(C[0]-1),a=c[1]*(C[1]-1),o=t===3?(c.length>=3?c[2]:.5)*(C[2]-1):0):k?(i=(C[0]-1)/2,a=(C[1]-1)/2,o=t===3?(C[2]-1)/2:0):(i=B%C[0],a=s(B/C[0])%C[1],o=t===3?s(B/r):0);let l=e%C[0],u=s(e/C[0])%C[1],d=t===3?s(e/r):0,f=i-l,m=a-u,h=o-d,g=p(f*f+m*m+(t===3?h*h:0));E===`x`&&(g=-f),E===`y`&&(g=-m),E===`z`&&(g=-h),n.push(g)}r=n[0];for(let e=1;e<O;e++)n[e]>r&&(r=n[e]);if(x||f)for(let e=0;e<O;e++){let t=n[e];x&&(t=x(t/r)*r),f&&(t=E?-t:b(r-t)),n[e]=t}if(le){a=Array(O);for(let e=0;e<O;e++)a[e]=ce(-1,1,4)}M&&(n=oe(n,ce))}let I=N?(ne-P)/r:P;w(i)&&(i=_?re(_,w(t.start)?_.iterationDuration:se):se);let L=i+(I*u(n[ae],2)||0);if(le){let e=r?n[ae]/r:0,t=R+(z-R)*e;L+=a[ae]*t}return t.modifier&&(L=t.modifier(L)),ie&&(L=`${L}${ie[2]}`),L}},I=e=>{let t=1;if(e&&e.getCTM){let n=e.getCTM();n&&(t=(p(n.a*n.a+n.b*n.b)+p(n.c*n.c+n.d*n.d))/2)}return t},ce=(e,t,n)=>{let r=ee,i=getComputedStyle(e),a=i.strokeLinecap,o=i.vectorEffect===`non-scaling-stroke`?e:null,s=a,c=new Proxy(e,{get(e,t){let n=e[t];return t===f?e:t===`setAttribute`?(...t)=>{if(t[0]===`draw`){let n=t[1].split(` `),i=+n[0],c=+n[1],l=I(o),u=i*-r*l,d=c*r*l+u,f=r*l+(i===0&&c===1||i===1&&c===0?0:10*l)-d;if(a!==`butt`){let t=i===c?`butt`:a;s!==t&&(e.style.strokeLinecap=`${t}`,s=t)}e.setAttribute(`stroke-dashoffset`,`${u}`),e.setAttribute(`stroke-dasharray`,`${d} ${f}`)}return Reflect.apply(n,e,t)}:l(n)?(...t)=>Reflect.apply(n,e,t):n}});return e.getAttribute(`pathLength`)!==`${r}`&&(e.setAttribute(`pathLength`,`${r}`),c.setAttribute(`draw`,`${t} ${n}`)),c},L=(e,t=0,n=0)=>x(e).map(e=>ce(e,t,n)),le=r(),ue=n(),R=e(t(),1),z={overview:`Overview`,laws:`Constitution`,library:`Library`,kits:`Kits`,loops:`Loops`,personal:`Personal`,installs:`Installs`,docs:`Docs`,activity:`Activity`},B={loops:[`templates`,`bricks`,`active`],personal:[`rules`,`profile`,`memory`,`notebook`],installs:[`hosts`,`kits`,`edits`,`doctor`,`server`]},de={templates:`Templates`,bricks:`Bricks`,active:`Active`,rules:`Rules`,profile:`Profile`,memory:`Memory`,notebook:`Notebook`,hosts:`Hosts`,kits:`Kits`,edits:`Local edits`,doctor:`Doctor`,server:`Server`},fe={dashboard:[`overview`],constitution:[`laws`],rules:[`personal`,`rules`],profile:[`personal`,`profile`],harness:[`installs`,`hosts`],harnesses:[`installs`,`hosts`],themes:[`installs`,`hosts`],diff:[`installs`,`edits`],doctor:[`installs`,`doctor`],settings:[`installs`,`server`],about:[`installs`,`server`]},pe=(e,t)=>t!==void 0&&Object.hasOwn(e,t),me=(e,t)=>B[e].includes(t)?t:B[e][0];function he(e){let t=(e||`#/`).slice(2).split(`/`).filter(Boolean),[n,r,i]=t,a=e=>{try{return decodeURIComponent(e||``)}catch{return e||``}};if(n===`section`||n===`item`){let e=n===`item`&&pe(N,r)?N[r]:r,t=n===`item`?a(i):void 0;return{page:e===`laws`?`laws`:`library`,section:e,item:t}}if(n===`docs`)return{page:`docs`,item:a(t.slice(1).join(`/`))};if(n===`kits`)return r?{page:`kits`,item:a(r)}:{page:`kits`};if(n===`activity`&&r)return{page:`activity`,item:a(r)};if(n===`skills`||n===`agents`)return{page:`library`,section:n};if(pe(B,n)){let e=me(n,r);return i&&e===r?{page:n,tab:e,item:a(i)}:{page:n,tab:e}}if(pe(fe,n)){let[e,t]=fe[n];return t?{page:e,tab:t}:{page:e}}return{page:pe(z,n)?n:`overview`}}var ge=new Set;function _e(e){return ge.add(e),()=>ge.delete(e)}function ve(){let e=()=>he(typeof window<`u`?window.location.hash:``),[t,n]=(0,R.useState)(e);(0,R.useEffect)(()=>{let t=window.location.hash,r=()=>{let r=window.location.hash;if(r!==t){for(let e of ge)if(e({from:t,to:r})===!1){window.history.replaceState(window.history.state,``,t||`#/`);return}t=r,n(e())}};return window.addEventListener(`hashchange`,r),()=>window.removeEventListener(`hashchange`,r)},[]);let r=(0,R.useRef)(!1);return(0,R.useEffect)(()=>{if(document.title=`${z[t.page]} · Geneseed`,!r.current){r.current=!0;return}let e=document.getElementById(`main`);e?.focus();for(let t of[e,document.scrollingElement||document.documentElement])t&&(t.scrollTop=0)},[t.page]),t}var ye=e=>{window.location.hash=e},be={red:`#FF5C57`,green:`#4ED888`,yellow:`#E8B53D`,blue:`#5B8CFF`,magenta:`#C77DFF`,cyan:`#3AD4C4`,white:`#E9EFEA`},xe={red:`#C53A36`,green:`#2FA864`,yellow:`#B8862A`,blue:`#3C66D8`,magenta:`#9A52D6`,cyan:`#2BA89B`,white:`#AEB8B0`},V=e=>be[e]||be.cyan,Se={red:`#A92F2B`,green:`#1E7A47`,yellow:`#8A6414`,blue:`#2F55C0`,magenta:`#7E3FB8`,cyan:`#15766C`,white:`#465A51`};function Ce(e,t,n){if(!e)return;let r=n===`light`,i=r?xe[t]||xe.cyan:V(t);r&&t===`white`&&(i=`#566B62`);let a=r?Se[t]||Se.cyan:i;Ve(e,Le(i,xe[t]||xe.cyan,Oe,a,r),r)}var we={cultivar:{dark:`#3AD4C4`,light:`#127E73`,ink:`#06100D`},operator:{dark:`#E8A23B`,light:`#8F5E10`,ink:`#1A1306`},matrix:{dark:`#19E37C`,light:`#0B7A47`,ink:`#04140C`},atlas:{dark:`#8FD694`,light:`#1C8450`,ink:`#14200F`}};function Te(e,t,n){let r=we[t];if(!e||!r)return!1;let i=n===`light`,a=i?r.light:r.dark;return Ve(e,Le(a,r.light,r.ink,a,i),i),!0}var Ee={dark:{worst:`#232A31`,soft:[`#14181D`,`#1B2026`,`#11151A`,`#171C22`,`#0B1116`,`#121A21`,`#1C1A12`,`#211E15`]},light:{worst:`#EBE6D8`,soft:[`#FBFDFC`,`#F3F6F6`,`#F4F6F8`,`#E9F4ED`,`#FCFAF4`,`#F6F2E7`]}},De=.13,Oe=`#06100D`,ke=e=>{let t=e.replace(`#`,``);return[0,2,4].map(e=>parseInt(t.slice(e,e+2),16))},Ae=e=>`#`+e.map(e=>Math.round(e).toString(16).padStart(2,`0`)).join(``).toUpperCase(),je=e=>{let[t,n,r]=ke(e).map(e=>{let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return .2126*t+.7152*n+.0722*r},Me=(e,t)=>{let[n,r]=[je(e),je(t)].sort((e,t)=>t-e);return(n+.05)/(r+.05)},Ne=(e,t,n)=>{let r=ke(e),i=ke(t);return Ae(r.map((e,t)=>e+(i[t]-e)*n))},Pe=(e,t,n,r)=>{let i=e=>Math.min(...[].concat(t).map(t=>Me(e,t))),a=e;for(let t=.05;i(a)<n&&t<=1.0001;t+=.05)a=Ne(e,r,t);return a},Fe=e=>{let[t,n,r]=ke(e).map(e=>e/255),i=Math.max(t,n,r),a=Math.min(t,n,r),o=i-a;if(o===0)return{h:0,s:0};let s=o/(1-Math.abs(i+a-1));return{h:((i===t?(n-r)/o%6:i===n?(r-t)/o+2:(t-n)/o+4)*60+360)%360,s}},Ie=(e,t)=>{let n=Math.abs(e-t)%360;return n>180?360-n:n};function Le(e,t,n,r,i){let a=i?`#000000`:`#FFFFFF`,o=e=>Me(e,n)>=Me(e,`#FFFFFF`)?n:`#FFFFFF`,s=Me(e,o(e))>=4.5?e:Pe(e,i?`#FFFFFF`:n,4.5,a),c=i?Ee.light:Ee.dark,l=[c.worst,...c.soft.map(e=>Ne(e,s,De))];return{accent:s,accent2:t,ink:o(s),text:Pe(r,l,4.5,a)}}var Re=39,ze={dark:[`#FF8A4C`,`#FF8A4C`],light:[`#B4441F`,`#9B3A1B`]};function Be(e,t,n){let[r,i]=n?ze.light:ze.dark,{h:a,s:o}=Fe(t),s=Ie(a,Re);o>=.15&&s<=29&&Ie(a,Fe(r).h)>s?(e.style.setProperty(`--warn`,r),e.style.setProperty(`--warn-text`,i)):(e.style.removeProperty(`--warn`),e.style.removeProperty(`--warn-text`))}function Ve(e,t,n){e.style.setProperty(`--accent`,t.accent),e.style.setProperty(`--accent-2`,t.accent2),e.style.setProperty(`--accent-ink`,t.ink),e.style.setProperty(`--accent-text`,t.text),Be(e,t.accent,n)}var He=e=>typeof e==`string`&&/^#[0-9a-fA-F]{6}$/.test(e);function Ue(e,t){let n=t===`light`,r=n?Ee.light:Ee.dark,i=n?`#000000`:`#FFFFFF`,a=Pe(e,r.worst,3,i);return Le(a,Pe(a,r.worst,4.5,i),Oe,a,n)}function We(e,t,n){return!e||!He(t)?!1:(Ve(e,Ue(t,n),n===`light`),!0)}function Ge(e,t){let[n,r]=(0,R.useState)(()=>{try{return t(localStorage.getItem(e))}catch{return t(null)}});return[n,(0,R.useCallback)(t=>r(n=>{let r=typeof t==`function`?t(n):t;try{localStorage.setItem(e,r)}catch{}return r}),[e])]}var Ke=`geneseed-mode`;function qe(){let[e,t]=Ge(Ke,e=>e===`light`?`light`:`dark`);return[e,()=>t(e=>e===`light`?`dark`:`light`)]}var Je=`geneseed-flavour`,Ye=[{id:`cultivar`,short:`Cultivar`,name:`Cultivar Evolved`,tagline:`The calm default — cool teal ink, geometric sans, soft flat cards lit by one quiet shadow.`},{id:`operator`,short:`Operator`,name:`Operator HUD`,tagline:`Amber phosphor on cool charcoal — all-mono, zero-radius instrument readout.`},{id:`matrix`,short:`Matrix`,name:`Matrix`,tagline:`Acid-green order-book terminal on pure black — all Space Mono, square 2px, a faint code-grid.`},{id:`atlas`,short:`Atlas`,name:`Atlas`,tagline:`The field journal — loam dark, sage ink, the codex as a living map.`}],Xe=new Set(Ye.map(e=>e.id)),Ze={a:`cultivar`,b:`atlas`,c:`operator`,d:`cultivar`,e:`matrix`,f:`cultivar`,g:`cultivar`,z:`cultivar`,cb:`matrix`,cm:`cultivar`,greenhouse:`atlas`,heirloom:`cultivar`,aurora:`cultivar`,perspective:`cultivar`,sequencer:`cultivar`,cobalt:`matrix`,cosmic:`cultivar`,neon:`matrix`};function Qe(){return Ge(Je,$e)}function $e(e){return Xe.has(e)?e:Ze[e]||`cultivar`}var et=1e3,tt=e=>new Promise(t=>setTimeout(t,e));async function nt(){try{return(await a.ping()).pid??null}catch{return null}}async function rt(e=0,t=null){await tt(e);for(let e=0;e<30;e++){let e=await nt();if(e!==null&&e!==t)break;await tt(et)}window.location.reload()}async function it(){let e=await nt();try{await a.restart()}catch(e){if(e.status)throw e}await rt(et,e)}var at=`geneseed-accent`,ot=[{id:`curated`,short:`Curated`,tagline:`Each theme's own signature colour.`}],st=[[`cyan`,`Cyan`],[`blue`,`Blue`],[`magenta`,`Violet`],[`yellow`,`Amber`],[`green`,`Green`]].map(([e,t])=>({id:`custom:${e}`,name:e,short:t,hex:V(e),tagline:`Always ${t.toLowerCase()}, whatever the voice or skin.`})),ct=[...ot,...st],lt=new Set(ct.map(e=>e.id)),ut=e=>{let t=typeof e==`string`&&e.startsWith(`hex:`)?e.slice(4):null;return He(t)?t.toUpperCase():null},dt=e=>e&&(lt.has(e)||ut(e))?e:`curated`,ft=e=>st.find(t=>t.id===e)?.name??null,pt=e=>{let t=ut(e);return t?`Your own colour, ${t}.`:ct.find(t=>t.id===e)?.tagline??``};function mt(){return Ge(at,dt)}var ht=`geneseed-layout`,gt=[{id:`overview`,short:`Overview`,tagline:`Every install, what needs you, cost, usage and gates.`},{id:`cultivar`,short:`Cultivar`,tagline:`Hero, KPIs & genome grid.`},{id:`greenhouse`,short:`Greenhouse`,tagline:`Ring, tiles & mix donut.`},{id:`operator`,short:`Operator`,tagline:`Dense terminal readout.`},{id:`journal`,short:`Journal`,tagline:`Growth rings & the constitution map.`}],_t=new Set(gt.map(e=>e.id));function vt(e){return e&&_t.has(e)?e:`overview`}function yt(){return Ge(ht,vt)}function bt(e){let[t,n]=(0,R.useState)(null),[r,i]=(0,R.useState)(null),[o,s]=(0,R.useState)([]),c=()=>a.overview().then(e=>{n(e),i(null)}).catch(t=>{i(t?.body?.message||t?.message||String(t)),e?.(t)});return(0,R.useEffect)(()=>{c()},[]),(0,R.useEffect)(()=>{a.themes().then(e=>s(e.themes)).catch(()=>{})},[]),{overview:t,error:r,themes:o,reload:c}}var xt=600;function St({onFinish:e,onError:t}={}){let[n,r]=(0,R.useState)([]),[i,o]=(0,R.useState)(null),[s,c]=(0,R.useState)(!1);return(0,R.useEffect)(()=>{a.jobs().then(({jobs:e})=>{if(!e.length)return;r(e.map(e=>({id:e.id,action:e.action,status:e.status,output:e.output||``,duration:e.duration,started:e.started})));let t=e.find(e=>e.status===`running`);t&&(o(t.id),c(!0))}).catch(()=>{})},[]),(0,R.useEffect)(()=>{if(!i)return;let t=n.find(e=>e.id===i),s=t?.action===`update`||!!t?.restarts,c=null;s&&nt().then(e=>c=e);let l=setInterval(async()=>{if(!document.hidden)try{let t=await a.job(i);if(r(e=>{let n=e.findIndex(e=>e.id===i);if(n===-1)return e;let r=e[n],a=t.output||``;if(r.output===a&&r.status===t.status&&r.duration===t.duration)return e;let o=e.slice();return o[n]={...r,output:a,status:t.status,duration:t.duration},o}),t.status!==`running`){if(clearInterval(l),o(null),s&&t.status===`done`){rt(2e3,c);return}e?.(t.status)}}catch{if(!s)return;clearInterval(l),rt(0,c)}},xt);return()=>clearInterval(l)},[i]),{runs:n,activeId:i,consoleOpen:s,setConsoleOpen:c,runAction:async(e,n)=>{try{let{job_id:t,restarts:i}=await a.action(e,n),s=e===`build`&&n?.theme?`build (${n.theme} · ${n.emit})`:e;return r(e=>[...e,{id:t,action:s,status:`running`,output:``,started:Date.now()/1e3,restarts:!!i}]),o(t),c(!0),t}catch(e){t?.(e)}},cancelJob:e=>a.cancelJob(e).catch(e=>t?.(e)),clearRuns:()=>r([])}}var H=new Map,Ct=new Map;function wt(e){for(let t of H.keys())t.startsWith(`${e}|`)&&H.delete(t)}function U(e,t=[],n=null,{revalidate:r=!1}={}){let i=n===null?null:`${n}|${t.join(``)}`,[a,o]=(0,R.useState)(()=>i!==null&&H.has(i)?H.get(i):null),[s,c]=(0,R.useState)(``),[l,u]=(0,R.useState)(()=>!(i!==null&&H.has(i))),d=(0,R.useRef)(e),f=(0,R.useRef)(i);(0,R.useLayoutEffect)(()=>{d.current=e,f.current=i});let p=(0,R.useRef)(0),m=(0,R.useCallback)(()=>{let e=++p.current,t=()=>e===p.current;u(!0),c(``);let n=f.current;return Promise.resolve(d.current()).then(e=>{if(t()&&(o(e),n!==null)){H.set(n,e);for(let t of Ct.get(n)||[])t(e)}}).catch(e=>{t()&&c(e.message)}).finally(()=>{t()&&u(!1)})},t);return(0,R.useEffect)(()=>{let e=f.current;return e!==null&&(Ct.has(e)||Ct.set(e,new Set),Ct.get(e).add(o)),e!==null&&H.has(e)&&(p.current++,o(H.get(e)),c(``),u(!1),!r)||m(),()=>Ct.get(e)?.delete(o)},[m]),{data:a,error:s,loading:l,reload:m,setData:o}}var Tt=60,Et=3600,Dt=86400,Ot={seconds:90,minutes:5400,hours:36*Et};function kt(e){let t=Math.max(0,Date.now()/1e3-e);return t<Ot.seconds?`${Math.round(t)}s`:t<Ot.minutes?`${Math.round(t/Tt)}m`:t<Ot.hours?`${Math.round(t/Et)}h`:`${Math.round(t/Dt)}d`}function At(e){return e?e.replace(/\\/g,`/`).replace(/^\/?(home|Users)\/[^/]+/i,`~`).replace(/^[A-Z]:\/Users\/[^/]+/i,`~`):`~`}var W={deployed:.4,doctorClean:.25,doctorMinor:.15,doctorMinorMax:2,doctorFail:.05,versionSynced:.2,diskClean:.15},jt={warn:W.deployed+W.doctorClean,bad:W.deployed};function Mt(e,t,n){if(!e)return 0;let r=e.doctor?.problems?.length??99,i=e.doctor?.ok?W.doctorClean:r<=W.doctorMinorMax?W.doctorMinor:W.doctorFail,a=t&&t.installed_fp&&t.installed_fp===t.source_fp,o=(e.deployed?W.deployed:0)+i+(a?W.versionSynced:0)+(e.diff&&e.diff.missing===0?W.diskClean:0);return Math.min(o,jt[n]??1)}var Nt=e=>Math.max(...P.map(t=>e?.[t]??0),1),Pt=e=>(e?.edited??0)+(e?.added??0),G=e=>Pt(e)+(e?.missing??0),Ft=e=>(e?.laws??0)+(e?.doctrines?.rules??0),K=i(),It={dashboard:`M3 13h7V3H3v10Zm0 8h7v-6H3v6Zm11 0h7V11h-7v10Zm0-18v6h7V3h-7Z`,library:`M4 5h10v14H4zM16 7h4v12h-4M7 9h4M7 12h4`,loop:`M19.5 9A8 8 0 1 1 15 4.6M15 1.5l.2 3.3-3.2.8`,graph:`M6 18a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM18 8a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM18 20a2 2 0 1 0 0-4 2 2 0 0 0 0 4ZM7.5 14.5l8-8M16.7 15.2L8.8 16.6`,changes:`M4 6h10M4 12h7M4 18h12M17 4l3 3-3 3M20 7h-6`,doctor:`M12 3v6m0 0a4 4 0 0 1-4 4H7a3 3 0 0 0-3 3v2m8-9a4 4 0 0 0 4 4h1a3 3 0 0 1 3 3v2M12 3a1.5 1.5 0 1 0 0-.01`,themes:`M12 3a9 9 0 1 0 0 18c1.1 0 2-.9 2-2 0-.5-.2-1-.5-1.3-.3-.4-.5-.8-.5-1.2 0-1 .8-1.5 1.7-1.5H17a4 4 0 0 0 4-4c0-4.4-4-8-9-8Z`,settings:`M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm8-3a8 8 0 0 0-.1-1.3l2-1.6-2-3.4-2.4 1a8 8 0 0 0-2.2-1.3L15 2H9l-.3 2.6a8 8 0 0 0-2.2 1.3l-2.4-1-2 3.4 2 1.6A8 8 0 0 0 4 12c0 .4 0 .9.1 1.3l-2 1.6 2 3.4 2.4-1a8 8 0 0 0 2.2 1.3L9 22h6l.3-2.6a8 8 0 0 0 2.2-1.3l2.4 1 2-3.4-2-1.6c.1-.4.1-.9.1-1.3Z`,search:`M11 19a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM21 21l-4.3-4.3`,chevron:`M9 6l6 6-6 6`,x:`M6 6l12 12M18 6L6 18`,menu:`M4 7h16M4 12h16M4 17h16`,play:`M7 5v14l11-7L7 5Z`,clear:`M3 6h18M8 6V4h8v2M6 6l1 14h10l1-14`,download:`M12 3v12m0 0l-4-4m4 4l4-4M4 19h16`,refresh:`M21 12a9 9 0 1 1-3-6.7M21 4v5h-5`,folder:`M3 7a2 2 0 0 1 2-2h3.5l2 2H19a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z`,build:`M14 3l-1 4 4-1 3 3-4 1 1 4-3 3-1-4-4 1-3-3 4-1-1-4 3-3 5 0Z`,arrow:`M5 12h14M13 6l6 6-6 6`,external:`M14 5h5v5M19 5l-8 8M12 5H6a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2v-6`,copy:`M9 9h11v11H9zM5 15H4V4h11v1`,spark:`M12 3v3m0 12v3m9-9h-3M6 12H3m13.5-6.5-2 2m-7 7-2 2m11 0-2-2m-7-7-2-2`,activity:`M3 12h4l2.5-7 5 14 2.5-7H21`,agent:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2M9 11a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM22 21v-2a4 4 0 0 0-3-3.9M16 3.1a4 4 0 0 1 0 7.8`,kit:`M21 8l-9-5-9 5v8l9 5 9-5V8ZM3 8l9 5 9-5M12 13v8`,layers:`M12 3l9 5-9 5-9-5 9-5ZM3 13l9 5 9-5M3 17l9 5 9-5`,sun:`M12 4V2M12 22v-2M4 12H2M22 12h-2M5.6 5.6 4.2 4.2M19.8 19.8l-1.4-1.4M18.4 5.6l1.4-1.4M4.2 19.8l1.4-1.4M12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8Z`,moon:`M21 12.8A8.5 8.5 0 1 1 11.2 3a6.5 6.5 0 0 0 9.8 9.8Z`,power:`M12 3v9M7.5 6.5a7 7 0 1 0 9 0`,docs:`M5 4h9l5 5v11a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1ZM14 4v5h5M8 12h7M8 16h7`,skill:`M21.7 6.6a5 5 0 0 1-6.6 6.6l-7.4 7.4a2 2 0 1 1-2.8-2.8l7.4-7.4a5 5 0 0 1 6.6-6.6l-2.6 2.6a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0Z`,law:`M12 3v18M5 6h14M8 21h8M6 6l-3 6h6zM3 12a3 3 0 0 1 6 0M18 6l-3 6h6zM15 12a3 3 0 0 1 6 0`,rule:`M7 3h10a1 1 0 0 1 1 1v17l-6-3.5L6 21V4a1 1 0 0 1 1-1ZM9.5 9.5l1.8 1.8 3.4-3.6`,profile:`M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8ZM5 20a7 7 0 0 1 14 0`,notebook:`M7 4h11v16H7zM4 8h3M4 12h3M4 16h3M11 9h5M11 13h5M11 17h3`,about:`M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18ZM12 11v6M12 7.6h.01`,github:`M12 2a10 10 0 0 0-3.2 19.5c.5.1.7-.2.7-.5v-1.8c-2.8.6-3.4-1.2-3.4-1.2-.5-1.2-1.1-1.5-1.1-1.5-.9-.6.1-.6.1-.6 1 .1 1.5 1 1.5 1 .9 1.5 2.3 1.1 2.9.8.1-.6.3-1.1.6-1.3-2.2-.3-4.6-1.1-4.6-5 0-1.1.4-2 1-2.7-.1-.3-.4-1.3.1-2.7 0 0 .8-.3 2.7 1a9.4 9.4 0 0 1 5 0c1.9-1.3 2.7-1 2.7-1 .5 1.4.2 2.4.1 2.7.6.7 1 1.6 1 2.7 0 3.9-2.4 4.7-4.6 5 .4.3.7.9.7 1.8v2.6c0 .3.2.6.7.5A10 10 0 0 0 12 2Z`};function q({name:e,className:t=`glyph`,style:n}){return(0,K.jsx)(`svg`,{className:t,style:n,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.7`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:(0,K.jsx)(`path`,{d:It[e]||``})})}function Lt({className:e=`sprout`}){return(0,K.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,K.jsx)(`path`,{d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,K.jsx)(`path`,{d:`M12 13c0-4.5 3.2-7.5 7.5-7.5 0 4.5-3.2 7.5-7.5 7.5z`,fill:`var(--accent)`}),(0,K.jsx)(`path`,{d:`M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z`,fill:`var(--accent)`,opacity:`.42`}),(0,K.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})}var Rt=[{hash:`#/`,page:`overview`,label:`Overview`,icon:`dashboard`},{hash:`#/laws`,page:`laws`,label:`Constitution`,icon:`law`,count:e=>e?.counts?(e.counts.ontology??0)+(e.counts.laws??0)+(e.counts.doctrines?.rules??0):null},{hash:`#/library`,page:`library`,label:`Library`,icon:`library`,count:e=>e?.counts?[`skills`,`agents`,`memory`,`notebook`,`wiki`,`config`].reduce((t,n)=>t+(e.counts[n]??0),0):null},{hash:`#/kits`,page:`kits`,label:`Kits`,icon:`kit`},{hash:`#/loops`,page:`loops`,label:`Loops`,icon:`loop`,count:e=>e?.counts?.loops??null},{hash:`#/personal`,page:`personal`,label:`Personal`,icon:`profile`},{hash:`#/installs`,page:`installs`,label:`Installs`,icon:`layers`,count:(e,t)=>t?`${t.filter(e=>e.state===`active`).length}/${t.length}`:null}],zt=[{hash:`#/docs`,page:`docs`,label:`Docs`,icon:`docs`},{hash:`#/activity`,page:`activity`,label:`Activity`,icon:`activity`}];function Bt({n:e,lit:t,count:n,onNavigate:r}){return(0,K.jsx)(`li`,{children:(0,K.jsxs)(`a`,{className:`sb-item${t?` on`:``}`,href:e.hash,"aria-current":t?`page`:void 0,onClick:()=>r?.(),children:[(0,K.jsx)(q,{name:e.icon}),(0,K.jsx)(`span`,{className:`sb-label`,children:e.label}),n==null?null:(0,K.jsx)(`span`,{className:`sb-count`,children:n})]})})}function Vt({overview:e,onOpenVoice:t}){if(!e)return null;let n=e.doctor,r=G(e.diff);return(0,K.jsxs)(`section`,{className:`sb-vitals`,"aria-label":`Install vitals`,children:[(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{children:`doctor`}),(0,K.jsx)(`b`,{className:n?n.ok?`good`:`bad`:``,children:n?n.ok?`clean`:`${n.problems.length} to fix`:`not run`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{children:`drift`}),(0,K.jsx)(`b`,{className:r?`warn`:``,children:e.diff?r:`n/a`})]}),(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`span`,{children:`built`}),(0,K.jsx)(`b`,{title:e.build_time||void 0,children:e.build_epoch?`${kt(e.build_epoch)} ago`:`never`})]}),(0,K.jsxs)(`button`,{type:`button`,className:`sb-voice`,onClick:t,title:`Switch voice`,"aria-haspopup":`dialog`,children:[(0,K.jsxs)(`span`,{className:`sb-voice-name`,children:[(0,K.jsx)(`i`,{className:`sb-voice-swatch`,"aria-hidden":`true`}),`Voice · `,e.theme||`none`]}),(0,K.jsx)(q,{name:`chevron`})]})]})}function Ht({route:e,overview:t,installs:n,onOpenVoice:r,onNavigate:i}){return(0,K.jsxs)(`nav`,{className:`sidebar`,id:`rail-nav`,"aria-label":`Console`,tabIndex:-1,children:[(0,K.jsxs)(`button`,{type:`button`,className:`sb-brand`,onClick:()=>{ye(`#/`),i?.()},"aria-label":`Geneseed, go to the overview`,children:[(0,K.jsx)(`span`,{className:`sb-mark`,children:(0,K.jsx)(Lt,{})}),(0,K.jsxs)(`span`,{className:`sb-brand-text`,children:[(0,K.jsx)(`span`,{className:`sb-name`,children:`Geneseed`}),(0,K.jsx)(`span`,{className:`sb-ver`,children:[t?.version&&`v${t.version}`,t?.theme].filter(Boolean).join(` · `)})]})]}),(0,K.jsx)(`ul`,{className:`sb-list`,children:[...Rt,...zt].map(r=>(0,K.jsx)(Bt,{n:r,lit:e.page===r.page,count:r.count?.(t,n),onNavigate:i},r.page))}),(0,K.jsx)(`div`,{className:`sb-spacer`}),t?(0,K.jsx)(`button`,{type:`button`,className:`sb-voice-rail`,"aria-label":`Switch voice, now ${t.theme||`none`}`,title:`Switch voice`,onClick:r,children:(0,K.jsx)(q,{name:`spark`})}):null,(0,K.jsx)(Vt,{overview:t,onOpenVoice:r})]})}var Ut=[`overview`,`laws`,`library`,`installs`];function Wt({route:e,navOpen:t,onMore:n}){return(0,K.jsxs)(`nav`,{className:`tabbar`,"aria-label":`Console pages`,children:[Rt.filter(e=>Ut.includes(e.page)).map(t=>(0,K.jsxs)(`a`,{href:t.hash,className:e.page===t.page?`on`:``,"aria-current":e.page===t.page?`page`:void 0,children:[(0,K.jsx)(q,{name:t.icon}),t.label]},t.page)),(0,K.jsxs)(`button`,{type:`button`,className:`tab-more${Ut.includes(e.page)?``:` on`}`,"aria-controls":`rail-nav`,"aria-expanded":!!t,onClick:n,children:[(0,K.jsx)(q,{name:`menu`}),`More`]})]})}var Gt=[{id:`opencode`,label:`OpenCode`,deployAdds:`.opencode/ + AGENT.md`,removeProject:`.opencode/ + AGENT.md + the bundle`,removeGlobal:`~/.config/opencode's AGENT.md, agents, skills, plugins + the opencode.json entry`},{id:`claude`,label:`Claude Code`,deployAdds:`.claude/ + CLAUDE.md`,removeProject:`.claude/ + the CLAUDE.md block`,removeGlobal:`~/.claude's agents/skills + the CLAUDE.md block + settings hooks`},{id:`bob`,label:`BOB (IBM)`,deployAdds:`.bob/ + AGENTS.md`,removeProject:`.bob/ + the AGENTS.md block`,removeGlobal:`~/.bob's agents/skills + the AGENTS.md block + settings hooks`},{id:`openclaude`,label:`OpenClaude`,deployAdds:`.openclaude/ + its CLAUDE.md`,removeProject:`.openclaude/ + its CLAUDE.md block`,removeGlobal:`~/.openclaude's agents/skills + the CLAUDE.md block + settings hooks`}],Kt=e=>Gt.find(t=>t.id===e)||Gt[0],qt=(e,t)=>t===`project`?Kt(e).removeProject:Kt(e).removeGlobal,Jt=e=>String(e||``).replace(/[\\/]+$/,``).split(/[\\/]/).pop()||e,Yt=e=>e.scope===`global`?Kt(e.host).label:Jt(e.path),Xt=`geneseed-harness`,Zt=Gt.map(({id:e,label:t})=>({id:e,label:t}));function Qt(e=`opencode`){let[t,n]=Ge(Xt,e=>Zt.some(t=>t.id===e)?e:null);return[t??e,n]}function $t(e){let t=String(e||``);return Gt.find(e=>t.startsWith(e.id))?.id||`opencode`}var en=Object.entries(z).flatMap(([e,t])=>(B[e]||[``]).map(n=>{let r=n?t+` / `+de[n]:t;return{kind:`Pages`,sortKey:-1,title:r,desc:``,hay:r.toLowerCase(),route:e===`overview`?`#/`:`#/`+e+(n?`/`+n:``)}}));function tn(e=0){let[t,n]=(0,R.useState)(null),[r,i]=(0,R.useState)(``),o=(0,R.useRef)(null),[s]=Qt(),c=`${e}|${s}`,[l,u]=(0,R.useState)(c);return l!==c&&(u(c),n(null)),(0,R.useEffect)(()=>{o.current=null},[c]),{index:t,error:r,prime:(0,R.useCallback)(()=>{if(t||o.current)return o.current;let e=(async()=>{let e=[],t=[`laws`,`skills`,...P],r=await Promise.all(t.map(async e=>{try{return{sec:e,items:(await a.catalog(e))?.items||[]}}catch{return{sec:e,items:[]}}}));for(let{sec:n,items:i}of r){let r=te[n];for(let a of i){let i=a.title||a.name;e.push({kind:r.label,sortKey:t.indexOf(n),title:i,desc:a.desc||``,hay:`${i} ${a.desc||``} ${a.name||``}`.toLowerCase(),route:`#/item/${r.type}/${encodeURIComponent(a.name)}`})}}try{let t=await a.mcp(),n=new Set;for(let r of t?.targets||[])for(let t of r.servers||[]){if(n.has(t.name))continue;n.add(t.name);let r=t.label||t.name;e.push({kind:`MCP servers`,sortKey:100,title:r,desc:t.desc||``,hay:`${r} ${t.desc||``} ${t.name||``} mcp`.toLowerCase(),route:`#/installs/hosts`})}}catch{}try{let t=await a.docs(s);for(let n of t?.groups||[])for(let t of n.pages||[])e.push({kind:`Docs`,sortKey:110,title:t.title,desc:n.label,hay:`${t.title||``} ${t.id||``} ${n.label||``} ${t.section||``} ${t.description||``}`.toLowerCase(),route:`#/docs/${encodeURIComponent(t.id)}`})}catch{}return n(e),o.current=null,e})().catch(e=>(o.current=null,i(e.message||String(e)),[]));return o.current=e,e},[t,s])}}function nn({open:e,title:t,children:n,confirmLabel:r,tone:i,onConfirm:a,onClose:o}){let s=(0,R.useRef)(null),c=(0,R.useRef)(null),l=(0,R.useRef)(null),u=(0,R.useId)(),d=i===`danger`;return(0,R.useEffect)(()=>{let t=s.current;t&&(e&&!t.open&&(typeof t.showModal==`function`?t.showModal():t.setAttribute(`open`,``)),e&&(d?c:l).current?.focus(),!e&&t.open&&(typeof t.close==`function`?t.close():t.removeAttribute(`open`)))},[e,d]),(0,K.jsxs)(`dialog`,{ref:s,className:`confirm`,"aria-labelledby":`${u}-title`,"aria-describedby":`${u}-body`,onCancel:o,onClose:o,children:[(0,K.jsx)(`h3`,{className:`confirm-title`,id:`${u}-title`,children:t}),(0,K.jsx)(`div`,{className:`confirm-body`,id:`${u}-body`,children:n}),(0,K.jsxs)(`div`,{className:`confirm-actions`,children:[(0,K.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:o,ref:c,children:`Cancel`}),(0,K.jsx)(`button`,{type:`button`,className:d?`btn danger`:`btn`,onClick:a,ref:l,children:r||`Confirm`})]})]})}var rn=(0,R.createContext)(null),an=()=>{throw Error(`useConfirm() needs a <ConfirmProvider> above it`)};function on(){return(0,R.useContext)(rn)||an}function sn({children:e}){let[t,n]=(0,R.useState)(null),r=(0,R.useRef)(null),i=e=>{let t=r.current;r.current=null,n(null),t?.(e)},a=(0,R.useCallback)((e,t={})=>new Promise(i=>{r.current?.(!1),r.current=i,n({msg:e,...t})}),[]);return(0,K.jsxs)(rn.Provider,{value:a,children:[e,(0,K.jsx)(nn,{open:!!t,title:t?.title||`Are you sure?`,confirmLabel:t?.confirmLabel,tone:t?.tone,onConfirm:()=>i(!0),onClose:()=>i(!1),children:t?.msg})]})}var cn=24;function ln(e,t){let n=e.title.toLowerCase();return n.startsWith(t)?0:n.includes(t)?1:e.hay.includes(t)?2:-1}function un(e,t){let n=t.toLowerCase().trim();if(!e)return[];if(!n)return e.filter(e=>e.sortKey<0).sort((e,t)=>e.sortKey-t.sortKey);let r=[];for(let t of e){let e=ln(t,n);e>=0&&r.push({e:t,s:e})}r.sort((e,t)=>e.e.sortKey-t.e.sortKey||e.s-t.s||e.e.title.localeCompare(t.e.title));let i=r.map(e=>e.e),a=i.filter(e=>e.sortKey>=0).slice(0,cn);return i.filter(e=>e.sortKey<0).concat(a)}function dn(e,t){let n=t.trim().toLowerCase(),r=n?e.toLowerCase().indexOf(n):-1;return r<0?e:(0,K.jsxs)(K.Fragment,{children:[e.slice(0,r),(0,K.jsx)(`mark`,{className:`spot-hit`,children:e.slice(r,r+n.length)}),e.slice(r+n.length)]})}function fn({query:e,index:t,loading:n,error:r,active:i,onActive:a,onPick:o}){let s=(0,R.useMemo)(()=>un(t,e),[t,e]),c=(0,R.useRef)(null),l=s.length>0;(0,R.useLayoutEffect)(()=>{let e=c.current?.querySelectorAll(`[data-spot-row]`);if(!l||!e?.length||!E())return;let t=T(e,{opacity:[0,1],translateY:[-4,0],duration:220,delay:se(18),ease:`outQuart`});return O(t,220+18*e.length)},[l]),(0,R.useEffect)(()=>{i>=s.length&&a(0)},[s,i,a]),(0,R.useEffect)(()=>{(c.current?.querySelector(`[data-spot-row="${i}"]`))?.scrollIntoView({block:`nearest`})},[i]);let u=[],d=null;s.forEach((e,t)=>{(!d||d.kind!==e.kind)&&(d={kind:e.kind,rows:[]},u.push(d)),d.rows.push({entry:e,index:t})});let f=!!e.trim();return(0,K.jsxs)(`div`,{className:`spotlight`,ref:c,id:`spotlight-list`,role:`listbox`,"aria-label":`Search results`,children:[u.map(t=>(0,K.jsxs)(`div`,{className:`spot-group`,role:`group`,"aria-label":t.kind,children:[(0,K.jsx)(`div`,{className:`spot-group-head`,"aria-hidden":`true`,children:t.kind}),t.rows.map(({entry:t,index:n})=>(0,K.jsxs)(`div`,{id:`spot-opt-${n}`,"data-spot-row":n,role:`option`,"aria-selected":n===i,className:`spot-row ${n===i?`on`:``}`,onMouseDown:e=>{e.preventDefault(),o(t)},onMouseEnter:()=>a(n),children:[(0,K.jsx)(`div`,{className:`spot-title`,children:dn(t.title,e)}),t.desc?(0,K.jsx)(`div`,{className:`spot-desc`,children:t.desc}):null]},`${t.route||t.title}-${n}`))]},`${t.kind}-${t.rows[0].index}`)),f&&r&&(0,K.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`Could not load the search index — `,r]}),f&&n&&!r&&(0,K.jsx)(`div`,{className:`spot-empty`,role:`presentation`,children:`Loading…`}),f&&!n&&!r&&s.length===0&&(0,K.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`No matches for “`,e,`”.`]})]})}function pn({actions:e=[],dataRev:t}){let n=(0,R.useRef)(null),r=(0,R.useRef)(null),i=(0,R.useRef)(null),[a,o]=(0,R.useState)(!1),[s,c]=(0,R.useState)(``),[l,u]=(0,R.useState)(0),{index:d,error:f,prime:p}=tn(t),m=on(),h=()=>{o(!0),p()},g=()=>{let e=n.current;e?.open&&(typeof e.close==`function`?e.close():e.removeAttribute(`open`)),o(!1),c(``),u(0),i.current?.focus()};(0,R.useEffect)(()=>{let e=n.current;a&&e&&!e.open&&(typeof e.showModal==`function`?e.showModal():e.setAttribute(`open`,``),r.current?.focus())},[a]),(0,R.useEffect)(()=>{let e=e=>{((e.metaKey||e.ctrlKey)&&!e.altKey&&e.key.toLowerCase()===`k`||e.key===`/`&&!e.target.closest(`input, textarea, select`))&&(e.preventDefault(),o(!0),p())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[p]);let _=(0,R.useMemo)(()=>[...e.map(e=>({sortKey:-2,...e})),...en,...d||[]],[e,d]),v=a?un(_,s):[],y=l<v.length?`spot-opt-${l}`:void 0,b=async e=>{if(g(),!e.run)return ye(e.route);let t=e.confirm;(!t||await m(t.msg,{title:t.title,confirmLabel:t.confirmLabel,tone:t.tone}))&&e.run()};return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`button`,{type:`button`,className:`tb-cmdk`,ref:i,"aria-haspopup":`dialog`,onClick:h,title:`Press / to open, or Ctrl-K / ⌘K from inside any field`,children:[(0,K.jsx)(q,{name:`search`,className:`mag glyph`}),(0,K.jsx)(`span`,{className:`tb-cmdk-label`,children:`Search or run…`}),(0,K.jsx)(`kbd`,{className:`tb-cmdk-key`,children:`Ctrl K`})]}),(0,K.jsx)(`dialog`,{ref:n,className:`palette`,"aria-label":`Search or run`,onCancel:e=>{e.preventDefault(),g()},onClose:()=>a&&g(),onClick:e=>e.target===n.current&&g(),children:a&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`palette-head`,children:[(0,K.jsx)(q,{name:`search`,className:`mag glyph`}),(0,K.jsx)(`input`,{ref:r,role:`combobox`,"aria-label":`Search or run`,"aria-autocomplete":`list`,"aria-expanded":`true`,"aria-controls":`spotlight-list`,"aria-activedescendant":y,value:s,onChange:e=>{c(e.target.value),u(0)},onKeyDown:e=>{if(e.key===`ArrowDown`)e.preventDefault(),u(e=>Math.min(e+1,Math.max(v.length-1,0)));else if(e.key===`ArrowUp`)e.preventDefault(),u(e=>Math.max(e-1,0));else if(e.key===`Enter`){let t=v[l];t&&(e.preventDefault(),b(t))}else e.key===`Escape`&&(e.preventDefault(),s?(c(``),u(0)):g())},placeholder:`Search or run…`}),(0,K.jsx)(`kbd`,{className:`palette-key`,children:`Esc`})]}),(0,K.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:v.length?`${v.length} results`:`no matches`}),(0,K.jsx)(fn,{query:s,index:_,loading:!d,error:d?``:f,active:l,onActive:u,onPick:b}),(0,K.jsxs)(`div`,{className:`palette-foot`,children:[(0,K.jsx)(`span`,{children:`↑↓ move`}),(0,K.jsx)(`span`,{children:`↵ open`}),(0,K.jsx)(`span`,{children:`actions that write always ask first`})]})]})})]})}function mn({installs:e,onSwitch:t,fallback:n=null}){let r=(e||[]).filter(e=>e.state===`active`);if(r.length<2)return n;let i=r.find(e=>e.selected)||r[0];return(0,K.jsx)(`select`,{className:`sel tb-harness`,"aria-label":`Harness to view`,title:`Harness the console is viewing`,value:i.id,onChange:async e=>{let n=r.find(t=>t.id===e.target.value);if(n)try{await a.selectView(n.host,n.path),t?.()}catch{}},children:r.map(e=>(0,K.jsx)(`option`,{value:e.id,children:e.scope===`global`?`${e.host} · global`:`${Yt(e)} · ${e.host}`},e.id))})}var hn=`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`;function gn({open:e,onClose:t,anchorRef:n,label:r,className:i,children:a}){let o=(0,R.useRef)(null);return(0,R.useEffect)(()=>{if(!e)return;let r=o.current,i=n?.current;(r.querySelector(hn)||r).focus();let a=e=>{e.key===`Escape`&&t()},s=e=>{r.contains(e.target)||i?.contains(e.target)||t()};return document.addEventListener(`keydown`,a),document.addEventListener(`mousedown`,s),()=>{document.removeEventListener(`keydown`,a),document.removeEventListener(`mousedown`,s);let e=document.activeElement;(!e||e===document.body||r.contains(e))&&i?.focus()}},[e]),e?(0,K.jsx)(`div`,{ref:o,className:i?`popover ${i}`:`popover`,role:`dialog`,"aria-label":r,tabIndex:-1,children:a}):null}function _n({children:e,...t}){let n=D(`button.on`);return(0,K.jsxs)(`div`,{className:`seg`,role:`group`,ref:n,...t,children:[(0,K.jsx)(`span`,{className:`glide`,"aria-hidden":`true`}),e]})}function vn({value:e,onChange:t,labelledBy:n}){let r=ut(e);return(0,K.jsxs)(`div`,{className:`accent-picker`,role:`group`,"aria-labelledby":n,children:[ot.map(n=>(0,K.jsx)(`button`,{type:`button`,className:`accent-src${e===n.id?` on`:``}`,"aria-pressed":e===n.id,title:n.tagline,onClick:()=>t(n.id),children:n.short},n.id)),(0,K.jsxs)(`div`,{className:`accent-swatches`,children:[st.map(n=>(0,K.jsx)(`button`,{type:`button`,className:`accent-swatch${e===n.id?` on`:``}`,style:{"--sw":n.hex},"aria-pressed":e===n.id,"aria-label":`${n.short} accent`,title:n.short,onClick:()=>t(n.id)},n.id)),(0,K.jsx)(`label`,{className:`accent-swatch accent-custom${r?` on picked`:``}`,style:r?{"--sw":r}:void 0,title:r?`Your colour, ${r}`:`Pick any colour`,children:(0,K.jsx)(`input`,{type:`color`,"aria-label":`Custom accent colour`,value:(r||`#3AD4C4`).toLowerCase(),onChange:e=>t(`hex:${e.target.value.toUpperCase()}`)})})]})]})}function yn({flavour:e,onFlavour:t,accentMode:n,onAccentMode:r,layout:i,onLayout:a,onClose:o,anchorRef:s}){let c=(e,t,n,r,i)=>(0,K.jsxs)(`div`,{className:`ap-group`,children:[(0,K.jsx)(`span`,{className:`ap-label`,id:e,children:t}),(0,K.jsx)(_n,{"aria-labelledby":e,children:n.map(e=>(0,K.jsx)(`button`,{type:`button`,className:r===e.id?`on`:``,"aria-pressed":r===e.id,title:e.tagline,onClick:()=>i(e.id),children:e.short},e.id))})]});return(0,le.createPortal)((0,K.jsxs)(gn,{open:!0,onClose:o,anchorRef:s,label:`Appearance`,className:`appearance-pop`,children:[c(`ap-skin`,`Skin`,Ye,e,t),(0,K.jsxs)(`div`,{className:`ap-group`,children:[(0,K.jsx)(`span`,{className:`ap-label`,id:`ap-accent`,children:`Accent`}),(0,K.jsx)(vn,{value:n,onChange:r,labelledBy:`ap-accent`})]}),c(`ap-view`,`Overview view`,gt,i,a)]}),document.querySelector(`.app`)||document.body)}function bn({route:e,navOpen:t,onToggleNav:n,overview:r,installs:i,actions:a,mode:o,onToggleMode:s,appearance:c,dataRev:l,onSwitch:u}){let[d,f]=(0,R.useState)(!1),p=(0,R.useRef)(null),m=r?.install,h=m?`${m.host}:${m.scope}`:At(r?.target),g=e.tab&&de[e.tab];return(0,K.jsxs)(`header`,{className:`topbar`,children:[(0,K.jsx)(`button`,{type:`button`,className:`tb-menu iconbtn`,onClick:n,"aria-label":t?`Close navigation`:`Open navigation`,"aria-expanded":!!t,"aria-controls":`rail-nav`,children:(0,K.jsx)(q,{name:t?`x`:`menu`})}),(0,K.jsx)(`nav`,{className:`crumbs`,"aria-label":`Breadcrumb`,children:(0,K.jsxs)(`ol`,{children:[(0,K.jsx)(`li`,{className:`crumb-root mono`,children:(0,K.jsx)(mn,{installs:i,onSwitch:u,fallback:(0,K.jsx)(`a`,{href:`#/installs`,title:r?.target||void 0,children:h})})}),(0,K.jsx)(`li`,{children:g?(0,K.jsx)(`a`,{href:e.page===`overview`?`#/`:`#/${e.page}`,children:z[e.page]}):(0,K.jsx)(`span`,{className:`crumb-here`,"aria-current":`page`,children:z[e.page]})}),g?(0,K.jsx)(`li`,{children:(0,K.jsx)(`span`,{className:`crumb-here`,"aria-current":`page`,children:g})}):null]})}),(0,K.jsx)(`div`,{className:`topbar-spacer`}),(0,K.jsx)(pn,{actions:a,dataRev:l}),(0,K.jsx)(`button`,{type:`button`,className:`iconbtn`,ref:p,"aria-label":`Appearance`,title:`Appearance`,"aria-expanded":d,onClick:()=>f(e=>!e),children:(0,K.jsx)(q,{name:`themes`})}),d?(0,K.jsx)(yn,{...c,anchorRef:p,onClose:()=>f(!1)}):null,(0,K.jsx)(`button`,{type:`button`,className:`iconbtn`,title:o===`light`?`Switch to dark`:`Switch to light`,"aria-label":o===`light`?`Switch to dark mode`:`Switch to light mode`,onClick:s,children:(0,K.jsx)(q,{name:o===`light`?`moon`:`sun`})})]})}function xn({themes:e,current:t,onPick:n,onClose:r}){let i=on(),a=(0,R.useRef)(null);return(0,R.useEffect)(()=>{let e=e=>{a.current&&!a.current.contains(e.target)&&r()},t=e=>{e.key===`Escape`&&r()};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]),(0,R.useEffect)(()=>{a.current?.querySelector(`button.pop-item`)?.focus()},[]),(0,K.jsxs)(`div`,{className:`pop`,ref:a,role:`dialog`,"aria-label":`Switch voice`,children:[(0,K.jsx)(`div`,{className:`tick`,style:{padding:`4px 10px 8px`},children:`Switch voice`}),e.map(e=>(0,K.jsxs)(`button`,{type:`button`,"aria-pressed":e.name===t,className:`pop-item ${e.name===t?`on`:``}`,onClick:async()=>{r(),await i(`Rebuild the deployed harness in the “${e.name}” voice? It rebuilds in place, non-destructive.`,{title:`Switch voice?`,confirmLabel:`Rebuild`})&&n(e.name)},children:[(0,K.jsx)(`span`,{className:`po`,style:{background:V(e.accent),boxShadow:`0 0 8px ${V(e.accent)}`}}),(0,K.jsx)(`span`,{className:`pn`,children:e.name})]},e.name))]})}var Sn=3500;function Cn({toast:e,onClose:t}){let[n,r]=(0,R.useState)(null),i=!!e&&e.kind!==`err`&&n!==e;(0,R.useEffect)(()=>{if(!i)return;let e=setTimeout(t,Sn);return()=>clearTimeout(e)},[e,i]);let a=()=>r(e),o=()=>r(null);return(0,K.jsx)(`div`,{className:`toast-region`,"aria-live":e?.kind===`err`?void 0:`polite`,children:e&&(0,K.jsxs)(`div`,{className:`toast ${e.kind}`,role:e.kind===`err`?`alert`:void 0,onMouseEnter:a,onMouseLeave:e=>{e.currentTarget.contains(document.activeElement)||o()},onFocus:a,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||o()},children:[(0,K.jsx)(`div`,{children:e.msg}),(0,K.jsx)(`div`,{style:{marginTop:8},children:(0,K.jsx)(`button`,{className:`btn ghost`,onClick:t,children:`Dismiss`})})]})})}function wn({runs:e,open:t,onToggle:n,onClear:r,onCancel:i,busy:a,finish:o}){let s=(0,R.useRef)(null),c=(0,R.useRef)(null);(0,R.useEffect)(()=>{let e=c.current;o&&e&&(e.classList.remove(`flash-ok`,`flash-bad`),e.offsetWidth,e.classList.add(o.status===`done`?`flash-ok`:`flash-bad`))},[o]);let l=e.length?e[e.length-1].output.length:0;return(0,R.useEffect)(()=>{let e=s.current;e&&t&&(e.scrollTop=e.scrollHeight)},[e.length,l,t]),(0,K.jsxs)(`div`,{className:`console`,style:{height:`42vh`,transform:t?`none`:`translateY(calc(42vh - 42px))`},children:[(0,K.jsxs)(`div`,{className:`console-head`,ref:c,onClick:n,onAnimationEnd:e=>{e.target===e.currentTarget&&e.currentTarget.classList.remove(`flash-ok`,`flash-bad`)},children:[a&&(0,K.jsx)(`span`,{className:`console-progress`,"aria-hidden":`true`}),(0,K.jsxs)(`span`,{className:`ttl`,children:[(0,K.jsx)(`span`,{className:`live ${a?`on`:``}`}),`terminal`]}),(0,K.jsx)(`span`,{className:`count`,children:e.length}),(0,K.jsxs)(`div`,{className:`right`,onClick:e=>e.stopPropagation(),children:[(0,K.jsx)(`button`,{className:`iconbtn`,title:`Clear`,"aria-label":`Clear run history`,onClick:r,disabled:!e.length,children:(0,K.jsx)(q,{name:`clear`})}),(0,K.jsx)(`button`,{className:`iconbtn`,title:t?`Collapse`:`Expand`,"aria-label":t?`Collapse console`:`Expand console`,"aria-expanded":t,onClick:n,children:(0,K.jsx)(q,{name:`chevron`,className:`glyph`,style:{transform:t?`rotate(90deg)`:`rotate(-90deg)`}})})]})]}),t&&(0,K.jsxs)(`div`,{className:`console-body`,ref:s,children:[e.length===0&&(0,K.jsx)(`div`,{className:`console-empty`,children:`No commands run yet. Actions you trigger stream here.`}),e.map(e=>(0,K.jsxs)(`div`,{className:`run`,children:[(0,K.jsxs)(`div`,{className:`run-head`,children:[(0,K.jsx)(`span`,{className:`pr`,children:`$`}),(0,K.jsx)(`span`,{className:`act`,children:e.action}),(0,K.jsx)(`span`,{className:`st ${e.status}`,children:e.status===`running`?`…running`:`${e.status===`done`?`✓ done`:`✗ failed`}${e.duration?` · ${e.duration}s`:``}`}),e.status===`running`&&i&&(0,K.jsx)(`button`,{className:`iconbtn run-cancel`,title:`Cancel this run`,"aria-label":`Cancel the ${e.action} run`,onClick:()=>i(e.id),children:(0,K.jsx)(q,{name:`x`})})]}),e.output&&(0,K.jsx)(`pre`,{className:`run-out`,children:e.output})]},e.id))]})]})}var Tn=550,En=`gs-splash-seen`;function Dn(){try{if(window.localStorage.getItem(En))return 0;window.localStorage.setItem(En,`1`)}catch{}return Tn}function On({ready:e,onDone:t}){let[n,r]=(0,R.useState)(!1),[i,a]=(0,R.useState)(!1);return(0,R.useEffect)(()=>{let e=setTimeout(()=>r(!0),Dn());return()=>clearTimeout(e)},[]),e&&n&&!i&&a(!0),(0,R.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>t?.(),700);return()=>clearTimeout(e)},[i]),(0,K.jsxs)(`div`,{className:`boot-splash${i?` fading`:``}`,"aria-hidden":`true`,onAnimationEnd:e=>{e.animationName===`splashOut`&&t?.()},children:[(0,K.jsxs)(`div`,{className:`boot-dial`,children:[(0,K.jsxs)(`svg`,{className:`boot-ring`,viewBox:`0 0 172 172`,children:[(0,K.jsx)(`circle`,{cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--surface-3)`,strokeWidth:`9`}),(0,K.jsx)(`circle`,{cx:`86`,cy:`86`,r:`50`,fill:`none`,stroke:`var(--line-2)`,strokeWidth:`8`,strokeDasharray:`1.2 5.3`,opacity:`.7`}),(0,K.jsx)(`circle`,{className:`boot-progress`,cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--accent)`,strokeWidth:`9`,strokeLinecap:`round`})]}),(0,K.jsxs)(`svg`,{className:`boot-sprout`,viewBox:`0 0 24 24`,children:[(0,K.jsx)(`path`,{className:`bs-stem`,d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,K.jsx)(`path`,{className:`bs-leaf bs-leaf-main`,d:`M12 13c0-4.5 3.2-7.5 7.5-7.5 0 4.5-3.2 7.5-7.5 7.5z`,fill:`var(--accent)`}),(0,K.jsx)(`path`,{className:`bs-leaf bs-leaf-back`,d:`M12 14.5c0-3.6-2.6-6-6-6 0 3.6 2.6 6 6 6z`,fill:`var(--accent)`,opacity:`.42`}),(0,K.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})]}),(0,K.jsxs)(`div`,{className:`boot-status`,children:[(0,K.jsx)(`span`,{children:`germinating harness`}),(0,K.jsx)(`span`,{className:`boot-caret`})]})]})}function kn({label:e=`Loading…`}){return(0,K.jsxs)(`div`,{className:`loading`,role:`status`,children:[e,(0,K.jsxs)(`div`,{className:`skel`,"aria-hidden":`true`,children:[(0,K.jsx)(`div`,{className:`skel-bar`}),(0,K.jsx)(`div`,{className:`skel-bar`}),(0,K.jsx)(`div`,{className:`skel-bar`})]})]})}function An({error:e,style:t,onRetry:n,role:r=`alert`}){return e?n?(0,K.jsxs)(`div`,{className:`error-state`,role:r,style:t,children:[(0,K.jsx)(`p`,{className:`badge bad`,children:e}),(0,K.jsx)(`button`,{type:`button`,className:`btn sm`,onClick:n,children:`Retry`})]}):(0,K.jsx)(`p`,{className:`badge bad`,role:r,style:t,children:e}):null}function jn(){let[e,t]=(0,R.useState)(!1),[n,r]=(0,R.useState)(null);return(0,K.jsxs)(`div`,{className:`stale-banner`,role:`alert`,children:[(0,K.jsx)(`span`,{children:n||`This console is running code from before your last upgrade.`}),(0,K.jsx)(`button`,{className:`btn sm`,onClick:async()=>{t(!0),r(null);try{await it()}catch(e){r(e.message),t(!1)}},disabled:e,children:e?`Restarting…`:`Restart`})]})}var Mn=/dynamically imported module|Importing a module script failed|Unable to preload CSS/i,Nn=e=>Mn.test(e?.message||``),Pn=class extends R.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}render(){let{error:e}=this.state;if(!e)return this.props.children;let t=Nn(e);return(0,K.jsxs)(`div`,{role:t?void 0:`alert`,children:[(0,K.jsx)(An,{error:e.message||String(e),role:null}),t?(0,K.jsx)(jn,{}):(0,K.jsx)(`button`,{type:`button`,className:`btn sm`,onClick:()=>this.setState({error:null}),children:`Retry`})]})}},Fn=(0,R.createContext)(null),In=e=>[...e].sort().join(`,`),Ln=e=>[...e.values()].some(e=>!e.applied&&In(e.value)!==e.base);function Rn(e,t){let[n,r]=(0,R.useState)(()=>({kits:new Map,rules:new Map})),[i,a]=(0,R.useState)(null),[o,s]=(0,R.useState)(t);if(o!==t&&(s(t),i&&t)){let e=t.status===`done`?{applied:!0}:{failed:!0};r(t=>{let n=t[i.kind].get(i.key);return n?{...t,[i.kind]:new Map(t[i.kind]).set(i.key,{...n,...e})}:t}),a(null)}let c=Ln(n.kits)||Ln(n.rules);return(0,R.useEffect)(()=>{if(!c)return;let e=e=>{e.preventDefault(),e.returnValue=``};return window.addEventListener(`beforeunload`,e),()=>window.removeEventListener(`beforeunload`,e)},[c]),{get:(e,t)=>n[e].get(t),put:(e,t,n,i)=>r(r=>{let a=new Map(r[e]);return In(n)===i?a.delete(t):a.set(t,{value:n,base:i}),{...r,[e]:a}}),drop:(e,t)=>r(n=>{let r=new Map(n[e]);return r.delete(t),{...n,[e]:r}}),prune:(0,R.useCallback)((e,t)=>r(n=>{let r=[...n[e]].filter(([e,n])=>t(e,n)).map(([e])=>e);if(!r.length)return n;let i=new Map(n[e]);return r.forEach(e=>i.delete(e)),{...n,[e]:i}}),[]),startApply:(e,t)=>{a({kind:e,key:t}),r(n=>{let r=n[e].get(t);return r?.failed?{...n,[e]:new Map(n[e]).set(t,{value:r.value,base:r.base})}:n})},running:(t,n)=>!!e&&i?.kind===t&&i?.key===n}}function zn({activeId:e,finish:t,children:n}){let r=Rn(e,t);return(0,K.jsx)(Fn.Provider,{value:r,children:n})}function Bn(){let e=Rn(null,null);return(0,R.useContext)(Fn)||e}function Vn({eyebrow:e,title:t,sub:n,primary:r,actions:i,crumbs:a}){return(0,K.jsxs)(`div`,{className:`page-head`,children:[(0,K.jsxs)(`div`,{children:[a?.length?(0,K.jsx)(`nav`,{"aria-label":`Breadcrumb`,className:`page-crumbs`,children:(0,K.jsx)(`ol`,{children:a.map((e,t)=>(0,K.jsx)(`li`,{children:t===a.length-1?(0,K.jsx)(`span`,{"aria-current":`page`,children:e.label}):e.href?(0,K.jsx)(`a`,{href:e.href,children:e.label}):e.label},t))})}):null,e?(0,K.jsx)(`div`,{className:`eyebrow`,children:e}):null,(0,K.jsx)(`h1`,{className:`h`,children:t}),n?(0,K.jsx)(`p`,{className:`sub`,children:n}):null]}),r||i?(0,K.jsxs)(`div`,{className:`page-actions`,children:[i,r]}):null]})}var Hn=e=>!!e&&!e.endsWith(`-global`);function Un({onAction:e}){let{data:t,error:n}=U(()=>a.themes(),[]),[r,i]=(0,R.useState)(``),[o,s]=(0,R.useState)(``),[c,l]=(0,R.useState)(``),[u,d]=(0,R.useState)(``),[f,p]=(0,R.useState)(!1);if(n)return(0,K.jsx)(An,{error:n});if(!t)return(0,K.jsx)(kn,{});let m=r||t.current?.theme||`neutral`,h=(t.emits||[]).filter(e=>e.name!==`files`),g=t.emits?.some(e=>e.name===`opencode-global`),_=o||(g?`opencode-global`:t.current?.emit||h[0]?.name||``),v=i,y=s,b=Hn(_);return(0,K.jsxs)(`div`,{className:`narrow-lg`,children:[(0,K.jsx)(`div`,{className:`head-row mb-18`,children:(0,K.jsxs)(`div`,{children:[(0,K.jsx)(`h1`,{className:`h`,children:`Deploy your harness`}),(0,K.jsx)(`p`,{className:`sub`,children:`Geneseed isn't implanted on this machine yet. Pick a voice and an install mode, then deploy. The graft runs in the console below, and this dashboard lights up when it lands.`})]})}),(0,K.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,K.jsx)(`div`,{className:`card-head`,children:(0,K.jsx)(`h3`,{children:`1 · Choose a voice`})}),(0,K.jsx)(`div`,{className:`row wrap gap-10`,children:t.themes.map(e=>(0,K.jsxs)(`button`,{className:`btn ${e.name===m?`soft`:`ghost`}`,onClick:()=>v(e.name),title:e.blurb||e.tagline||e.name,children:[(0,K.jsx)(`span`,{className:`po`,style:{width:10,height:10,borderRadius:`50%`,background:V(e.accent),boxShadow:`0 0 8px ${V(e.accent)}`}}),(0,K.jsx)(`span`,{style:{textTransform:`capitalize`},children:e.name})]},e.name))})]}),(0,K.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,K.jsx)(`div`,{className:`card-head`,children:(0,K.jsx)(`h3`,{children:`2 · Install mode`})}),(0,K.jsxs)(`p`,{className:`sub mb-16`,children:[`A `,(0,K.jsx)(`code`,{children:`-global`}),` mode deploys once to that tool's global config, so every repo on this machine inherits the harness (recommended). A project mode installs into the repository folder you choose.`]}),(0,K.jsxs)(`label`,{className:`stack`,style:{gap:6,maxWidth:360},children:[(0,K.jsx)(`span`,{className:`tick`,children:`Mode`}),(0,K.jsx)(`select`,{className:`sel`,value:_,onChange:e=>y(e.target.value),children:h.map(e=>(0,K.jsxs)(`option`,{value:e.name,children:[e.name,e.desc?` · ${e.desc}`:``]},e.name))})]}),b&&(0,K.jsxs)(`div`,{className:`row gap-10`,style:{maxWidth:560,marginTop:12},children:[(0,K.jsx)(`input`,{className:`inp`,style:{flex:1},type:`text`,placeholder:`/path/to/project, or click Browse…`,value:c,onChange:e=>l(e.target.value),"aria-label":`Project folder to install into`}),(0,K.jsx)(`button`,{className:`btn ghost sm`,disabled:f,onClick:async()=>{p(!0),d(``);try{let e=await a.pickFolder();e.path?l(e.path):e.error&&d(e.error)}catch(e){d(e.message)}finally{p(!1)}},children:f?`Choosing…`:`Browse…`})]}),u&&(0,K.jsx)(`p`,{className:`sub`,style:{marginTop:12},children:u})]}),(0,K.jsxs)(`button`,{className:`btn btn-grid`,disabled:!m||!_||b&&!c.trim(),onClick:()=>{if(!b)return e(`build`,{theme:m,emit:_});let t=c.trim();return t?(d(``),e(`deploy`,{host:_,path:t,theme:m})):d(`Choose or type the project folder to install into.`)},children:[(0,K.jsx)(q,{name:`build`}),`Deploy harness`]})]})}var Wn=e=>U(()=>a.rules().catch(()=>null),[e],`rules`,{revalidate:!0}),Gn=()=>wt(`rules`);function Kn({segments:e,value:t,max:n,size:r=120,stroke:i=12,label:a,sweepMs:o=650}){let s=n>0?n:0,c=e||[{key:`v`,label:a,n:Math.min(Math.max(t||0,0),s),tone:`accent`}],l=e?c.reduce((e,t)=>e+t.n,0):s,u=e?c.map(e=>`${e.label}: ${e.n} of ${l}`).join(`, `):`${c[0].n} of ${l}`,d=r/2-i/2,f=r/2,p=e=>[f+d*Math.cos(e),f+d*Math.sin(e)],m=[],h=0;for(let e of c)m.push(h),h+=e.n;let g=(0,R.useRef)(null),_=c.map(e=>e.n).join(`,`);return(0,R.useLayoutEffect)(()=>{let e=g.current?.querySelectorAll(`path.ring-arc`);if(!o||!e?.length||!E())return;let t=c.map(e=>e.n/l).filter(e=>e>0),n=t.map((e,n)=>t.slice(0,n).reduce((e,t)=>e+t,0)),r=L(e);k(r,{draw:`0 0`});let i=T(r,{draw:[`0 0`,`0 1`],duration:(e,n)=>Math.max(o*t[n],60),delay:(e,t)=>o*n[t],ease:`linear`});return O(i,o)},[_,o]),(0,K.jsxs)(`svg`,{className:`ring`,width:r,height:r,viewBox:`0 0 ${r} ${r}`,role:`img`,"aria-label":a?`${a}: ${u}`:u,children:[(0,K.jsx)(`circle`,{className:`ring-track`,cx:f,cy:f,r:d,fill:`none`,strokeWidth:i}),(0,K.jsx)(`g`,{ref:g,children:l>0?c.map((e,t)=>{let n=e.n/l;if(!(n>0))return null;let r=m[t]/l*2*Math.PI-Math.PI/2,a=r+n*2*Math.PI,[o,s]=p(r),[c,u]=p(a),h=n>=.9999?`M ${o} ${s} A ${d} ${d} 0 1 1 ${2*f-o} ${2*f-s} A ${d} ${d} 0 1 1 ${o} ${s}`:`M ${o} ${s} A ${d} ${d} 0 ${+(n>.5)} 1 ${c} ${u}`;return(0,K.jsx)(`path`,{className:`ring-arc tone-${e.tone||`muted`}`,d:h,fill:`none`,strokeWidth:i,children:(0,K.jsxs)(`title`,{children:[e.label,`: `,e.n]})},e.key)}):null})]})}var qn=500;function Jn({parts:e,total:t,label:n,legend:r=!0}){let i=e.reduce((e,t)=>e+t.n,0),a=t??i,o=e=>a>0?`${e/a*100}%`:`0%`,s=e.map(e=>`${e.label}: ${e.n} of ${a}`).join(`, `),c=(0,R.useRef)(null),l=e.map(e=>e.n).join(`,`)+`/${a}`;return(0,R.useLayoutEffect)(()=>{if(c.current&&E())return k(c.current,{scaleX:0}),O(T(c.current,{scaleX:[0,1],duration:qn,ease:`outExpo`}),qn)},[l]),(0,K.jsxs)(`div`,{className:`stackbar-box`,children:[(0,K.jsx)(`div`,{className:`stackbar sweep`,role:`img`,"aria-label":n?`${n}: ${s}`:s,ref:c,children:e.map(e=>e.n>0?(0,K.jsx)(`span`,{className:`tone-${e.tone||`muted`}`,style:{width:o(e.n)},title:`${e.label}: ${e.n}`},e.key):null)}),r&&(0,K.jsx)(`ul`,{className:`stackbar-legend`,"aria-hidden":`true`,children:e.map(e=>(0,K.jsxs)(`li`,{children:[(0,K.jsx)(`i`,{className:`tone-${e.tone||`muted`}`}),e.label,` `,(0,K.jsx)(`span`,{className:`mono`,children:e.n})]},e.key))})]})}function Yn({value:e,max:t,label:n=`value`,tone:r=`accent`}){let i=t>0?t:0;return(0,K.jsx)(Jn,{parts:[{key:`v`,label:n,n:Math.min(Math.max(e||0,0),i),tone:r}],total:i,legend:!1})}var Xn=864e5;function Zn(e,t=10,n=`today`){let r=Array(t).fill(0).map((e,r)=>({t:r===t-1?n:`${t-1-r}d`,v:0})),i=Date.now();for(let n of e){let e=n.started||n.finished||n.created||n.ts;if(!e)continue;let a=typeof e==`string`?Date.parse(e):e*1e3;if(!Number.isFinite(a))continue;let o=Math.floor((i-a)/Xn);o<0||o>=t||(r[t-1-o].v+=1)}return r}var Qn=(e,t)=>[...e||[]].sort((e,t)=>(t.started||0)-(e.started||0)).slice(0,t),$n=[`--emit`,`--theme`,`--scope`],er={done:`✓`,failed:`✗`};function tr(e){let t=(e.output||``).split(`
3
- `).find(e=>e.startsWith(`$ `))||``,n=t.split(/\s+/),r=[];return n.forEach((e,t)=>{let[i,a]=e.split(`=`),o=a||n[t+1];$n.includes(i)&&o&&!o.startsWith(`--`)&&r.push(o)}),{verb:(e.action||`run`).split(/[\s(]/)[0],scope:r.join(` · `),result:er[e.status]||`…`,duration:e.duration?`${e.duration}s`:`—`,command:t}}var nr={busy:{cls:`acc`,label:`working`,accent:`var(--accent)`},"waiting-input":{cls:`warn`,label:`your move`,accent:`var(--warn)`},blocked:{cls:`bad`,label:`blocked`,accent:`var(--bad)`},idle:{cls:``,label:`idle`,accent:`var(--line)`}},rr={cls:``,label:`ended`};function ir(e){if(!e)return``;let t=e.replace(/\\/g,`/`).replace(/\/+$/,``).split(`/`);return t[t.length-1]||e}var ar=e=>e?e<1e3?String(e):e<1e5?(e/1e3).toFixed(1)+`k`:e<1e6?(e/1e3).toFixed(0)+`k`:(e/1e6).toFixed(1)+`M`:`0`;function or(e){if(e=Math.max(0,Math.floor(e)),e<60)return`${e}s`;let t=Math.floor(e/60);return t<60?`${t}m ${e%60}s`:`${Math.floor(t/60)}h ${t%60}m`}function sr({startedAt:e}){let[t,n]=(0,R.useState)(()=>Date.now()/1e3);return(0,R.useEffect)(()=>{let e=setInterval(()=>n(Date.now()/1e3),1e3);return()=>clearInterval(e)},[]),or(t-e)}function cr({done:e,total:t}){let n=Math.min(t,10),r=Math.min(n,Math.round(e/t*n));return(0,K.jsxs)(`span`,{className:`act-todo`,children:[(0,K.jsx)(`span`,{className:`on`,children:`●`.repeat(r)}),(0,K.jsx)(`span`,{className:`dim`,children:`○`.repeat(n-r)})]})}var lr=e=>e.ended?null:e.turn_started_at,ur=e=>!!(e.tokens>0||e.cost>0||lr(e)||e.files?.count>0);function dr({s:e,heading:t,id:n,children:r}){let i=e.ended?rr:nr[e.status]||nr.idle,a=e.files,o=ur(e),s=e=>n?`${n}-${e}`:void 0;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`div`,{className:`row between wrap gap-12`,children:[t?(0,K.jsxs)(`div`,{className:`row gap-10 act-min`,children:[(0,K.jsx)(`span`,{className:`feed-dot act-dot ${e.ended?``:i.cls||`acc`}`}),(0,K.jsxs)(`div`,{className:`act-min`,children:[(0,K.jsx)(`h2`,{className:`act-title`,id:s(`t`),children:t}),e.cwd&&(0,K.jsx)(`div`,{className:`dim mono act-cwd`,title:e.cwd,children:e.cwd})]})]}):null,(0,K.jsxs)(`div`,{className:`row gap-8 act-fixed`,children:[e.model&&(0,K.jsx)(`span`,{className:`badge mono`,title:`model`,children:e.model}),e.agent&&(0,K.jsx)(`span`,{className:`badge`,children:e.agent}),(0,K.jsxs)(`span`,{className:`badge ${i.cls}`,id:s(`st`),children:[(0,K.jsx)(`span`,{className:`dot`}),i.label]}),r]})]}),e.phase&&(0,K.jsxs)(`div`,{className:`row gap-8 act-phase`,children:[(0,K.jsx)(q,{name:`activity`}),(0,K.jsx)(`span`,{className:`act-ell`,children:e.phase})]}),o&&(0,K.jsxs)(`div`,{className:`row wrap act-counters`,id:s(`c`),children:[e.tokens>0&&(0,K.jsxs)(`span`,{children:[ar(e.tokens),` tok`]}),e.cost>0&&(0,K.jsxs)(`span`,{children:[`$`,e.cost.toFixed(2)]}),lr(e)?(0,K.jsx)(`span`,{children:(0,K.jsx)(sr,{startedAt:e.turn_started_at})}):null,a&&a.count>0&&(0,K.jsxs)(`span`,{children:[a.count,` file`,a.count===1?``:`s`,` `,(0,K.jsxs)(`span`,{className:`t-good`,children:[`+`,a.additions]}),` `,(0,K.jsxs)(`span`,{className:`t-bad`,children:[`−`,a.deletions]})]})]}),(e.error||e.blocked_on)&&(0,K.jsx)(`div`,{className:`act-err-row`,children:(0,K.jsx)(`span`,{className:`badge bad act-ell`,title:e.error||e.blocked_on,children:e.error||e.blocked_on})})]})}var fr=e=>e?.status===`blocked`||e?.status===`waiting-input`,pr=864e5,J=e=>new Date(e).toISOString().slice(0,10),mr=(e,t)=>new Date(`${e}T00:00:00Z`).toLocaleDateString(`en-GB`,{...t,timeZone:`UTC`}),hr=e=>mr(e,{day:`numeric`,month:`short`});function gr(e,t=Date.now()){let n=mr(e,{weekday:`long`,day:`numeric`,month:`long`}),r=e===J(t)?`Today`:e===J(t-pr)?`Yesterday`:``;return r?`${r} · ${n}`:n}function _r(e,{now:t=Date.now(),days:n=14,cap:r}={}){let i=(e||[]).filter(e=>Number.isFinite(e.started)),a={};for(let e of i){let t=J(e.started*1e3);a[t]=(a[t]||0)+1}let o=i.length?J(Math.min(...i.map(e=>e.started))*1e3):null,s=i.filter(e=>e.status!==`running`).length,c=typeof r!=`number`||s>=r;return Array.from({length:n},(e,r)=>{let i=J(t-(n-1-r)*pr);return{key:i,n:a[i]||0,nodata:c&&(o===null||i<o)}})}var vr=(e,t)=>`${e} ${t}${e===1?``:`s`}`;function yr(e,t,n,r=Date.now()){let i={},a=e=>i[e]||={key:e,runs:[],asks:[]};for(let t of Qn(e,(e||[]).length))Number.isFinite(t.started)&&a(J(t.started*1e3)).runs.push(t);return(n||[]).forEach((e,n)=>{for(let r of t||[])r.per_day?.[n]>0&&a(e).asks.push([r.name,r.per_day[n]])}),Object.values(i).sort((e,t)=>e.key<t.key?1:-1).map(({key:e,runs:t,asks:n})=>{n.sort((e,t)=>t[1]-e[1]);let i=n.reduce((e,t)=>e+t[1],0),a=n.map(([e,t],n)=>`${e}${n?``:` asked`} ${t}×`).join(`, `),o=[t.length&&vr(t.length,`run`),i&&vr(i,`gate ask`)];return{key:e,title:gr(e,r),sum:o.filter(Boolean).join(` · `),runs:t,gate:i?{title:a,n:i}:null}})}var br=500;function xr({vals:e,i:t,sweep:n=!1}){let r=(0,R.useRef)(null),i=e.join(`,`);(0,R.useLayoutEffect)(()=>{if(n&&r.current&&E())return k(r.current,{strokeDasharray:1,strokeDashoffset:1}),O(T(r.current,{strokeDashoffset:[1,0],duration:br,ease:`outExpo`}),br)},[i,n]);let a=Math.max(1,...e),o=96/(e.length-1),s=e.map((e,t)=>`${(t*o).toFixed(1)},${(20-e/a*17).toFixed(1)}`),[c,l]=s[s.length-1].split(`,`);return(0,K.jsxs)(`svg`,{className:`spark`,viewBox:`0 0 96 22`,"aria-hidden":`true`,style:{"--i":t},children:[(0,K.jsx)(`polyline`,{points:`0,21 96,21`,className:`spk-base`}),(0,K.jsx)(`polygon`,{className:`spk-area`,points:`0,21 ${s.join(` `)} 96,21`}),(0,K.jsx)(`polyline`,{className:`spk-line`,pathLength:`1`,points:s.join(` `),ref:r}),(0,K.jsx)(`circle`,{className:`spk-end`,cx:c,cy:l,r:`2.4`})]})}function Sr(e,t){let n=(0,R.useRef)(null);return(0,R.useLayoutEffect)(()=>{let e=n.current?[...n.current.querySelectorAll(`[data-sweep]`)]:[];if(e.length&&E())return k(e,{[t]:0}),O(T(e,{[t]:[0,1],duration:br,ease:`outExpo`}),br)},[e,t]),n}var Y={security:`oklch(0.74 0.085 45)`,verify:`oklch(0.78 0.075 200)`,process:`oklch(0.76 0.075 150)`,craft:`oklch(0.78 0.085 95)`,context:`oklch(0.74 0.08 280)`,comms:`oklch(0.76 0.085 345)`},Cr={security:{label:`Security`,c:Y.security},verify:{label:`Verification`,c:Y.verify},process:{label:`Process`,c:Y.process},craft:{label:`Craft`,c:Y.craft},context:{label:`Context`,c:Y.context},comms:{label:`Communication`,c:Y.comms}},wr={craft:Y.craft,rigor:Y.verify,ops:Y.process,process:Y.security,comms:Y.comms},Tr=e=>wr[e]||`var(--text-3)`,Er={design:{label:`Design`,c:Y.context},build:{label:`Build`,c:Y.craft},review:{label:`Review`,c:Y.security},ship:{label:`Ship`,c:Y.process},understand:{label:`Understand`,c:Y.verify},learn:{label:`Learn`,c:Y.comms},harness:{label:`Harness`,c:`oklch(0.76 0.07 250)`},personal:{label:`Personal`,c:`oklch(0.72 0.025 250)`}},Dr=Object.keys(Er);function Or(e){let t=String(e||``),n=/\(retired\)\s*$/i.test(t);t=t.replace(/\s*\(retired\)\s*$/i,``),t=t.replace(/^(?:Rule\s+[IVXLCDM\d]+|Doctrine\s+[a-z]+\s+\d+)\s*[—-]\s*/i,``);let r=t.indexOf(` · `);return r===-1?{latin:``,name:t.trim(),retired:n}:{latin:t.slice(0,r).trim(),name:t.slice(r+3).trim(),retired:n}}var kr=[[10,`X`],[9,`IX`],[5,`V`],[4,`IV`],[1,`I`]],Ar=e=>{let t=``;for(let[n,r]of kr)for(;e>=n;)t+=r,e-=n;return t};function jr(e){let t=/^([a-z]+)-(\d+)$/.exec(String(e));return t?t[1]===`law`?Ar(Number(t[2])):`${t[1]}.${t[2]}`:String(e)}var Mr=new Set([`I`,`III`,`IV`,`process.1`,`process.5`,`rigor.5`,`ops.2`]),Nr={I:{key:`secretsGate`,label:`Secrets gate`},III:{key:`doneGate`,label:`Done gate`},IV:{key:`deletionGate`,label:`Deletion gate`}},Pr={I:{arm:`Writes that would carry a credential-shaped string are refused again.`,off:`A write carrying a credential-shaped string (on OpenCode, also a write to a key file) stops being refused. Rule I’s text still binds the agent; protected checks, real data loss and commit/push consent stay gated.`},III:{arm:`A turn that edited files cannot end before the project’s declared checks pass.`,off:`A turn that edited files may end without the checks in .geneseed/done-checks.txt passing. Rule III’s text still binds the agent; every other gate stays.`},IV:{arm:`Commands that would lose data nothing else holds ask again.`,off:`Commands that would really lose data — discarding uncommitted work, deleting an unpushed branch, removing untracked files — stop asking. Rule IV’s text still binds the agent; secrets, root-wide scans and commit/push consent stay gated.`}},Fr=[{key:`invariants`,source:`{{LAWS}}`,against:`—`},{key:`yours`,source:`user-rules.md`,against:`may tighten a {{LAW}}, never repeal one`},{key:`ethos`,source:`{{ONTOLOGY}}`,against:`never against a user rule`},{key:`doctrines`,source:`{{DOCTRINES}}`,against:`may tighten, never repeal`}],Ir=[{source:`mode`,label:`Mode`,against:`binds how work runs`},{source:`PROFILE.md, posture, theme`,label:`Profile, posture, theme`,against:`inform only; never bind`}],Lr=(e,t={})=>Nr[e]&&t?.[Nr[e].key]===!1?`Gate off`:Mr.has(e)?`Hook gate`:`Instruction`;function Rr(e){let t={};for(let n of e||[]){let e=Er[n.klass]?n.klass:`personal`,r=t[e]||(t[e]={key:e,label:Er[e].label,ok:0,exp:0});n.status===`experimental`?r.exp+=1:r.ok+=1}let n=Dr.filter(e=>t[e]).map(e=>({...t[e],n:t[e].ok+t[e].exp}));return{rows:n,total:n.reduce((e,t)=>e+t.n,0),experimental:n.reduce((e,t)=>e+t.exp,0),max:Math.max(1,...n.map(e=>e.n))}}var X=(e,t,n=t+`s`)=>`${e} ${e===1?t:n}`;function zr({overview:e,setup:t,rules:n,activity:r,profile:i,skills:a,laws:o}){let s=[],c=e?.doctor;c&&!c.ok&&s.push({id:`doctor`,tag:`Doctor`,tone:`bad`,title:`Doctor found ${X(c.problems.length,`problem`)}`,detail:c.problems[0]||``,where:`installs/doctor`,verb:`Review`,href:`#/installs/doctor`});let l=e?.diff,u=G(l);u&&s.push({id:`drift`,tag:`Drift`,tone:`warn`,title:`${X(u,`file`)} drifted from the source`,detail:`${l.edited} edited, ${l.added} added, ${l.missing} missing`,where:`installs/edits`,verb:`Review`,href:`#/installs/edits`}),i?.seeded&&s.push({id:`profile`,tag:`Profile`,tone:`warn`,title:`Profile is still the seeded template`,detail:`every section holds placeholder text`,where:`personal/profile`,verb:`Fill in`,href:`#/personal/profile`});let d=n?.exists?n.stats:null;d&&d.rules===0&&s.push({id:`rules`,tag:`Rules`,tone:``,title:`No standing rules yet`,detail:`0 of ${d.max_rules} · ${d.tokens} of ${d.max_tokens} tokens`,where:`personal/rules`,verb:`Write a rule`,href:`#/personal/rules`});let f=Object.entries(t?.gates?.asks||{}).sort((e,t)=>t[1]-e[1]);if(f.length){let[e,n]=f[0],r=jr(e),i=(o?.items||[]).find(e=>e.name===r),a=i?Or(i.title).name:r;s.push({id:`gates`,tag:`Gates`,tone:``,title:`${a} asked ${X(n,`time`)}`,detail:`${n} of ${t.gates.total} gate asks`,where:r,verb:`Review`,href:`#/item/law/${encodeURIComponent(r)}`})}if(a){let{rows:e,experimental:t}=Rr(a.items);t&&s.push({id:`skills`,tag:`Skills`,tone:``,title:`${X(t,`skill`)} still experimental`,detail:e.filter(e=>e.exp).sort((e,t)=>t.exp-e.exp).map(e=>`${e.label.toLowerCase()} ${e.exp}`).join(`, `),where:`library/skills`,verb:`Triage`,href:`#/skills`})}return t&&t.facts===0&&s.push({id:`memory`,tag:`Memory`,tone:``,title:`Memory holds no facts`,detail:`MEMORY.md is an empty index`,where:`library/memory`,verb:`Open`,href:`#/section/memory`}),r&&r.enabled===!1&&s.push({id:`activity`,tag:`Activity`,tone:``,title:`Session tracking is off`,detail:`no per-session trace is kept`,where:`activity`,verb:`Turn on`,href:`#/activity`}),s}var Br=e=>G(e.drift),Vr=e=>e.drift?.stale??0;function Hr(e){let t=t=>new Set((e?.never||[]).filter(e=>e.kind===t).map(e=>e.name)).size;return{skills:t(`skill`),agents:t(`agent`)}}function Ur(e){let t=e?.installs||[],n=t.filter(e=>e.state===`active`),r=t.length-n.length,i=n.filter(e=>e.verdict===`behind`).length,a=n.reduce((e,t)=>e+Br(t),0),o=n.reduce((e,t)=>e+Vr(t),0),s=e?.doctor,c=s&&!s.ok?`bad`:i||a||o?`warn`:`good`,l={good:`Harness healthy.`,warn:`Harness needs a look.`,bad:`Harness has problems.`}[c],u=[X(n.length,`active install`)+(r?`, ${r} disabled`:``),s?s.ok?`doctor clean`:`doctor found ${X(s.problems.length,`problem`)}`:`doctor not run yet`,i?`${X(i,`install`)} behind source`:`all in step with source`,a?`${X(a,`file`)} hand-edited`:`no hand edits`];return o&&u.push(`${X(o,`file`)} behind source`),{tone:c,head:l,facts:u}}var Wr=[[`carrier`,`Root file`],[`skills`,`Skill list`],[`agents`,`Agent list`],[`context`,`Session files`]],Gr=e=>e?e.carrier+e.skills+e.agents+e.context:0,Kr=e=>e.state===`active`&&(e.verdict===`behind`||G(e.drift)>0||(e.drift?.stale??0)>0),Z=e=>`≈${(e/4/1e3).toFixed(1)}k`,qr=e=>`${e.host} · ${e.scope}`,Jr=e=>({id:e.id,host:e.host,path:e.path,label:qr(e)});function Yr({fleet:e,usage:t,...n}){let r=[],i=e?.doctor;i&&!i.ok&&r.push({id:`doctor`,tag:`Doctor`,tone:`bad`,title:`Doctor found ${X(i.problems.length,`problem`)}`,detail:i.problems[0]||``,where:`installs/doctor`,verb:`Review`,href:`#/installs/doctor`});for(let t of(e?.installs||[]).filter(e=>e.state===`active`)){if(t.verdict===`behind`){let e=t.built_epoch?`built ${kt(t.built_epoch)} ago`:`never built`,n=Vr(t);r.push({id:`behind:${t.id}`,tag:`Behind`,tone:`warn`,title:`${qr(t)} is behind its source`,detail:n?`${e} · ${X(n,`file`)} behind`:e,where:t.host,verb:`Rebuild`,act:`rebuild`,installs:[Jr(t)]})}let e=Br(t);e&&r.push({id:`drift:${t.id}`,tag:`Drift`,tone:`warn`,title:`${qr(t)}: ${X(e,`file`)} edited by hand`,detail:`${t.drift.edited} edited, ${t.drift.added} added, ${t.drift.missing} missing`,where:`installs/edits`,verb:`Review`,href:`#/installs/edits`})}if(t&&t.days_counted>=30&&t.never?.length){let{skills:e,agents:n}=Hr(t);r.push({id:`usage`,tag:`Usage`,tone:``,sugg:!0,title:`${X(e,`skill`)} never fired in 30 days`,detail:`${X(n,`agent`)} too`,where:`library/skills`,verb:`Triage`,href:`#/skills`})}let a=zr({...n,overview:n.overview&&{...n.overview,doctor:null,diff:null}});for(let e of a)r.push({...e,sugg:!0});return r}function Xr(e,t){return(e?.rules||[]).map(e=>{let n=jr(e.rule),r=(t?.items||[]).find(e=>e.name===n);return{...e,name:r?Or(r.title).name:e.rule===`wiki`?`Wiki guard`:n}})}var Zr=e=>(e||[]).filter(e=>e.state===`active`&&e.cost);function Qr(e){let t=Zr(e).filter(e=>e.cost.ceiling>0&&Number.isFinite(e.cost.carrier)),n=e=>e.cost.carrier/e.cost.ceiling,r=t.find(e=>e.selected)||t.reduce((e,t)=>!e||n(t)>n(e)?t:e,null);if(!r)return null;let{carrier:i,ceiling:a}=r.cost;return{label:`${r.host} · ${r.scope}`,carrier:i,ceiling:a,pct:Math.round(n(r)*100),selected:!!r.selected}}function $r(e){let t=Zr(e);if(!t.length)return null;let n=t.reduce((e,t)=>Gr(t.cost)>Gr(e.cost)?t:e),r=t.map(e=>Gr(e.cost));return{min:Math.min(...r),max:Math.max(...r),top:n}}var ei=e=>(e?.per_day||[]).reduce((e,t)=>e+t,0);function ti(e,t){let n=Xr(e,t),r=n.reduce((e,t)=>e+t.n,0),i=n.reduce((e,t)=>!e||t.n>e.n?t:e,null),a=[];for(let e of n)(e.per_day||[]).forEach((e,t)=>{a[t]=(a[t]||0)+e});return{total:r,top:i?{name:i.name,n:i.n}:null,perDay:a}}var Q=e=>e.catch(()=>null),ni=(e,t)=>`${t?Math.min(100,e/t*100):0}%`,ri=36e5;function ii({update:e,onAction:t,canFill:n=!0}){if(!e)return null;let r=e.install??(e.git?`git`:`npm-global`),i=r===`git`&&typeof e.behind==`number`?e.behind:null,a=i===null?e.latest===null?(0,K.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current??``,` · update check unavailable`]}):e.available?(0,K.jsxs)(`span`,{className:`mono ver-chip`,children:[e.current,` `,(0,K.jsxs)(`span`,{className:`ver-new`,children:[e.latest,` available`]})]}):(0,K.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current,` · latest`]}):i>0?(0,K.jsxs)(`span`,{className:`mono ver-chip`,children:[e.current??``,` `,(0,K.jsxs)(`span`,{className:`ver-new`,children:[i,` commit`,i===1?``:`s`,` to pull`]})]}):(0,K.jsxs)(`span`,{className:`mono dim ver-chip`,children:[e.current??``,` · up to date`]});if(r===`other`)return!e.available||!e.command?a:(0,K.jsxs)(K.Fragment,{children:[a,(0,K.jsxs)(`span`,{className:`dim`,children:[`update with `,(0,K.jsx)(`code`,{className:`mono`,children:e.command})]})]});if(r!==`git`&&!e.available)return a;let o=i===null?!!e.available:i>0;return(0,K.jsxs)(K.Fragment,{children:[a,(0,K.jsx)(`button`,{type:`button`,className:o&&n?`btn`:`btn ghost`,title:r===`git`?i===0?`Nothing to pull: up to date with upstream. Pulls and rebuilds every install anyway.`:`git pull, then rebuild every install`:`npm install -g geneseed@latest, then rebuild every install`,onClick:()=>t(`update`),children:`Update`})]})}var ai={good:`M8 12.5l2.7 2.7L16 9.5M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18z`,warn:`M12 3 22 20H2zM12 10v4M12 17v.5`,bad:`M9 9l6 6M15 9l-6 6M12 3a9 9 0 1 0 0 18 9 9 0 0 0 0-18z`};function oi({tone:e}){return(0,K.jsx)(`svg`,{className:`health-ico`,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:(0,K.jsx)(`path`,{d:ai[e]||ai.warn})})}function si({fleet:e,error:t,behind:n,onAction:r,onRebuild:i}){let a=(0,K.jsx)(`button`,{type:`button`,className:`btn ghost ldg-doctor`,onClick:()=>r(`doctor`),children:`Run doctor`});if(!e)return t?(0,K.jsxs)(`section`,{className:`health unknown`,"aria-labelledby":`ldg-health`,children:[(0,K.jsx)(oi,{tone:`warn`}),(0,K.jsx)(`div`,{className:`health-text`,role:`status`,children:(0,K.jsx)(`h2`,{id:`ldg-health`,children:`Status unknown`})}),(0,K.jsx)(`div`,{className:`health-acts`,children:a})]}):(0,K.jsx)(`div`,{className:`health unknown`,"aria-busy":`true`});let o=Ur(e),s=[...o.facts,...e.version?[`Source is ${e.version}`]:[]];return(0,K.jsxs)(`section`,{className:`health ${o.tone}`,"aria-labelledby":`ldg-health`,children:[(0,K.jsx)(oi,{tone:o.tone}),(0,K.jsxs)(`div`,{className:`health-text`,role:`status`,children:[(0,K.jsx)(`h2`,{id:`ldg-health`,children:o.head}),(0,K.jsxs)(`p`,{className:`health-facts`,children:[s.join(` · `),`.`]})]}),(0,K.jsxs)(`div`,{className:`health-acts`,children:[a,n.length?(0,K.jsxs)(`button`,{type:`button`,className:`btn`,title:`Rebuilds ${n.map(e=>e.label).join(`, `)}`,onClick:()=>i(n),children:[`Rebuild all behind (`,n.length,`)`]}):null]})]})}function ci({chars:e}){let t=C(e);return(0,K.jsxs)(`span`,{className:`mono`,children:[Z(t??e),` tok`]})}var li=e=>Math.round(e/4),ui={carrier:`accent`,skills:`skill`,agents:`agent`,context:`context`},di=e=>Wr.map(([t,n])=>({key:t,label:n,n:li(e[t]),tone:ui[t]})),fi=e=>`${e.host} · ${e.scope}`;function pi({cost:e,i:t}){let n=2*Math.PI*14,r=e.ceiling?Math.min(1,e.carrier/e.ceiling):0;return(0,K.jsxs)(`svg`,{className:`ldg-ring`,viewBox:`0 0 36 36`,"aria-hidden":`true`,children:[(0,K.jsx)(`circle`,{className:`bg`,cx:`18`,cy:`18`,r:14}),(0,K.jsx)(`circle`,{className:`fg`+(e.ceiling&&e.carrier>e.ceiling?` over`:``),cx:`18`,cy:`18`,r:14,strokeDasharray:n.toFixed(2),strokeDashoffset:(n*(1-r)).toFixed(2),style:{"--circ":n.toFixed(2),"--i":t}})]})}function mi({id:e,title:t,aside:n,className:r=``,children:i}){return(0,K.jsxs)(`section`,{className:`panel ldg-kpi ${r}`,"aria-labelledby":e,children:[(0,K.jsxs)(`div`,{className:`ldg-kpi-head`,children:[(0,K.jsx)(`h3`,{id:e,children:t}),n]}),i]})}function hi({installs:e}){let t=Qr(e);return(0,K.jsx)(mi,{id:`ldg-k-root`,title:`Root file vs ceiling`,className:`ldg-kpi-root`,children:t?(0,K.jsxs)(`div`,{className:`ldg-kpi-ring`,children:[(0,K.jsxs)(`span`,{className:`ldg-ringbox`,children:[(0,K.jsx)(Kn,{value:li(t.carrier),max:li(t.ceiling),segments:t.pct>100?[{key:`v`,label:`root file`,n:li(t.carrier),tone:`bad`}]:void 0,size:64,stroke:7,label:`${t.selected?`Root file`:`Worst root file`}: ${t.label}, ${t.pct} percent of its ceiling`}),(0,K.jsxs)(`span`,{className:`mono ldg-ring-pct`,"aria-hidden":`true`,children:[t.pct,`%`]})]}),(0,K.jsxs)(`span`,{className:`ldg-kpi-stack`,children:[(0,K.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:`${Z(t.carrier)} / ${Z(t.ceiling)} tokens`}),(0,K.jsx)(`span`,{className:`dim`,children:t.label})]})]}):(0,K.jsx)(`p`,{className:`dim`,children:`No root file to measure.`})})}function gi({installs:e}){let t=$r(e),n=t&&(Z(t.min)===Z(t.max)?Z(t.max):`${Z(t.min)} – ${Z(t.max)}`);return(0,K.jsx)(mi,{id:`ldg-k-cost`,title:`Always-on cost per turn`,className:`ldg-kpi-cost`,children:t?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:`${n} tokens`}),(0,K.jsx)(Jn,{parts:di(t.top.cost),label:`Most expensive, ${fi(t.top)}`,legend:!1}),(0,K.jsx)(`span`,{className:`dim ldg-kpi-cap`,children:`Bar: ${fi(t.top)}, the most expensive`})]}):(0,K.jsx)(`p`,{className:`dim`,children:`No install has a root file to measure.`})})}function _i({usage:e}){let t=e?.enabled?e.days_counted<30&&e.since?`since ${e.since}`:`30 days`:null;return(0,K.jsx)(mi,{id:`ldg-k-calls`,title:`Skill and agent calls`,className:`ldg-kpi-calls`,aside:t?(0,K.jsx)(`span`,{className:`mono dim ldg-kpi-aside`,children:t}):null,children:e?e.enabled?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:(0,K.jsx)(A,{value:ei(e)})}),e.per_day?.length>1?(0,K.jsx)(xr,{vals:e.per_day,i:0}):null]}):(0,K.jsx)(`p`,{className:`dim`,children:`Usage counting is off on this machine.`}):(0,K.jsx)(`p`,{className:`dim`,children:`Usage could not be read.`})})}function vi({gates:e,laws:t}){let n=ti(e,t);return(0,K.jsx)(mi,{id:`ldg-k-gates`,title:`Gate asks · 30 days`,className:`ldg-kpi-gates`,aside:(0,K.jsx)(`a`,{className:`ldg-kpi-aside`,href:`#/laws`,"aria-label":`Open the Constitution`,children:`Constitution →`}),children:e?n.total?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`span`,{className:`ldg-kpi-line`,children:[(0,K.jsx)(`span`,{className:`mono ldg-kpi-fig`,children:n.total}),` `,(0,K.jsx)(`span`,{className:`dim`,children:`· ${n.top.name} ${n.top.n}`})]}),n.perDay.length>1?(0,K.jsx)(xr,{vals:n.perDay,i:1}):null]}):(0,K.jsx)(`p`,{className:`dim`,children:`No gate asked in 30 days.`}):(0,K.jsx)(`p`,{className:`dim`,children:`Gate activity could not be read.`})})}var yi=6;function bi({i:e}){if(!e.diffable)return(0,K.jsx)(`span`,{className:`dim`,title:`Drift is only checked for global installs`,children:`not checkable`});let t=G(e.drift),n=e.drift?.stale??0;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`ldg-syncbar`,children:(0,K.jsx)(Jn,{parts:[{key:`stale`,label:`Behind source`,n,tone:`warn`},{key:`edited`,label:`Edited by hand`,n:t,tone:`bad`}],label:`Sync with source, ${fi(e)}`,legend:!1})}),t?(0,K.jsxs)(`span`,{className:`mono t-bad`,children:[t,` edited`]}):e.drift?.linked?(0,K.jsxs)(`span`,{className:`mono dim`,title:`Yours: links Geneseed leaves alone`,children:[e.drift.linked,` linked`]}):(0,K.jsx)(`span`,{className:`mono dim`,children:`none`}),n?(0,K.jsxs)(`div`,{className:`mono dim ldg-sub`,children:[n,` file`,n===1?``:`s`,` behind`]}):null]})}function xi(e){if(!e.diffable)return`Not checkable: drift is only checked for global installs.`;let t=e.drift||{},n=[t.stale?`${t.stale} behind`:null,t.edited?`${t.edited} edited`:null,t.added?`${t.added} added`:null,t.missing?`${t.missing} missing`:null,t.linked?`${t.linked} linked (yours)`:null].filter(Boolean);return n.length?n.join(` · `):`Nothing differs.`}function Si({i:e,n:t,onRebuild:n,onOpen:r,busy:i}){let[a,o]=(0,R.useState)(!1),s=fi(e),c=(0,K.jsxs)(`td`,{className:`ldg-where`,children:[i?(0,K.jsx)(`span`,{className:`console-progress`,role:`progressbar`,"aria-label":`Rebuilding ${s}`}):null,(0,K.jsxs)(`div`,{className:`ldg-who`,children:[Kr(e)?(0,K.jsx)(`svg`,{className:`ldg-glyph ${G(e.drift)?`bad`:`warn`}`,viewBox:`0 0 10 10`,role:`img`,"aria-label":G(e.drift)?`edited by hand`:`needs a rebuild`,children:(0,K.jsx)(`path`,{d:`M5 1 9 9H1z`,fill:`currentColor`})}):null,e.state===`active`&&e.cost?(0,K.jsx)(`span`,{className:`ldg-phone-ring`,"aria-hidden":`true`,children:(0,K.jsx)(pi,{cost:e.cost,i:t})}):null,(0,K.jsxs)(`div`,{className:`ldg-name`,children:[(0,K.jsx)(`span`,{className:`ldg-host`,children:e.host}),` `,(0,K.jsx)(`span`,{className:`dim`,children:e.scope}),(0,K.jsx)(`div`,{className:`mono dim ldg-path`,children:e.path})]})]})]});if(e.state!==`active`)return(0,K.jsxs)(`tr`,{className:`ldg-off`,children:[c,(0,K.jsx)(`td`,{className:`ldg-build`,children:(0,K.jsx)(`span`,{className:`pill off`,children:`disabled`})}),(0,K.jsx)(`td`,{className:`ldg-sync`}),(0,K.jsx)(`td`,{className:`ldg-root`}),(0,K.jsx)(`td`,{className:`ldg-total`}),(0,K.jsx)(`td`,{className:`ldg-act`,children:(0,K.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Open ${s}`,onClick:()=>r(e),children:`Open`})})]});let l={synced:(0,K.jsx)(`span`,{className:`pill good`,children:`in step`}),behind:(0,K.jsx)(`span`,{className:`pill warn`,children:`behind source`}),unknown:(0,K.jsx)(`span`,{className:`pill off`,children:`not checked`})}[e.verdict],u=Gr(e.cost),d=e.cost?.ceiling?Math.round(e.cost.carrier/e.cost.ceiling*100):null;return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(`tr`,{className:a?`ldg-open`:``,children:[c,(0,K.jsxs)(`td`,{className:`ldg-build`,children:[l,(0,K.jsx)(`div`,{className:`mono dim ldg-sub`,children:e.built_epoch?`built ${kt(e.built_epoch)} ago`:`never built`})]}),(0,K.jsx)(`td`,{className:`ldg-sync`,children:(0,K.jsx)(bi,{i:e})}),(0,K.jsx)(`td`,{className:`ldg-root`,children:e.cost?d===null?(0,K.jsx)(`span`,{className:`dim`,children:`no ceiling`}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`ldg-rootbar`,children:(0,K.jsx)(Yn,{value:li(e.cost.carrier),max:li(e.cost.ceiling),label:`Root file, ${s}`,tone:d>100?`bad`:`accent`})}),(0,K.jsx)(`span`,{className:`mono dim ldg-sub`,children:`${Z(e.cost.carrier)} / ${Z(e.cost.ceiling)} · ${d}%`})]}):(0,K.jsx)(`span`,{className:`dim`,children:`not measured`})}),(0,K.jsx)(`td`,{className:`ldg-total`,children:e.cost?(0,K.jsx)(ci,{chars:u}):null}),(0,K.jsxs)(`td`,{className:`ldg-act`,children:[Kr(e)?(0,K.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Rebuild ${s}`,title:`Rebuilds ${s} only`,onClick:()=>n([Jr(e)]),children:`Rebuild`}):(0,K.jsx)(`button`,{type:`button`,className:`btn ghost sm`,"aria-label":`Open ${s}`,onClick:()=>r(e),children:`Open`}),(0,K.jsx)(`button`,{type:`button`,className:`btn ghost sm ldg-toggle`,"aria-label":`Details for ${s}`,"aria-expanded":a,"aria-controls":a?`ldg-detail-${e.id}`:void 0,onClick:()=>o(e=>!e),children:(0,K.jsx)(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,"aria-hidden":`true`,children:(0,K.jsx)(`path`,{d:a?`M6 15l6-6 6 6`:`M6 9l6 6 6-6`})})})]})]}),a?(0,K.jsx)(`tr`,{className:`ldg-detail`,id:`ldg-detail-${e.id}`,children:(0,K.jsx)(`td`,{colSpan:yi,children:(0,K.jsxs)(`div`,{className:`ldg-detail-grid`,children:[(0,K.jsxs)(`div`,{className:`ldg-detail-col`,children:[e.cost?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`span`,{className:`ldg-lbl`,children:`What rides every turn · ${Z(u)} tokens`}),(0,K.jsx)(Jn,{parts:di(e.cost),label:s})]}):(0,K.jsx)(`span`,{className:`dim`,children:`Always-on cost not measured.`}),(0,K.jsx)(`span`,{className:`dim`,children:`Voice ${e.theme} · ${e.footprint} footprint`})]}),(0,K.jsxs)(`div`,{className:`ldg-detail-col`,children:[(0,K.jsx)(`span`,{className:`ldg-lbl`,children:`Differs from source`}),(0,K.jsx)(`span`,{className:`muted`,children:xi(e)}),e.diffable?(0,K.jsx)(`span`,{children:(0,K.jsx)(`a`,{className:`btn ghost sm`,href:`#/installs/edits`,"aria-label":`View diff for ${s}`,children:`View diff`})}):null]})]})})}):null]})}function Ci({rows:e,onAction:t,onRebuild:n}){let r=e.filter(e=>!e.sugg).length;return(0,K.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-needs`,children:[(0,K.jsxs)(`div`,{className:`panel-head panel-head-rule`,children:[(0,K.jsx)(`h2`,{id:`ldg-needs`,children:`Needs you`}),(0,K.jsxs)(`span`,{className:`mono dim`,children:[r,` problem`,r===1?``:`s`,`, `,e.length-r,` suggestion`,e.length-r===1?``:`s`]})]}),e.length?(0,K.jsx)(`ul`,{className:`needs`,children:e.map(e=>(0,K.jsxs)(`li`,{className:e.sugg?`sugg`:``,children:[(0,K.jsx)(`span`,{className:`tag ${e.tone}`,children:e.tag}),(0,K.jsxs)(`span`,{className:`needs-what`,children:[(0,K.jsx)(`b`,{children:e.title}),e.detail?(0,K.jsxs)(`span`,{className:`dim`,children:[` · `,e.detail]}):null]}),(0,K.jsx)(`span`,{className:`mono dim needs-where`,children:e.where}),e.act?(0,K.jsx)(`button`,{type:`button`,className:`needs-verb linkish`,"aria-label":`${e.verb}: ${e.title}`,onClick:()=>e.installs?n(e.installs):t(e.act),children:e.verb}):(0,K.jsx)(`a`,{className:`needs-verb`,href:e.href,"aria-label":`${e.verb}: ${e.title}`,children:e.verb})]},e.id))}):(0,K.jsx)(`p`,{className:`needs-empty`,children:`Nothing needs you.`})]})}function wi({usage:e}){let t=(0,K.jsxs)(`div`,{className:`panel-head`,children:[(0,K.jsx)(`h2`,{id:`ldg-usage`,children:`What fires`}),(0,K.jsx)(`span`,{className:`mono dim`,children:`skills and agents, 30 d`})]});if(!e)return(0,K.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[t,(0,K.jsx)(`p`,{className:`dim`,children:`Usage could not be read.`})]});if(!e.enabled)return(0,K.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[t,(0,K.jsx)(`p`,{className:`dim`,children:`Usage counting is off on this machine.`})]});if(e.days_counted<30)return(0,K.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[t,(0,K.jsx)(`p`,{className:`muted`,children:e.since?(0,K.jsxs)(K.Fragment,{children:[`Counting since `,(0,K.jsx)(`b`,{children:e.since}),`, `,e.days_counted,` of 30 days`]}):`No skill or agent call counted yet`}),(0,K.jsx)(`div`,{className:`daytrack`,"aria-hidden":`true`,children:Array.from({length:30},(t,n)=>(0,K.jsx)(`i`,{className:n<e.days_counted?`on`:``},n))}),(0,K.jsx)(`p`,{className:`dim chart-foot`,children:`Rankings and the never-fired count appear once 30 days are counted, so a new install is not told every skill is unused.`})]});let n=e.rows.slice(0,7),r=Math.max(1,...n.map(e=>e.n));return(0,K.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-usage`,children:[t,(0,K.jsx)(`ul`,{className:`ubars`,children:n.map((e,t)=>(0,K.jsxs)(`li`,{className:e.kind,children:[(0,K.jsxs)(`span`,{className:`ub-name`,children:[e.name,` `,(0,K.jsx)(`span`,{className:`dim`,children:e.kind})]}),(0,K.jsx)(`span`,{className:`ub-trk`,children:(0,K.jsx)(`i`,{style:{width:ni(e.n,r),"--i":t}})}),(0,K.jsx)(`span`,{className:`mono`,children:e.n})]},`${e.install}:${e.kind}:${e.name}`))}),e.never.length?(0,K.jsxs)(`div`,{className:`ub-never`,children:[(0,K.jsxs)(`span`,{children:[(0,K.jsx)(`b`,{children:Hr(e).skills}),` skills never fired`]}),(0,K.jsx)(`a`,{className:`needs-verb`,href:`#/skills`,children:`Triage`})]}):null]})}function Ti({overview:e,setup:t,runs:n,onAction:r,onRetry:i,dataRev:o,banner:s,view:c}){let l=on(),[u,d]=(0,R.useState)({}),{data:f,error:p,reload:m}=U(()=>a.fleet(),[o]),{data:h}=U(()=>Q(a.usage()),[o]),{data:g}=U(()=>Q(a.gates()),[o]),_=(0,R.useRef)(null),{data:v,reload:y}=U(()=>Q(a.update()).then(e=>(e&&(_.current=e),_.current)),[o]);(0,R.useEffect)(()=>{let e=setInterval(y,ri),t=()=>{document.visibilityState===`visible`&&y()};return document.addEventListener(`visibilitychange`,t),()=>{clearInterval(e),document.removeEventListener(`visibilitychange`,t)}},[y]);let{data:b}=Wn(o),{data:x}=U(()=>Q(a.activity()),[o]),{data:S}=U(()=>Q(a.profile()),[o]),{data:C}=U(()=>Q(a.catalog(`skills`)),[o],`catalog:skills`),{data:w}=U(()=>Q(a.catalog(`laws`)),[o],`catalog:laws`),T=f?.installs||[],E=async e=>{try{await a.selectView(e.host,e.path)}catch{}i?.(),window.location.hash=`#/installs`},D=Yr({fleet:f,usage:h,overview:e,setup:t,rules:b,activity:x,profile:S,skills:C,laws:w}),O=T.filter(Kr).map(Jr),k=async e=>{let t=e.map(e=>e.label);if(!await l(`Rebuild ${t.join(`, `)}? Each is re-rendered from source with its own settings.`,{title:e.length===1?`Rebuild ${t[0]}?`:`Rebuild ${e.length} installs?`,confirmLabel:`Rebuild`}))return;let n=await r(`rebuild`,{installs:e.map(({host:e,path:t})=>({host:e,path:t}))});n&&d(t=>({...t,[n]:e.map(e=>e.id)}))},A=new Set(Object.entries(u).filter(([e])=>n?.find(t=>t.id===e)?.status===`running`).flatMap(([,e])=>e));return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Vn,{eyebrow:f?`${T.length} harness${T.length===1?``:`es`} installed on this machine`:null,title:`Overview`,actions:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(ii,{update:v,onAction:r,canFill:!O.length}),c]})}),s,(0,K.jsxs)(`div`,{className:`ov-stack ldg`,children:[(0,K.jsx)(si,{fleet:f,error:p,behind:O,onAction:r,onRebuild:k}),(0,K.jsxs)(`div`,{className:`ldg-kpis`,role:`group`,"aria-labelledby":`ldg-kpis-h`,children:[(0,K.jsx)(`h2`,{id:`ldg-kpis-h`,className:`sr-only`,children:`Key figures`}),(0,K.jsx)(hi,{installs:T}),(0,K.jsx)(gi,{installs:T}),(0,K.jsx)(_i,{usage:h}),(0,K.jsx)(vi,{gates:g,laws:w})]}),(0,K.jsxs)(`section`,{className:`panel`,"aria-labelledby":`ldg-fleet`,children:[(0,K.jsxs)(`div`,{className:`panel-head panel-head-rule`,children:[(0,K.jsx)(`h2`,{id:`ldg-fleet`,children:`Installed harnesses`}),f?.source_fp?(0,K.jsxs)(`span`,{className:`mono dim`,children:[`source `,f.source_fp]}):null]}),p&&f?(0,K.jsxs)(`p`,{className:`dim`,role:`status`,children:[`Could not refresh the installs — showing the last read.`,` `,(0,K.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:m,children:`Retry`})]}):null,(0,K.jsx)(`div`,{className:`ldg-scroll`,children:(0,K.jsxs)(`table`,{className:`ldg-fleet`,children:[(0,K.jsx)(`caption`,{className:`sr-only`,children:`Installs`}),(0,K.jsx)(`thead`,{children:(0,K.jsxs)(`tr`,{children:[(0,K.jsx)(`th`,{scope:`col`,children:`Install`}),(0,K.jsx)(`th`,{scope:`col`,className:`ldg-build`,children:`Build`}),(0,K.jsx)(`th`,{scope:`col`,className:`ldg-sync`,children:`Sync with source`}),(0,K.jsx)(`th`,{scope:`col`,className:`ldg-root`,children:`Root file · ceiling`}),(0,K.jsx)(`th`,{scope:`col`,className:`ldg-total`,children:`Always-on`}),(0,K.jsx)(`th`,{scope:`col`,children:(0,K.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,K.jsxs)(`tbody`,{children:[p&&!f?(0,K.jsx)(`tr`,{children:(0,K.jsxs)(`td`,{colSpan:yi,children:[(0,K.jsx)(`span`,{className:`dim`,role:`status`,children:`Could not read the installs`}),` `,(0,K.jsx)(`button`,{type:`button`,className:`btn ghost sm`,onClick:m,children:`Retry`})]})}):null,T.map((e,t)=>(0,K.jsx)(Si,{i:e,n:t,onRebuild:k,onOpen:E,busy:A.has(e.id)},e.id))]})]})})]}),(0,K.jsxs)(`div`,{className:`ldg-bottom`,children:[(0,K.jsx)(Ci,{rows:D,onAction:r,onRebuild:k}),(0,K.jsx)(wi,{usage:h})]})]})]})}var Ei=`geneseed-understand-seen`,Di=`understand`;function Oi(){try{let e=JSON.parse(localStorage.getItem(Ei));return Array.isArray(e)?e:[]}catch{return[]}}function ki(e){let t=Oi();if(t.includes(e))return t;let n=[...t,e];try{localStorage.setItem(Ei,JSON.stringify(n))}catch{}return n}function Ai(e,t){let n=e?.groups||[],r=n.findIndex(e=>e.id===Di),i=n[r]?.pages||[],a=i.findIndex(e=>e.id===t);if(a<0)return{prev:null,next:null};let o=n.slice(r+1).find(e=>e.pages.length);return{prev:i[a-1]||null,next:i[a+1]||o?.pages[0]||null}}function ji(e,t){for(let n of e?.groups||[]){let e=n.pages.find(e=>e.id===t);if(e)return{part:n,section:e.section||`General`,page:e}}return{part:null,section:null,page:null}}function Mi(e,t){let{part:n,section:r}=ji(e,t);if(!n)return{prev:null,next:null};if(n.id===`understand`)return Ai(e,t);let i=n.pages.filter(e=>(e.section||`General`)===r),a=i.findIndex(e=>e.id===t);return{prev:i[a-1]||null,next:i[a+1]||null}}var Ni=e=>`#/docs/`+encodeURIComponent(e);function Pi({pages:e,seen:t}){let n=e.filter(e=>t.includes(e.id)).length;return(0,K.jsx)(`div`,{className:`track-prog`,role:`progressbar`,"aria-label":`Pages read`,"aria-valuemin":0,"aria-valuemax":e.length,"aria-valuenow":n,children:(0,K.jsx)(`i`,{style:{width:`${n/(e.length||1)*100}%`}})})}function Fi({menu:e,pageId:t}){let{prev:n,next:r}=Mi(e,t);return!n&&!r?null:(0,K.jsxs)(`nav`,{className:`track-bar`,"aria-label":`Pages`,children:[n?(0,K.jsxs)(`a`,{className:`track-card`,href:Ni(n.id),children:[(0,K.jsx)(`span`,{className:`track-card-lbl`,"aria-hidden":`true`,children:`Previous`}),(0,K.jsxs)(`span`,{className:`track-card-title`,children:[`← `,n.title]})]}):(0,K.jsx)(`span`,{}),r&&(0,K.jsxs)(`a`,{className:`track-card next`,href:Ni(r.id),children:[(0,K.jsx)(`span`,{className:`track-card-lbl`,"aria-hidden":`true`,children:`Next`}),(0,K.jsxs)(`span`,{className:`track-card-title`,children:[`Next: `,r.title,` →`]})]})]})}var Ii=`modulepreload`,Li=function(e){return`/`+e},Ri={},zi=function(e){return e.pathname.endsWith(`.css`)},Bi=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},$=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=Li(t,n);let r=s(t),i=zi(r);return Bi(Ri,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:Ii,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Vi=`geneseed-newhere-dismissed`,Hi=(0,R.lazy)(()=>$(()=>import(`./Dashboard-CnO_bsfz.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5])));function Ui({harness:e}){let[t,n]=(0,R.useState)(()=>!!localStorage.getItem(Vi)),{data:r}=U(()=>t?Promise.resolve(null):a.docs(e).catch(()=>null),[t,e]),i=r?.groups?.find(e=>e.id===`understand`)?.pages||[],o=Oi(),s=i.findIndex(e=>!o.includes(e.id));if(t||!i.length||s<0)return null;let c=i.filter(e=>o.includes(e.id)).length;return(0,K.jsxs)(`section`,{className:`newhere`,"aria-label":`New here?`,children:[(0,K.jsxs)(`div`,{className:`newhere-body`,children:[(0,K.jsx)(`b`,{children:`New here? Understand your harness.`}),(0,K.jsxs)(`p`,{children:[i.length,` short pages: what a harness is, what was installed, what changes in your day, and what is guaranteed.`]}),(0,K.jsx)(`div`,{className:`newhere-dots`,"aria-label":`${c} of ${i.length} read`,children:i.map(e=>(0,K.jsx)(`i`,{className:o.includes(e.id)?`f`:``},e.id))})]}),(0,K.jsx)(`a`,{className:`btn ghost`,href:`#/docs/${encodeURIComponent(i[s].id)}`,children:c?`Continue · step ${s+1}`:`Start`}),(0,K.jsx)(`button`,{type:`button`,className:`newhere-x`,onClick:()=>{localStorage.setItem(Vi,`1`),n(!0)},title:`Dismiss for good`,"aria-label":`Dismiss`,children:`×`})]})}function Wi({layout:e,onLayout:t}){return(0,K.jsx)(_n,{"aria-label":`View`,children:gt.map(n=>(0,K.jsx)(`button`,{type:`button`,className:e===n.id?`on`:``,"aria-pressed":e===n.id,title:n.tagline,onClick:()=>t(n.id),children:n.short},n.id))})}function Gi({overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:a,onAction:o,layout:s=`overview`,onLayout:c,dataRev:l}){if(!e)return t?(0,K.jsx)(An,{error:`Could not load the harness overview: ${t}`,onRetry:n}):(0,K.jsx)(kn,{});if(!e.deployed)return(0,K.jsx)(Un,{onAction:o});let u=(0,K.jsx)(Ui,{harness:$t(e.emit)}),d=c?(0,K.jsx)(Wi,{layout:s,onLayout:c}):null;return s===`overview`?(0,K.jsx)(Ti,{overview:e,setup:i,runs:a,onAction:o,onRetry:n,dataRev:l,view:d,banner:(0,K.jsxs)(K.Fragment,{children:[e.daemon_stale?(0,K.jsx)(jn,{}):null,u]})}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(Vn,{title:`Overview`,sub:[e.theme&&`${e.theme} voice`,e.footprint&&`${e.footprint} footprint`,e.target].filter(Boolean).join(` · `),primary:(0,K.jsx)(`button`,{type:`button`,className:`btn`,onClick:()=>o(`build-all`),children:`Rebuild`}),actions:(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>o(`update`),children:`Update`}),(0,K.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:()=>o(`doctor`),children:`Run doctor`}),d]})}),u,(0,K.jsx)(R.Suspense,{fallback:(0,K.jsx)(kn,{}),children:(0,K.jsx)(Hi,{overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:a,onAction:o,layout:s,dataRev:l})})]})}var Ki=(0,R.lazy)(()=>$(()=>import(`./Activity-GdsfJgQQ.js`),__vite__mapDeps([6,1,2,3,4,7,8]))),qi=(0,R.lazy)(()=>$(()=>import(`./ActivityDetail-BsVbLWoA.js`),__vite__mapDeps([9,1,2,3,7,8]))),Ji=(0,R.lazy)(()=>$(()=>import(`./Library-BXHx4pFJ.js`),__vite__mapDeps([10,1,2,3,4,5,7,11,12,13]))),Yi=(0,R.lazy)(()=>$(()=>import(`./Kits-BtNHZ7_Z.js`),__vite__mapDeps([14,1,2,3,7,13,15,16]))),Xi=(0,R.lazy)(()=>$(()=>import(`./Loops-B_wNVFEN.js`),__vite__mapDeps([17,1,2,3,7,8,11,12,13,16]))),Zi=(0,R.lazy)(()=>$(()=>import(`./Laws-B2X2jIE9.js`),__vite__mapDeps([18,1,2,3,7,12,13]))),Qi=(0,R.lazy)(()=>$(()=>import(`./Personal-BwZ33bqc.js`),__vite__mapDeps([19,1,2,3,7,13,20,10,4,5,11,12]))),$i=(0,R.lazy)(()=>$(()=>import(`./Installs-D3fE87tF.js`),__vite__mapDeps([21,1,2,3,4,7,20,15]))),ea=(0,R.lazy)(()=>$(()=>import(`./Docs-DctLhPHX.js`),__vite__mapDeps([22,1,2,3,7,11,12,13])));function ta(){let e=ve(),[t,n]=(0,R.useState)(null),[r,i]=(0,R.useState)(!1),[o,s]=qe(),[c,l]=Qe(),u=e=>{if(!document.startViewTransition||!E())return l(e);document.startViewTransition(()=>(0,le.flushSync)(()=>l(e)))},[d,f]=mt(),[p,m]=yt(),[h,g]=(0,R.useState)(()=>{try{return!window.sessionStorage.getItem(`gs-booted`)}catch{return!0}}),[_,v]=(0,R.useState)(!1),y=(0,R.useRef)(null),b=(0,R.useRef)(null);(0,R.useEffect)(()=>{if(!_)return;let e=e=>{e.key===`Escape`&&v(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]),(0,R.useEffect)(()=>{if(!_)return;let e=b.current,t=document.activeElement;return e&&(e.inert=!0),document.getElementById(`rail-nav`)?.focus(),()=>{e&&(e.inert=!1),t instanceof HTMLElement&&t.focus()}},[_]);let x=e=>n({kind:e?.body?.kind||`err`,msg:e?.body?.message||e.message}),{overview:S,error:C,themes:w,reload:T}=bt(x),[D,O]=(0,R.useState)(0),k=()=>{T(),O(e=>e+1)},[A,j]=(0,R.useState)(null),{runs:M,activeId:ee,consoleOpen:N,setConsoleOpen:te,runAction:P,cancelJob:ne,clearRuns:re}=St({onFinish:e=>{k(),j({status:e,at:Date.now()})},onError:x}),{data:F}=U(()=>a.setup().catch(()=>null),[D],`setup`),{data:ie}=U(()=>a.installs().catch(()=>null),[D],`installs`),ae=ie?.installs||null,oe=M[M.length-1],se=oe?oe.status===`running`?`${oe.action} running`:`${oe.action} ${oe.status}`:``;(0,R.useEffect)(()=>{let e=y.current;if(e){if(!We(e,ut(d),o)){let t=ft(d);t?Ce(e,t,o):!Te(e,c,o)&&S?.accent&&Ce(e,S.accent,o)}document.querySelector(`meta[name="theme-color"]`)?.setAttribute(`content`,getComputedStyle(e).getPropertyValue(`--bg`).trim())}},[S,o,d,c]);let I=[{title:`Rebuild all`,desc:`Re-emit every install`,run:()=>P(`build-all`),confirm:{msg:`Rebuild every install from the current sources?`,title:`Rebuild all?`,confirmLabel:`Rebuild all`}},{title:`Update`,desc:`Pull the latest Geneseed; the server restarts after`,run:()=>P(`update`),confirm:{msg:`Update Geneseed? The server restarts when the update ends.`,title:`Update Geneseed?`,confirmLabel:`Update`}},{title:`Run doctor`,desc:`Read-only health check`,run:()=>P(`doctor`)},{title:`Restart server`,desc:`Restart the local Geneseed server`,run:()=>it().catch(x),confirm:{msg:`Restart the local Geneseed server? The console reconnects in a moment.`,title:`Restart the server?`,confirmLabel:`Restart`}},{title:o===`light`?`Switch to dark mode`:`Switch to light mode`,desc:`Appearance`,run:s},...Ye.filter(e=>e.id!==c).map(e=>({title:`Flavour: ${e.name}`,desc:e.tagline,run:()=>u(e.id)}))].map(e=>({kind:`Actions`,hay:`${e.title} ${e.desc}`.toLowerCase(),...e})),ce={flavour:c,onFlavour:u,accentMode:d,onAccentMode:f,layout:p,onLayout:m};return(0,K.jsx)(`div`,{className:`app fl-${c} ${o===`light`?`light`:``}${_?` nav-open`:``}`,ref:y,children:(0,K.jsxs)(sn,{children:[(0,K.jsx)(`div`,{className:`atmos`,"aria-hidden":`true`}),(0,K.jsx)(`a`,{className:`skip-link`,href:`#main`,onClick:e=>{e.preventDefault(),document.getElementById(`main`)?.focus()},children:`Skip to content`}),(0,K.jsx)(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:se}),_&&(0,K.jsx)(`button`,{type:`button`,className:`nav-scrim`,"aria-label":`Close navigation`,onClick:()=>v(!1)}),(0,K.jsx)(Ht,{route:e,overview:S,installs:ae,onOpenVoice:()=>i(e=>!e),onNavigate:()=>v(!1)}),r&&(0,K.jsx)(xn,{themes:w,current:S?.theme,onPick:e=>{i(!1),P(`build`,{theme:e,emit:S?.emit})},onClose:()=>i(!1)}),(0,K.jsxs)(`div`,{className:`col`,ref:b,children:[(0,K.jsx)(bn,{route:e,navOpen:_,onToggleNav:()=>v(e=>!e),overview:S,installs:ae,actions:I,mode:o,onToggleMode:s,appearance:ce,dataRev:D,onSwitch:k}),(0,K.jsx)(`main`,{className:`page`,id:`main`,tabIndex:-1,children:(0,K.jsx)(`div`,{className:[`library`,`kits`,`loops`,`docs`].includes(e.page)?`pad pad-wide`:`pad`,children:(0,K.jsx)(zn,{activeId:ee,finish:A,children:(0,K.jsx)(Pn,{children:(0,K.jsx)(R.Suspense,{fallback:(0,K.jsx)(kn,{}),children:{overview:()=>(0,K.jsx)(Gi,{overview:S,overviewError:C,onRetry:T,themes:w,setup:F,runs:M,onAction:P,layout:p,onLayout:m,dataRev:D}),laws:()=>(0,K.jsx)(Zi,{selected:e.item,overview:S,setup:F,onAction:P,dataRev:D}),library:()=>(0,K.jsx)(Ji,{overview:S,section:e.section,selected:e.item,dataRev:D}),kits:()=>(0,K.jsx)(Yi,{item:e.item,onAction:P,dataRev:D}),loops:()=>(0,K.jsx)(Xi,{tab:e.tab,item:e.item,dataRev:D}),personal:()=>(0,K.jsx)(Qi,{tab:e.tab,item:e.item,setup:F,dataRev:D}),installs:()=>(0,K.jsx)($i,{tab:e.tab,overview:S,setup:F,themes:w,onAction:P,onMutated:k,dataRev:D,appearance:ce}),activity:()=>e.item?(0,K.jsx)(qi,{sid:e.item},e.item):(0,K.jsx)(Ki,{}),docs:()=>(0,K.jsx)(ea,{page:e.item,onAction:P,overview:S})}[e.page]?.()})},e.page)})})}),(0,K.jsx)(Wt,{route:e,navOpen:_,onMore:()=>v(!0)}),(0,K.jsx)(wn,{runs:M,open:N,busy:!!ee,finish:A,onToggle:()=>te(e=>!e),onClear:re,onCancel:ne})]}),(0,K.jsx)(Cn,{toast:t,onClose:()=>n(null)}),h&&(0,K.jsx)(On,{ready:!!S||!!C,onDone:()=>{try{window.sessionStorage.setItem(`gs-booted`,`1`)}catch{}g(!1)}})]})})}(0,ue.createRoot)(document.getElementById(`root`)).render((0,K.jsx)(ta,{})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`).catch(()=>{})});export{$t as $,fr as A,Gn as B,dr as C,re as Ct,ar as D,ir as E,tr as F,Bn as G,Un as H,Qn as I,kn as J,jn as K,Yn as L,hr as M,Sr as N,yr as O,Zn as P,Zt as Q,Jn as R,Tr as S,se as St,cr as T,Vn as U,Wn as V,In as W,_n as X,vn as Y,on as Z,Or as _,B as _t,Ni as a,q as at,Er as b,_e as bt,Oi as c,Nt as ct,Pr as d,Ft as dt,Qt as et,Nr as f,U as ft,jr as g,Ye as gt,Lr as h,it as ht,Pi as i,qt as it,_r as j,ur as k,Ur as l,Mt as lt,Ir as m,pt as mt,Fi as n,Kt as nt,ki as o,G as ot,Fr as p,gt as pt,An as q,Di as r,Yt as rt,ji as s,Pt as st,$ as t,Gt as tt,Xr as u,kt as ut,Cr as v,de as vt,xr as w,Dr as x,L as xt,wr as y,ye as yt,Kn as z};