trybeacon 0.1.21 → 0.1.22

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 (82) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +11 -11
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  6. package/.next/server/app/_global-error.html +1 -1
  7. package/.next/server/app/_global-error.rsc +1 -1
  8. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  13. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  14. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/_not-found.html +1 -1
  16. package/.next/server/app/_not-found.rsc +1 -1
  17. package/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  18. package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  19. package/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  20. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  21. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  22. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  23. package/.next/server/app/api/plan/annotations/route.js +1 -1
  24. package/.next/server/app/docs/page_client-reference-manifest.js +1 -1
  25. package/.next/server/app/docs.html +1 -1
  26. package/.next/server/app/docs.rsc +1 -1
  27. package/.next/server/app/docs.segments/_full.segment.rsc +1 -1
  28. package/.next/server/app/docs.segments/_head.segment.rsc +1 -1
  29. package/.next/server/app/docs.segments/_index.segment.rsc +1 -1
  30. package/.next/server/app/docs.segments/_tree.segment.rsc +1 -1
  31. package/.next/server/app/docs.segments/docs/__PAGE__.segment.rsc +1 -1
  32. package/.next/server/app/docs.segments/docs.segment.rsc +1 -1
  33. package/.next/server/app/feedback/page_client-reference-manifest.js +1 -1
  34. package/.next/server/app/feedback.html +1 -1
  35. package/.next/server/app/feedback.rsc +1 -1
  36. package/.next/server/app/feedback.segments/_full.segment.rsc +1 -1
  37. package/.next/server/app/feedback.segments/_head.segment.rsc +1 -1
  38. package/.next/server/app/feedback.segments/_index.segment.rsc +1 -1
  39. package/.next/server/app/feedback.segments/_tree.segment.rsc +1 -1
  40. package/.next/server/app/feedback.segments/feedback/__PAGE__.segment.rsc +1 -1
  41. package/.next/server/app/feedback.segments/feedback.segment.rsc +1 -1
  42. package/.next/server/app/help/page_client-reference-manifest.js +1 -1
  43. package/.next/server/app/help.html +1 -1
  44. package/.next/server/app/help.rsc +1 -1
  45. package/.next/server/app/help.segments/_full.segment.rsc +1 -1
  46. package/.next/server/app/help.segments/_head.segment.rsc +1 -1
  47. package/.next/server/app/help.segments/_index.segment.rsc +1 -1
  48. package/.next/server/app/help.segments/_tree.segment.rsc +1 -1
  49. package/.next/server/app/help.segments/help/__PAGE__.segment.rsc +1 -1
  50. package/.next/server/app/help.segments/help.segment.rsc +1 -1
  51. package/.next/server/app/index.html +1 -1
  52. package/.next/server/app/index.rsc +1 -1
  53. package/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  54. package/.next/server/app/index.segments/_full.segment.rsc +1 -1
  55. package/.next/server/app/index.segments/_head.segment.rsc +1 -1
  56. package/.next/server/app/index.segments/_index.segment.rsc +1 -1
  57. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  58. package/.next/server/app/map/page.js +2 -2
  59. package/.next/server/app/map/page.js.nft.json +1 -1
  60. package/.next/server/app/map/page_client-reference-manifest.js +1 -1
  61. package/.next/server/app/page_client-reference-manifest.js +1 -1
  62. package/.next/server/app/plan/page.js +2 -2
  63. package/.next/server/app/plan/page.js.nft.json +1 -1
  64. package/.next/server/app/plan/page_client-reference-manifest.js +1 -1
  65. package/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  66. package/.next/server/app-paths-manifest.json +11 -11
  67. package/.next/server/chunks/5680.js +1 -0
  68. package/.next/server/middleware-build-manifest.js +1 -1
  69. package/.next/server/pages/404.html +1 -1
  70. package/.next/server/pages/500.html +1 -1
  71. package/.next/server/server-reference-manifest.js +1 -1
  72. package/.next/server/server-reference-manifest.json +1 -1
  73. package/.next/static/chunks/{7598-00c802f7e07168c6.js → 4779-6218ea303266aff3.js} +1 -1
  74. package/.next/static/chunks/app/map/{page-baea8dfc54dd1a13.js → page-bd036db25a148fb3.js} +1 -1
  75. package/.next/static/chunks/app/plan/page-2aa7eb766eb1c2e3.js +1 -0
  76. package/.next/trace +37 -37
  77. package/.next/trace-build +1 -1
  78. package/package.json +1 -1
  79. package/.next/server/chunks/4120.js +0 -1
  80. package/.next/static/chunks/app/plan/page-de571a7a9eac8400.js +0 -1
  81. /package/.next/static/{q-uh51S-JNckmc0aW2yd- → 08EMrNjd1iA9NlOduqVQX}/_buildManifest.js +0 -0
  82. /package/.next/static/{q-uh51S-JNckmc0aW2yd- → 08EMrNjd1iA9NlOduqVQX}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5823],{15373:(e,t,s)=>{"use strict";s.d(t,{FilesMapClient:()=>w});var o=s(95155),r=s(12115),n=s(81750),l=s(6266),a=s(7679),i=s(98766),d=s(15629),c=s(79176),u=s(74371);s(53255);var p=s(18986),h=s(9005),x=s(25583),m=s(82099),f=s(62311);let b=/(^|\/)tests?\/|\.(test|spec)\.[jt]sx?$/i;var g=s(91337);let y={ts:"#3178c6",js:"#f7df1e",py:"#3776ab",go:"#00add8",rs:"#dea584",swift:"#f05138",java:"#b07219",ruby:"#cc342d",kotlin:"#a97bff",csharp:"#178600",php:"#4f5d95",cpp:"#f34b7d",c:"#555555"},j={file:function({data:e}){var t;let s=!!e.touched,r=e.recency??0,a=e.inDegree??0,i=10+.35*Math.min(a,20),d=s?Math.max(13+4*r,i):i,c={fontSize:`${d}px`,...s?{boxShadow:`0 0 ${6+Math.round(12*r)}px ${1+Math.round(3*r)}px rgba(45,212,191,${(.25+.5*r).toFixed(2)})`,zIndex:10}:{}},u=a>0?` \xb7 imported by ${a}`:"",p=s?`${e.tooltip} \xb7 edited ${e.count??0}\xd7 this session${u}`:e.untested?`${e.tooltip} \xb7 no test imports this file${u}`:`${e.tooltip}${u}`;return(0,o.jsxs)("div",{title:p,style:c,className:(0,g.cn)("relative rounded-md border bg-card/85 px-2 py-0.5 text-[10px] font-medium backdrop-blur transition-[font-size,box-shadow,border-color] duration-300",s?"border-teal-300/80 px-2.5 py-1 font-semibold text-foreground":e.untested?"border-amber-400/60 text-foreground/85":"border-white/10 text-foreground/85",e.isNewest&&"animate-touch-pulse"),children:[(0,o.jsx)(n.h7,{type:"target",position:l.yX.Top,isConnectable:!1,className:"!h-0 !w-0 !min-w-0 !border-0 !bg-transparent"}),e.untested&&(0,o.jsx)("span",{"aria-hidden":!0,className:"absolute -right-1 -top-1 size-1.5 rounded-full bg-amber-400 ring-2 ring-background"}),s&&(e.count??0)>0&&(0,o.jsx)("span",{"aria-hidden":!0,className:"absolute -left-1.5 -top-1.5 flex h-3 min-w-3 items-center justify-center rounded-full bg-teal-400 px-0.5 text-[7px] font-bold text-background ring-1 ring-background",children:e.count}),e.lang&&(0,o.jsx)("span",{"aria-hidden":!0,title:e.lang,className:"absolute -bottom-1 -right-1 size-1.5 rounded-full ring-1 ring-background",style:{backgroundColor:(t=e.lang)&&y[t]||"#9ca3af"}}),e.label,(0,o.jsx)(n.h7,{type:"source",position:l.yX.Bottom,isConnectable:!1,className:"!h-0 !w-0 !min-w-0 !border-0 !bg-transparent"})]})}};function w({files:e,edges:t,touched:s}){let l,y=(0,r.useMemo)(()=>{if(!e.some(e=>0===e.x&&0===e.y)){let t=new Map;for(let s of e)t.set(s.path,{x:s.x,y:s.y});return{positions:t,fresh:!1}}return{positions:function(e,t){let s=e.map(e=>{let t=0!==e.x||0!==e.y,s=e.path.includes("/")?e.path.split("/").pop():e.path;return{id:e.path,x:t?e.x:(Math.random()-.5)*600,y:t?e.y:(Math.random()-.5)*600,fx:t?e.x:void 0,fy:t?e.y:void 0,pinned:t,radius:Math.max(28,(6*s.length+24)/2+8)}}),o=t.filter(e=>e.from!==e.to).map(e=>({source:e.from,target:e.to})),r=(0,a.A)(s).force("link",(0,i.A)(o).id(e=>e.id).distance(130).strength(.45)).force("charge",(0,d.A)().strength(-380).distanceMax(1e3)).force("collide",(0,c.A)().radius(e=>e.radius).strength(1)).force("center",(0,u.A)(0,0).strength(.025)).stop();for(let e=0;e<500;e++)r.tick();let n=new Map;for(let e of s)n.set(e.id,{x:e.x??0,y:e.y??0});return n}(e,t),fresh:!0}},[e,t]),k=(0,r.useMemo)(()=>(function(e,t){var s;let o=new Set;for(let e of t)s=e.from,b.test(s)&&o.add(e.to);let r=new Set;for(let t of e)b.test(t)||o.has(t)||r.add(t);return r})(e.map(e=>e.path),t),[e,t]),v=(0,r.useMemo)(()=>{let e=new Map,t=Object.entries(s??{});if(!t.length)return e;let o=t.map(([,e])=>e.lastAt),r=Math.max(...o),n=Math.min(...o),l=r-n||1,a=t[0][0],i=t[0][1].lastAt;for(let[e,s]of t)s.lastAt>=i&&(a=e,i=s.lastAt);for(let[s,o]of t)e.set(s,{count:o.count,recency:(o.lastAt-n)/l,isNewest:s===a});return e},[s]),C=v.size>0,M=(0,r.useMemo)(()=>Array.from(v.entries()).map(([e,t])=>({path:e,label:e.slice(e.lastIndexOf("/")+1),count:t.count,recency:t.recency})).sort((e,t)=>t.recency-e.recency),[v]),S=(0,r.useMemo)(()=>e.map(e=>{let t=y.positions.get(e.path)??{x:e.x,y:e.y},s=e.path.lastIndexOf("/"),o=s>=0?e.path.slice(s+1):e.path,r=v.get(e.path);return{id:e.path,type:"file",position:t,data:{label:o,tooltip:e.path,untested:k.has(e.path),inDegree:e.inDegree??0,lang:e.lang??null,touched:!!r,count:r?.count??0,recency:r?.recency??0,isNewest:r?.isNewest??!1}}}),[e,y,k,v]),A=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(!y.fresh||A.current)return;A.current=!0;let t=e.filter(e=>0===e.x&&0===e.y).map(e=>{let t=y.positions.get(e.path);return t?{path:e.path,x:t.x,y:t.y}:null}).filter(e=>null!==e);t.length&&fetch("/api/code-graph/position",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({batch:t})})},[y,e]);let E=(0,r.useMemo)(()=>t.map(e=>({id:`${e.from}|${e.to}`,source:e.from,target:e.to,type:"straight",style:e.circular?{stroke:"#f87171",strokeDasharray:"5 3",strokeWidth:2}:{stroke:"#a1a1aa",strokeWidth:1.5,opacity:.85}})),[t]),[$,z]=(0,r.useState)(S),[O,I]=(0,r.useState)(E),[_,D]=(0,r.useState)(null),[P,R]=(0,r.useState)(null),[T,F]=(0,r.useState)(!1),[L,W]=(0,r.useState)(!1),[Z,B]=(0,r.useState)(!1),[H,U]=(0,r.useState)(!1),J=(0,r.useRef)(null),K=(0,r.useCallback)(e=>{D(e),R(null);let t=J.current?.getNode(e);t&&J.current&&J.current.setCenter(t.position.x+40,t.position.y+12,{zoom:1.4,duration:600})},[]),V=(0,r.useCallback)(()=>{D(null),R(null);let e=!L;if(W(e),B(e),e&&J.current){let e=Array.from(v.keys()).map(e=>({id:e}));e.length&&J.current.fitView({nodes:e,duration:600,padding:.4})}},[L,v]);(0,r.useEffect)(()=>U(!0),[]),(0,r.useEffect)(()=>z(S),[S]),(0,r.useEffect)(()=>I(E),[E]);let X=(0,r.useCallback)(e=>z(t=>(0,n._0)(e,t)),[]),G=(0,r.useCallback)(e=>I(t=>(0,n.zW)(e,t)),[]),q=(0,r.useCallback)((e,t,s)=>{fetch("/api/code-graph/position",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,x:t,y:s})})},[]),Q=(0,r.useMemo)(()=>new Set(t.filter(e=>e.circular).map(e=>`${e.from}|${e.to}`)),[t]),Y=(0,r.useMemo)(()=>{let e=new Set;for(let s of t)s.circular&&(e.add(s.from),e.add(s.to));return e},[t]),ee=(0,r.useMemo)(()=>{if(P){let e=O.find(e=>e.id===P);return e?new Set([e.source,e.target]):null}if(_){let e=new Set([_]);for(let s of t)s.from===_&&e.add(s.to),s.to===_&&e.add(s.from);return e}return T?Y:L&&C?new Set(v.keys()):null},[_,P,T,Y,t,O,L,C,v]),et=(0,r.useMemo)(()=>ee?$.map(e=>({...e,style:{...e.style,opacity:ee.has(e.id)?1:.15,transition:"opacity 120ms"}})):$,[$,ee]),es=(0,r.useMemo)(()=>_||P||T||L?O.map(e=>{let t=!1;return P?t=e.id===P:_?t=e.source===_||e.target===_:T?t=Q.has(e.id):L&&(t=v.has(e.source)&&v.has(e.target)),t?{...e,zIndex:20,style:{...e.style,opacity:1,strokeWidth:2}}:{...e,style:{...e.style,opacity:.05}}}):O,[O,_,P,T,Q,L,v]),eo=t.filter(e=>e.circular).length,er=(0,r.useMemo)(()=>_?t.filter(e=>e.from===_).map(e=>e.to):[],[_,t]),en=(0,r.useMemo)(()=>_?t.filter(e=>e.to===_).map(e=>e.from):[],[_,t]),el=null!==_||Z&&C,ea=(0,r.useCallback)(()=>{D(null),B(!1),W(!1)},[]);return H?(0,o.jsxs)("div",{className:"canvas-dots relative h-screen w-full",children:[(0,o.jsxs)(n.Gc,{nodes:et,edges:es,nodeTypes:j,onNodesChange:X,onEdgesChange:G,onNodeClick:(e,t)=>{D(t.id),R(null)},onEdgeClick:(e,t)=>{R(t.id),D(null)},onPaneClick:()=>{D(null),R(null)},onInit:e=>{J.current=e},onNodeDragStop:(e,t)=>q(t.id,t.position.x,t.position.y),deleteKeyCode:null,colorMode:"dark",fitView:!0,minZoom:.05,panOnScroll:!0,zoomActivationKeyCode:["Meta","Control"],proOptions:{hideAttribution:!0},children:[(0,o.jsx)(n.H2,{position:"bottom-right",className:"!overflow-hidden !rounded-xl !border !border-white/10 [&_button]:!border-white/10 [&_button]:!bg-card/70 [&_button]:!text-foreground [&_button]:!backdrop-blur"}),(0,o.jsx)(n.of,{pannable:!0,zoomable:!0,position:"bottom-left",style:{width:140,height:90},className:"!rounded-xl !border !border-white/10 !bg-card/50 !backdrop-blur",nodeColor:()=>"#555"}),(0,o.jsx)(n.Zk,{position:"top-center",className:"glass rounded-full px-1 py-0.5",children:(0,o.jsx)(f.Z,{active:"FILES",tabs:[{value:"ROADMAP",label:"Roadmap",href:"/map?view=ROADMAP"},{value:"ARCHITECTURE",label:"Architecture",href:"/map?view=ARCHITECTURE"},{value:"FILES",label:"Files",href:"/map?view=FILES"},{value:"DATABASE",label:"Database",href:"/map?view=DATABASE"}]})}),(0,o.jsxs)(n.Zk,{position:"top-right",className:"glass flex items-center gap-3 rounded-xl px-3 py-1.5 text-[11px]",children:[(0,o.jsxs)("span",{className:"text-muted-foreground",children:[e.length," files \xb7 ",t.length," imports"]}),eo>0&&(0,o.jsxs)("button",{type:"button",onClick:()=>{F(e=>!e),D(null),R(null)},title:T?"Show all imports":"Show only files involved in import cycles",className:(0,g.cn)("flex items-center gap-1.5 rounded-md px-1.5 py-0.5 transition-colors",T?"bg-red-500/15 text-red-200 ring-1 ring-red-400/40":"text-red-300 hover:bg-red-500/10"),children:[(0,o.jsx)("span",{"aria-hidden":!0,className:"inline-block h-0 w-5 border-t border-dashed",style:{borderColor:"#ef4444"}}),eo," circular"]}),C&&(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("button",{type:"button",onClick:V,title:L?"Show all files again":"Focus + zoom to the files edited this session",className:(0,g.cn)("flex items-center gap-1.5 rounded-md px-1.5 py-0.5 transition-colors",L?"bg-teal-500/15 text-teal-200 ring-1 ring-teal-400/40":"text-teal-300 hover:bg-teal-500/10"),children:[(0,o.jsx)(p.A,{className:"size-3"}),v.size," edited"]})})]})]}),el&&(0,o.jsxs)(m.b,{className:"absolute bottom-3 right-3 top-16 z-10 flex w-72 flex-col rounded-2xl",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between border-b border-white/10 px-3.5 py-2.5",children:[(0,o.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:_?"File":"Edited this session"}),(0,o.jsx)("button",{onClick:ea,title:"Close panel",className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-white/10 hover:text-foreground",children:(0,o.jsx)(h.A,{className:"size-4"})})]}),(0,o.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-3",children:_?(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,o.jsx)(x.A,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,o.jsx)("h2",{className:"break-all text-sm font-semibold leading-tight",children:_.slice(_.lastIndexOf("/")+1)})]}),(0,o.jsx)("div",{className:"mt-0.5 break-all font-mono text-[10px] text-muted-foreground",children:_})]}),(0,o.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(l=v.get(_))?(0,o.jsxs)("span",{className:"rounded bg-teal-500/15 px-1.5 py-0.5 text-[10px] font-semibold text-teal-300",children:["edited ",l.count,"\xd7"]}):null,k.has(_)&&(0,o.jsx)("span",{className:"rounded bg-amber-500/15 px-1.5 py-0.5 text-[10px] font-semibold text-amber-300",children:"untested"})]}),(0,o.jsx)("button",{onClick:()=>fetch(`/api/open?path=${encodeURIComponent(_)}`).catch(()=>{}),className:"w-full rounded-md border border-white/10 px-2 py-1.5 text-[11px] text-muted-foreground transition-colors hover:bg-white/[0.06] hover:text-foreground",children:"Open in editor"}),(0,o.jsx)(N,{label:"Imports",paths:er,onPick:K}),(0,o.jsx)(N,{label:"Imported by",paths:en,onPick:K})]}):(0,o.jsx)("ul",{className:"space-y-0.5",children:M.map(e=>(0,o.jsx)("li",{children:(0,o.jsxs)("button",{onClick:()=>K(e.path),title:e.path,className:"flex w-full items-center justify-between gap-2 rounded px-2 py-1 text-left transition-colors hover:bg-white/[0.06]",children:[(0,o.jsx)("span",{className:"truncate text-[11px] text-foreground/90",children:e.label}),(0,o.jsxs)("span",{className:"shrink-0 text-[9px] text-teal-300/80",children:[e.count,"\xd7"]})]})},e.path))})})]})]}):(0,o.jsx)("div",{className:"flex h-screen w-full items-center justify-center text-sm text-muted-foreground",children:"Loading graph…"})}function N({label:e,paths:t,onPick:s}){return t.length?(0,o.jsxs)("div",{children:[(0,o.jsxs)("h3",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:[e," (",t.length,")"]}),(0,o.jsx)("ul",{className:"space-y-0.5",children:t.map(e=>(0,o.jsx)("li",{children:(0,o.jsx)("button",{onClick:()=>s(e),title:e,className:"block w-full truncate rounded px-1.5 py-0.5 text-left font-mono text-[10px] text-muted-foreground transition-colors hover:bg-white/5 hover:text-foreground",children:e.slice(e.lastIndexOf("/")+1)})},e))})]}):null}},39454:(e,t,s)=>{Promise.resolve().then(s.bind(s,26856)),Promise.resolve().then(s.bind(s,15373)),Promise.resolve().then(s.bind(s,70811))}},e=>{e.O(0,[2574,3862,8500,4294,766,1202,7028,7598,8441,3794,7358],()=>e(e.s=39454)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5823],{15373:(e,t,s)=>{"use strict";s.d(t,{FilesMapClient:()=>w});var o=s(95155),r=s(12115),n=s(81750),l=s(6266),a=s(7679),i=s(98766),d=s(15629),c=s(79176),u=s(74371);s(53255);var p=s(18986),h=s(9005),x=s(25583),m=s(82099),f=s(62311);let b=/(^|\/)tests?\/|\.(test|spec)\.[jt]sx?$/i;var g=s(91337);let y={ts:"#3178c6",js:"#f7df1e",py:"#3776ab",go:"#00add8",rs:"#dea584",swift:"#f05138",java:"#b07219",ruby:"#cc342d",kotlin:"#a97bff",csharp:"#178600",php:"#4f5d95",cpp:"#f34b7d",c:"#555555"},j={file:function({data:e}){var t;let s=!!e.touched,r=e.recency??0,a=e.inDegree??0,i=10+.35*Math.min(a,20),d=s?Math.max(13+4*r,i):i,c={fontSize:`${d}px`,...s?{boxShadow:`0 0 ${6+Math.round(12*r)}px ${1+Math.round(3*r)}px rgba(45,212,191,${(.25+.5*r).toFixed(2)})`,zIndex:10}:{}},u=a>0?` \xb7 imported by ${a}`:"",p=s?`${e.tooltip} \xb7 edited ${e.count??0}\xd7 this session${u}`:e.untested?`${e.tooltip} \xb7 no test imports this file${u}`:`${e.tooltip}${u}`;return(0,o.jsxs)("div",{title:p,style:c,className:(0,g.cn)("relative rounded-md border bg-card/85 px-2 py-0.5 text-[10px] font-medium backdrop-blur transition-[font-size,box-shadow,border-color] duration-300",s?"border-teal-300/80 px-2.5 py-1 font-semibold text-foreground":e.untested?"border-amber-400/60 text-foreground/85":"border-white/10 text-foreground/85",e.isNewest&&"animate-touch-pulse"),children:[(0,o.jsx)(n.h7,{type:"target",position:l.yX.Top,isConnectable:!1,className:"!h-0 !w-0 !min-w-0 !border-0 !bg-transparent"}),e.untested&&(0,o.jsx)("span",{"aria-hidden":!0,className:"absolute -right-1 -top-1 size-1.5 rounded-full bg-amber-400 ring-2 ring-background"}),s&&(e.count??0)>0&&(0,o.jsx)("span",{"aria-hidden":!0,className:"absolute -left-1.5 -top-1.5 flex h-3 min-w-3 items-center justify-center rounded-full bg-teal-400 px-0.5 text-[7px] font-bold text-background ring-1 ring-background",children:e.count}),e.lang&&(0,o.jsx)("span",{"aria-hidden":!0,title:e.lang,className:"absolute -bottom-1 -right-1 size-1.5 rounded-full ring-1 ring-background",style:{backgroundColor:(t=e.lang)&&y[t]||"#9ca3af"}}),e.label,(0,o.jsx)(n.h7,{type:"source",position:l.yX.Bottom,isConnectable:!1,className:"!h-0 !w-0 !min-w-0 !border-0 !bg-transparent"})]})}};function w({files:e,edges:t,touched:s}){let l,y=(0,r.useMemo)(()=>{if(!e.some(e=>0===e.x&&0===e.y)){let t=new Map;for(let s of e)t.set(s.path,{x:s.x,y:s.y});return{positions:t,fresh:!1}}return{positions:function(e,t){let s=e.map(e=>{let t=0!==e.x||0!==e.y,s=e.path.includes("/")?e.path.split("/").pop():e.path;return{id:e.path,x:t?e.x:(Math.random()-.5)*600,y:t?e.y:(Math.random()-.5)*600,fx:t?e.x:void 0,fy:t?e.y:void 0,pinned:t,radius:Math.max(28,(6*s.length+24)/2+8)}}),o=t.filter(e=>e.from!==e.to).map(e=>({source:e.from,target:e.to})),r=(0,a.A)(s).force("link",(0,i.A)(o).id(e=>e.id).distance(130).strength(.45)).force("charge",(0,d.A)().strength(-380).distanceMax(1e3)).force("collide",(0,c.A)().radius(e=>e.radius).strength(1)).force("center",(0,u.A)(0,0).strength(.025)).stop();for(let e=0;e<500;e++)r.tick();let n=new Map;for(let e of s)n.set(e.id,{x:e.x??0,y:e.y??0});return n}(e,t),fresh:!0}},[e,t]),k=(0,r.useMemo)(()=>(function(e,t){var s;let o=new Set;for(let e of t)s=e.from,b.test(s)&&o.add(e.to);let r=new Set;for(let t of e)b.test(t)||o.has(t)||r.add(t);return r})(e.map(e=>e.path),t),[e,t]),v=(0,r.useMemo)(()=>{let e=new Map,t=Object.entries(s??{});if(!t.length)return e;let o=t.map(([,e])=>e.lastAt),r=Math.max(...o),n=Math.min(...o),l=r-n||1,a=t[0][0],i=t[0][1].lastAt;for(let[e,s]of t)s.lastAt>=i&&(a=e,i=s.lastAt);for(let[s,o]of t)e.set(s,{count:o.count,recency:(o.lastAt-n)/l,isNewest:s===a});return e},[s]),C=v.size>0,M=(0,r.useMemo)(()=>Array.from(v.entries()).map(([e,t])=>({path:e,label:e.slice(e.lastIndexOf("/")+1),count:t.count,recency:t.recency})).sort((e,t)=>t.recency-e.recency),[v]),S=(0,r.useMemo)(()=>e.map(e=>{let t=y.positions.get(e.path)??{x:e.x,y:e.y},s=e.path.lastIndexOf("/"),o=s>=0?e.path.slice(s+1):e.path,r=v.get(e.path);return{id:e.path,type:"file",position:t,data:{label:o,tooltip:e.path,untested:k.has(e.path),inDegree:e.inDegree??0,lang:e.lang??null,touched:!!r,count:r?.count??0,recency:r?.recency??0,isNewest:r?.isNewest??!1}}}),[e,y,k,v]),A=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(!y.fresh||A.current)return;A.current=!0;let t=e.filter(e=>0===e.x&&0===e.y).map(e=>{let t=y.positions.get(e.path);return t?{path:e.path,x:t.x,y:t.y}:null}).filter(e=>null!==e);t.length&&fetch("/api/code-graph/position",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({batch:t})})},[y,e]);let E=(0,r.useMemo)(()=>t.map(e=>({id:`${e.from}|${e.to}`,source:e.from,target:e.to,type:"straight",style:e.circular?{stroke:"#f87171",strokeDasharray:"5 3",strokeWidth:2}:{stroke:"#a1a1aa",strokeWidth:1.5,opacity:.85}})),[t]),[$,z]=(0,r.useState)(S),[O,I]=(0,r.useState)(E),[_,D]=(0,r.useState)(null),[P,R]=(0,r.useState)(null),[T,F]=(0,r.useState)(!1),[L,W]=(0,r.useState)(!1),[Z,B]=(0,r.useState)(!1),[H,U]=(0,r.useState)(!1),J=(0,r.useRef)(null),K=(0,r.useCallback)(e=>{D(e),R(null);let t=J.current?.getNode(e);t&&J.current&&J.current.setCenter(t.position.x+40,t.position.y+12,{zoom:1.4,duration:600})},[]),V=(0,r.useCallback)(()=>{D(null),R(null);let e=!L;if(W(e),B(e),e&&J.current){let e=Array.from(v.keys()).map(e=>({id:e}));e.length&&J.current.fitView({nodes:e,duration:600,padding:.4})}},[L,v]);(0,r.useEffect)(()=>U(!0),[]),(0,r.useEffect)(()=>z(S),[S]),(0,r.useEffect)(()=>I(E),[E]);let X=(0,r.useCallback)(e=>z(t=>(0,n._0)(e,t)),[]),G=(0,r.useCallback)(e=>I(t=>(0,n.zW)(e,t)),[]),q=(0,r.useCallback)((e,t,s)=>{fetch("/api/code-graph/position",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({path:e,x:t,y:s})})},[]),Q=(0,r.useMemo)(()=>new Set(t.filter(e=>e.circular).map(e=>`${e.from}|${e.to}`)),[t]),Y=(0,r.useMemo)(()=>{let e=new Set;for(let s of t)s.circular&&(e.add(s.from),e.add(s.to));return e},[t]),ee=(0,r.useMemo)(()=>{if(P){let e=O.find(e=>e.id===P);return e?new Set([e.source,e.target]):null}if(_){let e=new Set([_]);for(let s of t)s.from===_&&e.add(s.to),s.to===_&&e.add(s.from);return e}return T?Y:L&&C?new Set(v.keys()):null},[_,P,T,Y,t,O,L,C,v]),et=(0,r.useMemo)(()=>ee?$.map(e=>({...e,style:{...e.style,opacity:ee.has(e.id)?1:.15,transition:"opacity 120ms"}})):$,[$,ee]),es=(0,r.useMemo)(()=>_||P||T||L?O.map(e=>{let t=!1;return P?t=e.id===P:_?t=e.source===_||e.target===_:T?t=Q.has(e.id):L&&(t=v.has(e.source)&&v.has(e.target)),t?{...e,zIndex:20,style:{...e.style,opacity:1,strokeWidth:2}}:{...e,style:{...e.style,opacity:.05}}}):O,[O,_,P,T,Q,L,v]),eo=t.filter(e=>e.circular).length,er=(0,r.useMemo)(()=>_?t.filter(e=>e.from===_).map(e=>e.to):[],[_,t]),en=(0,r.useMemo)(()=>_?t.filter(e=>e.to===_).map(e=>e.from):[],[_,t]),el=null!==_||Z&&C,ea=(0,r.useCallback)(()=>{D(null),B(!1),W(!1)},[]);return H?(0,o.jsxs)("div",{className:"canvas-dots relative h-screen w-full",children:[(0,o.jsxs)(n.Gc,{nodes:et,edges:es,nodeTypes:j,onNodesChange:X,onEdgesChange:G,onNodeClick:(e,t)=>{D(t.id),R(null)},onEdgeClick:(e,t)=>{R(t.id),D(null)},onPaneClick:()=>{D(null),R(null)},onInit:e=>{J.current=e},onNodeDragStop:(e,t)=>q(t.id,t.position.x,t.position.y),deleteKeyCode:null,colorMode:"dark",fitView:!0,minZoom:.05,panOnScroll:!0,zoomActivationKeyCode:["Meta","Control"],proOptions:{hideAttribution:!0},children:[(0,o.jsx)(n.H2,{position:"bottom-right",className:"!overflow-hidden !rounded-xl !border !border-white/10 [&_button]:!border-white/10 [&_button]:!bg-card/70 [&_button]:!text-foreground [&_button]:!backdrop-blur"}),(0,o.jsx)(n.of,{pannable:!0,zoomable:!0,position:"bottom-left",style:{width:140,height:90},className:"!rounded-xl !border !border-white/10 !bg-card/50 !backdrop-blur",nodeColor:()=>"#555"}),(0,o.jsx)(n.Zk,{position:"top-center",className:"glass rounded-full px-1 py-0.5",children:(0,o.jsx)(f.Z,{active:"FILES",tabs:[{value:"ROADMAP",label:"Roadmap",href:"/map?view=ROADMAP"},{value:"ARCHITECTURE",label:"Architecture",href:"/map?view=ARCHITECTURE"},{value:"FILES",label:"Files",href:"/map?view=FILES"},{value:"DATABASE",label:"Database",href:"/map?view=DATABASE"}]})}),(0,o.jsxs)(n.Zk,{position:"top-right",className:"glass flex items-center gap-3 rounded-xl px-3 py-1.5 text-[11px]",children:[(0,o.jsxs)("span",{className:"text-muted-foreground",children:[e.length," files \xb7 ",t.length," imports"]}),eo>0&&(0,o.jsxs)("button",{type:"button",onClick:()=>{F(e=>!e),D(null),R(null)},title:T?"Show all imports":"Show only files involved in import cycles",className:(0,g.cn)("flex items-center gap-1.5 rounded-md px-1.5 py-0.5 transition-colors",T?"bg-red-500/15 text-red-200 ring-1 ring-red-400/40":"text-red-300 hover:bg-red-500/10"),children:[(0,o.jsx)("span",{"aria-hidden":!0,className:"inline-block h-0 w-5 border-t border-dashed",style:{borderColor:"#ef4444"}}),eo," circular"]}),C&&(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)("button",{type:"button",onClick:V,title:L?"Show all files again":"Focus + zoom to the files edited this session",className:(0,g.cn)("flex items-center gap-1.5 rounded-md px-1.5 py-0.5 transition-colors",L?"bg-teal-500/15 text-teal-200 ring-1 ring-teal-400/40":"text-teal-300 hover:bg-teal-500/10"),children:[(0,o.jsx)(p.A,{className:"size-3"}),v.size," edited"]})})]})]}),el&&(0,o.jsxs)(m.b,{className:"absolute bottom-3 right-3 top-16 z-10 flex w-72 flex-col rounded-2xl",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between border-b border-white/10 px-3.5 py-2.5",children:[(0,o.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:_?"File":"Edited this session"}),(0,o.jsx)("button",{onClick:ea,title:"Close panel",className:"rounded-md p-1 text-muted-foreground transition-colors hover:bg-white/10 hover:text-foreground",children:(0,o.jsx)(h.A,{className:"size-4"})})]}),(0,o.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto p-3",children:_?(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"flex items-start gap-1.5",children:[(0,o.jsx)(x.A,{className:"mt-0.5 size-4 shrink-0 text-muted-foreground"}),(0,o.jsx)("h2",{className:"break-all text-sm font-semibold leading-tight",children:_.slice(_.lastIndexOf("/")+1)})]}),(0,o.jsx)("div",{className:"mt-0.5 break-all font-mono text-[10px] text-muted-foreground",children:_})]}),(0,o.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(l=v.get(_))?(0,o.jsxs)("span",{className:"rounded bg-teal-500/15 px-1.5 py-0.5 text-[10px] font-semibold text-teal-300",children:["edited ",l.count,"\xd7"]}):null,k.has(_)&&(0,o.jsx)("span",{className:"rounded bg-amber-500/15 px-1.5 py-0.5 text-[10px] font-semibold text-amber-300",children:"untested"})]}),(0,o.jsx)("button",{onClick:()=>fetch(`/api/open?path=${encodeURIComponent(_)}`).catch(()=>{}),className:"w-full rounded-md border border-white/10 px-2 py-1.5 text-[11px] text-muted-foreground transition-colors hover:bg-white/[0.06] hover:text-foreground",children:"Open in editor"}),(0,o.jsx)(N,{label:"Imports",paths:er,onPick:K}),(0,o.jsx)(N,{label:"Imported by",paths:en,onPick:K})]}):(0,o.jsx)("ul",{className:"space-y-0.5",children:M.map(e=>(0,o.jsx)("li",{children:(0,o.jsxs)("button",{onClick:()=>K(e.path),title:e.path,className:"flex w-full items-center justify-between gap-2 rounded px-2 py-1 text-left transition-colors hover:bg-white/[0.06]",children:[(0,o.jsx)("span",{className:"truncate text-[11px] text-foreground/90",children:e.label}),(0,o.jsxs)("span",{className:"shrink-0 text-[9px] text-teal-300/80",children:[e.count,"\xd7"]})]})},e.path))})})]})]}):(0,o.jsx)("div",{className:"flex h-screen w-full items-center justify-center text-sm text-muted-foreground",children:"Loading graph…"})}function N({label:e,paths:t,onPick:s}){return t.length?(0,o.jsxs)("div",{children:[(0,o.jsxs)("h3",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:[e," (",t.length,")"]}),(0,o.jsx)("ul",{className:"space-y-0.5",children:t.map(e=>(0,o.jsx)("li",{children:(0,o.jsx)("button",{onClick:()=>s(e),title:e,className:"block w-full truncate rounded px-1.5 py-0.5 text-left font-mono text-[10px] text-muted-foreground transition-colors hover:bg-white/5 hover:text-foreground",children:e.slice(e.lastIndexOf("/")+1)})},e))})]}):null}},39454:(e,t,s)=>{Promise.resolve().then(s.bind(s,26856)),Promise.resolve().then(s.bind(s,15373)),Promise.resolve().then(s.bind(s,91930))}},e=>{e.O(0,[2574,3862,8500,4294,766,1202,7028,4779,8441,3794,7358],()=>e(e.s=39454)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6624],{8143:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});let s=(0,n(30772).A)("list-checks",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"m3 7 2 2 4-4",key:"1obspn"}]])},9383:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});let s=(0,n(30772).A)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]])},10396:(e,t,n)=>{"use strict";n.d(t,{PlanWorkspace:()=>Y});var s=n(95155),r=n(12115),a=n(64577),o=n(25640),l=n(34306),i=n(92571),d=n(65408),c=n(30772);let u=(0,c.A)("archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);var m=n(8143);let x=(0,c.A)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);var p=n(82879),h=n(17356),f=n(9383),g=n(9005),b=n(65738),v=n(8962),j=n(73321),y=n(48484),w=n(99979),k=n(32133),N=n(38332),C=n(91337),A=n(60874);function S({markdown:e,round:t,onApi:n,hideSubmit:o=!1,getExtraSubmitPayload:l}){let[i,d]=(0,r.useState)([]),[c,u]=(0,r.useState)(""),[m,x]=(0,r.useState)(!1),[p,h]=(0,r.useState)(null),[b,v]=(0,r.useState)(null),[j,y]=(0,r.useState)(null),[A,E]=(0,r.useState)(!1),[P,M]=(0,r.useState)(!1),O=(0,r.useRef)(null),D=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=!0;return(async()=>{try{let t=await fetch("/api/plan/annotations",{cache:"no-store",headers:(0,w.dh)((0,w.X0)())});if(!t.ok)return;let n=await t.json();if(!e)return;d(n.annotations??[]),u(n.globalComment??""),M(!!n.submitted)}catch{}})(),()=>{e=!1}},[e,t]),(0,r.useEffect)(()=>{if(P)return;let e=setTimeout(()=>{fetch("/api/plan/annotations",{method:"PUT",headers:{"content-type":"application/json",...(0,w.dh)((0,w.X0)())},body:JSON.stringify({annotations:i,globalComment:c})}).catch(()=>{})},400);return()=>clearTimeout(e)},[i,c,P]);let T=(0,r.useCallback)(()=>{let e=window.getSelection();if(!e||e.isCollapsed)return void h(null);let t=e.toString().trim();if(!t)return void h(null);if(!O.current?.contains(e.anchorNode))return;let n=e.getRangeAt(0).getBoundingClientRect();h({x:n.right+window.scrollX,y:n.top+window.scrollY,excerpt:t})},[]);(0,r.useEffect)(()=>{let e=()=>setTimeout(T,0);return document.addEventListener("mouseup",e),document.addEventListener("selectionchange",e),()=>{document.removeEventListener("mouseup",e),document.removeEventListener("selectionchange",e)}},[T]);let L=(0,r.useCallback)((e,t="comment",n="")=>{let s=`a-${Date.now()}-${Math.floor(1e6*Math.random())}`;d(r=>[...r,{id:s,excerpt:e,comment:n,kind:t}]),"comment"===t&&y(s),h(null),window.getSelection()?.removeAllRanges()},[]);(0,r.useEffect)(()=>{let e=e=>{let t=window.getSelection();if(!t||t.isCollapsed)return;let n=t.toString().trim();if(!n||!O.current?.contains(t.anchorNode))return;let s=document.activeElement;if(s&&/^(TEXTAREA|INPUT)$/.test(s.tagName)||!(1===e.key.length&&!e.metaKey&&!e.ctrlKey&&!e.altKey))return;e.preventDefault();let r=t.getRangeAt(0).getBoundingClientRect();v({x:r.right+window.scrollX,y:r.top+window.scrollY,excerpt:n,seed:e.key}),h(null),window.getSelection()?.removeAllRanges()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[]),(0,r.useEffect)(()=>{if(!m)return;let e=e=>{let t=e.target;!t||D.current?.contains(t)||t.closest("[data-overall-toggle]")||x(!1)},t=e=>{"Escape"===e.key&&x(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[m]);let I=(e,t)=>d(n=>n.map(n=>n.id===e?{...n,comment:t}:n)),$=e=>d(t=>t.filter(t=>t.id!==e)),F=()=>{d([]),u(""),x(!1),fetch("/api/plan/annotations",{method:"DELETE",headers:(0,w.dh)((0,w.X0)())}).catch(()=>{})},U=async()=>{if(!A){E(!0);try{let e=l?.()??{},n=await fetch("/api/plan/annotations",{method:"POST",headers:{"content-type":"application/json",...(0,w.dh)((0,w.X0)())},body:JSON.stringify({annotations:i,globalComment:c,round:t,...e})});n.ok?M(!0):409===n.status&&window.location.reload()}finally{E(!1)}}},X=(0,r.useMemo)(()=>i.filter(e=>"deletion"===e.kind||e.comment.trim()).length+ +!!c.trim(),[i,c]);return(0,r.useEffect)(()=>{n?.({liveCount:X,submitting:A,submitted:P,submit:()=>void U(),clearAll:F,annotationCount:i.length,hasGlobalComment:!!c.trim(),globalOpen:m,toggleOverall:()=>x(e=>!e),annotations:i,updateComment:I,removeAnnotation:$,focusOnAnnotation:e=>y(e),addComment:e=>L(e,"comment")})},[X,A,P,i,c,m]),(0,s.jsxs)("div",{className:"flex h-full min-h-0 flex-col",children:[(0,s.jsx)("div",{className:"relative shrink-0",children:(0,s.jsxs)("div",{className:"absolute right-3 top-2 z-30 flex items-center gap-1",children:[!o&&(0,s.jsxs)("button",{onClick:()=>void U(),disabled:A||0===X,className:(0,C.cn)("flex items-center gap-1 rounded-md border px-2 py-1 text-[11px] font-semibold transition-colors",P?"border-emerald-500/40 bg-emerald-500/15 text-emerald-300":0===X?"border-white/10 text-muted-foreground opacity-50":"border-sky-500/40 bg-sky-500/15 text-sky-300 hover:bg-sky-500/25"),title:P?"Submitted — your terminal session is reading the feedback":"Submit all feedback so the agent can revise the plan",children:[P?(0,s.jsx)(a.A,{className:"size-3"}):(0,s.jsx)(f.A,{className:"size-3"}),P?"Submitted":"Submit feedback"]}),m&&(0,s.jsxs)("div",{ref:D,className:"absolute right-0 top-[calc(100%+6px)] z-50 w-[320px] rounded-md border border-white/10 bg-card p-2 shadow-xl",children:[(0,s.jsxs)("div",{className:"mb-1 flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Overall feedback"}),(0,s.jsx)("button",{onClick:()=>x(!1),title:"Close (Esc)",className:"rounded p-0.5 text-muted-foreground hover:text-foreground",children:(0,s.jsx)(g.A,{className:"size-3"})})]}),(0,s.jsx)("textarea",{autoFocus:!0,value:c,onChange:e=>u(e.target.value),onKeyDown:e=>{e.stopPropagation(),"Enter"===e.key&&e.shiftKey?(e.preventDefault(),!A&&X>0&&(U(),x(!1))):"Escape"===e.key&&(e.preventDefault(),x(!1))},placeholder:"Plan-level notes — e.g. 'split this into two phases' or 'wrong abstraction'…",rows:4,className:"w-full resize-y rounded border border-white/5 bg-background px-2 py-1.5 text-[12px] leading-snug outline-none focus:border-sky-400/40"}),(0,s.jsx)("div",{className:"mt-1 text-right text-[9px] text-muted-foreground/70",children:"Shift+Enter to submit \xb7 Esc to close"})]})]})}),(0,s.jsx)("div",{ref:O,className:"min-h-0 flex-1 overflow-y-auto px-5 pb-5 pt-16 text-[15px] leading-[1.6] selection:bg-[var(--accent-2,#ff7a45)]/30",children:(0,s.jsx)(R,{markdown:e,annotations:i,focusOnId:j,onClearFocus:()=>y(null),onUpdate:I,onRemove:$})}),p&&(0,s.jsxs)("div",{style:{position:"fixed",left:p.x+4,top:p.y-30,zIndex:60},className:"flex items-center gap-0.5 rounded-md border border-white/15 bg-card/95 p-0.5 shadow-lg backdrop-blur",children:[(0,s.jsx)("button",{onClick:()=>{v({...p,seed:""}),h(null),window.getSelection()?.removeAllRanges()},title:"Comment on this text",className:"rounded p-1 text-sky-300 hover:bg-sky-500/15",children:(0,s.jsx)(k.A,{className:"size-3.5"})}),(0,s.jsx)("button",{onClick:()=>L(p.excerpt,"deletion"),title:"Mark this for deletion",className:"rounded p-1 text-red-300 hover:bg-red-500/15",children:(0,s.jsx)(N.A,{className:"size-3.5"})})]}),b&&(0,s.jsx)(z,{excerpt:b.excerpt,x:b.x,y:b.y,seed:b.seed,onConfirm:e=>{L(b.excerpt,"comment",e),v(null)},onCancel:()=>v(null)})]})}function z({excerpt:e,x:t,y:n,seed:a,onConfirm:o,onCancel:l}){let[i,d]=(0,r.useState)(a);return(0,s.jsxs)("div",{style:{position:"fixed",left:t+4,top:n-6,zIndex:60},className:"w-64 rounded-md border border-white/15 bg-card/95 p-1.5 shadow-xl backdrop-blur",children:[(0,s.jsxs)("div",{className:"mb-1 line-clamp-1 text-[10px] text-muted-foreground",children:["“",e,"”"]}),(0,s.jsx)("textarea",{autoFocus:!0,value:i,onChange:e=>d(e.target.value),onFocus:e=>e.currentTarget.setSelectionRange(i.length,i.length),placeholder:"Comment… (Enter to save \xb7 Esc to cancel)",onKeyDown:e=>{e.stopPropagation(),"Enter"!==e.key||e.shiftKey?"Escape"===e.key&&(e.preventDefault(),l()):(e.preventDefault(),i.trim()?o(i.trim()):l())},onBlur:()=>i.trim()?o(i.trim()):l(),className:"h-16 w-full resize-none rounded bg-white/[0.05] px-1.5 py-1 text-xs outline-none placeholder:text-muted-foreground/50 focus:bg-white/[0.08]"})]})}function E({annotations:e,updateComment:t,removeAnnotation:n,focusOnAnnotation:r,onClose:a}){return 0===e.length?(0,s.jsx)("div",{className:"rounded-lg border border-dashed border-white/10 px-3 py-6 text-center text-[11px] text-muted-foreground",children:"Highlight any text in the plan to leave an inline comment."}):(0,s.jsx)("ul",{className:"space-y-1.5",children:e.map(e=>(0,s.jsx)("li",{className:(0,C.cn)("group rounded-md border bg-background/30 px-2 py-1.5 transition-colors hover:bg-background/50","deletion"===e.kind?"border-red-500/25":"border-sky-500/15"),children:(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>{r(e.id),a?.()},title:"Jump to this excerpt in the plan",className:(0,C.cn)("block w-full truncate text-left text-[10.5px] font-mono","deletion"===e.kind?"text-red-300/90 line-through":"text-foreground/80 hover:text-foreground"),children:["“",e.excerpt,"”"]}),"deletion"!==e.kind&&(0,s.jsx)("textarea",{value:e.comment,onChange:n=>t(e.id,n.target.value),placeholder:"Write your comment…",rows:1,className:"field-sizing-content mt-1 w-full resize-none bg-transparent text-[11px] leading-snug text-foreground/90 outline-none placeholder:text-muted-foreground/60 focus:text-foreground"})]}),(0,s.jsx)("button",{onClick:()=>n(e.id),title:"Remove this annotation",className:"shrink-0 rounded p-1 text-muted-foreground/70 opacity-0 transition-opacity hover:bg-red-500/15 hover:text-red-300 group-hover:opacity-100",children:(0,s.jsx)(b.A,{className:"size-3"})})]})},e.id))})}function R({markdown:e,annotations:t,focusOnId:n,onClearFocus:a,onUpdate:o,onRemove:l}){let i=(0,r.useMemo)(()=>(0,A.n$)(e),[e]);return(0,s.jsx)("div",{className:"mx-auto w-full max-w-[66ch] space-y-4",children:i.map((e,r)=>(0,s.jsx)(P,{block:e,index:r,annotations:t,focusOnId:n,onClearFocus:a,onUpdate:o,onRemove:l},r))})}function P({block:e,index:t,annotations:n,focusOnId:r,onClearFocus:a,onUpdate:o,onRemove:l}){if("code"===e.kind)return(0,s.jsx)(A.NG,{text:e.text});if("table"===e.kind)return(0,s.jsx)(A.QH,{block:e});let i=(0,s.jsx)(M,{text:e.text,annotations:n,focusOnId:r,onClearFocus:a,onUpdate:o,onRemove:l}),d=(0,A.Vq)(e.kind)?(0,A.vB)(t):void 0;return(0,s.jsx)(s.Fragment,{children:(0,A.aM)(e,i,"reading",d)})}function M({text:e,annotations:t,focusOnId:n,onClearFocus:r,onUpdate:a,onRemove:o}){let l=t.map(t=>({a:t,idx:e.indexOf(t.excerpt)})).filter(e=>e.idx>=0).sort((e,t)=>e.idx-t.idx);if(!l.length)return(0,s.jsx)(D,{text:e});let i=[],d=0;for(let{a:t,idx:c}of l)c<d||(c>d&&i.push((0,s.jsx)(D,{text:e.slice(d,c)},`p-${d}`)),i.push((0,s.jsx)(O,{annotation:t,autoFocus:n===t.id,onClearFocus:r,onUpdate:a,onRemove:o},t.id)),d=c+t.excerpt.length);return d<e.length&&i.push((0,s.jsx)(D,{text:e.slice(d)},"p-tail")),(0,s.jsx)(s.Fragment,{children:i})}function O({annotation:e,autoFocus:t,onClearFocus:n,onUpdate:a,onRemove:o}){let l=(0,r.useRef)(null);return((0,r.useEffect)(()=>{if(t&&l.current){l.current.focus();let e=l.current.value;l.current.setSelectionRange(e.length,e.length),n()}},[t,n]),"deletion"===(e.kind??"comment"))?(0,s.jsxs)("span",{className:"relative inline",children:[(0,s.jsx)("span",{className:"rounded bg-red-500/15 px-0.5 text-red-200/90 line-through decoration-red-300/70 decoration-2",children:(0,s.jsx)(D,{text:e.excerpt})}),(0,s.jsx)("button",{type:"button",onClick:()=>o(e.id),title:"Unmark",className:"ml-0.5 inline-flex translate-y-[-1px] items-center text-red-300/70 hover:text-red-300",children:(0,s.jsx)(b.A,{className:"size-3"})})]}):(0,s.jsx)("span",{className:"rounded bg-[var(--accent-2,#ff7a45)]/15 px-0.5","data-annotation-id":e.id,children:(0,s.jsx)(D,{text:e.excerpt})})}function D({text:e}){return(0,s.jsx)(A.cV,{text:e})}let T=(0,c.A)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);function L({pendingPlan:e=!1}={}){let t=(0,j.useRouter)(),[n,i]=(0,r.useState)([]),[d,c]=(0,r.useState)(null),[m,x]=(0,r.useState)(null),[p,h]=(0,r.useState)("markdown");(0,r.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/plan/history");if(!e.ok)return;let t=await e.json();i(t.items),t.items.length&&!d&&c(t.items[0].id)}catch{}})()},[]),(0,r.useEffect)(()=>{d&&(async()=>{let e=await fetch(`/api/plan/history?id=${encodeURIComponent(d)}`);e.ok&&x(await e.json())})()},[d]);let f=(0,r.useMemo)(()=>(function(e){let t=new Map;for(let n of e){let e=new Date(n.archivedAt).toLocaleDateString(void 0,{weekday:"short",month:"short",day:"numeric"});t.has(e)||t.set(e,[]),t.get(e).push(n)}return Array.from(t.entries())})(n),[n]),b=e?(0,s.jsxs)("button",{onClick:()=>t.push((0,w.rc)()),className:"glass pointer-events-auto fixed left-3 top-3 z-30 flex h-10 items-center gap-1.5 rounded-full px-3 text-[11px] font-semibold text-sky-300 transition-colors hover:bg-sky-500/15",title:"Return to the plan that's still pending review",children:[(0,s.jsx)(T,{className:"size-3.5"})," Back to current plan"]}):null;return 0===n.length?(0,s.jsxs)(s.Fragment,{children:[b,(0,s.jsx)("div",{className:"flex h-screen items-center justify-center px-6 pt-14 text-center",children:(0,s.jsxs)("div",{className:"max-w-md text-sm text-muted-foreground",children:[(0,s.jsx)(u,{className:"mx-auto mb-3 size-7 text-muted-foreground/40"}),(0,s.jsx)("div",{className:"mb-2 text-base font-semibold text-foreground",children:"No plans yet."}),"Ask the agent to propose a feature in your terminal session — it lands here via MCP and you can review + annotate on both sides. Past plans get archived to this page for browsing."]})})]}):(0,s.jsxs)("div",{className:"flex h-screen min-h-0 pt-14",children:[b,m&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"glass pointer-events-auto fixed left-1/2 top-3 z-30 flex -translate-x-1/2 items-center gap-0.5 rounded-full p-1",children:[(0,s.jsx)(I,{active:"markdown"===p,onClick:()=>h("markdown"),children:"Plan"}),(0,s.jsx)(I,{active:"map"===p,onClick:()=>h("map"),icon:(0,s.jsx)(o.A,{className:"size-3"}),children:"Features"}),(0,s.jsx)(I,{active:"db"===p,onClick:()=>h("db"),icon:(0,s.jsx)(l.A,{className:"size-3"}),children:"Schema"})]}),(0,s.jsxs)("div",{className:"glass pointer-events-auto fixed right-3 top-3 z-30 flex h-9 items-center gap-2 rounded-full px-3",children:[(0,s.jsx)("span",{className:(0,C.cn)("rounded px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide","approved"===m.verdict?"bg-emerald-500/15 text-emerald-300":"bg-red-500/15 text-red-300"),children:m.verdict}),(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground",children:new Date(m.archivedAt).toLocaleString()})]})]}),(0,s.jsxs)("aside",{className:"flex w-64 min-w-0 shrink-0 flex-col border-r border-white/5 bg-card/30",children:[(0,s.jsxs)("div",{className:"border-b border-white/5 px-3 py-2 text-[10.5px] font-semibold uppercase tracking-wide text-muted-foreground",children:["Plan history \xb7 ",n.length]}),(0,s.jsx)("ul",{className:"min-h-0 flex-1 overflow-y-auto",children:f.map(([e,t])=>(0,s.jsxs)("li",{children:[(0,s.jsx)("div",{className:"px-3 pb-1 pt-3 text-[9px] font-semibold uppercase tracking-widest text-muted-foreground/60",children:e}),(0,s.jsx)("ul",{children:t.map(e=>(0,s.jsx)("li",{children:(0,s.jsxs)("button",{onClick:()=>c(e.id),className:(0,C.cn)("flex w-full items-start gap-1.5 px-3 py-1.5 text-left text-[12px] transition-colors",d===e.id?"bg-white/[0.06] text-foreground":"text-muted-foreground hover:bg-white/[0.03] hover:text-foreground"),children:[(0,s.jsx)("span",{className:(0,C.cn)("mt-0.5 inline-flex size-3.5 shrink-0 items-center justify-center rounded-full","approved"===e.verdict?"bg-emerald-500/15 text-emerald-300":"bg-red-500/15 text-red-300"),title:e.verdict,children:"approved"===e.verdict?(0,s.jsx)(a.A,{className:"size-2.5"}):(0,s.jsx)(g.A,{className:"size-2.5"})}),(0,s.jsx)("span",{className:"line-clamp-2",children:e.description})]})},e.id))})]},e))})]}),m?(0,s.jsx)("section",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:(0,s.jsxs)("div",{className:"min-h-0 flex-1 overflow-y-auto",children:["markdown"===p&&(0,s.jsxs)("div",{className:"px-5 py-4",children:[(0,s.jsx)(A.pO,{markdown:m.markdown}),""===m.markdown.replace(/^#[^\n]*\n?/,"").trim()&&(0,s.jsx)("p",{className:"mt-2 text-[13px] text-muted-foreground",children:(m.featureGraph?.features?.length??0)===0&&(m.draftDoc?.tables?.length??0)===0&&(m.draftDoc?.endpoints?.length??0)===0?"This plan was approved without a detailed write-up — no features or schema were attached either.":"This plan has no written body. See the Features and Schema tabs for what it proposed."}),m.globalComment&&(0,s.jsxs)("div",{className:"mt-4 rounded-lg border border-white/5 bg-card/40 p-3",children:[(0,s.jsx)("div",{className:"mb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Overall feedback"}),(0,s.jsx)("div",{className:"text-[12px] whitespace-pre-wrap",children:m.globalComment})]})]}),"map"===p&&(0,s.jsx)($,{featureGraph:m.featureGraph}),"db"===p&&(0,s.jsx)(F,{draftDoc:m.draftDoc})]})}):(0,s.jsx)("section",{className:"flex min-h-0 min-w-0 flex-1 items-center justify-center text-sm text-muted-foreground",children:"Select a plan on the left to view it."})]})}function I({active:e,onClick:t,icon:n,children:r}){return(0,s.jsxs)("button",{onClick:t,className:(0,C.cn)("flex items-center gap-1 rounded-md px-2 py-1 text-[11px] font-medium transition-colors",e?"bg-white/10 text-foreground":"text-muted-foreground hover:text-foreground"),children:[n,r]})}function $({featureGraph:e}){let t=e?.features??[];return 0===t.length?(0,s.jsx)("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:"No features were proposed in this plan."}):(0,s.jsx)("div",{className:"grid gap-3 px-5 py-4 sm:grid-cols-2 lg:grid-cols-3",children:t.map((e,t)=>(0,s.jsxs)("div",{className:"rounded-lg border border-sky-500/20 bg-card/50 p-3",children:[(0,s.jsxs)("div",{className:"mb-1.5 flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"rounded bg-sky-500/15 px-1.5 py-0.5 text-[9px] font-semibold uppercase tracking-wide text-sky-300",children:"feature"}),e.cluster&&(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground",children:e.cluster})]}),(0,s.jsx)("div",{className:"text-sm font-semibold leading-tight",children:e.title}),e.role&&(0,s.jsx)("div",{className:"mt-1 text-[11px] text-muted-foreground",children:e.role}),e.plain&&(0,s.jsx)("div",{className:"mt-2 text-[12px] text-foreground/80",children:e.plain})]},t))})}function F({draftDoc:e}){let t=e?.tables??[],n=e?.endpoints??[];return 0===t.length&&0===n.length?(0,s.jsx)("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:"No schema was proposed in this plan."}):(0,s.jsxs)("div",{className:"space-y-5 px-5 py-4",children:[t.length>0&&(0,s.jsxs)("section",{children:[(0,s.jsxs)("div",{className:"mb-2 text-[10.5px] font-semibold uppercase tracking-wide text-muted-foreground",children:["Tables \xb7 ",t.length]}),(0,s.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map(e=>(0,s.jsxs)("div",{className:"rounded-lg border border-white/5 bg-card/40 p-3",children:[(0,s.jsxs)("div",{className:"mb-1 flex items-center gap-1.5",children:[(0,s.jsx)("span",{className:"font-mono text-[13px] font-semibold",children:e.name}),e.domain&&(0,s.jsx)("span",{className:"text-[10px] text-muted-foreground",children:e.domain})]}),e.description&&(0,s.jsx)("div",{className:"mb-1.5 text-[11px] text-muted-foreground",children:e.description}),(0,s.jsx)("ul",{className:"space-y-0.5 text-[11px]",children:e.columns.map((e,t)=>(0,s.jsxs)("li",{className:"flex items-baseline gap-1.5",children:[(0,s.jsx)("code",{className:"rounded bg-white/5 px-1 font-mono text-[11px]",children:e.name}),(0,s.jsx)("span",{className:"text-muted-foreground",children:e.type}),e.isPk&&(0,s.jsx)("span",{className:"text-amber-300/80 text-[9px]",children:"PK"}),e.isFk&&(0,s.jsx)("span",{className:"text-sky-300/80 text-[9px]",children:"FK"}),!e.nullable&&(0,s.jsx)("span",{className:"text-muted-foreground/60 text-[9px]",children:"NOT NULL"})]},t))})]},e.id))})]}),n.length>0&&(0,s.jsxs)("section",{children:[(0,s.jsxs)("div",{className:"mb-2 text-[10.5px] font-semibold uppercase tracking-wide text-muted-foreground",children:["Endpoints \xb7 ",n.length]}),(0,s.jsx)("ul",{className:"space-y-1.5",children:n.map(e=>{let t;return(0,s.jsxs)("li",{className:"flex items-center gap-2 rounded-md border border-white/5 bg-card/40 px-2.5 py-1.5 text-[12px]",children:[(0,s.jsx)("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-bold",style:(t=U[e.method.toUpperCase()]??"#8a8a8a",{background:`${t}22`,color:t}),children:e.method}),(0,s.jsx)("span",{className:"font-mono",children:e.path}),e.description&&(0,s.jsx)("span",{className:"ml-2 text-[11px] text-muted-foreground",children:e.description})]},e.id)})})]})]})}let U={GET:"#7bd389",POST:"#4ea1ff",PUT:"#ffb86b",PATCH:"#ffb86b",DELETE:"#ff3860"};function X({markdown:e}){let t=(0,r.useMemo)(()=>(0,A.n$)(e).map((e,t)=>({b:e,i:t})).filter(({b:e})=>(0,A.Vq)(e.kind)).map(({b:e,i:t})=>({id:(0,A.vB)(t),level:(0,A.F8)(e.kind),label:(0,A.kz)(e.text)})).filter(e=>e.label.length>0),[e]),[n,a]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if("u"<typeof IntersectionObserver||0===t.length)return;let e=t.map(e=>document.getElementById(e.id)).filter(e=>null!==e);if(0===e.length)return;let n=new IntersectionObserver(e=>{let t=e.filter(e=>e.isIntersecting).sort((e,t)=>e.boundingClientRect.top-t.boundingClientRect.top);t[0]&&a(t[0].target.id)},{rootMargin:"-12% 0px -70% 0px",threshold:0});return e.forEach(e=>n.observe(e)),()=>n.disconnect()},[t]),(0,s.jsxs)("aside",{className:"flex w-60 shrink-0 flex-col overflow-y-auto border-r border-white/5 bg-background pt-16",children:[(0,s.jsx)("div",{className:"px-4 pb-2 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Sections"}),0===t.length?(0,s.jsx)("p",{className:"px-4 text-[12px] text-muted-foreground/70",children:"No headings in this plan."}):(0,s.jsx)("nav",{className:"space-y-0.5 px-2 pb-6",children:t.map(e=>(0,s.jsx)("button",{onClick:()=>{var t;let n;return t=e.id,void((n=document.getElementById(t))&&(n.scrollIntoView({behavior:"smooth",block:"start"}),a(t)))},title:e.label,style:{paddingLeft:`${.5+.75*e.level}rem`},className:(0,C.cn)("block w-full truncate rounded py-1 pr-2 text-left text-[12px] leading-snug transition-colors",n===e.id?"bg-white/10 font-medium text-foreground":"text-muted-foreground hover:bg-white/[0.05] hover:text-foreground"),children:e.label},e.id))})]})}var B=n(50981),K=n(74350),q=n(4474),G=n(97358);function H({open:e,onOpenChange:t,onConfirmed:n}){let[o,l]=(0,r.useState)("bypassPermissions"),[i,d]=(0,r.useState)(!1);async function c(){d(!0);try{await fetch("/api/preferences",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({planApprovalMode:o})}).catch(()=>{}),t(!1),n()}finally{d(!1)}}return(0,s.jsx)(K.lG,{open:e,onOpenChange:t,children:(0,s.jsxs)(K.Cf,{className:"max-w-lg",children:[(0,s.jsxs)(K.c7,{children:[(0,s.jsxs)(K.L3,{className:"flex items-center gap-2",children:[(0,s.jsx)(B.A,{className:"size-4 text-emerald-400"}),"After approving, the agent should…"]}),(0,s.jsx)(K.rr,{children:"Pick the permission mode your terminal session enters when you approve a plan. We ask once and remember it for every project — change it anytime in Settings."})]}),(0,s.jsx)("div",{className:"space-y-2 py-1",children:G.pC.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>l(e.value),className:(0,C.cn)("flex w-full items-start gap-3 rounded-lg border p-3 text-left transition-colors",o===e.value?"border-emerald-500/50 bg-emerald-500/10":"border-white/10 bg-white/[0.03] hover:bg-white/[0.06]"),children:[(0,s.jsx)("span",{className:(0,C.cn)("mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full border",o===e.value?"border-emerald-400 bg-emerald-400/20":"border-white/30"),children:o===e.value&&(0,s.jsx)(a.A,{className:"size-3 text-emerald-300"})}),(0,s.jsxs)("span",{className:"min-w-0",children:[(0,s.jsx)("span",{className:"block text-sm font-medium text-foreground",children:e.label}),(0,s.jsx)("span",{className:"block text-xs text-muted-foreground",children:e.description})]})]},e.value))}),(0,s.jsxs)(K.Es,{className:"items-center justify-between gap-2 sm:justify-between",children:[(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"You can change this later in Settings."}),(0,s.jsx)(q.$,{onClick:c,disabled:i,size:"sm",children:i?"Saving…":"Save & approve"})]})]})})}var V=n(91930),_=n(26856);function Y({dbProps:e,mapProps:t,planMarkdown:n,forceHistory:c=!1}){let k=(0,j.useRouter)(),{status:N,discard:A}=(0,y.j)(),z=t.nodes.length>0,R=e.tables.length>0||e.endpoints.length>0||(e.draft?.tables.length??0)>0||(e.draft?.endpoints.length??0)>0,[P,M]=(0,r.useState)(z?"map":"db"),O="map"!==P||z?"db"!==P||R?P:"map":"db",[D,T]=(0,r.useState)(!1),[I,$]=(0,r.useState)(!1),[F,U]=(0,r.useState)(null),B=(0,r.useCallback)(async()=>{await fetch("/api/plan/approve",{method:"POST",headers:(0,w.dh)((0,w.X0)())}).catch(()=>{}),U({features:N.features,tables:N.tables,endpoints:N.endpoints})},[N.features,N.tables,N.endpoints]),K=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/preferences",{cache:"no-store"});if((await e.json()).planApprovalModeConfigured)return void B()}catch{B();return}$(!0)},[B]),[q,G]=(0,r.useState)(null),Q=(0,r.useCallback)(e=>G(e),[]),Z=(0,r.useRef)(null),ee=(0,r.useRef)(null),et=(0,r.useRef)(e.draft),[en,es]=(0,r.useState)(!1),er=(0,r.useCallback)(()=>es(!0),[]),[ea,eo]=(0,r.useState)([]),[el,ei]=(0,r.useState)(!1),[ed,ec]=(0,r.useState)(""),eu=(0,r.useCallback)(e=>{ec(e),ei(!0)},[]),em=(0,r.useRef)(ea);(0,r.useEffect)(()=>{em.current=ea},[ea]),(0,r.useEffect)(()=>{eo([]),ei(!1),es(!1)},[N.proposedAt]),(0,r.useEffect)(()=>{let e=()=>void fetch("/api/plan/presence",{method:"POST",cache:"no-store",headers:(0,w.dh)((0,w.X0)())}).catch(()=>{});e();let t=setInterval(e,5e3);return()=>clearInterval(t)},[]);let ex=(0,r.useCallback)(()=>({draft:et.current,questions:em.current}),[]),ep=(0,r.useMemo)(()=>{let n=[];for(let e of t.nodes)n.push(`feature: ${e.title}`);for(let t of e.draft?.tables??[])n.push(`table: ${t.name}`);for(let t of e.tables)n.push(`table: ${t.name}`);for(let t of e.draft?.endpoints??[])n.push(`endpoint: ${t.method} ${t.path}`);for(let t of e.endpoints)n.push(`endpoint: ${t.method} ${t.path}`);return Array.from(new Set(n))},[t.nodes,e]),eh=q?(0,s.jsx)(E,{annotations:q.annotations,updateComment:q.updateComment,removeAnnotation:q.removeAnnotation,focusOnAnnotation:q.focusOnAnnotation,onClose:()=>Z.current?.close()}):null,ef=(0,r.useCallback)(()=>{Z.current?.open()},[]),eg=(0,r.useCallback)(()=>{"db"===O?ee.current?.openComments():Z.current?.openComments()},[O]),eb=(0,r.useCallback)(e=>{q?.addComment(e)},[q]),ev=(0,r.useCallback)(e=>{q?.focusOnAnnotation(e),"db"===O?ee.current?.openComments():Z.current?.openComments()},[q,O]),[ej,ey]=(0,r.useState)(()=>{try{let e=window.localStorage.getItem("beacon:plan-left-pct");return e?Math.max(20,Math.min(80,Number(e))):50}catch{return 50}}),ew=(0,r.useRef)(null),ek=(0,r.useRef)(!1),eN=(0,r.useCallback)(e=>{e.preventDefault(),ek.current=!0,document.body.style.cursor="col-resize",document.body.style.userSelect="none"},[]);(0,r.useEffect)(()=>{let e=e=>{if(!ek.current||!ew.current)return;let t=ew.current.getBoundingClientRect();ey(Math.max(20,Math.min(80,(e.clientX-t.left)/t.width*100)))},t=()=>{if(ek.current){ek.current=!1,document.body.style.cursor="",document.body.style.userSelect="";try{localStorage.setItem("beacon:plan-left-pct",String(ej))}catch{}}};return window.addEventListener("pointermove",e),window.addEventListener("pointerup",t),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",t)}},[ej]);let eC=async()=>{await fetch("/api/plan/annotations",{method:"DELETE",headers:(0,w.dh)((0,w.X0)())}).catch(()=>{}),await A(),k.refresh()};if((!N.pending||c)&&!F)return(0,s.jsx)(L,{pendingPlan:N.pending});let eA=z||R,eS=eA&&!D,ez=!eA||D,eE=((q?.liveCount??0)>0||en||ea.length>0)&&!q?.submitted;return(0,s.jsxs)("div",{className:"relative flex h-screen flex-col",children:[F&&(0,s.jsxs)("div",{className:"absolute inset-0 z-50 flex flex-col items-center justify-center gap-5 bg-background/97 px-6 text-center backdrop-blur-sm",children:[(0,s.jsx)("div",{className:"flex size-12 items-center justify-center rounded-full bg-emerald-500/15",children:(0,s.jsx)(a.A,{className:"size-6 text-emerald-300"})}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:"Plan approved"}),(0,s.jsx)("p",{className:"max-w-sm text-sm text-muted-foreground",children:F.features>0||F.tables>0||F.endpoints>0?"It's committed. Here's where to find it:":"It's archived to your plan history."})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2",children:[F.features>0&&(0,s.jsxs)("button",{onClick:()=>k.push("/map?view=ROADMAP"),className:"flex items-center gap-2 rounded-lg border border-white/12 px-3 py-2 text-sm text-foreground transition-colors hover:bg-white/[0.06]",children:[(0,s.jsx)(o.A,{className:"size-4 text-sky-300"})," ",F.features," feature",1===F.features?"":"s"," → Map"]}),(F.tables>0||F.endpoints>0)&&(0,s.jsxs)("button",{onClick:()=>k.push("/map?view=DATABASE"),className:"flex items-center gap-2 rounded-lg border border-white/12 px-3 py-2 text-sm text-foreground transition-colors hover:bg-white/[0.06]",children:[(0,s.jsx)(l.A,{className:"size-4 text-violet-300"})," ",F.tables," table",1===F.tables?"":"s"," \xb7 ",F.endpoints," endpoint",1===F.endpoints?"":"s"," → Database"]})]}),(0,s.jsx)("button",{onClick:()=>{U(null),k.push((0,w.rc)({view:"history"}))},className:"rounded-full border border-white/12 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-white/[0.06] hover:text-foreground",children:"Done — browse plan history"})]}),q?.submitted&&(0,s.jsxs)("div",{className:"absolute inset-0 z-40 flex flex-col items-center justify-center gap-4 bg-background/95 px-6 text-center backdrop-blur-sm",children:[(0,s.jsx)("div",{className:"flex size-12 items-center justify-center rounded-full bg-sky-500/15",children:(0,s.jsx)(i.A,{className:"size-6 animate-spin text-sky-300"})}),(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:"Feedback sent"}),(0,s.jsx)("p",{className:"max-w-sm text-sm text-muted-foreground",children:"Your terminal session is revising the plan based on your comments. The updated plan will appear here automatically — no need to refresh."})]}),(0,s.jsx)("button",{onClick:()=>k.push((0,w.rc)({view:"history"})),className:"rounded-full border border-white/12 px-3 py-1.5 text-xs font-medium text-muted-foreground transition-colors hover:bg-white/[0.06] hover:text-foreground",children:"Browse past plans"})]}),(0,s.jsxs)("div",{className:"pointer-events-none fixed right-3 top-3 z-30 flex items-center gap-2",children:[eA&&D&&(0,s.jsx)("button",{onClick:()=>T(!1),title:"Collapse — show the board again",className:"glass pointer-events-auto flex size-8 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-white/[0.06] hover:text-foreground",children:(0,s.jsx)(d.A,{className:"size-3.5"})}),(0,s.jsxs)("div",{className:"glass pointer-events-auto flex h-10 items-center gap-0.5 rounded-full px-1",children:[(0,s.jsx)("button",{onClick:()=>k.push((0,w.rc)({view:"history"})),title:"Browse past plans (you can come back to this one)",className:"flex size-8 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-white/[0.06] hover:text-foreground",children:(0,s.jsx)(u,{className:"size-3.5"})}),(0,s.jsx)("span",{"aria-hidden":!0,className:"mx-1 h-5 w-px bg-white/10"}),(0,s.jsx)("button",{onClick:ef,disabled:!q,title:"Open the side panel (details)",className:"relative flex size-8 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-white/[0.06] hover:text-foreground",children:(0,s.jsx)(m.A,{className:"size-3.5"})}),(0,s.jsxs)("button",{onClick:eg,disabled:!q,title:q?.annotationCount?`Open comments \xb7 ${q.annotationCount} comment${1===q.annotationCount?"":"s"} so far`:"Open comments — select a card/table and 'Comment on this', or highlight text",className:"relative flex size-8 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-white/[0.06] hover:text-foreground",children:[(0,s.jsx)(x,{className:"size-3.5"}),q&&(q.annotationCount??0)>0&&(0,s.jsx)("span",{className:"absolute -right-0.5 -top-0.5 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-sky-500 px-1 text-[9px] font-semibold text-white",children:q.annotationCount})]}),(0,s.jsxs)("button",{"data-overall-toggle":!0,onClick:()=>q?.toggleOverall?.(),disabled:!q?.toggleOverall,title:q?.hasGlobalComment?"Edit your overall feedback":"Add overall plan-level feedback",className:(0,C.cn)("relative flex size-8 shrink-0 items-center justify-center rounded-full transition-colors",q?.globalOpen?"bg-white/10 text-foreground":q?.hasGlobalComment?"text-sky-300 hover:bg-sky-500/15":"text-muted-foreground hover:bg-white/[0.06] hover:text-foreground"),children:[(0,s.jsx)(p.A,{className:"size-3.5"}),q?.hasGlobalComment&&(0,s.jsx)("span",{className:"absolute -right-0.5 -top-0.5 size-2 rounded-full bg-sky-400"})]}),(0,s.jsxs)("button",{onClick:()=>ei(e=>!e),title:"Ask the agent a question about a node (answered in its next round)",className:(0,C.cn)("relative flex size-8 shrink-0 items-center justify-center rounded-full transition-colors",el?"bg-white/10 text-foreground":ea.length?"text-sky-300 hover:bg-sky-500/15":"text-muted-foreground hover:bg-white/[0.06] hover:text-foreground"),children:[(0,s.jsx)(h.A,{className:"size-3.5"}),ea.length>0&&(0,s.jsx)("span",{className:"absolute -right-0.5 -top-0.5 flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-sky-500 px-1 text-[9px] font-semibold text-white",children:ea.length})]}),(0,s.jsx)("span",{"aria-hidden":!0,className:"mx-1 h-5 w-px bg-white/10"}),(0,s.jsxs)("button",{onClick:()=>q?.submit(),disabled:!q||q.submitting||0===q.liveCount&&!en&&0===ea.length,title:q&&(0!==q.liveCount||en||0!==ea.length)?q.submitted?"Submitted — your terminal session is reading the feedback":"Submit feedback (comments + canvas edits) so the agent can revise the plan":"Highlight text or edit the canvas, then submit",className:(0,C.cn)("flex shrink-0 items-center gap-1 rounded-full px-2.5 py-1 text-[11px] font-semibold transition-colors",q?.submitted?"text-sky-300":q&&(0!==q.liveCount||en||0!==ea.length)?"text-sky-300 hover:bg-sky-500/15":"text-muted-foreground opacity-50"),children:[q?.submitted?(0,s.jsx)(a.A,{className:"size-3"}):(0,s.jsx)(f.A,{className:"size-3"}),q?.submitted?"Submitted":"Feedback"]}),eE&&(0,s.jsxs)("button",{onClick:()=>{q?.clearAll?.(),es(!1),eo([])},title:"Discard your unsubmitted comments / canvas edits so you can approve the plan as-is",className:"flex shrink-0 items-center gap-1 rounded-full px-2 py-1 text-[11px] font-medium text-amber-300/90 transition-colors hover:bg-amber-500/15",children:[(0,s.jsx)(g.A,{className:"size-3"})," Clear to approve"]}),(0,s.jsxs)("button",{onClick:()=>void K(),disabled:eE,title:eE?"You have unsubmitted feedback — submit it, or click ‘Clear to approve’ to drop it":"Approve the plan",className:(0,C.cn)("flex shrink-0 items-center gap-1 rounded-full border border-emerald-500/40 bg-emerald-500/15 px-2.5 py-1 text-[11px] font-semibold text-emerald-300 transition-colors hover:bg-emerald-500/25",eE&&"opacity-40 hover:bg-emerald-500/15"),children:[(0,s.jsx)(a.A,{className:"size-3"})," Approve"]}),(0,s.jsxs)("button",{onClick:eC,className:"flex shrink-0 items-center gap-1 rounded-full px-2.5 py-1 text-[11px] font-medium text-muted-foreground transition-colors hover:bg-red-500/15 hover:text-red-300",title:"Discard the plan",children:[(0,s.jsx)(b.A,{className:"size-3"})," Discard"]}),(0,s.jsx)(H,{open:I,onOpenChange:$,onConfirmed:()=>void B()})]})]}),el&&(0,s.jsxs)("div",{className:"fixed right-3 top-16 z-30 w-80 rounded-xl border border-white/10 bg-card p-3 shadow-xl",children:[(0,s.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wide text-muted-foreground",children:"Ask the agent"}),(0,s.jsx)("button",{onClick:()=>ei(!1),title:"Close",className:"rounded p-0.5 text-muted-foreground hover:text-foreground",children:(0,s.jsx)(g.A,{className:"size-3.5"})})]}),(0,s.jsx)(J,{targets:ep,initialTarget:ed,onAdd:e=>eo(t=>[...t,e])}),ea.length>0&&(0,s.jsx)("ul",{className:"mt-2 space-y-1",children:ea.map((e,t)=>(0,s.jsxs)("li",{className:"group flex items-start justify-between gap-2 rounded-md border border-white/5 bg-background/40 px-2 py-1",children:[(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("div",{className:"truncate font-mono text-[10px] text-sky-300/90",children:e.target}),(0,s.jsx)("div",{className:"text-[11px] text-foreground/90",children:e.question})]}),(0,s.jsx)("button",{onClick:()=>eo(e=>e.filter((e,n)=>n!==t)),title:"Remove",className:"shrink-0 rounded p-0.5 text-muted-foreground/70 opacity-0 transition-opacity hover:text-red-300 group-hover:opacity-100",children:(0,s.jsx)(g.A,{className:"size-3"})})]},t))}),(0,s.jsx)("p",{className:"mt-2 text-[10px] text-muted-foreground",children:"Questions are sent with your feedback on Submit — the agent answers them in its next round."})]}),(0,s.jsxs)("div",{ref:ew,className:"flex min-h-0 flex-1",children:[ez&&(0,s.jsx)(X,{markdown:n}),(0,s.jsxs)("div",{className:(0,C.cn)("relative flex min-w-0 flex-col",!eS&&"flex-1"),style:eS?{width:`${ej}%`}:void 0,children:[eS&&(0,s.jsx)("div",{className:"pointer-events-none absolute right-3 top-3 z-20",children:(0,s.jsx)("button",{onClick:()=>T(!0),title:"Expand the plan to full width",className:"glass pointer-events-auto flex size-8 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-white/[0.06] hover:text-foreground",children:(0,s.jsx)(v.A,{className:"size-3.5"})})}),(0,s.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden bg-background",children:(0,s.jsx)(S,{markdown:n,round:N.proposedAt,onApi:Q,hideSubmit:!0,getExtraSubmitPayload:ex})})]}),eS&&(0,s.jsx)("div",{onPointerDown:eN,className:"group relative w-px shrink-0 cursor-col-resize bg-white/5 hover:bg-white/15",title:"Drag to resize",children:(0,s.jsx)("div",{className:"absolute inset-y-0 -left-1.5 right-[-6px] z-10"})}),eS&&(0,s.jsxs)("div",{className:"relative flex min-w-0 flex-col",style:{width:`${100-ej}%`},children:[z&&R&&(0,s.jsx)("div",{className:"pointer-events-none absolute left-3 top-3 z-20",children:(0,s.jsxs)("div",{className:"glass pointer-events-auto flex items-center gap-1 rounded-full p-0.5",children:[(0,s.jsx)(W,{active:"map"===O,onClick:()=>M("map"),icon:(0,s.jsx)(o.A,{className:"size-3"}),children:"Map"}),(0,s.jsx)(W,{active:"db"===O,onClick:()=>M("db"),icon:(0,s.jsx)(l.A,{className:"size-3"}),children:"Database"})]})}),(0,s.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden bg-background",children:"map"===O?(0,s.jsx)(V.MapClient,{view:t.view,nodes:t.nodes,edges:t.edges,embedded:!0,commentsContent:eh,commentsCount:q?.annotationCount??0,controlRef:Z,onAskAgent:eu,onAddComment:eb,annotations:q?.annotations,onPinClick:ev,onUpdateComment:q?.updateComment,onRemoveComment:q?.removeAnnotation}):(0,s.jsx)(_.DbMapClient,{tables:e.tables,relations:e.relations,endpoints:e.endpoints,draft:e.draft,workspaceId:e.workspaceId,embedded:!0,draftRef:et,onEdit:er,controlRef:ee,commentsContent:eh,commentsCount:q?.annotationCount??0,onAddComment:eb,annotations:q?.annotations,onPinClick:ev,onUpdateComment:q?.updateComment,onRemoveComment:q?.removeAnnotation})})]})]})]})}function J({targets:e,onAdd:t,initialTarget:n}){let[a,o]=(0,r.useState)(n||e[0]||""),[l,i]=(0,r.useState)("");(0,r.useEffect)(()=>{n&&o(n)},[n]),(0,r.useEffect)(()=>{!a&&e[0]&&o(e[0])},[e,a]);let d=()=>{let e=l.trim();e&&(t({target:a||"(plan)",question:e}),i(""))};return(0,s.jsxs)("div",{className:"space-y-1.5",children:[e.length>0&&(0,s.jsx)("select",{value:a,onChange:e=>o(e.target.value),className:"w-full rounded border border-white/10 bg-background px-2 py-1 text-[11px] outline-none focus:border-sky-400/40",children:e.map(e=>(0,s.jsx)("option",{value:e,className:"bg-card",children:e},e))}),(0,s.jsx)("textarea",{value:l,onChange:e=>i(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),d())},rows:2,placeholder:"e.g. why a new table instead of reusing users? (⌘/Ctrl+Enter to add)",className:"w-full resize-y rounded border border-white/10 bg-background px-2 py-1.5 text-[12px] leading-snug outline-none focus:border-sky-400/40"}),(0,s.jsx)("button",{onClick:d,disabled:!l.trim(),className:(0,C.cn)("w-full rounded-md px-2 py-1 text-[11px] font-semibold transition-colors",l.trim()?"bg-sky-500/15 text-sky-300 hover:bg-sky-500/25":"text-muted-foreground opacity-50"),children:"Add question"})]})}function W({active:e,onClick:t,icon:n,children:r}){return(0,s.jsxs)("button",{onClick:t,className:(0,C.cn)("flex items-center gap-1 rounded-md px-2.5 py-1 text-[11px] font-medium transition-colors",e?"bg-white/10 text-foreground":"text-muted-foreground hover:text-foreground"),children:[n,r]})}},22137:(e,t,n)=>{Promise.resolve().then(n.bind(n,10396))},38332:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});let s=(0,n(30772).A)("strikethrough",[["path",{d:"M16 4H9a3 3 0 0 0-2.83 4",key:"43sutm"}],["path",{d:"M14 12a4 4 0 0 1 0 8H6",key:"nlfj13"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]])},48484:(e,t,n)=>{"use strict";n.d(t,{PlanProvider:()=>d,j:()=>c});var s=n(95155),r=n(12115),a=n(73321),o=n(99979);let l={pending:!1,proposedAt:0,tables:0,endpoints:0,features:0},i=(0,r.createContext)(null);function d({children:e}){let t=(0,a.useRouter)(),[n,c]=(0,r.useState)(l),u=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/plan",{method:"GET",cache:"no-store",headers:(0,o.dh)((0,o.X0)())});if(!e.ok)return;let t=await e.json();c(t)}catch{}},[]);(0,r.useEffect)(()=>{u();let e=setInterval(()=>void u(),4e3);return()=>clearInterval(e)},[u]);let m=(0,r.useCallback)(async()=>{await fetch("/api/plan",{method:"DELETE",headers:(0,o.dh)((0,o.X0)())}).catch(()=>{}),c(l),t.refresh()},[t]),x=(0,r.useCallback)(async()=>{await fetch("/api/plan/approve",{method:"POST",headers:(0,o.dh)((0,o.X0)())}).catch(()=>{}),c(l),t.refresh()},[t]);return(0,s.jsx)(i.Provider,{value:{status:n,discard:m,approvePlan:x,refresh:u},children:e})}function c(){let e=(0,r.useContext)(i);if(!e)throw Error("usePlan must be used inside PlanProvider");return e}},50981:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});let s=(0,n(30772).A)("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},82879:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});let s=(0,n(30772).A)("sticky-note",[["path",{d:"M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",key:"1dfntj"}],["path",{d:"M15 3v5a1 1 0 0 0 1 1h5",key:"6s6qgf"}]])},92571:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});let s=(0,n(30772).A)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},97358:(e,t,n)=>{"use strict";n.d(t,{pC:()=>s});let s=[{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+)."}]},99979:(e,t,n)=>{"use strict";function s(){return new URLSearchParams(window.location.search).get("ws")}function r(e){return e?{"x-beacon-workspace":e}:{}}function a(e){let t=new URLSearchParams,n=s();for(let[s,r]of(n&&t.set("ws",n),Object.entries(e??{})))t.set(s,r);let r=t.toString();return r?`/plan?${r}`:"/plan"}n.d(t,{X0:()=>s,dh:()=>r,rc:()=>a})}},e=>{e.O(0,[2574,3862,8500,4294,766,1202,4779,8441,3794,7358],()=>e(e.s=22137)),_N_E=e.O()}]);