trybeacon 0.1.90 → 0.1.92

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 (154) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/.next/BUILD_ID +1 -1
  3. package/.next/app-path-routes-manifest.json +19 -19
  4. package/.next/build-manifest.json +2 -2
  5. package/.next/prerender-manifest.json +3 -3
  6. package/.next/server/app/@modal/(.)settings/page.js +1 -1
  7. package/.next/server/app/@modal/(.)settings/page.js.nft.json +1 -1
  8. package/.next/server/app/@modal/(.)settings/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  10. package/.next/server/app/_global-error.html +1 -1
  11. package/.next/server/app/_global-error.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  14. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  15. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  16. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  17. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  18. package/.next/server/app/_not-found/page.js +1 -1
  19. package/.next/server/app/_not-found/page.js.nft.json +1 -1
  20. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  21. package/.next/server/app/_not-found.html +1 -1
  22. package/.next/server/app/_not-found.rsc +3 -3
  23. package/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
  24. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  25. package/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
  26. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  27. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  28. package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  29. package/.next/server/app/api/context/route.js +1 -1
  30. package/.next/server/app/api/ingest/route.js +1 -1
  31. package/.next/server/app/api/linear/route.js +1 -17
  32. package/.next/server/app/api/linear/route.js.nft.json +1 -1
  33. package/.next/server/app/api/linear/scopes/route.js +1 -17
  34. package/.next/server/app/api/linear/scopes/route.js.nft.json +1 -1
  35. package/.next/server/app/api/linear/sync/route.js +1 -17
  36. package/.next/server/app/api/linear/sync/route.js.nft.json +1 -1
  37. package/.next/server/app/api/plan/approve/route.js +1 -1
  38. package/.next/server/app/api/share/create/route.js +1 -1
  39. package/.next/server/app/docs/page.js +1 -1
  40. package/.next/server/app/docs/page.js.nft.json +1 -1
  41. package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  42. package/.next/server/app/docs.html +1 -1
  43. package/.next/server/app/docs.rsc +4 -4
  44. package/.next/server/app/docs.segments/@modal/__DEFAULT__.segment.rsc +1 -1
  45. package/.next/server/app/docs.segments/_full.segment.rsc +4 -4
  46. package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  47. package/.next/server/app/docs.segments/_index.segment.rsc +3 -3
  48. package/.next/server/app/docs.segments/_tree.segment.rsc +2 -2
  49. package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +2 -2
  50. package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  51. package/.next/server/app/help/page.js +2 -2
  52. package/.next/server/app/help/page.js.nft.json +1 -1
  53. package/.next/server/app/help/page_client-reference-manifest.js +1 -1
  54. package/.next/server/app/help.html +1 -1
  55. package/.next/server/app/help.rsc +4 -4
  56. package/.next/server/app/help.segments/@modal/__DEFAULT__.segment.rsc +1 -1
  57. package/.next/server/app/help.segments/_full.segment.rsc +4 -4
  58. package/.next/server/app/help.segments/_head.segment.rsc +1 -1
  59. package/.next/server/app/help.segments/_index.segment.rsc +3 -3
  60. package/.next/server/app/help.segments/_tree.segment.rsc +2 -2
  61. package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +2 -2
  62. package/.next/server/app/help.segments/help.segment.rsc +1 -1
  63. package/.next/server/app/index.html +1 -1
  64. package/.next/server/app/index.rsc +3 -3
  65. package/.next/server/app/index.segments/@modal/__DEFAULT__.segment.rsc +1 -1
  66. package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  67. package/.next/server/app/index.segments/_full.segment.rsc +3 -3
  68. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  69. package/.next/server/app/index.segments/_index.segment.rsc +3 -3
  70. package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  71. package/.next/server/app/learn/page.js +3 -3
  72. package/.next/server/app/learn/page.js.nft.json +1 -1
  73. package/.next/server/app/learn/page_client-reference-manifest.js +1 -1
  74. package/.next/server/app/map/page.js +2 -2
  75. package/.next/server/app/map/page.js.nft.json +1 -1
  76. package/.next/server/app/map/page_client-reference-manifest.js +1 -1
  77. package/.next/server/app/page.js +1 -1
  78. package/.next/server/app/page.js.nft.json +1 -1
  79. package/.next/server/app/page_client-reference-manifest.js +1 -1
  80. package/.next/server/app/parked/page.js +1 -1
  81. package/.next/server/app/parked/page.js.nft.json +1 -1
  82. package/.next/server/app/parked/page_client-reference-manifest.js +1 -1
  83. package/.next/server/app/plan/page.js +3 -3
  84. package/.next/server/app/plan/page.js.nft.json +1 -1
  85. package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
  86. package/.next/server/app/s/[token]/page.js +2 -2
  87. package/.next/server/app/s/[token]/page.js.nft.json +1 -1
  88. package/.next/server/app/s/[token]/page_client-reference-manifest.js +1 -1
  89. package/.next/server/app/settings/page.js +1 -1
  90. package/.next/server/app/settings/page.js.nft.json +1 -1
  91. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  92. package/.next/server/app-paths-manifest.json +19 -19
  93. package/.next/server/chunks/1130.js +1 -1
  94. package/.next/server/chunks/1495.js +18 -0
  95. package/.next/server/chunks/{7436.js → 1898.js} +3 -3
  96. package/.next/server/chunks/2031.js +1 -1
  97. package/.next/server/chunks/2644.js +1 -0
  98. package/.next/server/chunks/3825.js +1 -1
  99. package/.next/server/chunks/4378.js +1 -1
  100. package/.next/server/chunks/{5332.js → 473.js} +3 -3
  101. package/.next/server/chunks/5623.js +1 -1
  102. package/.next/server/chunks/8227.js +1 -1
  103. package/.next/server/chunks/8709.js +8 -7
  104. package/.next/server/chunks/9683.js +1 -1
  105. package/.next/server/middleware-build-manifest.js +1 -1
  106. package/.next/server/pages/404.html +1 -1
  107. package/.next/server/pages/500.html +1 -1
  108. package/.next/server/server-reference-manifest.js +1 -1
  109. package/.next/server/server-reference-manifest.json +1 -1
  110. package/.next/static/chunks/2149-6eac4575d8a8281c.js +1 -0
  111. package/.next/static/chunks/{6283-20a6abe3453496ae.js → 3729-99f9edd66d1473ac.js} +3 -3
  112. package/.next/static/chunks/569-c70eb3d6c88282dc.js +1 -0
  113. package/.next/static/chunks/6818-051146427620d0f9.js +1 -0
  114. package/.next/static/chunks/8653-27d42df759159788.js +1 -0
  115. package/.next/static/chunks/app/@modal/(.)settings/page-77639f97e58859de.js +1 -0
  116. package/.next/static/chunks/app/docs/page-574e48b1b9519c80.js +1 -0
  117. package/.next/static/chunks/app/layout-6f04d1687adcd16e.js +1 -0
  118. package/.next/static/chunks/app/learn/{page-49bdcae5bf2a7a49.js → page-53c201dbfd759610.js} +1 -1
  119. package/.next/static/chunks/app/map/{page-6e32f55c7b69bfa0.js → page-147befd24a412e04.js} +1 -1
  120. package/.next/static/chunks/app/plan/{page-b8b89d7171a582ce.js → page-a35f98b97c750679.js} +2 -2
  121. package/.next/static/chunks/app/s/[token]/{page-7ebe66049fae02ce.js → page-db7be755d871820e.js} +1 -1
  122. package/.next/static/chunks/app/settings/page-c15764e1c2f54c5a.js +1 -0
  123. package/.next/static/css/b6c71ada5fa39830.css +1 -0
  124. package/.next/trace +47 -47
  125. package/.next/trace-build +1 -1
  126. package/dist/bin/ask.js +2 -2
  127. package/dist/bin/doctor.js +32 -30
  128. package/dist/bin/hook.js +31 -29
  129. package/dist/bin/mcp.js +41 -39
  130. package/dist/bin/plan.js +32 -30
  131. package/dist/bin/prompt.js +2 -2
  132. package/dist/bin/remove.js +3 -3
  133. package/dist/bin/stop-hook.js +4 -4
  134. package/dist/bin/uninstall.js +31 -29
  135. package/dist/lib/assets.js +20 -20
  136. package/dist/lib/codex-install.js +30 -28
  137. package/dist/lib/daemon-boot.js +11 -11
  138. package/dist/lib/global-install.js +31 -29
  139. package/drizzle/0013_quick_brother_voodoo.sql +1 -0
  140. package/drizzle/meta/0013_snapshot.json +1953 -0
  141. package/drizzle/meta/_journal.json +7 -0
  142. package/package.json +1 -1
  143. package/.next/server/chunks/2806.js +0 -1
  144. package/.next/static/chunks/2114-74736df56930b46c.js +0 -1
  145. package/.next/static/chunks/569-bfdcec83011428d3.js +0 -1
  146. package/.next/static/chunks/6818-85b9a09bb74062ef.js +0 -1
  147. package/.next/static/chunks/6930-1231a4681af2ad3f.js +0 -1
  148. package/.next/static/chunks/app/@modal/(.)settings/page-58f068e66bf2fdf6.js +0 -1
  149. package/.next/static/chunks/app/docs/page-126c0e42c71731b2.js +0 -1
  150. package/.next/static/chunks/app/layout-a8bb07fb86893add.js +0 -1
  151. package/.next/static/chunks/app/settings/page-435bfb2ac6f01744.js +0 -1
  152. package/.next/static/css/56890131dbc6daff.css +0 -1
  153. /package/.next/static/{l2BAGl1tReuc34hH3NvPZ → Ced4ZzirE-x-xhZEP02do}/_buildManifest.js +0 -0
  154. /package/.next/static/{l2BAGl1tReuc34hH3NvPZ → Ced4ZzirE-x-xhZEP02do}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[569],{23319:(e,a,s)=>{"use strict";s.d(a,{AppearanceCard:()=>f});var t=s(95155),r=s(12115);let n=(0,s(30772).A)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);var l=s(79984),o=s(35550),i=s(91337);let c="#ff7a45",d={light:{bg:"#eeece6",card:"#ffffff",ink:"#3a3a3a",border:"#dcd9d2"},dark:{bg:"#1f1f22",card:"#2c2c30",ink:"#e6e6e6",border:"#3a3a3f"}},u=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"auto",label:"Auto"}],h=[{value:"glass",label:"Glass",hint:"Frosted blur"},{value:"tinted",label:"Tinted",hint:"Flat, no blur"},{value:"solid",label:"Solid",hint:"Opaque panels"}];function x({theme:e}){if("auto"===e)return(0,t.jsxs)("span",{className:"relative block h-10 w-full overflow-hidden rounded-md border border-black/10",children:[(0,t.jsx)("span",{className:"absolute inset-0",style:{background:d.light.bg}}),(0,t.jsx)("span",{className:"absolute inset-0",style:{background:d.dark.bg,clipPath:"polygon(100% 0, 100% 100%, 0 100%)"}}),(0,t.jsx)("span",{className:"absolute left-1.5 top-1.5 h-1.5 w-6 rounded-full",style:{background:c}})]});let a=d[e];return(0,t.jsx)("span",{className:"block h-10 w-full overflow-hidden rounded-md border",style:{background:a.bg,borderColor:a.border},children:(0,t.jsxs)("span",{className:"mx-1.5 mt-1.5 flex h-6 flex-col justify-center gap-1 rounded px-1.5",style:{background:a.card,border:`1px solid ${a.border}`},children:[(0,t.jsx)("span",{className:"h-1 w-3/4 rounded-full",style:{background:a.ink,opacity:.55}}),(0,t.jsx)("span",{className:"h-1 w-5 rounded-full",style:{background:c}})]})})}function p({surface:e}){let a="solid"===e?{background:d.dark.card}:"tinted"===e?{background:"rgba(44,44,48,0.72)"}:{background:"linear-gradient(180deg, rgba(255,255,255,0.10), rgba(44,44,48,0.55))",backdropFilter:"blur(3px)"};return(0,t.jsx)("span",{className:"relative block h-10 w-full overflow-hidden rounded-md border border-black/20",style:{backgroundColor:d.dark.bg,backgroundImage:"radial-gradient(rgba(255,255,255,0.22) 1px, transparent 1px)",backgroundSize:"6px 6px"},children:(0,t.jsx)("span",{className:"absolute inset-x-2 top-2 bottom-2 rounded",style:{...a,border:"1px solid rgba(255,255,255,0.12)"}})})}function m({selected:e,label:a,hint:s,onClick:r,children:n}){return(0,t.jsxs)("button",{type:"button",onClick:r,"aria-pressed":e,className:(0,i.cn)("flex flex-1 flex-col gap-2 rounded-lg border p-2 text-left transition-colors",e?"border-[var(--accent-2,#ff7a45)] bg-[color-mix(in_oklab,var(--accent-2,#ff7a45)_10%,transparent)]":"border-border hover:bg-[var(--ink-hover)]"),children:[n,(0,t.jsxs)("span",{className:"flex items-center justify-between gap-1 px-0.5",children:[(0,t.jsx)("span",{className:"text-xs font-medium",children:a}),e&&(0,t.jsx)("span",{"aria-hidden":!0,className:"size-1.5 rounded-full bg-[var(--accent-2,#ff7a45)]"})]}),s&&(0,t.jsx)("span",{className:"px-0.5 text-[10px] leading-tight text-muted-foreground",children:s})]})}function f(){let[e,a]=(0,r.useState)(o.SS),[s,i]=(0,r.useState)(o.mn);return(0,r.useEffect)(()=>{a((0,o.O4)()),i((0,o.C3)())},[]),(0,t.jsxs)(l.Zp,{children:[(0,t.jsxs)(l.aR,{children:[(0,t.jsxs)(l.ZB,{className:"flex items-center gap-2 text-base",children:[(0,t.jsx)(n,{className:"size-4 text-[var(--accent-2,#ff7a45)]"}),"Appearance"]}),(0,t.jsx)(l.BT,{children:"Theme and surface for this browser. Changes apply instantly and are remembered here."})]}),(0,t.jsx)(l.Wu,{className:"space-y-6",children:(0,t.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"Theme"}),(0,t.jsx)("div",{className:"flex gap-2",children:u.map(s=>(0,t.jsx)(m,{selected:e===s.value,label:s.label,hint:"auto"===s.value?"Follows your system":void 0,onClick:()=>{var e;a(e=s.value),(0,o.Yl)(e)},children:(0,t.jsx)(x,{theme:s.value})},s.value))})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"mb-2 text-xs font-medium text-muted-foreground",children:"Surface"}),(0,t.jsx)("div",{className:"flex gap-2",children:h.map(e=>(0,t.jsx)(m,{selected:s===e.value,label:e.label,hint:e.hint,onClick:()=>{var a;i(a=e.value),(0,o.S1)(a)},children:(0,t.jsx)(p,{surface:e.value})},e.value))})]})]})})]})}},35550:(e,a,s)=>{"use strict";s.d(a,{C3:()=>i,Fc:()=>c,Gq:()=>r,O4:()=>o,S1:()=>u,SS:()=>n,Yl:()=>d,k4:()=>t,mn:()=>l});let t="beacon-theme",r="beacon-surface",n="dark",l="glass";function o(){try{var e;return e=localStorage.getItem(t),"light"===e||"dark"===e||"auto"===e?e:n}catch{return n}}function i(){try{var e;return e=localStorage.getItem(r),"glass"===e||"tinted"===e||"solid"===e?e:l}catch{return l}}function c(e,a){var s;if("u"<typeof document)return;let t=document.documentElement,r=(s=!!window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches,"auto"===e?s:"dark"===e);t.dataset.theme=r?"dark":"light",t.classList.toggle("dark",r),t.dataset.surface=a}function d(e){try{localStorage.setItem(t,e)}catch{}c(e,i())}function u(e){try{localStorage.setItem(r,e)}catch{}c(o(),e)}},40755:(e,a,s)=>{"use strict";s.d(a,{LinearCard:()=>m});var t=s(95155),r=s(12115),n=s(51128),l=s(9005),o=s(64577);let i=(0,s(30772).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);var c=s(79984),d=s(4474),u=s(39658),h=s(26518);let x=e=>`${e.kind}:${e.id}`,p=e=>"milestone"===e.kind&&e.projectName?`${e.name} \xb7 ${e.projectName}`:e.name;function m(){let[e,a]=(0,r.useState)(null),[s,m]=(0,r.useState)([]),[f,g]=(0,r.useState)(""),[b,j]=(0,r.useState)(!1),[v,y]=(0,r.useState)(null),[k,N]=(0,r.useState)(!1),[w,C]=(0,r.useState)(0);(0,r.useEffect)(()=>{let e=!0;return fetch("/api/linear",{cache:"no-store"}).then(e=>e.ok?e.json():null).then(s=>{e&&s&&a(s)}).catch(()=>{}),()=>{e=!1}},[]);let S=e?.connected??!1;async function A(e){j(!0),y(null);try{let s=await fetch("/api/linear",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)});if(!s.ok)return y((await s.json().catch(()=>({}))).error??"Something went wrong"),null;let t=await s.json();return a(t),t}finally{j(!1)}}async function T(){!f.trim()||await A({apiKey:f.trim()})&&(g(""),N(!1))}async function E(a){let t;if(e){if(C(e=>e+1),"workspace"===a)t=[{kind:"workspace",id:"workspace",name:e.orgName??"Entire workspace"}];else{let r=s.find(e=>x(e)===a);if(!r||e.scopes.some(e=>x(e)===a))return;t=[...e.scopes.filter(e=>"workspace"!==e.kind),r]}await A(0===e.scopes.length?{scopes:t,enabled:!0}:{scopes:t})}}async function L(a){e&&await A({scopes:e.scopes.filter(e=>x(e)!==a)})}async function z(){j(!0),y(null);try{let e=await fetch("/api/linear/sync",{method:"POST"});if(!e.ok)return void y("Sync failed — check the API key and your connection");let s=await e.json().catch(()=>({}));y(s.skipped?s.skipped:`Synced — ${s.created??0} added, ${s.pulled??0} updated, ${s.pushed??0} pushed, ${s.removed??0} removed`);let t=await fetch("/api/linear",{cache:"no-store"}).then(e=>e.ok?e.json():null).catch(()=>null);t&&a(t)}finally{j(!1)}}(0,r.useEffect)(()=>{if(!S)return;let e=!0;return fetch("/api/linear/scopes",{cache:"no-store"}).then(e=>e.ok?e.json():null).then(a=>{e&&a&&m(a.scopes)}).catch(()=>{}),()=>{e=!1}},[S]);let P=e?.scopes??[],M=new Set(P.map(x)),B=P.some(e=>"workspace"===e.kind),$=e=>s.filter(a=>a.kind===e&&!M.has(x(a))),R=$("team"),Z=$("project"),D=$("milestone");return(0,t.jsxs)(c.Zp,{children:[(0,t.jsxs)(c.aR,{children:[(0,t.jsxs)(c.ZB,{className:"flex items-center gap-2 text-base",children:[(0,t.jsx)(n.A,{className:"size-4 text-[var(--accent-2,#ff7a45)]"}),"Linear sync"]}),(0,t.jsx)(c.BT,{children:"Mirror any mix of Linear teams, projects, or milestones — or the whole workspace — onto this board and back: create or edit in either place, no double entry. Changes flow both ways within ~a minute (last edit wins). The key stays on this machine."})]}),(0,t.jsxs)(c.Wu,{className:"space-y-3",children:[null==e?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:"Loading…"}):!e.connected||k?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(u.p,{type:"password",autoComplete:"off",placeholder:"Linear personal API key (lin_api_…)",value:f,onChange:e=>g(e.target.value),onKeyDown:e=>"Enter"===e.key&&void T(),className:"h-9 flex-1"}),(0,t.jsx)(d.$,{size:"sm",disabled:b||!f.trim(),onClick:()=>void T(),children:"Connect"})]}):(0,t.jsxs)("div",{className:"space-y-2.5",children:[(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Connected to ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:e.orgName}),e.viewerName&&(0,t.jsxs)(t.Fragment,{children:[" as ",e.viewerName]}),".",0===P.length&&(0,t.jsx)(t.Fragment,{children:" Which teams, projects, or milestones does this repo track?"})]}),P.length>0&&(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[P.map(e=>(0,t.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border border-border px-2 py-0.5 text-xs",children:[(0,t.jsx)("span",{className:"font-medium",children:p(e)}),(0,t.jsx)("span",{className:"text-muted-foreground",children:e.kind}),(0,t.jsx)("button",{type:"button","aria-label":`Remove ${p(e)}`,disabled:b,onClick:()=>void L(x(e)),className:"text-muted-foreground hover:text-foreground",children:(0,t.jsx)(l.A,{className:"size-3"})})]},x(e))),!e.enabled&&(0,t.jsx)("span",{className:"text-xs text-amber-400",children:"Paused"})]}),(0,t.jsxs)(h.l6,{onValueChange:e=>e&&void E(e),children:[(0,t.jsx)(h.bq,{className:"h-9 w-72",children:(0,t.jsx)(h.yv,{placeholder:s.length?"Add scope…":"Loading…"})}),(0,t.jsxs)(h.gC,{children:[!B&&(0,t.jsx)(h.s3,{children:(0,t.jsx)(h.eb,{value:"workspace",children:"Entire workspace"})}),R.length>0&&(0,t.jsxs)(h.s3,{children:[(0,t.jsx)(h.TR,{children:"Teams"}),R.map(e=>(0,t.jsx)(h.eb,{value:x(e),children:e.name},x(e)))]}),Z.length>0&&(0,t.jsxs)(h.s3,{children:[(0,t.jsx)(h.TR,{children:"Projects"}),Z.map(e=>(0,t.jsx)(h.eb,{value:x(e),children:e.name},x(e)))]}),D.length>0&&(0,t.jsxs)(h.s3,{children:[(0,t.jsx)(h.TR,{children:"Milestones"}),D.map(e=>(0,t.jsx)(h.eb,{value:x(e),children:p(e)},x(e)))]})]})]},w),P.length>0&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{type:"button",disabled:b,onClick:()=>void A({onlyMine:!e.onlyMine}),className:"flex items-center gap-2 text-left text-xs text-muted-foreground hover:text-foreground",children:[(0,t.jsx)("span",{className:`flex size-4 items-center justify-center rounded border ${e.onlyMine?"border-[var(--accent-2,#ff7a45)] bg-[var(--accent-2,#ff7a45)]/20 text-[var(--accent-2,#ff7a45)]":"border-border"}`,children:e.onlyMine&&(0,t.jsx)(o.A,{className:"size-3"})}),"Only issues assigned to me"]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pt-0.5",children:[(0,t.jsxs)(d.$,{size:"sm",variant:"outline",disabled:b,onClick:()=>void z(),children:[(0,t.jsx)(i,{className:`size-3.5 ${b?"animate-spin":""}`}),"Sync now"]}),(0,t.jsx)(d.$,{size:"sm",variant:"ghost",disabled:b,onClick:()=>void A({enabled:!e.enabled}),children:e.enabled?"Pause sync":"Resume sync"}),(0,t.jsx)(d.$,{size:"sm",variant:"ghost",disabled:b,onClick:()=>N(!0),children:"Change key"})]})]})]}),v&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:v}),e?.connected&&P.length>0&&e.lastSyncedAt&&(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Last synced ",new Date(e.lastSyncedAt).toLocaleString()]})]})]})}},44642:(e,a,s)=>{"use strict";s.d(a,{SettingsModal:()=>k});var t=s(95155),r=s(17112),n=s(51880),l=s(35176),o=s(11248),i=s(82022),c=s(98758),d=s(45362),u=s(12115),h=s(73321),x=s(65377),p=s(9005),m=s(52965),f=s(60292),g=s(91337);let b=0,j=new Set;function v(e){return j.add(e),()=>{j.delete(e)}}let y=()=>b>0;function k({sections:e,intercepted:a}){let s=(0,h.useRouter)(),[N,w]=(0,u.useState)(!0),[C,S]=(0,u.useState)(e[0]?.id),[A,T]=(0,u.useState)(""),E=(0,u.useRef)(null),L=(0,u.useSyncExternalStore)(v,y,()=>!1);(0,u.useEffect)(()=>{if(!a)return b+=1,j.forEach(e=>e()),()=>{b-=1,j.forEach(e=>e())}},[a]);let z=e.find(e=>e.id===C)??e[0],P=(0,u.useMemo)(()=>{let a=A.trim().toLowerCase(),s=[],t=new Map;for(let r of e)(!a||r.label.toLowerCase().includes(a)||r.group.toLowerCase().includes(a))&&(t.has(r.group)||(t.set(r.group,[]),s.push(r.group)),t.get(r.group).push(r));return s.map(e=>({label:e,items:t.get(e)}))},[e,A]);return a&&L?null:(0,t.jsx)(r.D,{open:N,onOpenChange:e=>{e||(w(!1),a?s.back():s.push((0,f.Fj)("/map",(0,f.fk)())))},children:(0,t.jsxs)(n.Z,{children:[(0,t.jsx)(l.X,{className:(0,g.cn)("fixed inset-0 z-50 bg-black/45 supports-backdrop-filter:backdrop-blur-[3px]","duration-150 data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0")}),(0,t.jsxs)(o.h,{initialFocus:E,className:(0,g.cn)("glass fixed left-1/2 top-1/2 z-50 flex -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-2xl outline-none","h-[min(680px,calc(100vh-80px))] w-[min(1000px,calc(100vw-80px))] max-w-[calc(100vw-24px)] max-h-[calc(100vh-24px)]","flex-col sm:flex-row","duration-150 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-[0.98] data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-[0.98]"),style:{boxShadow:"0 40px 120px -32px var(--glass-shadow), 0 12px 40px -20px var(--glass-shadow), inset 0 1px 0 var(--glass-sheen)"},children:[(0,t.jsxs)("aside",{className:"flex shrink-0 flex-col border-b border-border sm:w-[240px] sm:border-b-0 sm:border-r",children:[(0,t.jsxs)("div",{className:"px-4 pt-4",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center gap-1.5",children:[(0,t.jsx)(m._,{size:14,className:"text-muted-foreground"}),(0,t.jsx)("span",{className:"text-[12px] font-medium tracking-tight text-muted-foreground",children:"Beacon"})]}),(0,t.jsx)(i.L,{className:"text-[15px] font-semibold tracking-tight",children:"Settings"}),(0,t.jsx)(c.r,{className:"sr-only",children:"Change appearance, agent, integration and project settings."})]}),(0,t.jsx)("div",{className:"px-3 pb-2 pt-3",children:(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(x.A,{"aria-hidden":!0,className:"pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground"}),(0,t.jsx)("input",{ref:E,type:"text",value:A,onChange:e=>T(e.target.value),"aria-label":"Search settings",placeholder:"Search settings",className:(0,g.cn)("h-8 w-full rounded-lg border border-border bg-transparent pl-8 pr-2.5 text-[13px] outline-none transition-colors","placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/40")})]})}),(0,t.jsx)("nav",{"aria-label":"Settings sections",className:"flex gap-1 overflow-x-auto px-3 pb-3 sm:flex-1 sm:flex-col sm:gap-0.5 sm:overflow-x-visible sm:overflow-y-auto",children:0===P.length?(0,t.jsx)("p",{className:"px-1 py-2 text-[12px] text-muted-foreground",children:"No settings match."}):P.map(e=>(0,t.jsxs)("div",{className:"shrink-0 sm:mt-3 sm:first:mt-1",children:[(0,t.jsx)("p",{className:"hidden px-2 pb-1 text-[10px] font-semibold uppercase tracking-[0.08em] text-muted-foreground/70 sm:block",children:e.label}),(0,t.jsx)("div",{className:"flex gap-1 sm:flex-col sm:gap-0.5",children:e.items.map(e=>{let a=e.id===C;return(0,t.jsxs)("button",{type:"button","aria-current":a?"page":void 0,onClick:()=>S(e.id),className:(0,g.cn)("group flex shrink-0 items-center gap-2 rounded-lg px-2.5 py-1.5 text-left text-[13px] font-medium transition-colors sm:w-full",a?"bg-[var(--ink-active)] text-foreground":"text-muted-foreground hover:bg-[var(--ink-hover)] hover:text-foreground"),children:[e.icon&&(0,t.jsx)("span",{"aria-hidden":!0,className:(0,g.cn)("shrink-0 transition-colors",a?"text-[var(--accent-2,#ff7a45)]":"text-muted-foreground group-hover:text-foreground"),children:e.icon}),e.label]},e.id)})})]},e.label))})]}),(0,t.jsxs)("div",{className:"relative min-w-0 flex-1 overflow-y-auto",children:[(0,t.jsx)(d.H,{"aria-label":"Close settings",className:(0,g.cn)("absolute right-3 top-3 z-10 flex size-7 items-center justify-center rounded-lg text-muted-foreground transition-colors","hover:bg-[var(--ink-hover)] hover:text-foreground focus-visible:ring-[3px] focus-visible:ring-ring/40 focus-visible:outline-none"),children:(0,t.jsx)(p.A,{className:"size-4"})}),(0,t.jsx)("div",{className:"space-y-4 px-5 py-6 sm:px-7 sm:py-7",children:z?.content})]})]})]})})}},52965:(e,a,s)=>{"use strict";s.d(a,{_:()=>r});var t=s(95155);function r({size:e=18,className:a}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"20 22 56 56",fill:"none",className:a,"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M48 33 L72.5 73 L23.5 73 Z",fill:"none",stroke:"var(--accent-2, #ff7a45)",strokeWidth:7,strokeLinejoin:"round",strokeLinecap:"round"}),(0,t.jsx)("circle",{cx:"48",cy:"29.5",r:"7",fill:"var(--accent-2, #ff7a45)"})]})}},67787:(e,a,s)=>{"use strict";s.d(a,{PermissionModeCard:()=>c});var t=s(95155),r=s(12115),n=s(50981),l=s(79984),o=s(26518),i=s(97358);function c(){let[e,a]=(0,r.useState)("default"),[s,c]=(0,r.useState)(!1);async function d(e){a(e),c(!1),await fetch("/api/preferences",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({planApprovalMode:e})}).catch(()=>{}),c(!0)}(0,r.useEffect)(()=>{let e=!0;return fetch("/api/preferences",{cache:"no-store"}).then(e=>e.ok?e.json():null).then(s=>{e&&s&&a(s.planApprovalMode??"default")}).catch(()=>{}),()=>{e=!1}},[]);let u=i.pC.find(a=>a.value===e);return(0,t.jsxs)(l.Zp,{children:[(0,t.jsxs)(l.aR,{children:[(0,t.jsxs)(l.ZB,{className:"flex items-center gap-2 text-base",children:[(0,t.jsx)(n.A,{className:"size-4 text-emerald-400"}),"Permission mode after approval"]}),(0,t.jsx)(l.BT,{children:"When you approve a plan, your terminal session switches to this permission mode. Applies to all projects. (Requires Claude Code 2.1.7+.)"})]}),(0,t.jsxs)(l.Wu,{className:"flex items-center gap-3",children:[(0,t.jsxs)(o.l6,{value:e,onValueChange:e=>e&&void d(e),children:[(0,t.jsx)(o.bq,{className:"h-9 w-64",children:(0,t.jsx)(o.yv,{})}),(0,t.jsx)(o.gC,{children:i.pC.map(e=>(0,t.jsx)(o.eb,{value:e.value,children:e.label},e.value))})]}),u&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:u.description}),s&&(0,t.jsx)("span",{className:"text-xs text-emerald-300",children:"✓ saved"})]})]})}},70569:(e,a,s)=>{Promise.resolve().then(s.bind(s,23319)),Promise.resolve().then(s.bind(s,81453)),Promise.resolve().then(s.bind(s,71423)),Promise.resolve().then(s.bind(s,96759)),Promise.resolve().then(s.bind(s,40755)),Promise.resolve().then(s.bind(s,67787)),Promise.resolve().then(s.bind(s,44642)),Promise.resolve().then(s.bind(s,6539)),Promise.resolve().then(s.bind(s,71265)),Promise.resolve().then(s.t.bind(s,98500,23))},71423:(e,a,s)=>{"use strict";s.d(a,{DangerCard:()=>c});var t=s(95155),r=s(12115),n=s(73321),l=s(65738),o=s(79984),i=s(70521);function c(){let e=(0,n.useRouter)(),[a,s]=(0,r.useState)(!1),[c,d]=(0,r.useState)(!1);async function u(){s(!0);try{(await fetch("/api/reset",{method:"POST"})).ok&&(d(!0),e.refresh())}finally{s(!1)}}return(0,t.jsxs)(o.Zp,{className:"border-red-500/30",children:[(0,t.jsxs)(o.aR,{children:[(0,t.jsx)(o.ZB,{className:"text-base text-red-400",children:"Danger zone"}),(0,t.jsx)(o.BT,{children:"Erases all project data — the map, the database, drafts, the code graph and the generated summary — leaving the panel empty. Your preferences (provider and editor) are kept. This cannot be undone."})]}),(0,t.jsxs)(o.Wu,{className:"flex items-center gap-3",children:[(0,t.jsxs)(i.Lt,{children:[(0,t.jsxs)(i.tv,{className:"inline-flex h-9 items-center gap-2 rounded-lg bg-red-600 px-3 text-sm font-medium text-white transition-colors hover:bg-red-500 disabled:opacity-50",disabled:a,children:[(0,t.jsx)(l.A,{className:"size-4"}),a?"Erasing…":"Erase all data"]}),(0,t.jsxs)(i.EO,{children:[(0,t.jsxs)(i.wd,{children:[(0,t.jsx)(i.r7,{children:"Erase all data?"}),(0,t.jsx)(i.$v,{children:"This permanently removes the map, the database, drafts, the code graph and the project summary. This action cannot be undone."})]}),(0,t.jsxs)(i.ck,{children:[(0,t.jsx)(i.Zr,{children:"Cancel"}),(0,t.jsx)(i.Rx,{onClick:u,className:"bg-red-600 text-white hover:bg-red-500",children:"Yes, erase everything"})]})]})]}),c&&(0,t.jsx)("span",{className:"text-xs text-red-300",children:"✓ data erased"})]})]})}},79984:(e,a,s)=>{"use strict";s.d(a,{BT:()=>c,Wu:()=>d,ZB:()=>i,Zp:()=>l,aR:()=>o});var t=s(95155);s(12115);var r=s(91337),n=s(82099);function l({className:e,...a}){return(0,t.jsx)(n.b,{"data-slot":"card",className:(0,r.cn)("text-card-foreground flex flex-col gap-6 rounded-2xl py-6",e),...a})}function o({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...a})}function i({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("leading-none font-semibold",e),...a})}function c({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-muted-foreground text-sm",e),...a})}function d({className:e,...a}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-6",e),...a})}},81453:(e,a,s)=>{"use strict";s.d(a,{ContextCard:()=>o});var t=s(95155),r=s(12115),n=s(79984),l=s(4474);function o(){let[e,a]=(0,r.useState)(null),[s,o]=(0,r.useState)(!1);async function i(){o(!0),a(null);try{let e=await fetch("/api/context",{method:"POST"});if(!e.ok)return void a(await e.text());let s=await e.json();a(s.files?.length?`Updated: ${s.files.map(e=>e.split("/").pop()).join(" + ")}`:"Nothing to update")}catch{a("Failed")}finally{o(!1)}}return(0,t.jsxs)(n.Zp,{children:[(0,t.jsxs)(n.aR,{children:[(0,t.jsx)(n.ZB,{className:"text-base",children:"Context for the AI"}),(0,t.jsxs)(n.BT,{children:["Generates ",(0,t.jsx)("span",{className:"font-mono",children:"AGENTS.md"})," (read by Cursor/Codex/Aider) and makes sure ",(0,t.jsx)("span",{className:"font-mono",children:"CLAUDE.md"})," imports it (Claude Code reads CLAUDE.md), from the current map."]})]}),(0,t.jsxs)(n.Wu,{className:"flex flex-wrap items-center gap-3",children:[(0,t.jsx)(l.$,{size:"sm",disabled:s,onClick:i,children:s?"Generating…":"Update AGENTS.md + CLAUDE.md"}),e&&(0,t.jsx)("span",{className:"text-xs text-muted-foreground",children:e})]})]})}},96759:(e,a,s)=>{"use strict";s.d(a,{DeleteWorkspaceCard:()=>c});var t=s(95155),r=s(12115),n=s(73321),l=s(65738),o=s(79984),i=s(70521);function c({id:e,name:a}){let s=(0,n.useRouter)(),[d,u]=(0,r.useState)(!1);async function h(){u(!0);try{let a=await fetch("/api/workspace",{method:"DELETE",headers:{"content-type":"application/json"},body:JSON.stringify({id:e})});if(a.ok){let{fallbackId:e}=await a.json();document.cookie=e?`beacon_ws=${e}; Path=/; Max-Age=31536000; SameSite=Lax`:"beacon_ws=; Path=/; Max-Age=0; SameSite=Lax",s.refresh()}}finally{u(!1)}}return(0,t.jsxs)(o.Zp,{className:"border-red-500/30",children:[(0,t.jsxs)(o.aR,{children:[(0,t.jsx)(o.ZB,{className:"text-base text-red-400",children:"Delete this workspace"}),(0,t.jsxs)(o.BT,{children:["Removes ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:a})," ","from Beacon and erases all of its Beacon data — the map, the database, drafts and the code graph. The repository's files on disk are untouched. This cannot be undone."]})]}),(0,t.jsx)(o.Wu,{className:"flex items-center gap-3",children:(0,t.jsxs)(i.Lt,{children:[(0,t.jsxs)(i.tv,{className:"inline-flex h-9 items-center gap-2 rounded-lg bg-red-600 px-3 text-sm font-medium text-white transition-colors hover:bg-red-500 disabled:opacity-50",disabled:d,children:[(0,t.jsx)(l.A,{className:"size-4"}),d?"Deleting…":"Delete workspace"]}),(0,t.jsxs)(i.EO,{children:[(0,t.jsxs)(i.wd,{children:[(0,t.jsxs)(i.r7,{children:["Delete workspace “",a,"”?"]}),(0,t.jsx)(i.$v,{children:"This permanently removes the workspace from Beacon and erases its data — the map, the database, drafts and the code graph. Your code is not affected; only Beacon's data for this repository is erased. This action cannot be undone."})]}),(0,t.jsxs)(i.ck,{children:[(0,t.jsx)(i.Zr,{children:"Cancel"}),(0,t.jsx)(i.Rx,{onClick:h,className:"bg-red-600 text-white hover:bg-red-500",children:"Yes, delete workspace"})]})]})]})})]})}},97358:(e,a,s)=>{"use strict";s.d(a,{pC:()=>t});let t=[{value:"default",label:"Manual approval",description:"Approve each tool call yourself — Claude Code's default."},{value:"acceptEdits",label:"Auto-accept edits",description:"Auto-approve file edits; still ask before running other tools."},{value:"bypassPermissions",label:"Bypass permissions",description:"Auto-approve every tool call (like --dangerously-skip-permissions)."},{value:"auto",label:"Auto",description:"Autonomous, gated by a safety classifier (needs a recent Claude Code + Sonnet 4.6+)."}]}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6818],{4474:(e,t,a)=>{a.d(t,{$:()=>d});var r=a(95155),n=a(6539),i=a(18460),s=a(91337);let o=(0,i.F)("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function d({className:e,variant:t="default",size:a="default",...i}){return(0,r.jsx)(n.Button,{"data-slot":"button",className:(0,s.cn)(o({variant:t,size:a,className:e})),...i})}},26518:(e,t,a)=>{a.d(t,{TR:()=>C,bq:()=>_,eb:()=>S,gC:()=>E,l6:()=>y,s3:()=>k,yv:()=>N});var r=a(95155);a(12115);var n=a(40595),i=a(93338),s=a(41294),o=a(75681),d=a(17314),l=a(37265),u=a(23107),c=a(70826),g=a(67564),f=a(86017),p=a(1938),m=a(15433),x=a(5919),v=a(45450),b=a(88988),h=a(91337),z=a(12363),w=a(64577),j=a(94088);let y=n.H;function k({className:e,...t}){return(0,r.jsx)(i.s,{"data-slot":"select-group",className:(0,h.cn)("scroll-my-1 p-1",e),...t})}function N({className:e,...t}){return(0,r.jsx)(s.y,{"data-slot":"select-value",className:(0,h.cn)("flex flex-1 text-left",e),...t})}function _({className:e,size:t="default",children:a,...n}){return(0,r.jsxs)(o.b,{"data-slot":"select-trigger","data-size":t,className:(0,h.cn)("flex w-fit items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...n,children:[a,(0,r.jsx)(d.w,{render:(0,r.jsx)(z.A,{className:"pointer-events-none size-4 text-muted-foreground"})})]})}function E({className:e,children:t,side:a="bottom",sideOffset:n=4,align:i="center",alignOffset:s=0,alignItemWithTrigger:o=!0,...d}){return(0,r.jsx)(l.V,{children:(0,r.jsx)(u.l,{side:a,sideOffset:n,align:i,alignOffset:s,alignItemWithTrigger:o,className:"isolate z-50",children:(0,r.jsxs)(c.t,{"data-slot":"select-content","data-align-trigger":o,className:(0,h.cn)("relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...d,children:[(0,r.jsx)($,{}),(0,r.jsx)(g.B,{children:t}),(0,r.jsx)(I,{})]})})})}function C({className:e,...t}){return(0,r.jsx)(f.M,{"data-slot":"select-label",className:(0,h.cn)("px-1.5 py-1 text-xs text-muted-foreground",e),...t})}function S({className:e,children:t,...a}){return(0,r.jsxs)(p.e,{"data-slot":"select-item",className:(0,h.cn)("relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...a,children:[(0,r.jsx)(m.h,{className:"flex flex-1 shrink-0 gap-2 whitespace-nowrap",children:t}),(0,r.jsx)(x.h,{render:(0,r.jsx)("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:(0,r.jsx)(w.A,{className:"pointer-events-none"})})]})}function $({className:e,...t}){return(0,r.jsx)(v.w,{"data-slot":"select-scroll-up-button",className:(0,h.cn)("top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:(0,r.jsx)(j.A,{})})}function I({className:e,...t}){return(0,r.jsx)(b.d,{"data-slot":"select-scroll-down-button",className:(0,h.cn)("bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4",e),...t,children:(0,r.jsx)(z.A,{})})}},39658:(e,t,a)=>{a.d(t,{p:()=>i});var r=a(95155);a(12115);var n=a(91337);function i({className:e,type:t,...a}){return(0,r.jsx)("input",{type:t,"data-slot":"input",className:(0,n.cn)("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",e),...a})}},60292:(e,t,a)=>{a.d(t,{Bz:()=>r,Fj:()=>o,aE:()=>i,dh:()=>s,fk:()=>n,q0:()=>d});let r="beacon:tab-ws";function n(){var e;let t=new URLSearchParams(window.location.search).get("ws"),a=null;try{t&&sessionStorage.setItem(r,t),a=sessionStorage.getItem(r)}catch{}return e=a,t||e||null}function i(e){try{sessionStorage.setItem(r,e)}catch{}}function s(e){return e?{"x-beacon-workspace":e}:{}}function o(e,t,a){let r=new URLSearchParams;for(let[e,n]of(t&&r.set("ws",t),Object.entries(a??{})))r.set(e,n);let n=r.toString();return n?`${e}?${n}`:e}function d(e,t){if(e.startsWith("/api/"))return!0;try{let a=new URL(e,t);return a.origin===t&&a.pathname.startsWith("/api/")}catch{return!1}}},70521:(e,t,a)=>{a.d(t,{$v:()=>j,EO:()=>b,Lt:()=>p,Rx:()=>y,Zr:()=>k,ck:()=>z,r7:()=>w,tv:()=>m,wd:()=>h});var r=a(95155);a(12115);var n=a(25381),i=a(7121),s=a(51880),o=a(35176),d=a(11248),l=a(82022),u=a(98758),c=a(45362),g=a(91337),f=a(4474);function p({...e}){return(0,r.jsx)(n.V,{"data-slot":"alert-dialog",...e})}function m({...e}){return(0,r.jsx)(i.t,{"data-slot":"alert-dialog-trigger",...e})}function x({...e}){return(0,r.jsx)(s.Z,{"data-slot":"alert-dialog-portal",...e})}function v({className:e,...t}){return(0,r.jsx)(o.X,{"data-slot":"alert-dialog-overlay",className:(0,g.cn)("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function b({className:e,size:t="default",...a}){return(0,r.jsxs)(x,{children:[(0,r.jsx)(v,{}),(0,r.jsx)(d.h,{"data-slot":"alert-dialog-content","data-size":t,className:(0,g.cn)("group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...a})]})}function h({className:e,...t}){return(0,r.jsx)("div",{"data-slot":"alert-dialog-header",className:(0,g.cn)("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function z({className:e,...t}){return(0,r.jsx)("div",{"data-slot":"alert-dialog-footer",className:(0,g.cn)("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function w({className:e,...t}){return(0,r.jsx)(l.L,{"data-slot":"alert-dialog-title",className:(0,g.cn)("font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function j({className:e,...t}){return(0,r.jsx)(u.r,{"data-slot":"alert-dialog-description",className:(0,g.cn)("text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}function y({className:e,variant:t,size:a,...n}){return(0,r.jsx)(c.H,{"data-slot":"alert-dialog-action",className:(0,g.cn)(e),render:(0,r.jsx)(f.$,{variant:t,size:a}),...n})}function k({className:e,variant:t="outline",size:a="default",...n}){return(0,r.jsx)(c.H,{"data-slot":"alert-dialog-cancel",className:(0,g.cn)(e),render:(0,r.jsx)(f.$,{variant:t,size:a}),...n})}},82099:(e,t,a)=>{a.d(t,{b:()=>i});var r=a(95155);a(12115);var n=a(91337);function i({className:e,children:t,...a}){return(0,r.jsxs)("div",{className:(0,n.cn)("glass relative isolate overflow-hidden",e),...a,children:[(0,r.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 -z-10 rounded-[inherit]",style:{background:"radial-gradient(90% 60% at 0% 0%, oklch(1 0 0 / 0.04), transparent 42%)"}}),(0,r.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute inset-0 -z-10 rounded-[inherit] opacity-[0.035] mix-blend-overlay",style:{backgroundImage:"url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E\")",backgroundSize:"120px 120px"}}),t]})}},91337:(e,t,a)=>{a.d(t,{cn:()=>i});var r=a(29722),n=a(622);function i(...e){return(0,n.QP)((0,r.$)(e))}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8653],{2060:(e,t,r)=>{r.d(t,{G:()=>a});var n=r(12115);function a(){let[e,t]=(0,n.useState)("dark");return(0,n.useEffect)(()=>{let e=()=>"light"===document.documentElement.dataset.theme?"light":"dark";t(e());let r=new MutationObserver(()=>t(e()));return r.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","class"]}),()=>r.disconnect()},[]),e}},9991:(e,t,r)=>{r.d(t,{X:()=>c});var n=r(95155),a=r(12115),s=r(65377),o=r(9005),l=r(91337),i=r(56614);function d(e){if(!e||!e.tagName)return!1;let t=e.tagName;return"INPUT"===t||"TEXTAREA"===t||"SELECT"===t||e.isContentEditable}function c({query:e,onQuery:t,hits:r,onPick:u,onZoomToMatches:x,placeholder:p="Search…"}){let[m,f]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{let e=e=>{m||e.metaKey||e.ctrlKey||e.altKey||1!==e.key.length||" "===e.key||d(e.target)||d(document.activeElement)||(e.preventDefault(),f(!0),t(e.key))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[m,t]),(0,n.jsxs)(i.er,{title:"Search",open:m,onOpenChange:e=>e?f(!0):void(f(!1),t("")),outsideClicksToClose:2,trigger:(t,r)=>(0,n.jsx)("button",{type:"button",onClick:r,title:"Search this canvas",className:(0,l.cn)("glass flex size-8 items-center justify-center rounded-lg transition-colors",t||e.trim()?"text-foreground":"text-muted-foreground hover:text-foreground"),children:(0,n.jsx)(s.A,{className:"size-4"})}),children:[(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsx)("input",{autoFocus:!0,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{"Enter"===e.key&&x&&(e.preventDefault(),x())},placeholder:p,className:"w-full rounded-md border border-border bg-[var(--ink-hover)] py-1 pl-2 pr-7 text-[12px] outline-none placeholder:text-muted-foreground/50 focus:bg-[var(--ink-active)]"}),e&&(0,n.jsx)("button",{type:"button",onClick:()=>t(""),title:"Clear search",className:"absolute right-1 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center rounded text-muted-foreground/60 transition-colors hover:bg-[var(--ink-hover)] hover:text-foreground",children:(0,n.jsx)(o.A,{className:"size-3.5"})})]}),(0,n.jsxs)("div",{className:"mt-2 max-h-64 space-y-0.5 overflow-y-auto",children:[e.trim()&&0===r.length&&(0,n.jsx)("div",{className:"px-1 py-1 text-[11px] text-muted-foreground",children:"No matches"}),r.map(e=>(0,n.jsxs)("button",{type:"button",onClick:()=>{u(e.id),f(!1)},className:"group flex w-full items-center gap-2 rounded-md px-2 py-1 text-left transition-colors hover:bg-[var(--ink-hover)]",children:[(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate text-[12px] text-muted-foreground transition-colors group-hover:text-foreground",children:e.label}),e.sublabel&&(0,n.jsx)("span",{className:"shrink-0 text-[10px] uppercase tracking-wide text-muted-foreground/50",children:e.sublabel})]},e.id))]})]})}},12410:(e,t,r)=>{r.d(t,{a2:()=>o,i3:()=>d,xZ:()=>l});let n=["bg-emerald-500/15 text-emerald-700 dark:text-emerald-300","bg-sky-500/15 text-sky-700 dark:text-sky-300","bg-violet-500/15 text-violet-700 dark:text-violet-300","bg-amber-500/15 text-amber-700 dark:text-amber-200","bg-rose-500/15 text-rose-700 dark:text-rose-300","bg-cyan-500/15 text-cyan-700 dark:text-cyan-300","bg-fuchsia-500/15 text-fuchsia-700 dark:text-fuchsia-300","bg-lime-500/15 text-lime-700 dark:text-lime-300","bg-orange-500/15 text-orange-700 dark:text-orange-300","bg-teal-500/15 text-teal-700 dark:text-teal-300","bg-indigo-500/15 text-indigo-700 dark:text-indigo-300","bg-pink-500/15 text-pink-700 dark:text-pink-300"],a=["border-emerald-500/20 bg-emerald-500/[0.04]","border-sky-500/20 bg-sky-500/[0.04]","border-violet-500/20 bg-violet-500/[0.04]","border-amber-500/20 bg-amber-500/[0.04]","border-rose-500/20 bg-rose-500/[0.04]","border-cyan-500/20 bg-cyan-500/[0.04]","border-fuchsia-500/20 bg-fuchsia-500/[0.04]","border-lime-500/20 bg-lime-500/[0.04]","border-orange-500/20 bg-orange-500/[0.04]","border-teal-500/20 bg-teal-500/[0.04]","border-indigo-500/20 bg-indigo-500/[0.04]","border-pink-500/20 bg-pink-500/[0.04]"];function s(e){let t=(e??"").trim().toUpperCase();if(!t)return null;let r=0;for(let e=0;e<t.length;e++)r=31*r+t.charCodeAt(e)>>>0;return r%n.length}function o(e){let t=s(e);return null===t?"bg-[var(--ink-active)] text-muted-foreground":n[t]}function l(e){let t=s(e);return null===t?"border-border bg-[var(--ink-hover)]":a[t]}let i=["#34d399","#38bdf8","#a78bfa","#fbbf24","#fb7185","#22d3ee","#e879f9","#a3e635","#fb923c","#2dd4bf","#818cf8","#f472b6"];function d(e){let t=s(e);return null===t?"#9ca3af":i[t]}},14983:(e,t,r)=>{r.d(t,{$$:()=>o,Qk:()=>s,RU:()=>n,Uy:()=>a,jF:()=>l,r2:()=>c,sQ:()=>i,zn:()=>d});let n="0 0 0 3px var(--accent-2,#ff7a45), 0 0 32px -2px var(--accent-2,#ff7a45)",a=.14;function s(e,t){let r=t.trim().toLowerCase();if(!r)return!1;for(let t of e)if(t&&t.toLowerCase().includes(r))return!0;return!1}function o(e){return[e.title,e.role,e.plain,e.cluster,e.status].filter(Boolean)}function l(e){let t=[e.name,e.domain,e.description];for(let r of e.columns??[])t.push(r.name,r.type,r.note);return t.filter(Boolean)}function i(e){return[e.method,e.path,e.domain,e.description].filter(Boolean)}function d(e){return[e.path,e.lang].filter(Boolean)}function c(e,t,r,n,a=12){let o=t.trim().toLowerCase();if(!o)return[];let l=[];for(let t of e){if(!s(r(t),o))continue;let e=n(t);l.push({hit:e,score:function(e,t){let r=e.toLowerCase();return r===t?0:r.startsWith(t)?1:RegExp(`(^|[^a-z0-9])${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}`,"i").test(e)?2:r.includes(t)?3:4}(e.label,o)})}return l.sort((e,t)=>e.score-t.score||e.hit.label.length-t.hit.label.length),l.slice(0,a).map(e=>e.hit)}},16607:(e,t,r)=>{r.d(t,{d:()=>c});var n=r(95155),a=r(24413),s=r(9005),o=r(78780),l=r(76721),i=r(82099),d=r(91337);function c({steps:e,index:t,onPrev:r,onNext:u,onExit:x,onGoto:p}){let m=e[t];if(!m)return null;let f=t===e.length-1;return(0,n.jsxs)(i.b,{className:"absolute bottom-3 left-3 top-16 z-10 flex w-72 flex-col rounded-2xl",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-3.5 py-2.5",children:[(0,n.jsxs)("span",{className:"flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:[(0,n.jsx)(a.A,{className:"size-3.5"}),"Guided tour"]}),(0,n.jsx)("button",{onClick:x,title:"End tour (Esc)",className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-foreground",children:(0,n.jsx)(s.A,{className:"size-4"})})]}),(0,n.jsxs)("div",{className:"border-b border-border px-3.5 py-3",children:[(0,n.jsxs)("div",{className:"text-[10px] font-medium uppercase tracking-wide text-[var(--accent-2,#ff7a45)]",children:["Step ",t+1," / ",e.length]}),(0,n.jsx)("h2",{className:"mt-1 break-words text-sm font-semibold leading-tight",children:m.title}),(0,n.jsx)("p",{className:"mt-1 text-[11px] leading-snug text-muted-foreground",children:m.summary})]}),(0,n.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-1.5",children:(0,n.jsx)("ol",{className:"space-y-0.5",children:e.map((e,r)=>(0,n.jsx)("li",{children:(0,n.jsxs)("button",{onClick:()=>p(r),title:e.title,className:(0,d.cn)("flex w-full items-center gap-2 rounded-md px-2 py-1.5 text-left transition-colors",r===t?"bg-[var(--ink-active)] text-foreground":"text-muted-foreground hover:bg-[var(--ink-hover)] hover:text-foreground"),children:[(0,n.jsx)("span",{className:(0,d.cn)("flex size-4 shrink-0 items-center justify-center rounded-full text-[9px] font-bold",r===t?"bg-[var(--accent-2,#ff7a45)] text-background":"bg-[var(--ink-active)] text-muted-foreground"),children:r+1}),(0,n.jsx)("span",{className:"truncate text-[11px]",children:e.title})]})},e.id))})}),(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2 border-t border-border p-2",children:[(0,n.jsxs)("button",{onClick:r,disabled:0===t,className:"flex items-center gap-1 rounded-md px-2 py-1.5 text-[11px] text-muted-foreground transition-colors enabled:hover:bg-[var(--ink-hover)] enabled:hover:text-foreground disabled:opacity-40",children:[(0,n.jsx)(o.A,{className:"size-3.5"})," Prev"]}),f?(0,n.jsx)("button",{onClick:x,className:"rounded-md bg-[var(--accent-2,#ff7a45)]/90 px-3 py-1.5 text-[11px] font-semibold text-background transition-colors hover:bg-[var(--accent-2,#ff7a45)]",children:"Done"}):(0,n.jsxs)("button",{onClick:u,className:"flex items-center gap-1 rounded-md bg-foreground/10 px-3 py-1.5 text-[11px] font-semibold text-foreground transition-colors hover:bg-foreground/20",children:["Next ",(0,n.jsx)(l.A,{className:"size-3.5"})]})]})]})}},17918:(e,t,r)=>{r.d(t,{Sh:()=>c,V5:()=>d,e0:()=>x});var n=r(95155),a=r(12115),s=r(81750),o=r(6266),l=r(9005),i=r(91337);let d="#ff7a45";function c({data:e,selected:t}){let[r,u]=(0,a.useState)(e.text);return(0,a.useEffect)(()=>{u(e.text)},[e.text]),(0,n.jsxs)("div",{onClick:()=>e.onClick?.(e.annotationId),className:(0,i.cn)("group/anno relative w-[270px] rounded-xl border border-border bg-card/95 px-4 py-3 shadow-[0_18px_50px_-20px_rgba(0,0,0,0.9)] backdrop-blur transition-colors hover:border-foreground/20 dark:bg-[#1b1b1e]/95 dark:hover:border-white/20",!e.editable&&"cursor-pointer",t&&"border-[#ff7a45]/50"),children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"pointer-events-none absolute -left-px bottom-2 top-2 w-[3px] rounded-full",style:{background:d}}),(0,n.jsx)(s.h7,{type:"target",id:"in",position:o.yX.Top,isConnectable:!1,className:"!pointer-events-none !size-1 !min-h-0 !min-w-0 !border-0 !bg-transparent",style:{left:"auto",right:22,top:0}}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("div",{className:"font-mono text-[10px] font-semibold uppercase tracking-[0.22em]",style:{color:d},children:"Annotation \xb7 You"}),e.editable&&e.onDelete&&(0,n.jsx)("button",{type:"button",title:"Delete annotation",onClick:t=>{t.stopPropagation(),e.onDelete?.(e.annotationId)},className:"nodrag nopan -mr-1 rounded p-0.5 text-muted-foreground/60 opacity-0 transition-opacity hover:text-red-300 group-hover/anno:opacity-100",children:(0,n.jsx)(l.A,{className:"size-3"})})]}),e.editable?(0,n.jsx)("textarea",{value:r,autoFocus:!e.text.trim(),placeholder:"Type your annotation…",onChange:e=>u(e.target.value),onBlur:()=>{r!==e.text&&e.onChangeText?.(e.annotationId,r)},onKeyDown:e=>e.stopPropagation(),className:"nodrag nopan field-sizing-content mt-1.5 max-h-40 min-h-[2.25rem] w-full resize-none overflow-y-auto bg-transparent text-[13px] leading-snug text-foreground/95 outline-none placeholder:text-muted-foreground/60"}):(0,n.jsx)("div",{className:"mt-1.5 max-h-40 overflow-y-auto text-[13px] leading-snug text-foreground/95",children:e.text.trim()?e.text:(0,n.jsx)("span",{className:"text-muted-foreground",children:"…"})})]})}function u({n:e,annotationId:t,onClick:r}){return(0,n.jsxs)("button",{type:"button",title:`Annotation ${e} — view comment`,onClick:e=>{e.stopPropagation(),r?.(t)},className:"nodrag nopan relative flex size-6 items-center justify-center rounded-full font-mono text-[11px] font-bold text-[#181818] shadow-[0_0_0_3px_rgba(255,122,69,0.22),0_0_16px_2px_rgba(255,122,69,0.4)] transition-transform hover:scale-110",style:{background:d},children:[e,(0,n.jsx)(s.h7,{type:"source",id:`pin-${t}`,position:o.yX.Bottom,isConnectable:!1,className:"!pointer-events-none !size-1 !min-h-0 !min-w-0 !border-0 !bg-transparent",style:{left:"50%",bottom:2}})]})}function x({pins:e,onPinClick:t}){return e.length?(0,n.jsx)("span",{className:"absolute -right-3 top-1/2 z-10 flex -translate-y-1/2 flex-row-reverse gap-1",children:e.map(e=>(0,n.jsx)(u,{n:e.n,annotationId:e.id,onClick:t},e.id))}):null}},18874:(e,t,r)=>{r.d(t,{F1:()=>m,VY:()=>d,e6:()=>s,gG:()=>p,gX:()=>u,qA:()=>a,ru:()=>o});let n={auth:"#4ea1ff",firms:"#c792ea",search:"#7bd389",storage:"#ffb86b",petitions:"#ff7a45",monitoring:"#f5b942",admin:"#ff6b9d"};function a(e){return e&&n[e]||"#8a8a8a"}let s={GET:"#7bd389",POST:"#4ea1ff",PUT:"#ffb86b",PATCH:"#ffb86b",DELETE:"#ff3860"},o={read:"#4ea1ff",write:"#ffb86b","read-write":"#c792ea"},l="text-[#4b5563] dark:text-[#8a8a8a]",i={GET:"text-[#15803d] dark:text-[#7bd389]",POST:"text-[#1d4ed8] dark:text-[#4ea1ff]",PUT:"text-[#b45309] dark:text-[#ffb86b]",PATCH:"text-[#b45309] dark:text-[#ffb86b]",DELETE:"text-[#be123c] dark:text-[#ff3860]"};function d(e){return e&&i[e]||l}let c={read:"text-[#1d4ed8] dark:text-[#4ea1ff]",write:"text-[#b45309] dark:text-[#ffb86b]","read-write":"text-[#6d28d9] dark:text-[#c792ea]"};function u(e){return e&&c[e]||l}let x={auth:"text-[#1d4ed8] dark:text-[#4ea1ff]",firms:"text-[#6d28d9] dark:text-[#c792ea]",search:"text-[#15803d] dark:text-[#7bd389]",storage:"text-[#b45309] dark:text-[#ffb86b]",petitions:"text-[#c2410c] dark:text-[#ff7a45]",monitoring:"text-[#b45309] dark:text-[#f5b942]",admin:"text-[#be185d] dark:text-[#ff6b9d]"};function p(e){return e&&x[e]||l}function m(e,t){let r=new Set([e]);for(let n of t)n.source===e&&r.add(n.target),n.target===e&&r.add(n.source);return r}},24692:(e,t,r)=>{r.d(t,{I:()=>d});var n=r(95155),a=r(12115),s=r(81750),o=r(6266),l=r(65738),i=r(28736);function d(e){let{deleteElements:t}=(0,s.VH)(),r=(0,s.JY)(e.source),d=(0,s.JY)(e.target),c=(0,s.pk)(),u=r&&d?(0,i.U)(r,d):null,x=(0,a.useMemo)(()=>c.filter(t=>t.id!==e.source&&t.id!==e.target).map(e=>({x:e.position.x,y:e.position.y,w:e.measured?.width??e.width??0,h:e.measured?.height??e.height??0})).filter(e=>e.w>0&&e.h>0),[c,e.source,e.target]),p=u?(0,i.ZH)(u.sx,u.sy,u.tx,u.ty,x):null,[m,f,h]=(0,o.Fp)(u?{sourceX:u.sx,sourceY:u.sy,sourcePosition:u.sourcePos,targetX:u.tx,targetY:u.ty,targetPosition:u.targetPos}:{sourceX:e.sourceX,sourceY:e.sourceY,sourcePosition:e.sourcePosition,targetX:e.targetX,targetY:e.targetY,targetPosition:e.targetPosition}),g=p?.path??m,b=p?.labelX??f,v=p?.labelY??h;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.tE,{id:e.id,path:g,style:e.style,markerEnd:e.markerEnd,interactionWidth:20}),e.label&&(0,n.jsx)(s.rV,{children:(0,n.jsx)("div",{style:{position:"absolute",transform:`translate(-50%, -120%) translate(${b}px, ${v}px)`,fontSize:11,color:"#cfcfcf",background:"#161616",padding:"1px 4px",borderRadius:4,pointerEvents:"none",zIndex:1e3},children:e.label})}),e.selected&&(0,n.jsx)(s.rV,{children:(0,n.jsx)("div",{className:"nodrag nopan",style:{position:"absolute",transform:`translate(-50%, 0) translate(${b}px, ${v+14}px)`,pointerEvents:"all",zIndex:1e3},children:(0,n.jsx)("button",{type:"button",onMouseDown:e=>e.stopPropagation(),onClick:r=>{r.stopPropagation(),t({edges:[{id:e.id}]})},title:"Delete (or press Backspace)",className:"flex size-7 items-center justify-center rounded-full border border-border bg-card/95 text-red-300 shadow-lg backdrop-blur-md transition-colors hover:bg-red-500/25 hover:text-red-200",children:(0,n.jsx)(l.A,{className:"size-3.5"})})})})]})}},28161:(e,t,r)=>{r.d(t,{A6:()=>i,An:()=>d,RR:()=>n,YG:()=>o,ZD:()=>l,jR:()=>s});let n=["frontend","backend","fullstack"],a={fe:"frontend",front:"frontend",be:"backend",back:"backend",fs:"fullstack","full-stack":"fullstack","full stack":"fullstack"};function s(e){let t=(e??"").trim().toLowerCase();return t?n.includes(t)?t:a[t]??null:null}let o={frontend:{label:"Frontend",short:"FE"},backend:{label:"Backend",short:"BE"},fullstack:{label:"Fullstack",short:"FS"}},l={frontend:"#5AC8FA",backend:"#3ECF8E",fullstack:"#5AC8FA"};function i(e){return"fullstack"!==e?l[e]:`linear-gradient(to bottom, ${l.frontend} 0%, ${l.frontend} 50%, ${l.backend} 50%, ${l.backend} 100%)`}let d=/\.(tsx|jsx|vue|svelte)$/i},28736:(e,t,r)=>{r.d(t,{U:()=>l,ZH:()=>i,u1:()=>d});var n=r(6266);function a(e){let{x:t,y:r}=e.internals.positionAbsolute,n=e.measured?.width??0,a=e.measured?.height??0;return{x:t,y:r,w:n,h:a,cx:t+n/2,cy:r+a/2}}function s(e,t){let r=a(e),n=a(t),s=r.w/2||1,o=r.h/2||1,l=(n.cx-r.cx)/(2*s)-(n.cy-r.cy)/(2*o),i=(n.cx-r.cx)/(2*s)+(n.cy-r.cy)/(2*o),d=1/(Math.abs(l)+Math.abs(i)||1);return{x:s*d*(l+i)+r.cx,y:o*d*(-l+i)+r.cy}}function o(e,t){let r=a(e),s=Math.round(t.x),o=Math.round(t.y);return s<=Math.round(r.x)+1?n.yX.Left:s>=Math.round(r.x+r.w)-1?n.yX.Right:o<=Math.round(r.y)+1?n.yX.Top:n.yX.Bottom}function l(e,t){let r=s(e,t),n=s(t,e);return{sx:r.x,sy:r.y,tx:n.x,ty:n.y,sourcePos:o(e,r),targetPos:o(t,n)}}function i(e,t,r,n,a){let s=a.filter(a=>(function(e,t,r,n,a){let s=a.x-14,o=a.x+a.w+14,l=a.y-14,i=a.y+a.h+14;if(Math.max(e,r)<s||Math.min(e,r)>o||Math.max(t,n)<l||Math.min(t,n)>i)return!1;for(let a=1;a<24;a++){let d=a/24,c=e+(r-e)*d,u=t+(n-t)*d;if(c>=s&&c<=o&&u>=l&&u<=i)return!0}return!1})(e,t,r,n,a));if(!s.length)return null;let o=(e+r)/2,l=(t+n)/2,i=Math.min(...s.map(e=>e.y))-14-26,d=Math.max(...s.map(e=>e.y+e.h))+14+26,c=Math.abs(i-l)<=Math.abs(d-l)?i:d,u=e+(r-e)*.25,x=e+(r-e)*.75;return{path:`M ${e},${t} C ${u},${c} ${x},${c} ${r},${n}`,labelX:o,labelY:c}}function d(e,t){let r=e.x+e.w/2,n=e.y+e.h/2,a=t.x-r,s=t.y-n;if(0===a&&0===s)return{x:r,y:n};let o=1/Math.max(Math.abs(a)/(e.w/2||1),Math.abs(s)/(e.h/2||1));return{x:r+a*o,y:n+s*o}}},29523:(e,t,r)=>{r.d(t,{J:()=>l,k:()=>o});var n=r(12115),a=r(81750),s=r(70221);function o(e){let[t,r]=(0,n.useState)("full"),o=(0,a.Pj)(r=>(0,s.gt)(r.transform[2],t,e));return o!==t&&r(o),o}function l({onLod:e,thresholds:t}){let r=o(t),a=(0,n.useRef)(null);return(0,n.useEffect)(()=>{a.current!==r&&(a.current=r,e(r))},[r,e]),null}},29813:(e,t,r)=>{r.d(t,{to:()=>a});var n=r(94014);function a(e,t,r={}){if(0===e.length)return new Map;let s=function(e,t){let r=e.map(e=>e.id).sort(),n=new Map(r.map(e=>[e,[]]));for(let e of[...t].sort((e,t)=>e.fromId.localeCompare(t.fromId)||e.toId.localeCompare(t.toId)))n.get(e.fromId)?.push(e);let a=new Map,s=[],o=e=>{for(let t of(a.set(e,"visiting"),n.get(e)??[])){let e=a.get(t.toId);"visiting"!==e&&(s.push(t),"done"!==e&&o(t.toId))}a.set(e,"done")};for(let e of r)a.has(e)||o(e);return s}(e,t),o=function(e,t){let r=new Map(e.map(e=>[e.id,[]]));for(let e of t)r.get(e.fromId)?.push(e.toId);let n=new Map,a=e=>{let t=n.get(e);if(void 0!==t)return t;n.set(e,0);let s=r.get(e)??[],o=s.length?1+Math.max(...s.map(a)):0;return n.set(e,o),o};for(let t of e)a(t.id);return n}(e,s),l=new Map(e.map(e=>[e.id,[]]));for(let e of s)l.get(e.fromId)?.push(e.toId);let i=Array.from(new Set(e.map(e=>e.group))),d=i.filter(e=>"—"!==e).sort(),c=i.includes("—")?[...d,"—"]:d,u=[];for(let t of c){let r=e.filter(e=>e.group===t),n=Math.min(...r.map(e=>o.get(e.id)??0)),a=Math.max(...r.map(e=>o.get(e.id)??0)),s=new Map,i=new Map,d=0,c=0;for(let e=n;e<=a;e++){let t=r.filter(t=>o.get(t.id)===e);if(!t.length)continue;let n=e=>{let t=(l.get(e.id)??[]).map(e=>i.get(e)).filter(e=>void 0!==e);return t.length?t.reduce((e,t)=>e+t,0)/t.length:1/0};t.sort((e,t)=>n(e)-n(t)||e.id.localeCompare(t.id));let a=Math.max(1,Math.ceil(Math.sqrt(2*t.length))),u=[];t.forEach((e,t)=>{let r=Math.floor(t/a),n=t%a;i.set(e.id,n);let o=u[r]??0;s.set(e.id,{x:d+360*r,y:o}),u[r]=o+(e.h??150),c=Math.max(c,u[r])}),d+=360*Math.ceil(t.length/a)}u.push({d:t,w:d,h:Math.max(c,150),local:s})}let x=(0,n.Xi)(u.map(e=>({id:e.d,w:e.w,h:e.h})),{gapX:84,gapY:80,viewportAspect:r.viewportAspect,minBandW:1080,aspectSlack:1.5}),p=new Map;for(let e of u){let t=x.get(e.d);for(let[r,n]of e.local)p.set(r,{x:t.x+n.x,y:t.y+n.y})}return p}},36849:(e,t,r)=>{r.d(t,{Gg:()=>s,VI:()=>i});var n=r(43137),a=r(94014);function s(e){let t=(e.stateName??"").trim();if(!t)return e.status;let r=n.nR[e.status]?.label??e.status;return t.toLowerCase()===r.toLowerCase()?e.status:t}let o={started:"IN_PROGRESS",triage:"PENDING",backlog:"PENDING",unstarted:"PENDING",completed:"DONE",canceled:"CANCELLED"};function l(e,t,r){let n,a;return null==e.title?r:Math.max(r,(a=66+(((n=(e.title??"").trim())?Math.max(1,Math.ceil(n.length/17)):1)-1)*19,e.role&&e.role.trim()&&(a+=16),t>0&&(a+=22),a+24))}function i(e,t,r={}){let d=r.colW??320,c=r.rowH??150,u=r.childIndent??24,x=r.laneGap??56,p=r.bandGap??110,m=r.maxCols??10,f=r.minBandW??3*d,h=new Set(e.map(e=>e.id)),g=e=>!e.parentId||!h.has(e.parentId),b=e.filter(g),v=new Map;for(let t of e){if(g(t))continue;let e=v.get(t.parentId);e?e.push(t):v.set(t.parentId,[t])}let y="status"===t?s:"priority"===t?e=>String(e.priority):e=>(e.cluster??"").trim()||"—",j=new Map;for(let e of b){let t=y(e),r=j.get(t);r?r.push(e):j.set(t,[e])}let k=(function(e,t,r){if("status"===e){let e=new Set(n.TT),a=new Map;for(let n of t){let t=r(n);e.has(t)||a.has(t)||a.set(t,o[n.stateType??""]??"PENDING")}let s=[];for(let e of n.TT)s.push(e),s.push(...Array.from(a).filter(([,t])=>t===e).map(([e])=>e).sort());return s}if("priority"===e)return["0","1","2","3"];let a=Array.from(new Set(t.map(r))),s=a.filter(e=>"—"!==e).sort();return a.includes("—")?[...s,"—"]:s})(t,b,y).filter(e=>j.has(e)),N=[];for(let e of k){let t=j.get(e),r=t.reduce((e,t)=>e+1+(v.get(t.id)?.length??0),0),n=Math.max(1,Math.min(m,t.length,Math.round(Math.sqrt(.85*r))||1)),a=Array(n).fill(0),s=new Map;for(let e of t){let t=0;for(let e=1;e<n;e++)a[e]<a[t]&&(t=e);let r=t*d,o=a[t];s.set(e.id,{x:r,y:o});let i=v.get(e.id)??[],x=o+l(e,i.length,c);for(let e of i)s.set(e.id,{x:r+u,y:x}),x+=l(e,0,c);a[t]=x}let o=a.reduce((e,t)=>Math.max(e,t),0);N.push({id:e,w:n*d,h:o,local:s})}let w=(0,a.Xi)(N.map(e=>({id:e.id,w:e.w,h:e.h})),{gapX:x,gapY:p,viewportAspect:r.viewportAspect,minBandW:f,aspectSlack:1.5}),C=new Map;for(let e of N){let t=w.get(e.id);for(let[r,n]of e.local)C.set(r,{x:t.x+n.x,y:t.y+n.y})}return C}},40654:(e,t,r)=>{r.d(t,{e:()=>E});var n=r(95155),a=r(12115),s=r(5937),o=r(92571),l=r(74350),i=r(4474),d=r(91337),c=r(5989);let u=["ROADMAP","ARCHITECTURE","DATABASE"],x=c.k5(u),p=c.Ik({name:c.Yj(),type:c.Yj(),isPk:c.zM(),isFk:c.zM(),nullable:c.zM(),note:c.Yj().nullable()}),m=c.Ik({id:c.Yj(),view:c.Yj(),kind:c.Yj(),cluster:c.Yj().nullable(),layer:c.Yj().nullable(),title:c.Yj(),role:c.Yj().nullable(),plain:c.Yj().nullable(),status:c.Yj(),priority:c.ai(),x:c.ai(),y:c.ai(),source:c.Yj(),sourceRef:c.Yj().nullable(),parentId:c.Yj().nullable(),isCriterion:c.zM(),files:c.YO(c.Yj()),signals:c.bz().optional(),bugFlags:c.YO(c.bz())}),f=c.Ik({id:c.Yj(),fromId:c.Yj(),toId:c.Yj(),kind:c.Yj(),label:c.Yj().nullable(),sourceHandle:c.Yj().nullable(),targetHandle:c.Yj().nullable()}),h=c.Ik({nodes:c.YO(m),edges:c.YO(f),hasFrontend:c.zM()}),g=c.Ik({id:c.Yj(),name:c.Yj(),domain:c.Yj().nullable(),description:c.Yj().nullable(),source:c.Yj(),x:c.ai(),y:c.ai(),columns:c.YO(p)}),b=c.Ik({id:c.Yj(),fromTableId:c.Yj(),toTableId:c.Yj(),fromColumn:c.Yj(),toColumn:c.Yj(),label:c.Yj().nullable()}),v=c.Ik({id:c.Yj(),method:c.Yj(),path:c.Yj(),domain:c.Yj().nullable(),description:c.Yj().nullable(),source:c.Yj(),x:c.ai(),y:c.ai(),tables:c.YO(c.Ik({tableId:c.Yj(),access:c.Yj()}))}),y=c.Ik({proposedAt:c.ai(),status:c.Yj(),tables:c.YO(c.bz()),relations:c.YO(c.bz()),endpoints:c.YO(c.bz())}).nullable(),j=c.Ik({tables:c.YO(g),relations:c.YO(b),endpoints:c.YO(v),draft:y}),k=c.Ik({kind:c.eu("boards"),version:c.eu(1),createdAt:c.ai(),workspaceLabel:c.Yj(),selectedTabs:c.YO(x).min(1),roadmap:h.optional(),architecture:h.optional(),database:j.optional()}),N=c.Ik({kind:c.eu("plan"),version:c.eu(1),createdAt:c.ai(),workspaceLabel:c.Yj(),title:c.Yj(),markdown:c.Yj(),verdict:c.k5(["approved","discarded"]).nullable(),roadmap:h.optional(),draft:y.optional()});c.gM("kind",[k,N]);var w=r(89793),C=r(96719);let A=[{value:"ALL",label:"All"},{value:"ROADMAP",label:"Roadmap"},{value:"ARCHITECTURE",label:"Architecture"},{value:"DATABASE",label:"Database"}];function E({defaultSelection:e="ALL"}){let[t,r]=(0,a.useState)(!1),[c,x]=(0,a.useState)(e),{status:p,url:m,error:f,copied:h,mint:g,copy:b,reset:v}=(0,w.b)();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",title:"Share a read-only link to these boards",onClick:function(){x(e),v(),r(!0)},className:"glass flex size-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:text-foreground",children:(0,n.jsx)(s.A,{className:"size-4"})}),(0,n.jsx)(l.lG,{open:t,onOpenChange:r,children:(0,n.jsxs)(l.Cf,{children:[(0,n.jsxs)(l.c7,{children:[(0,n.jsx)(l.L3,{children:"Share a read-only link"}),(0,n.jsx)(l.rr,{children:"Anyone with the link can view these boards — no Beacon needed. Links expire after 7 days."})]}),"done"===p?(0,n.jsx)(C.F,{url:m,copied:h,onCopy:b}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"flex rounded-lg border border-border bg-background/40 p-0.5",children:A.map(e=>(0,n.jsx)("button",{onClick:()=>x(e.value),className:(0,d.cn)("flex-1 rounded-md px-1.5 py-1.5 text-[11px] font-medium transition-colors",c===e.value?"bg-[var(--ink-active)] text-foreground":"text-muted-foreground hover:text-foreground"),children:e.label},e.value))}),"error"===p&&(0,n.jsx)("p",{className:"text-[12px] text-red-400",children:f}),(0,n.jsx)("div",{className:"flex justify-end",children:(0,n.jsx)(i.$,{size:"sm",onClick:function(){g({kind:"boards",tabs:"ALL"===c?[...u]:[c]})},disabled:"loading"===p,children:"loading"===p?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.A,{className:"size-3.5 animate-spin"})," Creating…"]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(s.A,{className:"size-3.5"})," Create link"]})})})]})]})})]})}},43137:(e,t,r)=>{r.d(t,{TT:()=>s,Xf:()=>l,m6:()=>a,nR:()=>o,yl:()=>n});let n=["PENDING","IN_PROGRESS","DONE","BLOCKED","CANCELLED","DEPRIORITIZED"],a=["KEEP","REBUILD","REPLACE","DROP"],s=["IN_PROGRESS","PENDING","BLOCKED","DONE","DEPRIORITIZED","CANCELLED"],o={DONE:{label:"Done",className:"border-emerald-500/30 bg-emerald-500/15 text-emerald-700 dark:text-emerald-300"},IN_PROGRESS:{label:"In progress",className:"border-sky-500/30 bg-sky-500/15 text-sky-700 dark:text-sky-300"},PENDING:{label:"Pending",className:"border-amber-500/30 bg-amber-500/10 text-amber-700 dark:text-amber-200"},BLOCKED:{label:"Blocked",className:"border-orange-500/30 bg-orange-500/15 text-orange-700 dark:text-orange-300"},CANCELLED:{label:"Cancelled",className:"border-zinc-500/30 bg-zinc-500/10 text-zinc-600 dark:text-zinc-400 line-through"},DEPRIORITIZED:{label:"Deprioritized",className:"border-zinc-600/40 bg-zinc-600/10 text-zinc-600 dark:text-zinc-400"},KEEP:{label:"Keep",className:"border-emerald-500/30 bg-emerald-500/15 text-emerald-700 dark:text-emerald-300"},REBUILD:{label:"Rebuild",className:"border-violet-500/30 bg-violet-500/15 text-violet-700 dark:text-violet-300"},REPLACE:{label:"Replace",className:"border-rose-500/30 bg-rose-500/15 text-rose-700 dark:text-rose-300"},DROP:{label:"Drop",className:"border-zinc-500/30 bg-zinc-500/10 text-zinc-600 dark:text-zinc-400 line-through"}};function l(e){return e?.trim()||"—"}},44267:(e,t,r)=>{r.d(t,{S:()=>n});function n(e,t={}){let r=t.pad??20,a=t.header??26,s=new Map;for(let t of e){let e=s.get(t.group);e?(e.minX=Math.min(e.minX,t.x),e.minY=Math.min(e.minY,t.y),e.maxX=Math.max(e.maxX,t.x+t.w),e.maxY=Math.max(e.maxY,t.y+t.h),e.count++):s.set(t.group,{minX:t.x,minY:t.y,maxX:t.x+t.w,maxY:t.y+t.h,count:1})}return Array.from(s.entries()).sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({key:e,label:e,x:t.minX-r,y:t.minY-r-a,w:t.maxX-t.minX+2*r,h:t.maxY-t.minY+2*r+a,count:t.count}))}},45437:(e,t,r)=>{r.d(t,{L:()=>o});var n=r(95155),a=r(81750),s=r(28736);function o(e){let t=(0,a.JY)(e.target),r=e.targetX,o=e.targetY,l=t?.measured?.width,i=t?.measured?.height;if(t&&l&&i){let n=(0,s.u1)({x:t.internals.positionAbsolute.x,y:t.internals.positionAbsolute.y,w:l,h:i},{x:e.sourceX,y:e.sourceY});r=n.x,o=n.y}let d=e.sourceX,c=e.sourceY,u=r-d,x=o-c,p=Math.hypot(u,x)||1,m=Math.min(.18*p,42),f=(d+r)/2+-x/p*m,h=(c+o)/2+u/p*m,g=`M${d},${c} Q${f},${h} ${r},${o}`;return(0,n.jsx)(a.tE,{id:e.id,path:g,style:e.style,markerEnd:e.markerEnd})}},47409:(e,t,r)=>{r.d(t,{h:()=>v});var n=r(95155),a=r(12115),s=r(25583),o=r(874),l=r(36483),i=r(9107),d=r(76721),c=r(14225),u=r(95660);function x(e,t){return{name:e,path:t,folders:new Map,files:new Map}}function p(e,t){return e.kind!==t.kind?"folder"===e.kind?-1:1:e.name.localeCompare(t.name,void 0,{sensitivity:"base"})}var m=r(91337);let f={added:"text-emerald-400",modified:"text-amber-300",deleted:"text-rose-400 line-through"},h={added:"bg-emerald-400",modified:"bg-amber-300",deleted:"bg-rose-400"};function g({name:e,className:t}){let r=e.slice(e.lastIndexOf(".")+1).toLowerCase();return["ts","tsx","js","jsx","mjs","cjs"].includes(r)?(0,n.jsx)(s.A,{className:t}):"json"===r?(0,n.jsx)(o.A,{className:t}):["md","mdx","txt","css","scss"].includes(r)?(0,n.jsx)(l.A,{className:t}):(0,n.jsx)(i.A,{className:t})}function b({nodes:e,depth:t,collapsed:r,onToggle:a,onSelect:s,selectedPath:o,livePath:l}){return(0,n.jsx)("ul",{className:(0,m.cn)(t>0&&"ml-[7px] border-l border-border pl-1.5"),children:e.map(e=>{let i,x;return"folder"===e.kind?(0,n.jsxs)("li",{children:[(0,n.jsxs)("button",{type:"button",onClick:()=>a(e.path),title:e.path,className:"flex w-full items-center gap-1 rounded px-1.5 py-1 text-left text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-foreground",children:[(0,n.jsx)(d.A,{className:(0,m.cn)("size-3 shrink-0 transition-transform",!r.has(e.path)&&"rotate-90")}),r.has(e.path)?(0,n.jsx)(c.A,{className:"size-3.5 shrink-0 text-muted-foreground"}):(0,n.jsx)(u.A,{className:"size-3.5 shrink-0 text-muted-foreground"}),(0,n.jsx)("span",{className:"truncate text-[11px] font-medium",children:e.name})]}),!r.has(e.path)&&(0,n.jsx)(b,{nodes:e.children,depth:t+1,collapsed:r,onToggle:a,onSelect:s,selectedPath:o,livePath:l})]},`d:${e.path}`):(i=e.path===o,x=e.path===l,(0,n.jsx)("li",{children:(0,n.jsxs)("button",{type:"button",onClick:()=>s(e),title:e.path,"aria-current":i?"true":void 0,className:(0,m.cn)("flex w-full items-center gap-1.5 rounded py-1 pl-[18px] pr-1.5 text-left transition-colors",i?"bg-[var(--ink-active)]":x?"bg-[#ff7a45]/[0.08] hover:bg-[#ff7a45]/[0.13]":"hover:bg-[var(--ink-hover)]"),children:[(0,n.jsx)(g,{name:e.name,className:(0,m.cn)("size-3.5 shrink-0",x?"text-[#ff7a45]":e.status?f[e.status]:"text-muted-foreground")}),(0,n.jsx)("span",{className:(0,m.cn)("truncate text-[11px]",x?"font-medium text-[#ff7a45]":i?"text-foreground":e.status?f[e.status]:"text-foreground/90"),children:e.name}),(0,n.jsxs)("span",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[x&&(0,n.jsx)("span",{className:"size-1.5 rounded-full bg-[#ff7a45] motion-safe:animate-pulse",title:"The agent is editing this file now"}),e.meta&&(0,n.jsx)("span",{className:"text-[9px] text-teal-300/80",children:e.meta}),e.status&&(0,n.jsx)("span",{className:(0,m.cn)("size-1.5 rounded-full",h[e.status])})]})]})},`f:${e.path}`))})})}function v({files:e,onSelect:t,collapse:r=!0,emptyLabel:s,className:o,selectedPath:l,livePath:i}){let d=(0,a.useMemo)(()=>(function(e,t={}){let r=t.collapseSingleChildFolders??!0,n=x("","");for(let t of e){let e=t.path.split("\\").join("/").trim().replace(/^\/+/,"").replace(/\/+$/,"");if(!e)continue;let r=e.split("/").filter(Boolean);if(!r.length)continue;let a=n;for(let e=0;e<r.length-1;e++){let t=r[e],n=a.path?`${a.path}/${t}`:t,s=a.folders.get(t);s||(s=x(t,n),a.folders.set(t,s)),a=s}let s=r[r.length-1];a.files.set(s,{kind:"file",name:s,path:e,status:t.status,meta:t.meta})}return function e(t,r){let n=[];for(let a of t.folders.values())n.push(function(t,r){let n=t.name,a=t;for(;r&&0===a.files.size&&1===a.folders.size;){let e=a.folders.values().next().value;n=`${n}/${e.name}`,a=e}return{kind:"folder",name:n,path:a.path,children:e(a,r)}}(a,r));for(let e of t.files.values())n.push(e);return n.sort(p)}(n,r)})(e,{collapseSingleChildFolders:r}),[e,r]),[c,u]=(0,a.useState)(()=>new Set);return d.length?(0,n.jsx)("div",{className:o,children:(0,n.jsx)(b,{nodes:d,depth:0,collapsed:c,onToggle:e=>u(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r}),onSelect:e=>{var r;return t?t(e.path):(r=e.path,void fetch(`/api/open?path=${encodeURIComponent(r)}`).catch(()=>{}))},selectedPath:l,livePath:i})}):s?(0,n.jsx)("p",{className:(0,m.cn)("px-2 py-1 text-[11px] text-muted-foreground",o),children:s}):null}},54682:(e,t,r)=>{r.d(t,{Gd:()=>f,II:()=>u,Pu:()=>x,Z2:()=>m});var n=r(40054),a=r(82150),s=r(83694),o=r(35580),l=r(56991);let i=s.z.extend({renderMarkdown:(e,t)=>`<u>${t.renderChildren(e)}</u>`}),d=[n.W.configure({underline:!1}),i,a._0,a.L2.configure({nested:!0})],c=[...d,l.eo],u=c,x=d,p=new o.db({extensions:c});function m(e){return p.serialize(function e(t){return"paragraph"===t.type&&(t.content?.length??0)===0?{...t,content:[{type:"text",text:"​"}]}:Array.isArray(t.content)?{...t,content:t.content.map(e)}:t}(e))}function f(e){return function e(t){if("paragraph"===t.type&&t.content?.length){let e=t.content.every(e=>"text"===e.type),r=t.content.map(e=>e.text??"").join("");if(e&&r.includes("​")&&""===r.replace(/\u200B/g,"").trim())return{...t,content:[]}}return Array.isArray(t.content)?{...t,content:t.content.map(e)}:t}(function e(t){if("text"===t.type){let e=(t.marks??[]).find(e=>"link"===e.type&&"string"==typeof e.attrs?.href),r=e?.attrs?.href?(0,l.$w)(e.attrs.href):null;if(r)return{type:"mention",attrs:{kind:r.kind,ref:r.ref,label:(t.text??"").replace(/^@/,"")}}}return Array.isArray(t.content)?{...t,content:t.content.map(e)}:t}(function e(t){if("text"===t.type&&(t.text??"").includes("<u>"))return{type:"__frag",content:function(e){let t,r=e.text??"",n=e.marks??[],a=/<u>([\s\S]*?)<\/u>/g,s=[],o=0;for(;null!==(t=a.exec(r));)t.index>o&&s.push({...e,text:r.slice(o,t.index)}),s.push({type:"text",text:t[1],marks:[...n,{type:"underline"}]}),o=a.lastIndex;return o<r.length&&s.push({...e,text:r.slice(o)}),s.filter(e=>(e.text??"").length>0)}(t)};if(Array.isArray(t.content)){let r=t.content.flatMap(t=>{let r=e(t);return"__frag"===r.type?r.content:[r]});return{...t,content:r}}return t}(p.parse(e))))}},54698:(e,t,r)=>{r.d(t,{m:()=>n});function n(e,t){let r=[];return e.forEach((e,n)=>{let a=e.excerpt.trim();if(!a)return;let s={annotationId:e.id,n:n+1};for(let e of t.tables){if(a===e.name)return void r.push({...s,kind:"table",targetId:e.id,column:null});if(a.startsWith(`${e.name}.`)){let t=a.slice(e.name.length+1);if(e.columns.includes(t))return void r.push({...s,kind:"column",targetId:e.id,column:t})}}for(let e of t.endpoints??[])if(a===`${e.method} ${e.path}`)return void r.push({...s,kind:"endpoint",targetId:e.id,column:null});for(let e of t.features??[])if(a===e.title||a===`feature: ${e.title}`)return void r.push({...s,kind:"feature",targetId:e.id,column:null})}),r}},56614:(e,t,r)=>{r.d(t,{er:()=>o,r1:()=>l,vu:()=>i});var n=r(95155),a=r(12115),s=r(91337);function o({trigger:e,title:t,align:r="right",children:l,open:i,onOpenChange:d,outsideClicksToClose:c=1}){let[u,x]=(0,a.useState)(!1),[p,m]=(0,a.useState)("down"),f=i??u,h=e=>{void 0===i&&x(e),d?.(e)},g=(0,a.useRef)(null),b=(0,a.useRef)(()=>{});return(0,a.useEffect)(()=>{b.current=()=>h(!1)}),(0,a.useEffect)(()=>{if(!f)return;let e=g.current?.firstElementChild?.getBoundingClientRect();e&&m(window.innerHeight-e.bottom<260?"up":"down")},[f]),(0,a.useEffect)(()=>{if(!f)return;let e=0,t=null,r=()=>{t&&clearTimeout(t),t=null},n=n=>{if(g.current?.contains(n.target)){e=0,r();return}c<=1?b.current():(e+=1)>=c?(e=0,r(),b.current()):(r(),t=setTimeout(()=>{e=0},1500))},a=e=>{"Escape"===e.key&&b.current()};return window.addEventListener("mousedown",n,!0),window.addEventListener("keydown",a),()=>{r(),window.removeEventListener("mousedown",n,!0),window.removeEventListener("keydown",a)}},[f,c]),(0,n.jsxs)("div",{ref:g,className:"relative",children:[e(f,()=>h(!f)),f&&(0,n.jsxs)("div",{className:(0,s.cn)("glass absolute z-30 w-64 rounded-xl p-3 shadow-xl","up"===p?"bottom-full mb-1.5":"top-full mt-1.5","right"===r?"right-0":"left-0"),children:[t&&(0,n.jsx)("div",{className:"mb-2 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:t}),l]})]})}function l({title:e,children:t}){return(0,n.jsxs)("div",{className:"mb-2.5 last:mb-0",children:[(0,n.jsx)("div",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/80",children:e}),(0,n.jsx)("div",{className:"flex flex-wrap gap-1",children:t})]})}function i({on:e,onClick:t,children:r,tone:a="default"}){return(0,n.jsx)("button",{type:"button",onClick:t,className:(0,s.cn)("rounded-md border px-2 py-0.5 text-[11px] font-medium transition-colors",{default:e?"border-foreground/40 bg-[var(--ink-active)] text-foreground":"border-border text-muted-foreground hover:text-foreground",danger:e?"border-red-500/40 bg-red-500/15 text-red-300":"border-border text-muted-foreground hover:text-foreground",accent:e?"border-sky-500/40 bg-sky-500/15 text-sky-300":"border-border text-muted-foreground hover:text-foreground"}[a]),children:r})}},56895:(e,t,r)=>{r.d(t,{W:()=>a});var n=r(12115);function a(e,t){let[r,a]=(0,n.useState)(!1),[s,o]=(0,n.useState)(0),l=r?e[s]??null:null,i=(0,n.useCallback)(()=>{o(0),a(!0)},[]),d=(0,n.useCallback)(()=>a(!1),[]),c=(0,n.useCallback)(()=>o(t=>Math.min(t+1,e.length-1)),[e.length]),u=(0,n.useCallback)(()=>o(e=>Math.max(e-1,0)),[]),x=(0,n.useCallback)(t=>{t>=0&&t<e.length&&o(t)},[e.length]);(0,n.useEffect)(()=>{if(!r)return;let n=e[s];n&&t(n)},[r,s]),(0,n.useEffect)(()=>{if(!r)return;let e=e=>{"ArrowRight"===e.key?(e.preventDefault(),c()):"ArrowLeft"===e.key?(e.preventDefault(),u()):"Escape"===e.key&&(e.preventDefault(),d())};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[r,c,u,d]);let p=(0,n.useMemo)(()=>l&&l.focusIds.length?new Set(l.focusIds):null,[l]);return{active:r,index:s,step:l,start:i,stop:d,next:c,prev:u,goto:x,focusIds:p}}},56991:(e,t,r)=>{r.d(t,{$w:()=>o,eo:()=>c,tw:()=>u});var n=r(82159),a=r(28794);let s="beacon://";function o(e){if(!e.startsWith(s))return null;let t=e.slice(s.length),r=t.indexOf("/");return r<0?null:{kind:t.slice(0,r),ref:t.slice(r+1)}}let l={kind:{default:null,parseHTML:e=>e.getAttribute("data-kind"),renderHTML:e=>e.kind?{"data-kind":e.kind}:{}},ref:{default:null,parseHTML:e=>e.getAttribute("data-ref"),renderHTML:e=>e.ref?{"data-ref":e.ref}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label")??e.textContent?.replace(/^@/,""),renderHTML:e=>e.label?{"data-label":e.label}:{}}},i=()=>[{tag:"span[data-mention]"}],d=({node:e,HTMLAttributes:t})=>["span",(0,n.KV)({"data-mention":"",class:"beacon-mention"},t),`@${e.attrs.label??""}`],c=n.bP.create({name:"mention",group:"inline",inline:!0,atom:!0,addAttributes:()=>l,parseHTML:i,renderHTML:d,renderMarkdown:e=>{var t,r,n;let a=e.attrs??{};return t=a.kind??"feature",r=a.ref??"",n=a.label??"",`[@${n}](${s}${t}/${r})`}}),u=a.P.extend({name:"mention",addAttributes:()=>l,parseHTML:i,renderHTML:d})},62311:(e,t,r)=>{r.d(t,{Z:()=>f});var n=r(95155),a=r(12115),s=r(98500),o=r.n(s),l=r(25640),i=r(83599),d=r(94192),c=r(34306),u=r(60292),x=r(75514),p=r(91337);let m={ROADMAP:l.A,ARCHITECTURE:i.A,FILES:d.A,DATABASE:c.A};function f({tabs:e,active:t}){let[r,s]=(0,a.useState)(null);(0,a.useEffect)(()=>{s((0,u.fk)())},[]);let l=(0,x.$2)();return(0,n.jsx)("div",{className:"flex items-center gap-0.5",children:e.map(e=>{let a,s=e.value===t,i=e.Icon??m[e.value],d=(0,p.cn)("flex items-center gap-1.5 rounded-full border px-2.5 py-1 text-[12px] font-medium tracking-tight transition-colors",s?"border-border bg-[var(--ink-active)] text-foreground shadow-[inset_0_1px_0_rgba(255,255,255,0.06)]":"border-transparent text-muted-foreground/80 hover:bg-[var(--ink-hover)] hover:text-foreground"),c=(0,n.jsxs)(n.Fragment,{children:[i?(0,n.jsx)(i,{className:(0,p.cn)("size-3",s&&"text-[#ff7a45]")}):null,(0,n.jsx)("span",{className:"hidden lg:inline",children:e.label})]});return l?.views.has(e.value)?(0,n.jsx)("button",{type:"button",title:e.label,onClick:()=>l.switchTo(e.value),className:d,children:c},e.value):(0,n.jsx)(o(),{href:(a=e.href,r?`${a}${a.includes("?")?"&":"?"}ws=${r}`:a),title:e.label,className:d,children:c},e.value)})})}},64329:(e,t,r)=>{r.d(t,{Sq:()=>d,ZB:()=>m,aO:()=>u,aU:()=>p,p_:()=>c,yc:()=>x});var n=r(95155),a=r(32133),s=r(9005),o=r(82099),l=r(66616),i=r(91337);let d="!h-6 w-fit max-w-full !gap-1 rounded-md !border-0 !bg-transparent !px-1.5 !py-0 text-xs font-medium !shadow-none transition-colors hover:!bg-[var(--ink-hover)] [&_svg]:size-3";function c({topOffset:e,children:t,style:r}){return(0,n.jsx)(o.b,{className:"absolute bottom-0 right-0 z-10 flex w-[340px] flex-col rounded-none border-y-0 border-r-0",style:{top:e??0,...r},children:t})}function u({tabs:e,breadcrumb:t,comment:r,onClose:o}){return(0,n.jsxs)("div",{className:"flex items-center gap-1 border-b border-border py-2 pl-3 pr-2",children:[e?(0,n.jsxs)("div",{className:"flex min-w-0 items-center gap-0.5",children:[(0,n.jsx)(l.E,{active:"details"===e.active,onClick:()=>e.onChange("details"),children:"Details"}),(0,n.jsxs)(l.E,{active:"comments"===e.active,onClick:()=>e.onChange("comments"),children:["Comments",e.count>0&&(0,n.jsx)("span",{className:"ml-1 rounded-full bg-[var(--ink-active)] px-1 text-[9px] font-semibold leading-4",children:e.count})]})]}):(0,n.jsx)("span",{className:"min-w-0 truncate text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:t}),(0,n.jsxs)("div",{className:"ml-auto flex shrink-0 items-center gap-0.5",children:[r&&(0,n.jsx)("button",{type:"button",title:r.title,onClick:r.onClick,className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-[var(--accent-2,#ff7a45)]",children:(0,n.jsx)(a.A,{className:"size-4"})}),(0,n.jsx)("button",{onClick:o,title:"Close panel",className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-foreground",children:(0,n.jsx)(s.A,{className:"size-4"})})]})]})}function x({icon:e,label:t,children:r}){return(0,n.jsxs)("div",{className:"flex min-h-7 items-center gap-2 text-xs",children:[(0,n.jsxs)("span",{className:"flex w-[88px] shrink-0 items-center gap-1.5 text-muted-foreground",children:[(0,n.jsx)(e,{className:"size-3.5"}),t]}),(0,n.jsx)("div",{className:"flex min-w-0 flex-1 items-center",children:r})]})}function p({title:e,children:t,className:r}){return(0,n.jsxs)("div",{className:(0,i.cn)("mt-4 border-t border-border pt-3",r),children:[(0,n.jsx)("h3",{className:"mb-1.5 flex items-center gap-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:e}),t]})}function m({label:e,value:t}){return(0,n.jsxs)("div",{children:[(0,n.jsx)("dd",{className:"text-lg font-semibold tabular-nums",children:t}),(0,n.jsx)("dt",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:e})]})}},66616:(e,t,r)=>{r.d(t,{E:()=>s});var n=r(95155),a=r(91337);function s({active:e,onClick:t,icon:r,children:o,pill:l=!1}){return(0,n.jsxs)("button",{type:"button",onClick:t,className:(0,a.cn)("flex items-center gap-1 px-2.5 py-1 text-[11px] font-medium transition-colors",l?"rounded-full":"rounded-md",e?"bg-[var(--ink-active)] text-foreground":"text-muted-foreground hover:text-foreground"),children:[r,o]})}},70221:(e,t,r)=>{r.d(t,{fE:()=>s,gt:()=>o,kz:()=>a});let n={far:.3,farExit:.34,mid:.55,midExit:.6},a={far:.12,farExit:.15,mid:.45,midExit:.5},s={far:.2,farExit:.24,mid:.32,midExit:.36};function o(e,t="full",r=n){return e<r.far||"far"===t&&e<r.farExit?"far":e<r.mid||"mid"===t&&e<r.midExit?"mid":"full"}},70947:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r(95155),a=r(81750),s=r(12410),o=r(91337);function l({regions:e,tone:t="neutral",lod:r="full"}){let i=(0,a.Pj)(e=>e.transform[2]);if(0===e.length)return null;let d="far"===r,c=Math.min(150,26/Math.max(i,.05)),u=Math.min(80,13/Math.max(i,.05));return(0,n.jsx)(a.DX,{children:e.map(e=>(0,n.jsx)("div",{style:{position:"absolute",transform:`translate(${e.x}px, ${e.y}px)`,width:e.w,height:e.h,pointerEvents:"none",zIndex:0},className:(0,o.cn)("rounded-2xl border","category"===t?(0,s.xZ)(e.key):"border-border bg-[var(--ink-hover)]",d&&"bg-card/80"),children:d?(0,n.jsxs)("div",{className:"flex h-full flex-col items-center justify-center gap-[0.3em] px-2",children:[(0,n.jsx)("span",{className:"whitespace-nowrap text-center font-semibold tracking-tight text-foreground",style:{fontSize:Math.min(c,.34*e.h,(e.w-16)/(.74*Math.max(e.label.length,1))),lineHeight:1.1},children:e.label}),(0,n.jsxs)("span",{className:"tabular-nums text-muted-foreground",style:{fontSize:Math.min(u,.18*e.h)},children:[e.count," ",1===e.count?"card":"cards"]})]}):(0,n.jsxs)("div",{className:"flex items-baseline gap-2 px-3 py-1",children:[(0,n.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground/80",children:e.label}),(0,n.jsx)("span",{className:"text-[10px] tabular-nums text-muted-foreground/50",children:e.count})]})},e.key))})}},74350:(e,t,r)=>{r.d(t,{Cf:()=>g,Es:()=>v,L3:()=>y,c7:()=>b,lG:()=>m,rr:()=>j});var n=r(95155);r(12115);var a=r(17112),s=r(51880),o=r(35176),l=r(11248),i=r(45362),d=r(82022),c=r(98758),u=r(91337),x=r(4474),p=r(9005);function m({...e}){return(0,n.jsx)(a.D,{"data-slot":"dialog",...e})}function f({...e}){return(0,n.jsx)(s.Z,{"data-slot":"dialog-portal",...e})}function h({className:e,...t}){return(0,n.jsx)(o.X,{"data-slot":"dialog-overlay",className:(0,u.cn)("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function g({className:e,children:t,showCloseButton:r=!0,...a}){return(0,n.jsxs)(f,{children:[(0,n.jsx)(h,{}),(0,n.jsxs)(l.h,{"data-slot":"dialog-content",className:(0,u.cn)("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...a,children:[t,r&&(0,n.jsxs)(i.H,{"data-slot":"dialog-close",render:(0,n.jsx)(x.$,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[(0,n.jsx)(p.A,{}),(0,n.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})}function b({className:e,...t}){return(0,n.jsx)("div",{"data-slot":"dialog-header",className:(0,u.cn)("flex flex-col gap-2",e),...t})}function v({className:e,showCloseButton:t=!1,children:r,...a}){return(0,n.jsxs)("div",{"data-slot":"dialog-footer",className:(0,u.cn)("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",e),...a,children:[r,t&&(0,n.jsx)(i.H,{render:(0,n.jsx)(x.$,{variant:"outline"}),children:"Close"})]})}function y({className:e,...t}){return(0,n.jsx)(d.L,{"data-slot":"dialog-title",className:(0,u.cn)("font-heading text-base leading-none font-medium",e),...t})}function j({className:e,...t}){return(0,n.jsx)(c.r,{"data-slot":"dialog-description",className:(0,u.cn)("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}},75514:(e,t,r)=>{r.d(t,{$2:()=>o,a4:()=>a,no:()=>s});var n=r(12115);let a=new Set(["ROADMAP","ARCHITECTURE","DATABASE"]),s=(0,n.createContext)(null);function o(){return(0,n.useContext)(s)}},80277:(e,t,r)=>{r.d(t,{H:()=>c,e:()=>d});var n=r(95155),a=r(12115),s=r(6266),o=r(61285),l=r(91906),i=r(91337);function d(e="pan"){let[t,r]=(0,a.useState)(e);(0,a.useEffect)(()=>{let e=e=>{if(e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target;t&&(t.isContentEditable||/^(INPUT|TEXTAREA|SELECT)$/.test(t.tagName))||("v"===e.key||"V"===e.key?r("select"):("h"===e.key||"H"===e.key)&&r("pan"))};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]);let n="pan"===t?{panOnDrag:!0,selectionOnDrag:!1,selectionMode:s.Qc.Partial,selectNodesOnDrag:!1}:{panOnDrag:[1,2],selectionOnDrag:!0,selectionMode:s.Qc.Partial,selectNodesOnDrag:!1};return{tool:t,setTool:r,flowProps:n,paneClass:"select"===t?"rf-tool-select":void 0}}function c({tool:e,onChange:t}){return(0,n.jsxs)("div",{className:"flex items-center gap-0.5 rounded-xl border border-border bg-card/95 p-1 shadow-lg backdrop-blur dark:border-white/15 dark:bg-[#202024]/95",children:[(0,n.jsx)(u,{active:"select"===e,label:"Select tool (V) — drag to box-select; move many nodes at once",onClick:()=>t("select"),children:(0,n.jsx)(o.A,{className:"size-4"})}),(0,n.jsx)(u,{active:"pan"===e,label:"Hand tool (H) — drag to pan the board",onClick:()=>t("pan"),children:(0,n.jsx)(l.A,{className:"size-4"})})]})}function u({active:e,label:t,onClick:r,children:a}){return(0,n.jsx)("button",{type:"button",title:t,"aria-pressed":e,onClick:r,className:(0,i.cn)("flex size-7 items-center justify-center rounded-lg transition-colors",e?"bg-[#ff7a45]/15 text-[#ff7a45]":"text-muted-foreground hover:bg-[var(--ink-active)] hover:text-foreground dark:hover:bg-white/8"),children:a})}},89793:(e,t,r)=>{r.d(t,{b:()=>a});var n=r(12115);function a(){let[e,t]=(0,n.useState)("idle"),[r,a]=(0,n.useState)(""),[s,o]=(0,n.useState)(""),[l,i]=(0,n.useState)(!1);async function d(){try{await navigator.clipboard.writeText(r),i(!0),setTimeout(()=>i(!1),1500)}catch{}}return{status:e,url:r,error:s,copied:l,mint:async function e(e){t("loading"),o(""),i(!1);try{let r=await fetch("/api/share/create",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(e)}),n=await r.json();if(!r.ok||!n.url){o(n.error??"Could not create the link."),t("error");return}a(n.url),t("done")}catch{o("Could not reach the local Beacon daemon."),t("error")}},copy:d,reset:function(){t("idle"),a(""),o(""),i(!1)}}}},91157:(e,t,r)=>{r.d(t,{b:()=>o,d:()=>l});let n=e=>e.slice(e.lastIndexOf("/")+1),a=(e,t)=>t>e?", …":"";function s(e){let t=new Map;for(let r of e)t.set(n(r),(t.get(n(r))??0)+1);return e.map(e=>{let r=n(e);if((t.get(r)??0)<=1)return r;let a=e.slice(0,e.lastIndexOf("/")),s=a.slice(a.lastIndexOf("/")+1);return s?`${s}/${r}`:r})}function o(e,t,r){if(0===e.length)return[];let n=e=>r.get(e)??"(root)",o=new Map;for(let t of e){let e=n(t.path),r=o.get(e);r?r.push(t):o.set(e,[t])}let l=[...o.keys()],i=e=>o.get(e)?.length??0,d=new Map,c=new Map;for(let e of l)d.set(e,new Set),c.set(e,0);let u=new Set;for(let e of t){if(e.circular)continue;let t=n(e.from),r=n(e.to);if(t===r||!d.has(t)||!d.has(r))continue;let a=`${t}\0${r}`;u.has(a)||(u.add(a),d.get(t).add(r),c.set(r,(c.get(r)??0)+1))}let x=(e,t)=>i(t)-i(e)||e.localeCompare(t),p=new Map(c),m=new Set,f=[];for(;f.length<l.length;){let e=l.filter(e=>!m.has(e)&&(p.get(e)??0)===0).sort(x);if(0===e.length){for(let e of l.filter(e=>!m.has(e)).sort((e,t)=>(p.get(e)??0)-(p.get(t)??0)||i(t)-i(e)||e.localeCompare(t)))f.push(e),m.add(e);break}for(let t of e)for(let e of(f.push(t),m.add(t),d.get(t)))p.set(e,(p.get(e)??0)-1)}let h=e.filter(e=>(e.inDegree??0)===0).sort((e,t)=>(t.outDegree??0)-(e.outDegree??0)||e.path.localeCompare(t.path)),g=[];if(g.push({id:"tour:overview",kind:"overview",title:"Project overview",summary:`${e.length} files across ${l.length} ${1===l.length?"area":"areas"} \xb7 ${t.length} imports. Step through the architecture in dependency order — entry points first.`,focusIds:[]}),h.length){let e=s(h.slice(0,4).map(e=>e.path));g.push({id:"tour:entry",kind:"entry",title:"Entry points",summary:`${h.length} file${1===h.length?"":"s"} nothing imports — where execution starts: ${e.join(", ")}${a(4,h.length)}.`,focusIds:h.slice(0,12).map(e=>e.path)})}for(let e of f){let t=o.get(e),r=s([...t].sort((e,t)=>(t.inDegree??0)-(e.inDegree??0)||e.path.localeCompare(t.path)).slice(0,3).map(e=>e.path)),n=[...d.get(e)].sort(x),l=n.length?` \xb7 imports ${n.slice(0,3).join(", ")}${a(3,n.length)}`:" \xb7 no cross-area imports";g.push({id:`tour:group:${e}`,kind:"group",title:e,summary:`${t.length} file${1===t.length?"":"s"}${l} \xb7 top hubs: ${r.join(", ")}.`,focusIds:t.map(e=>e.path)})}return g}function l(e){if(0===e.length)return[];let t=e=>e.cluster?.trim()||"—",r=new Map;for(let n of e){let e=t(n),a=r.get(e);a?a.push(n):r.set(e,[n])}let n=e=>Math.min(...r.get(e).map(e=>e.x??0)),s=[...r.keys()].sort((e,t)=>n(e)-n(t)||e.localeCompare(t)),o=[{id:"tour:overview",kind:"overview",title:"Architecture overview",summary:`${e.length} component${1===e.length?"":"s"} across ${s.length} ${1===s.length?"domain":"domains"}. Walk the architecture domain by domain, upstream first.`,focusIds:[]}];for(let e of s){let t=r.get(e),n=t.slice(0,3).map(e=>e.title?.trim()||e.id);o.push({id:`tour:domain:${e}`,kind:"group",title:e,summary:`${t.length} component${1===t.length?"":"s"}: ${n.join(", ")}${a(3,t.length)}.`,focusIds:t.map(e=>e.id)})}return o}},93492:(e,t,r)=>{r.d(t,{I:()=>l,U:()=>o});var n=r(95155),a=r(12115),s=r(91337);function o(e){let[,t]=(0,a.useReducer)(e=>e+1,0);(0,a.useEffect)(()=>{let r=()=>t();return e.on("transaction",r),()=>void e.off("transaction",r)},[e])}function l({label:e,active:t,onClick:r,children:a}){return(0,n.jsx)("button",{type:"button","aria-label":e,"aria-pressed":t,title:e,onMouseDown:e=>e.preventDefault(),onClick:r,className:(0,s.cn)("nodrag nopan rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-foreground",t&&"bg-[var(--ink-active)] text-foreground"),children:a})}},94014:(e,t,r)=>{r.d(t,{Xi:()=>n});function n(e,t){let r,n,a,s=(n=((r=t.viewportAspect)&&Number.isFinite(r)&&r>0?Math.min(3.2,Math.max(.7,r)):1.8)*(t.aspectSlack??1),a=e.reduce((e,r)=>e+(r.w+t.gapX)*(r.h+t.gapY),0),Math.max(t.minBandW,Math.round(Math.sqrt(a*n)))),o=new Map,l=0,i=0,d=0;for(let r of e)l>0&&l+r.w>s&&(i+=d+t.gapY,l=0,d=0),o.set(r.id,{x:l,y:i}),d=Math.max(d,r.h),l+=r.w+t.gapX;return o}},95635:(e,t,r)=>{r.d(t,{x:()=>o});var n=r(95155),a=r(81750),s=r(6266);function o(){let e="!h-2 !w-2 !border-0 !bg-zinc-400";return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a.h7,{type:"target",position:s.yX.Top,id:"tt",className:e}),(0,n.jsx)(a.h7,{type:"source",position:s.yX.Top,id:"st",className:e}),(0,n.jsx)(a.h7,{type:"target",position:s.yX.Right,id:"tr",className:e}),(0,n.jsx)(a.h7,{type:"source",position:s.yX.Right,id:"sr",className:e}),(0,n.jsx)(a.h7,{type:"target",position:s.yX.Bottom,id:"tb",className:e}),(0,n.jsx)(a.h7,{type:"source",position:s.yX.Bottom,id:"sb",className:e}),(0,n.jsx)(a.h7,{type:"target",position:s.yX.Left,id:"tl",className:e}),(0,n.jsx)(a.h7,{type:"source",position:s.yX.Left,id:"sl",className:e})]})}},96719:(e,t,r)=>{r.d(t,{F:()=>i});var n=r(95155),a=r(64577),s=r(99314),o=r(1275),l=r(4474);function i({url:e,copied:t,onCopy:r}){return(0,n.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("input",{readOnly:!0,value:e,onFocus:e=>e.currentTarget.select(),className:"min-w-0 flex-1 rounded-md border border-border bg-background px-2.5 py-1.5 text-[12px] text-foreground outline-none"}),(0,n.jsxs)(l.$,{size:"sm",variant:"outline",onClick:r,children:[t?(0,n.jsx)(a.A,{className:"size-3.5"}):(0,n.jsx)(s.A,{className:"size-3.5"}),t?"Copied":"Copy"]})]}),(0,n.jsxs)("a",{href:e,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-[12px] text-muted-foreground transition-colors hover:text-foreground",children:[(0,n.jsx)(o.A,{className:"size-3.5"})," Open the shared view"]})]})}},98238:(e,t,r)=>{r.d(t,{F:()=>o,o:()=>l});var n=r(95155),a=r(28161),s=r(91337);function o(e,t){return!!t&&("fullstack"===e?"fullstack"===t:t===e||"fullstack"===t)}function l({value:e,onChange:t,options:r=a.RR,bare:o=!1}){return(0,n.jsx)("div",{className:(0,s.cn)("flex items-center gap-0.5",!o&&"glass rounded-lg p-0.5"),children:r.map(r=>{let o=e===r;return(0,n.jsxs)("button",{type:"button",onClick:()=>t(o?null:r),title:o?"Show every layer at full strength again":`Highlight ${a.YG[r].label} — other cards dim, nothing is hidden`,className:(0,s.cn)("flex h-7 items-center gap-1.5 rounded-md px-2 text-[10px] font-semibold uppercase tracking-wide transition-colors",o?"bg-[var(--ink-active)] text-foreground":"text-muted-foreground hover:bg-[var(--ink-hover)] hover:text-foreground"),children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"h-3 w-[3px] shrink-0 rounded-full",style:{background:(0,a.A6)(r)}}),a.YG[r].short]},r)})})}},98653:(e,t,r)=>{r.d(t,{MapClient:()=>tF});var n=r(95155),a=r(12115),s=r(98112),o=r(6266),l=r(81750);r(53255);var i=r(17356),d=r(85618),c=r(2125),u=r(68319),x=r(15480),p=r(24413),m=r(17494),f=r(80846),h=r(45486),g=r(73321),b=r(95635),v=r(17918),y=r(9339);let j=(0,y.createServerReference)("408addacb6c8748b9c906cc5e342ebbd01b3bc27e3",y.callServer,void 0,y.findSourceMapURL,"acceptSuggestionAction");var k=r(50981),N=r(34306),w=r(49960),C=r(55737),A=r(72974),E=r(83599),S=r(52750),I=r(68426),M=r(48869),R=r(55776),T=r(65377),z=r(71019),D=r(44825),P=r(54154),O=r(19707),$=r(29450),L=r(17082),Y=r(76181),F=r(27700),U=r(12651),H=r(85222),B=r(70299),G=r(22200),_=r(8962),X=r(12363),K=r(32133),Z=r(76721),W=r(84824),V=r(5736),q=r(65738),J=r(40638),Q=r(36483),ee=r(86659),et=r(9751),er=r(86272),en=r(64577),ea=r(9005),es=r(26518),eo=r(43137),el=r(28161),ei=r(12410);let ed=(0,a.createContext)(null);function ec(){let e=(0,a.useContext)(ed);if(!e)throw Error("useNodeEdit must be used inside NodeEditContext");return e}var eu=r(29523),ex=r(13439),ep=r(62678),em=r(95112),ef=r(67357),eh=r(8143),eg=r(58309),eb=r(5497),ev=r(54682),ey=r(56991),ej=r(93492),ek=r(60292),eN=r(91337);function ew({value:e,onChange:t,onBlur:r,autoFocus:s,compact:o,bare:l,className:i,placeholder:d="Description (markdown)… type @ to mention a file, feature, table…",editable:c=!0}){let u=(0,ex.hG)({editable:c,extensions:[...ev.Pu,ep.Or.configure({placeholder:d}),ey.tw.configure({suggestion:{char:"@",items:async({query:e})=>{if(!e.trim())return[];try{let t=await fetch(`/api/mention-search?q=${encodeURIComponent(e)}`,{headers:(0,ek.dh)((0,ek.fk)())});if(!t.ok)return[];return(await t.json()).hits}catch{return[]}},command:({editor:e,range:t,props:r})=>{e.chain().focus().insertContentAt(t,[{type:"mention",attrs:{kind:r.kind,ref:r.ref,label:r.label}},{type:"text",text:" "}]).run()},render:()=>{let e=null,t=null,r=e=>{if(!t||!e)return;let r=e();r&&(t.style.left=`${r.left}px`,t.style.top=`${r.bottom+4}px`)};return{onStart:n=>{e=new ex.NV(eE,{props:n,editor:n.editor}),(t=document.createElement("div")).style.position="fixed",t.style.zIndex="10000",document.body.appendChild(t),t.appendChild(e.element),r(n.clientRect)},onUpdate:t=>{e?.updateProps(t),r(t.clientRect)},onKeyDown:r=>"Escape"===r.event.key?(t?.remove(),!0):e?.ref?.onKeyDown(r)??!1,onExit:()=>{t?.remove(),t=null,e?.destroy(),e=null}}}}})],content:e?(0,ev.Gd)(e):void 0,immediatelyRender:!1,autofocus:!!s&&"end",editorProps:{attributes:{class:(0,eN.cn)("nodrag nopan node-prose focus:outline-none",i)}},onUpdate:({editor:e})=>t((0,ev.Z2)(e.getJSON())),onBlur:()=>r?.()});return((0,a.useEffect)(()=>{u?.setEditable(c)},[u,c]),(0,a.useEffect)(()=>{!u||u.isFocused||(0,ev.Z2)(u.getJSON())!==e&&u.commands.setContent(e?(0,ev.Gd)(e):"")},[u,e]),u)?(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[c&&(0,n.jsx)(eC,{editor:u,compact:o}),(0,n.jsx)(ex.$Z,{editor:u,onKeyDown:e=>e.stopPropagation(),className:(0,eN.cn)("node-editor rounded",l?"min-h-[3.5rem] text-[15px] leading-relaxed":c?"min-h-[3.5rem] bg-[var(--ink-hover)] px-1.5 py-1 text-xs focus-within:bg-[var(--ink-active)]":"text-xs",o&&"max-h-[24rem] overflow-y-auto")})]}):null}function eC({editor:e,compact:t}){(0,ej.U)(e);let r=()=>e.chain().focus(),a=t?"size-3":"size-3.5";return(0,n.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,n.jsx)(ej.I,{label:"Bold",active:e.isActive("bold"),onClick:()=>r().toggleBold().run(),children:(0,n.jsx)(em.A,{className:a})}),(0,n.jsx)(ej.I,{label:"Italic",active:e.isActive("italic"),onClick:()=>r().toggleItalic().run(),children:(0,n.jsx)(ef.A,{className:a})}),(0,n.jsx)("span",{"aria-hidden":!0,className:"mx-0.5 h-3.5 w-px bg-border"}),(0,n.jsx)(ej.I,{label:"Checklist",active:e.isActive("taskList"),onClick:()=>r().toggleTaskList().run(),children:(0,n.jsx)(eh.A,{className:a})}),(0,n.jsx)(ej.I,{label:"Bullet list",active:e.isActive("bulletList"),onClick:()=>r().toggleBulletList().run(),children:(0,n.jsx)(eg.A,{className:a})}),(0,n.jsx)(ej.I,{label:"Numbered list",active:e.isActive("orderedList"),onClick:()=>r().toggleOrderedList().run(),children:(0,n.jsx)(eb.A,{className:a})})]})}let eA={file:"\uD83D\uDCC4",folder:"\uD83D\uDCC1",feature:"\uD83E\uDDE9",table:"⛁",endpoint:"⇄",note:"\uD83D\uDDD2"},eE=(0,a.forwardRef)(function({items:e,command:t},r){let[s,o]=(0,a.useState)(0);return((0,a.useEffect)(()=>o(0),[e]),(0,a.useImperativeHandle)(r,()=>({onKeyDown:({event:r})=>"ArrowDown"===r.key?(o(t=>(t+1)%Math.max(e.length,1)),!0):"ArrowUp"===r.key?(o(t=>(t-1+e.length)%Math.max(e.length,1)),!0):"Enter"===r.key&&(e[s]&&t(e[s]),!0)})),e.length)?(0,n.jsx)("div",{className:"glass max-h-72 min-w-56 max-w-80 overflow-y-auto rounded-lg p-1 shadow-xl",children:e.map((e,r)=>(0,n.jsxs)("button",{type:"button",onMouseDown:r=>{r.preventDefault(),t(e)},onMouseEnter:()=>o(r),className:(0,eN.cn)("flex w-full items-center gap-2 rounded px-2 py-1 text-left text-[12px]",r===s?"bg-[var(--ink-active)] text-foreground":"text-foreground/85 hover:bg-[var(--ink-hover)]"),children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"shrink-0 text-[11px] opacity-80",children:eA[e.kind]??"•"}),(0,n.jsx)("span",{className:"truncate",children:e.label}),e.sublabel&&(0,n.jsx)("span",{className:"ml-auto shrink-0 truncate text-[10px] text-muted-foreground/70",children:e.sublabel})]},`${e.kind}:${e.ref}`))}):(0,n.jsx)("div",{className:"glass min-w-56 rounded-lg p-2 text-[11px] text-muted-foreground shadow-xl",children:"No matches"})}),eS=[{v:0,l:"P0 \xb7 critical"},{v:1,l:"P1 \xb7 high"},{v:2,l:"P2 \xb7 medium"},{v:3,l:"P3 \xb7 low"}],eI=["#ff3860","#ff7a45","#fbbf24","#a1a1aa"],eM=[[/AUTH|SECURIT|LOGIN|SESSION|IDENT/,k.A],[/DATA|\bDB\b|DBMAP|SQL|STORAGE|STORE|CACHE|PERSIST/,N.A],[/\bUI\b|FRONT|VIEW|CANVAS|BOARD|DESIGN/,w.A],[/MCP|\bAPI\b|INTEGRAT/,C.A],[/WEBHOOK|HOOK/,A.A],[/INTEL|GRAPH|\bCODE\b|SYMBOL|SEARCH|FIND/,E.A],[/PLAN|ROADMAP|REVIEW/,S.A],[/INFRA|DEVOPS|CLOUD|DEPLOY|MEDIA/,I.A],[/GAM|PLAY/,M.A],[/NOTE|DOC/,R.A],[/QUERY|SEARCH/,T.A],[/BILL|\bPAY|CHECKOUT|SUBSCRIPT|INVOICE/,z.A],[/LAUNCH|RELEASE|SHIP|ROCKET/,D.A],[/INSTALL|SETUP|BOOTSTRAP|INIT/,P.A],[/CONTEXT|LAYER|BUNDLE/,O.A]],eR=[$.A,L.A,Y.A,F.A,U.A,H.A],eT="nodrag nopan";function ez({layer:e,onSave:t,readOnly:r}){let a=(0,el.jR)(e);return(0,n.jsxs)(es.l6,{value:a??"none",onValueChange:e=>t("none"===e?null:e),disabled:r,children:[(0,n.jsx)(es.bq,{title:"Which side of the stack this lands on",className:(0,eN.cn)(eT,"!h-5 shrink-0 gap-1 rounded !border-0 !bg-[var(--ink-active)] !px-1.5 !py-0 text-[9px] font-semibold uppercase tracking-wide text-muted-foreground [&_svg]:size-2.5 [&>svg]:hidden hover:[&>svg]:block"),children:(0,n.jsx)(es.yv,{children:e=>"none"===e?(0,n.jsx)("span",{className:"text-muted-foreground/70",children:"layer"}):(0,n.jsxs)("span",{className:"flex items-center gap-1",children:["backend"!==e&&(0,n.jsx)(B.A,{className:"size-2.5"}),"frontend"!==e&&(0,n.jsx)(G.A,{className:"size-2.5"}),el.YG[e]?.short??e]})})}),(0,n.jsxs)(es.gC,{alignItemWithTrigger:!1,children:[(0,n.jsx)(es.eb,{value:"none",children:"— no layer"}),Object.entries(el.YG).map(([e,t])=>(0,n.jsx)(es.eb,{value:e,children:t.label},e))]})]})}let eD={DONE:"#34d399",IN_PROGRESS:"#38bdf8",PENDING:"#fbbf24",BLOCKED:"#fb923c",CANCELLED:"#71717a",DEPRIORITIZED:"#52525b",KEEP:"#34d399",REBUILD:"#a78bfa",REPLACE:"#fb7185",DROP:"#71717a"};function eP({status:e}){return(0,n.jsx)("span",{"aria-hidden":!0,title:eo.nR[e]?.label??e,className:"absolute bottom-2 left-1 top-2 w-[3px] rounded-full",style:{background:eD[e]??"#71717a"}})}function eO({priority:e,rank:t}){let r=eI[e]??eI[3];return(0,n.jsxs)("div",{className:"flex w-5 shrink-0 flex-col items-center gap-1 self-stretch border-r border-border py-1.5",title:eS[e]?.l??"priority",children:[null!=t&&(0,n.jsx)("span",{title:`#${t} in the work order`,className:(0,eN.cn)("flex size-4 shrink-0 items-center justify-center rounded text-[10px] font-bold leading-none",1===t?"bg-emerald-400 text-black":"bg-[var(--ink-active)] text-muted-foreground"),children:t}),(0,n.jsx)("span",{className:"w-[3px] flex-1 rounded-full",style:{background:r,opacity:.9}})]})}function e$({onFocus:e,onExpand:t,onDetails:r,expanded:a,className:s}){return(0,n.jsxs)("div",{className:(0,eN.cn)(eT,"absolute z-20 flex items-center gap-0.5 rounded-lg p-0.5 transition-colors group-hover/nc:border group-hover/nc:border-border group-hover/nc:bg-card/90 group-hover/nc:shadow-lg group-hover/nc:backdrop-blur",s??"right-2 top-2"),children:[(0,n.jsx)("button",{type:"button",onClick:t=>{t.stopPropagation(),e()},title:"Edit description in focus mode",className:"flex w-0 items-center justify-center overflow-hidden rounded p-0 text-muted-foreground opacity-0 transition-all hover:text-[#ff7a45] group-hover/nc:w-6 group-hover/nc:p-0.5 group-hover/nc:opacity-100",children:(0,n.jsx)(_.A,{className:"size-3.5"})}),(0,n.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),t()},title:a?"Collapse":"Expand in place",className:"flex w-0 items-center justify-center overflow-hidden rounded p-0 text-muted-foreground opacity-0 transition-all hover:text-foreground group-hover/nc:w-6 group-hover/nc:p-0.5 group-hover/nc:opacity-100",children:(0,n.jsx)(X.A,{className:(0,eN.cn)("size-3.5 transition-transform",a&&"rotate-180")})}),(0,n.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),r()},title:"Open details side panel",className:"flex w-0 items-center justify-center overflow-hidden rounded p-0 text-muted-foreground opacity-0 transition-all hover:text-[#ff7a45] group-hover/nc:w-6 group-hover/nc:p-0.5 group-hover/nc:opacity-100",children:(0,n.jsx)(h.A,{className:"size-3.5"})})]})}function eL({value:e,label:t,Icon:r,danger:a}){return(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("div",{className:(0,eN.cn)("text-[13px] font-semibold leading-none tracking-tight tabular-nums",a&&"text-rose-700 dark:text-rose-300"),children:e}),(0,n.jsxs)("div",{className:"mt-0.5 flex items-center justify-center gap-0.5 text-[8px] font-medium uppercase tracking-wide text-muted-foreground",children:[(0,n.jsx)(r,{className:"size-2.5"}),t]})]})}function eY({importsIn:e}){let t=e>=16?5:e>=8?4:e>=4?3:e>=2?2:+(e>=1);return(0,n.jsxs)("span",{className:"flex items-center gap-1.5 text-[10px] text-muted-foreground",title:`${e} external file(s) import this component`,children:[(0,n.jsx)("span",{className:"flex items-center gap-0.5",children:[0,1,2,3,4].map(e=>(0,n.jsx)("span",{className:"size-1 rounded-full bg-sky-400",style:{opacity:e<t?.7:.18}},e))}),e>=8?"core dependency":e>=3?"shared":e>=1?"leaf":"isolated"]})}function eF({nodeId:e}){let t=(0,g.useRouter)(),[r,s]=(0,a.useState)(!1),[o,l]=(0,a.useState)(""),[i,d]=(0,a.useState)(!1),c=()=>{s(!1),l("")},x=async()=>{let r=o.trim();if(r&&!i){d(!0);try{(await fetch("/api/bug-flags",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({nodeId:e,by:"user",note:r})})).ok&&(c(),t.refresh())}finally{d(!1)}}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{type:"button",title:"Flag a bug on this component",onClick:e=>{e.stopPropagation(),s(e=>!e)},className:(0,eN.cn)(eT,"absolute -right-3 top-[calc(50%-28px)] z-10 flex size-6 -translate-y-1/2 items-center justify-center rounded-full border border-border bg-card text-muted-foreground shadow-md transition-all hover:border-rose-400/50 hover:text-rose-600 dark:hover:text-rose-300",r?"border-rose-400/50 text-rose-600 opacity-100 dark:text-rose-300":"opacity-0 group-hover/nc:opacity-100"),children:(0,n.jsx)(u.A,{className:"size-3"})}),r&&(0,n.jsxs)("div",{onClick:e=>e.stopPropagation(),className:(0,eN.cn)(eT,"absolute -right-2 top-[calc(50%-28px)] z-20 w-60 translate-x-full rounded-xl border border-rose-400/25 bg-popover p-2 shadow-xl"),children:[(0,n.jsxs)("div",{className:"mb-1.5 flex items-center justify-between",children:[(0,n.jsxs)("span",{className:"flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wide text-rose-700 dark:text-rose-300",children:[(0,n.jsx)(u.A,{className:"size-3"})," Flag a bug"]}),(0,n.jsx)("button",{type:"button",title:"Cancel",onClick:c,className:"rounded p-0.5 text-muted-foreground transition-colors hover:bg-[var(--ink-active)] hover:text-foreground",children:(0,n.jsx)("span",{className:"block px-1 text-[11px] leading-none",children:"✕"})})]}),(0,n.jsx)("textarea",{autoFocus:!0,rows:2,value:o,placeholder:"What did you find?",onChange:e=>l(e.target.value),onKeyDown:e=>{e.stopPropagation(),"Escape"===e.key&&c(),"Enter"!==e.key||e.shiftKey||(e.preventDefault(),x())},className:"field-sizing-content max-h-40 min-h-12 w-full resize-none rounded-md bg-[var(--ink-hover)] px-1.5 py-1 text-xs outline-none placeholder:text-muted-foreground/50 focus:bg-[var(--ink-active)]"}),(0,n.jsx)("button",{type:"button",disabled:i||!o.trim(),onClick:()=>void x(),className:"mt-1.5 w-full rounded-md bg-rose-500/15 py-1 text-[11px] font-semibold text-rose-700 transition-colors hover:bg-rose-500/25 disabled:opacity-50 dark:text-rose-300",children:i?"Flagging…":"Flag bug"})]})]})}let eU=["border-[#ff3860]/60 shadow-[0_0_0_1px_rgba(255,56,96,0.15)]","border-[#ff7a45]/50","border-amber-400/35","border-border"],eH=(0,a.memo)(function({id:e,data:t,selected:r}){let{categories:s,statuses:o,patch:l,isExpanded:i,toggleExpand:d,openDetailed:c,openFocus:x,removeNode:p,editingTitleId:m,onAskAgent:f,hasFrontend:h,readOnly:g}=ec(),y=i(e),[k,N]=(0,a.useState)(!1),[w,C]=(0,a.useState)(t.title),[A,E]=(0,a.useState)(t.cluster??""),[S,I]=(0,a.useState)(t.plain??"");(0,a.useEffect)(()=>I(t.plain??""),[t.plain]);let M="BUG"===t.kind&&"ROADMAP"===t.view,R="ARCHITECTURE"===t.view,T=R?"border-border":eU[t.priority]??"border-border",z=t.openBugs??0,D="CANCELLED"===t.status||"DROP"===t.status,P="DEPRIORITIZED"===t.status,O="DRAFT"===t.source,$="IN_PROGRESS"===t.status,L="INIT"===t.source&&"ROADMAP"===t.view,Y=t=>{g||l(e,t,!0)},[F,U]=(0,a.useTransition)(),H=(0,eu.k)();if("full"!==H)return(0,n.jsxs)("div",{className:(0,eN.cn)("relative rounded-lg border bg-card px-3 py-2.5 text-card-foreground shadow-sm","w-fit max-w-[296px]",t.isChild?"min-w-56":"min-w-64",M?"border-rose-400/50 bg-rose-500/[0.05]":T,$&&"border-sky-400/60",r&&"ring-2 ring-[var(--accent,#f5b942)]",D&&"opacity-60","far"===H&&!g&&"!opacity-0"),children:[(0,n.jsx)(b.x,{}),(0,n.jsx)(eP,{status:t.status}),(0,n.jsx)("div",{className:"break-words text-[15px] font-semibold leading-snug",children:t.title})]});let B=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(b.x,{}),R&&(0,n.jsx)(eF,{nodeId:e}),(t.pins?.length??0)>0?(0,n.jsx)(v.e0,{pins:t.pins,onPinClick:t.onPinClick}):t.onComment&&(0,n.jsx)("button",{type:"button",title:`Annotate ${t.title}`,onClick:e=>{e.stopPropagation(),t.onComment?.(t.title)},className:(0,eN.cn)(eT,"absolute -right-3 top-1/2 z-10 flex size-6 -translate-y-1/2 items-center justify-center rounded-full border border-border bg-card text-muted-foreground opacity-0 shadow-md transition-all group-hover/nc:opacity-100 hover:border-[#ff7a45]/50 hover:text-[#ff7a45]"),children:(0,n.jsx)(K.A,{className:"size-3"})})]}),G=(t.childCount??0)>0&&(0,n.jsxs)("button",{type:"button",onClick:r=>{r.stopPropagation(),t.onToggleCollapse?.(e)},title:t.collapsed?`Show ${t.childCount} sub-task${1===t.childCount?"":"s"}`:`Hide ${t.childCount} sub-task${1===t.childCount?"":"s"}`,className:(0,eN.cn)(eT,"mt-0.5 flex shrink-0 items-center gap-0.5 rounded px-1 text-[10px] font-semibold transition-colors",t.collapsed?"bg-[var(--ink-active)] text-foreground hover:brightness-110":"text-muted-foreground hover:bg-[var(--ink-hover)] hover:text-foreground"),children:[t.collapsed?(0,n.jsx)(Z.A,{className:"size-3"}):(0,n.jsx)(X.A,{className:"size-3"}),t.childCount]}),_=(0,n.jsx)(e$,{onFocus:()=>x({id:e,title:t.title||"Untitled",value:S,editable:!g,onCommit:e=>Y({plain:e.trim()||null})}),onExpand:()=>d(e),onDetails:()=>c(e),expanded:y,className:"top-full right-1 mt-1.5 before:absolute before:inset-x-0 before:bottom-full before:h-2.5 before:content-['']"}),el=(0,n.jsx)("textarea",{rows:1,value:w,readOnly:g,autoFocus:m===e,placeholder:"Title…",onFocus:t=>{m===e&&t.currentTarget.select()},onChange:e=>C(e.target.value),onBlur:()=>{let e=w.trim();e&&e!==t.title&&Y({title:e})},onKeyDown:e=>{e.stopPropagation(),"Enter"!==e.key||e.shiftKey||(e.preventDefault(),e.currentTarget.blur())},className:(0,eN.cn)(eT,"field-sizing-content w-full resize-none bg-transparent text-sm font-medium leading-snug outline-none placeholder:text-muted-foreground/60",D&&"line-through")}),ed=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("input",{list:`cats-${e}`,value:A,readOnly:g,placeholder:R?"domain":"category",title:R?"Architecture domain — the lane this component lives in":void 0,onChange:e=>E(e.target.value),onBlur:()=>{let e=A.trim()||null;e!==(t.cluster??null)&&Y({cluster:e})},onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key&&e.currentTarget.blur()},className:(0,eN.cn)(eT,"field-sizing-content min-w-12 max-w-[60%] rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide outline-none focus:brightness-125 [&::-webkit-calendar-picker-indicator]:hidden",(0,ei.a2)(A))}),(0,n.jsx)("datalist",{id:`cats-${e}`,children:s.map(e=>(0,n.jsx)("option",{value:e},e))})]}),ex="LINEAR"===t.source?t.externalMeta?.state:void 0,ep=(0,n.jsxs)(es.l6,{value:t.status,onValueChange:e=>Y({status:e}),disabled:g,children:[(0,n.jsx)(es.bq,{title:ex?`Linear state: ${ex.name}`:void 0,className:(0,eN.cn)(eT,"!h-5 shrink-0 !gap-0.5 rounded border !px-1.5 !py-0 text-[10px] font-medium [&_svg]:size-3",eo.nR[t.status]?.className??"border-border"),children:(0,n.jsx)(es.yv,{children:e=>ex?(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"size-1.5 shrink-0 rounded-full",style:{background:ex.color}}),ex.name]}):eo.nR[e]?.label??e})}),(0,n.jsx)(es.gC,{alignItemWithTrigger:!1,children:o.map(e=>(0,n.jsx)(es.eb,{value:e,children:eo.nR[e]?.label??e},e))})]}),em=(z>0||(t.signals?.untested??0)>0||t.signals?.auth)&&(0,n.jsxs)("div",{className:"mt-1.5 flex w-0 min-w-full flex-wrap items-center gap-1",children:[z>0&&(0,n.jsxs)("span",{title:`${z} open bug flag(s)`,className:"flex items-center gap-1 rounded bg-rose-500/15 px-1 text-[9px] font-semibold uppercase tracking-wide text-rose-700 dark:text-rose-300",children:[(0,n.jsx)(u.A,{className:"size-2.5"}),z]}),(t.signals?.untested??0)>0&&(0,n.jsxs)("span",{title:`${t.signals.untested} of ${t.signals.total} attached file(s) have no test importing them`,className:"flex items-center gap-1 rounded bg-amber-500/15 px-1 text-[9px] font-semibold uppercase tracking-wide text-amber-700 dark:text-amber-300",children:[(0,n.jsx)(W.A,{className:"size-2.5"}),t.signals.untested]}),t.signals?.auth&&(0,n.jsxs)("span",{title:"touches auth-sensitive files",className:"flex items-center gap-1 rounded bg-red-500/15 px-1 text-[9px] font-semibold uppercase tracking-wide text-red-700 dark:text-red-300",children:[(0,n.jsx)(V.A,{className:"size-2.5"})," auth"]})]}),ef=y&&(0,n.jsxs)("div",{className:"mt-2 w-0 min-w-full space-y-2 border-t border-border pt-2",children:[(0,n.jsx)(ew,{compact:!0,editable:!g,value:S,onChange:I,onBlur:()=>{let e=S.trim()||null;e!==(t.plain??null)&&Y({plain:e})}}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 pr-8",children:[(0,n.jsx)("div",{className:"flex items-center gap-1",children:!R&&(0,n.jsxs)(es.l6,{value:String(t.priority),onValueChange:e=>Y({priority:Number(e)}),disabled:g,children:[(0,n.jsx)(es.bq,{className:(0,eN.cn)(eT,"!h-6 gap-1 rounded border-border !px-1.5 !py-0 text-[10px] [&_svg]:size-3"),children:(0,n.jsx)(es.yv,{children:e=>eS.find(t=>String(t.v)===e)?.l??e})}),(0,n.jsx)(es.gC,{alignItemWithTrigger:!1,children:eS.map(e=>(0,n.jsx)(es.eb,{value:String(e.v),children:e.l},e.v))})]})}),(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[!g&&(0,n.jsxs)("button",{type:"button",onClick:t=>{t.stopPropagation(),k?p(e):N(!0)},onBlur:()=>N(!1),title:"Delete node",className:(0,eN.cn)(eT,"flex items-center gap-1 rounded px-1.5 py-1 text-[10px] transition-colors",k?"bg-red-500/20 text-red-700 dark:text-red-300":"text-muted-foreground hover:bg-[var(--ink-hover)] hover:text-red-600 dark:hover:text-red-300"),children:[(0,n.jsx)(q.A,{className:"size-3"}),k&&"Delete?"]}),f&&(0,n.jsxs)("button",{type:"button",onClick:e=>{e.stopPropagation(),f(`${R?"component":"feature"}: ${t.title}`)},title:"Ask the agent a question about this (answered in its next round)",className:(0,eN.cn)(eT,"flex items-center gap-1 rounded px-1.5 py-1 text-[10px] text-sky-700/90 hover:bg-sky-500/15 hover:text-sky-700 dark:text-sky-300/90 dark:hover:text-sky-300"),children:[(0,n.jsx)(J.A,{className:"size-3"})," Ask"]})]})]})]});if(R){let e=(0,ei.i3)(t.cluster);return(0,n.jsxs)("div",{className:(0,eN.cn)("group/nc relative rounded-lg border bg-card px-3 py-2.5 text-card-foreground shadow-sm transition","w-fit min-w-60 max-w-72",O?"border-dashed border-sky-400/50 bg-sky-500/[0.06]":"border-border",$&&"border-sky-400/60 shadow-[0_0_0_1px_rgba(56,160,255,0.25)]",r&&"ring-2 ring-[var(--accent,#f5b942)]",D&&"opacity-60",P&&"opacity-70 border-dashed"),children:[B,(0,n.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,n.jsx)("span",{className:"mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg",style:{background:`color-mix(in oklab, ${e} 18%, transparent)`,color:e},children:(0,a.createElement)(function(e){let t=(e??"").toUpperCase();for(let[e,r]of eM)if(e.test(t))return r;if(!t)return eR[0];let r=0;for(let e=0;e<t.length;e++)r=31*r+t.charCodeAt(e)>>>0;return eR[r%eR.length]}(t.cluster),{className:"size-4"})}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsxs)("div",{className:"flex items-start gap-1",children:[el,G]}),(0,n.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[ed,h&&(0,n.jsx)(ez,{layer:t.layer,onSave:e=>Y({layer:e}),readOnly:g})]})]}),(0,n.jsx)("div",{className:"shrink-0",children:ep})]}),t.role&&(0,n.jsx)("div",{className:"mt-2 line-clamp-1 text-[10.5px] leading-snug text-muted-foreground",children:t.role}),(0,n.jsxs)("div",{className:"mt-2.5 grid grid-cols-4 gap-1 border-t border-border pt-2",children:[(0,n.jsx)(eL,{value:t.fileCount??0,label:"files",Icon:Q.A}),(0,n.jsx)(eL,{value:t.importsIn??"—",label:"in",Icon:ee.A}),(0,n.jsx)(eL,{value:t.importsOut??"—",label:"out",Icon:et.A}),(0,n.jsx)(eL,{value:z,label:"bug",Icon:u.A,danger:z>0})]}),null!=t.importsIn&&(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)(eY,{importsIn:t.importsIn})}),_,ef]})}let eh=t.childCount??0,eg=t.childDone??0;return(0,n.jsxs)("div",{className:(0,eN.cn)("group/nc relative flex rounded-lg border bg-card text-card-foreground shadow-sm transition","w-fit max-w-96",y?"min-w-80":"min-w-64",O?"border-dashed border-sky-400/50 bg-sky-500/[0.06]":L?"border-dashed border-violet-400/60 bg-violet-500/[0.07] shadow-[0_0_0_1px_rgba(167,139,250,0.18)]":T,M&&!O&&"border-rose-400/50 bg-rose-500/[0.05]",$&&"border-sky-400/60 shadow-[0_0_0_1px_rgba(56,160,255,0.25)]",t.isNext&&"border-emerald-400/70 shadow-[0_0_0_2px_rgba(52,211,153,0.35)]",null!=t.workOrderRank&&t.workOrderRank>1&&"border-emerald-400/25",r&&"ring-2 ring-[var(--accent,#f5b942)]",D&&"opacity-60",P&&"opacity-70 border-dashed"),children:[B,_,(0,n.jsx)(eO,{priority:t.priority,rank:t.workOrderRank}),"LINEAR"===t.source&&(t.assigneeAvatarUrl?(0,n.jsx)("img",{src:t.assigneeAvatarUrl,alt:t.assigneeName??"assignee",title:t.assigneeName?`Owner: ${t.assigneeName}`:"Assignee",draggable:!1,className:(0,eN.cn)(eT,"absolute -left-2 -top-2 z-20 size-5 rounded-full object-cover shadow ring-2 ring-background")}):t.assigneeName?(0,n.jsx)("span",{title:`Owner: ${t.assigneeName}`,className:(0,eN.cn)(eT,"absolute -left-2 -top-2 z-20 flex size-5 items-center justify-center rounded-full bg-[#3a3a40] text-[8px] font-semibold uppercase text-white/90 shadow ring-2 ring-background"),children:t.assigneeName.split(/\s+/).map(e=>e[0]).slice(0,2).join("")}):null),(0,n.jsxs)("div",{className:"min-w-0 flex-1 px-2.5 py-2.5",children:[(0,n.jsxs)("div",{className:"flex w-0 min-w-full items-start gap-1.5",children:[(0,n.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1",children:[$&&(0,n.jsx)("span",{title:"in progress",className:"mt-1.5 inline-block size-2 shrink-0 animate-pulse rounded-full bg-sky-400"}),t.isCriterion&&!$&&(0,n.jsx)("span",{title:"Success criterion",className:"mt-1.5 inline-block size-1.5 shrink-0 rounded-full bg-[var(--accent,#f5b942)]"}),el,G]}),(0,n.jsx)("div",{className:"shrink-0",children:ep})]}),(0,n.jsxs)("div",{className:"mt-1.5 flex w-0 min-w-full flex-wrap items-center gap-1.5",children:[(0,n.jsxs)("span",{title:M?"Bug — something to fix":t.isChild?"Sub-task of a feature":"Feature — top-level roadmap item",className:(0,eN.cn)("flex shrink-0 items-center gap-1 rounded px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide",M?"bg-rose-500/15 text-rose-700 dark:text-rose-300":t.isChild?"bg-zinc-500/15 text-zinc-600 dark:text-zinc-300":"bg-sky-500/15 text-sky-700 dark:text-sky-300"),children:[M&&(0,n.jsx)(u.A,{className:"size-2.5"}),M?"bug":t.isChild?"sub-task":"feature"]}),h&&(0,n.jsx)(ez,{layer:t.layer,onSave:e=>Y({layer:e}),readOnly:g}),L&&(0,n.jsxs)("span",{className:(0,eN.cn)("flex items-center gap-1 rounded bg-violet-500/15 px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-violet-700 dark:text-violet-300",F&&"opacity-50"),children:[(0,n.jsx)(er.A,{className:"size-2.5"})," IA",(0,n.jsx)("button",{type:"button",title:"Accept suggestion — turn it into your own feature",disabled:F,onClick:t=>{t.stopPropagation(),U(async()=>j(e))},className:(0,eN.cn)(eT,"-my-0.5 rounded p-0.5 hover:bg-emerald-500/20 hover:text-emerald-600 dark:hover:text-emerald-300"),children:(0,n.jsx)(en.A,{className:"size-2.5"})}),(0,n.jsx)("button",{type:"button",title:"Dismiss suggestion (deletes the card)",disabled:F,onClick:t=>{t.stopPropagation(),p(e)},className:(0,eN.cn)(eT,"-my-0.5 -ml-0.5 rounded p-0.5 hover:bg-red-500/20 hover:text-red-600 dark:hover:text-red-300"),children:(0,n.jsx)(ea.A,{className:"size-2.5"})})]}),ed]}),t.role&&(0,n.jsx)("div",{className:(0,eN.cn)("mt-1.5 w-0 min-w-full text-[10px] leading-snug text-muted-foreground",!y&&"line-clamp-1"),children:t.role}),eh>0&&(0,n.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,n.jsx)("span",{className:"h-[3px] flex-1 overflow-hidden rounded-full bg-[var(--ink-active)]",title:`${eg}/${eh} sub-tasks done`,children:(0,n.jsx)("span",{className:"block h-full rounded-full bg-sky-400/75",style:{width:`${eh?eg/eh*100:0}%`}})}),(0,n.jsxs)("span",{className:"flex shrink-0 items-center gap-1 text-[10px] text-muted-foreground",children:[(0,n.jsx)(en.A,{className:"size-3"}),eg,"/",eh]})]}),em,ef]})]})});var eB=r(54698),eG=r(24692),e_=r(81499),eX=r(51128);let eK=(0,a.memo)(function({data:e}){let[t,r]=(0,a.useState)(!1),s=e.columns??[],o=t?s:s.slice(0,5),l=s.length-o.length,i=e.sample??[];return(0,n.jsxs)("div",{className:"w-[270px] rounded-xl border border-sky-400/25 bg-card/95 text-card-foreground shadow-[0_18px_50px_-22px_rgba(0,0,0,0.9)] backdrop-blur dark:bg-[#13161b]/95",children:[(0,n.jsx)(b.x,{}),(0,n.jsxs)("div",{className:"flex items-center gap-1.5 rounded-t-[11px] border-b border-border dark:border-white/[0.06] bg-sky-400/[0.07] px-3 py-2",children:[(0,n.jsx)(N.A,{className:"size-3.5 shrink-0 text-sky-400/80"}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-[13px] font-semibold tracking-tight",title:e.name,children:e.name}),e.domain&&(0,n.jsx)("span",{className:"shrink-0 text-[9px] uppercase tracking-[0.14em] text-sky-300/70",children:e.domain})]}),e.note&&(0,n.jsx)("div",{className:"border-b border-border px-3 py-1.5 text-[11px] leading-snug text-muted-foreground dark:border-white/[0.05]",children:e.note}),(0,n.jsx)("div",{className:"divide-y divide-border dark:divide-white/[0.05]",children:o.map(e=>(0,n.jsxs)("div",{className:"px-3 py-[6px]",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 text-[12px]",children:[e.isPk?(0,n.jsx)(e_.A,{className:"size-3 shrink-0 text-amber-300/90"}):e.isFk?(0,n.jsx)(eX.A,{className:"size-3 shrink-0 text-sky-400/80"}):(0,n.jsx)("span",{className:"size-3 shrink-0"}),(0,n.jsx)("span",{className:(0,eN.cn)("shrink-0 whitespace-nowrap font-mono",e.isPk&&"text-amber-200/95"),children:e.name}),(0,n.jsx)("span",{title:e.fkTo?`→ ${e.fkTo}`:e.type,className:"ml-auto min-w-0 truncate font-mono text-[11px] text-muted-foreground/80",children:e.fkTo?(0,n.jsxs)(n.Fragment,{children:["→\xa0",e.fkTo]}):e.type})]}),e.note&&(0,n.jsx)("div",{className:"ml-5 mt-0.5 text-[10.5px] leading-snug text-muted-foreground/70 [overflow-wrap:anywhere]",children:e.note})]},e.name))}),(l>0||i.length>0)&&(0,n.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),r(e=>!e)},className:"nodrag nopan flex w-full items-center justify-center gap-1 rounded-b-[11px] border-t border-border dark:border-white/[0.06] px-3 py-1.5 text-[10px] text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-foreground dark:hover:bg-white/[0.04]",children:t?"Show less":l>0?`+${l} more column${1===l?"":"s"}`:"Show example row"}),t&&i.length>0&&(0,n.jsxs)("div",{className:"nowheel overflow-x-auto border-t border-border dark:border-white/[0.06] px-3 py-2",children:[(0,n.jsx)("div",{className:"mb-1 text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground/70",children:"example"}),(0,n.jsxs)("table",{className:"border-collapse font-mono text-[10px]",children:[(0,n.jsx)("thead",{children:(0,n.jsx)("tr",{className:"text-muted-foreground/60",children:s.map(e=>(0,n.jsx)("th",{className:"whitespace-nowrap px-1.5 pb-1 text-left font-medium",children:e.name},e.name))})}),(0,n.jsx)("tbody",{children:i.map((e,t)=>(0,n.jsx)("tr",{className:"text-foreground/85",children:s.map(t=>(0,n.jsx)("td",{className:"whitespace-nowrap px-1.5 py-0.5",children:e[t.name]??""},t.name))},t))})]})]})]})});var eZ=r(45437),eW=r(23723),eV=r(9083),eq=r(36145),eJ=r(36408),eQ=r(57465),e0=r(91259),e1=r(1275),e5=r(18986),e2=r(59680),e3=r(64329),e4=r(47409),e6=r(4474),e7=r(70521),e9=r(74350),e8=r(39658);function te({className:e,...t}){return(0,n.jsx)("textarea",{"data-slot":"textarea",className:(0,eN.cn)("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),...t})}var tt=r(61388);function tr({className:e,...t}){return(0,n.jsx)(tt.b,{"data-slot":"label",className:(0,eN.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...t})}let tn=(0,y.createServerReference)("40467e97c598f5efce143be114d181684cdc8c8801",y.callServer,void 0,y.findSourceMapURL,"createNodeAction"),ta=(0,y.createServerReference)("60fc1a1091aee96998c4058daf638f8a6efdb6f902",y.callServer,void 0,y.findSourceMapURL,"updateNodeAction");function ts({open:e,onOpenChange:t,mode:r,view:s,heading:o,nodeId:l,parentId:i,position:d,defaults:c,hasFrontend:u=!1}){let x=(0,g.useRouter)(),[p,m]=(0,a.useState)(c?.title??""),[f,h]=(0,a.useState)(c?.role??""),[b,v]=(0,a.useState)(c?.plain??""),[y,j]=(0,a.useState)(c?.cluster??""),[k,N]=(0,a.useState)(c?.status??("ARCHITECTURE"===s?"REBUILD":"PENDING")),[w,C]=(0,a.useState)(c?.kind==="BUG"?"BUG":"FEATURE"),[A,E]=(0,a.useState)((0,el.jR)(c?.layer)??"none"),[S,I]=(0,a.useState)(!1),M="ARCHITECTURE"===s?eo.m6:eo.yl;async function R(){if(p.trim()){I(!0);try{let e="none"===A?null:A;"create"===r?await tn({view:s,..."ROADMAP"===s?{kind:w}:{},title:p.trim(),role:f.trim()||null,plain:b.trim()||null,cluster:y.trim()||null,...u?{layer:e}:{},parentId:i??null,status:k,x:d?.x??60,y:d?.y??60}):l&&await ta(l,{..."ROADMAP"===s?{kind:w}:{},title:p.trim(),role:f.trim()||null,plain:b.trim()||null,cluster:y.trim()||null,...u?{layer:e}:{},status:k}),t(!1),x.refresh()}finally{I(!1)}}}return(0,n.jsx)(e9.lG,{open:e,onOpenChange:t,children:(0,n.jsxs)(e9.Cf,{children:[(0,n.jsx)(e9.c7,{children:(0,n.jsx)(e9.L3,{children:o})}),(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)(tr,{htmlFor:"nf-title",children:"Title"}),(0,n.jsx)(e8.p,{id:"nf-title",value:p,autoFocus:!0,onChange:e=>m(e.target.value)})]}),(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)(tr,{htmlFor:"nf-role",children:"Role (one line)"}),(0,n.jsx)(e8.p,{id:"nf-role",value:f,onChange:e=>h(e.target.value)})]}),(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)(tr,{htmlFor:"nf-plain",children:"Description"}),(0,n.jsx)(te,{id:"nf-plain",rows:3,value:b,onChange:e=>v(e.target.value)})]}),"ROADMAP"===s&&(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)(tr,{children:"Kind"}),(0,n.jsxs)(es.l6,{value:w,onValueChange:e=>null!=e&&C(e),children:[(0,n.jsx)(es.bq,{children:(0,n.jsx)(es.yv,{children:e=>"BUG"===e?"Bug":"Feature"})}),(0,n.jsxs)(es.gC,{children:[(0,n.jsx)(es.eb,{value:"FEATURE",children:"Feature"}),(0,n.jsx)(es.eb,{value:"BUG",children:"Bug"})]})]})]}),u&&(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)(tr,{children:"Layer"}),(0,n.jsxs)(es.l6,{value:A,onValueChange:e=>null!=e&&E(e),children:[(0,n.jsx)(es.bq,{children:(0,n.jsx)(es.yv,{children:e=>"none"===e?"—":el.YG[e]?.label??e})}),(0,n.jsxs)(es.gC,{children:[(0,n.jsx)(es.eb,{value:"none",children:"—"}),Object.keys(el.YG).map(e=>(0,n.jsx)(es.eb,{value:e,children:el.YG[e].label},e))]})]})]}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)(tr,{children:"Status"}),(0,n.jsxs)(es.l6,{value:k,onValueChange:e=>null!=e&&N(e),children:[(0,n.jsx)(es.bq,{children:(0,n.jsx)(es.yv,{children:e=>eo.nR[e]?.label??e})}),(0,n.jsx)(es.gC,{children:M.map(e=>(0,n.jsx)(es.eb,{value:e,children:eo.nR[e]?.label??e},e))})]})]}),(0,n.jsxs)("div",{className:"space-y-1.5",children:[(0,n.jsx)(tr,{htmlFor:"nf-cluster",children:"Cluster / lane"}),(0,n.jsx)(e8.p,{id:"nf-cluster",value:y,onChange:e=>j(e.target.value)})]})]})]}),(0,n.jsxs)(e9.Es,{children:[(0,n.jsx)(e6.$,{variant:"outline",onClick:()=>t(!1),children:"Cancel"}),(0,n.jsx)(e6.$,{onClick:R,disabled:S||!p.trim(),children:S?"Saving…":"Save"})]})]})})}let to=(0,y.createServerReference)("4082e119e7997decee01b634b5bb66ddef57834032",y.callServer,void 0,y.findSourceMapURL,"deleteNodeAction"),tl=(0,y.createServerReference)("60f8cdcb5931c995e6fe5830c60072052e21e49cb9",y.callServer,void 0,y.findSourceMapURL,"setStatusAction"),ti=(0,y.createServerReference)("40ad73811db4f257c117eddffe5857b199d064fe2c",y.callServer,void 0,y.findSourceMapURL,"deprioritizeAction"),td=(0,y.createServerReference)("4038c80f0b4b50ab317b1da3463121032b8dfe0741",y.callServer,void 0,y.findSourceMapURL,"cancelAction");function tc({view:e,selected:t,allNodes:r,onClose:a,commentsContent:s,commentsCount:o=0,activeTab:l,onTabChange:i,onAddComment:d,topOffset:c}){let u=!!s,x=l??"details",p=t?.parentId?r.find(e=>e.id===t.parentId)?.title??null:null;return(0,n.jsxs)(e3.p_,{topOffset:c,children:[(0,n.jsx)(e3.aO,{tabs:u?{active:x,count:o,onChange:e=>i?.(e)}:null,breadcrumb:t?(0,n.jsx)(tu,{node:t,view:e}):"ROADMAP"===e?"Roadmap":"Architecture",comment:d&&t&&"details"===x?{title:`Comment on this ${"ARCHITECTURE"===e?"component":"feature"}`,onClick:()=>d(t.title)}:null,onClose:a}),(0,n.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:(0,n.jsx)("div",{className:"px-4 py-3",children:"comments"===x&&u?s:t?(0,n.jsx)(tx,{node:t,view:e,parentTitle:p,showBreadcrumb:u},t.id):(0,n.jsx)(tf,{view:e,nodes:r})})})]})}function tu({node:e,view:t}){let{hasFrontend:r}=ec(),a=(0,el.jR)(e.layer),s="ARCHITECTURE"===t?"component":"BUG"===e.kind?"bug":e.parentId?"sub-task":"feature";return(0,n.jsxs)(n.Fragment,{children:[(0,eo.Xf)(e.cluster),r&&a&&(0,n.jsxs)("span",{children:[" \xb7 ",el.YG[a].label]}),(0,n.jsxs)("span",{children:[" \xb7 ",s]})]})}function tx({node:e,view:t,parentTitle:r,showBreadcrumb:s}){let o=(0,g.useRouter)(),[l,i]=(0,a.useTransition)(),[d,u]=(0,a.useState)(!1),[x,p]=(0,a.useState)(!1),[m,f]=(0,a.useState)(!1),[h,b]=(0,a.useState)(!1),[v,y]=(0,a.useState)(!1),[k,N]=(0,a.useState)(e.plain??"");(0,a.useEffect)(()=>N(e.plain??""),[e.id,e.plain]);let{hasFrontend:w,openFocus:C}=ec(),A="ARCHITECTURE"===t?eo.m6:eo.yl,E="LINEAR"===e.source&&e.sourceRef?e.sourceRef.match(/\/issue\/([^/]+)/)?.[1]??"Linear issue":null,S=e=>i(async()=>{await e(),o.refresh()});return(0,n.jsxs)("div",{children:[s&&(0,n.jsx)("div",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:(0,n.jsx)(tu,{node:e,view:t})}),(0,n.jsx)("h2",{className:"text-base font-semibold leading-snug",children:e.title}),"INIT"===e.source&&"ROADMAP"===t&&(0,n.jsxs)("div",{className:"mt-3 rounded-lg border border-violet-400/25 bg-violet-500/[0.05] p-2.5",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 text-xs font-semibold text-violet-700 dark:text-violet-300",children:[(0,n.jsx)(er.A,{className:"size-3.5"})," AI suggestion"]}),(0,n.jsx)("p",{className:"mt-1 text-[11px] leading-snug text-muted-foreground",children:"Suggested direction surfaced when mapping the repo. Accept to turn it into your own feature, or dismiss."}),(0,n.jsxs)("div",{className:"mt-2 flex gap-1.5",children:[(0,n.jsx)(e6.$,{size:"sm",className:"h-7 px-2.5 text-xs",disabled:l,onClick:()=>S(()=>j(e.id)),children:"Accept"}),(0,n.jsx)(e6.$,{size:"sm",variant:"ghost",className:"h-7 px-2.5 text-xs text-muted-foreground",disabled:l,onClick:()=>S(()=>to(e.id)),children:"Dismiss"})]})]}),(0,n.jsxs)("div",{className:"mt-3 space-y-px",children:[(0,n.jsx)(e3.yc,{icon:eW.A,label:"Status",children:(0,n.jsxs)(es.l6,{value:e.status,onValueChange:t=>null!=t&&S(()=>tl(e.id,t)),children:[(0,n.jsx)(es.bq,{className:e3.Sq,disabled:l,children:(0,n.jsx)(es.yv,{children:e=>(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"size-2 rounded-full",style:{background:eD[e]??"#71717a"}}),eo.nR[e]?.label??e]})})}),(0,n.jsx)(es.gC,{alignItemWithTrigger:!1,children:A.map(e=>(0,n.jsx)(es.eb,{value:e,children:eo.nR[e]?.label??e},e))})]})}),"ARCHITECTURE"!==t&&(0,n.jsx)(e3.yc,{icon:eV.A,label:"Priority",children:(0,n.jsxs)(es.l6,{value:String(e.priority),onValueChange:t=>null!=t&&S(()=>ta(e.id,{priority:Number(t)})),children:[(0,n.jsx)(es.bq,{className:e3.Sq,disabled:l,children:(0,n.jsx)(es.yv,{children:e=>eS.find(t=>String(t.v)===e)?.l??e})}),(0,n.jsx)(es.gC,{alignItemWithTrigger:!1,children:eS.map(e=>(0,n.jsx)(es.eb,{value:String(e.v),children:e.l},e.v))})]})}),w&&(0,n.jsx)(e3.yc,{icon:O.A,label:"Layer",children:(0,n.jsxs)(es.l6,{value:(0,el.jR)(e.layer)??"none",onValueChange:t=>null!=t&&S(()=>ta(e.id,{layer:"none"===t?null:t})),children:[(0,n.jsx)(es.bq,{className:e3.Sq,disabled:l,children:(0,n.jsx)(es.yv,{children:e=>"none"===e?(0,n.jsx)("span",{className:"text-muted-foreground",children:"No layer"}):el.YG[e]?.label??e})}),(0,n.jsxs)(es.gC,{alignItemWithTrigger:!1,children:[(0,n.jsx)(es.eb,{value:"none",children:"— no layer"}),Object.entries(el.YG).map(([e,t])=>(0,n.jsx)(es.eb,{value:e,children:t.label},e))]})]})}),e.cluster&&(0,n.jsx)(e3.yc,{icon:eq.A,label:"Category",children:(0,n.jsx)("span",{className:(0,eN.cn)("rounded px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wide",(0,ei.a2)(e.cluster)),children:e.cluster})}),r&&(0,n.jsx)(e3.yc,{icon:eJ.A,label:"Parent",children:(0,n.jsx)("span",{className:"truncate",children:r})}),"LINEAR"===e.source&&e.externalMeta?.state&&(0,n.jsx)(e3.yc,{icon:eW.A,label:"State",children:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"size-2 rounded-full",style:{background:e.externalMeta.state.color}}),e.externalMeta.state.name]})}),"LINEAR"===e.source&&e.externalMeta?.team&&(0,n.jsx)(e3.yc,{icon:eQ.A,label:"Team",children:(0,n.jsx)("span",{className:"truncate",children:e.externalMeta.team.name})}),"LINEAR"===e.source&&e.externalMeta?.project&&(0,n.jsx)(e3.yc,{icon:L.A,label:"Project",children:(0,n.jsx)("span",{className:"truncate",children:e.externalMeta.project.name})}),"LINEAR"===e.source&&e.externalMeta?.milestone&&(0,n.jsx)(e3.yc,{icon:e0.A,label:"Milestone",children:(0,n.jsx)("span",{className:"truncate",children:e.externalMeta.milestone.name})}),E?(0,n.jsx)(e3.yc,{icon:e1.A,label:"Linear",children:(0,n.jsxs)("a",{href:e.sourceRef,target:"_blank",rel:"noreferrer",className:"flex items-center gap-1 rounded-md px-1.5 py-0.5 font-mono text-xs transition-colors hover:bg-[var(--ink-hover)] hover:text-[var(--accent-2,#ff7a45)]",children:[E,(0,n.jsx)(e1.A,{className:"size-3"})]})}):e.sourceRef?(0,n.jsx)(e3.yc,{icon:e1.A,label:"Source",children:(0,n.jsx)("span",{className:"truncate font-mono text-[11px] text-muted-foreground",children:e.sourceRef})}):null]}),(0,n.jsx)(e3.aU,{title:(0,n.jsxs)(n.Fragment,{children:["Description",(0,n.jsx)("button",{type:"button",title:"Edit in focus mode",onClick:()=>C({id:e.id,title:e.title,value:k,editable:!0,onCommit:t=>{N(t);let r=t.trim()||null;r!==(e.plain??null)&&S(()=>ta(e.id,{plain:r}))}}),className:"ml-auto rounded p-0.5 text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-[var(--accent-2,#ff7a45)]",children:(0,n.jsx)(_.A,{className:"size-3.5"})})]}),children:v?(0,n.jsx)(ew,{value:k,onChange:N,onBlur:()=>{y(!1);let t=k.trim()||null;t!==(e.plain??null)&&S(()=>ta(e.id,{plain:t}))},autoFocus:!0},"edit"):k.trim()?(0,n.jsx)("div",{role:"button",tabIndex:0,title:"Click to edit",onClick:()=>y(!0),onKeyDown:e=>{"Enter"===e.key&&y(!0)},className:"-mx-1.5 cursor-text rounded-md px-1.5 py-1 transition-colors hover:bg-[var(--ink-hover)]",children:(0,n.jsx)(ew,{value:k,onChange:()=>{},editable:!1},"view")}):(0,n.jsx)("button",{type:"button",onClick:()=>y(!0),className:"-mx-1.5 w-full rounded-md px-1.5 py-1 text-left text-xs text-muted-foreground/60 transition-colors hover:bg-[var(--ink-hover)] hover:text-muted-foreground",children:"Add a description…"})}),e.files.length>0&&(0,n.jsx)(e3.aU,{title:`Files (${e.files.length})`,children:(0,n.jsx)(e4.h,{files:e.files.map(e=>({path:e}))})}),"ARCHITECTURE"===t&&(0,n.jsx)(tm,{node:e}),(0,n.jsxs)("div",{className:"mt-4 flex items-center gap-1 border-t border-border pt-3",children:[(0,n.jsxs)(e6.$,{size:"sm",variant:"ghost",className:"h-7 gap-1.5 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>u(!0),children:[(0,n.jsx)(e5.A,{className:"size-3.5"}),"Edit"]}),(0,n.jsxs)(e6.$,{size:"sm",variant:"ghost",className:"h-7 gap-1.5 px-2 text-xs text-muted-foreground hover:text-foreground",onClick:()=>p(!0),children:[(0,n.jsx)(c.A,{className:"size-3.5"}),"Sub-node"]}),(0,n.jsxs)("div",{className:"relative ml-auto",children:[(0,n.jsx)("button",{type:"button",title:"More actions",onClick:()=>f(e=>!e),className:(0,eN.cn)("rounded-md p-1.5 text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-foreground",m&&"bg-[var(--ink-active)] text-foreground"),children:(0,n.jsx)(e2.A,{className:"size-4"})}),m&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"fixed inset-0 z-10",onClick:()=>f(!1)}),(0,n.jsxs)("div",{className:"absolute bottom-full right-0 z-20 mb-1 w-44 rounded-lg border border-border bg-popover p-1 shadow-xl",children:[(0,n.jsx)(tp,{disabled:l,onClick:()=>{f(!1),S(()=>ti(e.id))},children:"Deprioritize"}),(0,n.jsx)(tp,{disabled:l,onClick:()=>{f(!1),S(()=>td(e.id))},children:"Cancel node"}),(0,n.jsx)(tp,{destructive:!0,disabled:l,onClick:()=>{f(!1),b(!0)},children:"Delete…"})]})]})]})]}),(0,n.jsx)(e7.Lt,{open:h,onOpenChange:b,children:(0,n.jsxs)(e7.EO,{children:[(0,n.jsxs)(e7.wd,{children:[(0,n.jsxs)(e7.r7,{children:["Delete “",e.title,"”?"]}),(0,n.jsx)(e7.$v,{children:"This removes the node and all its sub-nodes. It can’t be undone."})]}),(0,n.jsxs)(e7.ck,{children:[(0,n.jsx)(e7.Zr,{children:"Cancel"}),(0,n.jsx)(e7.Rx,{onClick:()=>S(()=>to(e.id)),children:"Delete"})]})]})}),d&&(0,n.jsx)(ts,{open:!0,onOpenChange:u,mode:"edit",view:t,heading:"Edit node",nodeId:e.id,hasFrontend:w,defaults:{title:e.title,role:e.role,plain:e.plain,status:e.status,cluster:e.cluster,kind:e.kind,layer:e.layer}}),x&&(0,n.jsx)(ts,{open:!0,onOpenChange:p,mode:"create",view:t,heading:"New sub-node",parentId:e.id,position:{x:e.x,y:e.y+120},hasFrontend:w,defaults:{cluster:e.cluster,layer:e.layer}})]})}function tp({onClick:e,disabled:t,destructive:r,children:a}){return(0,n.jsx)("button",{type:"button",disabled:t,onClick:e,className:(0,eN.cn)("flex w-full items-center rounded-md px-2 py-1.5 text-left text-xs transition-colors disabled:opacity-50",r?"text-red-600 hover:bg-red-500/10 dark:text-red-300":"text-foreground hover:bg-[var(--ink-hover)]"),children:a})}function tm({node:e}){let t=(0,g.useRouter)(),[r,s]=(0,a.useState)(""),[o,l]=(0,a.useState)(!1),i=e.bugFlags.filter(e=>!e.resolved),d=e=>{l(!0),e().then(()=>t.refresh()).finally(()=>l(!1))},c=()=>{let t=r.trim();t&&d(async()=>{(await fetch("/api/bug-flags",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({nodeId:e.id,by:"user",note:t})})).ok&&s("")})};return(0,n.jsxs)(e3.aU,{title:(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(u.A,{className:"size-3.5 text-rose-600 dark:text-rose-300"}),"Bug flags",i.length>0&&` (${i.length} open)`]}),children:[e.bugFlags.length>0&&(0,n.jsx)("ul",{className:"space-y-1.5",children:e.bugFlags.map(e=>(0,n.jsxs)("li",{className:(0,eN.cn)("rounded-md px-2 py-1.5",e.resolved?"opacity-50":"bg-rose-500/[0.06]"),children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("span",{title:"agent"===e.by?"Flagged by an agent examining the code":"Flagged by you",className:(0,eN.cn)("rounded px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide","agent"===e.by?"bg-violet-500/15 text-violet-700 dark:text-violet-300":"bg-sky-500/15 text-sky-700 dark:text-sky-300"),children:"agent"===e.by?"agent":"you"}),(0,n.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,n.jsx)("button",{type:"button",disabled:o,onClick:()=>d(()=>fetch(`/api/bug-flags/${e.id}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({resolved:!e.resolved})})),className:"rounded px-1.5 py-0.5 text-[10px] text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-foreground",children:e.resolved?"Reopen":"Resolve"}),(0,n.jsx)("button",{type:"button",disabled:o,title:"Delete flag",onClick:()=>d(()=>fetch(`/api/bug-flags/${e.id}`,{method:"DELETE"})),className:"rounded p-0.5 text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-red-600 dark:hover:text-red-300",children:(0,n.jsx)(ea.A,{className:"size-3"})})]})]}),(0,n.jsx)("p",{className:(0,eN.cn)("mt-1 text-[11.5px] leading-snug",e.resolved&&"line-through"),children:e.note})]},e.id))}),(0,n.jsxs)("div",{className:"mt-1.5 flex items-start gap-1.5",children:[(0,n.jsx)("textarea",{rows:1,value:r,placeholder:"Flag a bug or something worth investigating…",onChange:e=>s(e.target.value),onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||(e.preventDefault(),c())},className:"field-sizing-content min-h-7 w-full resize-none rounded-md bg-[var(--ink-hover)] px-2 py-1 text-[11.5px] outline-none placeholder:text-muted-foreground/60 focus:bg-[var(--ink-active)]"}),(0,n.jsx)(e6.$,{size:"sm",variant:"ghost",className:"h-7 shrink-0 px-2 text-[11px] text-muted-foreground hover:text-foreground",disabled:o||!r.trim(),onClick:c,children:"Flag"})]})]})}function tf({view:e,nodes:t}){let r=t.filter(e=>0===e.priority).length;return(0,n.jsxs)("div",{children:[(0,n.jsx)("h2",{className:"text-base font-semibold",children:"ROADMAP"===e?"Roadmap":"Architecture"}),(0,n.jsx)("p",{className:"mt-1 text-xs leading-relaxed text-muted-foreground",children:"Click a node for details and actions. Drag to rearrange — positions are saved."}),(0,n.jsxs)("dl",{className:"mt-4 flex gap-8 border-t border-border pt-3",children:[(0,n.jsx)(e3.ZB,{label:"nodes",value:t.length}),(0,n.jsx)(e3.ZB,{label:"critical",value:r})]})]})}var th=r(82099);function tg({payload:e,onDismiss:t}){let[r,s]=(0,a.useState)(""),[o,l]=(0,a.useState)(null);if((e?.id??null)!==o&&(l(e?.id??null),s(e?.value??"")),(0,a.useEffect)(()=>{if(!e)return;let n=n=>{("Escape"===n.key||(n.metaKey||n.ctrlKey)&&"Enter"===n.key)&&(n.preventDefault(),e.onCommit(r),t())};return document.addEventListener("keydown",n,!0),()=>document.removeEventListener("keydown",n,!0)},[e,r,t]),!e)return null;let i=()=>{e.onCommit(r),t()};return(0,n.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":`Edit description — ${e.title}`,onMouseDown:e=>{e.target===e.currentTarget&&i()},className:"fixed inset-0 z-[70] flex items-center justify-center bg-black/55 backdrop-blur-[5px] animate-in fade-in duration-150",children:(0,n.jsxs)(th.b,{className:"flex max-h-[82vh] w-[min(720px,92vw)] flex-col rounded-2xl duration-150 animate-in fade-in zoom-in-95",onMouseDown:e=>e.stopPropagation(),children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 border-b border-border px-4 py-3",children:[(0,n.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Description"}),(0,n.jsx)("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:e.title}),(0,n.jsxs)("span",{className:"shrink-0 font-mono text-[11px] text-muted-foreground",children:[r.length," chars"]}),(0,n.jsx)("button",{type:"button",onClick:i,title:"Close (Esc)",className:"shrink-0 rounded-lg p-1 text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-foreground",children:(0,n.jsx)(ea.A,{className:"size-4"})})]}),(0,n.jsx)("div",{className:"min-h-[40vh] flex-1 overflow-y-auto px-6 py-5 text-[15px] leading-relaxed",children:(0,n.jsx)(ew,{bare:!0,autoFocus:e.editable,editable:e.editable,value:r,onChange:s})}),(0,n.jsxs)("div",{className:"flex items-center gap-3 border-t border-border px-4 py-2.5 text-[11.5px] text-muted-foreground",children:[(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("span",{className:"size-1.5 rounded-full bg-emerald-400"})," Autosaves"]}),(0,n.jsx)("span",{className:"opacity-70",children:"\xb7 Esc to close"}),e.editable&&(0,n.jsxs)("button",{type:"button",onClick:i,className:"ml-auto flex items-center gap-1.5 rounded-lg bg-[#ff7a45] px-3 py-1.5 text-xs font-semibold text-black transition hover:brightness-110",children:[(0,n.jsx)(en.A,{className:"size-3.5"}),"Save & close"]})]})]})})}var tb=r(80277),tv=r(18874),ty=r(62311),tj=r(9991),tk=r(40654),tN=r(14983),tw=r(91157),tC=r(56895),tA=r(16607),tE=r(56614),tS=r(98238),tI=r(36849),tM=r(29813),tR=r(44267);function tT(e,t){let r={x:t.x,y:t.y};for(let t=0;t<100&&e.some(e=>200>Math.abs(r.x-e.x)&&150>Math.abs(r.y-e.y));t++)r.y+=150;return r}var tz=r(70947),tD=r(2060);let tP=[{value:"cluster",label:"Theme"},{value:"status",label:"Status"},{value:"priority",label:"Priority"}],tO=new Set(["title","role","plain","cluster","layer","status","priority"]),t$={roadmapNode:eH,archNode:eH,annotation:v.Sh,lessonTable:eK},tL={deletable:eG.I,annotation:eZ.L},tY={CONTAINS:{stroke:"#7c7c8a"},DEPENDS:{stroke:"#f5b942",dash:"6 4"},RELATES:{stroke:"#8a8a95",dash:"4 4"},REPLACES:{stroke:"#ff6b9d"}};function tF({view:e,nodes:t,edges:r,workOrder:g=[],embedded:b=!1,commentsContent:y,commentsCount:j=0,controlRef:k,onAskAgent:N,onAddComment:w,annotations:C,onPinClick:A,onUpdateComment:E,onRemoveComment:S,boardAnnotations:I,initialArrangedBy:M=null,initialCollapsed:R=[],hasFrontend:T=!1,readOnly:z=!1,firstTapHighlightsOnly:D=!1,minimap:P,staticEdgeLabels:O=!1,tableNodes:$}){let L=g.join(","),Y=(0,a.useMemo)(()=>{let e=new Map;return g.forEach((t,r)=>e.set(t,r+1)),e},[L]),F=g[0]??null,U=(0,a.useMemo)(()=>t.map(e=>({id:e.id,type:"ROADMAP"===e.view?"roadmapNode":"archNode",position:{x:e.x,y:e.y},data:{title:e.title,role:e.role,plain:e.plain,status:e.status,priority:e.priority,cluster:e.cluster,layer:e.layer,view:e.view,kind:e.kind,source:e.source,sourceRef:e.sourceRef,assigneeName:e.assigneeName,assigneeAvatarUrl:e.assigneeAvatarUrl,externalMeta:e.externalMeta,isCriterion:e.isCriterion,isChild:null!=e.parentId,parentId:e.parentId,signals:e.signals,fileCount:e.files.length,importsIn:e.importsIn,importsOut:e.importsOut,openBugs:e.bugFlags.filter(e=>!e.resolved).length}})),[t]),H=(0,a.useMemo)(()=>{var e;let n;return e=new Set(($??[]).map(e=>e.id)),n=new Set([...t.map(e=>e.id),...e??[]]),[...t.filter(e=>e.parentId&&n.has(e.parentId)).map(e=>({id:`c-${e.id}`,source:e.parentId,sourceHandle:"sb",target:e.id,targetHandle:"tt",type:"smoothstep",style:{stroke:tY.CONTAINS.stroke}})),...r.filter(e=>n.has(e.fromId)&&n.has(e.toId)).map(e=>{let t=tY[e.kind]??tY.RELATES,r="DEPENDS"===e.kind?"depends on":void 0;return{id:e.id,source:e.fromId,sourceHandle:e.sourceHandle??void 0,target:e.toId,targetHandle:e.targetHandle??void 0,label:e.label??r,type:"deletable",markerEnd:{type:o.TG.ArrowClosed,color:t.stroke},style:{stroke:t.stroke,strokeDasharray:t.dash}}})]},[t,r,$]),[B,G]=(0,a.useState)(U),[_,X]=(0,a.useState)(H),[K,Z]=(0,a.useState)(null),[W,V]=(0,a.useState)(null),[q,J]=(0,a.useState)(null),[Q,ee]=(0,a.useState)(!1),[et,er]=(0,a.useState)("details"),{tool:en,setTool:ea,flowProps:es,paneClass:ei}=(0,tb.e)(),[ec,ex]=(0,a.useState)(null),[ep,em]=(0,a.useState)(null),[ef,eh]=(0,a.useState)(!1),eg=(0,tD.G)(),eb=(0,a.useRef)(!1),ev=(0,a.useRef)("details");(0,a.useEffect)(()=>{eb.current=Q},[Q]),(0,a.useEffect)(()=>{ev.current=et},[et]),(0,a.useEffect)(()=>{if(k)return k.current={open:()=>{if(eb.current){ee(!1),er("details");return}ee(!0),er("details")},close:()=>{ee(!1),er("details")},openComments:()=>{ee(!0),er("comments")}},()=>{k&&(k.current=null)}},[k]);let[ey,ej]=(0,a.useState)(new Set),[ek,ew]=(0,a.useState)(null),[eC,eA]=(0,a.useState)(!1),eE=(0,a.useRef)(null);(0,a.useEffect)(()=>G(U),[U]),(0,a.useEffect)(()=>X(H),[H]),(0,a.useEffect)(()=>{if(!z)return;let e=0,t=requestAnimationFrame(()=>{e=requestAnimationFrame(()=>eE.current?.fitView({padding:.2,duration:0,minZoom:.38,maxZoom:.9}))});return()=>{cancelAnimationFrame(t),cancelAnimationFrame(e)}},[z,U]);let eS=(0,a.useCallback)((e,t,r)=>{G(r=>r.map(r=>r.id===e?{...r,data:{...r.data,...t}}:r)),r&&fetch(`/api/nodes/${e}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(Object.fromEntries(Object.entries(t).filter(([e])=>tO.has(e))))})},[]),eI=(0,a.useMemo)(()=>JSON.stringify(Array.from(new Set(B.map(e=>e.data.cluster).filter(e=>!!e))).sort()),[B]),eM=(0,a.useMemo)(()=>JSON.parse(eI),[eI]),eR=(0,a.useCallback)(e=>ej(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r}),[]),eT=(0,a.useCallback)(e=>{Z(e),ee(!0),er("details")},[]),ez=(0,a.useCallback)(e=>{G(t=>t.filter(t=>t.id!==e)),Z(t=>t===e?null:t),fetch(`/api/nodes/${e}`,{method:"DELETE"})},[]),eD=(0,a.useCallback)(async(t,r,n="FEATURE")=>{let a=(0,s.sX)(),o="ARCHITECTURE"===e?"REBUILD":"PENDING",l="BUG"===n?"New bug":"New node";G(s=>[...s,{id:a,type:"ROADMAP"===e?"roadmapNode":"archNode",position:{x:t,y:r},data:{title:l,role:null,plain:null,status:o,priority:2,cluster:null,view:e,kind:n,source:"MANUAL",sourceRef:null,isCriterion:!1,isChild:!1,parentId:null,openBugs:0}}]),ej(e=>new Set(e).add(a)),ew(a),Z(a);try{if(!(await fetch("/api/nodes",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:a,view:e,kind:n,title:l,status:o,x:t,y:r})})).ok)throw Error("create failed")}catch{G(e=>e.filter(e=>e.id!==a)),ej(e=>{let t=new Set(e);return t.delete(a),t}),ew(e=>e===a?null:e),Z(e=>e===a?null:e)}},[e]),eP=(0,a.useCallback)((e,t)=>{if(!ec||!eE.current)return;let r=eE.current.screenToFlowPosition({x:e,y:t});eD(r.x,r.y,ec),ex(null),em(null)},[ec,eD]);(0,a.useEffect)(()=>{if(!ec&&!eC)return;let e=e=>em({x:e.clientX,y:e.clientY}),t=e=>{"Escape"===e.key&&(ex(null),eA(!1),em(null))};return window.addEventListener("mousemove",e),window.addEventListener("keydown",t),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("keydown",t)}},[ec,eC]),(0,a.useCallback)(()=>{let e=B.filter(e=>"annotation"!==e.type);return function(e,t,r={}){let n=r.colW??320,a=r.rowH??150,s=r.maxCols??4,o=r.bandGap??90;if(0===e.length){if(0===t.length)return{x:0,y:0};let e=Math.max(...t.map(e=>e.y));return tT(t,{x:0,y:e+a+o})}let l=Math.min(...e.map(e=>e.x)),i=Math.min(...e.map(e=>e.y)),d=e.map(e=>Math.max(0,Math.round((e.x-l)/n))),c=Math.min(s,Math.max(Math.max(...d)+1,Math.ceil(Math.sqrt(e.length+1)))),u=Array(c).fill(i-a);e.forEach((e,t)=>{let r=Math.min(d[t],c-1);u[r]=Math.max(u[r],e.y)});let x=0;for(let e=1;e<c;e++)u[e]<u[x]&&(x=e);return tT(t,{x:l+x*n,y:u[x]+a})}(e.filter(e=>!e.data.parentId&&!(e.data.cluster??"").trim()).map(e=>e.position),e.map(e=>e.position))},[B]);let eO=(0,a.useCallback)(()=>{eA(!1),ex("FEATURE")},[]),e$=(0,a.useCallback)(()=>{eA(!1),ex("BUG")},[]),[eL,eY]=(0,a.useState)(null),eF=(0,a.useCallback)(e=>eY(e),[]),eU=(0,a.useMemo)(()=>({view:e,readOnly:z,categories:eM,statuses:"ARCHITECTURE"===e?eo.m6:eo.yl,patch:eS,isExpanded:e=>ey.has(e),toggleExpand:eR,openDetailed:eT,openFocus:eF,removeNode:ez,editingTitleId:ek,onAskAgent:N,hasFrontend:T}),[e,z,eM,eS,ey,eR,eT,eF,ez,ek,N,T]),[eH,eG]=(0,a.useState)(M),[e_,eX]=(0,a.useState)(""),[eK,eZ]=(0,a.useState)("full"),[eW,eV]=(0,a.useState)(new Set),[eq,eJ]=(0,a.useState)(new Set),[eQ,e0]=(0,a.useState)(new Set),[e1,e5]=(0,a.useState)(new Set),[e2,e3]=(0,a.useState)(new Set),[e4,e6]=(0,a.useState)(new Set),[e7,e9]=(0,a.useState)(new Set),[e8,te]=(0,a.useState)(null),tt=(0,a.useMemo)(()=>Array.from(new Set(t.map(e=>e.status))),[t]),tr=(0,a.useMemo)(()=>Array.from(new Set(t.map(e=>e.cluster).filter(e=>!!e))).sort(),[t]),tn=(0,a.useMemo)(()=>Array.from(new Set(t.map(e=>e.priority))).sort((e,t)=>e-t),[t]),ta=(0,a.useMemo)(()=>t.some(e=>e.externalMeta),[t]),ts=(0,a.useMemo)(()=>Array.from(new Set(t.map(e=>e.externalMeta?.team.name).filter(e=>!!e))).sort(),[t]),to=(0,a.useMemo)(()=>Array.from(new Set(t.map(e=>e.externalMeta?.project?.name).filter(e=>!!e))).sort(),[t]),tl=(0,a.useMemo)(()=>Array.from(new Set(t.map(e=>e.externalMeta?.milestone?.name).filter(e=>!!e))).sort(),[t]),ti=(0,a.useMemo)(()=>Array.from(new Set(t.map(e=>e.externalMeta?.state.name).filter(e=>!!e))).sort(),[t]),td=(0,a.useMemo)(()=>({status:eW,cluster:eq,priority:eQ,team:e1,project:e2,milestone:e4,state:e7}),[eW,eq,eQ,e1,e2,e4,e7]),tu=(0,a.useCallback)(e=>(function(e,t){if(t.status.size&&!t.status.has(e.status)||t.cluster.size&&(!e.cluster||!t.cluster.has(e.cluster))||t.priority.size&&!t.priority.has(e.priority))return!1;if(!(t.team.size>0||t.project.size>0||t.milestone.size>0||t.state.size>0))return!0;let r=e.externalMeta;return!!r&&(!t.team.size||!!t.team.has(r.team.name))&&(!t.project.size||!!r.project&&!!t.project.has(r.project.name))&&(!t.milestone.size||!!r.milestone&&!!t.milestone.has(r.milestone.name))&&(!t.state.size||!!t.state.has(r.state.name))})(e,td),[td]),tx=eW.size+eq.size+eQ.size+e1.size+e2.size+e4.size+e7.size+ +!!e8,tp=(0,a.useCallback)(()=>{eV(new Set),eJ(new Set),e0(new Set),e5(new Set),e3(new Set),e6(new Set),e9(new Set),te(null)},[]),[tm,tf]=(0,a.useState)(()=>new Set(R)),th=(0,a.useCallback)(t=>{tf(r=>{let n=new Set(r);return n.has(t)?n.delete(t):n.add(t),b||fetch("/api/board-layout",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({board:"ROADMAP"===e?"roadmap":"architecture",collapsed:[...n]})}).catch(()=>{}),n})},[b,e]),tU=(0,a.useMemo)(()=>(function(e){let t=new Map;for(let r of e)r.parentId&&t.set(r.parentId,(t.get(r.parentId)??0)+1);return t})(t),[t]),tH=(0,a.useMemo)(()=>{let e=new Map;for(let r of t)r.parentId&&"DONE"===r.status&&e.set(r.parentId,(e.get(r.parentId)??0)+1);return e},[t]),tB=(0,a.useMemo)(()=>(function(e,t){let r=new Set;if(0===t.size)return r;let n=new Map;for(let t of e){if(!t.parentId)continue;let e=n.get(t.parentId);e?e.push(t.id):n.set(t.parentId,[t.id])}let a=[...t];for(;a.length;){let e=a.pop();for(let t of n.get(e)??[])r.has(t)||(r.add(t),a.push(t))}return r})(t,tm),[t,tm]),tG=(0,a.useMemo)(()=>B.map(e=>({...e,hidden:!tu(e.data)||tB.has(e.id)})),[B,tu,tB]),t_=(0,a.useMemo)(()=>new Set(tG.filter(e=>e.hidden).map(e=>e.id)),[tG]),tX=(0,a.useMemo)(()=>_.map(e=>({...e,hidden:t_.has(e.source)||t_.has(e.target)})),[_,t_]),tK=(0,a.useMemo)(()=>{if(W){let e=tX.find(e=>e.id===W);return e?new Set([e.source,e.target]):null}return K?(0,tv.F1)(K,tX.filter(e=>!e.hidden)):null},[K,W,tX]),tZ=e_.trim().length>0,tW=(0,a.useMemo)(()=>{if(!tZ)return null;let e=new Set;for(let t of B)tu(t.data)&&(0,tN.Qk)((0,tN.$$)(t.data),e_)&&e.add(t.id);return e},[B,e_,tu,tZ]),tV=(0,a.useMemo)(()=>"ARCHITECTURE"===e?(0,tw.d)(t):[],[e,t]),tq=(0,a.useCallback)(e=>{eE.current&&(e.focusIds.length?eE.current.fitView({nodes:e.focusIds.map(e=>({id:e})),duration:700,padding:.3,maxZoom:1.1}):eE.current.fitView({duration:700,padding:.2}))},[]),tJ=(0,tC.W)(tV,tq),tQ=tJ.focusIds,t0=tQ??tW??tK,t1=tW??tQ??tK,t5=(0,a.useMemo)(()=>e8?new Set(tG.filter(e=>!e.hidden&&!(0,tS.F)(e8,(0,el.jR)(e.data.layer))).map(e=>e.id)):null,[e8,tG]),t2=(0,a.useMemo)(()=>tG.map(e=>{let t=Y.get(e.id),r=tU.get(e.id)??0,n={...t?{workOrderRank:t,isNext:1===t}:{},...r>0?{childCount:r,childDone:tH.get(e.id)??0,collapsed:tm.has(e.id),onToggleCollapse:th}:{}},a=t||r>0?{...e,data:{...e.data,...n}}:e;if(ey.has(e.id)&&(a={...a,zIndex:25}),a.hidden)return a;if(!t0)return t5?.has(e.id)?{...a,style:{...a.style,opacity:.3,filter:"saturate(0.3)",transition:"opacity 120ms, filter 120ms"}}:a;let s=t0.has(e.id),o=t1?tN.Uy:.45;return{...a,zIndex:s&&t1?24:a.zIndex,style:{...a.style,opacity:s?1:o,boxShadow:s&&t1?tN.RU:a.style?.boxShadow,borderRadius:s&&t1?"var(--radius-lg)":a.style?.borderRadius,transition:"opacity 120ms, box-shadow 120ms"}}}),[tG,t0,t1,Y,ey,t5,tU,tH,tm,th]),[t3,t4]=(0,a.useState)(()=>new Map),[t6,t7]=(0,a.useState)(()=>new Map),t9=(0,a.useMemo)(()=>new Set(($??[]).map(e=>e.id)),[$]),t8=(0,a.useMemo)(()=>{if("ROADMAP"===e&&!eH||"ROADMAP"!==e&&"ARCHITECTURE"!==e)return[];let t=new Map(t2.map(e=>[e.id,e])),r=[];for(let n of t2){if(n.hidden||"annotation"===n.type)continue;let a=(n.data.parentId?t.get(n.data.parentId):void 0)??n,s="ROADMAP"===e&&eH?function(e,t){if("status"===e){let e=(0,tI.Gg)({status:t.status,stateName:t.externalMeta?.state?.name});return eo.nR[e]?.label??e}return"priority"===e?`P${t.priority}`:t.cluster?.trim()||"—"}(eH,a.data):a.data.cluster?.trim()||"—";r.push({id:n.id,group:s,x:n.position.x,y:n.position.y,w:n.measured?.width??(n.data.isChild?224:256),h:n.measured?.height??96})}for(let e of $??[]){let t=t6.get(e.id)??e;r.push({id:e.id,group:e.group?.trim()||"—",x:t.x,y:t.y,w:t3.get(e.id)?.width??270,h:t3.get(e.id)?.height??200})}return(0,tR.S)(r)},[t2,eH,e,$,t3,t6]),re="ARCHITECTURE"===e||"cluster"===eH?"category":"neutral",rt=(0,a.useMemo)(()=>{if(tQ)return tX.map(e=>e.hidden?e:tQ.has(e.source)&&tQ.has(e.target)?{...e,style:{...e.style,opacity:1}}:{...e,label:void 0,style:{...e.style,opacity:.06}});if(tW)return tX.map(e=>e.hidden?e:tW.has(e.source)&&tW.has(e.target)?{...e,style:{...e.style,opacity:1}}:{...e,label:void 0,style:{...e.style,opacity:.06}});let e=K??q;return W||e?tX.map(t=>t.hidden?t:(W?t.id===W:t.source===e||t.target===e)?{...t,zIndex:20,style:{...t.style,opacity:1,strokeWidth:2.5}}:{...t,selectable:!1,label:void 0,markerEnd:void 0,style:{...t.style,opacity:.06}}):tX.map(e=>{if(e.hidden)return e;let t=t5&&(t5.has(e.source)||t5.has(e.target));return O?{...e,style:{...e.style,opacity:t?.25:1}}:{...e,label:void 0,style:{...e.style,opacity:t?.06:.18}}})},[tX,K,W,q,tW,t5,tQ,O]),rr=void 0!==I,[rn,ra]=(0,a.useState)(I??[]);(0,a.useEffect)(()=>{I&&ra(I)},[I]);let rs=(0,a.useMemo)(()=>{if(rr){let e=new Set(t.map(e=>e.id));return rn.filter(t=>"feature"===t.targetKind&&e.has(t.targetId)).map((e,t)=>({id:e.id,n:t+1,targetId:e.targetId,text:e.body,x:e.x,y:e.y}))}let e=new Map((C??[]).map(e=>[e.id,e.comment]));return(0,eB.m)(C??[],{tables:[],features:t.map(e=>({id:e.id,title:e.title}))}).map(t=>({id:t.annotationId,n:t.n,targetId:t.targetId,text:e.get(t.annotationId)??"",x:null,y:null}))},[rr,rn,C,t]),ro=(0,a.useMemo)(()=>{let e=new Map;for(let t of rs){let r=e.get(t.targetId)??[];r.push({id:t.id,n:t.n,column:null}),e.set(t.targetId,r)}return e},[rs]),rl=(0,a.useCallback)(async e=>{let r=(0,eB.m)([{id:"_",excerpt:e}],{tables:[],features:t.map(e=>({id:e.id,title:e.title}))})[0];if(!r)return;let n=await fetch("/api/board-annotations",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({targetKind:"feature",targetId:r.targetId})});if(n.ok){let e=await n.json();ra(t=>[...t,e])}},[t]),ri=(0,a.useCallback)((e,t)=>{ra(r=>r.map(r=>r.id===e?{...r,...t}:r)),fetch(`/api/board-annotations/${e}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify(t)})},[]),rd=(0,a.useCallback)(e=>{ra(t=>t.filter(t=>t.id!==e)),fetch(`/api/board-annotations/${e}`,{method:"DELETE"})},[]),rc=rr?rl:w,[ru,rx]=(0,a.useState)(()=>new Map),rp=(0,a.useMemo)(()=>{let e=new Map(t2.map(e=>[e.id,e])),t=new Map,r=rs.flatMap(r=>{let n=e.get(r.targetId);if(!n||n.hidden)return[];let a=t.get(r.targetId)??0;t.set(r.targetId,a+1);let s=n.measured?.height??96;return[{id:`anno-${r.id}`,type:"annotation",position:{x:r.x??n.position.x+26,y:r.y??n.position.y+s+56+112*a},measured:ru.get(`anno-${r.id}`),draggable:rr,data:{n:r.n,text:r.text,annotationId:r.id,onClick:rr||E?void 0:A,editable:rr||!!E,onChangeText:rr?(e,t)=>ri(e,{body:t}):E,onDelete:rr?rd:S}}]});return[...t2.map(e=>{let t=ro.get(e.id);return t||rc?{...e,data:{...e.data,pins:t,onPinClick:rr?void 0:A,onComment:rc}}:e}),...r,...($??[]).map(e=>({id:e.id,type:"lessonTable",position:t6.get(e.id)??{x:e.x,y:e.y},measured:t3.get(e.id),draggable:!0,data:e.data}))]},[t2,rs,ro,rr,A,E,S,rc,ri,rd,ru,$,t3,t6]),rm=(0,a.useMemo)(()=>rs.map(e=>({id:`annoe-${e.id}`,source:e.targetId,sourceHandle:`pin-${e.id}`,target:`anno-${e.id}`,targetHandle:"in",type:"annotation",selectable:!1,zIndex:30,style:{stroke:v.V5,strokeWidth:1.5,opacity:.9}})),[rs]),rf=(0,a.useCallback)(e=>{let t=[];for(let r of e)if("position"===r.type&&r.id.startsWith("anno-")&&r.position){let e=r.id.slice(5),{x:t,y:n}=r.position;ra(r=>r.map(r=>r.id===e?{...r,x:t,y:n}:r))}else if("dimensions"===r.type&&r.id.startsWith("anno-")){let e=r.dimensions;e&&rx(t=>{let n=t.get(r.id);if(n&&n.width===e.width&&n.height===e.height)return t;let a=new Map(t);return a.set(r.id,e),a})}else if("dimensions"===r.type&&t9.has(r.id)){let e=r.dimensions;e&&t4(t=>{let n=t.get(r.id);if(n&&n.width===e.width&&n.height===e.height)return t;let a=new Map(t);return a.set(r.id,e),a})}else if("position"===r.type&&t9.has(r.id)&&r.position){let{x:e,y:t}=r.position;t7(n=>new Map(n).set(r.id,{x:e,y:t}))}else t.push(r);t.length&&G(e=>(0,l._0)(t,e))},[t9]),rh=(0,a.useCallback)(e=>X(t=>(0,l.zW)(e,t)),[]),rg=(0,a.useCallback)(async e=>{if(!e.source||!e.target||e.source===e.target)return;let t=await fetch("/api/edges",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({fromId:e.source,toId:e.target,kind:"DEPENDS",sourceHandle:e.sourceHandle??null,targetHandle:e.targetHandle??null})});if(!t.ok)return;let r=await t.json(),n=tY.DEPENDS;X(t=>t.some(e=>e.id===r.id)?t:[...t,{id:r.id,source:r.fromId,sourceHandle:e.sourceHandle??void 0,target:r.toId,targetHandle:e.targetHandle??void 0,label:"depends on",type:"deletable",markerEnd:{type:o.TG.ArrowClosed,color:n.stroke},style:{stroke:n.stroke,strokeDasharray:n.dash}}])},[]),rb=(0,a.useCallback)(async(t,r,n)=>{let a=await fetch("/api/nodes",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({view:e,title:"New node",parentId:t.id,cluster:t.data.cluster??null,status:"ARCHITECTURE"===e?"REBUILD":"PENDING",x:r,y:n})});if(!a.ok)return;let s=await a.json();G(a=>[...a,{id:s.id,type:"ROADMAP"===e?"roadmapNode":"archNode",position:{x:r,y:n},data:{title:s.title,role:s.role,plain:s.plain,status:s.status,priority:s.priority,cluster:s.cluster,view:s.view,source:s.source,sourceRef:s.sourceRef,kind:s.kind,isCriterion:!1,isChild:!0,parentId:t.id,openBugs:0}}]),X(e=>[...e,{id:`c-${s.id}`,source:t.id,sourceHandle:"sb",target:s.id,targetHandle:"tt",type:"smoothstep",style:{stroke:tY.CONTAINS.stroke}}]),ej(e=>new Set(e).add(s.id)),ew(s.id),Z(s.id)},[e]),rv=(0,a.useCallback)(async(e,t)=>{if(t.isValid||!t.fromNode||!eE.current)return;let r=e.changedTouches,n=r?.[0]?.clientX??e.clientX,a=r?.[0]?.clientY??e.clientY,{x:s,y:o}=eE.current.screenToFlowPosition({x:n,y:a});await rb(t.fromNode,s,o)},[rb]);(0,a.useEffect)(()=>{if(!eC)return;let e=e=>{"Escape"===e.key&&eA(!1)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[eC]);let ry=(0,a.useMemo)(()=>t.find(e=>e.id===K)??null,[t,K]),rj=(0,a.useCallback)((e,t,r)=>{fetch(`/api/nodes/${e}/position`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({x:t,y:r})})},[]),rk=(0,a.useCallback)(e=>{Z(e),V(null);let t=eE.current?.getNode(e);if(!t||!eE.current)return;let r=t.measured?.width??128,n=t.measured?.height??48;eE.current.setCenter(t.position.x+r/2,t.position.y+n/2,{zoom:1.2,duration:600})},[]),rN=(0,a.useCallback)(e=>{let t=(0,tI.VI)(B.map(e=>({id:e.id,parentId:e.data.parentId??null,cluster:e.data.cluster,status:e.data.status,priority:e.data.priority,stateName:e.data.externalMeta?.state?.name??null,stateType:e.data.externalMeta?.state?.type??null,title:e.data.title,role:e.data.role})),e,{viewportAspect:window.innerWidth/window.innerHeight});G(e=>e.map(e=>{let r=t.get(e.id);return r?{...e,position:r}:e}));let r=Array.from(t,([e,t])=>({id:e,x:t.x,y:t.y}));r.length&&fetch("/api/nodes/positions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({batch:r})}),eG(e),fetch("/api/board-layout",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({board:"roadmap",arrangedBy:e})}),requestAnimationFrame(()=>eE.current?.fitView({duration:600,padding:.2}))},[B]),rw=(0,a.useMemo)(()=>{let t=new Map;if("ROADMAP"!==e||!eH)return t;let r=e=>"status"===eH?e.status:"priority"===eH?`P${e.priority}`:e.cluster??"—";for(let e of B)"annotation"!==e.type&&t.set(e.id,r(e.data));return t},[B,eH,e]),rC=(0,a.useRef)(null);(0,a.useEffect)(()=>{let t=rC.current;if(rC.current=rw,!t||"ROADMAP"!==e||!eH)return;let r=!1;for(let[e,n]of rw)if(t.has(e)&&t.get(e)!==n){r=!0;break}r&&rN(eH)},[rw,eH,e,rN]);let rA=(0,a.useCallback)(()=>{let e=B.filter(e=>"annotation"!==e.type),t=(0,tM.to)(e.map(e=>({id:e.id,group:(e.data.cluster??"").trim()||"—"})),r.filter(e=>"DEPENDS"===e.kind).map(e=>({fromId:e.fromId,toId:e.toId})),{viewportAspect:window.innerWidth/window.innerHeight});G(e=>e.map(e=>{let r=t.get(e.id);return r?{...e,position:r}:e}));let n=Array.from(t,([e,t])=>({id:e,x:t.x,y:t.y}));n.length&&fetch("/api/nodes/positions",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({batch:n})}),requestAnimationFrame(()=>eE.current?.fitView({duration:600,padding:.2}))},[B,r]),rE=(0,a.useMemo)(()=>tZ?(0,tN.r2)(B.filter(e=>tu(e.data)),e_,e=>(0,tN.$$)(e.data),e=>({id:e.id,label:e.data.title,sublabel:e.data.cluster??e.data.status,kind:"feature"})):[],[B,e_,tu,tZ]);function rS(e,t){t(t=>{let r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})}return(0,n.jsx)(ed.Provider,{value:eU,children:(0,n.jsxs)("div",{className:(0,eN.cn)("canvas-dots relative w-full",b?"h-full":"h-screen",ef&&"rf-panning"),onDragOver:e=>{e.dataTransfer.types.includes("application/beacon-node")&&(e.preventDefault(),e.dataTransfer.dropEffect="copy")},onDrop:e=>{if(!e.dataTransfer.getData("application/beacon-node")||!eE.current)return;e.preventDefault();let{x:t,y:r}=eE.current.screenToFlowPosition({x:e.clientX,y:e.clientY});eD(t,r,"BUG"===e.dataTransfer.getData("application/beacon-node-kind")?"BUG":"FEATURE")},children:[(0,n.jsxs)(l.Gc,{...es,className:(0,eN.cn)(ei,(ec||eC)&&"rf-placing"),nodes:rp,edges:"far"===eK?[...rt,...rm].map(e=>({...e,hidden:!0})):[...rt,...rm],nodeTypes:t$,edgeTypes:tL,nodesConnectable:!z,connectionMode:o.WZ.Loose,connectionLineStyle:{stroke:"var(--accent-2,#ff7a45)",strokeWidth:1.5,strokeDasharray:"4 4"},onInit:e=>{eE.current=e},onNodesChange:rf,onEdgesChange:rh,onMoveStart:()=>eh(!0),onMoveEnd:()=>eh(!1),onConnect:rg,onConnectEnd:rv,onNodeMouseEnter:(e,t)=>J(t.id),onNodeMouseLeave:()=>J(null),onEdgesDelete:e=>{for(let t of e)t.id.startsWith("c-")||fetch(`/api/edges/${t.id}`,{method:"DELETE"})},onNodesDelete:e=>{for(let t of e)t.id.startsWith("anno-")||(fetch(`/api/nodes/${t.id}`,{method:"DELETE"}),Z(e=>e===t.id?null:e))},onNodeClick:(e,t)=>{if(ec)return void eP(e.clientX,e.clientY);if("lessonTable"===t.type)return;if("annotation"===t.type){let e=t.data;e.editable||A?.(e.annotationId);return}if(eC){if(eA(!1),t.data.isChild)return;rb(t,t.position.x+300,t.position.y+60);return}let r=K===t.id;if(Z(t.id),V(null),er("details"),b){let t=e.target,n=t?.closest("input, textarea, select, button, [role='combobox']"),a=D&&!r&&!eb.current;n||a||ee(!0)}},onEdgeClick:(e,t)=>{V(t.id),Z(null),er("details")},onPaneClick:e=>{ec?eP(e.clientX,e.clientY):eC?eA(!1):(ee(!1),Z(null),V(null))},onNodeDragStop:(e,t)=>{if(t.id.startsWith("anno-")){rr&&ri(t.id.slice(5),{x:t.position.x,y:t.position.y});return}z||rj(t.id,t.position.x,t.position.y)},deleteKeyCode:z?null:["Backspace","Delete"],colorMode:eg,fitView:!0,fitViewOptions:{padding:.15,minZoom:.38,maxZoom:.9},minZoom:.2,panOnScroll:!0,zoomActivationKeyCode:["Meta","Control"],proOptions:{hideAttribution:!0},children:[(0,n.jsx)(tz.Z,{regions:t8,tone:re,lod:eK}),(0,n.jsx)(eu.J,{onLod:eZ}),(0,n.jsx)(l.H2,{position:"bottom-right",className:"!overflow-hidden !rounded-xl !border !border-border [&_button]:!border-border [&_button]:!bg-card/70 [&_button]:!text-foreground [&_button]:!backdrop-blur"}),(0,n.jsx)(l.Zk,{position:"bottom-left",style:{marginBottom:118},children:(0,n.jsx)(tb.H,{tool:en,onChange:ea})}),(0,n.jsx)(l.Zk,{position:"bottom-right",style:{marginBottom:152},children:(0,n.jsx)(tE.er,{title:"Legend",trigger:(e,t)=>(0,n.jsx)("button",{type:"button",onClick:t,title:"Legend",className:(0,eN.cn)("glass flex size-8 items-center justify-center rounded-lg transition-colors",e?"text-foreground":"text-muted-foreground hover:text-foreground"),children:(0,n.jsx)(i.A,{className:"size-4"})}),children:(0,n.jsxs)("ul",{className:"space-y-1.5 text-[10.5px] text-muted-foreground",children:["ROADMAP"===e?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"inline-block rounded bg-sky-500/15 px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-sky-300",children:"feature"}),(0,n.jsx)("span",{children:"top-level card \xb7 can have sub-tasks"})]}),(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"inline-block rounded bg-zinc-500/15 px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-zinc-300",children:"sub-task"}),(0,n.jsx)("span",{children:"child of a feature"})]}),(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"inline-block rounded bg-rose-500/15 px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-rose-300",children:"bug"}),(0,n.jsx)("span",{children:"a bug to fix \xb7 not a feature"})]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"inline-block rounded bg-sky-500/15 px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-sky-300",children:"component"}),(0,n.jsx)("span",{children:"a subsystem \xb7 can have sub-components"})]}),(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"inline-block rounded bg-zinc-500/15 px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-zinc-300",children:"sub-component"}),(0,n.jsx)("span",{children:"part of a component"})]}),(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"inline-block rounded bg-rose-500/15 px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-rose-300",children:"bug"}),(0,n.jsx)("span",{children:"a flagged issue on a component"})]})]}),T&&(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"inline-block h-3 w-1 shrink-0 rounded-sm",style:{background:(0,el.A6)("fullstack")}}),(0,n.jsx)("span",{children:"left stripe \xb7 frontend / backend layer"})]}),(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"inline-block h-px w-6 bg-[#33333a]"}),(0,n.jsx)("span",{children:"contains \xb7 drag the bottom handle to empty canvas"})]}),(0,n.jsxs)("li",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"inline-block h-0 w-6 border-t border-dashed",style:{borderColor:"#f5b942"}}),(0,n.jsxs)("span",{children:["depends on \xb7 drag between two ","ROADMAP"===e?"cards":"components"]})]})]})})}),(P??!b)&&(0,n.jsx)(l.of,{pannable:!0,zoomable:!0,position:"bottom-left",style:{width:140,height:90},className:"!overflow-hidden !rounded-xl !border !border-border !bg-card/50 !backdrop-blur",nodeColor:e=>e.data?.priority===0?"#ff3860":"#555"}),!b&&(0,n.jsxs)(l.Zk,{position:"bottom-center",className:"!mb-4 flex flex-col items-center gap-2",children:[eC&&(0,n.jsxs)("div",{className:"glass rounded-full px-3 py-1 text-[11px] text-muted-foreground",children:["Click a ","ARCHITECTURE"===e?"component":"feature"," to attach the"," ","ARCHITECTURE"===e?"sub-component":"sub-task"," \xb7 Esc to cancel"]}),"ARCHITECTURE"===e&&(0,n.jsx)("div",{className:"glass flex items-center rounded-full p-0.5",children:(0,n.jsxs)("button",{onClick:rA,title:"Arrange components into a left→right dependency flow, grouped by domain",className:"flex h-6 items-center gap-1.5 rounded-full px-3 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-foreground",children:[(0,n.jsx)(d.A,{className:"size-3"}),"Arrange"]})}),"ROADMAP"===e&&(0,n.jsxs)("div",{className:"glass flex items-center gap-1 rounded-full p-1",children:[(0,n.jsx)("span",{className:"pl-2 pr-0.5 text-[11px] text-muted-foreground",children:"Group by"}),tP.map(e=>(0,n.jsx)("button",{onClick:()=>rN(e.value),title:`Arrange features into lanes by ${e.label.toLowerCase()}`,className:(0,eN.cn)("h-7 rounded-full px-2.5 text-[11px] font-medium transition-colors",eH===e.value?"bg-[var(--ink-active)] text-foreground":"text-muted-foreground hover:bg-[var(--ink-hover)] hover:text-foreground"),children:e.label},e.value))]}),(0,n.jsxs)("div",{className:"glass flex items-center gap-1 rounded-full p-1",children:[(0,n.jsxs)("button",{onClick:eO,draggable:!0,onDragStart:t=>{t.dataTransfer.setData("application/beacon-node",e),t.dataTransfer.effectAllowed="copy"},title:"ARCHITECTURE"===e?"Add component (click, or drag onto the board to place it)":"Add feature (click, or drag onto the board to place it)",className:"flex h-8 cursor-grab items-center gap-1.5 rounded-full px-3 text-[12px] font-medium text-foreground transition-colors hover:bg-[var(--ink-hover)] active:cursor-grabbing",children:[(0,n.jsx)(c.A,{className:"size-3.5 text-[var(--accent-2,#ff7a45)]"}),"ARCHITECTURE"===e?"Component":"Feature"]}),"ROADMAP"===e&&(0,n.jsxs)("button",{onClick:e$,draggable:!0,onDragStart:t=>{t.dataTransfer.setData("application/beacon-node",e),t.dataTransfer.setData("application/beacon-node-kind","BUG"),t.dataTransfer.effectAllowed="copy"},title:"Add bug (click, or drag onto the board to place it)",className:"flex h-8 cursor-grab items-center gap-1.5 rounded-full px-3 text-[12px] font-medium text-foreground transition-colors hover:bg-[var(--ink-hover)] active:cursor-grabbing",children:[(0,n.jsx)(u.A,{className:"size-3.5 text-rose-400"}),"Bug"]}),(0,n.jsx)("span",{"aria-hidden":!0,className:"mx-0.5 h-5 w-px bg-border"}),(0,n.jsxs)("button",{onClick:()=>{ex(null),eA(e=>!e)},title:"ARCHITECTURE"===e?"Add sub-component (click a component next)":"Add sub-task (click a feature next)",className:(0,eN.cn)("flex h-8 items-center gap-1.5 rounded-full px-3 text-[12px] font-medium transition-colors",eC?"bg-[var(--ink-active)] text-foreground":"text-muted-foreground hover:bg-[var(--ink-hover)] hover:text-foreground"),children:[(0,n.jsx)(x.A,{className:"size-3.5"}),"ARCHITECTURE"===e?"Sub-component":"Sub-task"]})]})]}),!b&&tV.length>0&&!tJ.active&&(0,n.jsx)(l.Zk,{position:"top-left",className:"!mt-14",children:(0,n.jsxs)("button",{type:"button",onClick:tJ.start,title:"Guided, domain-by-domain walkthrough of the architecture",className:"glass flex items-center gap-1.5 rounded-xl px-3 py-1.5 text-[11px] text-muted-foreground transition-colors hover:text-foreground",children:[(0,n.jsx)(p.A,{className:"size-3.5"}),"Start tour"]})}),!b&&(0,n.jsx)(l.Zk,{position:"top-right",className:(0,eN.cn)("glass rounded-full px-1 py-0.5 transition-[margin] duration-200",Q&&"!mr-[352px]"),children:(0,n.jsx)(ty.Z,{active:e,tabs:[{value:"ROADMAP",label:"Roadmap",href:"/map?view=ROADMAP"},{value:"ARCHITECTURE",label:"Architecture",href:"/map?view=ARCHITECTURE"},{value:"DATABASE",label:"Database",href:"/map?view=DATABASE"},{value:"FILES",label:"Files",href:"/map?view=FILES"}]})}),(0,n.jsxs)(l.Zk,{position:"top-right",className:(0,eN.cn)("!mt-14 flex items-center gap-1 transition-[margin] duration-200",Q&&"!mr-[352px]",b&&"hidden"),children:[(0,n.jsx)(tj.X,{query:e_,onQuery:eX,hits:rE,placeholder:"Find a feature…",onPick:e=>{eX(""),rk(e)},onZoomToMatches:()=>{tW?.size&&eE.current?.fitView({nodes:[...tW].map(e=>({id:e})),duration:600,padding:.2})}}),"ROADMAP"===e&&F&&(0,n.jsx)("button",{type:"button",onClick:()=>rk(F),title:"Jump to the next feature to work on",className:"glass flex size-8 items-center justify-center rounded-lg text-emerald-300 transition-colors hover:text-emerald-200",children:(0,n.jsx)(m.A,{className:"size-4"})}),(0,n.jsx)(tk.e,{defaultSelection:e}),(0,n.jsxs)(tE.er,{title:"Filters",trigger:(e,t)=>(0,n.jsxs)("button",{type:"button",onClick:t,title:"Filters",className:(0,eN.cn)("glass relative flex size-8 items-center justify-center rounded-lg transition-colors",e||tx>0?"text-foreground":"text-muted-foreground hover:text-foreground"),children:[(0,n.jsx)(f.A,{className:"size-4"}),tx>0&&(0,n.jsx)("span",{className:"absolute -right-1 -top-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-[var(--accent-2,#ff7a45)] px-1 text-[9px] font-semibold text-white",children:tx})]}),children:[T&&(0,n.jsx)(tE.r1,{title:"Layer",children:(0,n.jsx)(tS.o,{bare:!0,value:e8,onChange:te})}),tt.length>0&&(0,n.jsx)(tE.r1,{title:"Status",children:tt.map(e=>(0,n.jsx)(tE.vu,{on:eW.has(e),onClick:()=>rS(e,eV),children:eo.nR[e]?.label??e},e))}),tr.length>0&&(0,n.jsx)(tE.r1,{title:"Cluster",children:tr.map(e=>(0,n.jsx)(tE.vu,{on:eq.has(e),onClick:()=>rS(e,eJ),children:e},e))}),tn.length>0&&(0,n.jsx)(tE.r1,{title:"Priority",children:tn.map(e=>(0,n.jsxs)(tE.vu,{on:eQ.has(e),onClick:()=>rS(e,e0),children:["P",e]},e))}),ta&&ts.length>0&&(0,n.jsx)(tE.r1,{title:"Team",children:ts.map(e=>(0,n.jsx)(tE.vu,{on:e1.has(e),onClick:()=>rS(e,e5),children:e},e))}),ta&&to.length>0&&(0,n.jsx)(tE.r1,{title:"Project",children:to.map(e=>(0,n.jsx)(tE.vu,{on:e2.has(e),onClick:()=>rS(e,e3),children:e},e))}),ta&&tl.length>0&&(0,n.jsx)(tE.r1,{title:"Milestone",children:tl.map(e=>(0,n.jsx)(tE.vu,{on:e4.has(e),onClick:()=>rS(e,e6),children:e},e))}),ta&&ti.length>0&&(0,n.jsx)(tE.r1,{title:"State",children:ti.map(e=>(0,n.jsx)(tE.vu,{on:e7.has(e),onClick:()=>rS(e,e9),children:e},e))}),tx>0&&(0,n.jsx)("button",{type:"button",onClick:tp,className:"mt-1 w-full rounded-md border border-border px-2 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-[var(--ink-hover)] hover:text-foreground",children:"clear filters"})]}),!Q&&(0,n.jsx)("button",{onClick:()=>{ee(!0),er("details")},title:"Show panel",className:"glass flex size-8 items-center justify-center rounded-lg text-muted-foreground transition-colors hover:text-foreground",children:(0,n.jsx)(h.A,{className:"size-4"})})]})]}),Q&&(0,n.jsx)(tc,{view:e,selected:ry,allNodes:t,onClose:()=>{ee(!1),er("details")},commentsContent:y,commentsCount:j,activeTab:et,onTabChange:er,onAddComment:rc,topOffset:b?64:void 0}),(0,n.jsx)(tg,{payload:eL,onDismiss:()=>eY(null)}),(ec||eC)&&ep&&(0,n.jsxs)("div",{className:"pointer-events-none fixed z-50 flex translate-x-3 translate-y-3 items-center gap-1.5 rounded-lg border border-border bg-card/95 px-2.5 py-1.5 text-xs shadow-xl backdrop-blur dark:border-white/15",style:{left:ep.x,top:ep.y},children:[(0,n.jsx)("span",{className:(0,eN.cn)("rounded px-1 py-0.5 text-[9px] font-semibold uppercase tracking-wide","BUG"===ec?"bg-rose-500/15 text-rose-300":"FEATURE"===ec?"bg-sky-500/15 text-sky-300":"bg-zinc-500/15 text-zinc-300"),children:"BUG"===ec?"Bug":"FEATURE"===ec?"ARCHITECTURE"===e?"Component":"Feature":"Sub-task"}),(0,n.jsx)("span",{className:"text-muted-foreground",children:ec?"click to place \xb7 Esc":"click a feature to attach \xb7 Esc"})]}),tJ.active&&tJ.step&&(0,n.jsx)(tA.d,{steps:tV,index:tJ.index,onPrev:tJ.prev,onNext:tJ.next,onExit:tJ.stop,onGoto:tJ.goto})]})})}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6609],{},_=>{_.O(0,[8500,4888,2149,1569,6818,569,8441,3794,7358],()=>_(_.s=70569)),_N_E=_.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9040],{39593:(e,s,a)=>{"use strict";a.d(s,{EO:()=>o,kw:()=>n});var t=a(41463);let n="https://registry.npmjs.org/trybeacon/latest",r=(t.env.NEXT_PUBLIC_BEACON_SITE_URL??"https://www.trybeacon.sh").replace(/\/$/,""),o=`curl -fsSL ${r}/install.sh | sh`},52965:(e,s,a)=>{"use strict";a.d(s,{_:()=>n});var t=a(95155);function n({size:e=18,className:s}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"20 22 56 56",fill:"none",className:s,"aria-hidden":"true",children:[(0,t.jsx)("path",{d:"M48 33 L72.5 73 L23.5 73 Z",fill:"none",stroke:"var(--accent-2, #ff7a45)",strokeWidth:7,strokeLinejoin:"round",strokeLinecap:"round"}),(0,t.jsx)("circle",{cx:"48",cy:"29.5",r:"7",fill:"var(--accent-2, #ff7a45)"})]})}},73954:(e,s,a)=>{"use strict";a.d(s,{Docs:()=>f});var t=a(95155),n=a(12115),r=a(98500),o=a.n(r),i=a(52965),l=a(39593);a(93340);let d=[{id:"overview",title:"What is Beacon"},{id:"install",title:"Install"},{id:"quickstart",title:"Quickstart"},{id:"loop",title:"The planning loop"},{id:"canvases",title:"The canvases"},{id:"cli",title:"CLI reference"},{id:"integration",title:"Agent integration"},{id:"config",title:"Configuration"},{id:"telemetry",title:"Telemetry"},{id:"troubleshooting",title:"Troubleshooting"}],c=[{cmd:"beacon",what:"Register the current repo, ensure the shared server is running, and open the panel on this repo. The everyday command."},{cmd:"beacon doctor",what:"Audit what's wired — global agent hooks + skills, this repo's .mcp.json, and the running daemon."},{cmd:"beacon stop",what:"Stop the shared background server. It restarts the next time you run beacon."},{cmd:"beacon setup",what:"(Re)install Beacon's per-repo helpers — the skills and .mcp.json — in the current repo without opening the panel."},{cmd:"beacon uninstall",what:"Reverse every Beacon artifact: global agent wiring and per-repo files."},{cmd:"beacon mcp",what:"The stdio MCP server an agent session starts automatically. You never run this by hand."}],h=[{name:"/beacon-init",when:"First time you point Beacon at a repo.",what:"The agent reads the codebase and fills Beacon's map — the main components, the rough roadmap themes, the database schema, and the endpoints. Run it once per repo to bootstrap the picture."},{name:"/beacon-refresh",when:"Every few weeks, or after a big set of changes.",what:"The agent re-surveys the repo and updates what /beacon-init produced — adds new components, drops removed ones, picks up new tables and routes. Anything you added by hand on the canvas survives."},{name:"/beacon-plan",when:"Whenever you want to review an approach on the canvas.",what:"Present the current plan or approach on Beacon's /plan page for annotation instead of asking for approval as a wall of text."}],m=[{name:"beacon_context_for_feature",what:"Before touching code, the agent pulls the files attached to a feature plus their imports, the endpoints in that domain, the tables those endpoints touch, and the surrounding components — one round-trip instead of a blind Glob/Grep scan."},{name:"beacon_blast_radius",what:"Mid-feature, the agent runs this on a file it's about to edit to see what imports it and what it imports — so it can judge whether a change is safe."},{name:"beacon_propose_plan",what:"When the agent has a feature plan (tables + relations + endpoints), this opens it on /plan and BLOCKS the session until you Approve, Discard, or Submit feedback."},{name:"beacon_feature",what:"One tool for a feature's whole lifecycle: add a card (defaults to backlog), start one, break it into sub-tasks, or mark it done with a markdown summary + the files it touched — keeping the next session's context accurate."},{name:"beacon_map",what:"A quick list of features already on the roadmap, with each card's category/priority/layer/status. The agent calls it near the start of work to reuse a category and avoid duplicating what's planned."},{name:"beacon_entities",what:"A raw readout of everything mapped — features, architecture, tables, endpoints — when the agent just needs the planning data."}],p=[{trigger:"Plan review",what:"The agent sends plans to Beacon's /plan canvas for annotation and review. Codex uses beacon_present_plan or beacon_propose_plan; the result returns after you Approve, Discard, or Submit feedback."},{trigger:"File edits (PostToolUse)",what:"Every Edit/Write the agent runs is reported to Beacon and the file is attached to whichever feature the session is working on. The /map view fills in with the real files behind each feature, without you tagging anything."},{trigger:"Code-graph watcher",what:"While the panel is open, a background watcher rebuilds the Files view as you save code — the maps stay current with the repo on their own."}],x=[{key:"BEACON_HOME",what:"Where per-workspace data lives — the SQLite databases and the server record. Defaults to ~/.beacon."},{key:"PORT",what:"Port for the shared local server. Defaults to 4319."},{key:"Settings → intel",what:"In the panel, the Settings page drives the code-intelligence model/provider and your editor, and triggers a code-map sync."}];function u({text:e,label:s="Copy"}){let[a,r]=(0,n.useState)(!1);return(0,t.jsx)("button",{onClick:()=>{navigator.clipboard?.writeText(e),r(!0),setTimeout(()=>r(!1),1500)},className:"glass-soft w-hover grid h-8 w-8 shrink-0 place-items-center rounded-md","aria-label":s,children:a?(0,t.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"#ff7a45",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,t.jsx)("path",{d:"M20 6 9 17l-5-5"})}):(0,t.jsxs)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,t.jsx)("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),(0,t.jsx)("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})})}function g({children:e,copy:s}){return(0,t.jsxs)("div",{className:"glass-soft flex items-center gap-3 rounded-lg px-4 py-2.5",children:[(0,t.jsx)("span",{className:"w-signal select-none",children:"$"}),(0,t.jsx)("code",{className:"w-mono w-scrollbar-none flex-1 overflow-x-auto whitespace-nowrap text-[0.85rem] text-foreground",children:e}),s&&(0,t.jsx)(u,{text:e})]})}function w({id:e,eyebrow:s,children:a}){return(0,t.jsxs)("div",{className:"mb-5 scroll-mt-28",id:e,children:[(0,t.jsx)("p",{className:"w-mono w-eyebrow w-signal mb-2",children:s}),(0,t.jsx)("h2",{className:"text-[1.6rem] font-semibold tracking-tight",children:a})]})}function f(){let[e,s]=(0,n.useState)(d[0].id),a=(0,n.useRef)(null);return(0,n.useEffect)(()=>{let e=new IntersectionObserver(e=>{let a=e.filter(e=>e.isIntersecting).sort((e,s)=>e.boundingClientRect.top-s.boundingClientRect.top);a[0]&&s(a[0].target.id)},{rootMargin:"-20% 0px -70% 0px",threshold:0});return d.forEach(s=>{let a=document.getElementById(s.id);a&&e.observe(a)}),()=>e.disconnect()},[]),(0,t.jsxs)("div",{className:"welcome",ref:a,children:[(0,t.jsx)("div",{className:"welcome-bg","aria-hidden":!0}),(0,t.jsx)("header",{className:"fixed inset-x-0 top-0 z-50",children:(0,t.jsx)("div",{className:"mx-auto max-w-6xl px-6",children:(0,t.jsxs)("div",{className:"w-load mt-4 glass flex items-center justify-between rounded-full py-2.5 pl-5 pr-3",style:{animationDelay:".05s"},children:[(0,t.jsxs)(o(),{href:"/",className:"flex items-center gap-2.5",children:[(0,t.jsx)(i._,{size:20,className:"text-foreground"}),(0,t.jsx)("span",{className:"font-semibold tracking-tight",children:"Beacon"}),(0,t.jsx)("span",{className:"w-mono w-eyebrow w-muted ml-1 hidden sm:inline",children:"docs"})]}),(0,t.jsxs)("nav",{className:"flex items-center gap-6 text-sm w-muted",children:[(0,t.jsx)(o(),{href:"/",className:"transition-colors hover:text-foreground",children:"Home"}),(0,t.jsx)("a",{href:"#install",className:"transition-colors hover:text-foreground",children:"Install"})]})]})})}),(0,t.jsx)("div",{className:"mx-auto max-w-6xl px-6 pb-24 pt-20",children:(0,t.jsxs)("div",{className:"lg:grid lg:grid-cols-[15rem_1fr] lg:gap-14",children:[(0,t.jsx)("aside",{className:"hidden lg:block",children:(0,t.jsxs)("nav",{className:"sticky top-28",children:[(0,t.jsx)("p",{className:"w-mono w-eyebrow w-muted mb-4",children:"On this page"}),(0,t.jsx)("ul",{className:"space-y-1.5 text-sm",children:d.map(s=>(0,t.jsx)("li",{children:(0,t.jsx)("a",{href:`#${s.id}`,className:`block border-l-2 py-1 pl-3 transition-colors ${e===s.id?"w-signal border-[#ff7a45]":"w-muted border-transparent hover:text-foreground"}`,children:s.title})},s.id))})]})}),(0,t.jsxs)("main",{className:"min-w-0 max-w-2xl",children:[(0,t.jsxs)("section",{className:"w-load",children:[(0,t.jsx)(w,{id:"overview",eyebrow:"Overview",children:"What is Beacon"}),(0,t.jsxs)("p",{className:"w-muted leading-relaxed",children:["Beacon is the ",(0,t.jsx)("span",{className:"text-foreground",children:"visual planning surface for the coding agent in your terminal"}),". That session is the brain; Beacon is its eyes and hands. The agent proposes a feature plan — roadmap features, database schema, and endpoints — you review it on a canvas instead of a wall of text, give scoped feedback, and approve or discard with a click. The verdict flows straight back to your session."]}),(0,t.jsxs)("p",{className:"w-muted mt-4 leading-relaxed",children:["It runs entirely on your machine — ",(0,t.jsx)("span",{className:"text-foreground",children:"local-first, your code never leaves it"}),". One shared server quietly serves every repo you open; each keeps its own data under ",(0,t.jsx)("span",{className:"w-mono text-foreground",children:"~/.beacon"}),"."]})]}),(0,t.jsxs)("section",{className:"mt-16",children:[(0,t.jsx)(w,{id:"install",eyebrow:"Get started",children:"Install"}),(0,t.jsxs)("p",{className:"w-muted mb-4 leading-relaxed",children:["One command. It installs ",(0,t.jsx)("span",{className:"text-foreground",children:"Bun"})," if you don't have it, then puts the"," ",(0,t.jsx)("span",{className:"w-mono text-foreground",children:"beacon"})," CLI on your PATH. Re-run it any time to update."]}),(0,t.jsx)(g,{copy:!0,children:l.EO}),(0,t.jsx)("p",{className:"w-muted mt-4 leading-relaxed",children:"Then, inside any repository:"}),(0,t.jsx)("div",{className:"mt-3",children:(0,t.jsx)(g,{copy:!0,children:"beacon"})})]}),(0,t.jsxs)("section",{className:"mt-16",children:[(0,t.jsx)(w,{id:"quickstart",eyebrow:"Get started",children:"Quickstart"}),(0,t.jsx)("ol",{className:"space-y-5",children:[(0,t.jsxs)(t.Fragment,{children:["Install with the command above, then run ",(0,t.jsx)("span",{className:"w-mono text-foreground",children:"beacon"})," inside a repo. It registers the repo, starts the shared server, and opens the panel in your browser."]}),(0,t.jsxs)(t.Fragment,{children:["In your terminal session, run ",(0,t.jsx)("span",{className:"w-mono text-foreground",children:"/beacon-init"}),". The agent reads the repo and draws its architecture, schema, and roadmap onto the canvas."]}),(0,t.jsxs)(t.Fragment,{children:["Ask the agent to plan a feature. It calls ",(0,t.jsx)("span",{className:"w-mono text-foreground",children:"beacon_propose_plan"})," and the plan renders live on ",(0,t.jsx)("span",{className:"text-foreground",children:"/plan"}),"."]}),(0,t.jsxs)(t.Fragment,{children:["Review it — annotate inline, edit the boards — then ",(0,t.jsx)("span",{className:"text-foreground",children:"Approve"}),", ",(0,t.jsx)("span",{className:"text-foreground",children:"Submit feedback"}),", or ",(0,t.jsx)("span",{className:"text-foreground",children:"Discard"}),". Your verdict returns to the session."]})].map((e,s)=>(0,t.jsxs)("li",{className:"relative pl-11",children:[(0,t.jsx)("span",{className:"w-mono glass absolute left-0 top-0 grid h-7 w-7 place-items-center rounded-md text-[0.72rem] font-semibold text-foreground",children:s+1}),(0,t.jsx)("p",{className:"w-muted leading-relaxed",children:e})]},s))})]}),(0,t.jsxs)("section",{className:"mt-16",children:[(0,t.jsx)(w,{id:"loop",eyebrow:"Concepts",children:"The planning loop"}),(0,t.jsx)("p",{className:"w-muted leading-relaxed",children:"The loop is the whole point. It closes in five steps:"}),(0,t.jsx)("ol",{className:"mt-4 space-y-3",children:[(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-foreground",children:"Propose."})," The agent calls ",(0,t.jsx)("span",{className:"w-mono text-foreground",children:"beacon_propose_plan"})," (or you present a plan in plan mode). The tool ",(0,t.jsx)("span",{className:"text-foreground",children:"blocks"})," — the session waits for your verdict."]}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-foreground",children:"Review."})," The plan renders on ",(0,t.jsx)("span",{className:"text-foreground",children:"/plan"}),": a native annotation panel on the left, the roadmap and database boards on the right. Select text to comment; edit the boards directly."]}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-foreground",children:"Decide."})," Approve, Discard, or Submit feedback. Feedback bundles your inline notes plus any board edits."]}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-foreground",children:"Return."})," The verdict flows back to the terminal. On feedback, the agent revises and re-proposes — the loop continues."]}),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-foreground",children:"Record."})," On approval the schema and roadmap drafts persist, and when the work is done the agent calls ",(0,t.jsx)("span",{className:"w-mono text-foreground",children:"beacon_feature"})," (action: done) so the next session has accurate context."]})].map((e,s)=>(0,t.jsx)("li",{className:"glass w-hover rounded-lg p-4",children:(0,t.jsx)("p",{className:"w-muted text-[0.95rem] leading-relaxed",children:e})},s))})]}),(0,t.jsxs)("section",{className:"mt-16",children:[(0,t.jsx)(w,{id:"canvases",eyebrow:"Concepts",children:"The canvases"}),(0,t.jsx)("div",{className:"space-y-4",children:[{path:"/map",what:"The roadmap: feature cards, their sub-tasks, and dependency links — plus a separate architecture view of the real components. Files the agent edits attach themselves here."},{path:"/db",what:"The database design board: tables and columns, endpoints, and the endpoint→table links. Proposed schema lands as a distinct draft layer you can approve or discard."},{path:"/plan",what:"The split-screen review page: annotations on the left, the roadmap + database boards tabbed on the right, plus a history of every plan and its verdict."}].map(e=>(0,t.jsxs)("div",{className:"glass w-hover rounded-lg p-5",children:[(0,t.jsx)("p",{className:"w-mono text-foreground mb-1",children:e.path}),(0,t.jsx)("p",{className:"w-muted text-[0.95rem] leading-relaxed",children:e.what})]},e.path))})]}),(0,t.jsxs)("section",{className:"mt-16",children:[(0,t.jsx)(w,{id:"cli",eyebrow:"Reference",children:"CLI reference"}),(0,t.jsx)("div",{className:"space-y-3",children:c.map(e=>(0,t.jsxs)("div",{className:"glass rounded-lg p-4",children:[(0,t.jsxs)("code",{className:"w-mono text-foreground text-[0.9rem]",children:[(0,t.jsx)("span",{className:"w-signal select-none",children:"$ "}),e.cmd]}),(0,t.jsx)("p",{className:"w-muted mt-1.5 text-[0.92rem] leading-relaxed",children:e.what})]},e.cmd))})]}),(0,t.jsxs)("section",{className:"mt-16",children:[(0,t.jsx)(w,{id:"integration",eyebrow:"Reference",children:"Agent integration"}),(0,t.jsx)("h3",{className:"mb-1 mt-2 font-semibold text-foreground",children:"Skills — you type these"}),(0,t.jsx)("p",{className:"w-muted mb-4 text-[0.92rem]",children:"Slash commands that tell the agent to do something Beacon-shaped."}),(0,t.jsx)("div",{className:"space-y-3",children:h.map(e=>(0,t.jsxs)("div",{className:"glass rounded-lg p-4",children:[(0,t.jsx)("code",{className:"w-mono text-foreground text-[0.9rem]",children:e.name}),(0,t.jsxs)("p",{className:"w-muted mt-1.5 text-[0.92rem] leading-relaxed",children:[(0,t.jsx)("span",{className:"text-foreground",children:"When:"})," ",e.when," ",e.what]})]},e.name))}),(0,t.jsx)("h3",{className:"mb-1 mt-8 font-semibold text-foreground",children:"MCP tools — the agent calls these"}),(0,t.jsx)("p",{className:"w-muted mb-4 text-[0.92rem]",children:"You don't run these; the agent reaches for them when they fit. Knowing they exist makes its moves legible."}),(0,t.jsx)("div",{className:"space-y-3",children:m.map(e=>(0,t.jsxs)("div",{className:"glass rounded-lg p-4",children:[(0,t.jsx)("code",{className:"w-mono text-foreground text-[0.9rem]",children:e.name}),(0,t.jsx)("p",{className:"w-muted mt-1.5 text-[0.92rem] leading-relaxed",children:e.what})]},e.name))}),(0,t.jsx)("h3",{className:"mb-1 mt-8 font-semibold text-foreground",children:"Hooks — these run on their own"}),(0,t.jsx)("p",{className:"w-muted mb-4 text-[0.92rem]",children:"Wired into supported terminal sessions globally; they react to what the session is already doing."}),(0,t.jsx)("div",{className:"space-y-3",children:p.map(e=>(0,t.jsxs)("div",{className:"glass rounded-lg p-4",children:[(0,t.jsx)("p",{className:"font-medium text-foreground text-[0.92rem]",children:e.trigger}),(0,t.jsx)("p",{className:"w-muted mt-1.5 text-[0.92rem] leading-relaxed",children:e.what})]},e.trigger))})]}),(0,t.jsxs)("section",{className:"mt-16",children:[(0,t.jsx)(w,{id:"config",eyebrow:"Reference",children:"Configuration"}),(0,t.jsx)("div",{className:"space-y-3",children:x.map(e=>(0,t.jsxs)("div",{className:"glass rounded-lg p-4",children:[(0,t.jsx)("code",{className:"w-mono text-foreground text-[0.9rem]",children:e.key}),(0,t.jsx)("p",{className:"w-muted mt-1.5 text-[0.92rem] leading-relaxed",children:e.what})]},e.key))})]}),(0,t.jsxs)("section",{className:"mt-16",children:[(0,t.jsx)(w,{id:"telemetry",eyebrow:"Reference",children:"Telemetry"}),(0,t.jsxs)("p",{className:"w-muted mb-4 leading-relaxed",children:["Beacon sends an anonymous heartbeat at most every 12 hours while the local server runs, so we can count active installs (npm download numbers are dominated by mirrors and CI). The payload is exactly five fields — verify it yourself anytime with"," ",(0,t.jsx)("span",{className:"w-mono text-foreground",children:"beacon telemetry status"}),", which prints the exact payload that gets sent."]}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"glass rounded-lg p-4",children:[(0,t.jsx)("p",{className:"font-medium text-foreground text-[0.92rem]",children:"What is sent"}),(0,t.jsxs)("p",{className:"w-muted mt-1.5 text-[0.92rem] leading-relaxed",children:["A random machine id (a UUID generated locally — tied to nothing), the Beacon version, the operating system (",(0,t.jsx)("span",{className:"w-mono",children:"darwin"}),"/",(0,t.jsx)("span",{className:"w-mono",children:"linux"}),"/",(0,t.jsx)("span",{className:"w-mono",children:"win32"}),"), the CPU architecture, and whether the machine is a CI runner."]})]}),(0,t.jsxs)("div",{className:"glass rounded-lg p-4",children:[(0,t.jsx)("p",{className:"font-medium text-foreground text-[0.92rem]",children:"What is never sent"}),(0,t.jsx)("p",{className:"w-muted mt-1.5 text-[0.92rem] leading-relaxed",children:"Repo names, file paths, code, plans, board content, environment variables, or anything derived from them. IP addresses are not stored."})]}),(0,t.jsxs)("div",{className:"glass rounded-lg p-4",children:[(0,t.jsx)("p",{className:"font-medium text-foreground text-[0.92rem]",children:"Opting out"}),(0,t.jsxs)("p",{className:"w-muted mt-1.5 text-[0.92rem] leading-relaxed",children:["Any of: ",(0,t.jsx)("span",{className:"w-mono text-foreground",children:"beacon telemetry off"}),", the env var"," ",(0,t.jsx)("span",{className:"w-mono text-foreground",children:"BEACON_TELEMETRY_DISABLED=1"}),", or the cross-tool ",(0,t.jsx)("span",{className:"w-mono text-foreground",children:"DO_NOT_TRACK=1"})," convention. Re-enable with ",(0,t.jsx)("span",{className:"w-mono text-foreground",children:"beacon telemetry on"}),"."]})]})]})]}),(0,t.jsxs)("section",{className:"mt-16",children:[(0,t.jsx)(w,{id:"troubleshooting",eyebrow:"Help",children:"Troubleshooting"}),(0,t.jsx)("p",{className:"w-muted mb-4 leading-relaxed",children:"When something looks off, start here:"}),(0,t.jsx)("div",{className:"mb-4",children:(0,t.jsx)(g,{copy:!0,children:"beacon doctor"})}),(0,t.jsx)("div",{className:"space-y-3",children:[{q:"The panel won't open",a:(0,t.jsxs)(t.Fragment,{children:["Make sure the server is up — run ",(0,t.jsx)("span",{className:"w-mono text-foreground",children:"beacon"})," again, or ",(0,t.jsx)("span",{className:"w-mono text-foreground",children:"beacon stop"})," then ",(0,t.jsx)("span",{className:"w-mono text-foreground",children:"beacon"})," to restart it."]})},{q:"The @beacon tools or skills are missing",a:(0,t.jsxs)(t.Fragment,{children:["Run ",(0,t.jsx)("span",{className:"w-mono text-foreground",children:"beacon setup"})," in the repo, then restart your terminal session so it re-reads the MCP registration."]})},{q:"How do I update?",a:(0,t.jsx)(t.Fragment,{children:"Re-run the install command — it fetches the latest and relinks. Nothing else to do."})}].map(e=>(0,t.jsxs)("div",{className:"glass rounded-lg p-4",children:[(0,t.jsx)("p",{className:"font-medium text-foreground text-[0.92rem]",children:e.q}),(0,t.jsx)("p",{className:"w-muted mt-1.5 text-[0.92rem] leading-relaxed",children:e.a})]},e.q))})]})]})]})}),(0,t.jsx)("footer",{className:"px-6 pb-12 pt-8",children:(0,t.jsxs)("div",{className:"mx-auto max-w-6xl",children:[(0,t.jsx)("div",{className:"w-accent-line mb-8 h-px w-full opacity-60"}),(0,t.jsxs)("div",{className:"flex flex-col items-center justify-between gap-5 md:flex-row",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,t.jsx)(i._,{size:26,className:"text-foreground"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-semibold leading-tight",children:"Beacon"}),(0,t.jsx)("p",{className:"w-mono w-muted text-[0.72rem]",children:"the visual planning surface for your terminal"})]})]}),(0,t.jsxs)("nav",{className:"flex items-center gap-6 text-sm w-muted",children:[(0,t.jsx)(o(),{href:"/",className:"transition-colors hover:text-foreground",children:"Home"}),(0,t.jsx)("a",{href:"#overview",className:"transition-colors hover:text-foreground",children:"Docs"})]}),(0,t.jsxs)("p",{className:"w-mono w-muted text-[0.72rem]",children:["Created by"," ",(0,t.jsxs)("a",{href:"https://www.instagram.com/wenzorithelly/",target:"_blank",rel:"noreferrer",className:"w-signal inline-flex items-center gap-1 underline decoration-dotted underline-offset-2 transition-opacity hover:opacity-80",children:[(0,t.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:[(0,t.jsx)("rect",{x:"2",y:"2",width:"20",height:"20",rx:"5",ry:"5"}),(0,t.jsx)("path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"}),(0,t.jsx)("line",{x1:"17.5",y1:"6.5",x2:"17.51",y2:"6.5"})]}),"Wenzo"]}),(0,t.jsx)("span",{className:"mx-2 opacity-40",children:"\xb7"}),"\xa9 2026 Beacon"]})]})]})})]})}},82780:(e,s,a)=>{Promise.resolve().then(a.bind(a,73954))},93340:()=>{}},e=>{e.O(0,[1477,8500,8441,3794,7358],()=>e(e.s=82780)),_N_E=e.O()}]);