geneseed 3.6.0 → 3.7.0

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.
Files changed (86) hide show
  1. package/CHANGELOG.md +49 -0
  2. package/DESIGN.md +6 -6
  3. package/QUICKSTART.md +1 -1
  4. package/README.md +32 -30
  5. package/SETUP.md +34 -8
  6. package/SHIPPED.md +3 -3
  7. package/adapters/claude-code/skills/geneseed/SKILL.md +1 -1
  8. package/adapters/openclaude/README.md +64 -0
  9. package/adapters/opencode/plugins/geneseed-workflow.js +1 -1
  10. package/adapters/opencode/workflows/_runtime.js +1 -1
  11. package/docs/extending.md +18 -6
  12. package/docs/web/exclusions.md +1 -0
  13. package/docs/web/footprint.md +1 -1
  14. package/docs/web/harnesses.md +14 -14
  15. package/docs/web/install-quick.md +1 -1
  16. package/docs/web/rules.md +1 -1
  17. package/docs/web/themes-author.md +1 -1
  18. package/docs/web-ui.md +1 -1
  19. package/harness.config.json +1 -1
  20. package/js/README.md +3 -3
  21. package/js/build/driver.mjs +50 -9
  22. package/js/build/emit-claude.mjs +1 -1
  23. package/js/build/generate.mjs +2 -1
  24. package/js/build/source.mjs +5 -4
  25. package/js/hosts/hooks.mjs +11 -4
  26. package/js/hosts/hosts.mjs +17 -2
  27. package/js/hosts/installs.mjs +32 -2
  28. package/js/hosts/mcp.mjs +8 -1
  29. package/js/hosts/settings.mjs +4 -1
  30. package/js/inspect/diff.mjs +1 -1
  31. package/js/inspect/doctor.mjs +3 -3
  32. package/js/inspect/excludes.mjs +7 -5
  33. package/js/inspect/status.mjs +4 -4
  34. package/js/maintain/migrate.mjs +1 -1
  35. package/js/maintain/setup.mjs +7 -2
  36. package/js/maintain/uninstall.mjs +3 -3
  37. package/js/web/actions.mjs +7 -5
  38. package/js/web/api.mjs +2 -2
  39. package/js/web/docs.mjs +1 -1
  40. package/package.json +2 -1
  41. package/src/doctrines/README.md +3 -2
  42. package/src/doctrines/comms.md +53 -0
  43. package/src/doctrines/process.md +0 -26
  44. package/src/skills/parallel-agents.md +1 -1
  45. package/src/skills/pipeline.md +1 -1
  46. package/src/skills/token-report/SKILL.md +2 -1
  47. package/src/skills/token-report/VENDOR.md +3 -3
  48. package/src/skills/token-report/scripts/token_report.mjs +14 -7
  49. package/src/skills/workflow.md +2 -2
  50. package/themes/_TEMPLATE.json +4 -2
  51. package/themes/biker.json +4 -2
  52. package/themes/commentator.json +4 -2
  53. package/themes/cyberpunk.json +4 -2
  54. package/themes/gamer.json +4 -2
  55. package/themes/imperial.json +4 -2
  56. package/themes/joker.json +4 -2
  57. package/themes/marvin.json +4 -2
  58. package/themes/mean.json +4 -2
  59. package/themes/military.json +4 -2
  60. package/themes/neutral.json +4 -2
  61. package/themes/pirate.json +4 -2
  62. package/themes/sports.json +4 -2
  63. package/themes/verstappen.json +4 -2
  64. package/themes/wizard.json +4 -2
  65. package/web/dist/assets/{Activity-Flgf4kHy.js → Activity-CH-7cPIM.js} +1 -1
  66. package/web/dist/assets/{ActivityDetail-DIpr85nh.js → ActivityDetail-DZvz0xS5.js} +1 -1
  67. package/web/dist/assets/{CatalogRow-CjyLjaLb.js → CatalogRow-DftXpZHY.js} +1 -1
  68. package/web/dist/assets/{Diff-Deisdha8.js → Diff-DvwdG0L9.js} +1 -1
  69. package/web/dist/assets/{Docs-DGUdY4l4.js → Docs-DrJNDPwI.js} +1 -1
  70. package/web/dist/assets/{Doctor-F74lJ69P.js → Doctor-OTmwmYZg.js} +1 -1
  71. package/web/dist/assets/{GreenhouseView-D072lBiD.js → GreenhouseView-XxrAdriX.js} +1 -1
  72. package/web/dist/assets/Harness-C_LYNk5c.js +1 -0
  73. package/web/dist/assets/{JournalView-DWFqZ0Iw.js → JournalView-BcuyeEaR.js} +1 -1
  74. package/web/dist/assets/{Laws-BN6g3HU7.js → Laws-CWHrTKY4.js} +1 -1
  75. package/web/dist/assets/{Library-CDOv4emM.js → Library-CA9IHghn.js} +1 -1
  76. package/web/dist/assets/{OperatorHudView-CwNIUVX8.js → OperatorHudView-BMRY1Tt4.js} +1 -1
  77. package/web/dist/assets/{Profile-CpP9BTne.js → Profile-wceET1JY.js} +1 -1
  78. package/web/dist/assets/{Rules-DFXsUCB7.js → Rules-BEXvY4Tx.js} +1 -1
  79. package/web/dist/assets/{Settings-BqZVUtJ5.js → Settings-DS2zF0Ez.js} +1 -1
  80. package/web/dist/assets/{Skills-Cu6kBgfF.js → Skills-DahlOJuI.js} +1 -1
  81. package/web/dist/assets/{drawable-BgfrEBer.js → drawable-BTHjTzF7.js} +1 -1
  82. package/web/dist/assets/{index-CAqrWhKl.js → index-AN5Emnrg.js} +2 -2
  83. package/web/dist/assets/{lawCats-BLgxl151.js → lawCats-Btjp3Hk_.js} +1 -1
  84. package/web/dist/index.html +1 -1
  85. package/web/src/pages/Laws.jsx +6 -2
  86. package/web/dist/assets/Harness-DNRP2Va7.js +0 -1
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-D072lBiD.js","assets/rolldown-runtime-CbXtAM7H.js","assets/react-DbkvxWG5.js","assets/drawable-BgfrEBer.js","assets/jobBuckets-Dbq8ZlWW.js","assets/OperatorHudView-CwNIUVX8.js","assets/JournalView-DWFqZ0Iw.js","assets/lawCats-BLgxl151.js","assets/Activity-Flgf4kHy.js","assets/activity-iWaWVtsR.js","assets/ActivityDetail-DIpr85nh.js","assets/Library-CDOv4emM.js","assets/Markdown-BQAvN8xx.js","assets/FilterInput-BakJLvaV.js","assets/StatusBadge-Cg6j-NJL.js","assets/Laws-BN6g3HU7.js","assets/CatalogRow-CjyLjaLb.js","assets/Rules-DFXsUCB7.js","assets/Profile-CpP9BTne.js","assets/Skills-Cu6kBgfF.js","assets/Diff-Deisdha8.js","assets/Doctor-F74lJ69P.js","assets/Settings-BqZVUtJ5.js","assets/Harness-DNRP2Va7.js","assets/Docs-DGUdY4l4.js"])))=>i.map(i=>d[i]);
2
- import{n as e}from"./rolldown-runtime-CbXtAM7H.js";import{i as t,n,r,t as i}from"./react-DbkvxWG5.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 a=e(t(),1),o=r(),s=n(),c=typeof window<`u`?window.__GENESEED_TOKEN__:``;async function l(e){let t=await e.json().catch(()=>({})),n=e.status===403&&(t.error||``).startsWith(`forbidden`)?`the web server restarted since this page loaded — reload the page, then re-apply your edit`:t.error||t.message||e.statusText,r=Error(n);return r.status=e.status,r.body=t,r}async function u(e){let t=await fetch(e);if(!t.ok)throw await l(t);return t.json()}async function d(e,t={}){let n=await fetch(e,{method:`POST`,headers:{"X-Geneseed-Token":c||``,"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw await l(n);return n.json()}var f=()=>u(`/api/overview`),p=()=>u(`/api/recent`),m=()=>u(`/api/activity`),h=e=>u(`/api/activity/`+encodeURIComponent(e)),g=e=>d(`/api/activity`,{enabled:e}),_=()=>u(`/api/setup`),v=()=>u(`/api/doctor`),y=()=>u(`/api/themes`),b=e=>u(`/api/catalog/${e}`),x=(e,t)=>u(`/api/item/${e}/${encodeURIComponent(t)}`),S=e=>d(`/api/memory/delete`,{name:e}),C=()=>u(`/api/diff`),ee=e=>d(`/api/actions/restore`,{files:e}),te=409,w=e=>u(`/api/jobs/${e}`),ne=()=>u(`/api/jobs`),T=e=>d(`/api/jobs/${e}/cancel`);async function E(e,t){try{return await d(`/api/actions/${e}`,t||{})}catch(e){throw e.status===te?Error(`An action is already running.`,{cause:e}):e}}var D=()=>u(`/api/mcp`),O=(e,t,n)=>d(`/api/mcp`,{path:e,name:t,enabled:n}),k=e=>d(`/api/reveal`,{path:e}),A=()=>u(`/api/installs`),j=(e,t,n)=>d(`/api/install`,{host:e,path:t,action:n}),re=(e,t,n)=>d(`/api/install`,{host:e,path:t,action:`remove`,memory:n}),ie=(e,t)=>d(`/api/view`,{host:e,path:t}),ae=()=>d(`/api/pick-folder`,{}),M=()=>u(`/api/ping`),oe=()=>d(`/api/shutdown`),se=()=>d(`/api/restart`),ce=e=>e?`?harness=${encodeURIComponent(e)}`:``,N={overview:f,recent:p,activity:m,activityDetail:h,activityToggle:g,setup:_,doctor:v,themes:y,catalog:b,item:x,memoryDelete:S,diff:C,restore:ee,job:w,jobs:ne,cancelJob:T,action:E,mcp:D,mcpToggle:O,mcpReveal:k,installs:A,installToggle:j,installRemove:re,selectView:ie,pickFolder:ae,ping:M,shutdown:oe,restart:se,docs:e=>u(`/api/docs${ce(e)}`),docsPage:(e,t)=>u(`/api/docs/page/${encodeURIComponent(e)}${ce(t)}`),rules:()=>u(`/api/rules`),rulesMutate:e=>d(`/api/rules`,e),rulesPromote:e=>d(`/api/rules/promote`,e),profile:()=>u(`/api/profile`),profileSave:e=>d(`/api/profile`,e),excludes:()=>u(`/api/excludes`),excludeMutate:(e,t)=>d(`/api/excludes`,{action:e,path:t})},P=typeof window<`u`,le=P?window:null,F=P?document:null,I={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},L={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},R={NONE:0,AUTO:1,FORCE:2},z={replace:0,none:1,blend:2},ue=Symbol(),de=Symbol(),fe=Symbol(),pe=Symbol(),B=Symbol(),V=1e-11,me=0xe8d4a51000,he=1e3,ge=[],_e=(()=>{let e=new Map;return e.set(`x`,`translateX`),e.set(`y`,`translateY`),e.set(`z`,`translateZ`),e})(),ve=[`perspective`,`translateX`,`translateY`,`translateZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`skew`,`skewX`,`skewY`],ye=ve.reduce((e,t)=>({...e,[t]:t+`(`}),{}),be=()=>{},xe=e=>e,Se=/\)\s*[-.\d]/,Ce=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,we=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,Te=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,Ee=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,De=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,Oe=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,ke=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,Ae=/([a-z])([A-Z])/g,je=/(\*=|\+=|-=)/,Me=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/,Ne={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:he,delay:0,loopDelay:0,ease:`out(2)`,composition:z.replace,modifier:xe,onBegin:be,onBeforeUpdate:be,onUpdate:be,onLoop:be,onPause:be,onComplete:be,onRender:be},Pe={current:null,root:F},H={defaults:Ne,precision:4,timeScale:1,tickThreshold:200,editor:null},Fe={version:`4.5.0`,engine:null};P&&(le.AnimeJS||=[],le.AnimeJS.push(Fe));var Ie=e=>e.replace(Ae,`$1-$2`).toLowerCase(),Le=(e,t)=>e.indexOf(t)===0,Re=Date.now,ze=Array.isArray,Be=e=>e&&e.constructor===Object,Ve=e=>typeof e==`number`&&!isNaN(e),He=e=>typeof e==`string`,Ue=e=>typeof e==`function`,U=e=>e===void 0,We=e=>U(e)||e===null,Ge=e=>P&&e instanceof SVGElement,Ke=e=>Ce.test(e),qe=e=>Le(e,`rgb`),Je=e=>Le(e,`hsl`),Ye=e=>Ke(e)||(qe(e)||Je(e))&&(e[e.length-1]===`)`||!Se.test(e)),Xe=e=>!H.defaults.hasOwnProperty(e),Ze=[`opacity`,`rotate`,`overflow`,`color`],Qe=(e,t)=>{if(Ze.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t===`scale`){let t=e.parentNode;return t&&t.tagName===`filter`}return!0}},$e=e=>He(e)?parseFloat(e):e,et=Math.pow,tt=Math.sqrt,nt=Math.sin,rt=Math.cos,it=Math.abs,at=Math.floor,ot=Math.asin,st=Math.PI,ct=Math.round,lt=(e,t,n)=>e<t?t:e>n?n:e,W=(e,t)=>{if(t<0)return e;if(!t)return ct(e);let n=10**t;return ct(e*n)/n},ut=(e,t,n)=>n===1?t:n===0?e:e+(t-e)*n,dt=e=>e===1/0?me:e===-1/0?-me:e,ft=e=>e<=1e-11?V:dt(W(e,11)),G=e=>ze(e)?[...e]:e,pt=(e,t)=>{let n={...e};for(let r in t){let i=e[r];n[r]=U(i)?t[r]:i}return n},K=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._head,o=i;for(n&&(a=e._tail,o=r);a;){let e=a[o];t(a),a=e}},mt=(e,t,n=`_prev`,r=`_next`)=>{let i=t[n],a=t[r];i?i[r]=a:e._head=a,a?a[n]=i:e._tail=i,t[n]=null,t[r]=null},ht=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._tail;for(;a&&n&&n(a,t);)a=a[r];let o=a?a[i]:e._head;a?a[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=a,t[i]=o},gt=(e,t,n)=>{let r=e.style.transform;if(r){let i=e[pe],a=0,o=r.length,s;for(;a<o;){for(;a<o&&r.charCodeAt(a)===32;)a++;if(a>=o)break;let e=a;for(;a<o&&r.charCodeAt(a)!==40;)a++;if(a>=o)break;let t=r.substring(e,a),n=1,c=a+1,l=-1,u=-1;for(a++;a<o&&n>0;){let e=r.charCodeAt(a);e===40?n++:e===41?n--:e===44&&n===1&&(l===-1?l=a:u===-1&&(u=a)),a++}let d=a-1;t===`translate`||t===`translate3d`?(l===-1?i.translateX=r.substring(c,d).trim():(i.translateX=r.substring(c,l).trim(),u===-1?i.translateY=r.substring(l+1,d).trim():(i.translateY=r.substring(l+1,u).trim(),i.translateZ=r.substring(u+1,d).trim())),s=r.substring(c,d)):t===`scale`||t===`scale3d`?l===-1?i.scale=r.substring(c,d).trim():(i.scaleX=r.substring(c,l).trim(),u===-1?i.scaleY=r.substring(l+1,d).trim():(i.scaleY=r.substring(l+1,u).trim(),i.scaleZ=r.substring(u+1,d).trim())):i[t]=r.substring(c,d)}if(t===`translate3d`&&s)return n&&(n[t]=s),s;let c=i[t];if(!U(c))return n&&(n[t]=c),c}return t===`translate3d`?`0px, 0px, 0px`:t===`rotate3d`?`0, 0, 0, 0deg`:Le(t,`scale`)?`1`:Le(t,`rotate`)||Le(t,`skew`)?`0deg`:`0px`},_t=e=>{let t=``;for(let n=0,r=ve.length;n<r;n++){let r=ve[n],i=e[r];if(i!==void 0){if(r===`translateX`){let r=e.translateY;if(r!==void 0){let a=e.translateZ;a===void 0?(t+=`translate(${i},${r}) `,n+=1):(t+=`translate3d(${i},${r},${a}) `,n+=2);continue}}if(r===`scaleX`&&e.scale===void 0){let r=e.scaleY;if(r!==void 0){let a=e.scaleZ;a===void 0?(t+=`scale(${i},${r}) `,n+=1):(t+=`scale3d(${i},${r},${a}) `,n+=2);continue}}t+=`${ye[r]}${i}) `}r===`rotateZ`&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},vt=[];function yt(e,t){if(!e)return null;let n=vt.length;outer:for(let r=0;r<n;r++){let n=vt[r];if(n.detect&&!n.detect(e))continue;let i=n.targetAdapters;for(let n=0,r=i.length;n<r;n++){let r=i[n];if(r.detect(e)){let n=r.props[t];if(n&&(!n.gate||n.gate(e)))return n;break outer}}}for(let r=0;r<n;r++){let n=vt[r];if(n.detect&&!n.detect(e))continue;let i=n.propertyResolvers;for(let n=0,r=i.length;n<r;n++){let r=i[n](e,t);if(r)return r}}return null}var bt=e=>{let t=we.exec(e)||Te.exec(e),n=U(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],n]},xt=e=>{let t=e.length,n=t===4||t===5;return[+(`0x`+e[1]+e[n?1:2]),+(`0x`+e[n?2:3]+e[n?2:4]),+(`0x`+e[n?3:5]+e[n?3:6]),t===5||t===9?+((`0x`+e[n?4:7]+e[n?4:8])/255).toFixed(3):1]},St=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),Ct=e=>{let t=Ee.exec(e)||De.exec(e),n=t[1]/360,r=t[2]/100,i=t[3]/100,a=U(t[4])?1:+t[4],o,s,c;if(r===0)o=s=c=i;else{let e=i<.5?i*(1+r):i+r-i*r,t=2*i-e;o=W(St(t,e,n+1/3)*255,0),s=W(St(t,e,n)*255,0),c=W(St(t,e,n-1/3)*255,0)}return[o,s,c,a]},wt=e=>qe(e)?bt(e):Ke(e)?xt(e):Je(e)?Ct(e):[0,0,0,1],q=(e,t)=>U(e)?t:e,Tt=(e,t)=>{let n=e.match(Me),r=t[de]?t:document.documentElement,i=getComputedStyle(r)?.getPropertyValue(n[1]);return(!i||i.trim()===``)&&n[2]&&(i=n[2].trim()),i||0},Et=(e,t,n,r,i,a)=>{if(Ue(e)){if(!i){let i=e(t,n,r,a);return isNaN(+i)?i||0:+i}let o=()=>{let i=e(t,n,r,a);return isNaN(+i)?i||0:+i};return i.func=o,o()}if(He(e)&&Le(e,`var(`)){if(!i)return Tt(e,t);let n=()=>Tt(e,t);return i.func=n,n()}return e},Dt=(e,t)=>e[de]?e[fe]&&Qe(e,t)?I.ATTRIBUTE:ve.includes(t)||_e.get(t)?I.TRANSFORM:Le(t,`--`)?I.CSS_VAR:t in e.style?I.CSS:t in e?I.OBJECT:I.ATTRIBUTE:I.OBJECT,Ot=(e,t,n)=>{let r=e.style[t];r&&n&&(n[t]=r);let i=r||getComputedStyle(e[B]||e).getPropertyValue(t);return i===`auto`?`0`:i},kt=(e,t,n,r)=>{let i=U(n)?Dt(e,t):n,a=yt(e,t);if(a){let n=a.get(e);return n&&r&&(r[t]=n),n??0}if(i===I.OBJECT){let n=e[t];return n&&r&&(r[t]=n),n||0}if(i===I.ATTRIBUTE){let n=e.getAttribute(t);return n&&r&&(r[t]=n),n}return i===I.TRANSFORM?gt(e,t,r):i===I.CSS_VAR?Ot(e,t,r).trimStart():Ot(e,t,r)},At=(e,t,n)=>n===`-`?e-t:n===`+`?e+t:e*t,jt=()=>({t:L.NUMBER,n:0,u:null,o:null,d:null,s:null}),Mt=(e,t)=>{if(t.t=L.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;let n=+e;if(!isNaN(n))return t.n=n,t;let r=e;r[1]===`=`&&(t.o=r[0],r=r.slice(2));let i=!r.includes(` `)&&ke.exec(r);if(i)return t.t=L.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(Ye(r))return t.t=L.COLOR,t.d=wt(r),t;{let e=r.match(Oe);return t.t=L.COMPLEX,t.d=e?e.map(Number):[],t.s=r.split(Oe)||[],t}},Nt=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=G(e._toNumbers),t.s=G(e._strings),t),Pt=jt(),Ft=(e,t,n)=>{let r=e._modifier,i=e._fromNumbers,a=e._toNumbers,o=e._strings,s=o[0];for(let c=0,l=a.length;c<l;c++){let l=r(W(ut(i[c],a[c],t),n)),u=o[c+1];s+=`${u?l+u:l}`,e._numbers[c]=l}return s},It=(e,t,n,r,i)=>{let a=e.parent,o=e.duration,s=e.completed,c=e.iterationDuration,l=e.iterationCount,u=e._currentIteration,d=e._loopDelay,f=e._reversed,p=e._alternate,m=e._hasChildren,h=e._delay,g=e._currentTime,_=h+c,v=t-h,y=lt(g,-h,o),b=lt(v,-h,o),x=v-g,S=b>0,C=b>=o,ee=o<=V,te=i===R.FORCE,w=0,ne=v,T=0;if(l>1){let t=c+(C?0:d),n=~~(b/t);e._currentIteration=lt(n,0,l),C&&e._currentIteration--,w=e._currentIteration%2,ne=b-n*t||0}let E=f^(p&&w),D=e._ease,O=C?E?0:o:E?c-ne:ne;D&&(O=c*D(O/c)||0);let k=(a?a.backwards:v<g)?!E:!!E;if(e._currentTime=v,e._iterationTime=O,e.backwards=k,S&&!e.began?(e.began=!0,!n&&(!a||!k&&a.began)&&e.onBegin(e)):v<=0&&(e.began=!1),!n&&!m&&S&&e._currentIteration!==u&&e.onLoop(e),te||i===R.AUTO&&(t>=(a&&h>0?0:h)&&t<=_||t<=h&&y>h||t>=_&&y!==o)||O>=_&&y!==o||O<=h&&y>0&&!C||t<=y&&y===o&&s||C&&!s&&ee){if(S&&(e.computeDeltaTime(y),n||e.onBeforeUpdate(e)),!m){let t=te||(k?x*-1:x)>=H.tickThreshold,i=W(e._offset+(a?a._offset:0)+h+O,12),o=e._head,s,c,l,u,d=0;for(;o;){let e=o._composition,n=o._currentTime,a=o._changeDuration,f=o._absoluteStartTime+o._changeDuration,p=o._nextRep,m=o._prevRep,h=e!==z.none,g=m?m._absoluteStartTime+m._changeDuration:0,_=m&&m.parent!==o.parent,v=!p||p._isOverridden?f:p.parent===o.parent?f+p._delay:p._absoluteStartTime<p._absoluteUpdateStartTime?p._absoluteStartTime:p._absoluteUpdateStartTime;if((t||(n!==a||i<=v||m&&!_&&(!p||p.parent!==o.parent))&&(n!==0||i>=o._absoluteStartTime||_&&!o._hasFromValue&&!m._isOverridden&&i>=g||p&&!p._isOverridden&&p.parent===o.parent&&p._currentTime!==0&&O<p._startTime))&&(!m||_||O>=o._startTime)&&(!h||!o._isOverridden&&(!o._isOverlapped||i<=f)&&(!p||p._isOverridden||i<=v)&&(!m||m._isOverridden||(_?i>=o._absoluteStartTime||!o._hasFromValue&&i>=g:i>=g+o._delay)))){let t=o._currentTime=lt(O-o._startTime,0,a),n=o._ease(t/o._updateDuration),i=o._modifier,f=o._valueType,p=o._tweenType,m=p===I.OBJECT,g=f===L.NUMBER,_=g&&m||n===0||n===1?-1:H.precision,v,y;if(g)v=y=i(W(ut(o._fromNumber,o._toNumber,n),_));else if(f===L.UNIT)y=i(W(ut(o._fromNumber,o._toNumber,n),_)),v=`${y}${o._unit}`;else if(f===L.COLOR){let e=o._numbers,t=o._fromNumbers,a=o._toNumbers,s=1-n,c=t[0],l=t[1],u=t[2],d=a[0],f=a[1],p=a[2];e[0]=i(Math.sqrt(c*c*s+d*d*n)),e[1]=i(Math.sqrt(l*l*s+f*f*n)),e[2]=i(Math.sqrt(u*u*s+p*p*n)),e[3]=i(ut(t[3],a[3],n)),(!o._setter||r)&&(v=`rgba(${W(e[0],0)},${W(e[1],0)},${W(e[2],0)},${e[3]})`)}else f===L.COMPLEX&&(v=Ft(o,n,_));if(h&&(o._number=y),!r&&e!==z.blend){let e=o.property;s=o.target,o._setter?o._setter(s,y,o):m?s[e]=v:p===I.ATTRIBUTE?s.setAttribute(e,v):(c=s.style,p===I.TRANSFORM?(s!==l&&(l=s,u=s[pe]),u[e]=v,d=1):p===I.CSS?c[e]=v:p===I.CSS_VAR&&c.setProperty(e,v)),S&&(T=1)}else o._value=v}else n&&m&&!_&&O<o._startTime&&(o._currentTime=0);d&&o._renderTransforms&&(c.transform=_t(u),d=0),o=o._next}!n&&T&&e.onRender(e)}!n&&S&&e.onUpdate(e)}return a&&ee?!n&&(a.began&&!k&&v>0&&!s||k&&v<=1e-11&&s)&&(e.onComplete(e),e.completed=!k):S&&C?l===1/0?e._startTime+=e.duration:e._currentIteration>=l-1&&(e.paused=!0,!s&&!m&&(e.completed=!0,!n&&(!a||!k&&a.began)&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,T},Lt=(e,t,n,r,i)=>{let a=e._currentIteration;if(It(e,t,n,r,i),e._hasChildren){let o=e,s=o.backwards,c=r?t:o._iterationTime,l=Re(),u=0,d=!0;if(!r&&o._currentIteration!==a){let e=o.iterationDuration;K(o,t=>{if(!s)!t.completed&&!t.backwards&&t._currentTime<t.iterationDuration&&It(t,e,n,1,R.FORCE),t.began=!1,t.completed=!1;else{let r=t.duration,i=t._offset+t._delay,a=i+r;!n&&r<=1e-11&&(!i||a===e)&&t.onComplete(t)}}),n||o.onLoop(o)}K(o,e=>{let t=W((c-e._offset)*e._speed,12);if(s&&t>e._delay+e.duration)return;let a=e._fps<o._fps?e.requestTick(l):i;u+=It(e,t,n,r,a),!e.completed&&d&&(d=!1)},s),!n&&u&&o.onRender(o),(d||s)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,n||(o.onComplete(o),o._resolve(o))))}},Rt={},zt=(e,t,n)=>{if(n===I.TRANSFORM)return _e.get(e)||e;if(n===I.CSS||n===I.ATTRIBUTE&&Ge(t)&&e in t.style){let t=Rt[e];if(t)return t;{let t=e&&Ie(e);return Rt[e]=t,t}}return e},Bt=(e,t=!1)=>{if(e._hasChildren)K(e,e=>Bt(e,t),!0);else{let n=e;n.pause(),K(n,e=>{let r=e.property,i=e.target,a=e._tweenType,o=e._inlineValue,s=We(o)||o===``;if(e._setter){if(!t&&!s){if(Mt(o,Pt),Pt.d){let t=Pt.d,n=e._numbers;for(let e=0,r=t.length;e<r;e++)n[e]=t[e]}else e._number=Pt.n;e._setter(e.target,e._number,e)}}else if(a===I.OBJECT)!t&&!s&&(i[r]=o);else if(i[de]){if(a===I.ATTRIBUTE)t||(s?i.removeAttribute(r):i.setAttribute(r,o));else{let t=i.style;if(a===I.TRANSFORM){let n=i[pe];s?delete n[r]:n[r]=o,e._renderTransforms&&(Object.keys(n).length?t.transform=_t(n):t.removeProperty(`transform`))}else s?t.removeProperty(Ie(r)):t[r]=o}}i[de]&&n._tail===e&&n.targets.forEach(e=>{e.getAttribute&&e.getAttribute(`style`)===``&&e.removeAttribute(`style`)})})}return e},Vt=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=he/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){let t=+e,n=t<1e-11?V:t,r=he/n;n>Ne.frameRate&&(Ne.frameRate=n),this._fps=n,this._frameDuration=r}get speed(){return this._speed}set speed(e){let t=+e;this._speed=t<1e-11?V:t}requestTick(e){let t=this._frameDuration,n=e-this._lastTickTime,r=t*.25;return n+(r<4?r:4)<t?R.NONE:(this._lastTickTime=n>=t?e-n%t:e,R.AUTO)}computeDeltaTime(e){let t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},Ht={animation:null,update:be},Ut=e=>{let t=Ht.animation;return t||(t={duration:V,computeDeltaTime:be,_offset:0,_delay:0,_head:null,_tail:null},Ht.animation=t,Ht.update=()=>{e.forEach(e=>{for(let t in e){let n=e[t],r=n._head;if(r){let e=r._valueType,t=e===L.COMPLEX||e===L.COLOR?G(r._fromNumbers):null,i=r._fromNumber,a=n._tail;for(;a&&a!==r;){if(t)for(let e=0,n=a._numbers.length;e<n;e++)t[e]+=a._numbers[e];else i+=a._number;a=a._prevAdd}r._toNumber=i,r._toNumbers=t}}}),It(t,1,1,0,R.FORCE)}),t},Wt=P?requestAnimationFrame:setImmediate,Gt=P?cancelAnimationFrame:clearImmediate,Kt=class extends Vt{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=Ne,this.paused=!0,this.reqId=0}update(){let e=this._currentTime=Re();if(this.requestTick(e)){this.computeDeltaTime(e);let t=this._speed,n=this._fps,r=this._head;for(;r;){let i=r._next;r.paused?(mt(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):Lt(r,(e-r._startTime)*r._speed*t,0,0,r._fps<n?r.requestTick(e):R.AUTO),r=i}Ht.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(Re()),this.reqId=Wt(qt)),this}pause(){if(this.reqId)return this.paused=!0,Jt()}resume(){if(this.paused)return this.paused=!1,K(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(H.timeScale===1?1:he)}set speed(e){let t=e*H.timeScale;this._speed!==t&&(this._speed=t,K(this,e=>e.speed=e._speed))}get timeUnit(){return H.timeScale===1?`ms`:`s`}set timeUnit(e){let t=.001,n=e===`s`,r=n?t:1;if(H.timeScale!==r){H.timeScale=r,H.tickThreshold=200*r;let e=n?t:he;this.defaults.duration*=e,this._speed*=e}}get precision(){return H.precision}set precision(e){H.precision=e}},J=(()=>{let e=new Kt(Re());return P&&(Fe.engine=e,F.addEventListener(`visibilitychange`,()=>{e.pauseOnDocumentHidden&&(F.hidden?e.pause():e.resume())})),e})(),qt=()=>{J._head?(J.reqId=Wt(qt),J.update()):J.reqId=0},Jt=()=>(Gt(J.reqId),J.reqId=0,J),Yt={_rep:new WeakMap,_add:new Map},Xt=(e,t,n=`_rep`)=>{let r=Yt[n],i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},Zt=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,Qt=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=V,e._currentTime=V},$t=(e,t)=>{let n=e._composition;if(n===z.replace){let n=e._absoluteStartTime;ht(t,e,Zt,`_prevRep`,`_nextRep`);let r=e._prevRep;if(r){let t=r.parent,i=r._absoluteEndTime;if(e.parent.id!==t.id&&t.iterationCount>1&&i+(t.duration-t.iterationDuration)>n){Qt(r);let e=r._prevRep;for(;e&&e.parent.id===t.id;)Qt(e),e=e._prevRep}let a=e._absoluteUpdateStartTime;if(i>a){let e=r._startTime,t=W(a-(i-(e+r._updateDuration))-e,12);r._changeDuration=t,r._currentTime=t,r._isOverlapped=1,t<1e-11&&Qt(r)}let o=e.parent.parent;if(!o||o!==t.parent){let e=!0;if(K(t,t=>{t._isOverlapped||(e=!1)}),e){let e=t.parent;if(e){let n=!0;K(e,e=>{e!==t&&K(e,e=>{e._isOverlapped||(n=!1)})}),n&&e.cancel()}else t.cancel()}}}}else if(n===z.blend){let t=Xt(e.target,e.property,`_add`),n=Ut(Yt._add),r=t._head;r||(r={...e},r._composition=z.replace,r._updateDuration=V,r._startTime=0,r._numbers=G(e._fromNumbers),r._number=0,r._next=null,r._prev=null,ht(t,r),ht(n,r));let i=e._toNumber;if(e._fromNumber=r._fromNumber-i,e._toNumber=0,e._numbers=G(e._fromNumbers),e._number=0,r._fromNumber=i,e._toNumbers.length){let t=G(e._toNumbers);t.forEach((t,n)=>{e._fromNumbers[n]=r._fromNumbers[n]-t,e._toNumbers[n]=0}),r._fromNumbers=t}ht(t,e,null,`_prevAdd`,`_nextAdd`)}return e},en=e=>{let t=e._composition;if(t!==z.none){let n=e.target,r=e.property,i=Yt._rep.get(n)[r];if(mt(i,e,`_prevRep`,`_nextRep`),t===z.blend){let t=Yt._add,i=t.get(n);if(!i)return;let a=i[r],o=Ht.animation;mt(a,e,`_prevAdd`,`_nextAdd`);let s=a._head;if(s&&s===a._tail){mt(a,s,`_prevAdd`,`_nextAdd`),mt(o,s);let e=!0;for(let t in i)if(i[t]._head){e=!1;break}e&&t.delete(n)}}}return e},tn=(e,t,n)=>{let r=!1;return K(t,i=>{let a=i.target;if(e.includes(a)){let e=i.property,o=i._tweenType,s=zt(n,a,o);(!s||s&&s===e)&&(i.parent._tail===i&&i._tweenType===I.TRANSFORM&&i._prev&&i._prev._tweenType===I.TRANSFORM&&(i._prev._renderTransforms=1),mt(t,i),en(i),r=!0)}},!0),r},nn=(e,t,n)=>{let r=t||J,i;if(r._hasChildren){let t=0;K(r,a=>{if(!a._hasChildren){if(i=tn(e,a,n),i&&!a._head)a.cancel(),mt(r,a);else{let e=a._offset+a._delay+a.duration;e>t&&(t=e)}}a._head?nn(e,a,n):a._hasChildren=!1},!0),U(r.iterationDuration)||(r.iterationDuration=t)}else i=tn(e,r,n);i&&!r._head&&(r._hasChildren=!1,r.cancel&&r.cancel())},rn=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),an=e=>e._cancelled?(e._hasChildren?K(e,an):K(e,e=>{e._composition!==z.none&&$t(e,Xt(e.target,e.property))}),e._cancelled=0,e):e,on=0,sn=(e,t)=>e._priority>t._priority,cn=class extends Vt{constructor(e={},t=null,n=0){super(0),++on;let{id:r,delay:i,duration:a,reversed:o,alternate:s,loop:c,loopDelay:l,autoplay:u,frameRate:d,playbackRate:f,priority:p,onComplete:m,onLoop:h,onPause:g,onBegin:_,onBeforeUpdate:v,onUpdate:y}=e;Pe.current&&Pe.current.register(this);let b=t?0:J._lastTickTime,x=t?t.defaults:H.defaults,S=Ue(i)||U(i)?x.delay:+i,C=Ue(a)||U(a)?1/0:+a,ee=q(c,x.loop),te=q(l,x.loopDelay),w=ee===!0||ee===1/0||ee<0?1/0:ee+1,ne=0;t?ne=n:(J.reqId||J.requestTick(Re()),ne=(J._lastTickTime-J._startTime)*H.timeScale),this.id=U(r)?on:r,this.parent=t,this.duration=dt((C+te)*w-te)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=_||x.onBegin,this.onBeforeUpdate=v||x.onBeforeUpdate,this.onUpdate=y||x.onUpdate,this.onLoop=h||x.onLoop,this.onPause=g||x.onPause,this.onComplete=m||x.onComplete,this.iterationDuration=C,this.iterationCount=w,this._autoplay=!t&&q(u,x.autoplay),this._offset=ne,this._delay=S,this._loopDelay=te,this._iterationTime=0,this._currentIteration=0,this._resolve=be,this._running=!1,this._reversed=+q(o,x.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=q(s,x.alternate),this._prev=null,this._next=null,this._lastTickTime=b,this._startTime=b,this._lastTime=b,this._fps=q(d,x.frameRate),this._speed=q(f,x.playbackRate),this._priority=+q(p,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return lt(W(this._currentTime,H.precision),-this._delay,this.duration)}set currentTime(e){let t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return lt(W(this._iterationTime,H.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return lt(W(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return lt(W(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){let t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*lt(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return an(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,Lt(this,0,1,~~e,R.FORCE),rn(this),this._hasChildren&&K(this,rn),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&Lt(this,this.duration,1,~~e,R.FORCE),this.reset(e);let t=this._autoplay;return t===!0?this.resume():t&&!U(t.linked)&&t.link(this),this}resetTime(){let e=1/(this._speed*J._speed);return this._startTime=Re()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?Lt(this,V,0,0,R.FORCE):(this._running||=(ht(J,this,sn),J._hasChildren=!0,!0),this.resetTime(),this._startTime-=12,J.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,n=0){an(this),this.completed=!1;let r=this.paused;return this.paused=!0,Lt(this,e+this._delay,~~t,~~n,R.AUTO),r?this:this.resume()}alternate(){let e=this._reversed,t=this.iterationCount,n=this.iterationDuration,r=t===1/0?at(me/n):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(n*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?K(this,e=>e.cancel(),!0):K(this,en),this._cancelled=1,this.pause()}stretch(e){let t=this.duration,n=ft(e);if(t===n)return this;let r=e/t,i=e<=V;return this.duration=i?V:n,this.iterationDuration=i?V:ft(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){Lt(this,0,1,0,R.AUTO);let e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=be){let t=this.then,n=()=>{this.then=null,e(this),this.then=t,this._resolve=be};return new Promise(e=>(this._resolve=()=>e(n()),this.completed&&this._resolve(),this))}};function ln(e){let t=He(e)?Pe.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function un(e){if(We(e))return[];if(!P)return ze(e)&&e.flat(1/0)||[e];if(ze(e)){let t=e.flat(1/0),n=[];for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!We(r)){let e=ln(r);if(e)for(let t=0,r=e.length;t<r;t++){let r=e[t];if(!We(r)){let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}else{let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}}return n}let t=ln(e);return t?Array.from(t):[e]}function dn(e){let t=un(e),n=t.length;for(let e=0;e<n;e++){let n=t[e];if(!n[ue]){n[ue]=!0;let e=Ge(n);(n.nodeType||e)&&(n[de]=!0,n[fe]=e,n[pe]={})}}return t}var fn={deg:1,rad:180/st,turn:360},pn={},mn=(e,t,n,r=!1)=>{let i=t.u,a=t.n;if(t.t===L.UNIT&&i===n)return t;let o=a+i+n,s=pn[o];if(!U(s)&&!r)t.n=s;else{let r;if(i in fn)r=a*fn[i]/fn[n];else{let t=e.cloneNode(),o=e.parentNode,s=o&&o!==F?o:F.body;s.appendChild(t);let c=t.style;c.width=100+i;let l=t.offsetWidth||100;c.width=100+n;let u=l/(t.offsetWidth||100);s.removeChild(t),r=u*a}t.n=r,pn[o]=r}return t.t,L.UNIT,t.u=n,t},hn=e=>e,gn=(e=1.68)=>t=>et(t,+e),_n={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},vn=st/2,yn=st*2,bn={"":gn,Quad:gn(2),Cubic:gn(3),Quart:gn(4),Quint:gn(5),Sine:e=>1-rt(e*vn),Circ:e=>1-tt(1-e*e),Expo:e=>e?et(2,10*e-10):0,Bounce:e=>{let t,n=4;for(;e<((t=et(2,--n))-1)/11;);return 1/et(4,3-n)-7.5625*et((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{let n=lt(+e,1,10),r=lt(+t,V,2),i=r/yn*ot(1/n),a=yn/r;return e=>e===0||e===1?e:-n*et(2,-10*(1-e))*nt((1-e-i)*a)}},xn=(()=>{let e={linear:hn,none:hn};for(let t in _n)for(let n in bn){let r=bn[n],i=_n[t];e[t+n]=n===``||n===`Back`||n===`Elastic`?(e,t)=>i(r(e,t)):i(r)}return e})(),Sn={linear:hn,none:hn},Cn=e=>{if(Sn[e])return Sn[e];if(e.indexOf(`(`)<=-1){let t=_n[e]||e.includes(`Back`)||e.includes(`Elastic`)?xn[e]():xn[e];return t?Sn[e]=t:hn}{let t=e.slice(0,-1).split(`(`),n=xn[t[0]];return n?Sn[e]=n(...t[1].split(`,`)):hn}},wn=[`steps(`,`irregular(`,`linear(`,`cubicBezier(`],Tn=e=>{if(He(e)){for(let t=0,n=wn.length;t<n;t++)if(Le(e,wn[t]))return console.warn(`String syntax for \`ease: "${e}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${e}\``),hn}return Ue(e)?e:He(e)?Cn(e):hn},Y=jt(),X=jt(),En={},Dn={func:null},On={func:null},kn=[null],An=[null,null],jn={to:null},Mn=0,Nn=0,Pn,Fn,In=(e,t)=>{let n={};if(ze(e)){let t=[].concat(...e.map(e=>Object.keys(e))).filter(Xe);for(let r=0,i=t.length;r<i;r++){let i=t[r];n[i]=e.map(e=>{let t={};for(let n in e){let r=e[n];Xe(n)?n===i&&(t.to=r):t[n]=r}return t})}}else{let r=q(t.duration,H.defaults.duration);Object.keys(e).map(t=>({o:parseFloat(t)/100,p:e[t]})).sort((e,t)=>e.o-t.o).forEach(e=>{let t=e.o,i=e.p;for(let e in i)if(Xe(e)){let a=n[e];a||=n[e]=[];let o=t*r,s=a.length,c=a[s-1],l={to:i[e]},u=0;for(let e=0;e<s;e++)u+=a[e].duration;s===1&&(l.from=c.to),i.ease&&(l.ease=i.ease),l.duration=o-(s?u:0),a.push(l)}return e});for(let e in n){let t=n[e],r;for(let e=0,n=t.length;e<n;e++){let n=t[e],i=n.ease;n.ease=r||void 0,r=i}t[0].duration||t.shift()}}return n},Ln=class extends cn{constructor(e,t,n,r,i=!1,a=0,o){super(t,n,r),this._head,this._tail,++Nn;let s=dn(e),c=s.length,l=t.keyframes,u=l?pt(In(l,t),t):t,{id:d,delay:f,duration:p,ease:m,playbackEase:h,modifier:g,composition:_,onRender:v}=u,y=n?n.defaults:H.defaults,b=q(m,y.ease),x=q(h,y.playbackEase),S=x?Tn(x):null,C=!U(b.ease),ee=C?b.ease:q(m,S?`linear`:y.ease),te=C?b.settlingDuration:q(p,y.duration),w=q(f,y.delay),ne=g||y.modifier,T=U(_)&&c>=1e3?z.none:U(_)?y.composition:_,E=this._offset+(n?n._offset:0);C&&(b.parent=this);let D=NaN,O=NaN,k=0,A=0;for(let e=0;e<c;e++){let t=s[e],r=a||e,c=o||s,l=NaN,d=NaN;for(let e in u)if(Xe(e)){let a=Dt(t,e),o=yt(t,e),s=zt(e,t,a),f=u[e],p=ze(f);if(i&&!p&&(An[0]=f,An[1]=f,f=An),p){let e=f.length,t=!Be(f[0]);e===2&&t?(jn.to=f,kn[0]=jn,Pn=kn):e>2&&t?(Pn=[],f.forEach((e,t)=>{t?t===1?(An[1]=e,Pn.push(An)):Pn.push(e):An[0]=e})):Pn=f}else kn[0]=f,Pn=kn;let m=null,h=null,g=NaN,_=0,v=0;for(let e=Pn.length;v<e;v++){let i=Pn[v];Be(i)?Fn=i:(jn.to=i,Fn=jn),Dn.func=null,On.func=null;let l=Et(q(Fn.composition,T),t,r,c,null,null),u=Ve(l)?l:z[l];!m&&u!==z.none&&(m=Xt(t,s));let d=m?m._tail:null,f=n&&d&&d.parent.parent===n?d:h,p=Et(Fn.to,t,r,c,Dn,f),y;Be(p)&&!U(p.to)?(Fn=p,y=p.to):y=p;let b=Et(Fn.from,t,r,c,On,f),x=Fn.ease||ee,S=Et(x,t,r,c,null,f),C=Ue(S)||He(S)?S:x,D=!U(C)&&!U(C.ease),O=D?C.ease:C,j=D?C.settlingDuration:Et(q(Fn.duration,e>1?Et(te,t,r,c,null,f)/e:te),t,r,c,null,f),re=Et(q(Fn.delay,v?0:w),t,r,c,null,f),ie=Fn.modifier||ne,ae=!U(b),M=!U(y),oe=ze(y),se=oe||ae&&M,ce=h?_:0,N=h?_+re:re,P=W(E+N,12),le=W(E+ce,12);!A&&(ae||oe)&&(A=1);let F=h;if(u!==z.none){let e=m._head;for(;e&&e._absoluteStartTime<=P;)if(e._isOverridden||(F=e),e=e._nextRep,e&&e._absoluteStartTime>=P)for(;e;)Qt(e),e=e._nextRep}if(se){Mt(oe?Et(y[0],t,r,c,On,f):b,Y),Mt(oe?Et(y[1],t,r,c,Dn,f):y,X);let e=kt(t,s,a,En);Y.t===L.NUMBER&&(F?F._valueType===L.UNIT&&(Y.t=L.UNIT,Y.u=F._unit):(Mt(e,Pt),Pt.t===L.UNIT&&(Y.t=L.UNIT,Y.u=Pt.u)))}else M?Mt(y,X):h?Nt(h,X):Mt(n&&F&&F.parent.parent===n?F._value:kt(t,s,a,En),X),ae?Mt(b,Y):h?Nt(h,Y):Mt(n&&F&&F.parent.parent===n?F._value:kt(t,s,a,En),Y);if(Y.o&&(Y.n=At(F?F._toNumber:Mt(kt(t,s,a,En),Pt).n,Y.n,Y.o)),X.o&&(X.n=At(Y.n,X.n,X.o)),Y.t!==X.t){if(Y.t===L.COMPLEX||X.t===L.COMPLEX){let e=Y.t===L.COMPLEX?Y:X,t=Y.t===L.COMPLEX?X:Y;t.t=L.COMPLEX,t.s=G(e.s),t.d=e.d.map(()=>t.n)}else if(Y.t===L.UNIT||X.t===L.UNIT){let e=Y.t===L.UNIT?Y:X,t=Y.t===L.UNIT?X:Y;t.t=L.UNIT,t.u=e.u}else if(Y.t===L.COLOR||X.t===L.COLOR){let e=Y.t===L.COLOR?Y:X,t=Y.t===L.COLOR?X:Y;t.t=L.COLOR,t.d=e.d.map(()=>0)}}if(Y.u!==X.u){let e=X.u?Y:X;e=mn(t,e,X.u?X.u:Y.u,!1)}if(X.d&&Y.d&&X.d.length!==Y.d.length){let e=Y.d.length>X.d.length?Y:X,t=e===Y?X:Y;t.d=e.d.map((e,n)=>U(t.d[n])?0:t.d[n]),t.s=G(e.s)}let I=W(+j||1e-11,12),R=En[s];We(R)||(En[s]=null);let ue=o?o.set:null;_=W(N+I,12);let de=Y.d,fe=X.d,pe=X.s,B={parent:this,id:Mn++,property:s,target:t,_value:null,_toFunc:Dn.func,_fromFunc:On.func,_ease:Tn(O),_fromNumbers:de?G(de):ge,_toNumbers:fe?G(fe):ge,_strings:pe?G(pe):ge,_fromNumber:Y.n,_toNumber:X.n,_numbers:de?G(de):ge,_number:Y.n,_unit:X.u,_modifier:ie,_currentTime:0,_startTime:N,_delay:+re,_updateDuration:I,_changeDuration:I,_absoluteStartTime:P,_absoluteUpdateStartTime:le,_absoluteEndTime:W(E+_,12),_hasFromValue:ae||oe?1:0,_tweenType:a,_setter:ue,_valueType:X.t,_composition:u,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:R,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};u!==z.none&&$t(B,m);let V=B._valueType;if(V===L.COMPLEX)B._value=Ft(B,1,-1);else if(V===L.UNIT)B._value=`${ie(B._toNumber)}${B._unit}`;else if(V===L.COLOR){let e=X.d;B._value=`rgba(${W(e[0],0)},${W(e[1],0)},${W(e[2],0)},${e[3]})`}else B._value=ie(B._toNumber);isNaN(g)&&(g=B._startTime),h=B,k++,ht(this,B)}(isNaN(O)||g<O)&&(O=g),(isNaN(D)||_>D)&&(D=_),a===I.TRANSFORM&&(l=k-v,d=k)}if(!isNaN(l)){let e=0;K(this,t=>{e>=l&&e<d&&(t._renderTransforms=1,t._composition===z.blend&&K(Ht.animation,e=>{e.id===t.id&&(e._renderTransforms=1)})),e++})}}c||console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`),O?(K(this,e=>{e._startTime-e._delay||(e._delay-=O),e._startTime-=O}),D-=O):O=0,D||(D=V,this.iterationCount=0),this.targets=s,this.id=U(d)?Nn:d,this.duration=D===1e-11?V:dt((D+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=v||y.onRender,this._ease=S,this._delay=O,this.iterationDuration=D,!this._autoplay&&A&&this.onRender(this)}stretch(e){let t=this.duration;if(t===ft(e))return this;let n=e/t;return K(this,e=>{e._updateDuration=ft(e._updateDuration*n),e._changeDuration=ft(e._changeDuration*n),e._currentTime*=n,e._delay*=n,e._startTime*=n,e._absoluteStartTime*=n,e._absoluteUpdateStartTime*=n,e._absoluteEndTime*=n}),super.stretch(e)}refresh(){return K(this,e=>{let t=e._toFunc,n=e._fromFunc;(t||n)&&(n?(Mt(n(),Y),Y.u!==e._unit&&e.target[de]&&mn(e.target,Y,e._unit,!0),e._fromNumbers=G(Y.d),e._fromNumber=Y.n):t&&(Mt(kt(e.target,e.property,e._tweenType),Pt),e._fromNumbers=G(Pt.d),e._fromNumber=Pt.n),t&&(Mt(t(),X),e._toNumbers=G(X.d),e._strings=G(X.s),e._toNumber=X.o?At(e._fromNumber,X.n,X.o):X.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),Bt(this)}then(e){return super.then(e)}},Rn=(e,t)=>H.editor?H.editor.addAnimation(e,t):new Ln(e,t,null,0,!1).init(),zn=(e,t)=>{if(Le(t,`<`)){let n=t[1]===`<`,r=e._tail,i=r?r._offset+r._delay:0;return n?i:i+r.duration}},Bn=(e,t)=>{let n=e.iterationDuration;if(n===1e-11&&(n=0),U(t))return n;if(Ve(+t))return+t;let r=t,i=e?e.labels:null,a=!We(i),o=zn(e,r),s=!U(o),c=je.exec(r);if(c){let e=c[0],t=r.split(e),l=a&&t[0]?i[t[0]]:n;return At(s?o:a?l:n,+t[1],e[0])}return s?o:a?U(i[r])?n:i[r]:n},Vn=(e,t)=>{if(!U(t))return H.editor&&H.editor.addSet?H.editor.addSet(e,t):(t.duration=V,t.composition=q(t.composition,z.none),new Ln(e,t,null,0,!0).resume())},Hn=(e=0,t=1,n=0)=>{let r=10**n;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},Un=0,Wn=(e,t=0,n=1,r=0)=>{let i=e===void 0?Un++: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}},Gn=(e,t=Hn)=>{let n=e.length,r,i;for(;n;)i=t(0,--n),r=e[n],e[n]=e[i],e[i]=r;return e},Kn=(e,t={})=>{let n=[],r=0,i,a=null,o=t.from,s=t.reversed,c=t.ease,l=!U(c),u=l&&!U(c.ease)?c.ease:l?Tn(c):null,d=t.grid,f=d===!0,p=t.axis,m=t.total,h=U(o)||o===0||o===`first`,g=o===`center`,_=o===`last`,v=o===`random`,y=ze(o),b=ze(e),x=t.use,S=$e(b?e[0]:e),C=b?$e(e[1]):0,ee=ke.exec((b?e[1]:e)+``),te=t.start||0+(b?S:0),w=t.seed,ne=!U(w)&&w!==!1?Wn(w===!0?0:w):Hn,T=t.jitter,E=!U(T),D=ze(T),O=D?T[0]:T||0,k=D?T[1]:T||0,A=h?0:Ve(o)?o:0;return(e,c,l,h,w)=>{let[T]=dn(e),D=U(m)?l.length:m,j=U(x)?!1:Ue(x)?x(T,c,D):kt(T,x),re=Ve(j)||He(j)&&Ve(+j)?+j:c,ie=re>=0&&re<D?re:c;if(g&&(A=(D-1)/2),_&&(A=D-1),!n.length){if(f){let e=!0,t=!1,r=1/0,i=1/0,a=1/0,s=-1/0,c=-1/0,u=-1/0,d=[],f=[],m=[];for(let n=0;n<D;n++){let o=l[n],p=0,h=0,g=0,_=!1;if(o&&Ue(o.getBoundingClientRect)){let e=o.getBoundingClientRect();p=e.left+e.width/2,h=e.top+e.height/2,_=!0}else{let e=o;e&&Ve(e.x)&&Ve(e.y)&&(p=e.x,h=e.y,Ve(e.z)&&(g=e.z,t=!0),_=!0)}if(!_){e=!1;break}d.push(p),f.push(h),m.push(g),p<r&&(r=p),h<i&&(i=h),g<a&&(a=g),p>s&&(s=p),h>c&&(c=h),g>u&&(u=g)}if(e){let e=d[0],l=f[0],h=m[0];y?(e=r+o[0]*(s-r),l=i+o[1]*(c-i),h=t?a+(o.length>=3?o[2]:.5)*(u-a):0):g?(e=(r+s)/2,l=(i+c)/2,h=(a+u)/2):_?(e=d[D-1],l=f[D-1],h=m[D-1]):Ve(o)&&(e=d[o],l=f[o],h=m[o]);for(let r=0;r<D;r++){let i=e-d[r],a=l-f[r],o=h-m[r],s=tt(i*i+a*a+(t?o*o:0));p===`x`&&(s=-i),p===`y`&&(s=-a),p===`z`&&(s=-o),n.push(s)}let v=1/0;for(let e=0;e<D;e++){let t=it(n[e]);t>0&&t<v&&(v=t)}if(v>0&&v<1/0)for(let e=0;e<D;e++)n[e]=n[e]/v}else for(let e=0;e<D;e++)n.push(it(A-e))}else for(let e=0;e<D;e++)if(!d)n.push(it(A-e));else{let t=d.length,r=d[0]*d[1],i,a,s;y?(i=o[0]*(d[0]-1),a=o[1]*(d[1]-1),s=t===3?(o.length>=3?o[2]:.5)*(d[2]-1):0):g?(i=(d[0]-1)/2,a=(d[1]-1)/2,s=t===3?(d[2]-1)/2:0):(i=A%d[0],a=at(A/d[0])%d[1],s=t===3?at(A/r):0);let c=e%d[0],l=at(e/d[0])%d[1],u=t===3?at(e/r):0,f=i-c,m=a-l,h=s-u,_=tt(f*f+m*m+(t===3?h*h:0));p===`x`&&(_=-f),p===`y`&&(_=-m),p===`z`&&(_=-h),n.push(_)}r=n[0];for(let e=1;e<D;e++)n[e]>r&&(r=n[e]);if(u||s)for(let e=0;e<D;e++){let t=n[e];u&&(t=u(t/r)*r),s&&(t=p?-t:it(r-t)),n[e]=t}if(E){a=Array(D);for(let e=0;e<D;e++)a[e]=ne(-1,1,4)}v&&(n=Gn(n,ne))}let ae=b?(C-S)/r:S;U(i)&&(i=w?Bn(w,U(t.start)?w.iterationDuration:te):te);let M=i+(ae*W(n[ie],2)||0);if(E){let e=r?n[ie]/r:0,t=O+(k-O)*e;M+=a[ie]*t}return t.modifier&&(M=t.modifier(M)),ee&&(M=`${M}${ee[2]}`),M}};function qn(){return typeof window>`u`||!window.matchMedia?!1:!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Jn(e,t){let n=setTimeout(()=>e.complete(),t+400);return()=>{clearTimeout(n),e.complete()}}function Yn(e,t=700){let n=typeof e==`number`&&Number.isFinite(e)?e:null,r=n!==null&&qn(),[i,o]=(0,a.useState)(0),s=(0,a.useRef)(0);return(0,a.useEffect)(()=>{if(!r)return;let e={n:s.current},i=Rn(e,{n,duration:t,ease:`outExpo`,onUpdate:()=>{s.current=e.n,o(e.n)},onComplete:()=>{s.current=n,o(n)}}),a=setTimeout(()=>i.complete(),t+400);return()=>{clearTimeout(a),i.pause()}},[n,t,r]),r?i:n}function Xn({value:e,duration:t}){let n=Yn(e,t);return n===null?e??null:Math.round(n)}function Zn(e){let t=(0,a.useRef)(null),n=(0,a.useRef)(null),r=(0,a.useRef)(()=>{}),i=(0,a.useRef)(null);return(0,a.useLayoutEffect)(()=>{let a=t.current,o=a?.querySelector(`:scope > .glide`);o&&(r.current=t=>{let r=a.querySelector(e);if(!r){o.style.opacity=`0`,n.current=null;return}let s=a.getBoundingClientRect(),c=r.getBoundingClientRect(),l={translateX:c.left-s.left+a.scrollLeft-a.clientLeft,translateY:c.top-s.top+a.scrollTop-a.clientTop,width:c.width,height:c.height},u=n.current;if(n.current={el:r,...l},!(u&&u.el===r&&[`translateX`,`translateY`,`width`,`height`].every(e=>Math.abs(u[e]-l[e])<.5))){if(o.style.opacity=`1`,i.current&&=(clearTimeout(i.current.t),i.current.anim.pause(),null),t&&u&&u.el!==r&&qn()){let e=Rn(o,{...l,duration:280,ease:`outExpo`});i.current={anim:e,t:setTimeout(()=>e.complete(),680)}}else Vn(o,l)}},r.current(!0))}),(0,a.useEffect)(()=>{let e=()=>r.current(!1);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),t}function Qn(){let e=(0,a.useRef)(null),t=(0,a.useRef)(null);return(0,a.useLayoutEffect)(()=>{let n=e.current;if(!n){t.current=null;return}let r=[...n.querySelectorAll(`:scope > [data-flip]`)],i=new Map(r.map(e=>[e.dataset.flip,e.offsetTop])),a=t.current;if(t.current=i,a&&qn())for(let e of r){let t=a.get(e.dataset.flip);t===void 0?Jn(Rn(e,{opacity:[0,1],translateY:[-12,0],duration:340,ease:`outExpo`}),340):Math.abs(t-i.get(e.dataset.flip))>1&&Jn(Rn(e,{translateY:[t-i.get(e.dataset.flip),0],duration:340,ease:`outExpo`}),340)}}),e}var $n=new Set([`activity`,`diff`,`settings`,`harness`,`harnesses`,`doctor`,`themes`,`library`,`laws`,`rules`,`profile`,`skills`,`agents`,`about`]),er={themes:`harness`,harnesses:`harness`,about:`settings`};function tr(){let e=()=>{let e=((typeof window<`u`?window.location.hash:``)||`#/`).slice(2).split(`/`).filter(Boolean);return e[0]===`section`?{view:`section`,section:e[1]}:e[0]===`item`?{view:`item`,type:e[1],name:decodeURIComponent(e[2]||``)}:e[0]===`docs`?{view:`docs`,page:decodeURIComponent(e.slice(1).join(`/`)||``)}:e[0]===`activity`&&e[1]?{view:`activity-detail`,sid:decodeURIComponent(e[1])}:$n.has(e[0])?{view:er[e[0]]||e[0]}:{view:`dashboard`}},[t,n]=(0,a.useState)(e);return(0,a.useEffect)(()=>{let t=()=>n(e());return window.addEventListener(`hashchange`,t),()=>window.removeEventListener(`hashchange`,t)},[]),t}var nr=e=>{window.location.hash=e},rr={red:`#FF5C57`,green:`#4ED888`,yellow:`#E8B53D`,blue:`#5B8CFF`,magenta:`#C77DFF`,cyan:`#3AD4C4`,white:`#E9EFEA`},ir={red:`#C53A36`,green:`#2FA864`,yellow:`#B8862A`,blue:`#3C66D8`,magenta:`#9A52D6`,cyan:`#2BA89B`,white:`#AEB8B0`},ar=e=>rr[e]||rr.cyan,or=e=>e===`yellow`||e===`white`||e===`cyan`||e===`green`?`#06100D`:`#FFFFFF`;function sr(e,t,n){if(!e)return;let r=n===`light`,i=r?ir[t]||ir.cyan:ar(t),a=r?`#FFFFFF`:or(t);r&&t===`white`&&(i=`#566B62`,a=`#FFFFFF`),e.style.setProperty(`--accent`,i),e.style.setProperty(`--accent-2`,ir[t]||ir.cyan),e.style.setProperty(`--accent-ink`,a)}var cr={cultivar:{dark:`#3AD4C4`,light:`#127E73`,ink:`#06100D`,inkLight:`#FFFFFF`},greenhouse:{dark:`#74CE86`,light:`#1C8450`,ink:`#06140C`,inkLight:`#FFFFFF`},operator:{dark:`#E8A23B`,light:`#8F5E10`,ink:`#1A1306`,inkLight:`#FFFFFF`},heirloom:{dark:`#B9A6C6`,light:`#6E5A7C`,ink:`#1B1622`,inkLight:`#FFFFFF`},matrix:{dark:`#19E37C`,light:`#0B7A47`,ink:`#04140C`,inkLight:`#FFFFFF`},aurora:{dark:`#2DE0B8`,light:`#0B7D62`,ink:`#04231A`,inkLight:`#FFFFFF`},perspective:{dark:`#FF7A59`,light:`#C24A2C`,ink:`#2A0E04`,inkLight:`#FFFFFF`},sequencer:{dark:`#5B57E8`,light:`#4F46E5`,ink:`#FFFFFF`,inkLight:`#FFFFFF`},cobalt:{dark:`#2BA8FF`,light:`#1668A8`,ink:`#021018`,inkLight:`#FFFFFF`},cosmic:{dark:`#C081FF`,light:`#7A33CC`,ink:`#1A0833`,inkLight:`#FFFFFF`},neon:{dark:`#DB245C`,light:`#D81E5B`,ink:`#FFFFFF`,inkLight:`#FFFFFF`},atlas:{dark:`#8FD694`,light:`#1C8450`,ink:`#14200F`,inkLight:`#FFFFFF`}};function lr(e,t,n){let r=cr[t];if(!e||!r)return!1;let i=n===`light`;return e.style.setProperty(`--accent`,i?r.light:r.dark),e.style.setProperty(`--accent-2`,r.light),e.style.setProperty(`--accent-ink`,i?r.inkLight:r.ink),!0}var ur={agents:{label:`Agents`,type:`agent`,desc:`capability specialists`,icon:`agent`},skills:{label:`Skills`,type:`skill`,desc:`repeatable workflows`,icon:`skill`},laws:{label:`Constitution`,type:`law`,desc:`ontology, invariants, doctrines`,icon:`law`},memory:{label:`Memory`,type:`memory`,desc:`durable facts`,icon:`library`},notebook:{label:`Notebook`,type:`notebook`,desc:`sovereign space`,icon:`notebook`},wiki:{label:`Knowledge`,type:`wiki`,desc:`knowledge base + setup`,icon:`graph`},config:{label:`Config`,type:`config`,desc:`install metadata`,icon:`settings`}},dr=[`agents`,`memory`,`notebook`,`wiki`,`config`],fr=dr.filter(e=>e!==`agents`&&e!==`config`),pr={config:`wiki`},mr=Object.fromEntries(Object.entries(ur).map(([e,t])=>[t.type,e]));function hr(e,t){let[n,r]=(0,a.useState)(()=>{try{return t(localStorage.getItem(e))}catch{return t(null)}});return(0,a.useEffect)(()=>{try{localStorage.setItem(e,n)}catch{}},[e,n]),[n,r]}var gr=`geneseed-mode`;function _r(){let[e,t]=hr(gr,e=>e===`light`?`light`:`dark`);return[e,()=>t(e=>e===`light`?`dark`:`light`)]}var vr=`geneseed-flavour`,yr=[{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:`greenhouse`,short:`Greenhouse`,name:`Greenhouse`,tagline:`Warm loam dark, fresh sage green, rounded humanist type — the softest, friendliest skin.`},{id:`operator`,short:`Operator`,name:`Operator HUD`,tagline:`Amber phosphor on cool charcoal — all-mono, zero-radius instrument readout.`},{id:`heirloom`,short:`Heirloom`,name:`Heirloom`,tagline:`Aubergine plum and serif display — the one luxe, calm, editorial skin.`},{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:`aurora`,short:`Aurora`,name:`Aurora Glass`,tagline:`The glass skin — frosted navy panels lit by a cyan-to-violet aurora, airy and weightless.`},{id:`perspective`,short:`Perspective`,name:`Perspective`,tagline:`Coral on cool slate, condensed-architectural headings, cards that physically lift off the page.`},{id:`sequencer`,short:`Sequencer`,name:`Sequencer`,tagline:`A quant terminal in daylight — indigo on white, Inter, lining numerals on a fine ruled grid.`},{id:`cobalt`,short:`Cobalt`,name:`Cobalt Terminal`,tagline:`Electric-blue hacker terminal — all-mono, 2px corners, CRT scanlines on near-black.`},{id:`cosmic`,short:`Cosmic`,name:`Cosmic`,tagline:`Violet-magenta nebula on near-black — wide Audiowide wordmark, chamfered sci-fi instrumentation.`},{id:`neon`,short:`Neon`,name:`Neon`,tagline:`Neon-noir: hot-pink edge-glow on near-black, all-mono Geist, frosted glass.`},{id:`atlas`,short:`Atlas`,name:`Atlas`,tagline:`The field journal — loam dark, sage ink, the codex as a living map.`}],br=new Set(yr.map(e=>e.id)),xr={a:`cultivar`,b:`greenhouse`,c:`operator`,d:`heirloom`,e:`matrix`,f:`aurora`,g:`perspective`,z:`sequencer`,cb:`cobalt`,cm:`cosmic`};function Sr(){return hr(vr,e=>br.has(e)?e:xr[e]||`cultivar`)}var Cr=`geneseed-accent`,wr=[{id:`auto`,short:`Auto`,tagline:`Follows the deployed voice's accent.`},{id:`curated`,short:`Curated`,tagline:`Each theme's own signature colour.`}],Tr=new Set(wr.map(e=>e.id));function Er(){return hr(Cr,e=>e&&Tr.has(e)?e:`auto`)}var Dr=`geneseed-layout`,Or=[{id:`auto`,short:`Auto`,tagline:`Follows the theme.`},{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.`}],kr=new Set(Or.map(e=>e.id));function Ar(e){return e===`atlas`||e===`greenhouse`?`journal`:e===`cobalt`?`greenhouse`:e===`operator`?`operator`:`cultivar`}function jr(e,t){return t&&t!==`auto`&&kr.has(t)?t:Ar(e)}function Mr(){return hr(Dr,e=>e&&kr.has(e)?e:`auto`)}function Nr(e){let[t,n]=(0,a.useState)(null),[r,i]=(0,a.useState)(null),[o,s]=(0,a.useState)([]),c=()=>N.overview().then(e=>{n(e),i(null)}).catch(t=>{i(t?.body?.message||t?.message||String(t)),e?.(t)});return(0,a.useEffect)(()=>{c()},[]),(0,a.useEffect)(()=>{N.themes().then(e=>s(e.themes)).catch(()=>{})},[]),{overview:t,error:r,themes:o,reload:c}}var Pr=1e3;async function Fr(e=0){await new Promise(t=>setTimeout(t,e));for(let e=0;e<30;e++)try{await N.ping();break}catch{await new Promise(e=>setTimeout(e,Pr))}window.location.reload()}var Ir=600;function Lr({onFinish:e,onError:t}={}){let[n,r]=(0,a.useState)([]),[i,o]=(0,a.useState)(null),[s,c]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{N.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,a.useEffect)(()=>{if(!i)return;let t=n.find(e=>e.id===i)?.action===`update`,a=setInterval(async()=>{if(!document.hidden)try{let n=await N.job(i);if(r(e=>{let t=e.findIndex(e=>e.id===i);if(t===-1)return e;let r=e[t],a=n.output||``;if(r.output===a&&r.status===n.status&&r.duration===n.duration)return e;let o=e.slice();return o[t]={...r,output:a,status:n.status,duration:n.duration},o}),n.status!==`running`){if(clearInterval(a),o(null),t){Fr(2e3);return}e?.(n.status)}}catch{clearInterval(a),t&&Fr(0)}},Ir);return()=>clearInterval(a)},[i]),{runs:n,activeId:i,consoleOpen:s,setConsoleOpen:c,runAction:async(e,n)=>{try{let{job_id:t}=await N.action(e,n),i=e===`build`&&n?.theme?`build (${n.theme} · ${n.emit})`:e;return r(e=>[...e,{id:t,action:i,status:`running`,output:``,started:Date.now()/1e3}]),o(t),c(!0),t}catch(e){t?.(e)}},cancelJob:e=>N.cancelJob(e).catch(e=>t?.(e)),clearRuns:()=>r([])}}var Rr=new Map;function zr(e,t=[],n=null){let r=n===null?null:`${n}|${t.join(``)}`,[i,o]=(0,a.useState)(()=>r!==null&&Rr.has(r)?Rr.get(r):null),[s,c]=(0,a.useState)(``),[l,u]=(0,a.useState)(()=>!(r!==null&&Rr.has(r))),d=(0,a.useRef)(e),f=(0,a.useRef)(r);(0,a.useLayoutEffect)(()=>{d.current=e,f.current=r});let p=(0,a.useCallback)(()=>(u(!0),c(``),Promise.resolve(d.current()).then(e=>{f.current!==null&&Rr.set(f.current,e),o(e)}).catch(e=>c(e.message)).finally(()=>u(!1))),t);return(0,a.useEffect)(()=>{if(f.current!==null&&Rr.has(f.current)){o(Rr.get(f.current)),c(``),u(!1);return}p()},[p]),{data:i,error:s,loading:l,reload:p,setData:o}}var Br=60,Vr=3600,Hr=86400,Ur={seconds:90,minutes:5400,hours:36*Vr};function Wr(e){let t=Math.max(0,Date.now()/1e3-e);return t<Ur.seconds?`${Math.round(t)}s`:t<Ur.minutes?`${Math.round(t/Br)}m`:t<Ur.hours?`${Math.round(t/Vr)}h`:`${Math.round(t/Hr)}d`}function Gr(e){return e?e.replace(/\\/g,`/`).replace(/^\/?(home|Users)\/[^/]+/i,`~`).replace(/^[A-Z]:\/Users\/[^/]+/i,`~`):`~`}var Kr={deployed:.4,doctorClean:.25,doctorMinor:.15,doctorMinorMax:2,doctorFail:.05,versionSynced:.2,diskClean:.15};function qr(e,t){if(!e)return 0;let n=e.doctor?.problems?.length??99,r=e.doctor?.ok?Kr.doctorClean:n<=Kr.doctorMinorMax?Kr.doctorMinor:Kr.doctorFail,i=t&&t.installed_fp&&t.installed_fp===t.source_fp;return(e.deployed?Kr.deployed:0)+r+(i?Kr.versionSynced:0)+(e.diff&&e.diff.missing===0?Kr.diskClean:0)}var Jr=e=>Math.max(...dr.map(t=>e?.[t]??0),1),Yr=e=>(e?.edited??0)+(e?.added??0),Xr=e=>(e?.laws??0)+(e?.doctrines?.rules??0),Z=i(),Zr={dashboard:`M3 13h7V3H3v10Zm0 8h7v-6H3v6Zm11 0h7V11h-7v10Zm0-18v6h7V3h-7Z`,library:`M4 5h10v14H4zM16 7h4v12h-4M7 9h4M7 12h4`,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`,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,Z.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,Z.jsx)(`path`,{d:Zr[e]||``})})}function Qr({className:e=`sprout`}){return(0,Z.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,Z.jsx)(`path`,{d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,Z.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,Z.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,Z.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})}var $r=[{hash:`#/`,id:`dashboard`,label:`Dashboard`,icon:`dashboard`,match:e=>e.view===`dashboard`,tag:()=>`today`},{group:`Codex`},{hash:`#/laws`,id:`laws`,label:`Constitution`,icon:`law`,match:e=>e.view===`laws`||e.view===`section`&&e.section===`laws`||e.view===`item`&&e.type===`law`,tag:e=>e?.counts?.laws??null},{hash:`#/rules`,id:`rules`,label:`Rules`,icon:`rule`,match:e=>e.view===`rules`},{hash:`#/profile`,id:`profile`,label:`Profile`,icon:`profile`,match:e=>e.view===`profile`},{hash:`#/skills`,id:`skills`,label:`Skills`,icon:`skill`,match:e=>e.view===`skills`||e.view===`section`&&e.section===`skills`||e.view===`item`&&e.type===`skill`,tag:e=>e?.counts?.skills??null},{hash:`#/agents`,id:`agents`,label:`Agents`,icon:`agent`,match:e=>e.view===`agents`||e.view===`section`&&e.section===`agents`||e.view===`item`&&e.type===`agent`,tag:e=>e?.counts?.agents??null},{hash:`#/library`,id:`library`,label:`Library`,icon:`library`,match:e=>e.view===`library`||e.view===`section`&&![`laws`,`skills`,`agents`].includes(e.section)||e.view===`item`&&![`law`,`skill`,`agent`].includes(e.type),tag:e=>e?.counts?(e.counts.memory??0)+(e.counts.notebook??0)+(e.counts.wiki??0)+(e.counts.config??0):null},{hash:`#/docs`,id:`docs`,label:`Docs`,icon:`docs`,match:e=>e.view===`docs`},{group:`Care`},{hash:`#/activity`,id:`activity`,label:`Activity`,icon:`activity`,match:e=>e.view===`activity`||e.view===`activity-detail`},{hash:`#/diff`,id:`changes`,label:`Changes`,icon:`changes`,match:e=>e.view===`diff`,tag:e=>(e?.diff?Yr(e.diff):null)||null},{hash:`#/doctor`,id:`doctor`,label:`Doctor`,icon:`doctor`,match:e=>e.view===`doctor`,tag:e=>e?.doctor?e.doctor.ok?`clean`:e.doctor.problems.length:null,warn:e=>!!e?.doctor&&!e.doctor.ok},{group:`Setup`},{hash:`#/harness`,id:`harness`,label:`Harness`,icon:`layers`,match:e=>e.view===`harness`,tag:e=>e?.theme??null},{hash:`#/settings`,id:`settings`,label:`Settings`,icon:`settings`,match:e=>e.view===`settings`}];function ei({value:e}){let t=2*Math.PI*30;return(0,Z.jsxs)(`svg`,{className:`rv-ring`,width:`66`,height:`66`,viewBox:`0 0 72 72`,role:`img`,"aria-label":`Growth ${Math.round(e*100)} of 100`,children:[(0,Z.jsx)(`circle`,{cx:`36`,cy:`36`,r:30,fill:`none`,stroke:`var(--line-2)`,strokeWidth:`6`}),(0,Z.jsx)(`circle`,{cx:`36`,cy:`36`,r:30,fill:`none`,stroke:`var(--accent)`,strokeWidth:`6`,strokeLinecap:`round`,strokeDasharray:`${t*e} ${t}`,transform:`rotate(-90 36 36)`,style:{transition:`stroke-dasharray 1.1s cubic-bezier(.2,.7,.2,1)`}}),(0,Z.jsx)(`text`,{className:`rv-ring-num`,x:`36`,y:`34`,textAnchor:`middle`,children:Math.round(e*100)}),(0,Z.jsx)(`text`,{className:`rv-ring-lbl`,x:`36`,y:`47`,textAnchor:`middle`,children:`GROWTH`})]})}function ti({overview:e,setup:t}){if(!e)return null;let n=e.doctor?e.doctor.ok?`clean`:`${e.doctor.problems.length} to fix`:`—`;return(0,Z.jsxs)(`div`,{className:`rail-vitals`,children:[(0,Z.jsx)(ei,{value:qr(e,t)}),(0,Z.jsxs)(`div`,{className:`rv-rows`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`span`,{children:`Drift`}),(0,Z.jsx)(`b`,{children:Yr(e.diff)})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`span`,{children:`Doctor`}),(0,Z.jsx)(`b`,{children:n})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`span`,{children:`Built`}),(0,Z.jsx)(`b`,{className:`plain`,title:e.build_time||void 0,children:e.build_epoch?Wr(e.build_epoch):`never`})]})]})]})}function ni(e){let t=a.useRef(null);return(0,a.useEffect)(()=>e?.status!==`done`||!t.current||!qn()?void 0:Jn(Rn(t.current,{rotate:[{to:-14},{to:10},{to:-5},{to:0}],scale:[{to:1.14},{to:1}],duration:1100,ease:`inOutSine`}),1100),[e]),t}function ri({route:e,overview:t,setup:n,onOpenVoice:r,onNavigate:i,finish:a}){let o=Zn(`.rail-item.active`),s=ni(a);return(0,Z.jsxs)(`nav`,{className:`rail`,id:`rail-nav`,"aria-label":`Harness navigation`,tabIndex:-1,ref:o,children:[(0,Z.jsx)(`span`,{className:`glide`,"aria-hidden":`true`}),(0,Z.jsxs)(`button`,{className:`rail-brand`,onClick:()=>{nr(`#/`),i?.()},title:`Dashboard`,children:[(0,Z.jsx)(`span`,{className:`sprout-sway`,ref:s,children:(0,Z.jsx)(Qr,{})}),(0,Z.jsxs)(`div`,{className:`brand-text`,children:[(0,Z.jsxs)(`span`,{className:`brand-name`,children:[`Gene`,(0,Z.jsx)(`b`,{children:`seed`})]}),(0,Z.jsx)(`span`,{className:`brand-sub`,children:`harness console`})]})]}),(0,Z.jsx)(ti,{overview:t,setup:n}),$r.map((n,r)=>{if(n.group)return(0,Z.jsx)(`div`,{className:`rail-group`,children:n.group},`g`+r);let a=n.tag?n.tag(t):null,o=n.match(e),s=typeof n.warn==`function`?n.warn(t):!!n.warn;return(0,Z.jsx)(`div`,{className:`rail-nav`,children:(0,Z.jsxs)(`a`,{className:`rail-item ${o?`active`:``}`,href:n.hash,"aria-current":o?`page`:void 0,title:n.label,onClick:()=>i?.(),children:[(0,Z.jsx)(Q,{name:n.icon}),(0,Z.jsx)(`span`,{children:n.label}),a?(0,Z.jsx)(`span`,{className:`tag`,style:s?{color:`var(--warn)`}:null,children:a}):null]})},n.id)}),(0,Z.jsx)(`div`,{className:`rail-spacer`}),(0,Z.jsx)(`div`,{className:`rail-foot`,children:(0,Z.jsxs)(`button`,{className:`voice`,onClick:r,title:`Switch deployed voice`,children:[(0,Z.jsx)(`span`,{className:`voice-orb`}),(0,Z.jsxs)(`div`,{className:`voice-meta`,children:[(0,Z.jsx)(`div`,{className:`vk`,children:`deployed voice`}),(0,Z.jsx)(`div`,{className:`vv`,children:t?.theme||`—`})]}),(0,Z.jsx)(Q,{name:`chevron`,className:`chev glyph`})]})})]})}var ii=`geneseed-harness`,ai=[{id:`opencode`,label:`OpenCode`},{id:`claude`,label:`Claude Code`}];function oi(e=`opencode`){return hr(ii,t=>t===`claude`||t===`opencode`?t:e)}function si(e){let t=String(e||``);return/^(claude|bob|copilot)/.test(t)?`claude`:`opencode`}function ci(e=0){let[t,n]=(0,a.useState)(null),[r,i]=(0,a.useState)(``),o=(0,a.useRef)(null),[s]=oi(),c=`${e}|${s}`,[l,u]=(0,a.useState)(c);return l!==c&&(u(c),n(null)),(0,a.useEffect)(()=>{o.current=null},[c]),{index:t,error:r,prime:(0,a.useCallback)(()=>{if(t||o.current)return o.current;let e=(async()=>{let e=[],t=[`laws`,`skills`,...dr],r=await Promise.all(t.map(async e=>{try{return{sec:e,items:(await N.catalog(e))?.items||[]}}catch{return{sec:e,items:[]}}}));for(let{sec:n,items:i}of r){let r=ur[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 N.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:`#/harness`})}}catch{}try{let t=await N.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||``}`.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])}}var li=24;function ui(e,t){let n=e.title.toLowerCase();return n.startsWith(t)?0:n.includes(t)?1:e.hay.includes(t)?2:-1}function di(e,t){let n=t.toLowerCase().trim();if(!n||!e)return[];let r=[];for(let t of e){let e=ui(t,n);e>=0&&r.push({e:t,s:e})}return r.sort((e,t)=>e.s-t.s||e.e.sortKey-t.e.sortKey||e.e.title.localeCompare(t.e.title)),r.slice(0,li).map(e=>e.e)}function fi(e,t){let n=t.trim().toLowerCase(),r=n?e.toLowerCase().indexOf(n):-1;return r<0?e:(0,Z.jsxs)(Z.Fragment,{children:[e.slice(0,r),(0,Z.jsx)(`mark`,{className:`spot-hit`,children:e.slice(r,r+n.length)}),e.slice(r+n.length)]})}function pi({query:e,index:t,loading:n,error:r,active:i,onActive:o,onClose:s}){let c=(0,a.useMemo)(()=>di(t,e),[t,e]),l=(0,a.useRef)(null),u=c.length>0;(0,a.useLayoutEffect)(()=>{let e=l.current?.querySelectorAll(`[data-spot-row]`);return!u||!e?.length||!qn()?void 0:Jn(Rn(e,{opacity:[0,1],translateY:[-4,0],duration:220,delay:Kn(18),ease:`outQuart`}),220+18*e.length)},[u]),(0,a.useEffect)(()=>{i>=c.length&&o(0)},[c,i,o]),(0,a.useEffect)(()=>{(l.current?.querySelector(`[data-spot-row="${i}"]`))?.scrollIntoView({block:`nearest`})},[i]);let d=e=>{e&&(nr(e.route),s())},f=[],p=null;return c.forEach((e,t)=>{(!p||p.kind!==e.kind)&&(p={kind:e.kind,rows:[]},f.push(p)),p.rows.push({entry:e,index:t})}),e.trim()?(0,Z.jsxs)(`div`,{className:`spotlight`,ref:l,id:`spotlight-list`,role:`listbox`,"aria-label":`Search results`,children:[r&&!t&&(0,Z.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`Could not load the search index — `,r]}),n&&!t&&!r&&(0,Z.jsx)(`div`,{className:`spot-empty`,role:`presentation`,children:`Loading…`}),!n&&c.length===0&&t&&(0,Z.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`No matches for “`,e,`”.`]}),f.map(t=>(0,Z.jsxs)(`div`,{className:`spot-group`,role:`group`,"aria-label":t.kind,children:[(0,Z.jsx)(`div`,{className:`spot-group-head`,"aria-hidden":`true`,children:t.kind}),t.rows.map(({entry:t,index:n})=>(0,Z.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(),d(t)},onMouseEnter:()=>o(n),children:[(0,Z.jsx)(`div`,{className:`spot-title`,children:fi(t.title,e)}),t.desc?(0,Z.jsx)(`div`,{className:`spot-desc`,children:t.desc}):null]},`${t.route}-${n}`))]},t.kind))]}):null}function mi({value:e,onChange:t,dataRev:n}){let r=(0,a.useRef)(null),i=(0,a.useRef)(null),[o,s]=(0,a.useState)(!1),[c,l]=(0,a.useState)(0),{index:u,error:d,prime:f}=ci(n);(0,a.useEffect)(()=>{let e=e=>{((e.metaKey||e.ctrlKey)&&!e.altKey&&e.key.toLowerCase()===`k`||e.key===`/`&&!e.target.closest(`input, textarea, select`))&&(e.preventDefault(),r.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,a.useEffect)(()=>{if(!o)return;let e=e=>{i.current?.contains(e.target)||s(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[o]);let p=o&&!!e.trim(),m=p&&u?di(u,e):[],h=c<m.length?`spot-opt-${c}`:void 0;return(0,Z.jsxs)(`div`,{className:`tb-search`,ref:i,children:[(0,Z.jsx)(Q,{name:`search`,className:`mag glyph`}),(0,Z.jsx)(`input`,{ref:r,role:`combobox`,"aria-label":`Search the harness`,"aria-autocomplete":`list`,"aria-expanded":p,"aria-controls":p?`spotlight-list`:void 0,"aria-activedescendant":h,value:e,onChange:e=>{t(e.target.value),l(0)},onFocus:()=>{s(!0),f()},onKeyDown:n=>{if(p){if(n.key===`ArrowDown`)n.preventDefault(),l(e=>Math.min(e+1,Math.max(m.length-1,0)));else if(n.key===`ArrowUp`)n.preventDefault(),l(e=>Math.max(e-1,0));else if(n.key===`Enter`){let e=m[c];e&&(n.preventDefault(),nr(e.route),s(!1),r.current?.blur())}else n.key===`Escape`&&(n.preventDefault(),e?t(``):(s(!1),r.current?.blur()))}},placeholder:`Search the harness…`,title:`Press / to jump here, or Ctrl-K / ⌘K from inside any field`}),(0,Z.jsx)(`span`,{className:`kbd`,children:`/`}),(0,Z.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:p?m.length?`${m.length} results`:`no matches`:``}),p&&(0,Z.jsx)(pi,{query:e,index:u,loading:!u,error:d,active:c,onActive:l,onClose:()=>{s(!1),r.current?.blur()}})]})}function hi({dataRev:e,onSwitch:t}){let{data:n}=zr(()=>N.installs(),[e]),r=(n?.installs||[]).filter(e=>e.state===`active`);if(r.length<2)return null;let i=r.find(e=>e.selected)||r[0];return(0,Z.jsxs)(`div`,{className:`row gap-8`,style:{alignItems:`center`},title:`Harness the console is viewing`,children:[(0,Z.jsx)(`span`,{style:{fontSize:12,color:`var(--text-3)`},children:`harness`}),(0,Z.jsx)(`select`,{className:`sel`,"aria-label":`harness to view`,value:i.id,onChange:async e=>{let n=r.find(t=>t.id===e.target.value);if(n)try{await N.selectView(n.host,n.path),t?.()}catch{}},children:r.map(e=>(0,Z.jsxs)(`option`,{value:e.id,children:[e.host,` · `,e.scope]},e.id))})]})}var gi={dashboard:`overview`,diff:`diff`,doctor:`doctor`,harness:`harness`,settings:`settings`};function _i(e){return e.view===`section`?[`laws`,`skills`].includes(e.section)?e.section:`library`:e.view===`item`?e.type===`law`?`laws`:e.type===`skill`?`skills`:`library`:gi[e.view]||e.view}function vi({route:e,navOpen:t,onToggleNav:n,target:r,version:i,query:a,onQuery:o,mode:s,onToggleMode:c,onShutdown:l,dataRev:u,onSwitch:d}){return(0,Z.jsxs)(`header`,{className:`topbar`,children:[(0,Z.jsx)(`button`,{className:`tb-menu`,onClick:n,"aria-label":t?`Close navigation`:`Open navigation`,"aria-expanded":!!t,"aria-controls":`rail-nav`,children:(0,Z.jsx)(Q,{name:t?`x`:`menu`})}),(0,Z.jsxs)(`div`,{className:`prompt`,children:[(0,Z.jsx)(`span`,{className:`path`,children:Gr(r)}),(0,Z.jsx)(`span`,{className:`sep`,children:`$`}),(0,Z.jsx)(`span`,{className:`cmd`,children:`geneseed`}),` `,(0,Z.jsxs)(`span`,{className:`flag`,children:[`--tab=`,_i(e)]}),i&&(0,Z.jsxs)(`span`,{className:`flag ver`,children:[` --version=`,i]}),(0,Z.jsx)(`span`,{className:`cur`})]}),(0,Z.jsx)(`div`,{className:`topbar-spacer`}),(0,Z.jsx)(hi,{dataRev:u,onSwitch:d}),(0,Z.jsx)(mi,{value:a,onChange:o,dataRev:u}),(0,Z.jsx)(`button`,{className:`iconbtn`,title:s===`light`?`Switch to dark`:`Switch to light`,"aria-label":s===`light`?`Switch to dark mode`:`Switch to light mode`,onClick:c,children:(0,Z.jsx)(Q,{name:s===`light`?`moon`:`sun`})}),(0,Z.jsx)(`button`,{className:`iconbtn`,title:`Stop server`,"aria-label":`Stop server`,onClick:l,children:(0,Z.jsx)(Q,{name:`power`})})]})}function yi({themes:e,current:t,onPick:n,onClose:r}){let i=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=e=>{i.current&&!i.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,a.useEffect)(()=>{i.current?.querySelector(`button.pop-item`)?.focus()},[]),(0,Z.jsxs)(`div`,{className:`pop`,ref:i,role:`menu`,"aria-label":`Switch voice`,children:[(0,Z.jsx)(`div`,{className:`tick`,style:{padding:`4px 10px 8px`},children:`Switch voice`}),e.map(e=>(0,Z.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.name===t,className:`pop-item ${e.name===t?`on`:``}`,onClick:()=>n(e.name),children:[(0,Z.jsx)(`span`,{className:`po`,style:{background:ar(e.accent),boxShadow:`0 0 8px ${ar(e.accent)}`}}),(0,Z.jsx)(`span`,{className:`pn`,children:e.name})]},e.name))]})}var bi=3500;function xi({toast:e,onClose:t}){return(0,a.useEffect)(()=>{let e=setTimeout(t,bi);return()=>clearTimeout(e)},[e]),(0,Z.jsxs)(`div`,{className:`toast ${e.kind}`,role:e.kind===`err`?`alert`:`status`,"aria-live":e.kind===`err`?void 0:`polite`,children:[(0,Z.jsx)(`div`,{children:e.msg}),(0,Z.jsx)(`div`,{style:{marginTop:8},children:(0,Z.jsx)(`button`,{className:`btn ghost`,onClick:t,children:`Dismiss`})})]})}function Si({runs:e,open:t,onToggle:n,onClear:r,onCancel:i,busy:o,finish:s}){let c=(0,a.useRef)(null),l=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=l.current;s&&e&&(e.classList.remove(`flash-ok`,`flash-bad`),e.offsetWidth,e.classList.add(s.status===`done`?`flash-ok`:`flash-bad`))},[s]);let u=e.length?e[e.length-1].output.length:0;return(0,a.useEffect)(()=>{let e=c.current;e&&t&&(e.scrollTop=e.scrollHeight)},[e.length,u,t]),(0,Z.jsxs)(`div`,{className:`console`,style:{height:`42vh`,transform:t?`none`:`translateY(calc(42vh - 42px))`},children:[(0,Z.jsxs)(`div`,{className:`console-head`,ref:l,onClick:n,onAnimationEnd:e=>{e.target===e.currentTarget&&e.currentTarget.classList.remove(`flash-ok`,`flash-bad`)},children:[o&&(0,Z.jsx)(`span`,{className:`console-progress`,"aria-hidden":`true`}),(0,Z.jsxs)(`span`,{className:`ttl`,children:[(0,Z.jsx)(`span`,{className:`live ${o?`on`:``}`}),`terminal`]}),(0,Z.jsx)(`span`,{className:`count`,children:e.length}),(0,Z.jsxs)(`div`,{className:`right`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsx)(`button`,{className:`iconbtn`,title:`Clear`,"aria-label":`Clear run history`,onClick:r,disabled:!e.length,children:(0,Z.jsx)(Q,{name:`clear`})}),(0,Z.jsx)(`button`,{className:`iconbtn`,title:t?`Collapse`:`Expand`,"aria-label":t?`Collapse console`:`Expand console`,"aria-expanded":t,onClick:n,children:(0,Z.jsx)(Q,{name:`chevron`,className:`glyph`,style:{transform:t?`rotate(90deg)`:`rotate(-90deg)`}})})]})]}),t&&(0,Z.jsxs)(`div`,{className:`console-body`,ref:c,children:[e.length===0&&(0,Z.jsx)(`div`,{className:`console-empty`,children:`No commands run yet. Actions you trigger stream here.`}),e.map(e=>(0,Z.jsxs)(`div`,{className:`run`,children:[(0,Z.jsxs)(`div`,{className:`run-head`,children:[(0,Z.jsx)(`span`,{className:`pr`,children:`$`}),(0,Z.jsx)(`span`,{className:`act`,children:e.action}),(0,Z.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,Z.jsx)(`button`,{className:`iconbtn run-cancel`,title:`Cancel this run`,"aria-label":`Cancel the ${e.action} run`,onClick:()=>i(e.id),children:(0,Z.jsx)(Q,{name:`x`})})]}),e.output&&(0,Z.jsx)(`pre`,{className:`run-out`,children:e.output})]},e.id))]})]})}var Ci=550,wi=`gs-splash-seen`;function Ti(){try{if(window.localStorage.getItem(wi))return 0;window.localStorage.setItem(wi,`1`)}catch{}return Ci}function Ei({ready:e,onDone:t}){let[n,r]=(0,a.useState)(!1),[i,o]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=setTimeout(()=>r(!0),Ti());return()=>clearTimeout(e)},[]),e&&n&&!i&&o(!0),(0,a.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>t?.(),700);return()=>clearTimeout(e)},[i]),(0,Z.jsxs)(`div`,{className:`boot-splash${i?` fading`:``}`,"aria-hidden":`true`,onAnimationEnd:e=>{e.animationName===`splashOut`&&t?.()},children:[(0,Z.jsxs)(`div`,{className:`boot-dial`,children:[(0,Z.jsxs)(`svg`,{className:`boot-ring`,viewBox:`0 0 172 172`,children:[(0,Z.jsx)(`circle`,{cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--surface-3)`,strokeWidth:`9`}),(0,Z.jsx)(`circle`,{cx:`86`,cy:`86`,r:`50`,fill:`none`,stroke:`var(--line-2)`,strokeWidth:`8`,strokeDasharray:`1.2 5.3`,opacity:`.7`}),(0,Z.jsx)(`circle`,{className:`boot-progress`,cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--accent)`,strokeWidth:`9`,strokeLinecap:`round`})]}),(0,Z.jsxs)(`svg`,{className:`boot-sprout`,viewBox:`0 0 24 24`,children:[(0,Z.jsx)(`path`,{className:`bs-stem`,d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,Z.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,Z.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,Z.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})]}),(0,Z.jsxs)(`div`,{className:`boot-status`,children:[(0,Z.jsx)(`span`,{children:`germinating harness`}),(0,Z.jsx)(`span`,{className:`boot-caret`})]})]})}function Di({label:e=`Loading…`}){return(0,Z.jsxs)(`div`,{className:`loading`,role:`status`,children:[e,(0,Z.jsxs)(`div`,{className:`skel`,"aria-hidden":`true`,children:[(0,Z.jsx)(`div`,{className:`skel-bar`}),(0,Z.jsx)(`div`,{className:`skel-bar`}),(0,Z.jsx)(`div`,{className:`skel-bar`})]})]})}function Oi({open:e,title:t,children:n,confirmLabel:r,onConfirm:i,onClose:o}){let s=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let t=s.current;t&&(e&&!t.open&&(typeof t.showModal==`function`?t.showModal():t.setAttribute(`open`,``)),!e&&t.open&&t.close())},[e]),(0,Z.jsxs)(`dialog`,{ref:s,className:`confirm`,onCancel:o,onClose:o,children:[(0,Z.jsx)(`h3`,{className:`confirm-title`,children:t}),(0,Z.jsx)(`div`,{className:`confirm-body`,children:n}),(0,Z.jsxs)(`div`,{className:`confirm-actions`,children:[(0,Z.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:o,children:`Cancel`}),(0,Z.jsx)(`button`,{type:`button`,className:`btn`,onClick:i,autoFocus:!0,children:r||`Confirm`})]})]})}var ki={neutral:`Loaded & ready`,imperial:`The Codex in force`,military:`The unit stands ready`,cyberpunk:`Jacked in`,wizard:`Wards in place`,pirate:`The crew stands ready`,gamer:`Game loaded`,sports:`The squad takes the field`,biker:`The crew rolls out`,commentator:`Lights out, away we go`,verstappen:`Setup's in`,joker:`Mic check`,mean:`Rules are up`,marvin:`Online. Reluctantly.`},Ai=e=>e.deployed?ki[e.theme]||`Loaded & ready`:`Not deployed`;function ji({value:e,size:t=232}){let n=Yn(e,1100)??0,r=t/2-14,i=2*Math.PI*r,a=i*(1-n);return(0,Z.jsxs)(`div`,{className:`ring-wrap`,style:{width:t,height:t},children:[(0,Z.jsxs)(`svg`,{viewBox:`0 0 ${t} ${t}`,children:[(0,Z.jsx)(`circle`,{cx:t/2,cy:t/2,r,fill:`none`,stroke:`var(--surface-3)`,strokeWidth:`10`}),(0,Z.jsx)(`circle`,{cx:t/2,cy:t/2,r,fill:`none`,stroke:`var(--accent)`,strokeWidth:`10`,strokeLinecap:`round`,strokeDasharray:i,strokeDashoffset:a}),Array.from({length:48}).map((e,i)=>{let a=i/48*2*Math.PI,o=r-18,s=r-24,c=t/2+Math.cos(a)*o,l=t/2+Math.sin(a)*o,u=t/2+Math.cos(a)*s,d=t/2+Math.sin(a)*s;return(0,Z.jsx)(`line`,{x1:c,y1:l,x2:u,y2:d,stroke:`var(--line-2)`,strokeWidth:`1`,opacity:i/48<n?.9:.25},i)})]}),(0,Z.jsxs)(`div`,{className:`ring-center`,children:[(0,Z.jsxs)(`div`,{className:`pct`,children:[Math.round(n*100),(0,Z.jsx)(`span`,{style:{fontSize:20,color:`var(--text-3)`},children:`%`})]}),(0,Z.jsx)(`div`,{className:`lbl`,children:`germination`})]})]})}function Mi({overview:e}){let t=Yr(e.diff),n=e.counts||{};return(0,Z.jsxs)(`div`,{className:`card kpiband rise mb-16`,children:[[{key:`agents`,label:`Agents`,hash:`#/agents`},{key:`skills`,label:`Skills`,hash:`#/skills`},{key:`laws`,label:`Invariants`,hash:`#/laws`}].map(e=>{let t=n[e.key];return(0,Z.jsxs)(`a`,{className:`kseg`,href:e.hash,title:`Open ${e.label}`,children:[(0,Z.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:t==null?`—`:(0,Z.jsx)(Xn,{value:t})}),(0,Z.jsx)(`span`,{className:`kseg-l`,children:e.label})]},e.key)}),(0,Z.jsx)(`div`,{className:`kseg-spacer`}),(0,Z.jsxs)(`button`,{className:`kseg`+(t>0?` hot`:``),onClick:()=>nr(`#/diff`),title:`Open changes`,children:[(0,Z.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:(0,Z.jsx)(Xn,{value:t})}),(0,Z.jsx)(`span`,{className:`kseg-l`,children:`Local edits`}),t>0&&(0,Z.jsx)(`span`,{className:`delta up`,children:`▲`})]})]})}function Ni({overview:e}){return(0,Z.jsx)(`div`,{className:`genome`,children:dr.map((t,n)=>{let r=ur[t],i=e.counts?.[t];return(0,Z.jsxs)(`div`,{className:`card gcell rise`,style:{"--i":n},onClick:()=>nr(`#/section/`+t),children:[(0,Z.jsxs)(`div`,{className:`gtop`,children:[(0,Z.jsx)(`span`,{className:`gname`,children:r.label}),(0,Z.jsx)(Q,{name:r.icon,className:`gicon`})]}),(0,Z.jsx)(`div`,{className:`gcount`+(i===0?` zero`:``),children:i==null?`—`:(0,Z.jsx)(Xn,{value:i})}),(0,Z.jsx)(`div`,{className:`gdesc`,children:r.desc})]},t)})})}function Pi({jobs:e}){if(!e||e.length===0)return(0,Z.jsx)(`div`,{className:`feed`,children:(0,Z.jsxs)(`div`,{className:`empty`,children:[(0,Z.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})});let t={done:`ok`,running:`acc`,failed:`bad`},n=[...e].sort((e,t)=>t.started-e.started).slice(0,8);return(0,Z.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,Z.jsxs)(`div`,{className:`feed-row`,children:[(0,Z.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,Z.jsx)(`span`,{className:`feed-txt`,children:(0,Z.jsx)(`b`,{children:e.action})}),(0,Z.jsxs)(`span`,{className:`feed-when`,children:[Wr(e.started),` ago`]})]},e.id))})}function Fi({overview:e,sigil:t,setup:n,jobs:r,onAction:i}){let a=Ai(e),o=qr(e,n);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`card pad-lg rise mb-16`,children:(0,Z.jsxs)(`div`,{className:`hero`,children:[(0,Z.jsx)(ji,{value:o}),(0,Z.jsxs)(`div`,{className:`hero-facts`,children:[(0,Z.jsx)(`div`,{className:`ttl`,children:a}),t&&(0,Z.jsxs)(`div`,{className:`voice-readout`,children:[(0,Z.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,Z.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,Z.jsxs)(`p`,{className:`sub`,children:[`One source rendered into `,(0,Z.jsx)(`code`,{children:e.target}),`. Every repo on this machine inherits it.`]}),(0,Z.jsxs)(`div`,{className:`hero-chips`,children:[(0,Z.jsxs)(`span`,{className:`chip`,children:[(0,Z.jsx)(`span`,{className:`ck`,children:`voice`}),(0,Z.jsx)(`span`,{className:`cv`,style:{textTransform:`capitalize`},children:e.theme})]}),(0,Z.jsxs)(`span`,{className:`chip`,children:[(0,Z.jsx)(`span`,{className:`ck`,children:`mode`}),(0,Z.jsx)(`span`,{className:`cv`,children:e.emit})]}),(0,Z.jsxs)(`span`,{className:`chip`,children:[(0,Z.jsx)(`span`,{className:`ck`,children:`footprint`}),(0,Z.jsx)(`span`,{className:`cv`,children:e.footprint})]}),(0,Z.jsxs)(`span`,{className:`chip`,children:[(0,Z.jsx)(`span`,{className:`ck`,children:`built`}),(0,Z.jsx)(`span`,{className:`cv`,children:e.build_time||`unknown`})]}),(0,Z.jsxs)(`span`,{className:`chip`,children:[(0,Z.jsx)(`span`,{className:`ck`,children:`fp`}),(0,Z.jsx)(`span`,{className:`cv`,children:n?.installed_fp||`—`})]})]}),(0,Z.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,Z.jsxs)(`button`,{className:`btn`,onClick:()=>i(`update`),children:[(0,Z.jsx)(Q,{name:`refresh`}),`Update`]}),(0,Z.jsxs)(`button`,{className:`btn ghost`,onClick:()=>i(`build-all`),children:[(0,Z.jsx)(Q,{name:`build`}),`Rebuild`]}),(0,Z.jsxs)(`button`,{className:`btn ghost`,onClick:()=>i(`doctor`),children:[(0,Z.jsx)(Q,{name:`doctor`}),`Run doctor`]})]})]})]})}),(0,Z.jsx)(Mi,{overview:e}),(0,Z.jsxs)(`div`,{className:`grid split-status`,children:[(0,Z.jsxs)(`div`,{className:`card pad-lg`,children:[(0,Z.jsxs)(`div`,{className:`card-head`,children:[(0,Z.jsx)(`h3`,{children:`Capability genome`}),(0,Z.jsx)(`div`,{className:`right`,children:(0,Z.jsxs)(`span`,{className:`tick`,children:[dr.length,` sections`]})})]}),(0,Z.jsx)(Ni,{overview:e})]}),(0,Z.jsxs)(`div`,{className:`card pad-lg`,children:[(0,Z.jsxs)(`div`,{className:`card-head`,children:[(0,Z.jsx)(`h3`,{children:`Recent activity`}),(0,Z.jsx)(`div`,{className:`right`,children:(0,Z.jsxs)(`span`,{className:`badge acc`,children:[(0,Z.jsx)(`span`,{className:`dot`}),`live`]})})]}),(0,Z.jsx)(Pi,{jobs:r})]})]})]})}function Ii({k:e,overview:t,max:n}){let r=ur[e],i=t.counts?.[e]??0;return(0,Z.jsxs)(`div`,{className:`strand`,onClick:()=>nr(`#/section/`+e),children:[(0,Z.jsxs)(`span`,{className:`strand-name`,children:[(0,Z.jsx)(`span`,{className:`strand-dot`}),(0,Z.jsx)(`a`,{href:`#/section/`+e,className:`strand-link`,onClick:e=>e.stopPropagation(),children:r.label})]}),(0,Z.jsx)(`div`,{className:`hbar`,children:(0,Z.jsx)(`i`,{style:{width:`${i/n*100}%`}})}),(0,Z.jsx)(`span`,{className:`strand-val`,children:i})]})}function Li({overview:e,sigil:t,setup:n,jobs:r}){let i=Jr(e.counts),a=n?.version_verdict||``,o=a.includes(`up to date`),s=Yr(e.diff),c=[[`Source`,`src/, the canonical genetic material`,n?.source_fp||`—`,!0],[`Render`,`geneseed build → ${e.emit}`,e.theme+` voice`,!0],[`Deployed`,e.target,`inherited by every repo`,!1]];return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`mb-16`,children:(0,Z.jsxs)(`div`,{className:`card pad-lg rise`,style:{position:`relative`,overflow:`hidden`},children:[(0,Z.jsx)(`h2`,{className:`h`,style:{fontSize:22,margin:`0 0 18px`},children:`Gene-seed lineage`}),(0,Z.jsxs)(`div`,{className:`lineage-track`,children:[(0,Z.jsx)(`div`,{className:`spine`}),c.map(([e,t,n,r],i)=>(0,Z.jsxs)(`div`,{className:`lineage-step`,children:[(0,Z.jsx)(`span`,{className:`node ${r?`on`:``}`}),(0,Z.jsx)(`div`,{className:`lt`,children:e}),(0,Z.jsx)(`div`,{className:`ld`,children:t}),(0,Z.jsx)(`div`,{className:`ltag`,children:n})]},i))]}),(0,Z.jsx)(`hr`,{className:`hr`}),t&&(0,Z.jsxs)(`div`,{className:`voice-readout`,style:{marginBottom:14},children:[(0,Z.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,Z.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,Z.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,Z.jsxs)(`span`,{className:`badge ${o?`ok`:`warn`}`,children:[(0,Z.jsx)(`span`,{className:`dot`}),`in sync · `,a]}),(0,Z.jsxs)(`span`,{className:`badge`,children:[(0,Z.jsx)(`span`,{className:`dot`}),s,` local edits`]})]})]})}),(0,Z.jsxs)(`div`,{className:`grid split-even`,children:[(0,Z.jsxs)(`div`,{className:`card pad-lg`,children:[(0,Z.jsxs)(`div`,{className:`card-head`,children:[(0,Z.jsx)(`h3`,{children:`Genome strand`}),(0,Z.jsx)(`div`,{className:`right`,children:(0,Z.jsx)(`span`,{className:`tick`,children:`by volume`})})]}),dr.map(t=>(0,Z.jsx)(Ii,{k:t,overview:e,max:i},t))]}),(0,Z.jsxs)(`div`,{className:`card pad-lg`,children:[(0,Z.jsx)(`div`,{className:`card-head`,children:(0,Z.jsx)(`h3`,{children:`Recent activity`})}),(0,Z.jsx)(Pi,{jobs:r})]})]})]})}function Ri({overview:e,setup:t,jobs:n}){let r=dr.reduce((t,n)=>t+(e.counts?.[n]??0),0),i=Jr(e.counts),a=e.doctor?.ok,o=e.doctor?.problems?.length??0,s=Yr(e.diff);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`card pad-md rise mb-16`,children:(0,Z.jsx)(`div`,{className:`row wrap between gap-16`,children:(0,Z.jsxs)(`div`,{className:`row`,style:{gap:20,flexWrap:`wrap`},children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`tick`,children:`status`}),(0,Z.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:(0,Z.jsxs)(`span`,{className:`badge ${e.deployed?`ok`:`warn`}`,children:[(0,Z.jsx)(`span`,{className:`dot`}),e.deployed?`deployed`:`not deployed`]})})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`tick`,children:`voice`}),(0,Z.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6,textTransform:`capitalize`},children:e.theme})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`tick`,children:`mode`}),(0,Z.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6},children:e.emit})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`tick`,children:`fingerprint`}),(0,Z.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6,color:`var(--accent)`},children:t?.installed_fp||`—`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`tick`,children:`doctor`}),(0,Z.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:a?(0,Z.jsxs)(`span`,{className:`badge ok`,children:[(0,Z.jsx)(`span`,{className:`dot`}),`clean`]}):(0,Z.jsxs)(`span`,{className:`badge warn`,children:[(0,Z.jsx)(`span`,{className:`dot`}),o,` issue`,o===1?``:`s`]})})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`tick`,children:`edits`}),(0,Z.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6},children:s})]})]})})}),(0,Z.jsxs)(`div`,{className:`grid split-operator`,children:[(0,Z.jsxs)(`div`,{className:`card rise`,style:{"--i":1},children:[(0,Z.jsxs)(`div`,{className:`card-head pad-lg`,style:{padding:`18px 20px 0`,marginBottom:14},children:[(0,Z.jsx)(`h3`,{children:`Sections`}),(0,Z.jsx)(`div`,{className:`right`,children:(0,Z.jsxs)(`span`,{className:`tick`,children:[r,` entries total`]})})]}),(0,Z.jsxs)(`table`,{className:`tbl`,children:[(0,Z.jsx)(`thead`,{children:(0,Z.jsxs)(`tr`,{children:[(0,Z.jsx)(`th`,{children:`Section`}),(0,Z.jsx)(`th`,{children:`Detail`}),(0,Z.jsx)(`th`,{style:{width:130},children:`Share`}),(0,Z.jsx)(`th`,{className:`num`,children:`Count`})]})}),(0,Z.jsx)(`tbody`,{children:dr.map(t=>{let n=ur[t],r=e.counts?.[t]??0;return(0,Z.jsxs)(`tr`,{className:`clickable`,onClick:()=>nr(`#/section/`+t),children:[(0,Z.jsx)(`td`,{className:`name`,children:(0,Z.jsx)(`a`,{href:`#/section/`+t,onClick:e=>e.stopPropagation(),children:n.label})}),(0,Z.jsx)(`td`,{className:`muted`,children:n.desc}),(0,Z.jsx)(`td`,{children:(0,Z.jsx)(`div`,{className:`hbar`,children:(0,Z.jsx)(`i`,{style:{width:`${r/i*100}%`}})})}),(0,Z.jsx)(`td`,{className:`num`,children:r})]},t)})})]})]}),(0,Z.jsxs)(`div`,{className:`card pad-lg rise`,style:{"--i":2},children:[(0,Z.jsx)(`div`,{className:`card-head`,children:(0,Z.jsx)(`h3`,{children:`Run log`})}),(0,Z.jsx)(Pi,{jobs:n})]})]})]})}function zi({error:e,style:t}){return e?(0,Z.jsx)(`p`,{className:`badge bad`,style:t,children:e}):null}function Bi({onAction:e}){let{data:t,error:n}=zr(()=>N.themes(),[]),[r,i]=(0,a.useState)(``),[o,s]=(0,a.useState)(``);if(n)return(0,Z.jsx)(zi,{error:n});if(!t)return(0,Z.jsx)(Di,{});let c=r||t.current?.theme||`neutral`,l=t.emits?.some(e=>e.name===`opencode-global`),u=o||(l?`opencode-global`:t.current?.emit||t.emits?.[0]?.name||``),d=i,f=s;return(0,Z.jsxs)(`div`,{className:`narrow-lg`,children:[(0,Z.jsx)(`div`,{className:`head-row mb-18`,children:(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h1`,{className:`h`,children:`Deploy your harness`}),(0,Z.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,Z.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,Z.jsx)(`div`,{className:`card-head`,children:(0,Z.jsx)(`h3`,{children:`1 · Choose a voice`})}),(0,Z.jsx)(`div`,{className:`row wrap gap-10`,children:t.themes.map(e=>(0,Z.jsxs)(`button`,{className:`btn ${e.name===c?`soft`:`ghost`}`,onClick:()=>d(e.name),title:e.blurb||e.tagline||e.name,children:[(0,Z.jsx)(`span`,{className:`po`,style:{width:10,height:10,borderRadius:`50%`,background:ar(e.accent),boxShadow:`0 0 8px ${ar(e.accent)}`}}),(0,Z.jsx)(`span`,{style:{textTransform:`capitalize`},children:e.name})]},e.name))})]}),(0,Z.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,Z.jsx)(`div`,{className:`card-head`,children:(0,Z.jsx)(`h3`,{children:`2 · Install mode`})}),(0,Z.jsxs)(`p`,{className:`sub mb-16`,children:[(0,Z.jsx)(`code`,{children:`opencode-global`}),` deploys once to your global config so every repo on this machine inherits the harness (recommended). Other modes render into a chosen directory.`]}),(0,Z.jsxs)(`label`,{className:`stack`,style:{gap:6,maxWidth:360},children:[(0,Z.jsx)(`span`,{className:`tick`,children:`Mode`}),(0,Z.jsx)(`select`,{className:`sel`,value:u,onChange:e=>f(e.target.value),children:t.emits.map(e=>(0,Z.jsxs)(`option`,{value:e.name,children:[e.name,e.desc?` · ${e.desc}`:``]},e.name))})]})]}),(0,Z.jsxs)(`button`,{className:`btn btn-grid`,disabled:!c||!u,onClick:()=>e(`build`,{theme:c,emit:u}),children:[(0,Z.jsx)(Q,{name:`build`}),`Deploy harness`]})]})}function Vi({children:e,...t}){let n=Zn(`button.on`);return(0,Z.jsxs)(`div`,{className:`seg`,role:`group`,ref:n,...t,children:[(0,Z.jsx)(`span`,{className:`glide`,"aria-hidden":`true`}),e]})}var Hi=`modulepreload`,Ui=function(e){return`/`+e},Wi={},$=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),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?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Ui(t,n),t=s(t),t in Wi)return;Wi[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Hi,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).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)})},Gi=(0,a.lazy)(()=>$(()=>import(`./GreenhouseView-D072lBiD.js`),__vite__mapDeps([0,1,2,3,4]))),Ki=(0,a.lazy)(()=>$(()=>import(`./OperatorHudView-CwNIUVX8.js`),__vite__mapDeps([5,1,2,4]))),qi=(0,a.lazy)(()=>$(()=>import(`./JournalView-DWFqZ0Iw.js`),__vite__mapDeps([6,1,2,3,7])));function Ji({overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:o,onAction:s,flavour:c=`a`,layout:l=`auto`,dataRev:u}){let d=jr(c,l),[f,p]=(0,a.useState)(`status`),[m,h]=(0,a.useState)(null),[g,_]=(0,a.useState)(null),v=e&&r.find(t=>t.name===e.theme)?.sigil||``;return(0,a.useEffect)(()=>{let e=!0;return(d===`greenhouse`||d===`operator`)&&N.doctor().then(t=>e&&h(t)).catch(()=>{}),d===`journal`&&N.recent().then(t=>e&&_(t)).catch(()=>{}),()=>{e=!1}},[d,u]),e?e.deployed?f===`status`&&d===`journal`?(0,Z.jsx)(a.Suspense,{fallback:(0,Z.jsx)(Di,{}),children:(0,Z.jsx)(qi,{overview:e,recent:g,onAction:s,onDirection:p})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`head-row`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h1`,{className:`h`,children:`Harness console`}),(0,Z.jsx)(`p`,{className:`sub`,children:`A live readout of the harness this machine carries. Its voice, its capabilities, its drift from source.`})]}),(0,Z.jsx)(Vi,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`operator`,`Operator`]].map(([e,t])=>(0,Z.jsx)(`button`,{className:f===e?`on`:``,onClick:()=>p(e),"aria-pressed":f===e,children:t},e))})]}),(0,Z.jsxs)(`div`,{className:`view-in`,children:[f===`status`&&d===`cultivar`&&(0,Z.jsx)(Fi,{overview:e,sigil:v,setup:i,jobs:o,onAction:s}),f===`status`&&d===`greenhouse`&&(0,Z.jsx)(a.Suspense,{fallback:(0,Z.jsx)(Di,{}),children:(0,Z.jsx)(Gi,{overview:e,sigil:v,jobs:o,doctor:m,onAction:s})}),f===`status`&&d===`operator`&&(0,Z.jsx)(a.Suspense,{fallback:(0,Z.jsx)(Di,{}),children:(0,Z.jsx)(Ki,{overview:e,jobs:o,doctor:m,onAction:s})}),f===`lineage`&&(0,Z.jsx)(Li,{overview:e,sigil:v,setup:i,jobs:o}),f===`operator`&&(0,Z.jsx)(Ri,{overview:e,setup:i,jobs:o})]},f)]}):(0,Z.jsx)(Bi,{onAction:s}):t?(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(zi,{error:`Could not load the harness overview: ${t}`}),(0,Z.jsx)(`button`,{className:`btn`,onClick:n,children:`Retry`})]}):(0,Z.jsx)(Di,{})}var Yi=(0,a.lazy)(()=>$(()=>import(`./Activity-Flgf4kHy.js`),__vite__mapDeps([8,1,2,9]))),Xi=(0,a.lazy)(()=>$(()=>import(`./ActivityDetail-DIpr85nh.js`),__vite__mapDeps([10,1,2,9]))),Zi=(0,a.lazy)(()=>$(()=>import(`./Library-CDOv4emM.js`),__vite__mapDeps([11,1,2,12,13,14]))),Qi=(0,a.lazy)(()=>$(()=>import(`./Laws-BN6g3HU7.js`),__vite__mapDeps([15,1,2,7,16,13]))),$i=(0,a.lazy)(()=>$(()=>import(`./Rules-DFXsUCB7.js`),__vite__mapDeps([17,1,2]))),ea=(0,a.lazy)(()=>$(()=>import(`./Profile-CpP9BTne.js`),__vite__mapDeps([18,1,2,12]))),ta=(0,a.lazy)(()=>$(()=>import(`./Skills-Cu6kBgfF.js`),__vite__mapDeps([19,1,2,7,12,16,13,14]))),na=(0,a.lazy)(()=>$(()=>import(`./Diff-Deisdha8.js`),__vite__mapDeps([20,1,2]))),ra=(0,a.lazy)(()=>$(()=>import(`./Doctor-F74lJ69P.js`),__vite__mapDeps([21,1,2]))),ia=(0,a.lazy)(()=>$(()=>import(`./Settings-BqZVUtJ5.js`),__vite__mapDeps([22,1,2]))),aa=(0,a.lazy)(()=>$(()=>import(`./Harness-DNRP2Va7.js`),__vite__mapDeps([23,1,2]))),oa=(0,a.lazy)(()=>$(()=>import(`./Docs-DGUdY4l4.js`),__vite__mapDeps([24,1,2,12])));function sa(){let e=tr(),t=e.view===`section`,n=e.view===`item`,r=e.view===`laws`||t&&e.section===`laws`||n&&e.type===`law`,i=e.view===`skills`||t&&e.section===`skills`||n&&e.type===`skill`,s=e.view===`library`||e.view===`agents`||(t||n)&&!r&&!i,c=e.view===`agents`?`agents`:t?e.section:n?mr[e.type]||e.type:void 0,l=n?e.name:void 0,[u,d]=(0,a.useState)(``),[f,p]=(0,a.useState)(null),[m,h]=(0,a.useState)(!1),[g,_]=(0,a.useState)(!1),[v,y]=_r(),[b,x]=Sr(),S=e=>{if(!document.startViewTransition||!qn())return x(e);document.startViewTransition(()=>(0,o.flushSync)(()=>x(e)))},[C,ee]=Er(),[te,w]=Mr(),[ne,T]=(0,a.useState)(()=>{try{return!window.sessionStorage.getItem(`gs-booted`)}catch{return!0}}),[E,D]=(0,a.useState)(!1),O=(0,a.useRef)(null),k=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(!E)return;let e=e=>{e.key===`Escape`&&D(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[E]),(0,a.useEffect)(()=>{if(!E)return;let e=k.current,t=document.activeElement;return e&&(e.inert=!0),document.getElementById(`rail-nav`)?.focus(),()=>{e&&(e.inert=!1),t instanceof HTMLElement&&t.focus()}},[E]);let A=e=>p({kind:e?.body?.kind||`err`,msg:e?.body?.message||e.message}),{overview:j,error:re,themes:ie,reload:ae}=Nr(A),[M,oe]=(0,a.useState)(0),se=()=>{ae(),oe(e=>e+1)},[ce,P]=(0,a.useState)(null),{runs:le,activeId:F,consoleOpen:I,setConsoleOpen:L,runAction:R,cancelJob:z,clearRuns:ue}=Lr({onFinish:e=>{se(),P({status:e,at:Date.now()})},onError:A}),{data:de}=zr(()=>N.setup().catch(()=>null),[M],`setup`),fe=le[le.length-1],pe=fe?fe.status===`running`?`${fe.action} running`:`${fe.action} ${fe.status}`:``;(0,a.useEffect)(()=>{let e=O.current;e&&(C===`curated`&&lr(e,b,v)||j?.accent&&sr(e,j.accent,v))},[j,v,C,b]);let[B,V]=(0,a.useState)(!1);return g?(0,Z.jsxs)(`div`,{className:`app fl-${b} ${v===`light`?`light`:``}`,ref:O,children:[(0,Z.jsx)(`div`,{className:`atmos`,"aria-hidden":`true`}),(0,Z.jsx)(`div`,{className:`page`,style:{display:`grid`,placeItems:`center`},children:(0,Z.jsxs)(`p`,{className:`sub`,style:{textAlign:`center`,maxWidth:480},children:[`Server stopped. You can close this tab and reopen any time with`,` `,(0,Z.jsx)(`code`,{children:`geneseed web`}),`.`]})})]}):(0,Z.jsxs)(`div`,{className:`app fl-${b} ${v===`light`?`light`:``}${E?` nav-open`:``}`,ref:O,children:[(0,Z.jsx)(`div`,{className:`atmos`,"aria-hidden":`true`}),(0,Z.jsx)(`a`,{className:`skip-link`,href:`#main`,children:`Skip to content`}),(0,Z.jsx)(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:pe}),E&&(0,Z.jsx)(`button`,{type:`button`,className:`nav-scrim`,"aria-label":`Close navigation`,onClick:()=>D(!1)}),(0,Z.jsx)(ri,{route:e,overview:j,setup:de,onOpenVoice:()=>h(e=>!e),onNavigate:()=>D(!1),finish:ce}),m&&(0,Z.jsx)(yi,{themes:ie,current:j?.theme,onPick:e=>{h(!1),R(`build`,{theme:e,emit:j?.emit})},onClose:()=>h(!1)}),(0,Z.jsxs)(`div`,{className:`col`,ref:k,children:[(0,Z.jsx)(vi,{route:e,navOpen:E,onToggleNav:()=>D(e=>!e),target:j?.target,version:j?.version,query:u,onQuery:d,mode:v,onToggleMode:y,onShutdown:()=>V(!0),dataRev:M,onSwitch:se}),(0,Z.jsx)(`main`,{className:`page`,id:`main`,tabIndex:-1,children:(0,Z.jsx)(`div`,{className:e.view===`harness`?`pad pad-wide`:`pad`,children:(0,Z.jsxs)(a.Suspense,{fallback:(0,Z.jsx)(Di,{}),children:[e.view===`dashboard`&&(0,Z.jsx)(Ji,{overview:j,overviewError:re,onRetry:ae,themes:ie,setup:de,runs:le,onAction:R,flavour:b,layout:te,dataRev:M}),e.view===`activity`&&(0,Z.jsx)(Yi,{}),e.view===`activity-detail`&&(0,Z.jsx)(Xi,{sid:e.sid},e.sid),r&&(0,Z.jsx)(Qi,{selected:l,overview:j,onAction:R,dataRev:M}),i&&(0,Z.jsx)(ta,{selected:l,dataRev:M}),s&&(0,Z.jsx)(Zi,{overview:j,section:c,selected:l,dataRev:M}),e.view===`rules`&&(0,Z.jsx)($i,{}),e.view===`profile`&&(0,Z.jsx)(ea,{}),e.view===`diff`&&(0,Z.jsx)(na,{onMutated:ae,dataRev:M}),e.view===`doctor`&&(0,Z.jsx)(ra,{}),e.view===`settings`&&(0,Z.jsx)(ia,{overview:j,onAction:R,flavour:b,onFlavour:S,accentMode:C,onAccentMode:ee,layout:te,onLayout:w}),e.view===`harness`&&(0,Z.jsx)(aa,{onAction:R,themes:ie,currentTheme:j?.theme,overview:j,dataRev:M,onMutated:se}),e.view===`docs`&&(0,Z.jsx)(oa,{page:e.page,query:u,onAction:R,overview:j})]})})}),(0,Z.jsx)(Si,{runs:le,open:I,busy:!!F,finish:ce,onToggle:()=>L(e=>!e),onClear:ue,onCancel:z})]}),(0,Z.jsxs)(Oi,{open:B,title:`Stop the server?`,confirmLabel:`Stop server`,onConfirm:async()=>{V(!1);try{await N.shutdown()}catch{}_(!0)},onClose:()=>V(!1),children:[`The console goes offline until you start it again with `,(0,Z.jsx)(`code`,{children:`geneseed web`}),`.`]}),f&&(0,Z.jsx)(xi,{toast:f,onClose:()=>p(null)}),ne&&(0,Z.jsx)(Ei,{ready:!!j||!!re,onDone:()=>{try{window.sessionStorage.setItem(`gs-booted`,`1`)}catch{}T(!1)}})]})}(0,s.createRoot)(document.getElementById(`root`)).render((0,Z.jsx)(sa,{})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`).catch(()=>{})});export{z as $,Bn as A,ht as B,nr as C,Qn as D,Jn as E,cn as F,Be as G,K as H,nn as I,pt as J,He as K,Bt as L,Rn as M,Tn as N,Kn as O,un as P,he as Q,Lt as R,dr as S,qn as T,Ue as U,dt as V,Ve as W,tt as X,ft as Y,H as Z,wr as _,ai as a,ur as b,Q as c,Xr as d,V as et,zr as f,Ar as g,Or as h,Di as i,Ln as j,Vn as k,Yr as l,Fr as m,zi as n,R as nt,si as o,Pr as p,U as q,Ai as r,N as rt,oi as s,Vi as t,B as tt,Wr as u,yr as v,Xn as w,pr as x,fr as y,q as z};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GreenhouseView-XxrAdriX.js","assets/rolldown-runtime-CbXtAM7H.js","assets/react-DbkvxWG5.js","assets/drawable-BTHjTzF7.js","assets/jobBuckets-Dbq8ZlWW.js","assets/OperatorHudView-BMRY1Tt4.js","assets/JournalView-BcuyeEaR.js","assets/lawCats-Btjp3Hk_.js","assets/Activity-CH-7cPIM.js","assets/activity-iWaWVtsR.js","assets/ActivityDetail-DZvz0xS5.js","assets/Library-CA9IHghn.js","assets/Markdown-BQAvN8xx.js","assets/FilterInput-BakJLvaV.js","assets/StatusBadge-Cg6j-NJL.js","assets/Laws-CWHrTKY4.js","assets/CatalogRow-DftXpZHY.js","assets/Rules-BEXvY4Tx.js","assets/Profile-wceET1JY.js","assets/Skills-DahlOJuI.js","assets/Diff-DvwdG0L9.js","assets/Doctor-OTmwmYZg.js","assets/Settings-DS2zF0Ez.js","assets/Harness-C_LYNk5c.js","assets/Docs-DrJNDPwI.js"])))=>i.map(i=>d[i]);
2
+ import{n as e}from"./rolldown-runtime-CbXtAM7H.js";import{i as t,n,r,t as i}from"./react-DbkvxWG5.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 a=e(t(),1),o=r(),s=n(),c=typeof window<`u`?window.__GENESEED_TOKEN__:``;async function l(e){let t=await e.json().catch(()=>({})),n=e.status===403&&(t.error||``).startsWith(`forbidden`)?`the web server restarted since this page loaded — reload the page, then re-apply your edit`:t.error||t.message||e.statusText,r=Error(n);return r.status=e.status,r.body=t,r}async function u(e){let t=await fetch(e);if(!t.ok)throw await l(t);return t.json()}async function d(e,t={}){let n=await fetch(e,{method:`POST`,headers:{"X-Geneseed-Token":c||``,"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok)throw await l(n);return n.json()}var f=()=>u(`/api/overview`),p=()=>u(`/api/recent`),m=()=>u(`/api/activity`),h=e=>u(`/api/activity/`+encodeURIComponent(e)),g=e=>d(`/api/activity`,{enabled:e}),_=()=>u(`/api/setup`),v=()=>u(`/api/doctor`),y=()=>u(`/api/themes`),b=e=>u(`/api/catalog/${e}`),x=(e,t)=>u(`/api/item/${e}/${encodeURIComponent(t)}`),S=e=>d(`/api/memory/delete`,{name:e}),C=()=>u(`/api/diff`),ee=e=>d(`/api/actions/restore`,{files:e}),te=409,w=e=>u(`/api/jobs/${e}`),ne=()=>u(`/api/jobs`),T=e=>d(`/api/jobs/${e}/cancel`);async function E(e,t){try{return await d(`/api/actions/${e}`,t||{})}catch(e){throw e.status===te?Error(`An action is already running.`,{cause:e}):e}}var D=()=>u(`/api/mcp`),O=(e,t,n)=>d(`/api/mcp`,{path:e,name:t,enabled:n}),k=e=>d(`/api/reveal`,{path:e}),A=()=>u(`/api/installs`),j=(e,t,n)=>d(`/api/install`,{host:e,path:t,action:n}),re=(e,t,n)=>d(`/api/install`,{host:e,path:t,action:`remove`,memory:n}),ie=(e,t)=>d(`/api/view`,{host:e,path:t}),ae=()=>d(`/api/pick-folder`,{}),M=()=>u(`/api/ping`),oe=()=>d(`/api/shutdown`),se=()=>d(`/api/restart`),ce=e=>e?`?harness=${encodeURIComponent(e)}`:``,N={overview:f,recent:p,activity:m,activityDetail:h,activityToggle:g,setup:_,doctor:v,themes:y,catalog:b,item:x,memoryDelete:S,diff:C,restore:ee,job:w,jobs:ne,cancelJob:T,action:E,mcp:D,mcpToggle:O,mcpReveal:k,installs:A,installToggle:j,installRemove:re,selectView:ie,pickFolder:ae,ping:M,shutdown:oe,restart:se,docs:e=>u(`/api/docs${ce(e)}`),docsPage:(e,t)=>u(`/api/docs/page/${encodeURIComponent(e)}${ce(t)}`),rules:()=>u(`/api/rules`),rulesMutate:e=>d(`/api/rules`,e),rulesPromote:e=>d(`/api/rules/promote`,e),profile:()=>u(`/api/profile`),profileSave:e=>d(`/api/profile`,e),excludes:()=>u(`/api/excludes`),excludeMutate:(e,t)=>d(`/api/excludes`,{action:e,path:t})},P=typeof window<`u`,le=P?window:null,F=P?document:null,I={OBJECT:0,ATTRIBUTE:1,CSS:2,TRANSFORM:3,CSS_VAR:4},L={NUMBER:0,UNIT:1,COLOR:2,COMPLEX:3},R={NONE:0,AUTO:1,FORCE:2},z={replace:0,none:1,blend:2},ue=Symbol(),de=Symbol(),fe=Symbol(),pe=Symbol(),B=Symbol(),V=1e-11,me=0xe8d4a51000,he=1e3,ge=[],_e=(()=>{let e=new Map;return e.set(`x`,`translateX`),e.set(`y`,`translateY`),e.set(`z`,`translateZ`),e})(),ve=[`perspective`,`translateX`,`translateY`,`translateZ`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`scale`,`scaleX`,`scaleY`,`scaleZ`,`skew`,`skewX`,`skewY`],ye=ve.reduce((e,t)=>({...e,[t]:t+`(`}),{}),be=()=>{},xe=e=>e,Se=/\)\s*[-.\d]/,Ce=/(^#([\da-f]{3}){1,2}$)|(^#([\da-f]{4}){1,2}$)/i,we=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,Te=/rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,Ee=/hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)/i,De=/hsla\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)\s*\)/i,Oe=/[-+]?\d*\.?\d+(?:e[-+]?\d)?/gi,ke=/^([-+]?\d*\.?\d+(?:e[-+]?\d+)?)([a-z]+|%)$/i,Ae=/([a-z])([A-Z])/g,je=/(\*=|\+=|-=)/,Me=/var\(\s*(--[\w-]+)(?:\s*,\s*([^)]+))?\s*\)/,Ne={id:null,keyframes:null,playbackEase:null,playbackRate:1,frameRate:240,loop:0,reversed:!1,alternate:!1,autoplay:!0,persist:!1,duration:he,delay:0,loopDelay:0,ease:`out(2)`,composition:z.replace,modifier:xe,onBegin:be,onBeforeUpdate:be,onUpdate:be,onLoop:be,onPause:be,onComplete:be,onRender:be},Pe={current:null,root:F},H={defaults:Ne,precision:4,timeScale:1,tickThreshold:200,editor:null},Fe={version:`4.5.0`,engine:null};P&&(le.AnimeJS||=[],le.AnimeJS.push(Fe));var Ie=e=>e.replace(Ae,`$1-$2`).toLowerCase(),Le=(e,t)=>e.indexOf(t)===0,Re=Date.now,ze=Array.isArray,Be=e=>e&&e.constructor===Object,Ve=e=>typeof e==`number`&&!isNaN(e),He=e=>typeof e==`string`,Ue=e=>typeof e==`function`,U=e=>e===void 0,We=e=>U(e)||e===null,Ge=e=>P&&e instanceof SVGElement,Ke=e=>Ce.test(e),qe=e=>Le(e,`rgb`),Je=e=>Le(e,`hsl`),Ye=e=>Ke(e)||(qe(e)||Je(e))&&(e[e.length-1]===`)`||!Se.test(e)),Xe=e=>!H.defaults.hasOwnProperty(e),Ze=[`opacity`,`rotate`,`overflow`,`color`],Qe=(e,t)=>{if(Ze.includes(t))return!1;if(e.getAttribute(t)||t in e){if(t===`scale`){let t=e.parentNode;return t&&t.tagName===`filter`}return!0}},$e=e=>He(e)?parseFloat(e):e,et=Math.pow,tt=Math.sqrt,nt=Math.sin,rt=Math.cos,it=Math.abs,at=Math.floor,ot=Math.asin,st=Math.PI,ct=Math.round,lt=(e,t,n)=>e<t?t:e>n?n:e,W=(e,t)=>{if(t<0)return e;if(!t)return ct(e);let n=10**t;return ct(e*n)/n},ut=(e,t,n)=>n===1?t:n===0?e:e+(t-e)*n,dt=e=>e===1/0?me:e===-1/0?-me:e,ft=e=>e<=1e-11?V:dt(W(e,11)),G=e=>ze(e)?[...e]:e,pt=(e,t)=>{let n={...e};for(let r in t){let i=e[r];n[r]=U(i)?t[r]:i}return n},K=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._head,o=i;for(n&&(a=e._tail,o=r);a;){let e=a[o];t(a),a=e}},mt=(e,t,n=`_prev`,r=`_next`)=>{let i=t[n],a=t[r];i?i[r]=a:e._head=a,a?a[n]=i:e._tail=i,t[n]=null,t[r]=null},ht=(e,t,n,r=`_prev`,i=`_next`)=>{let a=e._tail;for(;a&&n&&n(a,t);)a=a[r];let o=a?a[i]:e._head;a?a[i]=t:e._head=t,o?o[r]=t:e._tail=t,t[r]=a,t[i]=o},gt=(e,t,n)=>{let r=e.style.transform;if(r){let i=e[pe],a=0,o=r.length,s;for(;a<o;){for(;a<o&&r.charCodeAt(a)===32;)a++;if(a>=o)break;let e=a;for(;a<o&&r.charCodeAt(a)!==40;)a++;if(a>=o)break;let t=r.substring(e,a),n=1,c=a+1,l=-1,u=-1;for(a++;a<o&&n>0;){let e=r.charCodeAt(a);e===40?n++:e===41?n--:e===44&&n===1&&(l===-1?l=a:u===-1&&(u=a)),a++}let d=a-1;t===`translate`||t===`translate3d`?(l===-1?i.translateX=r.substring(c,d).trim():(i.translateX=r.substring(c,l).trim(),u===-1?i.translateY=r.substring(l+1,d).trim():(i.translateY=r.substring(l+1,u).trim(),i.translateZ=r.substring(u+1,d).trim())),s=r.substring(c,d)):t===`scale`||t===`scale3d`?l===-1?i.scale=r.substring(c,d).trim():(i.scaleX=r.substring(c,l).trim(),u===-1?i.scaleY=r.substring(l+1,d).trim():(i.scaleY=r.substring(l+1,u).trim(),i.scaleZ=r.substring(u+1,d).trim())):i[t]=r.substring(c,d)}if(t===`translate3d`&&s)return n&&(n[t]=s),s;let c=i[t];if(!U(c))return n&&(n[t]=c),c}return t===`translate3d`?`0px, 0px, 0px`:t===`rotate3d`?`0, 0, 0, 0deg`:Le(t,`scale`)?`1`:Le(t,`rotate`)||Le(t,`skew`)?`0deg`:`0px`},_t=e=>{let t=``;for(let n=0,r=ve.length;n<r;n++){let r=ve[n],i=e[r];if(i!==void 0){if(r===`translateX`){let r=e.translateY;if(r!==void 0){let a=e.translateZ;a===void 0?(t+=`translate(${i},${r}) `,n+=1):(t+=`translate3d(${i},${r},${a}) `,n+=2);continue}}if(r===`scaleX`&&e.scale===void 0){let r=e.scaleY;if(r!==void 0){let a=e.scaleZ;a===void 0?(t+=`scale(${i},${r}) `,n+=1):(t+=`scale3d(${i},${r},${a}) `,n+=2);continue}}t+=`${ye[r]}${i}) `}r===`rotateZ`&&e.rotate3d!==void 0&&(t+=`rotate3d(${e.rotate3d}) `)}return e.matrix!==void 0&&(t+=`matrix(${e.matrix}) `),e.matrix3d!==void 0&&(t+=`matrix3d(${e.matrix3d}) `),t},vt=[];function yt(e,t){if(!e)return null;let n=vt.length;outer:for(let r=0;r<n;r++){let n=vt[r];if(n.detect&&!n.detect(e))continue;let i=n.targetAdapters;for(let n=0,r=i.length;n<r;n++){let r=i[n];if(r.detect(e)){let n=r.props[t];if(n&&(!n.gate||n.gate(e)))return n;break outer}}}for(let r=0;r<n;r++){let n=vt[r];if(n.detect&&!n.detect(e))continue;let i=n.propertyResolvers;for(let n=0,r=i.length;n<r;n++){let r=i[n](e,t);if(r)return r}}return null}var bt=e=>{let t=we.exec(e)||Te.exec(e),n=U(t[4])?1:+t[4];return[+t[1],+t[2],+t[3],n]},xt=e=>{let t=e.length,n=t===4||t===5;return[+(`0x`+e[1]+e[n?1:2]),+(`0x`+e[n?2:3]+e[n?2:4]),+(`0x`+e[n?3:5]+e[n?3:6]),t===5||t===9?+((`0x`+e[n?4:7]+e[n?4:8])/255).toFixed(3):1]},St=(e,t,n)=>(n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e),Ct=e=>{let t=Ee.exec(e)||De.exec(e),n=t[1]/360,r=t[2]/100,i=t[3]/100,a=U(t[4])?1:+t[4],o,s,c;if(r===0)o=s=c=i;else{let e=i<.5?i*(1+r):i+r-i*r,t=2*i-e;o=W(St(t,e,n+1/3)*255,0),s=W(St(t,e,n)*255,0),c=W(St(t,e,n-1/3)*255,0)}return[o,s,c,a]},wt=e=>qe(e)?bt(e):Ke(e)?xt(e):Je(e)?Ct(e):[0,0,0,1],q=(e,t)=>U(e)?t:e,Tt=(e,t)=>{let n=e.match(Me),r=t[de]?t:document.documentElement,i=getComputedStyle(r)?.getPropertyValue(n[1]);return(!i||i.trim()===``)&&n[2]&&(i=n[2].trim()),i||0},Et=(e,t,n,r,i,a)=>{if(Ue(e)){if(!i){let i=e(t,n,r,a);return isNaN(+i)?i||0:+i}let o=()=>{let i=e(t,n,r,a);return isNaN(+i)?i||0:+i};return i.func=o,o()}if(He(e)&&Le(e,`var(`)){if(!i)return Tt(e,t);let n=()=>Tt(e,t);return i.func=n,n()}return e},Dt=(e,t)=>e[de]?e[fe]&&Qe(e,t)?I.ATTRIBUTE:ve.includes(t)||_e.get(t)?I.TRANSFORM:Le(t,`--`)?I.CSS_VAR:t in e.style?I.CSS:t in e?I.OBJECT:I.ATTRIBUTE:I.OBJECT,Ot=(e,t,n)=>{let r=e.style[t];r&&n&&(n[t]=r);let i=r||getComputedStyle(e[B]||e).getPropertyValue(t);return i===`auto`?`0`:i},kt=(e,t,n,r)=>{let i=U(n)?Dt(e,t):n,a=yt(e,t);if(a){let n=a.get(e);return n&&r&&(r[t]=n),n??0}if(i===I.OBJECT){let n=e[t];return n&&r&&(r[t]=n),n||0}if(i===I.ATTRIBUTE){let n=e.getAttribute(t);return n&&r&&(r[t]=n),n}return i===I.TRANSFORM?gt(e,t,r):i===I.CSS_VAR?Ot(e,t,r).trimStart():Ot(e,t,r)},At=(e,t,n)=>n===`-`?e-t:n===`+`?e+t:e*t,jt=()=>({t:L.NUMBER,n:0,u:null,o:null,d:null,s:null}),Mt=(e,t)=>{if(t.t=L.NUMBER,t.n=0,t.u=null,t.o=null,t.d=null,t.s=null,!e)return t;let n=+e;if(!isNaN(n))return t.n=n,t;let r=e;r[1]===`=`&&(t.o=r[0],r=r.slice(2));let i=!r.includes(` `)&&ke.exec(r);if(i)return t.t=L.UNIT,t.n=+i[1],t.u=i[2],t;if(t.o)return t.n=+r,t;if(Ye(r))return t.t=L.COLOR,t.d=wt(r),t;{let e=r.match(Oe);return t.t=L.COMPLEX,t.d=e?e.map(Number):[],t.s=r.split(Oe)||[],t}},Nt=(e,t)=>(t.t=e._valueType,t.n=e._toNumber,t.u=e._unit,t.o=null,t.d=G(e._toNumbers),t.s=G(e._strings),t),Pt=jt(),Ft=(e,t,n)=>{let r=e._modifier,i=e._fromNumbers,a=e._toNumbers,o=e._strings,s=o[0];for(let c=0,l=a.length;c<l;c++){let l=r(W(ut(i[c],a[c],t),n)),u=o[c+1];s+=`${u?l+u:l}`,e._numbers[c]=l}return s},It=(e,t,n,r,i)=>{let a=e.parent,o=e.duration,s=e.completed,c=e.iterationDuration,l=e.iterationCount,u=e._currentIteration,d=e._loopDelay,f=e._reversed,p=e._alternate,m=e._hasChildren,h=e._delay,g=e._currentTime,_=h+c,v=t-h,y=lt(g,-h,o),b=lt(v,-h,o),x=v-g,S=b>0,C=b>=o,ee=o<=V,te=i===R.FORCE,w=0,ne=v,T=0;if(l>1){let t=c+(C?0:d),n=~~(b/t);e._currentIteration=lt(n,0,l),C&&e._currentIteration--,w=e._currentIteration%2,ne=b-n*t||0}let E=f^(p&&w),D=e._ease,O=C?E?0:o:E?c-ne:ne;D&&(O=c*D(O/c)||0);let k=(a?a.backwards:v<g)?!E:!!E;if(e._currentTime=v,e._iterationTime=O,e.backwards=k,S&&!e.began?(e.began=!0,!n&&(!a||!k&&a.began)&&e.onBegin(e)):v<=0&&(e.began=!1),!n&&!m&&S&&e._currentIteration!==u&&e.onLoop(e),te||i===R.AUTO&&(t>=(a&&h>0?0:h)&&t<=_||t<=h&&y>h||t>=_&&y!==o)||O>=_&&y!==o||O<=h&&y>0&&!C||t<=y&&y===o&&s||C&&!s&&ee){if(S&&(e.computeDeltaTime(y),n||e.onBeforeUpdate(e)),!m){let t=te||(k?x*-1:x)>=H.tickThreshold,i=W(e._offset+(a?a._offset:0)+h+O,12),o=e._head,s,c,l,u,d=0;for(;o;){let e=o._composition,n=o._currentTime,a=o._changeDuration,f=o._absoluteStartTime+o._changeDuration,p=o._nextRep,m=o._prevRep,h=e!==z.none,g=m?m._absoluteStartTime+m._changeDuration:0,_=m&&m.parent!==o.parent,v=!p||p._isOverridden?f:p.parent===o.parent?f+p._delay:p._absoluteStartTime<p._absoluteUpdateStartTime?p._absoluteStartTime:p._absoluteUpdateStartTime;if((t||(n!==a||i<=v||m&&!_&&(!p||p.parent!==o.parent))&&(n!==0||i>=o._absoluteStartTime||_&&!o._hasFromValue&&!m._isOverridden&&i>=g||p&&!p._isOverridden&&p.parent===o.parent&&p._currentTime!==0&&O<p._startTime))&&(!m||_||O>=o._startTime)&&(!h||!o._isOverridden&&(!o._isOverlapped||i<=f)&&(!p||p._isOverridden||i<=v)&&(!m||m._isOverridden||(_?i>=o._absoluteStartTime||!o._hasFromValue&&i>=g:i>=g+o._delay)))){let t=o._currentTime=lt(O-o._startTime,0,a),n=o._ease(t/o._updateDuration),i=o._modifier,f=o._valueType,p=o._tweenType,m=p===I.OBJECT,g=f===L.NUMBER,_=g&&m||n===0||n===1?-1:H.precision,v,y;if(g)v=y=i(W(ut(o._fromNumber,o._toNumber,n),_));else if(f===L.UNIT)y=i(W(ut(o._fromNumber,o._toNumber,n),_)),v=`${y}${o._unit}`;else if(f===L.COLOR){let e=o._numbers,t=o._fromNumbers,a=o._toNumbers,s=1-n,c=t[0],l=t[1],u=t[2],d=a[0],f=a[1],p=a[2];e[0]=i(Math.sqrt(c*c*s+d*d*n)),e[1]=i(Math.sqrt(l*l*s+f*f*n)),e[2]=i(Math.sqrt(u*u*s+p*p*n)),e[3]=i(ut(t[3],a[3],n)),(!o._setter||r)&&(v=`rgba(${W(e[0],0)},${W(e[1],0)},${W(e[2],0)},${e[3]})`)}else f===L.COMPLEX&&(v=Ft(o,n,_));if(h&&(o._number=y),!r&&e!==z.blend){let e=o.property;s=o.target,o._setter?o._setter(s,y,o):m?s[e]=v:p===I.ATTRIBUTE?s.setAttribute(e,v):(c=s.style,p===I.TRANSFORM?(s!==l&&(l=s,u=s[pe]),u[e]=v,d=1):p===I.CSS?c[e]=v:p===I.CSS_VAR&&c.setProperty(e,v)),S&&(T=1)}else o._value=v}else n&&m&&!_&&O<o._startTime&&(o._currentTime=0);d&&o._renderTransforms&&(c.transform=_t(u),d=0),o=o._next}!n&&T&&e.onRender(e)}!n&&S&&e.onUpdate(e)}return a&&ee?!n&&(a.began&&!k&&v>0&&!s||k&&v<=1e-11&&s)&&(e.onComplete(e),e.completed=!k):S&&C?l===1/0?e._startTime+=e.duration:e._currentIteration>=l-1&&(e.paused=!0,!s&&!m&&(e.completed=!0,!n&&(!a||!k&&a.began)&&(e.onComplete(e),e._resolve(e)))):e.completed=!1,T},Lt=(e,t,n,r,i)=>{let a=e._currentIteration;if(It(e,t,n,r,i),e._hasChildren){let o=e,s=o.backwards,c=r?t:o._iterationTime,l=Re(),u=0,d=!0;if(!r&&o._currentIteration!==a){let e=o.iterationDuration;K(o,t=>{if(!s)!t.completed&&!t.backwards&&t._currentTime<t.iterationDuration&&It(t,e,n,1,R.FORCE),t.began=!1,t.completed=!1;else{let r=t.duration,i=t._offset+t._delay,a=i+r;!n&&r<=1e-11&&(!i||a===e)&&t.onComplete(t)}}),n||o.onLoop(o)}K(o,e=>{let t=W((c-e._offset)*e._speed,12);if(s&&t>e._delay+e.duration)return;let a=e._fps<o._fps?e.requestTick(l):i;u+=It(e,t,n,r,a),!e.completed&&d&&(d=!1)},s),!n&&u&&o.onRender(o),(d||s)&&o._currentTime>=o.duration&&(o.paused=!0,o.completed||(o.completed=!0,n||(o.onComplete(o),o._resolve(o))))}},Rt={},zt=(e,t,n)=>{if(n===I.TRANSFORM)return _e.get(e)||e;if(n===I.CSS||n===I.ATTRIBUTE&&Ge(t)&&e in t.style){let t=Rt[e];if(t)return t;{let t=e&&Ie(e);return Rt[e]=t,t}}return e},Bt=(e,t=!1)=>{if(e._hasChildren)K(e,e=>Bt(e,t),!0);else{let n=e;n.pause(),K(n,e=>{let r=e.property,i=e.target,a=e._tweenType,o=e._inlineValue,s=We(o)||o===``;if(e._setter){if(!t&&!s){if(Mt(o,Pt),Pt.d){let t=Pt.d,n=e._numbers;for(let e=0,r=t.length;e<r;e++)n[e]=t[e]}else e._number=Pt.n;e._setter(e.target,e._number,e)}}else if(a===I.OBJECT)!t&&!s&&(i[r]=o);else if(i[de]){if(a===I.ATTRIBUTE)t||(s?i.removeAttribute(r):i.setAttribute(r,o));else{let t=i.style;if(a===I.TRANSFORM){let n=i[pe];s?delete n[r]:n[r]=o,e._renderTransforms&&(Object.keys(n).length?t.transform=_t(n):t.removeProperty(`transform`))}else s?t.removeProperty(Ie(r)):t[r]=o}}i[de]&&n._tail===e&&n.targets.forEach(e=>{e.getAttribute&&e.getAttribute(`style`)===``&&e.removeAttribute(`style`)})})}return e},Vt=class{constructor(e=0){this.deltaTime=0,this._currentTime=e,this._lastTickTime=e,this._startTime=e,this._lastTime=e,this._frameDuration=he/240,this._fps=240,this._speed=1,this._hasChildren=!1,this._head=null,this._tail=null}get fps(){return this._fps}set fps(e){let t=+e,n=t<1e-11?V:t,r=he/n;n>Ne.frameRate&&(Ne.frameRate=n),this._fps=n,this._frameDuration=r}get speed(){return this._speed}set speed(e){let t=+e;this._speed=t<1e-11?V:t}requestTick(e){let t=this._frameDuration,n=e-this._lastTickTime,r=t*.25;return n+(r<4?r:4)<t?R.NONE:(this._lastTickTime=n>=t?e-n%t:e,R.AUTO)}computeDeltaTime(e){let t=e-this._lastTime;return this.deltaTime=t,this._lastTime=e,t}},Ht={animation:null,update:be},Ut=e=>{let t=Ht.animation;return t||(t={duration:V,computeDeltaTime:be,_offset:0,_delay:0,_head:null,_tail:null},Ht.animation=t,Ht.update=()=>{e.forEach(e=>{for(let t in e){let n=e[t],r=n._head;if(r){let e=r._valueType,t=e===L.COMPLEX||e===L.COLOR?G(r._fromNumbers):null,i=r._fromNumber,a=n._tail;for(;a&&a!==r;){if(t)for(let e=0,n=a._numbers.length;e<n;e++)t[e]+=a._numbers[e];else i+=a._number;a=a._prevAdd}r._toNumber=i,r._toNumbers=t}}}),It(t,1,1,0,R.FORCE)}),t},Wt=P?requestAnimationFrame:setImmediate,Gt=P?cancelAnimationFrame:clearImmediate,Kt=class extends Vt{constructor(e){super(e),this.useDefaultMainLoop=!0,this.pauseOnDocumentHidden=!0,this.defaults=Ne,this.paused=!0,this.reqId=0}update(){let e=this._currentTime=Re();if(this.requestTick(e)){this.computeDeltaTime(e);let t=this._speed,n=this._fps,r=this._head;for(;r;){let i=r._next;r.paused?(mt(this,r),this._hasChildren=!!this._tail,r._running=!1,r.completed&&!r._cancelled&&r.cancel()):Lt(r,(e-r._startTime)*r._speed*t,0,0,r._fps<n?r.requestTick(e):R.AUTO),r=i}Ht.update()}}wake(){return this.useDefaultMainLoop&&!this.reqId&&(this.requestTick(Re()),this.reqId=Wt(qt)),this}pause(){if(this.reqId)return this.paused=!0,Jt()}resume(){if(this.paused)return this.paused=!1,K(this,e=>e.resetTime()),this.wake()}get speed(){return this._speed*(H.timeScale===1?1:he)}set speed(e){let t=e*H.timeScale;this._speed!==t&&(this._speed=t,K(this,e=>e.speed=e._speed))}get timeUnit(){return H.timeScale===1?`ms`:`s`}set timeUnit(e){let t=.001,n=e===`s`,r=n?t:1;if(H.timeScale!==r){H.timeScale=r,H.tickThreshold=200*r;let e=n?t:he;this.defaults.duration*=e,this._speed*=e}}get precision(){return H.precision}set precision(e){H.precision=e}},J=(()=>{let e=new Kt(Re());return P&&(Fe.engine=e,F.addEventListener(`visibilitychange`,()=>{e.pauseOnDocumentHidden&&(F.hidden?e.pause():e.resume())})),e})(),qt=()=>{J._head?(J.reqId=Wt(qt),J.update()):J.reqId=0},Jt=()=>(Gt(J.reqId),J.reqId=0,J),Yt={_rep:new WeakMap,_add:new Map},Xt=(e,t,n=`_rep`)=>{let r=Yt[n],i=r.get(e);return i||(i={},r.set(e,i)),i[t]?i[t]:i[t]={_head:null,_tail:null}},Zt=(e,t)=>e._isOverridden||e._absoluteStartTime>t._absoluteStartTime,Qt=e=>{e._isOverlapped=1,e._isOverridden=1,e._changeDuration=V,e._currentTime=V},$t=(e,t)=>{let n=e._composition;if(n===z.replace){let n=e._absoluteStartTime;ht(t,e,Zt,`_prevRep`,`_nextRep`);let r=e._prevRep;if(r){let t=r.parent,i=r._absoluteEndTime;if(e.parent.id!==t.id&&t.iterationCount>1&&i+(t.duration-t.iterationDuration)>n){Qt(r);let e=r._prevRep;for(;e&&e.parent.id===t.id;)Qt(e),e=e._prevRep}let a=e._absoluteUpdateStartTime;if(i>a){let e=r._startTime,t=W(a-(i-(e+r._updateDuration))-e,12);r._changeDuration=t,r._currentTime=t,r._isOverlapped=1,t<1e-11&&Qt(r)}let o=e.parent.parent;if(!o||o!==t.parent){let e=!0;if(K(t,t=>{t._isOverlapped||(e=!1)}),e){let e=t.parent;if(e){let n=!0;K(e,e=>{e!==t&&K(e,e=>{e._isOverlapped||(n=!1)})}),n&&e.cancel()}else t.cancel()}}}}else if(n===z.blend){let t=Xt(e.target,e.property,`_add`),n=Ut(Yt._add),r=t._head;r||(r={...e},r._composition=z.replace,r._updateDuration=V,r._startTime=0,r._numbers=G(e._fromNumbers),r._number=0,r._next=null,r._prev=null,ht(t,r),ht(n,r));let i=e._toNumber;if(e._fromNumber=r._fromNumber-i,e._toNumber=0,e._numbers=G(e._fromNumbers),e._number=0,r._fromNumber=i,e._toNumbers.length){let t=G(e._toNumbers);t.forEach((t,n)=>{e._fromNumbers[n]=r._fromNumbers[n]-t,e._toNumbers[n]=0}),r._fromNumbers=t}ht(t,e,null,`_prevAdd`,`_nextAdd`)}return e},en=e=>{let t=e._composition;if(t!==z.none){let n=e.target,r=e.property,i=Yt._rep.get(n)[r];if(mt(i,e,`_prevRep`,`_nextRep`),t===z.blend){let t=Yt._add,i=t.get(n);if(!i)return;let a=i[r],o=Ht.animation;mt(a,e,`_prevAdd`,`_nextAdd`);let s=a._head;if(s&&s===a._tail){mt(a,s,`_prevAdd`,`_nextAdd`),mt(o,s);let e=!0;for(let t in i)if(i[t]._head){e=!1;break}e&&t.delete(n)}}}return e},tn=(e,t,n)=>{let r=!1;return K(t,i=>{let a=i.target;if(e.includes(a)){let e=i.property,o=i._tweenType,s=zt(n,a,o);(!s||s&&s===e)&&(i.parent._tail===i&&i._tweenType===I.TRANSFORM&&i._prev&&i._prev._tweenType===I.TRANSFORM&&(i._prev._renderTransforms=1),mt(t,i),en(i),r=!0)}},!0),r},nn=(e,t,n)=>{let r=t||J,i;if(r._hasChildren){let t=0;K(r,a=>{if(!a._hasChildren){if(i=tn(e,a,n),i&&!a._head)a.cancel(),mt(r,a);else{let e=a._offset+a._delay+a.duration;e>t&&(t=e)}}a._head?nn(e,a,n):a._hasChildren=!1},!0),U(r.iterationDuration)||(r.iterationDuration=t)}else i=tn(e,r,n);i&&!r._head&&(r._hasChildren=!1,r.cancel&&r.cancel())},rn=e=>(e.paused=!0,e.began=!1,e.completed=!1,e),an=e=>e._cancelled?(e._hasChildren?K(e,an):K(e,e=>{e._composition!==z.none&&$t(e,Xt(e.target,e.property))}),e._cancelled=0,e):e,on=0,sn=(e,t)=>e._priority>t._priority,cn=class extends Vt{constructor(e={},t=null,n=0){super(0),++on;let{id:r,delay:i,duration:a,reversed:o,alternate:s,loop:c,loopDelay:l,autoplay:u,frameRate:d,playbackRate:f,priority:p,onComplete:m,onLoop:h,onPause:g,onBegin:_,onBeforeUpdate:v,onUpdate:y}=e;Pe.current&&Pe.current.register(this);let b=t?0:J._lastTickTime,x=t?t.defaults:H.defaults,S=Ue(i)||U(i)?x.delay:+i,C=Ue(a)||U(a)?1/0:+a,ee=q(c,x.loop),te=q(l,x.loopDelay),w=ee===!0||ee===1/0||ee<0?1/0:ee+1,ne=0;t?ne=n:(J.reqId||J.requestTick(Re()),ne=(J._lastTickTime-J._startTime)*H.timeScale),this.id=U(r)?on:r,this.parent=t,this.duration=dt((C+te)*w-te)||1e-11,this.backwards=!1,this.paused=!0,this.began=!1,this.completed=!1,this.onBegin=_||x.onBegin,this.onBeforeUpdate=v||x.onBeforeUpdate,this.onUpdate=y||x.onUpdate,this.onLoop=h||x.onLoop,this.onPause=g||x.onPause,this.onComplete=m||x.onComplete,this.iterationDuration=C,this.iterationCount=w,this._autoplay=!t&&q(u,x.autoplay),this._offset=ne,this._delay=S,this._loopDelay=te,this._iterationTime=0,this._currentIteration=0,this._resolve=be,this._running=!1,this._reversed=+q(o,x.reversed),this._reverse=this._reversed,this._cancelled=0,this._alternate=q(s,x.alternate),this._prev=null,this._next=null,this._lastTickTime=b,this._startTime=b,this._lastTime=b,this._fps=q(d,x.frameRate),this._speed=q(f,x.playbackRate),this._priority=+q(p,1)}get cancelled(){return!!this._cancelled}set cancelled(e){e?this.cancel():this.reset(!0).play()}get currentTime(){return lt(W(this._currentTime,H.precision),-this._delay,this.duration)}set currentTime(e){let t=this.paused;this.pause().seek(+e),t||this.resume()}get iterationCurrentTime(){return lt(W(this._iterationTime,H.precision),0,this.iterationDuration)}set iterationCurrentTime(e){this.currentTime=this.iterationDuration*this._currentIteration+e}get progress(){return lt(W(this._currentTime/this.duration,10),0,1)}set progress(e){this.currentTime=this.duration*e}get iterationProgress(){return lt(W(this._iterationTime/this.iterationDuration,10),0,1)}set iterationProgress(e){let t=this.iterationDuration;this.currentTime=t*this._currentIteration+t*e}get currentIteration(){return this._currentIteration}set currentIteration(e){this.currentTime=this.iterationDuration*lt(+e,0,this.iterationCount-1)}get reversed(){return!!this._reversed}set reversed(e){e?this.reverse():this.play()}get speed(){return super.speed}set speed(e){super.speed=e,this.resetTime()}reset(e=!1){return an(this),this._reversed&&!this._reverse&&(this.reversed=!1),this._iterationTime=this.iterationDuration,Lt(this,0,1,~~e,R.FORCE),rn(this),this._hasChildren&&K(this,rn),this}init(e=!1){this.fps=this._fps,this.speed=this._speed,!e&&this._hasChildren&&Lt(this,this.duration,1,~~e,R.FORCE),this.reset(e);let t=this._autoplay;return t===!0?this.resume():t&&!U(t.linked)&&t.link(this),this}resetTime(){let e=1/(this._speed*J._speed);return this._startTime=Re()-(this._currentTime+this._delay)*e,this}pause(){return this.paused?this:(this.paused=!0,this.onPause(this),this)}resume(){return this.paused?(this.paused=!1,this.duration<=1e-11&&!this._hasChildren?Lt(this,V,0,0,R.FORCE):(this._running||=(ht(J,this,sn),J._hasChildren=!0,!0),this.resetTime(),this._startTime-=12,J.wake()),this):this}restart(){return this.reset().resume()}seek(e,t=0,n=0){an(this),this.completed=!1;let r=this.paused;return this.paused=!0,Lt(this,e+this._delay,~~t,~~n,R.AUTO),r?this:this.resume()}alternate(){let e=this._reversed,t=this.iterationCount,n=this.iterationDuration,r=t===1/0?at(me/n):t;return this._reversed=+(this._alternate&&!(r%2)?e:!e),t===1/0?this.iterationProgress=this._reversed?1-this.iterationProgress:this.iterationProgress:this.seek(n*r-this._currentTime),this.resetTime(),this}play(){return this._reversed&&this.alternate(),this.resume()}reverse(){return this._reversed||this.alternate(),this.resume()}cancel(){return this._hasChildren?K(this,e=>e.cancel(),!0):K(this,en),this._cancelled=1,this.pause()}stretch(e){let t=this.duration,n=ft(e);if(t===n)return this;let r=e/t,i=e<=V;return this.duration=i?V:n,this.iterationDuration=i?V:ft(this.iterationDuration*r),this._offset*=r,this._delay*=r,this._loopDelay*=r,this}revert(){Lt(this,0,1,0,R.AUTO);let e=this._autoplay;return e&&e.linked&&e.linked===this&&e.revert(),this.cancel()}complete(e=0){return this.seek(this.duration,e).cancel()}then(e=be){let t=this.then,n=()=>{this.then=null,e(this),this.then=t,this._resolve=be};return new Promise(e=>(this._resolve=()=>e(n()),this.completed&&this._resolve(),this))}};function ln(e){let t=He(e)?Pe.root.querySelectorAll(e):e;if(t instanceof NodeList||t instanceof HTMLCollection)return t}function un(e){if(We(e))return[];if(!P)return ze(e)&&e.flat(1/0)||[e];if(ze(e)){let t=e.flat(1/0),n=[];for(let e=0,r=t.length;e<r;e++){let r=t[e];if(!We(r)){let e=ln(r);if(e)for(let t=0,r=e.length;t<r;t++){let r=e[t];if(!We(r)){let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}else{let e=!1;for(let t=0,i=n.length;t<i;t++)if(n[t]===r){e=!0;break}e||n.push(r)}}}return n}let t=ln(e);return t?Array.from(t):[e]}function dn(e){let t=un(e),n=t.length;for(let e=0;e<n;e++){let n=t[e];if(!n[ue]){n[ue]=!0;let e=Ge(n);(n.nodeType||e)&&(n[de]=!0,n[fe]=e,n[pe]={})}}return t}var fn={deg:1,rad:180/st,turn:360},pn={},mn=(e,t,n,r=!1)=>{let i=t.u,a=t.n;if(t.t===L.UNIT&&i===n)return t;let o=a+i+n,s=pn[o];if(!U(s)&&!r)t.n=s;else{let r;if(i in fn)r=a*fn[i]/fn[n];else{let t=e.cloneNode(),o=e.parentNode,s=o&&o!==F?o:F.body;s.appendChild(t);let c=t.style;c.width=100+i;let l=t.offsetWidth||100;c.width=100+n;let u=l/(t.offsetWidth||100);s.removeChild(t),r=u*a}t.n=r,pn[o]=r}return t.t,L.UNIT,t.u=n,t},hn=e=>e,gn=(e=1.68)=>t=>et(t,+e),_n={in:e=>t=>e(t),out:e=>t=>1-e(1-t),inOut:e=>t=>t<.5?e(t*2)/2:1-e(t*-2+2)/2,outIn:e=>t=>t<.5?(1-e(1-t*2))/2:(e(t*2-1)+1)/2},vn=st/2,yn=st*2,bn={"":gn,Quad:gn(2),Cubic:gn(3),Quart:gn(4),Quint:gn(5),Sine:e=>1-rt(e*vn),Circ:e=>1-tt(1-e*e),Expo:e=>e?et(2,10*e-10):0,Bounce:e=>{let t,n=4;for(;e<((t=et(2,--n))-1)/11;);return 1/et(4,3-n)-7.5625*et((t*3-2)/22-e,2)},Back:(e=1.7)=>t=>(+e+1)*t*t*t-+e*t*t,Elastic:(e=1,t=.3)=>{let n=lt(+e,1,10),r=lt(+t,V,2),i=r/yn*ot(1/n),a=yn/r;return e=>e===0||e===1?e:-n*et(2,-10*(1-e))*nt((1-e-i)*a)}},xn=(()=>{let e={linear:hn,none:hn};for(let t in _n)for(let n in bn){let r=bn[n],i=_n[t];e[t+n]=n===``||n===`Back`||n===`Elastic`?(e,t)=>i(r(e,t)):i(r)}return e})(),Sn={linear:hn,none:hn},Cn=e=>{if(Sn[e])return Sn[e];if(e.indexOf(`(`)<=-1){let t=_n[e]||e.includes(`Back`)||e.includes(`Elastic`)?xn[e]():xn[e];return t?Sn[e]=t:hn}{let t=e.slice(0,-1).split(`(`),n=xn[t[0]];return n?Sn[e]=n(...t[1].split(`,`)):hn}},wn=[`steps(`,`irregular(`,`linear(`,`cubicBezier(`],Tn=e=>{if(He(e)){for(let t=0,n=wn.length;t<n;t++)if(Le(e,wn[t]))return console.warn(`String syntax for \`ease: "${e}"\` has been removed from the core and replaced by importing and passing the easing function directly: \`ease: ${e}\``),hn}return Ue(e)?e:He(e)?Cn(e):hn},Y=jt(),X=jt(),En={},Dn={func:null},On={func:null},kn=[null],An=[null,null],jn={to:null},Mn=0,Nn=0,Pn,Fn,In=(e,t)=>{let n={};if(ze(e)){let t=[].concat(...e.map(e=>Object.keys(e))).filter(Xe);for(let r=0,i=t.length;r<i;r++){let i=t[r];n[i]=e.map(e=>{let t={};for(let n in e){let r=e[n];Xe(n)?n===i&&(t.to=r):t[n]=r}return t})}}else{let r=q(t.duration,H.defaults.duration);Object.keys(e).map(t=>({o:parseFloat(t)/100,p:e[t]})).sort((e,t)=>e.o-t.o).forEach(e=>{let t=e.o,i=e.p;for(let e in i)if(Xe(e)){let a=n[e];a||=n[e]=[];let o=t*r,s=a.length,c=a[s-1],l={to:i[e]},u=0;for(let e=0;e<s;e++)u+=a[e].duration;s===1&&(l.from=c.to),i.ease&&(l.ease=i.ease),l.duration=o-(s?u:0),a.push(l)}return e});for(let e in n){let t=n[e],r;for(let e=0,n=t.length;e<n;e++){let n=t[e],i=n.ease;n.ease=r||void 0,r=i}t[0].duration||t.shift()}}return n},Ln=class extends cn{constructor(e,t,n,r,i=!1,a=0,o){super(t,n,r),this._head,this._tail,++Nn;let s=dn(e),c=s.length,l=t.keyframes,u=l?pt(In(l,t),t):t,{id:d,delay:f,duration:p,ease:m,playbackEase:h,modifier:g,composition:_,onRender:v}=u,y=n?n.defaults:H.defaults,b=q(m,y.ease),x=q(h,y.playbackEase),S=x?Tn(x):null,C=!U(b.ease),ee=C?b.ease:q(m,S?`linear`:y.ease),te=C?b.settlingDuration:q(p,y.duration),w=q(f,y.delay),ne=g||y.modifier,T=U(_)&&c>=1e3?z.none:U(_)?y.composition:_,E=this._offset+(n?n._offset:0);C&&(b.parent=this);let D=NaN,O=NaN,k=0,A=0;for(let e=0;e<c;e++){let t=s[e],r=a||e,c=o||s,l=NaN,d=NaN;for(let e in u)if(Xe(e)){let a=Dt(t,e),o=yt(t,e),s=zt(e,t,a),f=u[e],p=ze(f);if(i&&!p&&(An[0]=f,An[1]=f,f=An),p){let e=f.length,t=!Be(f[0]);e===2&&t?(jn.to=f,kn[0]=jn,Pn=kn):e>2&&t?(Pn=[],f.forEach((e,t)=>{t?t===1?(An[1]=e,Pn.push(An)):Pn.push(e):An[0]=e})):Pn=f}else kn[0]=f,Pn=kn;let m=null,h=null,g=NaN,_=0,v=0;for(let e=Pn.length;v<e;v++){let i=Pn[v];Be(i)?Fn=i:(jn.to=i,Fn=jn),Dn.func=null,On.func=null;let l=Et(q(Fn.composition,T),t,r,c,null,null),u=Ve(l)?l:z[l];!m&&u!==z.none&&(m=Xt(t,s));let d=m?m._tail:null,f=n&&d&&d.parent.parent===n?d:h,p=Et(Fn.to,t,r,c,Dn,f),y;Be(p)&&!U(p.to)?(Fn=p,y=p.to):y=p;let b=Et(Fn.from,t,r,c,On,f),x=Fn.ease||ee,S=Et(x,t,r,c,null,f),C=Ue(S)||He(S)?S:x,D=!U(C)&&!U(C.ease),O=D?C.ease:C,j=D?C.settlingDuration:Et(q(Fn.duration,e>1?Et(te,t,r,c,null,f)/e:te),t,r,c,null,f),re=Et(q(Fn.delay,v?0:w),t,r,c,null,f),ie=Fn.modifier||ne,ae=!U(b),M=!U(y),oe=ze(y),se=oe||ae&&M,ce=h?_:0,N=h?_+re:re,P=W(E+N,12),le=W(E+ce,12);!A&&(ae||oe)&&(A=1);let F=h;if(u!==z.none){let e=m._head;for(;e&&e._absoluteStartTime<=P;)if(e._isOverridden||(F=e),e=e._nextRep,e&&e._absoluteStartTime>=P)for(;e;)Qt(e),e=e._nextRep}if(se){Mt(oe?Et(y[0],t,r,c,On,f):b,Y),Mt(oe?Et(y[1],t,r,c,Dn,f):y,X);let e=kt(t,s,a,En);Y.t===L.NUMBER&&(F?F._valueType===L.UNIT&&(Y.t=L.UNIT,Y.u=F._unit):(Mt(e,Pt),Pt.t===L.UNIT&&(Y.t=L.UNIT,Y.u=Pt.u)))}else M?Mt(y,X):h?Nt(h,X):Mt(n&&F&&F.parent.parent===n?F._value:kt(t,s,a,En),X),ae?Mt(b,Y):h?Nt(h,Y):Mt(n&&F&&F.parent.parent===n?F._value:kt(t,s,a,En),Y);if(Y.o&&(Y.n=At(F?F._toNumber:Mt(kt(t,s,a,En),Pt).n,Y.n,Y.o)),X.o&&(X.n=At(Y.n,X.n,X.o)),Y.t!==X.t){if(Y.t===L.COMPLEX||X.t===L.COMPLEX){let e=Y.t===L.COMPLEX?Y:X,t=Y.t===L.COMPLEX?X:Y;t.t=L.COMPLEX,t.s=G(e.s),t.d=e.d.map(()=>t.n)}else if(Y.t===L.UNIT||X.t===L.UNIT){let e=Y.t===L.UNIT?Y:X,t=Y.t===L.UNIT?X:Y;t.t=L.UNIT,t.u=e.u}else if(Y.t===L.COLOR||X.t===L.COLOR){let e=Y.t===L.COLOR?Y:X,t=Y.t===L.COLOR?X:Y;t.t=L.COLOR,t.d=e.d.map(()=>0)}}if(Y.u!==X.u){let e=X.u?Y:X;e=mn(t,e,X.u?X.u:Y.u,!1)}if(X.d&&Y.d&&X.d.length!==Y.d.length){let e=Y.d.length>X.d.length?Y:X,t=e===Y?X:Y;t.d=e.d.map((e,n)=>U(t.d[n])?0:t.d[n]),t.s=G(e.s)}let I=W(+j||1e-11,12),R=En[s];We(R)||(En[s]=null);let ue=o?o.set:null;_=W(N+I,12);let de=Y.d,fe=X.d,pe=X.s,B={parent:this,id:Mn++,property:s,target:t,_value:null,_toFunc:Dn.func,_fromFunc:On.func,_ease:Tn(O),_fromNumbers:de?G(de):ge,_toNumbers:fe?G(fe):ge,_strings:pe?G(pe):ge,_fromNumber:Y.n,_toNumber:X.n,_numbers:de?G(de):ge,_number:Y.n,_unit:X.u,_modifier:ie,_currentTime:0,_startTime:N,_delay:+re,_updateDuration:I,_changeDuration:I,_absoluteStartTime:P,_absoluteUpdateStartTime:le,_absoluteEndTime:W(E+_,12),_hasFromValue:ae||oe?1:0,_tweenType:a,_setter:ue,_valueType:X.t,_composition:u,_isOverlapped:0,_isOverridden:0,_renderTransforms:0,_inlineValue:R,_prevRep:null,_nextRep:null,_prevAdd:null,_nextAdd:null,_prev:null,_next:null};u!==z.none&&$t(B,m);let V=B._valueType;if(V===L.COMPLEX)B._value=Ft(B,1,-1);else if(V===L.UNIT)B._value=`${ie(B._toNumber)}${B._unit}`;else if(V===L.COLOR){let e=X.d;B._value=`rgba(${W(e[0],0)},${W(e[1],0)},${W(e[2],0)},${e[3]})`}else B._value=ie(B._toNumber);isNaN(g)&&(g=B._startTime),h=B,k++,ht(this,B)}(isNaN(O)||g<O)&&(O=g),(isNaN(D)||_>D)&&(D=_),a===I.TRANSFORM&&(l=k-v,d=k)}if(!isNaN(l)){let e=0;K(this,t=>{e>=l&&e<d&&(t._renderTransforms=1,t._composition===z.blend&&K(Ht.animation,e=>{e.id===t.id&&(e._renderTransforms=1)})),e++})}}c||console.warn(`No target found. Make sure the element you're trying to animate is accessible before creating your animation.`),O?(K(this,e=>{e._startTime-e._delay||(e._delay-=O),e._startTime-=O}),D-=O):O=0,D||(D=V,this.iterationCount=0),this.targets=s,this.id=U(d)?Nn:d,this.duration=D===1e-11?V:dt((D+this._loopDelay)*this.iterationCount-this._loopDelay)||1e-11,this.onRender=v||y.onRender,this._ease=S,this._delay=O,this.iterationDuration=D,!this._autoplay&&A&&this.onRender(this)}stretch(e){let t=this.duration;if(t===ft(e))return this;let n=e/t;return K(this,e=>{e._updateDuration=ft(e._updateDuration*n),e._changeDuration=ft(e._changeDuration*n),e._currentTime*=n,e._delay*=n,e._startTime*=n,e._absoluteStartTime*=n,e._absoluteUpdateStartTime*=n,e._absoluteEndTime*=n}),super.stretch(e)}refresh(){return K(this,e=>{let t=e._toFunc,n=e._fromFunc;(t||n)&&(n?(Mt(n(),Y),Y.u!==e._unit&&e.target[de]&&mn(e.target,Y,e._unit,!0),e._fromNumbers=G(Y.d),e._fromNumber=Y.n):t&&(Mt(kt(e.target,e.property,e._tweenType),Pt),e._fromNumbers=G(Pt.d),e._fromNumber=Pt.n),t&&(Mt(t(),X),e._toNumbers=G(X.d),e._strings=G(X.s),e._toNumber=X.o?At(e._fromNumber,X.n,X.o):X.n))}),this.duration===1e-11&&this.restart(),this}revert(){return super.revert(),Bt(this)}then(e){return super.then(e)}},Rn=(e,t)=>H.editor?H.editor.addAnimation(e,t):new Ln(e,t,null,0,!1).init(),zn=(e,t)=>{if(Le(t,`<`)){let n=t[1]===`<`,r=e._tail,i=r?r._offset+r._delay:0;return n?i:i+r.duration}},Bn=(e,t)=>{let n=e.iterationDuration;if(n===1e-11&&(n=0),U(t))return n;if(Ve(+t))return+t;let r=t,i=e?e.labels:null,a=!We(i),o=zn(e,r),s=!U(o),c=je.exec(r);if(c){let e=c[0],t=r.split(e),l=a&&t[0]?i[t[0]]:n;return At(s?o:a?l:n,+t[1],e[0])}return s?o:a?U(i[r])?n:i[r]:n},Vn=(e,t)=>{if(!U(t))return H.editor&&H.editor.addSet?H.editor.addSet(e,t):(t.duration=V,t.composition=q(t.composition,z.none),new Ln(e,t,null,0,!0).resume())},Hn=(e=0,t=1,n=0)=>{let r=10**n;return Math.floor((Math.random()*(t-e+1/r)+e)*r)/r},Un=0,Wn=(e,t=0,n=1,r=0)=>{let i=e===void 0?Un++: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}},Gn=(e,t=Hn)=>{let n=e.length,r,i;for(;n;)i=t(0,--n),r=e[n],e[n]=e[i],e[i]=r;return e},Kn=(e,t={})=>{let n=[],r=0,i,a=null,o=t.from,s=t.reversed,c=t.ease,l=!U(c),u=l&&!U(c.ease)?c.ease:l?Tn(c):null,d=t.grid,f=d===!0,p=t.axis,m=t.total,h=U(o)||o===0||o===`first`,g=o===`center`,_=o===`last`,v=o===`random`,y=ze(o),b=ze(e),x=t.use,S=$e(b?e[0]:e),C=b?$e(e[1]):0,ee=ke.exec((b?e[1]:e)+``),te=t.start||0+(b?S:0),w=t.seed,ne=!U(w)&&w!==!1?Wn(w===!0?0:w):Hn,T=t.jitter,E=!U(T),D=ze(T),O=D?T[0]:T||0,k=D?T[1]:T||0,A=h?0:Ve(o)?o:0;return(e,c,l,h,w)=>{let[T]=dn(e),D=U(m)?l.length:m,j=U(x)?!1:Ue(x)?x(T,c,D):kt(T,x),re=Ve(j)||He(j)&&Ve(+j)?+j:c,ie=re>=0&&re<D?re:c;if(g&&(A=(D-1)/2),_&&(A=D-1),!n.length){if(f){let e=!0,t=!1,r=1/0,i=1/0,a=1/0,s=-1/0,c=-1/0,u=-1/0,d=[],f=[],m=[];for(let n=0;n<D;n++){let o=l[n],p=0,h=0,g=0,_=!1;if(o&&Ue(o.getBoundingClientRect)){let e=o.getBoundingClientRect();p=e.left+e.width/2,h=e.top+e.height/2,_=!0}else{let e=o;e&&Ve(e.x)&&Ve(e.y)&&(p=e.x,h=e.y,Ve(e.z)&&(g=e.z,t=!0),_=!0)}if(!_){e=!1;break}d.push(p),f.push(h),m.push(g),p<r&&(r=p),h<i&&(i=h),g<a&&(a=g),p>s&&(s=p),h>c&&(c=h),g>u&&(u=g)}if(e){let e=d[0],l=f[0],h=m[0];y?(e=r+o[0]*(s-r),l=i+o[1]*(c-i),h=t?a+(o.length>=3?o[2]:.5)*(u-a):0):g?(e=(r+s)/2,l=(i+c)/2,h=(a+u)/2):_?(e=d[D-1],l=f[D-1],h=m[D-1]):Ve(o)&&(e=d[o],l=f[o],h=m[o]);for(let r=0;r<D;r++){let i=e-d[r],a=l-f[r],o=h-m[r],s=tt(i*i+a*a+(t?o*o:0));p===`x`&&(s=-i),p===`y`&&(s=-a),p===`z`&&(s=-o),n.push(s)}let v=1/0;for(let e=0;e<D;e++){let t=it(n[e]);t>0&&t<v&&(v=t)}if(v>0&&v<1/0)for(let e=0;e<D;e++)n[e]=n[e]/v}else for(let e=0;e<D;e++)n.push(it(A-e))}else for(let e=0;e<D;e++)if(!d)n.push(it(A-e));else{let t=d.length,r=d[0]*d[1],i,a,s;y?(i=o[0]*(d[0]-1),a=o[1]*(d[1]-1),s=t===3?(o.length>=3?o[2]:.5)*(d[2]-1):0):g?(i=(d[0]-1)/2,a=(d[1]-1)/2,s=t===3?(d[2]-1)/2:0):(i=A%d[0],a=at(A/d[0])%d[1],s=t===3?at(A/r):0);let c=e%d[0],l=at(e/d[0])%d[1],u=t===3?at(e/r):0,f=i-c,m=a-l,h=s-u,_=tt(f*f+m*m+(t===3?h*h:0));p===`x`&&(_=-f),p===`y`&&(_=-m),p===`z`&&(_=-h),n.push(_)}r=n[0];for(let e=1;e<D;e++)n[e]>r&&(r=n[e]);if(u||s)for(let e=0;e<D;e++){let t=n[e];u&&(t=u(t/r)*r),s&&(t=p?-t:it(r-t)),n[e]=t}if(E){a=Array(D);for(let e=0;e<D;e++)a[e]=ne(-1,1,4)}v&&(n=Gn(n,ne))}let ae=b?(C-S)/r:S;U(i)&&(i=w?Bn(w,U(t.start)?w.iterationDuration:te):te);let M=i+(ae*W(n[ie],2)||0);if(E){let e=r?n[ie]/r:0,t=O+(k-O)*e;M+=a[ie]*t}return t.modifier&&(M=t.modifier(M)),ee&&(M=`${M}${ee[2]}`),M}};function qn(){return typeof window>`u`||!window.matchMedia?!1:!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function Jn(e,t){let n=setTimeout(()=>e.complete(),t+400);return()=>{clearTimeout(n),e.complete()}}function Yn(e,t=700){let n=typeof e==`number`&&Number.isFinite(e)?e:null,r=n!==null&&qn(),[i,o]=(0,a.useState)(0),s=(0,a.useRef)(0);return(0,a.useEffect)(()=>{if(!r)return;let e={n:s.current},i=Rn(e,{n,duration:t,ease:`outExpo`,onUpdate:()=>{s.current=e.n,o(e.n)},onComplete:()=>{s.current=n,o(n)}}),a=setTimeout(()=>i.complete(),t+400);return()=>{clearTimeout(a),i.pause()}},[n,t,r]),r?i:n}function Xn({value:e,duration:t}){let n=Yn(e,t);return n===null?e??null:Math.round(n)}function Zn(e){let t=(0,a.useRef)(null),n=(0,a.useRef)(null),r=(0,a.useRef)(()=>{}),i=(0,a.useRef)(null);return(0,a.useLayoutEffect)(()=>{let a=t.current,o=a?.querySelector(`:scope > .glide`);o&&(r.current=t=>{let r=a.querySelector(e);if(!r){o.style.opacity=`0`,n.current=null;return}let s=a.getBoundingClientRect(),c=r.getBoundingClientRect(),l={translateX:c.left-s.left+a.scrollLeft-a.clientLeft,translateY:c.top-s.top+a.scrollTop-a.clientTop,width:c.width,height:c.height},u=n.current;if(n.current={el:r,...l},!(u&&u.el===r&&[`translateX`,`translateY`,`width`,`height`].every(e=>Math.abs(u[e]-l[e])<.5))){if(o.style.opacity=`1`,i.current&&=(clearTimeout(i.current.t),i.current.anim.pause(),null),t&&u&&u.el!==r&&qn()){let e=Rn(o,{...l,duration:280,ease:`outExpo`});i.current={anim:e,t:setTimeout(()=>e.complete(),680)}}else Vn(o,l)}},r.current(!0))}),(0,a.useEffect)(()=>{let e=()=>r.current(!1);return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),t}function Qn(){let e=(0,a.useRef)(null),t=(0,a.useRef)(null);return(0,a.useLayoutEffect)(()=>{let n=e.current;if(!n){t.current=null;return}let r=[...n.querySelectorAll(`:scope > [data-flip]`)],i=new Map(r.map(e=>[e.dataset.flip,e.offsetTop])),a=t.current;if(t.current=i,a&&qn())for(let e of r){let t=a.get(e.dataset.flip);t===void 0?Jn(Rn(e,{opacity:[0,1],translateY:[-12,0],duration:340,ease:`outExpo`}),340):Math.abs(t-i.get(e.dataset.flip))>1&&Jn(Rn(e,{translateY:[t-i.get(e.dataset.flip),0],duration:340,ease:`outExpo`}),340)}}),e}var $n=new Set([`activity`,`diff`,`settings`,`harness`,`harnesses`,`doctor`,`themes`,`library`,`laws`,`rules`,`profile`,`skills`,`agents`,`about`]),er={themes:`harness`,harnesses:`harness`,about:`settings`};function tr(){let e=()=>{let e=((typeof window<`u`?window.location.hash:``)||`#/`).slice(2).split(`/`).filter(Boolean);return e[0]===`section`?{view:`section`,section:e[1]}:e[0]===`item`?{view:`item`,type:e[1],name:decodeURIComponent(e[2]||``)}:e[0]===`docs`?{view:`docs`,page:decodeURIComponent(e.slice(1).join(`/`)||``)}:e[0]===`activity`&&e[1]?{view:`activity-detail`,sid:decodeURIComponent(e[1])}:$n.has(e[0])?{view:er[e[0]]||e[0]}:{view:`dashboard`}},[t,n]=(0,a.useState)(e);return(0,a.useEffect)(()=>{let t=()=>n(e());return window.addEventListener(`hashchange`,t),()=>window.removeEventListener(`hashchange`,t)},[]),t}var nr=e=>{window.location.hash=e},rr={red:`#FF5C57`,green:`#4ED888`,yellow:`#E8B53D`,blue:`#5B8CFF`,magenta:`#C77DFF`,cyan:`#3AD4C4`,white:`#E9EFEA`},ir={red:`#C53A36`,green:`#2FA864`,yellow:`#B8862A`,blue:`#3C66D8`,magenta:`#9A52D6`,cyan:`#2BA89B`,white:`#AEB8B0`},ar=e=>rr[e]||rr.cyan,or=e=>e===`yellow`||e===`white`||e===`cyan`||e===`green`?`#06100D`:`#FFFFFF`;function sr(e,t,n){if(!e)return;let r=n===`light`,i=r?ir[t]||ir.cyan:ar(t),a=r?`#FFFFFF`:or(t);r&&t===`white`&&(i=`#566B62`,a=`#FFFFFF`),e.style.setProperty(`--accent`,i),e.style.setProperty(`--accent-2`,ir[t]||ir.cyan),e.style.setProperty(`--accent-ink`,a)}var cr={cultivar:{dark:`#3AD4C4`,light:`#127E73`,ink:`#06100D`,inkLight:`#FFFFFF`},greenhouse:{dark:`#74CE86`,light:`#1C8450`,ink:`#06140C`,inkLight:`#FFFFFF`},operator:{dark:`#E8A23B`,light:`#8F5E10`,ink:`#1A1306`,inkLight:`#FFFFFF`},heirloom:{dark:`#B9A6C6`,light:`#6E5A7C`,ink:`#1B1622`,inkLight:`#FFFFFF`},matrix:{dark:`#19E37C`,light:`#0B7A47`,ink:`#04140C`,inkLight:`#FFFFFF`},aurora:{dark:`#2DE0B8`,light:`#0B7D62`,ink:`#04231A`,inkLight:`#FFFFFF`},perspective:{dark:`#FF7A59`,light:`#C24A2C`,ink:`#2A0E04`,inkLight:`#FFFFFF`},sequencer:{dark:`#5B57E8`,light:`#4F46E5`,ink:`#FFFFFF`,inkLight:`#FFFFFF`},cobalt:{dark:`#2BA8FF`,light:`#1668A8`,ink:`#021018`,inkLight:`#FFFFFF`},cosmic:{dark:`#C081FF`,light:`#7A33CC`,ink:`#1A0833`,inkLight:`#FFFFFF`},neon:{dark:`#DB245C`,light:`#D81E5B`,ink:`#FFFFFF`,inkLight:`#FFFFFF`},atlas:{dark:`#8FD694`,light:`#1C8450`,ink:`#14200F`,inkLight:`#FFFFFF`}};function lr(e,t,n){let r=cr[t];if(!e||!r)return!1;let i=n===`light`;return e.style.setProperty(`--accent`,i?r.light:r.dark),e.style.setProperty(`--accent-2`,r.light),e.style.setProperty(`--accent-ink`,i?r.inkLight:r.ink),!0}var ur={agents:{label:`Agents`,type:`agent`,desc:`capability specialists`,icon:`agent`},skills:{label:`Skills`,type:`skill`,desc:`repeatable workflows`,icon:`skill`},laws:{label:`Constitution`,type:`law`,desc:`ontology, invariants, doctrines`,icon:`law`},memory:{label:`Memory`,type:`memory`,desc:`durable facts`,icon:`library`},notebook:{label:`Notebook`,type:`notebook`,desc:`sovereign space`,icon:`notebook`},wiki:{label:`Knowledge`,type:`wiki`,desc:`knowledge base + setup`,icon:`graph`},config:{label:`Config`,type:`config`,desc:`install metadata`,icon:`settings`}},dr=[`agents`,`memory`,`notebook`,`wiki`,`config`],fr=dr.filter(e=>e!==`agents`&&e!==`config`),pr={config:`wiki`},mr=Object.fromEntries(Object.entries(ur).map(([e,t])=>[t.type,e]));function hr(e,t){let[n,r]=(0,a.useState)(()=>{try{return t(localStorage.getItem(e))}catch{return t(null)}});return(0,a.useEffect)(()=>{try{localStorage.setItem(e,n)}catch{}},[e,n]),[n,r]}var gr=`geneseed-mode`;function _r(){let[e,t]=hr(gr,e=>e===`light`?`light`:`dark`);return[e,()=>t(e=>e===`light`?`dark`:`light`)]}var vr=`geneseed-flavour`,yr=[{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:`greenhouse`,short:`Greenhouse`,name:`Greenhouse`,tagline:`Warm loam dark, fresh sage green, rounded humanist type — the softest, friendliest skin.`},{id:`operator`,short:`Operator`,name:`Operator HUD`,tagline:`Amber phosphor on cool charcoal — all-mono, zero-radius instrument readout.`},{id:`heirloom`,short:`Heirloom`,name:`Heirloom`,tagline:`Aubergine plum and serif display — the one luxe, calm, editorial skin.`},{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:`aurora`,short:`Aurora`,name:`Aurora Glass`,tagline:`The glass skin — frosted navy panels lit by a cyan-to-violet aurora, airy and weightless.`},{id:`perspective`,short:`Perspective`,name:`Perspective`,tagline:`Coral on cool slate, condensed-architectural headings, cards that physically lift off the page.`},{id:`sequencer`,short:`Sequencer`,name:`Sequencer`,tagline:`A quant terminal in daylight — indigo on white, Inter, lining numerals on a fine ruled grid.`},{id:`cobalt`,short:`Cobalt`,name:`Cobalt Terminal`,tagline:`Electric-blue hacker terminal — all-mono, 2px corners, CRT scanlines on near-black.`},{id:`cosmic`,short:`Cosmic`,name:`Cosmic`,tagline:`Violet-magenta nebula on near-black — wide Audiowide wordmark, chamfered sci-fi instrumentation.`},{id:`neon`,short:`Neon`,name:`Neon`,tagline:`Neon-noir: hot-pink edge-glow on near-black, all-mono Geist, frosted glass.`},{id:`atlas`,short:`Atlas`,name:`Atlas`,tagline:`The field journal — loam dark, sage ink, the codex as a living map.`}],br=new Set(yr.map(e=>e.id)),xr={a:`cultivar`,b:`greenhouse`,c:`operator`,d:`heirloom`,e:`matrix`,f:`aurora`,g:`perspective`,z:`sequencer`,cb:`cobalt`,cm:`cosmic`};function Sr(){return hr(vr,e=>br.has(e)?e:xr[e]||`cultivar`)}var Cr=`geneseed-accent`,wr=[{id:`auto`,short:`Auto`,tagline:`Follows the deployed voice's accent.`},{id:`curated`,short:`Curated`,tagline:`Each theme's own signature colour.`}],Tr=new Set(wr.map(e=>e.id));function Er(){return hr(Cr,e=>e&&Tr.has(e)?e:`auto`)}var Dr=`geneseed-layout`,Or=[{id:`auto`,short:`Auto`,tagline:`Follows the theme.`},{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.`}],kr=new Set(Or.map(e=>e.id));function Ar(e){return e===`atlas`||e===`greenhouse`?`journal`:e===`cobalt`?`greenhouse`:e===`operator`?`operator`:`cultivar`}function jr(e,t){return t&&t!==`auto`&&kr.has(t)?t:Ar(e)}function Mr(){return hr(Dr,e=>e&&kr.has(e)?e:`auto`)}function Nr(e){let[t,n]=(0,a.useState)(null),[r,i]=(0,a.useState)(null),[o,s]=(0,a.useState)([]),c=()=>N.overview().then(e=>{n(e),i(null)}).catch(t=>{i(t?.body?.message||t?.message||String(t)),e?.(t)});return(0,a.useEffect)(()=>{c()},[]),(0,a.useEffect)(()=>{N.themes().then(e=>s(e.themes)).catch(()=>{})},[]),{overview:t,error:r,themes:o,reload:c}}var Pr=1e3;async function Fr(e=0){await new Promise(t=>setTimeout(t,e));for(let e=0;e<30;e++)try{await N.ping();break}catch{await new Promise(e=>setTimeout(e,Pr))}window.location.reload()}var Ir=600;function Lr({onFinish:e,onError:t}={}){let[n,r]=(0,a.useState)([]),[i,o]=(0,a.useState)(null),[s,c]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{N.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,a.useEffect)(()=>{if(!i)return;let t=n.find(e=>e.id===i)?.action===`update`,a=setInterval(async()=>{if(!document.hidden)try{let n=await N.job(i);if(r(e=>{let t=e.findIndex(e=>e.id===i);if(t===-1)return e;let r=e[t],a=n.output||``;if(r.output===a&&r.status===n.status&&r.duration===n.duration)return e;let o=e.slice();return o[t]={...r,output:a,status:n.status,duration:n.duration},o}),n.status!==`running`){if(clearInterval(a),o(null),t){Fr(2e3);return}e?.(n.status)}}catch{clearInterval(a),t&&Fr(0)}},Ir);return()=>clearInterval(a)},[i]),{runs:n,activeId:i,consoleOpen:s,setConsoleOpen:c,runAction:async(e,n)=>{try{let{job_id:t}=await N.action(e,n),i=e===`build`&&n?.theme?`build (${n.theme} · ${n.emit})`:e;return r(e=>[...e,{id:t,action:i,status:`running`,output:``,started:Date.now()/1e3}]),o(t),c(!0),t}catch(e){t?.(e)}},cancelJob:e=>N.cancelJob(e).catch(e=>t?.(e)),clearRuns:()=>r([])}}var Rr=new Map;function zr(e,t=[],n=null){let r=n===null?null:`${n}|${t.join(``)}`,[i,o]=(0,a.useState)(()=>r!==null&&Rr.has(r)?Rr.get(r):null),[s,c]=(0,a.useState)(``),[l,u]=(0,a.useState)(()=>!(r!==null&&Rr.has(r))),d=(0,a.useRef)(e),f=(0,a.useRef)(r);(0,a.useLayoutEffect)(()=>{d.current=e,f.current=r});let p=(0,a.useCallback)(()=>(u(!0),c(``),Promise.resolve(d.current()).then(e=>{f.current!==null&&Rr.set(f.current,e),o(e)}).catch(e=>c(e.message)).finally(()=>u(!1))),t);return(0,a.useEffect)(()=>{if(f.current!==null&&Rr.has(f.current)){o(Rr.get(f.current)),c(``),u(!1);return}p()},[p]),{data:i,error:s,loading:l,reload:p,setData:o}}var Br=60,Vr=3600,Hr=86400,Ur={seconds:90,minutes:5400,hours:36*Vr};function Wr(e){let t=Math.max(0,Date.now()/1e3-e);return t<Ur.seconds?`${Math.round(t)}s`:t<Ur.minutes?`${Math.round(t/Br)}m`:t<Ur.hours?`${Math.round(t/Vr)}h`:`${Math.round(t/Hr)}d`}function Gr(e){return e?e.replace(/\\/g,`/`).replace(/^\/?(home|Users)\/[^/]+/i,`~`).replace(/^[A-Z]:\/Users\/[^/]+/i,`~`):`~`}var Kr={deployed:.4,doctorClean:.25,doctorMinor:.15,doctorMinorMax:2,doctorFail:.05,versionSynced:.2,diskClean:.15};function qr(e,t){if(!e)return 0;let n=e.doctor?.problems?.length??99,r=e.doctor?.ok?Kr.doctorClean:n<=Kr.doctorMinorMax?Kr.doctorMinor:Kr.doctorFail,i=t&&t.installed_fp&&t.installed_fp===t.source_fp;return(e.deployed?Kr.deployed:0)+r+(i?Kr.versionSynced:0)+(e.diff&&e.diff.missing===0?Kr.diskClean:0)}var Jr=e=>Math.max(...dr.map(t=>e?.[t]??0),1),Yr=e=>(e?.edited??0)+(e?.added??0),Xr=e=>(e?.laws??0)+(e?.doctrines?.rules??0),Z=i(),Zr={dashboard:`M3 13h7V3H3v10Zm0 8h7v-6H3v6Zm11 0h7V11h-7v10Zm0-18v6h7V3h-7Z`,library:`M4 5h10v14H4zM16 7h4v12h-4M7 9h4M7 12h4`,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`,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,Z.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,Z.jsx)(`path`,{d:Zr[e]||``})})}function Qr({className:e=`sprout`}){return(0,Z.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,"aria-hidden":`true`,children:[(0,Z.jsx)(`path`,{d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,Z.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,Z.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,Z.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})}var $r=[{hash:`#/`,id:`dashboard`,label:`Dashboard`,icon:`dashboard`,match:e=>e.view===`dashboard`,tag:()=>`today`},{group:`Codex`},{hash:`#/laws`,id:`laws`,label:`Constitution`,icon:`law`,match:e=>e.view===`laws`||e.view===`section`&&e.section===`laws`||e.view===`item`&&e.type===`law`,tag:e=>e?.counts?.laws??null},{hash:`#/rules`,id:`rules`,label:`Rules`,icon:`rule`,match:e=>e.view===`rules`},{hash:`#/profile`,id:`profile`,label:`Profile`,icon:`profile`,match:e=>e.view===`profile`},{hash:`#/skills`,id:`skills`,label:`Skills`,icon:`skill`,match:e=>e.view===`skills`||e.view===`section`&&e.section===`skills`||e.view===`item`&&e.type===`skill`,tag:e=>e?.counts?.skills??null},{hash:`#/agents`,id:`agents`,label:`Agents`,icon:`agent`,match:e=>e.view===`agents`||e.view===`section`&&e.section===`agents`||e.view===`item`&&e.type===`agent`,tag:e=>e?.counts?.agents??null},{hash:`#/library`,id:`library`,label:`Library`,icon:`library`,match:e=>e.view===`library`||e.view===`section`&&![`laws`,`skills`,`agents`].includes(e.section)||e.view===`item`&&![`law`,`skill`,`agent`].includes(e.type),tag:e=>e?.counts?(e.counts.memory??0)+(e.counts.notebook??0)+(e.counts.wiki??0)+(e.counts.config??0):null},{hash:`#/docs`,id:`docs`,label:`Docs`,icon:`docs`,match:e=>e.view===`docs`},{group:`Care`},{hash:`#/activity`,id:`activity`,label:`Activity`,icon:`activity`,match:e=>e.view===`activity`||e.view===`activity-detail`},{hash:`#/diff`,id:`changes`,label:`Changes`,icon:`changes`,match:e=>e.view===`diff`,tag:e=>(e?.diff?Yr(e.diff):null)||null},{hash:`#/doctor`,id:`doctor`,label:`Doctor`,icon:`doctor`,match:e=>e.view===`doctor`,tag:e=>e?.doctor?e.doctor.ok?`clean`:e.doctor.problems.length:null,warn:e=>!!e?.doctor&&!e.doctor.ok},{group:`Setup`},{hash:`#/harness`,id:`harness`,label:`Harness`,icon:`layers`,match:e=>e.view===`harness`,tag:e=>e?.theme??null},{hash:`#/settings`,id:`settings`,label:`Settings`,icon:`settings`,match:e=>e.view===`settings`}];function ei({value:e}){let t=2*Math.PI*30;return(0,Z.jsxs)(`svg`,{className:`rv-ring`,width:`66`,height:`66`,viewBox:`0 0 72 72`,role:`img`,"aria-label":`Growth ${Math.round(e*100)} of 100`,children:[(0,Z.jsx)(`circle`,{cx:`36`,cy:`36`,r:30,fill:`none`,stroke:`var(--line-2)`,strokeWidth:`6`}),(0,Z.jsx)(`circle`,{cx:`36`,cy:`36`,r:30,fill:`none`,stroke:`var(--accent)`,strokeWidth:`6`,strokeLinecap:`round`,strokeDasharray:`${t*e} ${t}`,transform:`rotate(-90 36 36)`,style:{transition:`stroke-dasharray 1.1s cubic-bezier(.2,.7,.2,1)`}}),(0,Z.jsx)(`text`,{className:`rv-ring-num`,x:`36`,y:`34`,textAnchor:`middle`,children:Math.round(e*100)}),(0,Z.jsx)(`text`,{className:`rv-ring-lbl`,x:`36`,y:`47`,textAnchor:`middle`,children:`GROWTH`})]})}function ti({overview:e,setup:t}){if(!e)return null;let n=e.doctor?e.doctor.ok?`clean`:`${e.doctor.problems.length} to fix`:`—`;return(0,Z.jsxs)(`div`,{className:`rail-vitals`,children:[(0,Z.jsx)(ei,{value:qr(e,t)}),(0,Z.jsxs)(`div`,{className:`rv-rows`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`span`,{children:`Drift`}),(0,Z.jsx)(`b`,{children:Yr(e.diff)})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`span`,{children:`Doctor`}),(0,Z.jsx)(`b`,{children:n})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`span`,{children:`Built`}),(0,Z.jsx)(`b`,{className:`plain`,title:e.build_time||void 0,children:e.build_epoch?Wr(e.build_epoch):`never`})]})]})]})}function ni(e){let t=a.useRef(null);return(0,a.useEffect)(()=>e?.status!==`done`||!t.current||!qn()?void 0:Jn(Rn(t.current,{rotate:[{to:-14},{to:10},{to:-5},{to:0}],scale:[{to:1.14},{to:1}],duration:1100,ease:`inOutSine`}),1100),[e]),t}function ri({route:e,overview:t,setup:n,onOpenVoice:r,onNavigate:i,finish:a}){let o=Zn(`.rail-item.active`),s=ni(a);return(0,Z.jsxs)(`nav`,{className:`rail`,id:`rail-nav`,"aria-label":`Harness navigation`,tabIndex:-1,ref:o,children:[(0,Z.jsx)(`span`,{className:`glide`,"aria-hidden":`true`}),(0,Z.jsxs)(`button`,{className:`rail-brand`,onClick:()=>{nr(`#/`),i?.()},title:`Dashboard`,children:[(0,Z.jsx)(`span`,{className:`sprout-sway`,ref:s,children:(0,Z.jsx)(Qr,{})}),(0,Z.jsxs)(`div`,{className:`brand-text`,children:[(0,Z.jsxs)(`span`,{className:`brand-name`,children:[`Gene`,(0,Z.jsx)(`b`,{children:`seed`})]}),(0,Z.jsx)(`span`,{className:`brand-sub`,children:`harness console`})]})]}),(0,Z.jsx)(ti,{overview:t,setup:n}),$r.map((n,r)=>{if(n.group)return(0,Z.jsx)(`div`,{className:`rail-group`,children:n.group},`g`+r);let a=n.tag?n.tag(t):null,o=n.match(e),s=typeof n.warn==`function`?n.warn(t):!!n.warn;return(0,Z.jsx)(`div`,{className:`rail-nav`,children:(0,Z.jsxs)(`a`,{className:`rail-item ${o?`active`:``}`,href:n.hash,"aria-current":o?`page`:void 0,title:n.label,onClick:()=>i?.(),children:[(0,Z.jsx)(Q,{name:n.icon}),(0,Z.jsx)(`span`,{children:n.label}),a?(0,Z.jsx)(`span`,{className:`tag`,style:s?{color:`var(--warn)`}:null,children:a}):null]})},n.id)}),(0,Z.jsx)(`div`,{className:`rail-spacer`}),(0,Z.jsx)(`div`,{className:`rail-foot`,children:(0,Z.jsxs)(`button`,{className:`voice`,onClick:r,title:`Switch deployed voice`,children:[(0,Z.jsx)(`span`,{className:`voice-orb`}),(0,Z.jsxs)(`div`,{className:`voice-meta`,children:[(0,Z.jsx)(`div`,{className:`vk`,children:`deployed voice`}),(0,Z.jsx)(`div`,{className:`vv`,children:t?.theme||`—`})]}),(0,Z.jsx)(Q,{name:`chevron`,className:`chev glyph`})]})})]})}var ii=`geneseed-harness`,ai=[{id:`opencode`,label:`OpenCode`},{id:`claude`,label:`Claude Code`}];function oi(e=`opencode`){return hr(ii,t=>t===`claude`||t===`opencode`?t:e)}function si(e){let t=String(e||``);return/^(claude|bob|copilot|openclaude)/.test(t)?`claude`:`opencode`}function ci(e=0){let[t,n]=(0,a.useState)(null),[r,i]=(0,a.useState)(``),o=(0,a.useRef)(null),[s]=oi(),c=`${e}|${s}`,[l,u]=(0,a.useState)(c);return l!==c&&(u(c),n(null)),(0,a.useEffect)(()=>{o.current=null},[c]),{index:t,error:r,prime:(0,a.useCallback)(()=>{if(t||o.current)return o.current;let e=(async()=>{let e=[],t=[`laws`,`skills`,...dr],r=await Promise.all(t.map(async e=>{try{return{sec:e,items:(await N.catalog(e))?.items||[]}}catch{return{sec:e,items:[]}}}));for(let{sec:n,items:i}of r){let r=ur[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 N.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:`#/harness`})}}catch{}try{let t=await N.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||``}`.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])}}var li=24;function ui(e,t){let n=e.title.toLowerCase();return n.startsWith(t)?0:n.includes(t)?1:e.hay.includes(t)?2:-1}function di(e,t){let n=t.toLowerCase().trim();if(!n||!e)return[];let r=[];for(let t of e){let e=ui(t,n);e>=0&&r.push({e:t,s:e})}return r.sort((e,t)=>e.s-t.s||e.e.sortKey-t.e.sortKey||e.e.title.localeCompare(t.e.title)),r.slice(0,li).map(e=>e.e)}function fi(e,t){let n=t.trim().toLowerCase(),r=n?e.toLowerCase().indexOf(n):-1;return r<0?e:(0,Z.jsxs)(Z.Fragment,{children:[e.slice(0,r),(0,Z.jsx)(`mark`,{className:`spot-hit`,children:e.slice(r,r+n.length)}),e.slice(r+n.length)]})}function pi({query:e,index:t,loading:n,error:r,active:i,onActive:o,onClose:s}){let c=(0,a.useMemo)(()=>di(t,e),[t,e]),l=(0,a.useRef)(null),u=c.length>0;(0,a.useLayoutEffect)(()=>{let e=l.current?.querySelectorAll(`[data-spot-row]`);return!u||!e?.length||!qn()?void 0:Jn(Rn(e,{opacity:[0,1],translateY:[-4,0],duration:220,delay:Kn(18),ease:`outQuart`}),220+18*e.length)},[u]),(0,a.useEffect)(()=>{i>=c.length&&o(0)},[c,i,o]),(0,a.useEffect)(()=>{(l.current?.querySelector(`[data-spot-row="${i}"]`))?.scrollIntoView({block:`nearest`})},[i]);let d=e=>{e&&(nr(e.route),s())},f=[],p=null;return c.forEach((e,t)=>{(!p||p.kind!==e.kind)&&(p={kind:e.kind,rows:[]},f.push(p)),p.rows.push({entry:e,index:t})}),e.trim()?(0,Z.jsxs)(`div`,{className:`spotlight`,ref:l,id:`spotlight-list`,role:`listbox`,"aria-label":`Search results`,children:[r&&!t&&(0,Z.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`Could not load the search index — `,r]}),n&&!t&&!r&&(0,Z.jsx)(`div`,{className:`spot-empty`,role:`presentation`,children:`Loading…`}),!n&&c.length===0&&t&&(0,Z.jsxs)(`div`,{className:`spot-empty`,role:`presentation`,children:[`No matches for “`,e,`”.`]}),f.map(t=>(0,Z.jsxs)(`div`,{className:`spot-group`,role:`group`,"aria-label":t.kind,children:[(0,Z.jsx)(`div`,{className:`spot-group-head`,"aria-hidden":`true`,children:t.kind}),t.rows.map(({entry:t,index:n})=>(0,Z.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(),d(t)},onMouseEnter:()=>o(n),children:[(0,Z.jsx)(`div`,{className:`spot-title`,children:fi(t.title,e)}),t.desc?(0,Z.jsx)(`div`,{className:`spot-desc`,children:t.desc}):null]},`${t.route}-${n}`))]},t.kind))]}):null}function mi({value:e,onChange:t,dataRev:n}){let r=(0,a.useRef)(null),i=(0,a.useRef)(null),[o,s]=(0,a.useState)(!1),[c,l]=(0,a.useState)(0),{index:u,error:d,prime:f}=ci(n);(0,a.useEffect)(()=>{let e=e=>{((e.metaKey||e.ctrlKey)&&!e.altKey&&e.key.toLowerCase()===`k`||e.key===`/`&&!e.target.closest(`input, textarea, select`))&&(e.preventDefault(),r.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]),(0,a.useEffect)(()=>{if(!o)return;let e=e=>{i.current?.contains(e.target)||s(!1)};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[o]);let p=o&&!!e.trim(),m=p&&u?di(u,e):[],h=c<m.length?`spot-opt-${c}`:void 0;return(0,Z.jsxs)(`div`,{className:`tb-search`,ref:i,children:[(0,Z.jsx)(Q,{name:`search`,className:`mag glyph`}),(0,Z.jsx)(`input`,{ref:r,role:`combobox`,"aria-label":`Search the harness`,"aria-autocomplete":`list`,"aria-expanded":p,"aria-controls":p?`spotlight-list`:void 0,"aria-activedescendant":h,value:e,onChange:e=>{t(e.target.value),l(0)},onFocus:()=>{s(!0),f()},onKeyDown:n=>{if(p){if(n.key===`ArrowDown`)n.preventDefault(),l(e=>Math.min(e+1,Math.max(m.length-1,0)));else if(n.key===`ArrowUp`)n.preventDefault(),l(e=>Math.max(e-1,0));else if(n.key===`Enter`){let e=m[c];e&&(n.preventDefault(),nr(e.route),s(!1),r.current?.blur())}else n.key===`Escape`&&(n.preventDefault(),e?t(``):(s(!1),r.current?.blur()))}},placeholder:`Search the harness…`,title:`Press / to jump here, or Ctrl-K / ⌘K from inside any field`}),(0,Z.jsx)(`span`,{className:`kbd`,children:`/`}),(0,Z.jsx)(`span`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:p?m.length?`${m.length} results`:`no matches`:``}),p&&(0,Z.jsx)(pi,{query:e,index:u,loading:!u,error:d,active:c,onActive:l,onClose:()=>{s(!1),r.current?.blur()}})]})}function hi({dataRev:e,onSwitch:t}){let{data:n}=zr(()=>N.installs(),[e]),r=(n?.installs||[]).filter(e=>e.state===`active`);if(r.length<2)return null;let i=r.find(e=>e.selected)||r[0];return(0,Z.jsxs)(`div`,{className:`row gap-8`,style:{alignItems:`center`},title:`Harness the console is viewing`,children:[(0,Z.jsx)(`span`,{style:{fontSize:12,color:`var(--text-3)`},children:`harness`}),(0,Z.jsx)(`select`,{className:`sel`,"aria-label":`harness to view`,value:i.id,onChange:async e=>{let n=r.find(t=>t.id===e.target.value);if(n)try{await N.selectView(n.host,n.path),t?.()}catch{}},children:r.map(e=>(0,Z.jsxs)(`option`,{value:e.id,children:[e.host,` · `,e.scope]},e.id))})]})}var gi={dashboard:`overview`,diff:`diff`,doctor:`doctor`,harness:`harness`,settings:`settings`};function _i(e){return e.view===`section`?[`laws`,`skills`].includes(e.section)?e.section:`library`:e.view===`item`?e.type===`law`?`laws`:e.type===`skill`?`skills`:`library`:gi[e.view]||e.view}function vi({route:e,navOpen:t,onToggleNav:n,target:r,version:i,query:a,onQuery:o,mode:s,onToggleMode:c,onShutdown:l,dataRev:u,onSwitch:d}){return(0,Z.jsxs)(`header`,{className:`topbar`,children:[(0,Z.jsx)(`button`,{className:`tb-menu`,onClick:n,"aria-label":t?`Close navigation`:`Open navigation`,"aria-expanded":!!t,"aria-controls":`rail-nav`,children:(0,Z.jsx)(Q,{name:t?`x`:`menu`})}),(0,Z.jsxs)(`div`,{className:`prompt`,children:[(0,Z.jsx)(`span`,{className:`path`,children:Gr(r)}),(0,Z.jsx)(`span`,{className:`sep`,children:`$`}),(0,Z.jsx)(`span`,{className:`cmd`,children:`geneseed`}),` `,(0,Z.jsxs)(`span`,{className:`flag`,children:[`--tab=`,_i(e)]}),i&&(0,Z.jsxs)(`span`,{className:`flag ver`,children:[` --version=`,i]}),(0,Z.jsx)(`span`,{className:`cur`})]}),(0,Z.jsx)(`div`,{className:`topbar-spacer`}),(0,Z.jsx)(hi,{dataRev:u,onSwitch:d}),(0,Z.jsx)(mi,{value:a,onChange:o,dataRev:u}),(0,Z.jsx)(`button`,{className:`iconbtn`,title:s===`light`?`Switch to dark`:`Switch to light`,"aria-label":s===`light`?`Switch to dark mode`:`Switch to light mode`,onClick:c,children:(0,Z.jsx)(Q,{name:s===`light`?`moon`:`sun`})}),(0,Z.jsx)(`button`,{className:`iconbtn`,title:`Stop server`,"aria-label":`Stop server`,onClick:l,children:(0,Z.jsx)(Q,{name:`power`})})]})}function yi({themes:e,current:t,onPick:n,onClose:r}){let i=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let e=e=>{i.current&&!i.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,a.useEffect)(()=>{i.current?.querySelector(`button.pop-item`)?.focus()},[]),(0,Z.jsxs)(`div`,{className:`pop`,ref:i,role:`menu`,"aria-label":`Switch voice`,children:[(0,Z.jsx)(`div`,{className:`tick`,style:{padding:`4px 10px 8px`},children:`Switch voice`}),e.map(e=>(0,Z.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e.name===t,className:`pop-item ${e.name===t?`on`:``}`,onClick:()=>n(e.name),children:[(0,Z.jsx)(`span`,{className:`po`,style:{background:ar(e.accent),boxShadow:`0 0 8px ${ar(e.accent)}`}}),(0,Z.jsx)(`span`,{className:`pn`,children:e.name})]},e.name))]})}var bi=3500;function xi({toast:e,onClose:t}){return(0,a.useEffect)(()=>{let e=setTimeout(t,bi);return()=>clearTimeout(e)},[e]),(0,Z.jsxs)(`div`,{className:`toast ${e.kind}`,role:e.kind===`err`?`alert`:`status`,"aria-live":e.kind===`err`?void 0:`polite`,children:[(0,Z.jsx)(`div`,{children:e.msg}),(0,Z.jsx)(`div`,{style:{marginTop:8},children:(0,Z.jsx)(`button`,{className:`btn ghost`,onClick:t,children:`Dismiss`})})]})}function Si({runs:e,open:t,onToggle:n,onClear:r,onCancel:i,busy:o,finish:s}){let c=(0,a.useRef)(null),l=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=l.current;s&&e&&(e.classList.remove(`flash-ok`,`flash-bad`),e.offsetWidth,e.classList.add(s.status===`done`?`flash-ok`:`flash-bad`))},[s]);let u=e.length?e[e.length-1].output.length:0;return(0,a.useEffect)(()=>{let e=c.current;e&&t&&(e.scrollTop=e.scrollHeight)},[e.length,u,t]),(0,Z.jsxs)(`div`,{className:`console`,style:{height:`42vh`,transform:t?`none`:`translateY(calc(42vh - 42px))`},children:[(0,Z.jsxs)(`div`,{className:`console-head`,ref:l,onClick:n,onAnimationEnd:e=>{e.target===e.currentTarget&&e.currentTarget.classList.remove(`flash-ok`,`flash-bad`)},children:[o&&(0,Z.jsx)(`span`,{className:`console-progress`,"aria-hidden":`true`}),(0,Z.jsxs)(`span`,{className:`ttl`,children:[(0,Z.jsx)(`span`,{className:`live ${o?`on`:``}`}),`terminal`]}),(0,Z.jsx)(`span`,{className:`count`,children:e.length}),(0,Z.jsxs)(`div`,{className:`right`,onClick:e=>e.stopPropagation(),children:[(0,Z.jsx)(`button`,{className:`iconbtn`,title:`Clear`,"aria-label":`Clear run history`,onClick:r,disabled:!e.length,children:(0,Z.jsx)(Q,{name:`clear`})}),(0,Z.jsx)(`button`,{className:`iconbtn`,title:t?`Collapse`:`Expand`,"aria-label":t?`Collapse console`:`Expand console`,"aria-expanded":t,onClick:n,children:(0,Z.jsx)(Q,{name:`chevron`,className:`glyph`,style:{transform:t?`rotate(90deg)`:`rotate(-90deg)`}})})]})]}),t&&(0,Z.jsxs)(`div`,{className:`console-body`,ref:c,children:[e.length===0&&(0,Z.jsx)(`div`,{className:`console-empty`,children:`No commands run yet. Actions you trigger stream here.`}),e.map(e=>(0,Z.jsxs)(`div`,{className:`run`,children:[(0,Z.jsxs)(`div`,{className:`run-head`,children:[(0,Z.jsx)(`span`,{className:`pr`,children:`$`}),(0,Z.jsx)(`span`,{className:`act`,children:e.action}),(0,Z.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,Z.jsx)(`button`,{className:`iconbtn run-cancel`,title:`Cancel this run`,"aria-label":`Cancel the ${e.action} run`,onClick:()=>i(e.id),children:(0,Z.jsx)(Q,{name:`x`})})]}),e.output&&(0,Z.jsx)(`pre`,{className:`run-out`,children:e.output})]},e.id))]})]})}var Ci=550,wi=`gs-splash-seen`;function Ti(){try{if(window.localStorage.getItem(wi))return 0;window.localStorage.setItem(wi,`1`)}catch{}return Ci}function Ei({ready:e,onDone:t}){let[n,r]=(0,a.useState)(!1),[i,o]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=setTimeout(()=>r(!0),Ti());return()=>clearTimeout(e)},[]),e&&n&&!i&&o(!0),(0,a.useEffect)(()=>{if(!i)return;let e=setTimeout(()=>t?.(),700);return()=>clearTimeout(e)},[i]),(0,Z.jsxs)(`div`,{className:`boot-splash${i?` fading`:``}`,"aria-hidden":`true`,onAnimationEnd:e=>{e.animationName===`splashOut`&&t?.()},children:[(0,Z.jsxs)(`div`,{className:`boot-dial`,children:[(0,Z.jsxs)(`svg`,{className:`boot-ring`,viewBox:`0 0 172 172`,children:[(0,Z.jsx)(`circle`,{cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--surface-3)`,strokeWidth:`9`}),(0,Z.jsx)(`circle`,{cx:`86`,cy:`86`,r:`50`,fill:`none`,stroke:`var(--line-2)`,strokeWidth:`8`,strokeDasharray:`1.2 5.3`,opacity:`.7`}),(0,Z.jsx)(`circle`,{className:`boot-progress`,cx:`86`,cy:`86`,r:`72`,fill:`none`,stroke:`var(--accent)`,strokeWidth:`9`,strokeLinecap:`round`})]}),(0,Z.jsxs)(`svg`,{className:`boot-sprout`,viewBox:`0 0 24 24`,children:[(0,Z.jsx)(`path`,{className:`bs-stem`,d:`M12 21.5v-9`,stroke:`var(--accent)`,strokeWidth:`2`,strokeLinecap:`round`,fill:`none`}),(0,Z.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,Z.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,Z.jsx)(`circle`,{cx:`12`,cy:`12.4`,r:`1.1`,fill:`var(--bg)`})]})]}),(0,Z.jsxs)(`div`,{className:`boot-status`,children:[(0,Z.jsx)(`span`,{children:`germinating harness`}),(0,Z.jsx)(`span`,{className:`boot-caret`})]})]})}function Di({label:e=`Loading…`}){return(0,Z.jsxs)(`div`,{className:`loading`,role:`status`,children:[e,(0,Z.jsxs)(`div`,{className:`skel`,"aria-hidden":`true`,children:[(0,Z.jsx)(`div`,{className:`skel-bar`}),(0,Z.jsx)(`div`,{className:`skel-bar`}),(0,Z.jsx)(`div`,{className:`skel-bar`})]})]})}function Oi({open:e,title:t,children:n,confirmLabel:r,onConfirm:i,onClose:o}){let s=(0,a.useRef)(null);return(0,a.useEffect)(()=>{let t=s.current;t&&(e&&!t.open&&(typeof t.showModal==`function`?t.showModal():t.setAttribute(`open`,``)),!e&&t.open&&t.close())},[e]),(0,Z.jsxs)(`dialog`,{ref:s,className:`confirm`,onCancel:o,onClose:o,children:[(0,Z.jsx)(`h3`,{className:`confirm-title`,children:t}),(0,Z.jsx)(`div`,{className:`confirm-body`,children:n}),(0,Z.jsxs)(`div`,{className:`confirm-actions`,children:[(0,Z.jsx)(`button`,{type:`button`,className:`btn ghost`,onClick:o,children:`Cancel`}),(0,Z.jsx)(`button`,{type:`button`,className:`btn`,onClick:i,autoFocus:!0,children:r||`Confirm`})]})]})}var ki={neutral:`Loaded & ready`,imperial:`The Codex in force`,military:`The unit stands ready`,cyberpunk:`Jacked in`,wizard:`Wards in place`,pirate:`The crew stands ready`,gamer:`Game loaded`,sports:`The squad takes the field`,biker:`The crew rolls out`,commentator:`Lights out, away we go`,verstappen:`Setup's in`,joker:`Mic check`,mean:`Rules are up`,marvin:`Online. Reluctantly.`},Ai=e=>e.deployed?ki[e.theme]||`Loaded & ready`:`Not deployed`;function ji({value:e,size:t=232}){let n=Yn(e,1100)??0,r=t/2-14,i=2*Math.PI*r,a=i*(1-n);return(0,Z.jsxs)(`div`,{className:`ring-wrap`,style:{width:t,height:t},children:[(0,Z.jsxs)(`svg`,{viewBox:`0 0 ${t} ${t}`,children:[(0,Z.jsx)(`circle`,{cx:t/2,cy:t/2,r,fill:`none`,stroke:`var(--surface-3)`,strokeWidth:`10`}),(0,Z.jsx)(`circle`,{cx:t/2,cy:t/2,r,fill:`none`,stroke:`var(--accent)`,strokeWidth:`10`,strokeLinecap:`round`,strokeDasharray:i,strokeDashoffset:a}),Array.from({length:48}).map((e,i)=>{let a=i/48*2*Math.PI,o=r-18,s=r-24,c=t/2+Math.cos(a)*o,l=t/2+Math.sin(a)*o,u=t/2+Math.cos(a)*s,d=t/2+Math.sin(a)*s;return(0,Z.jsx)(`line`,{x1:c,y1:l,x2:u,y2:d,stroke:`var(--line-2)`,strokeWidth:`1`,opacity:i/48<n?.9:.25},i)})]}),(0,Z.jsxs)(`div`,{className:`ring-center`,children:[(0,Z.jsxs)(`div`,{className:`pct`,children:[Math.round(n*100),(0,Z.jsx)(`span`,{style:{fontSize:20,color:`var(--text-3)`},children:`%`})]}),(0,Z.jsx)(`div`,{className:`lbl`,children:`germination`})]})]})}function Mi({overview:e}){let t=Yr(e.diff),n=e.counts||{};return(0,Z.jsxs)(`div`,{className:`card kpiband rise mb-16`,children:[[{key:`agents`,label:`Agents`,hash:`#/agents`},{key:`skills`,label:`Skills`,hash:`#/skills`},{key:`laws`,label:`Invariants`,hash:`#/laws`}].map(e=>{let t=n[e.key];return(0,Z.jsxs)(`a`,{className:`kseg`,href:e.hash,title:`Open ${e.label}`,children:[(0,Z.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:t==null?`—`:(0,Z.jsx)(Xn,{value:t})}),(0,Z.jsx)(`span`,{className:`kseg-l`,children:e.label})]},e.key)}),(0,Z.jsx)(`div`,{className:`kseg-spacer`}),(0,Z.jsxs)(`button`,{className:`kseg`+(t>0?` hot`:``),onClick:()=>nr(`#/diff`),title:`Open changes`,children:[(0,Z.jsx)(`span`,{className:`kseg-n`+(t===0?` zero`:``),children:(0,Z.jsx)(Xn,{value:t})}),(0,Z.jsx)(`span`,{className:`kseg-l`,children:`Local edits`}),t>0&&(0,Z.jsx)(`span`,{className:`delta up`,children:`▲`})]})]})}function Ni({overview:e}){return(0,Z.jsx)(`div`,{className:`genome`,children:dr.map((t,n)=>{let r=ur[t],i=e.counts?.[t];return(0,Z.jsxs)(`div`,{className:`card gcell rise`,style:{"--i":n},onClick:()=>nr(`#/section/`+t),children:[(0,Z.jsxs)(`div`,{className:`gtop`,children:[(0,Z.jsx)(`span`,{className:`gname`,children:r.label}),(0,Z.jsx)(Q,{name:r.icon,className:`gicon`})]}),(0,Z.jsx)(`div`,{className:`gcount`+(i===0?` zero`:``),children:i==null?`—`:(0,Z.jsx)(Xn,{value:i})}),(0,Z.jsx)(`div`,{className:`gdesc`,children:r.desc})]},t)})})}function Pi({jobs:e}){if(!e||e.length===0)return(0,Z.jsx)(`div`,{className:`feed`,children:(0,Z.jsxs)(`div`,{className:`empty`,children:[(0,Z.jsx)(`div`,{className:`big`,children:`No activity yet`}),`Actions you run appear here.`]})});let t={done:`ok`,running:`acc`,failed:`bad`},n=[...e].sort((e,t)=>t.started-e.started).slice(0,8);return(0,Z.jsx)(`div`,{className:`feed`,children:n.map(e=>(0,Z.jsxs)(`div`,{className:`feed-row`,children:[(0,Z.jsx)(`span`,{className:`feed-dot ${t[e.status]||`ok`}`}),(0,Z.jsx)(`span`,{className:`feed-txt`,children:(0,Z.jsx)(`b`,{children:e.action})}),(0,Z.jsxs)(`span`,{className:`feed-when`,children:[Wr(e.started),` ago`]})]},e.id))})}function Fi({overview:e,sigil:t,setup:n,jobs:r,onAction:i}){let a=Ai(e),o=qr(e,n);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`card pad-lg rise mb-16`,children:(0,Z.jsxs)(`div`,{className:`hero`,children:[(0,Z.jsx)(ji,{value:o}),(0,Z.jsxs)(`div`,{className:`hero-facts`,children:[(0,Z.jsx)(`div`,{className:`ttl`,children:a}),t&&(0,Z.jsxs)(`div`,{className:`voice-readout`,children:[(0,Z.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,Z.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,Z.jsxs)(`p`,{className:`sub`,children:[`One source rendered into `,(0,Z.jsx)(`code`,{children:e.target}),`. Every repo on this machine inherits it.`]}),(0,Z.jsxs)(`div`,{className:`hero-chips`,children:[(0,Z.jsxs)(`span`,{className:`chip`,children:[(0,Z.jsx)(`span`,{className:`ck`,children:`voice`}),(0,Z.jsx)(`span`,{className:`cv`,style:{textTransform:`capitalize`},children:e.theme})]}),(0,Z.jsxs)(`span`,{className:`chip`,children:[(0,Z.jsx)(`span`,{className:`ck`,children:`mode`}),(0,Z.jsx)(`span`,{className:`cv`,children:e.emit})]}),(0,Z.jsxs)(`span`,{className:`chip`,children:[(0,Z.jsx)(`span`,{className:`ck`,children:`footprint`}),(0,Z.jsx)(`span`,{className:`cv`,children:e.footprint})]}),(0,Z.jsxs)(`span`,{className:`chip`,children:[(0,Z.jsx)(`span`,{className:`ck`,children:`built`}),(0,Z.jsx)(`span`,{className:`cv`,children:e.build_time||`unknown`})]}),(0,Z.jsxs)(`span`,{className:`chip`,children:[(0,Z.jsx)(`span`,{className:`ck`,children:`fp`}),(0,Z.jsx)(`span`,{className:`cv`,children:n?.installed_fp||`—`})]})]}),(0,Z.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,Z.jsxs)(`button`,{className:`btn`,onClick:()=>i(`update`),children:[(0,Z.jsx)(Q,{name:`refresh`}),`Update`]}),(0,Z.jsxs)(`button`,{className:`btn ghost`,onClick:()=>i(`build-all`),children:[(0,Z.jsx)(Q,{name:`build`}),`Rebuild`]}),(0,Z.jsxs)(`button`,{className:`btn ghost`,onClick:()=>i(`doctor`),children:[(0,Z.jsx)(Q,{name:`doctor`}),`Run doctor`]})]})]})]})}),(0,Z.jsx)(Mi,{overview:e}),(0,Z.jsxs)(`div`,{className:`grid split-status`,children:[(0,Z.jsxs)(`div`,{className:`card pad-lg`,children:[(0,Z.jsxs)(`div`,{className:`card-head`,children:[(0,Z.jsx)(`h3`,{children:`Capability genome`}),(0,Z.jsx)(`div`,{className:`right`,children:(0,Z.jsxs)(`span`,{className:`tick`,children:[dr.length,` sections`]})})]}),(0,Z.jsx)(Ni,{overview:e})]}),(0,Z.jsxs)(`div`,{className:`card pad-lg`,children:[(0,Z.jsxs)(`div`,{className:`card-head`,children:[(0,Z.jsx)(`h3`,{children:`Recent activity`}),(0,Z.jsx)(`div`,{className:`right`,children:(0,Z.jsxs)(`span`,{className:`badge acc`,children:[(0,Z.jsx)(`span`,{className:`dot`}),`live`]})})]}),(0,Z.jsx)(Pi,{jobs:r})]})]})]})}function Ii({k:e,overview:t,max:n}){let r=ur[e],i=t.counts?.[e]??0;return(0,Z.jsxs)(`div`,{className:`strand`,onClick:()=>nr(`#/section/`+e),children:[(0,Z.jsxs)(`span`,{className:`strand-name`,children:[(0,Z.jsx)(`span`,{className:`strand-dot`}),(0,Z.jsx)(`a`,{href:`#/section/`+e,className:`strand-link`,onClick:e=>e.stopPropagation(),children:r.label})]}),(0,Z.jsx)(`div`,{className:`hbar`,children:(0,Z.jsx)(`i`,{style:{width:`${i/n*100}%`}})}),(0,Z.jsx)(`span`,{className:`strand-val`,children:i})]})}function Li({overview:e,sigil:t,setup:n,jobs:r}){let i=Jr(e.counts),a=n?.version_verdict||``,o=a.includes(`up to date`),s=Yr(e.diff),c=[[`Source`,`src/, the canonical genetic material`,n?.source_fp||`—`,!0],[`Render`,`geneseed build → ${e.emit}`,e.theme+` voice`,!0],[`Deployed`,e.target,`inherited by every repo`,!1]];return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`mb-16`,children:(0,Z.jsxs)(`div`,{className:`card pad-lg rise`,style:{position:`relative`,overflow:`hidden`},children:[(0,Z.jsx)(`h2`,{className:`h`,style:{fontSize:22,margin:`0 0 18px`},children:`Gene-seed lineage`}),(0,Z.jsxs)(`div`,{className:`lineage-track`,children:[(0,Z.jsx)(`div`,{className:`spine`}),c.map(([e,t,n,r],i)=>(0,Z.jsxs)(`div`,{className:`lineage-step`,children:[(0,Z.jsx)(`span`,{className:`node ${r?`on`:``}`}),(0,Z.jsx)(`div`,{className:`lt`,children:e}),(0,Z.jsx)(`div`,{className:`ld`,children:t}),(0,Z.jsx)(`div`,{className:`ltag`,children:n})]},i))]}),(0,Z.jsx)(`hr`,{className:`hr`}),t&&(0,Z.jsxs)(`div`,{className:`voice-readout`,style:{marginBottom:14},children:[(0,Z.jsx)(`span`,{className:`vr-cur`,children:`▕`}),(0,Z.jsx)(`span`,{className:`vr-txt`,children:t})]},e.theme),(0,Z.jsxs)(`div`,{className:`row wrap gap-10`,children:[(0,Z.jsxs)(`span`,{className:`badge ${o?`ok`:`warn`}`,children:[(0,Z.jsx)(`span`,{className:`dot`}),`in sync · `,a]}),(0,Z.jsxs)(`span`,{className:`badge`,children:[(0,Z.jsx)(`span`,{className:`dot`}),s,` local edits`]})]})]})}),(0,Z.jsxs)(`div`,{className:`grid split-even`,children:[(0,Z.jsxs)(`div`,{className:`card pad-lg`,children:[(0,Z.jsxs)(`div`,{className:`card-head`,children:[(0,Z.jsx)(`h3`,{children:`Genome strand`}),(0,Z.jsx)(`div`,{className:`right`,children:(0,Z.jsx)(`span`,{className:`tick`,children:`by volume`})})]}),dr.map(t=>(0,Z.jsx)(Ii,{k:t,overview:e,max:i},t))]}),(0,Z.jsxs)(`div`,{className:`card pad-lg`,children:[(0,Z.jsx)(`div`,{className:`card-head`,children:(0,Z.jsx)(`h3`,{children:`Recent activity`})}),(0,Z.jsx)(Pi,{jobs:r})]})]})]})}function Ri({overview:e,setup:t,jobs:n}){let r=dr.reduce((t,n)=>t+(e.counts?.[n]??0),0),i=Jr(e.counts),a=e.doctor?.ok,o=e.doctor?.problems?.length??0,s=Yr(e.diff);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`div`,{className:`card pad-md rise mb-16`,children:(0,Z.jsx)(`div`,{className:`row wrap between gap-16`,children:(0,Z.jsxs)(`div`,{className:`row`,style:{gap:20,flexWrap:`wrap`},children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`tick`,children:`status`}),(0,Z.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:(0,Z.jsxs)(`span`,{className:`badge ${e.deployed?`ok`:`warn`}`,children:[(0,Z.jsx)(`span`,{className:`dot`}),e.deployed?`deployed`:`not deployed`]})})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`tick`,children:`voice`}),(0,Z.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6,textTransform:`capitalize`},children:e.theme})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`tick`,children:`mode`}),(0,Z.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6},children:e.emit})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`tick`,children:`fingerprint`}),(0,Z.jsx)(`div`,{className:`mono`,style:{fontSize:14,marginTop:6,color:`var(--accent)`},children:t?.installed_fp||`—`})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`tick`,children:`doctor`}),(0,Z.jsx)(`div`,{className:`row`,style:{gap:8,marginTop:4},children:a?(0,Z.jsxs)(`span`,{className:`badge ok`,children:[(0,Z.jsx)(`span`,{className:`dot`}),`clean`]}):(0,Z.jsxs)(`span`,{className:`badge warn`,children:[(0,Z.jsx)(`span`,{className:`dot`}),o,` issue`,o===1?``:`s`]})})]}),(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`div`,{className:`tick`,children:`edits`}),(0,Z.jsx)(`div`,{className:`metric`,style:{fontSize:18,marginTop:6},children:s})]})]})})}),(0,Z.jsxs)(`div`,{className:`grid split-operator`,children:[(0,Z.jsxs)(`div`,{className:`card rise`,style:{"--i":1},children:[(0,Z.jsxs)(`div`,{className:`card-head pad-lg`,style:{padding:`18px 20px 0`,marginBottom:14},children:[(0,Z.jsx)(`h3`,{children:`Sections`}),(0,Z.jsx)(`div`,{className:`right`,children:(0,Z.jsxs)(`span`,{className:`tick`,children:[r,` entries total`]})})]}),(0,Z.jsxs)(`table`,{className:`tbl`,children:[(0,Z.jsx)(`thead`,{children:(0,Z.jsxs)(`tr`,{children:[(0,Z.jsx)(`th`,{children:`Section`}),(0,Z.jsx)(`th`,{children:`Detail`}),(0,Z.jsx)(`th`,{style:{width:130},children:`Share`}),(0,Z.jsx)(`th`,{className:`num`,children:`Count`})]})}),(0,Z.jsx)(`tbody`,{children:dr.map(t=>{let n=ur[t],r=e.counts?.[t]??0;return(0,Z.jsxs)(`tr`,{className:`clickable`,onClick:()=>nr(`#/section/`+t),children:[(0,Z.jsx)(`td`,{className:`name`,children:(0,Z.jsx)(`a`,{href:`#/section/`+t,onClick:e=>e.stopPropagation(),children:n.label})}),(0,Z.jsx)(`td`,{className:`muted`,children:n.desc}),(0,Z.jsx)(`td`,{children:(0,Z.jsx)(`div`,{className:`hbar`,children:(0,Z.jsx)(`i`,{style:{width:`${r/i*100}%`}})})}),(0,Z.jsx)(`td`,{className:`num`,children:r})]},t)})})]})]}),(0,Z.jsxs)(`div`,{className:`card pad-lg rise`,style:{"--i":2},children:[(0,Z.jsx)(`div`,{className:`card-head`,children:(0,Z.jsx)(`h3`,{children:`Run log`})}),(0,Z.jsx)(Pi,{jobs:n})]})]})]})}function zi({error:e,style:t}){return e?(0,Z.jsx)(`p`,{className:`badge bad`,style:t,children:e}):null}function Bi({onAction:e}){let{data:t,error:n}=zr(()=>N.themes(),[]),[r,i]=(0,a.useState)(``),[o,s]=(0,a.useState)(``);if(n)return(0,Z.jsx)(zi,{error:n});if(!t)return(0,Z.jsx)(Di,{});let c=r||t.current?.theme||`neutral`,l=t.emits?.some(e=>e.name===`opencode-global`),u=o||(l?`opencode-global`:t.current?.emit||t.emits?.[0]?.name||``),d=i,f=s;return(0,Z.jsxs)(`div`,{className:`narrow-lg`,children:[(0,Z.jsx)(`div`,{className:`head-row mb-18`,children:(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h1`,{className:`h`,children:`Deploy your harness`}),(0,Z.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,Z.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,Z.jsx)(`div`,{className:`card-head`,children:(0,Z.jsx)(`h3`,{children:`1 · Choose a voice`})}),(0,Z.jsx)(`div`,{className:`row wrap gap-10`,children:t.themes.map(e=>(0,Z.jsxs)(`button`,{className:`btn ${e.name===c?`soft`:`ghost`}`,onClick:()=>d(e.name),title:e.blurb||e.tagline||e.name,children:[(0,Z.jsx)(`span`,{className:`po`,style:{width:10,height:10,borderRadius:`50%`,background:ar(e.accent),boxShadow:`0 0 8px ${ar(e.accent)}`}}),(0,Z.jsx)(`span`,{style:{textTransform:`capitalize`},children:e.name})]},e.name))})]}),(0,Z.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,Z.jsx)(`div`,{className:`card-head`,children:(0,Z.jsx)(`h3`,{children:`2 · Install mode`})}),(0,Z.jsxs)(`p`,{className:`sub mb-16`,children:[(0,Z.jsx)(`code`,{children:`opencode-global`}),` deploys once to your global config so every repo on this machine inherits the harness (recommended). Other modes render into a chosen directory.`]}),(0,Z.jsxs)(`label`,{className:`stack`,style:{gap:6,maxWidth:360},children:[(0,Z.jsx)(`span`,{className:`tick`,children:`Mode`}),(0,Z.jsx)(`select`,{className:`sel`,value:u,onChange:e=>f(e.target.value),children:t.emits.map(e=>(0,Z.jsxs)(`option`,{value:e.name,children:[e.name,e.desc?` · ${e.desc}`:``]},e.name))})]})]}),(0,Z.jsxs)(`button`,{className:`btn btn-grid`,disabled:!c||!u,onClick:()=>e(`build`,{theme:c,emit:u}),children:[(0,Z.jsx)(Q,{name:`build`}),`Deploy harness`]})]})}function Vi({children:e,...t}){let n=Zn(`button.on`);return(0,Z.jsxs)(`div`,{className:`seg`,role:`group`,ref:n,...t,children:[(0,Z.jsx)(`span`,{className:`glide`,"aria-hidden":`true`}),e]})}var Hi=`modulepreload`,Ui=function(e){return`/`+e},Wi={},$=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),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?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Ui(t,n),t=s(t),t in Wi)return;Wi[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Hi,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}).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)})},Gi=(0,a.lazy)(()=>$(()=>import(`./GreenhouseView-XxrAdriX.js`),__vite__mapDeps([0,1,2,3,4]))),Ki=(0,a.lazy)(()=>$(()=>import(`./OperatorHudView-BMRY1Tt4.js`),__vite__mapDeps([5,1,2,4]))),qi=(0,a.lazy)(()=>$(()=>import(`./JournalView-BcuyeEaR.js`),__vite__mapDeps([6,1,2,3,7])));function Ji({overview:e,overviewError:t,onRetry:n,themes:r,setup:i,runs:o,onAction:s,flavour:c=`a`,layout:l=`auto`,dataRev:u}){let d=jr(c,l),[f,p]=(0,a.useState)(`status`),[m,h]=(0,a.useState)(null),[g,_]=(0,a.useState)(null),v=e&&r.find(t=>t.name===e.theme)?.sigil||``;return(0,a.useEffect)(()=>{let e=!0;return(d===`greenhouse`||d===`operator`)&&N.doctor().then(t=>e&&h(t)).catch(()=>{}),d===`journal`&&N.recent().then(t=>e&&_(t)).catch(()=>{}),()=>{e=!1}},[d,u]),e?e.deployed?f===`status`&&d===`journal`?(0,Z.jsx)(a.Suspense,{fallback:(0,Z.jsx)(Di,{}),children:(0,Z.jsx)(qi,{overview:e,recent:g,onAction:s,onDirection:p})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`div`,{className:`head-row`,children:[(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(`h1`,{className:`h`,children:`Harness console`}),(0,Z.jsx)(`p`,{className:`sub`,children:`A live readout of the harness this machine carries. Its voice, its capabilities, its drift from source.`})]}),(0,Z.jsx)(Vi,{"aria-label":`Dashboard view`,children:[[`status`,`Status`],[`lineage`,`Lineage`],[`operator`,`Operator`]].map(([e,t])=>(0,Z.jsx)(`button`,{className:f===e?`on`:``,onClick:()=>p(e),"aria-pressed":f===e,children:t},e))})]}),(0,Z.jsxs)(`div`,{className:`view-in`,children:[f===`status`&&d===`cultivar`&&(0,Z.jsx)(Fi,{overview:e,sigil:v,setup:i,jobs:o,onAction:s}),f===`status`&&d===`greenhouse`&&(0,Z.jsx)(a.Suspense,{fallback:(0,Z.jsx)(Di,{}),children:(0,Z.jsx)(Gi,{overview:e,sigil:v,jobs:o,doctor:m,onAction:s})}),f===`status`&&d===`operator`&&(0,Z.jsx)(a.Suspense,{fallback:(0,Z.jsx)(Di,{}),children:(0,Z.jsx)(Ki,{overview:e,jobs:o,doctor:m,onAction:s})}),f===`lineage`&&(0,Z.jsx)(Li,{overview:e,sigil:v,setup:i,jobs:o}),f===`operator`&&(0,Z.jsx)(Ri,{overview:e,setup:i,jobs:o})]},f)]}):(0,Z.jsx)(Bi,{onAction:s}):t?(0,Z.jsxs)(`div`,{children:[(0,Z.jsx)(zi,{error:`Could not load the harness overview: ${t}`}),(0,Z.jsx)(`button`,{className:`btn`,onClick:n,children:`Retry`})]}):(0,Z.jsx)(Di,{})}var Yi=(0,a.lazy)(()=>$(()=>import(`./Activity-CH-7cPIM.js`),__vite__mapDeps([8,1,2,9]))),Xi=(0,a.lazy)(()=>$(()=>import(`./ActivityDetail-DZvz0xS5.js`),__vite__mapDeps([10,1,2,9]))),Zi=(0,a.lazy)(()=>$(()=>import(`./Library-CA9IHghn.js`),__vite__mapDeps([11,1,2,12,13,14]))),Qi=(0,a.lazy)(()=>$(()=>import(`./Laws-CWHrTKY4.js`),__vite__mapDeps([15,1,2,7,16,13]))),$i=(0,a.lazy)(()=>$(()=>import(`./Rules-BEXvY4Tx.js`),__vite__mapDeps([17,1,2]))),ea=(0,a.lazy)(()=>$(()=>import(`./Profile-wceET1JY.js`),__vite__mapDeps([18,1,2,12]))),ta=(0,a.lazy)(()=>$(()=>import(`./Skills-DahlOJuI.js`),__vite__mapDeps([19,1,2,7,12,16,13,14]))),na=(0,a.lazy)(()=>$(()=>import(`./Diff-DvwdG0L9.js`),__vite__mapDeps([20,1,2]))),ra=(0,a.lazy)(()=>$(()=>import(`./Doctor-OTmwmYZg.js`),__vite__mapDeps([21,1,2]))),ia=(0,a.lazy)(()=>$(()=>import(`./Settings-DS2zF0Ez.js`),__vite__mapDeps([22,1,2]))),aa=(0,a.lazy)(()=>$(()=>import(`./Harness-C_LYNk5c.js`),__vite__mapDeps([23,1,2]))),oa=(0,a.lazy)(()=>$(()=>import(`./Docs-DrJNDPwI.js`),__vite__mapDeps([24,1,2,12])));function sa(){let e=tr(),t=e.view===`section`,n=e.view===`item`,r=e.view===`laws`||t&&e.section===`laws`||n&&e.type===`law`,i=e.view===`skills`||t&&e.section===`skills`||n&&e.type===`skill`,s=e.view===`library`||e.view===`agents`||(t||n)&&!r&&!i,c=e.view===`agents`?`agents`:t?e.section:n?mr[e.type]||e.type:void 0,l=n?e.name:void 0,[u,d]=(0,a.useState)(``),[f,p]=(0,a.useState)(null),[m,h]=(0,a.useState)(!1),[g,_]=(0,a.useState)(!1),[v,y]=_r(),[b,x]=Sr(),S=e=>{if(!document.startViewTransition||!qn())return x(e);document.startViewTransition(()=>(0,o.flushSync)(()=>x(e)))},[C,ee]=Er(),[te,w]=Mr(),[ne,T]=(0,a.useState)(()=>{try{return!window.sessionStorage.getItem(`gs-booted`)}catch{return!0}}),[E,D]=(0,a.useState)(!1),O=(0,a.useRef)(null),k=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(!E)return;let e=e=>{e.key===`Escape`&&D(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[E]),(0,a.useEffect)(()=>{if(!E)return;let e=k.current,t=document.activeElement;return e&&(e.inert=!0),document.getElementById(`rail-nav`)?.focus(),()=>{e&&(e.inert=!1),t instanceof HTMLElement&&t.focus()}},[E]);let A=e=>p({kind:e?.body?.kind||`err`,msg:e?.body?.message||e.message}),{overview:j,error:re,themes:ie,reload:ae}=Nr(A),[M,oe]=(0,a.useState)(0),se=()=>{ae(),oe(e=>e+1)},[ce,P]=(0,a.useState)(null),{runs:le,activeId:F,consoleOpen:I,setConsoleOpen:L,runAction:R,cancelJob:z,clearRuns:ue}=Lr({onFinish:e=>{se(),P({status:e,at:Date.now()})},onError:A}),{data:de}=zr(()=>N.setup().catch(()=>null),[M],`setup`),fe=le[le.length-1],pe=fe?fe.status===`running`?`${fe.action} running`:`${fe.action} ${fe.status}`:``;(0,a.useEffect)(()=>{let e=O.current;e&&(C===`curated`&&lr(e,b,v)||j?.accent&&sr(e,j.accent,v))},[j,v,C,b]);let[B,V]=(0,a.useState)(!1);return g?(0,Z.jsxs)(`div`,{className:`app fl-${b} ${v===`light`?`light`:``}`,ref:O,children:[(0,Z.jsx)(`div`,{className:`atmos`,"aria-hidden":`true`}),(0,Z.jsx)(`div`,{className:`page`,style:{display:`grid`,placeItems:`center`},children:(0,Z.jsxs)(`p`,{className:`sub`,style:{textAlign:`center`,maxWidth:480},children:[`Server stopped. You can close this tab and reopen any time with`,` `,(0,Z.jsx)(`code`,{children:`geneseed web`}),`.`]})})]}):(0,Z.jsxs)(`div`,{className:`app fl-${b} ${v===`light`?`light`:``}${E?` nav-open`:``}`,ref:O,children:[(0,Z.jsx)(`div`,{className:`atmos`,"aria-hidden":`true`}),(0,Z.jsx)(`a`,{className:`skip-link`,href:`#main`,children:`Skip to content`}),(0,Z.jsx)(`p`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:pe}),E&&(0,Z.jsx)(`button`,{type:`button`,className:`nav-scrim`,"aria-label":`Close navigation`,onClick:()=>D(!1)}),(0,Z.jsx)(ri,{route:e,overview:j,setup:de,onOpenVoice:()=>h(e=>!e),onNavigate:()=>D(!1),finish:ce}),m&&(0,Z.jsx)(yi,{themes:ie,current:j?.theme,onPick:e=>{h(!1),R(`build`,{theme:e,emit:j?.emit})},onClose:()=>h(!1)}),(0,Z.jsxs)(`div`,{className:`col`,ref:k,children:[(0,Z.jsx)(vi,{route:e,navOpen:E,onToggleNav:()=>D(e=>!e),target:j?.target,version:j?.version,query:u,onQuery:d,mode:v,onToggleMode:y,onShutdown:()=>V(!0),dataRev:M,onSwitch:se}),(0,Z.jsx)(`main`,{className:`page`,id:`main`,tabIndex:-1,children:(0,Z.jsx)(`div`,{className:e.view===`harness`?`pad pad-wide`:`pad`,children:(0,Z.jsxs)(a.Suspense,{fallback:(0,Z.jsx)(Di,{}),children:[e.view===`dashboard`&&(0,Z.jsx)(Ji,{overview:j,overviewError:re,onRetry:ae,themes:ie,setup:de,runs:le,onAction:R,flavour:b,layout:te,dataRev:M}),e.view===`activity`&&(0,Z.jsx)(Yi,{}),e.view===`activity-detail`&&(0,Z.jsx)(Xi,{sid:e.sid},e.sid),r&&(0,Z.jsx)(Qi,{selected:l,overview:j,onAction:R,dataRev:M}),i&&(0,Z.jsx)(ta,{selected:l,dataRev:M}),s&&(0,Z.jsx)(Zi,{overview:j,section:c,selected:l,dataRev:M}),e.view===`rules`&&(0,Z.jsx)($i,{}),e.view===`profile`&&(0,Z.jsx)(ea,{}),e.view===`diff`&&(0,Z.jsx)(na,{onMutated:ae,dataRev:M}),e.view===`doctor`&&(0,Z.jsx)(ra,{}),e.view===`settings`&&(0,Z.jsx)(ia,{overview:j,onAction:R,flavour:b,onFlavour:S,accentMode:C,onAccentMode:ee,layout:te,onLayout:w}),e.view===`harness`&&(0,Z.jsx)(aa,{onAction:R,themes:ie,currentTheme:j?.theme,overview:j,dataRev:M,onMutated:se}),e.view===`docs`&&(0,Z.jsx)(oa,{page:e.page,query:u,onAction:R,overview:j})]})})}),(0,Z.jsx)(Si,{runs:le,open:I,busy:!!F,finish:ce,onToggle:()=>L(e=>!e),onClear:ue,onCancel:z})]}),(0,Z.jsxs)(Oi,{open:B,title:`Stop the server?`,confirmLabel:`Stop server`,onConfirm:async()=>{V(!1);try{await N.shutdown()}catch{}_(!0)},onClose:()=>V(!1),children:[`The console goes offline until you start it again with `,(0,Z.jsx)(`code`,{children:`geneseed web`}),`.`]}),f&&(0,Z.jsx)(xi,{toast:f,onClose:()=>p(null)}),ne&&(0,Z.jsx)(Ei,{ready:!!j||!!re,onDone:()=>{try{window.sessionStorage.setItem(`gs-booted`,`1`)}catch{}T(!1)}})]})}(0,s.createRoot)(document.getElementById(`root`)).render((0,Z.jsx)(sa,{})),`serviceWorker`in navigator&&window.addEventListener(`load`,()=>{navigator.serviceWorker.register(`/sw.js`).catch(()=>{})});export{z as $,Bn as A,ht as B,nr as C,Qn as D,Jn as E,cn as F,Be as G,K as H,nn as I,pt as J,He as K,Bt as L,Rn as M,Tn as N,Kn as O,un as P,he as Q,Lt as R,dr as S,qn as T,Ue as U,dt as V,Ve as W,tt as X,ft as Y,H as Z,wr as _,ai as a,ur as b,Q as c,Xr as d,V as et,zr as f,Ar as g,Or as h,Di as i,Ln as j,Vn as k,Yr as l,Fr as m,zi as n,R as nt,si as o,Pr as p,U as q,Ai as r,N as rt,oi as s,Vi as t,B as tt,Wr as u,yr as v,Xn as w,pr as x,fr as y,q as z};
@@ -1 +1 @@
1
- var e={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)`},t={security:{label:`Security`,c:e.security},verify:{label:`Verification`,c:e.verify},process:{label:`Process`,c:e.process},craft:{label:`Craft`,c:e.craft},context:{label:`Context`,c:e.context},comms:{label:`Communication`,c:e.comms}},n=[`security`,`verify`,`process`,`craft`,`context`,`comms`],r={craft:e.craft,rigor:e.verify,ops:e.process,process:e.security},i=e=>r[e]||`var(--text-3)`;export{i as a,r as i,t as n,n as r,e as t};
1
+ var e={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)`},t={security:{label:`Security`,c:e.security},verify:{label:`Verification`,c:e.verify},process:{label:`Process`,c:e.process},craft:{label:`Craft`,c:e.craft},context:{label:`Context`,c:e.context},comms:{label:`Communication`,c:e.comms}},n=[`security`,`verify`,`process`,`craft`,`context`,`comms`],r={craft:e.craft,rigor:e.verify,ops:e.process,process:e.security,comms:e.comms},i=e=>r[e]||`var(--text-3)`;export{i as a,r as i,t as n,n as r,e as t};
@@ -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-CAqrWhKl.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-AN5Emnrg.js"></script>
15
15
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-CbXtAM7H.js">
16
16
  <link rel="modulepreload" crossorigin href="/assets/react-DbkvxWG5.js">
17
17
  <link rel="stylesheet" crossorigin href="/assets/index-Ruh93A3A.css">
@@ -93,11 +93,15 @@ const DOCTRINE_META = {
93
93
  'process.4': ['process', "Read the project's own docs before changing a part."],
94
94
  'process.5': ['process', 'Every commit and push needs explicit, repeated consent.'],
95
95
  'process.6': ['process', "Set a loop's exit before entering it; break out of thrashing."],
96
- 'process.7': ['process', 'Give tracked items stable reference codes; never renumber one.'],
97
- 'process.8': [
96
+ 'process.7': [
98
97
  'process',
99
98
  'One writer per file: give each agent a write set, never overwrite a change you did not make.',
100
99
  ],
100
+ 'comms.1': ['comms', 'Give tracked items stable reference codes; never renumber one.'],
101
+ 'comms.2': [
102
+ 'comms',
103
+ 'Beside the prose, a diagram only where arrows carry meaning, else a table; codes stay.',
104
+ ],
101
105
  }
102
106
 
103
107
  // Tiny inline formatter: render `code` spans and *emphasis* in plain rule text.
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-CbXtAM7H.js";import{i as t,t as n}from"./react-DbkvxWG5.js";import{c as r,f as i,i as a,n as o,rt as s}from"./index-CAqrWhKl.js";var c=e(t(),1),l=n();function u({label:e,value:t,options:n,onChange:r}){return n.length?(0,l.jsx)(`select`,{className:`sel`,"aria-label":e,value:t,onChange:e=>r(e.target.value),children:n.map(e=>(0,l.jsx)(`option`,{value:e,children:e},e))}):null}var d=[`full`,`lean`];function f({on:e,disabled:t,label:n,onToggle:r}){return(0,l.jsx)(`input`,{type:`checkbox`,role:`switch`,className:`sw-toggle${e?` on`:``}`,checked:e,"aria-checked":e,disabled:t,"aria-label":n,onChange:r,onKeyDown:e=>{e.key===`Enter`&&!t&&r()}})}var p=(e,t)=>`${e} ${t}`,ee=(e,t)=>t===`project`?e===`claude`?`.claude/ + the CLAUDE.md block`:e===`bob`?`.bob/ + the AGENTS.md block`:e===`copilot`?`.github's Geneseed agents/skills + the AGENTS.md block`:`.opencode/ + AGENT.md + the bundle`:e===`claude`?`~/.claude's agents/skills + the CLAUDE.md block + settings hooks`:e===`bob`?`~/.bob's agents/skills + the AGENTS.md block + settings hooks`:e===`copilot`?`~/.copilot's agents/skills + the copilot-instructions.md block`:`~/.config/opencode's AGENT.md, agents, skills, plugins + the opencode.json entry`;function m(){let{data:e,error:t,reload:n}=i(()=>s.excludes(),[]),[a,o]=(0,c.useState)(!1),[u,d]=(0,c.useState)([]),f=async(e,t)=>{o(!0);try{let n=await s.excludeMutate(e,t);d(n.messages||[])}catch(e){d(e.body?.messages||[e.message])}finally{o(!1),n()}};return t||!e?.installs?.length?null:(0,l.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,l.jsx)(`div`,{className:`card-head`,children:(0,l.jsx)(`h3`,{children:`Excluded folders`})}),(0,l.jsx)(`p`,{className:`sub mb-16`,children:`Sovereign repos: inside these folders every global harness goes dormant — hooks stay silent and the global preamble is not loaded.`}),(e.excludes||[]).map(e=>(0,l.jsxs)(`div`,{className:`row wrap between gap-12`,children:[(0,l.jsx)(`code`,{children:e.path}),(0,l.jsxs)(`span`,{className:`mono muted`,children:[`[`,e.hosts.join(`, `),`]`]}),(0,l.jsx)(`button`,{className:`btn ghost sm`,disabled:a,onClick:()=>f(`remove`,e.path),children:`Remove`})]},e.path)),(0,l.jsxs)(`button`,{className:`btn ghost sm`,disabled:a,onClick:async()=>{o(!0);try{let e=await s.pickFolder();e.path?await f(`add`,e.path):e.error&&d([e.error])}catch(e){d([e.message])}finally{o(!1)}},children:[(0,l.jsx)(r,{name:`folder`}),` Exclude a folder…`]}),u.map((e,t)=>(0,l.jsx)(`p`,{className:`sub`,children:e},t))]})}function h({overview:e}){let t=e?.install;return t?(0,l.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,l.jsxs)(`div`,{className:`card-head`,children:[(0,l.jsxs)(`h3`,{children:[t.host,` · `,t.scope]}),(0,l.jsx)(`span`,{className:`tick right`,children:`active`})]}),(0,l.jsxs)(`div`,{className:`kv`,children:[(0,l.jsx)(`span`,{className:`k`,children:`path`}),(0,l.jsx)(`code`,{className:`v`,children:t.path})]}),(0,l.jsxs)(`div`,{className:`kv`,children:[(0,l.jsx)(`span`,{className:`k`,children:`voice`}),(0,l.jsx)(`span`,{className:`v mono`,children:e.theme||`—`})]}),(0,l.jsxs)(`div`,{className:`kv`,children:[(0,l.jsx)(`span`,{className:`k`,children:`footprint`}),(0,l.jsx)(`span`,{className:`v mono`,children:e.footprint||`—`})]}),(0,l.jsxs)(`div`,{className:`kv`,children:[(0,l.jsx)(`span`,{className:`k`,children:`built`}),(0,l.jsx)(`span`,{className:`v mono`,children:e.build_time||`never`})]}),(0,l.jsx)(`p`,{className:`sub motto`,children:`Per-folder overrides global: inside a folder with its own harness, only the folder’s harness loads there.`})]}):null}function g({themes:e,overview:t}){if(!e.length||!t)return null;let n=t.theme,r=[...e].sort((e,t)=>e.name===n?-1:+(t.name===n));return(0,l.jsxs)(`details`,{className:`card voice-ref mb-16`,children:[(0,l.jsxs)(`summary`,{children:[(0,l.jsx)(`span`,{className:`vr-title`,children:`Voice`}),(0,l.jsx)(`span`,{className:`vr-current`,children:n}),(0,l.jsxs)(`span`,{className:`tick vr-hint`,children:[e.length,` to choose from — set it per install below`]})]}),(0,l.jsx)(`div`,{className:`vr-list`,children:r.map(e=>(0,l.jsxs)(`div`,{className:`voice-row${e.name===n?` current`:``}`,children:[(0,l.jsx)(`span`,{className:`vr-name`,children:e.name}),(0,l.jsx)(`span`,{className:`vr-desc`,children:e.tagline?`“${e.tagline}”`:e.blurb})]},e.name))})]})}function _({onAction:e,themes:t=[],currentTheme:n,overview:_,dataRev:v,onMutated:y}){let{data:b,error:x}=i(()=>s.installs(),[v]),{data:S,error:C}=i(()=>s.mcp(),[v]),[w,T]=(0,c.useState)(``),[E,D]=(0,c.useState)(``),[te,O]=(0,c.useState)(``),[ne,re]=(0,c.useState)({}),[ie,ae]=(0,c.useState)({}),[oe,se]=(0,c.useState)({}),[ce,le]=(0,c.useState)({}),[k,ue]=(0,c.useState)({}),[A,j]=(0,c.useState)(null),[M,N]=(0,c.useState)(!1),[P,F]=(0,c.useState)(null),[I,L]=(0,c.useState)(``),de=(0,c.useMemo)(()=>{let e={};for(let t of S?.targets||[]){let n=p(t.host||`opencode`,t.root);(e[n]||(e[n]=[])).push(t)}return e},[S]);if(x||C)return(0,l.jsx)(o,{error:x||C});if(!b||!S)return(0,l.jsx)(a,{});let R=b.installs,z=b.postures||[],B=b.modes||[],V=R.filter(e=>e.state===`active`).length,fe=[{key:`global`,title:`Global`,sub:`machine-wide`,rows:R.filter(e=>e.scope===`global`),empty:`No global installs detected.`},{key:`project`,title:`Per-project`,sub:`one folder each`,rows:R.filter(e=>e.scope!==`global`),empty:`No per-project installs yet; use “Deploy to folder…”.`}],H=e=>ne[e.id]||e.theme||n||`neutral`,U=(e,t)=>re(n=>({...n,[e.id]:t})),W=e=>ie[e.id]||e.footprint||`full`,G=(e,t)=>ae(n=>({...n,[e.id]:t})),K=e=>oe[e.id]||e.posture||`peer`,q=(e,t)=>se(n=>({...n,[e.id]:t})),J=e=>ce[e.id]||e.mode||`direct`,Y=(e,t)=>le(n=>({...n,[e.id]:t})),pe=e=>H(e)===e.theme&&W(e)===(e.footprint||`full`)&&K(e)===(e.posture||`peer`)&&J(e)===(e.mode||`direct`),X=t=>{let n=H(t),r=W(t),i=K(t),a=J(t),o=t.state===`absent`?`Install Geneseed into ${t.path} with the “${n}” voice (${r} footprint, ${i} posture, ${a} mode)? Files are added non-destructively (your own config is left untouched); deactivate or uninstall later.`:`Rebuild this install (voice “${n}”, ${r} footprint, ${i} posture, ${a} mode)? It rebuilds in place, non-destructive.`;window.confirm(o)&&e?.(`install`,{host:t.host,scope:t.scope,path:t.path,theme:n,footprint:r,posture:i,mode:a})},me=async e=>{if(e.state!==`active`||window.confirm(`Deactivate this install? Files are moved aside, not deleted; reactivate any time.`)){D(e.id),T(``);try{let t=await s.installToggle(e.host,e.path,e.state===`active`?`deactivate`:`activate`);if(!t.ok){let e=Array.isArray(t.failed)?t.failed.join(`, `):``;T(t.error||e&&`unrestored: ${e}`||`action failed`);return}y?.()}catch(e){T(e.message)}finally{D(``)}}},he=async()=>{let e=P;if(e){D(e.id),T(``);try{let t=await s.installRemove(e.host,e.path,e.memory);if(!t.ok){T(t.error||`remove failed`);return}F(null),y?.()}catch(e){T(e.message)}finally{D(``)}}},Z=async e=>{T(``);try{let t=await s.mcpReveal(e.path);T(`Opening ${t.dir} — if no window appeared, open that folder by hand.`)}catch(e){T(e.message)}},Q=async(e,t)=>{let n=e.path+t.name;O(n),T(``);try{await s.mcpToggle(e.path,t.name,t.state!==`enabled`),y?.()}catch(e){T(e.message)}finally{O(``)}},ge=e=>ue(t=>({...t,[e]:!t[e]})),_e=()=>R.find(e=>e.selected)?.host||R.find(e=>e.state===`active`)?.host||R[0]?.host||`opencode`,ve=()=>j({path:``,host:_e(),theme:n||`neutral`,footprint:`full`,posture:`peer`,mode:`direct`}),ye=async()=>{N(!0),T(``);try{let e=await s.pickFolder();e.path?j(t=>t&&{...t,path:e.path}):e.error&&T(e.error)}catch(e){T(e.message)}finally{N(!1)}},$=async()=>{let t=(A?.path||``).trim();if(!t){T(`Choose or type a folder to deploy into.`);return}T(``),await e?.(`deploy`,{host:A.host,path:t,theme:A.theme,footprint:A.footprint,posture:A.posture,mode:A.mode})&&j(null)};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(`div`,{className:`head-row mb-18`,children:[(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`eyebrow`,children:`Setup`}),(0,l.jsx)(`h1`,{className:`h`,children:`Harness`}),(0,l.jsx)(`p`,{className:`sub`,children:`This machine’s install: where it lives, how it’s built, and the voice it speaks with. Other hosts (Claude Code, Bob, Copilot) install from here too.`})]}),(0,l.jsxs)(`div`,{className:`row wrap gap-10`,children:[e?(0,l.jsxs)(`button`,{className:`btn`,onClick:()=>A?j(null):ve(),children:[(0,l.jsx)(r,{name:`folder`}),` Deploy to folder…`]}):null,(0,l.jsxs)(`button`,{className:`btn`,onClick:()=>e(`build-all`),children:[(0,l.jsx)(r,{name:`refresh`}),` Rebuild all`]})]})]}),(0,l.jsx)(h,{overview:_}),(0,l.jsx)(g,{themes:t,overview:_}),(0,l.jsxs)(`div`,{className:`card pad-lg mb-16`,children:[(0,l.jsxs)(`div`,{className:`card-head`,children:[(0,l.jsx)(`h3`,{children:`Every install`}),(0,l.jsx)(`div`,{className:`right`,children:(0,l.jsxs)(`span`,{className:`tick`,children:[V,` active · `,R.length,` total`]})})]}),A?(0,l.jsxs)(`div`,{className:`deploy-pop`,children:[(0,l.jsxs)(`div`,{className:`dp-row`,children:[(0,l.jsx)(`input`,{className:`inp dp-path`,type:`text`,placeholder:`/path/to/project, or click Browse…`,value:A.path,onChange:e=>j(t=>({...t,path:e.target.value})),onKeyDown:e=>e.key===`Enter`&&$(),"aria-label":`Folder to deploy into`}),(0,l.jsx)(`button`,{className:`btn ghost sm`,disabled:M,onClick:ye,children:M?`Choosing…`:`Browse…`})]}),(0,l.jsxs)(`div`,{className:`dp-row`,children:[(0,l.jsxs)(`label`,{className:`dp-field`,children:[(0,l.jsx)(`span`,{children:`Deploy as`}),(0,l.jsxs)(`select`,{className:`sel`,"aria-label":`host for the new harness`,value:A.host,onChange:e=>j(t=>({...t,host:e.target.value})),children:[(0,l.jsx)(`option`,{value:`opencode`,children:`OpenCode`}),(0,l.jsx)(`option`,{value:`claude`,children:`Claude Code`}),(0,l.jsx)(`option`,{value:`bob`,children:`BOB (IBM)`}),(0,l.jsx)(`option`,{value:`copilot`,children:`GitHub Copilot`})]})]}),(0,l.jsxs)(`label`,{className:`dp-field`,children:[(0,l.jsx)(`span`,{children:`Voice`}),(0,l.jsx)(u,{label:`voice for the new harness`,value:A.theme,options:t.map(e=>e.name),onChange:e=>j(t=>({...t,theme:e}))})]}),(0,l.jsxs)(`label`,{className:`dp-field`,children:[(0,l.jsx)(`span`,{children:`Footprint`}),(0,l.jsx)(u,{label:`footprint for the new harness`,value:A.footprint,options:d,onChange:e=>j(t=>({...t,footprint:e}))})]}),(0,l.jsxs)(`label`,{className:`dp-field`,children:[(0,l.jsx)(`span`,{children:`Posture`}),(0,l.jsx)(u,{label:`posture for the new harness`,value:A.posture,options:z,onChange:e=>j(t=>({...t,posture:e}))})]}),(0,l.jsxs)(`label`,{className:`dp-field`,children:[(0,l.jsx)(`span`,{children:`Mode`}),(0,l.jsx)(u,{label:`mode for the new harness`,value:A.mode,options:B,onChange:e=>j(t=>({...t,mode:e}))})]}),(0,l.jsx)(`button`,{className:`btn sm`,onClick:$,children:`Deploy`}),(0,l.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>j(null),children:`Cancel`})]}),(0,l.jsxs)(`p`,{className:`sub dp-note`,children:[`Adds a per-repo harness (`,(0,l.jsx)(`code`,{children:A.host===`claude`?`.claude/ + CLAUDE.md`:A.host===`bob`?`.bob/ + AGENTS.md`:A.host===`copilot`?`.github/ + AGENTS.md`:`.opencode/ + AGENT.md`}),`) into the folder, non-destructively. It’s then tracked here even after you leave its directory.`]})]}):null,(0,l.jsxs)(`p`,{className:`sub mb-16`,children:[`Every Geneseed install on this machine: OpenCode, Claude Code, Bob, and Copilot — global and per-repo. Toggle one off without deleting it (files move aside, reactivate any time). Active rows expand to wire their MCP servers. `,(0,l.jsx)(`strong`,{children:`Rebuild all`}),` re-emits every active install in its own voice and mode, as one background job.`]}),(0,l.jsxs)(`p`,{className:`sub mb-16`,children:[(0,l.jsx)(`strong`,{children:`Per-folder now overrides global.`}),` Inside a folder that has its own harness, the `,(0,l.jsx)(`em`,{children:`same host’s`}),` global harness steps aside; only the folder’s harness loads there (the global one still applies everywhere else). Set`,` `,(0,l.jsx)(`code`,{children:`GENESEED_STACK_GLOBAL=1`}),` to load both. Existing installs pick this up on their next rebuild.`]}),w?(0,l.jsx)(`p`,{className:`badge bad mb-16`,children:w}):null,(0,l.jsx)(`div`,{className:`tbl-scroll`,children:(0,l.jsxs)(`table`,{className:`tbl harness-tbl`,children:[(0,l.jsx)(`thead`,{children:(0,l.jsxs)(`tr`,{children:[(0,l.jsx)(`th`,{"aria-label":`expand`}),(0,l.jsx)(`th`,{children:`Harness`}),(0,l.jsx)(`th`,{children:`Voice`}),(0,l.jsx)(`th`,{children:`MCP`}),(0,l.jsx)(`th`,{children:`Status`}),(0,l.jsx)(`th`,{className:`th-acts`})]})}),fe.map(e=>(0,l.jsxs)(`tbody`,{children:[(0,l.jsx)(`tr`,{className:`h-group`,children:(0,l.jsxs)(`td`,{colSpan:6,children:[e.title,(0,l.jsxs)(`span`,{className:`hg-sub`,children:[` · `,e.sub]})]})}),e.rows.length?e.rows.map(be):(0,l.jsx)(`tr`,{className:`h-empty-row`,children:(0,l.jsx)(`td`,{colSpan:6,className:`h-empty`,children:e.empty})})]},e.key))]})})]}),(0,l.jsx)(m,{})]});function be(n){let i=n.state===`active`,a=de[p(n.host,n.path)]||[],o=a.length>0,s=o&&!k[n.id],m=a.reduce((e,t)=>e+t.servers.filter(e=>e.state===`enabled`).length,0),h=`voice for ${n.host} · ${n.scope}`,g=i?`active`:n.state===`disabled`?`disabled`:`not installed`;return(0,l.jsxs)(c.Fragment,{children:[(0,l.jsxs)(`tr`,{children:[(0,l.jsx)(`td`,{className:`h-exp-cell`,children:o?(0,l.jsx)(`button`,{className:`h-exp`,"aria-expanded":s,"aria-label":`${s?`collapse`:`expand`} MCP for ${n.host} · ${n.scope}`,onClick:()=>ge(n.id),children:(0,l.jsx)(r,{name:`chevron`,className:`glyph${s?` open`:``}`})}):null}),(0,l.jsxs)(`td`,{children:[(0,l.jsxs)(`span`,{className:`name`,children:[n.host,` · `,n.scope]}),(0,l.jsx)(`code`,{className:`h-path`,title:n.path,children:n.path})]}),(0,l.jsx)(`td`,{className:`mono`,children:n.theme||`—`}),(0,l.jsx)(`td`,{children:o?(0,l.jsxs)(`span`,{className:m?`mono`:`mono muted`,children:[m,` on`]}):(0,l.jsx)(`span`,{className:`muted`,children:`—`})}),(0,l.jsx)(`td`,{children:(0,l.jsx)(`span`,{className:`badge ${i?`ok`:``}`,children:g})}),(0,l.jsx)(`td`,{children:(0,l.jsxs)(`div`,{className:`h-acts`,children:[(0,l.jsx)(`div`,{className:`ha-cell ha-voice`,children:i&&e?(0,l.jsx)(u,{label:h,value:H(n),options:t.map(e=>e.name),onChange:e=>U(n,e)}):null}),(0,l.jsx)(`div`,{className:`ha-cell ha-fp`,children:i&&e?(0,l.jsx)(u,{label:`footprint for ${n.host} · ${n.scope}`,value:W(n),options:d,onChange:e=>G(n,e)}):null}),(0,l.jsx)(`div`,{className:`ha-cell ha-posture`,children:i&&e?(0,l.jsx)(u,{label:`posture for ${n.host} · ${n.scope}`,value:K(n),options:z,onChange:e=>q(n,e)}):null}),(0,l.jsx)(`div`,{className:`ha-cell ha-mode`,children:i&&e?(0,l.jsx)(u,{label:`mode for ${n.host} · ${n.scope}`,value:J(n),options:B,onChange:e=>Y(n,e)}):null}),(0,l.jsx)(`div`,{className:`ha-cell ha-btn`,children:n.state===`absent`&&e?(0,l.jsx)(`button`,{className:`btn ghost sm`,"aria-expanded":I===n.id,onClick:()=>L(e=>e===n.id?``:n.id),children:`Install…`}):i&&e?(0,l.jsx)(`button`,{className:`btn ghost sm`,disabled:pe(n),onClick:()=>X(n),children:`Apply`}):null}),(0,l.jsx)(`div`,{className:`ha-cell ha-sw`,children:n.state===`absent`?null:(0,l.jsx)(f,{on:i,disabled:E===n.id,label:`activate ${n.host} · ${n.scope}`,onToggle:()=>me(n)})}),(0,l.jsx)(`div`,{className:`ha-cell ha-trash`,children:n.state!==`absent`&&e?(0,l.jsx)(`button`,{className:`btn ghost sm h-trash`,"aria-label":`remove ${n.host} · ${n.scope} from ${n.path}`,title:`Remove this harness`,disabled:E===n.id,onClick:()=>F(e=>e?.id===n.id?null:{id:n.id,host:n.host,path:n.path,memory:`keep`}),children:(0,l.jsx)(r,{name:`clear`})}):null})]})})]}),n.state===`absent`&&I===n.id?(0,l.jsxs)(`tr`,{className:`h-detail-row h-setup-row`,children:[(0,l.jsx)(`td`,{}),(0,l.jsx)(`td`,{colSpan:5,className:`h-detail`,children:(0,l.jsxs)(`div`,{className:`h-setup`,children:[(0,l.jsxs)(`p`,{className:`sub hs-msg`,children:[`Install Geneseed into `,(0,l.jsx)(`code`,{children:n.path}),` as `,(0,l.jsx)(`strong`,{children:n.host}),`. Files are added non-destructively; deactivate or uninstall later.`]}),(0,l.jsxs)(`div`,{className:`hs-steps`,children:[(0,l.jsxs)(`label`,{className:`hs-step`,children:[(0,l.jsx)(`span`,{children:`1 · Voice`}),(0,l.jsx)(u,{label:h,value:H(n),options:t.map(e=>e.name),onChange:e=>U(n,e)})]}),(0,l.jsxs)(`label`,{className:`hs-step`,children:[(0,l.jsx)(`span`,{children:`2 · Footprint`}),(0,l.jsx)(u,{label:`footprint for ${n.host} · ${n.scope}`,value:W(n),options:d,onChange:e=>G(n,e)})]}),(0,l.jsxs)(`label`,{className:`hs-step`,children:[(0,l.jsx)(`span`,{children:`3 · Posture`}),(0,l.jsx)(u,{label:`posture for ${n.host} · ${n.scope}`,value:K(n),options:z,onChange:e=>q(n,e)})]}),(0,l.jsxs)(`label`,{className:`hs-step`,children:[(0,l.jsx)(`span`,{children:`4 · Mode`}),(0,l.jsx)(u,{label:`mode for ${n.host} · ${n.scope}`,value:J(n),options:B,onChange:e=>Y(n,e)})]})]}),(0,l.jsxs)(`div`,{className:`hr-acts`,children:[(0,l.jsx)(`button`,{className:`btn sm`,onClick:()=>X(n),children:`Install`}),(0,l.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>L(``),children:`Cancel`})]})]})})]}):null,P?.id===n.id?(0,l.jsxs)(`tr`,{className:`h-detail-row h-remove-row`,children:[(0,l.jsx)(`td`,{}),(0,l.jsx)(`td`,{colSpan:5,className:`h-detail`,children:(0,l.jsxs)(`div`,{className:`h-remove`,children:[(0,l.jsxs)(`div`,{className:`hr-msg`,children:[(0,l.jsx)(`strong`,{children:n.scope===`project`?`Remove this harness from the folder?`:`Remove the global ${n.host} install?`}),(0,l.jsxs)(`span`,{className:`sub`,children:[`Deletes `,(0,l.jsx)(`code`,{children:ee(n.host,n.scope)}),n.scope===`project`?` and de-lists it.`:`; the row stays, marked “not installed.”`,` `,`This can’t be undone.`]})]}),(0,l.jsxs)(`label`,{className:`hr-field`,children:[(0,l.jsx)(`span`,{children:`Memory & notebook`}),(0,l.jsxs)(`select`,{className:`sel`,"aria-label":`memory disposition`,value:P.memory,onChange:e=>F(t=>({...t,memory:e.target.value})),children:[(0,l.jsx)(`option`,{value:`keep`,children:`keep in place`}),(0,l.jsx)(`option`,{value:`archive`,children:`archive aside`}),(0,l.jsx)(`option`,{value:`delete`,children:`delete too`})]})]}),(0,l.jsxs)(`div`,{className:`hr-acts`,children:[(0,l.jsx)(`button`,{className:`btn sm hr-go`,disabled:E===n.id,onClick:he,children:E===n.id?`Removing…`:`Remove`}),(0,l.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>F(null),children:`Cancel`})]})]})})]}):null,s?(0,l.jsxs)(`tr`,{className:`h-detail-row`,children:[(0,l.jsx)(`td`,{}),(0,l.jsx)(`td`,{colSpan:5,className:`h-detail`,children:a.map(e=>(0,l.jsxs)(`div`,{className:`mcp-target`,children:[(0,l.jsxs)(`div`,{className:`mt-head`,children:[e.label,` · `,(0,l.jsx)(`code`,{children:e.path}),(0,l.jsx)(`button`,{className:`btn ghost sm`,onClick:()=>Z(e),title:`Open the folder holding ${e.path} — tokens and URLs go in this file`,children:`Open folder`}),e.commented&&` (has comments; edit by hand)`]}),e.servers.map(t=>{let n=e.path+t.name,r=!!(e.commented||te===n);return(0,l.jsxs)(`div`,{className:`mcp-row`,children:[(0,l.jsxs)(`div`,{className:`mcp-info`,children:[(0,l.jsxs)(`div`,{className:`mi-top`,children:[(0,l.jsx)(`strong`,{children:t.label}),(0,l.jsx)(`span`,{className:`badge ${t.state===`enabled`?`ok`:``}`,children:t.state})]}),(0,l.jsx)(`p`,{children:t.desc})]}),t.state===`absent`?t.preset?(0,l.jsx)(`button`,{className:`btn ghost sm`,disabled:r,onClick:()=>Q(e,t),children:`Add`}):null:(0,l.jsx)(f,{on:t.state===`enabled`,disabled:r,label:`${t.label} server`,onToggle:()=>Q(e,t)})]},t.name)})]},e.path))})]}):null]},n.id)}}export{f as Switch,_ as default};