@a5c-ai/babysitter-observer-dashboard 5.0.1-staging.69cb593ea → 5.0.1-staging.69cb593ea536

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 (70) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/build-manifest.json +3 -3
  3. package/.next/fallback-build-manifest.json +3 -3
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/required-server-files.json +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/__PAGE__.segment.rsc +1 -1
  9. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  11. package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  14. package/.next/server/app/_not-found.html +1 -1
  15. package/.next/server/app/_not-found.rsc +11 -11
  16. package/.next/server/app/_not-found.segments/_full.segment.rsc +11 -11
  17. package/.next/server/app/_not-found.segments/_head.segment.rsc +4 -4
  18. package/.next/server/app/_not-found.segments/_index.segment.rsc +6 -6
  19. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  20. package/.next/server/app/_not-found.segments/_not-found.segment.rsc +3 -3
  21. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  22. package/.next/server/app/api/config/route.js.nft.json +1 -1
  23. package/.next/server/app/api/digest/route.js.nft.json +1 -1
  24. package/.next/server/app/api/runs/[runId]/events/route.js.nft.json +1 -1
  25. package/.next/server/app/api/runs/[runId]/route.js.nft.json +1 -1
  26. package/.next/server/app/api/runs/[runId]/tasks/[effectId]/route.js.nft.json +1 -1
  27. package/.next/server/app/api/runs/route.js.nft.json +1 -1
  28. package/.next/server/app/api/stream/route.js.nft.json +1 -1
  29. package/.next/server/app/index.html +1 -1
  30. package/.next/server/app/index.rsc +13 -13
  31. package/.next/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  32. package/.next/server/app/index.segments/_full.segment.rsc +13 -13
  33. package/.next/server/app/index.segments/_head.segment.rsc +4 -4
  34. package/.next/server/app/index.segments/_index.segment.rsc +6 -6
  35. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  36. package/.next/server/app/page/server-reference-manifest.json +1 -1
  37. package/.next/server/app/page.js.nft.json +1 -1
  38. package/.next/server/app/page_client-reference-manifest.js +1 -1
  39. package/.next/server/app/runs/[runId]/page/react-loadable-manifest.json +1 -1
  40. package/.next/server/app/runs/[runId]/page/server-reference-manifest.json +1 -1
  41. package/.next/server/app/runs/[runId]/page.js.nft.json +1 -1
  42. package/.next/server/app/runs/[runId]/page_client-reference-manifest.js +1 -1
  43. package/.next/server/chunks/[root-of-the-server]__0kdfw4x._.js +1 -1
  44. package/.next/server/chunks/[root-of-the-server]__0kdfw4x._.js.map +1 -1
  45. package/.next/server/chunks/ssr/[root-of-the-server]__006f7~t._.js +1 -1
  46. package/.next/server/chunks/ssr/[root-of-the-server]__0cpy61n._.js +1 -1
  47. package/.next/server/chunks/ssr/[root-of-the-server]__0cpy61n._.js.map +1 -1
  48. package/.next/server/chunks/ssr/[root-of-the-server]__0cwa32j._.js +1 -1
  49. package/.next/server/chunks/ssr/[root-of-the-server]__0cwa32j._.js.map +1 -1
  50. package/.next/server/chunks/ssr/_0wrbwro._.js +1 -1
  51. package/.next/server/chunks/ssr/_0wrbwro._.js.map +1 -1
  52. package/.next/server/chunks/ssr/packages_observer-dashboard_src_components_providers_tsx_03_vrrn._.js +1 -1
  53. package/.next/server/chunks/ssr/packages_observer-dashboard_src_components_providers_tsx_03_vrrn._.js.map +1 -1
  54. package/.next/server/middleware-build-manifest.js +3 -3
  55. package/.next/server/pages/404.html +1 -1
  56. package/.next/server/pages/500.html +1 -1
  57. package/.next/server/server-reference-manifest.js +1 -1
  58. package/.next/server/server-reference-manifest.json +2 -2
  59. package/.next/static/chunks/000hw8nxjx.vb.js +1 -0
  60. package/.next/static/chunks/{0pz50_eb4w65d.js → 0_cy8bu_bft_5.js} +1 -1
  61. package/.next/static/chunks/0o5~3-h4mum5j.js +1 -0
  62. package/.next/static/chunks/{0zf5eassysmop.js → 0omakh0w7wy6c.js} +1 -1
  63. package/.next/static/chunks/{176.275d7k6ec.js → 0sw5vb.l_4v6s.js} +1 -1
  64. package/.next/static/chunks/{09ze1k0g3l6h~.js → 0~6i.7w.a-0js.js} +1 -1
  65. package/package.json +1 -1
  66. package/.next/static/chunks/0ttye155r7iod.js +0 -1
  67. package/.next/static/chunks/0v2atacdv1f4y.js +0 -1
  68. /package/.next/static/{ZHstK_arkd5Lrq2DUJeCT → WkdZV5tOMJsApP9g9lEZ1}/_buildManifest.js +0 -0
  69. /package/.next/static/{ZHstK_arkd5Lrq2DUJeCT → WkdZV5tOMJsApP9g9lEZ1}/_clientMiddlewareManifest.js +0 -0
  70. /package/.next/static/{ZHstK_arkd5Lrq2DUJeCT → WkdZV5tOMJsApP9g9lEZ1}/_ssgManifest.js +0 -0
@@ -2,6 +2,6 @@ module.exports=[843881,a=>{"use strict";let b,c,d,e;var f,g,h,i,j,k,l,m=a.i(1879
2
2
 
3
3
  If you want to hide the \`${b.titleName}\`, you can wrap it with our VisuallyHidden component.
4
4
 
5
- For more information, see https://radix-ui.com/primitives/docs/components/${b.docsSlug}`;return n.useEffect(()=>{a&&(document.getElementById(a)||console.error(c))},[c,a]),null},a8=({contentRef:a,descriptionId:b})=>{let c=a6("DialogDescriptionWarning"),d=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${c.contentName}}.`;return n.useEffect(()=>{let c=a.current?.getAttribute("aria-describedby");b&&c&&(document.getElementById(b)||console.warn(d))},[d,a,b]),null},a9=a.i(848953);function ba({children:a,className:b}){return(0,m.jsx)("kbd",{className:(0,a9.cn)("inline-flex h-5 min-w-[20px] items-center justify-center rounded","border border-[var(--kbd-border)] bg-background-secondary","px-1.5 font-mono text-xs leading-tight text-foreground-muted","shadow-kbd",b),children:a})}var bb=a.i(735660),bc=a.i(814225);let bd=[{keys:["?"],description:"Show this help",context:"global"},{keys:["n"],description:"Toggle notifications",context:"global"},{keys:["/"],description:"Focus search",context:"dashboard"},{keys:["j"],description:"Next item",context:"run-detail"},{keys:["k"],description:"Previous item",context:"run-detail"},{keys:["Enter"],description:"Open selected",context:"run-detail"},{keys:["Esc"],description:"Go back / Close",context:"run-detail"},{keys:["e"],description:"Toggle event stream",context:"run-detail"},{keys:["1"],description:"Agent tab",context:"run-detail"},{keys:["2"],description:"Timing tab",context:"run-detail"},{keys:["3"],description:"Logs tab",context:"run-detail"},{keys:["4"],description:"Data tab",context:"run-detail"},{keys:["5"],description:"Approval tab",context:"run-detail"}],be={global:"Global",dashboard:"Dashboard","run-detail":"Run Detail"};function bf(){let[a,b]=(0,n.useState)(!1),c=(0,v.usePathname)(),d=c?.startsWith("/runs/")??!1;(0,bc.useKeyboard)([{key:"?",action:()=>b(!0),description:"Show shortcuts help"},{key:"Escape",action:()=>b(!1),description:"Close shortcuts help"}]),(0,n.useEffect)(()=>{let a=()=>b(!0);return window.addEventListener("open-shortcuts-help",a),()=>window.removeEventListener("open-shortcuts-help",a)},[]);let e=bd.filter(a=>"global"===a.context||"dashboard"===a.context&&!d||"run-detail"===a.context&&!!d).reduce((a,b)=>((a[b.context]??=[]).push(b),a),{});return(0,m.jsx)(aK,{open:a,onOpenChange:b,children:(0,m.jsxs)(aP,{children:[(0,m.jsx)(aR,{className:"fixed inset-0 z-50 bg-black/70 backdrop-blur-sm"}),(0,m.jsxs)(aV,{className:"fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2 rounded-lg border border-[var(--glass-border)] bg-[var(--glass-bg)] backdrop-blur-xl p-6 shadow-glass w-full max-w-md",children:[(0,m.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,m.jsx)(a$,{className:"text-sm font-medium text-foreground",children:"Keyboard Shortcuts"}),(0,m.jsx)(a2,{asChild:!0,children:(0,m.jsx)("button",{className:"rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-primary transition-colors",children:(0,m.jsx)(bb.X,{className:"h-4 w-4"})})})]}),(0,m.jsx)("div",{className:"space-y-4",children:Object.entries(e).map(([a,b])=>(0,m.jsxs)("div",{children:[(0,m.jsx)("h3",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:be[a]??a}),(0,m.jsx)("div",{className:"space-y-2",children:b.map(({keys:a,description:b})=>(0,m.jsxs)("div",{className:"flex items-center justify-between py-1",children:[(0,m.jsx)("span",{className:"text-sm text-foreground-secondary",children:b}),(0,m.jsx)("div",{className:"flex items-center gap-1",children:a.map(a=>(0,m.jsx)(ba,{children:a},a))})]},b))})]},a))})]})]})})}var bg=a.i(238246),bh=a.i(399549),bi=a.i(133313),bj=a.i(172688),bk=a.i(492924),bl=a.i(57703);let bm=(0,bl.default)("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);var bn=a.i(676321);let bo={success:(0,m.jsx)(bh.CheckCircle2,{className:"h-4 w-4 text-success drop-shadow-[var(--drop-glow-success)]"}),error:(0,m.jsx)(bi.XCircle,{className:"h-4 w-4 text-error drop-shadow-[var(--drop-glow-error)]"}),warning:(0,m.jsx)(bj.AlertTriangle,{className:"h-4 w-4 text-warning drop-shadow-[var(--drop-glow-warning)]"}),info:(0,m.jsx)(bk.Info,{className:"h-4 w-4 text-info drop-shadow-[var(--drop-glow-cyan)]"})},bp={success:"border-l-success",error:"border-l-error",warning:"border-l-warning",info:"border-l-info"};function bq({open:a,notifications:b,onDismiss:c,onClose:d}){let e=(0,v.useRouter)();return(0,m.jsx)(aK,{open:a,onOpenChange:a=>{a||d()},children:(0,m.jsxs)(aP,{children:[(0,m.jsx)(aR,{className:"fixed inset-0 z-50 bg-black/70 backdrop-blur-sm"}),(0,m.jsxs)(aV,{"data-testid":"notification-panel",className:"fixed right-4 top-4 z-50 rounded-lg border border-[var(--glass-border)] bg-[var(--glass-bg)] backdrop-blur-xl shadow-glass w-full max-w-md max-h-[80vh] flex flex-col",children:[(0,m.jsxs)("div",{className:"flex items-center justify-between p-4 border-b border-[var(--glass-border-subtle)]",children:[(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)(bm,{className:"h-4 w-4 text-primary/60"}),(0,m.jsx)(a$,{className:"text-sm font-medium text-foreground",children:"Notifications"}),b.length>0&&(0,m.jsxs)("span",{className:"text-xs text-primary/70 font-mono",children:["(",b.length,")"]})]}),(0,m.jsx)(a2,{asChild:!0,children:(0,m.jsx)("button",{className:"rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-primary transition-colors",children:(0,m.jsx)(bb.X,{className:"h-4 w-4"})})})]}),(0,m.jsx)("div",{className:"flex-1 overflow-y-auto p-2",children:0===b.length?(0,m.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-foreground-muted",children:[(0,m.jsx)(bm,{className:"h-8 w-8 mb-2 opacity-50"}),(0,m.jsx)("p",{className:"text-sm",children:"No notifications"})]}):(0,m.jsx)("div",{className:"space-y-2",children:b.map(a=>{var b;let f,g,h;return(0,m.jsx)("div",{"data-testid":`notification-item-${a.id}`,className:(0,a9.cn)("rounded-lg border border-[var(--glass-border-faint)] bg-[var(--glass-card-bg)] p-3 border-l-2","transition-colors duration-150",a.href&&"cursor-pointer hover:bg-[var(--glass-border-faint)]",bp[a.type]),onClick:()=>{a.href&&(e.push(a.href),c(a.id),d())},children:(0,m.jsxs)("div",{className:"flex items-start gap-2",children:[(0,m.jsx)("div",{className:"shrink-0 mt-0.5",children:bo[a.type]}),a.persistent&&(0,m.jsx)("span",{title:"Pinned — won't auto-dismiss",className:"shrink-0",children:(0,m.jsx)(bn.Pin,{className:"h-3 w-3 text-primary/50"})}),(0,m.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,m.jsx)("p",{className:"text-sm font-medium text-foreground",children:a.title}),(0,m.jsx)("p",{className:"text-xs text-foreground-muted mt-0.5",children:a.body}),(0,m.jsxs)("p",{className:"text-xs text-foreground-muted mt-1 opacity-70",children:[(b=a.timestamp,h=Math.floor((g=Math.floor((f=Math.floor((Date.now()-b)/1e3))/60))/60),f<60?"just now":g<60?`${g}m ago`:h<24?`${h}h ago`:new Date(b).toLocaleString()),a.persistent&&(0,m.jsx)("span",{className:"text-primary/50 ml-1",children:"· Pinned"})]})]}),(0,m.jsx)("button",{onClick:b=>{b.stopPropagation(),c(a.id)},className:"shrink-0 rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-primary transition-colors",children:(0,m.jsx)(bb.X,{className:"h-3.5 w-3.5"})})]})},a.id)})})})]})]})})}let br=(0,bl.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var bs=a.i(2468);let bt=(0,bl.default)("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]),bu=(0,bl.default)("Palette",[["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:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]),bv=(0,bl.default)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),bw=(0,bl.default)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var bx=a.i(77317),by=a.i(46193);let bz=(0,bl.default)("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);var bA=a.i(10169),bB=a.i(885410),bC=a.i(620498);function bD({open:a,onClose:b}){let{theme:c,toggle:d}=p(),[e,f]=(0,n.useState)(null),[g,h]=(0,n.useState)(null),[i,j]=(0,n.useState)(!1),[k,l]=(0,n.useState)([]),[o,q]=(0,n.useState)(2e3),[r,s]=(0,n.useState)("dark"),[t,u]=(0,n.useState)(30),[v,w]=(0,n.useState)([]),[x,y]=(0,n.useState)([]),[z,A]=(0,n.useState)(!1),[B,C]=(0,n.useState)(null),[D,E]=(0,n.useState)(null),F=(0,n.useRef)(null),G=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!a)return;j(!0),h(null),C(null),E(null),F.current?.abort(),F.current=new AbortController;let b=F.current.signal;return Promise.all([(0,bC.resilientFetch)("/api/config",{signal:b}),(0,bC.resilientFetch)("/api/runs?mode=projects",{signal:b})]).then(([a,b])=>{if(!a.ok){if(a.error.isAborted)return;h(a.error.message);return}let c=a.data;f(c),l(c.sources.map(a=>({...a}))),q(c.pollInterval),s(c.theme),u(c.retentionDays),w(c.hiddenProjects??[]),y(Array.from(new Set([...b.ok?b.data.projects.map(a=>a.projectName):[],...c.hiddenProjects??[]])).sort())}).finally(()=>j(!1)),()=>{F.current?.abort(),G.current?.abort()}},[a]);let H=(0,n.useCallback)((a,b,c)=>{l(d=>d.map((d,e)=>e===a?{...d,[b]:c}:d))},[]),I=(0,n.useCallback)(a=>{l(b=>b.filter((b,c)=>c!==a))},[]),J=(0,n.useCallback)(()=>{l(a=>[...a,{path:"",depth:2}])},[]),K=(0,n.useCallback)(()=>{e&&(l(e.sources.map(a=>({...a}))),q(e.pollInterval),s(e.theme),u(e.retentionDays),w(e.hiddenProjects??[])),C(null),E(null)},[e]),L=(0,n.useCallback)(async()=>{A(!0),C(null),E(null),G.current?.abort(),G.current=new AbortController;let a=await (0,bC.resilientFetch)("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sources:k.filter(a=>a.path.trim()),pollInterval:o,theme:r,retentionDays:t,hiddenProjects:v}),signal:G.current.signal});if(!a.ok){if(a.error.isAborted)return;C("error"),E(a.error.message),A(!1);return}let b=a.data;f(b),l(b.sources.map(a=>({...a}))),q(b.pollInterval),s(b.theme),u(b.retentionDays),w(b.hiddenProjects??[]),C("success"),b.theme!==c&&d(),setTimeout(()=>C(null),2e3),A(!1)},[k,o,r,t,v,c,d]),M=e&&(JSON.stringify(k)!==JSON.stringify(e.sources)||o!==e.pollInterval||r!==e.theme||t!==e.retentionDays||JSON.stringify(v.slice().sort())!==JSON.stringify((e.hiddenProjects??[]).slice().sort()));return(0,m.jsx)(aK,{open:a,onOpenChange:a=>{a||b()},children:(0,m.jsxs)(aP,{children:[(0,m.jsx)(aR,{className:"fixed inset-0 z-50 bg-black/60"}),(0,m.jsx)(aV,{className:"fixed inset-0 z-50 flex items-center justify-center p-4","data-testid":"settings-modal",children:(0,m.jsxs)("div",{className:"relative z-50 rounded-lg border border-border bg-card shadow-xl w-full max-w-lg max-h-[80vh] flex flex-col",children:[(0,m.jsxs)("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)(br,{className:"h-4 w-4 text-foreground-muted"}),(0,m.jsx)(a$,{className:"text-sm font-medium text-foreground",children:"Settings"})]}),(0,m.jsx)(a2,{asChild:!0,children:(0,m.jsx)("button",{className:"rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-foreground transition-colors",children:(0,m.jsx)(bb.X,{className:"h-4 w-4"})})})]}),(0,m.jsx)(a0,{asChild:!0,children:(0,m.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:i?(0,m.jsxs)("div",{className:"flex items-center justify-center py-12 text-foreground-muted",children:[(0,m.jsx)(bx.Loader2,{className:"h-4 w-4 animate-spin mr-2"}),(0,m.jsx)("p",{className:"text-sm",children:"Loading configuration..."})]}):g?(0,m.jsxs)("div",{className:"rounded-lg border border-error/20 bg-error-muted p-3 text-sm text-error",children:["Failed to load config: ",g]}):e?(0,m.jsxs)("div",{className:"space-y-5",children:[(0,m.jsxs)("section",{children:[(0,m.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,m.jsx)(bs.FolderOpen,{className:"h-4 w-4 text-foreground-muted"}),(0,m.jsx)("span",{className:"text-xs font-medium text-foreground-secondary",children:"Watch Sources"})]}),(0,m.jsx)("div",{className:"space-y-2",children:k.map((a,b)=>(0,m.jsxs)("div",{className:"rounded-md border border-border bg-background p-2.5 space-y-2",children:[(0,m.jsxs)("div",{className:"flex items-start gap-2",children:[(0,m.jsxs)("div",{className:"flex-1",children:[(0,m.jsx)("label",{className:"text-xs uppercase tracking-wider text-foreground-muted mb-1 block",children:"Path"}),(0,m.jsx)("input",{type:"text",value:a.path,onChange:a=>H(b,"path",a.target.value),placeholder:"/path/to/projects",className:"w-full rounded-md border border-border bg-background-secondary px-2.5 py-1.5 font-mono text-xs text-foreground placeholder:text-foreground-muted/50 focus:outline-none focus:ring-1 focus:ring-primary/50"})]}),(0,m.jsx)("button",{onClick:()=>I(b),className:"mt-4 rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-error hover:bg-error/10 transition-colors",title:"Remove source",children:(0,m.jsx)(bw,{className:"h-3.5 w-3.5"})})]}),(0,m.jsx)("div",{className:"flex items-center gap-3",children:(0,m.jsxs)("div",{className:"w-20",children:[(0,m.jsx)("label",{className:"text-xs uppercase tracking-wider text-foreground-muted mb-1 block",children:"Depth"}),(0,m.jsx)("input",{type:"number",value:a.depth,onChange:a=>H(b,"depth",Math.max(0,Math.min(10,parseInt(a.target.value)||0))),min:0,max:10,className:"w-full rounded-md border border-border bg-background-secondary px-2.5 py-1.5 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary/50"})]})})]},b))}),(0,m.jsxs)("button",{onClick:J,className:"mt-2 flex items-center gap-1.5 rounded-md px-2.5 py-1.5 min-h-[44px] text-xs text-foreground-muted hover:text-foreground hover:bg-background-secondary transition-colors",children:[(0,m.jsx)(bv,{className:"h-3.5 w-3.5"}),"Add Source"]})]}),(0,m.jsxs)("section",{children:[(0,m.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,m.jsx)(bt,{className:"h-4 w-4 text-foreground-muted"}),(0,m.jsx)("span",{className:"text-xs font-medium text-foreground-secondary",children:"Poll Interval"})]}),(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)("input",{type:"number",value:o,onChange:a=>q(Math.max(500,parseInt(a.target.value)||500)),min:500,step:500,className:"w-28 rounded-md border border-border bg-background-secondary px-2.5 py-1.5 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,m.jsx)("span",{className:"text-xs text-foreground-muted",children:"ms"})]})]}),(0,m.jsxs)("section",{children:[(0,m.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,m.jsx)(bu,{className:"h-4 w-4 text-foreground-muted"}),(0,m.jsx)("span",{className:"text-xs font-medium text-foreground-secondary",children:"Theme"})]}),(0,m.jsx)("div",{className:"flex rounded-md border border-border overflow-hidden",children:["dark","light"].map(a=>(0,m.jsx)("button",{onClick:()=>s(a),className:(0,a9.cn)("flex-1 px-4 py-1.5 min-h-[44px] text-xs font-medium transition-colors capitalize",r===a?"bg-primary/15 text-primary":"bg-background-secondary text-foreground-muted hover:text-foreground"),children:a},a))})]}),(0,m.jsxs)("section",{children:[(0,m.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,m.jsx)(bz,{className:"h-4 w-4 text-foreground-muted"}),(0,m.jsx)("span",{className:"text-xs font-medium text-foreground-secondary",children:"Run Retention"})]}),(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)("span",{className:"text-xs text-foreground-muted",children:"Show runs from the last"}),(0,m.jsx)("input",{type:"number",value:t,onChange:a=>u(Math.max(1,Math.min(365,parseInt(a.target.value)||30))),min:1,max:365,className:"w-20 rounded-md border border-border bg-background-secondary px-2.5 py-1.5 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,m.jsx)("span",{className:"text-xs text-foreground-muted",children:"days"})]}),(0,m.jsx)("p",{className:"text-xs text-foreground-muted mt-1.5",children:"Older completed/failed runs are hidden from the dashboard. Active runs are always shown."})]}),x.length>0&&(0,m.jsxs)("section",{children:[(0,m.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,m.jsx)(bA.Eye,{className:"h-4 w-4 text-foreground-muted"}),(0,m.jsx)("span",{className:"text-xs font-medium text-foreground-secondary",children:"Project Visibility"})]}),(0,m.jsx)("p",{className:"text-xs text-foreground-muted mb-2",children:"Hidden projects will not appear on the dashboard."}),(0,m.jsx)("div",{className:"space-y-1",children:x.map(a=>{let b=v.includes(a);return(0,m.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border bg-background px-2.5 py-1.5",children:[(0,m.jsx)("span",{className:(0,a9.cn)("text-xs font-mono truncate",b?"text-foreground-muted line-through":"text-foreground"),children:a}),(0,m.jsx)("button",{onClick:()=>{w(c=>b?c.filter(b=>b!==a):[...c,a])},className:(0,a9.cn)("rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center transition-colors",b?"text-foreground-muted hover:text-foreground hover:bg-background-secondary":"text-foreground-secondary hover:text-foreground-muted hover:bg-background-secondary"),title:b?"Show project":"Hide project",children:b?(0,m.jsx)(bB.EyeOff,{className:"h-3.5 w-3.5"}):(0,m.jsx)(bA.Eye,{className:"h-3.5 w-3.5"})})]},a)})})]}),"success"===B&&(0,m.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-success/20 bg-success/5 px-3 py-2 text-xs text-success",children:[(0,m.jsx)(by.Check,{className:"h-3.5 w-3.5"}),"Settings saved successfully"]}),"error"===B&&(0,m.jsx)("div",{className:"rounded-md border border-error/20 bg-error/5 px-3 py-2 text-xs text-error",children:D||"Failed to save settings"})]}):null})}),e&&(0,m.jsxs)("div",{className:"flex items-center justify-between border-t border-border px-4 py-3",children:[(0,m.jsxs)("p",{className:"text-xs text-foreground-muted",children:["Config file: ",(0,m.jsx)("span",{className:"font-mono",children:"~/.a5c/observer.json"})]}),(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)("button",{onClick:K,disabled:z,className:"rounded-md px-3 py-1.5 min-h-[44px] text-xs text-foreground-muted hover:text-foreground hover:bg-background-secondary transition-colors disabled:opacity-50",children:"Cancel"}),(0,m.jsx)("button",{onClick:L,disabled:z||!M,className:(0,a9.cn)("rounded-md px-3 py-1.5 min-h-[44px] text-xs font-medium transition-colors",M?"bg-primary text-primary-foreground hover:bg-primary/90":"bg-background-secondary text-foreground-muted cursor-not-allowed",z&&"opacity-50"),children:z?(0,m.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,m.jsx)(bx.Loader2,{className:"h-3 w-3 animate-spin"}),"Saving..."]}):"Save"})]})]})]})})]})})}let bE=(0,bl.default)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),bF=(0,bl.default)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),bG=(0,bl.default)("HelpCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),bH=(0,bl.default)("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]),bI=(0,bl.default)("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),bJ=(0,bl.default)("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);function bK(){let{theme:a,toggle:b}=p(),{connected:c}=(0,s.useEventStream)(),{notifications:d,dismiss:e}=(0,r.useNotificationContext)(),[f,g]=(0,n.useState)(!1),[h,i]=(0,n.useState)(!1),j=(0,n.useCallback)(()=>{g(a=>!a)},[]);return(0,bc.useKeyboard)([{key:"n",action:j,description:"Toggle notifications"}]),(0,n.useEffect)(()=>{let a=()=>i(!0);return window.addEventListener("open-settings",a),()=>window.removeEventListener("open-settings",a)},[]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:top-2 focus:left-2 focus:z-[100] focus:px-4 focus:py-2 focus:bg-primary focus:text-primary-foreground focus:rounded-md",children:"Skip to main content"}),(0,m.jsx)("header",{className:"sticky top-0 z-30 border-b border-border bg-background/80 backdrop-blur-md",children:(0,m.jsxs)("div",{className:"mx-auto max-w-[1600px] px-6 py-3 flex items-center gap-3",children:[(0,m.jsx)(bA.Eye,{className:"h-5 w-5 text-primary"}),(0,m.jsx)("h1",{className:"text-base font-semibold",children:(0,m.jsx)(bg.default,{href:"/",className:"text-foreground hover:text-primary transition-colors",children:"Babysitter Observer"})}),(0,m.jsx)("a",{href:"https://www.a5c.ai/",target:"_blank",rel:"noopener noreferrer",className:"text-xs leading-tight font-medium text-primary/60 hover:text-primary transition-colors hidden sm:block",children:"a5c.ai"}),(0,m.jsx)("a",{href:"https://github.com/a5c-ai/babysitter",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-foreground-muted hover:text-foreground-secondary transition-colors hidden sm:block",title:"Babysitter on GitHub",children:(0,m.jsx)(bJ,{className:"h-3.5 w-3.5"})}),(0,m.jsx)("span",{className:"text-xs text-foreground-muted hidden md:block",children:"Real-time orchestration dashboard"}),(0,m.jsxs)("div",{className:"ml-auto flex items-center gap-1.5",children:[(0,m.jsxs)("span",{"data-testid":"sse-status",role:"status","aria-live":"polite",className:(0,a9.cn)("inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium mr-1 transition-all",c?"bg-success/10 text-success border border-success/20":"bg-error/10 text-error border border-error/20"),title:c?"Live updates connected":"Live updates disconnected",children:[c?(0,m.jsx)(bH,{className:"h-3 w-3"}):(0,m.jsx)(bI,{className:"h-3 w-3"}),(0,m.jsx)("span",{className:"hidden sm:inline",children:c?"Live":"Offline"})]}),(0,m.jsxs)("button",{"data-testid":"notification-bell",onClick:j,className:"relative rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-foreground-secondary hover:bg-background-secondary transition-colors",title:"Notifications","aria-label":`Notifications${d.length>0?` (${d.length} unread)`:""}`,children:[(0,m.jsx)(bm,{className:"h-4 w-4"}),d.length>0&&(0,m.jsx)("span",{"data-testid":"notification-badge",className:"absolute -top-0.5 -right-0.5 flex h-4 w-4 items-center justify-center rounded-full bg-primary text-[10px] font-bold text-primary-foreground tabular-nums",children:d.length>9?"9+":d.length})]}),(0,m.jsx)("button",{onClick:()=>window.dispatchEvent(new CustomEvent("open-shortcuts-help")),className:"rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-foreground-secondary hover:bg-background-secondary transition-colors",title:"Keyboard shortcuts","aria-label":"Keyboard shortcuts",children:(0,m.jsx)(bG,{className:"h-4 w-4"})}),(0,m.jsx)("button",{onClick:()=>i(!0),className:"rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-foreground-secondary hover:bg-background-secondary transition-colors",title:"Settings","aria-label":"Settings",children:(0,m.jsx)(br,{className:"h-4 w-4"})}),(0,m.jsx)("button",{"data-testid":"theme-toggle",onClick:b,className:"rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-foreground-secondary hover:bg-background-secondary transition-colors",title:`Switch to ${"dark"===a?"light":"dark"} theme`,"aria-label":`Switch to ${"dark"===a?"light":"dark"} theme`,children:"dark"===a?(0,m.jsx)(bE,{className:"h-4 w-4"}):(0,m.jsx)(bF,{className:"h-4 w-4"})})]})]})}),(0,m.jsx)(bq,{open:f,notifications:d,onDismiss:e,onClose:()=>g(!1)}),(0,m.jsx)(bD,{open:h,onClose:()=>i(!1)})]})}var bL=a.i(377907);function bM(){let[a,b]=(0,n.useState)({app:"5.0.1-staging.69cb593ea",babysitter:process.env.NEXT_PUBLIC_BABYSITTER_VERSION||"…"});return(0,n.useEffect)(()=>{fetch("/api/version").then(a=>a.json()).then(a=>{(a.app||a.babysitter)&&b(b=>({app:a.app||b.app,babysitter:a.babysitter||b.babysitter}))}).catch(()=>{})},[]),(0,m.jsx)("footer",{className:"border-t border-border bg-background/80 backdrop-blur-sm",children:(0,m.jsxs)("div",{className:"mx-auto max-w-[1600px] px-6 py-3 flex flex-wrap items-center justify-between gap-3 text-xs text-foreground-muted",children:[(0,m.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,m.jsx)(bA.Eye,{className:"h-3.5 w-3.5 text-primary/40"}),(0,m.jsxs)("span",{className:"font-medium",children:["Babysitter Observer"," ",(0,m.jsxs)("span",{className:"rounded-full bg-primary/10 border border-primary/20 px-1.5 py-px text-[10px] font-medium text-primary tabular-nums",children:["v",a.app]})]}),(0,m.jsx)("span",{className:"text-foreground-muted/30 select-none",children:"·"}),(0,m.jsxs)("span",{className:"text-xs font-normal text-foreground-muted",children:["Babysitter"," ",(0,m.jsxs)("span",{className:"rounded-full bg-muted/50 border border-border px-1.5 py-px text-[10px] font-normal text-foreground-muted tabular-nums",children:["v",a.babysitter]})]})]}),(0,m.jsxs)("div",{className:"flex items-center gap-4",children:[(0,m.jsxs)("a",{href:"https://github.com/a5c-ai/babysitter/tree/main/packages/observer-dashboard#readme",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 hover:text-foreground-secondary transition-colors",children:[(0,m.jsx)(bJ,{className:"h-3 w-3"}),"Docs"]}),(0,m.jsxs)("a",{href:"https://github.com/a5c-ai/babysitter",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 hover:text-foreground-secondary transition-colors",children:[(0,m.jsx)(bJ,{className:"h-3 w-3"}),"Babysitter"]}),(0,m.jsxs)("a",{href:"https://www.a5c.ai/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 hover:text-primary transition-colors",children:["a5c.ai",(0,m.jsx)(bL.ExternalLink,{className:"h-3 w-3"})]})]})]})})}a.s(["Providers",0,function({children:a}){return(0,m.jsx)(q,{children:(0,m.jsx)(r.NotificationProvider,{children:(0,m.jsxs)(u,{children:[(0,m.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,m.jsx)(bK,{}),(0,m.jsx)("main",{id:"main-content",className:"flex-1 flex flex-col",children:a}),(0,m.jsx)(bM,{})]}),(0,m.jsx)(bf,{})]})})})}],843881)}];
5
+ For more information, see https://radix-ui.com/primitives/docs/components/${b.docsSlug}`;return n.useEffect(()=>{a&&(document.getElementById(a)||console.error(c))},[c,a]),null},a8=({contentRef:a,descriptionId:b})=>{let c=a6("DialogDescriptionWarning"),d=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${c.contentName}}.`;return n.useEffect(()=>{let c=a.current?.getAttribute("aria-describedby");b&&c&&(document.getElementById(b)||console.warn(d))},[d,a,b]),null},a9=a.i(848953);function ba({children:a,className:b}){return(0,m.jsx)("kbd",{className:(0,a9.cn)("inline-flex h-5 min-w-[20px] items-center justify-center rounded","border border-[var(--kbd-border)] bg-background-secondary","px-1.5 font-mono text-xs leading-tight text-foreground-muted","shadow-kbd",b),children:a})}var bb=a.i(735660),bc=a.i(814225);let bd=[{keys:["?"],description:"Show this help",context:"global"},{keys:["n"],description:"Toggle notifications",context:"global"},{keys:["/"],description:"Focus search",context:"dashboard"},{keys:["j"],description:"Next item",context:"run-detail"},{keys:["k"],description:"Previous item",context:"run-detail"},{keys:["Enter"],description:"Open selected",context:"run-detail"},{keys:["Esc"],description:"Go back / Close",context:"run-detail"},{keys:["e"],description:"Toggle event stream",context:"run-detail"},{keys:["1"],description:"Agent tab",context:"run-detail"},{keys:["2"],description:"Timing tab",context:"run-detail"},{keys:["3"],description:"Logs tab",context:"run-detail"},{keys:["4"],description:"Data tab",context:"run-detail"},{keys:["5"],description:"Approval tab",context:"run-detail"}],be={global:"Global",dashboard:"Dashboard","run-detail":"Run Detail"};function bf(){let[a,b]=(0,n.useState)(!1),c=(0,v.usePathname)(),d=c?.startsWith("/runs/")??!1;(0,bc.useKeyboard)([{key:"?",action:()=>b(!0),description:"Show shortcuts help"},{key:"Escape",action:()=>b(!1),description:"Close shortcuts help"}]),(0,n.useEffect)(()=>{let a=()=>b(!0);return window.addEventListener("open-shortcuts-help",a),()=>window.removeEventListener("open-shortcuts-help",a)},[]);let e=bd.filter(a=>"global"===a.context||"dashboard"===a.context&&!d||"run-detail"===a.context&&!!d).reduce((a,b)=>((a[b.context]??=[]).push(b),a),{});return(0,m.jsx)(aK,{open:a,onOpenChange:b,children:(0,m.jsxs)(aP,{children:[(0,m.jsx)(aR,{className:"fixed inset-0 z-50 bg-black/70 backdrop-blur-sm"}),(0,m.jsxs)(aV,{className:"fixed left-1/2 top-1/2 z-50 -translate-x-1/2 -translate-y-1/2 rounded-lg border border-[var(--glass-border)] bg-[var(--glass-bg)] backdrop-blur-xl p-6 shadow-glass w-full max-w-md",children:[(0,m.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,m.jsx)(a$,{className:"text-sm font-medium text-foreground",children:"Keyboard Shortcuts"}),(0,m.jsx)(a2,{asChild:!0,children:(0,m.jsx)("button",{className:"rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-primary transition-colors",children:(0,m.jsx)(bb.X,{className:"h-4 w-4"})})})]}),(0,m.jsx)("div",{className:"space-y-4",children:Object.entries(e).map(([a,b])=>(0,m.jsxs)("div",{children:[(0,m.jsx)("h3",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:be[a]??a}),(0,m.jsx)("div",{className:"space-y-2",children:b.map(({keys:a,description:b})=>(0,m.jsxs)("div",{className:"flex items-center justify-between py-1",children:[(0,m.jsx)("span",{className:"text-sm text-foreground-secondary",children:b}),(0,m.jsx)("div",{className:"flex items-center gap-1",children:a.map(a=>(0,m.jsx)(ba,{children:a},a))})]},b))})]},a))})]})]})})}var bg=a.i(238246),bh=a.i(399549),bi=a.i(133313),bj=a.i(172688),bk=a.i(492924),bl=a.i(57703);let bm=(0,bl.default)("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);var bn=a.i(676321);let bo={success:(0,m.jsx)(bh.CheckCircle2,{className:"h-4 w-4 text-success drop-shadow-[var(--drop-glow-success)]"}),error:(0,m.jsx)(bi.XCircle,{className:"h-4 w-4 text-error drop-shadow-[var(--drop-glow-error)]"}),warning:(0,m.jsx)(bj.AlertTriangle,{className:"h-4 w-4 text-warning drop-shadow-[var(--drop-glow-warning)]"}),info:(0,m.jsx)(bk.Info,{className:"h-4 w-4 text-info drop-shadow-[var(--drop-glow-cyan)]"})},bp={success:"border-l-success",error:"border-l-error",warning:"border-l-warning",info:"border-l-info"};function bq({open:a,notifications:b,onDismiss:c,onClose:d}){let e=(0,v.useRouter)();return(0,m.jsx)(aK,{open:a,onOpenChange:a=>{a||d()},children:(0,m.jsxs)(aP,{children:[(0,m.jsx)(aR,{className:"fixed inset-0 z-50 bg-black/70 backdrop-blur-sm"}),(0,m.jsxs)(aV,{"data-testid":"notification-panel",className:"fixed right-4 top-4 z-50 rounded-lg border border-[var(--glass-border)] bg-[var(--glass-bg)] backdrop-blur-xl shadow-glass w-full max-w-md max-h-[80vh] flex flex-col",children:[(0,m.jsxs)("div",{className:"flex items-center justify-between p-4 border-b border-[var(--glass-border-subtle)]",children:[(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)(bm,{className:"h-4 w-4 text-primary/60"}),(0,m.jsx)(a$,{className:"text-sm font-medium text-foreground",children:"Notifications"}),b.length>0&&(0,m.jsxs)("span",{className:"text-xs text-primary/70 font-mono",children:["(",b.length,")"]})]}),(0,m.jsx)(a2,{asChild:!0,children:(0,m.jsx)("button",{className:"rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-primary transition-colors",children:(0,m.jsx)(bb.X,{className:"h-4 w-4"})})})]}),(0,m.jsx)("div",{className:"flex-1 overflow-y-auto p-2",children:0===b.length?(0,m.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-foreground-muted",children:[(0,m.jsx)(bm,{className:"h-8 w-8 mb-2 opacity-50"}),(0,m.jsx)("p",{className:"text-sm",children:"No notifications"})]}):(0,m.jsx)("div",{className:"space-y-2",children:b.map(a=>{var b;let f,g,h;return(0,m.jsx)("div",{"data-testid":`notification-item-${a.id}`,className:(0,a9.cn)("rounded-lg border border-[var(--glass-border-faint)] bg-[var(--glass-card-bg)] p-3 border-l-2","transition-colors duration-150",a.href&&"cursor-pointer hover:bg-[var(--glass-border-faint)]",bp[a.type]),onClick:()=>{a.href&&(e.push(a.href),c(a.id),d())},children:(0,m.jsxs)("div",{className:"flex items-start gap-2",children:[(0,m.jsx)("div",{className:"shrink-0 mt-0.5",children:bo[a.type]}),a.persistent&&(0,m.jsx)("span",{title:"Pinned — won't auto-dismiss",className:"shrink-0",children:(0,m.jsx)(bn.Pin,{className:"h-3 w-3 text-primary/50"})}),(0,m.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,m.jsx)("p",{className:"text-sm font-medium text-foreground",children:a.title}),(0,m.jsx)("p",{className:"text-xs text-foreground-muted mt-0.5",children:a.body}),(0,m.jsxs)("p",{className:"text-xs text-foreground-muted mt-1 opacity-70",children:[(b=a.timestamp,h=Math.floor((g=Math.floor((f=Math.floor((Date.now()-b)/1e3))/60))/60),f<60?"just now":g<60?`${g}m ago`:h<24?`${h}h ago`:new Date(b).toLocaleString()),a.persistent&&(0,m.jsx)("span",{className:"text-primary/50 ml-1",children:"· Pinned"})]})]}),(0,m.jsx)("button",{onClick:b=>{b.stopPropagation(),c(a.id)},className:"shrink-0 rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-primary transition-colors",children:(0,m.jsx)(bb.X,{className:"h-3.5 w-3.5"})})]})},a.id)})})})]})]})})}let br=(0,bl.default)("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var bs=a.i(2468);let bt=(0,bl.default)("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]),bu=(0,bl.default)("Palette",[["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:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]),bv=(0,bl.default)("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),bw=(0,bl.default)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);var bx=a.i(77317),by=a.i(46193);let bz=(0,bl.default)("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);var bA=a.i(10169),bB=a.i(885410),bC=a.i(620498);function bD({open:a,onClose:b}){let{theme:c,toggle:d}=p(),[e,f]=(0,n.useState)(null),[g,h]=(0,n.useState)(null),[i,j]=(0,n.useState)(!1),[k,l]=(0,n.useState)([]),[o,q]=(0,n.useState)(2e3),[r,s]=(0,n.useState)("dark"),[t,u]=(0,n.useState)(30),[v,w]=(0,n.useState)([]),[x,y]=(0,n.useState)([]),[z,A]=(0,n.useState)(!1),[B,C]=(0,n.useState)(null),[D,E]=(0,n.useState)(null),F=(0,n.useRef)(null),G=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!a)return;j(!0),h(null),C(null),E(null),F.current?.abort(),F.current=new AbortController;let b=F.current.signal;return Promise.all([(0,bC.resilientFetch)("/api/config",{signal:b}),(0,bC.resilientFetch)("/api/runs?mode=projects",{signal:b})]).then(([a,b])=>{if(!a.ok){if(a.error.isAborted)return;h(a.error.message);return}let c=a.data;f(c),l(c.sources.map(a=>({...a}))),q(c.pollInterval),s(c.theme),u(c.retentionDays),w(c.hiddenProjects??[]),y(Array.from(new Set([...b.ok?b.data.projects.map(a=>a.projectName):[],...c.hiddenProjects??[]])).sort())}).finally(()=>j(!1)),()=>{F.current?.abort(),G.current?.abort()}},[a]);let H=(0,n.useCallback)((a,b,c)=>{l(d=>d.map((d,e)=>e===a?{...d,[b]:c}:d))},[]),I=(0,n.useCallback)(a=>{l(b=>b.filter((b,c)=>c!==a))},[]),J=(0,n.useCallback)(()=>{l(a=>[...a,{path:"",depth:2}])},[]),K=(0,n.useCallback)(()=>{e&&(l(e.sources.map(a=>({...a}))),q(e.pollInterval),s(e.theme),u(e.retentionDays),w(e.hiddenProjects??[])),C(null),E(null)},[e]),L=(0,n.useCallback)(async()=>{A(!0),C(null),E(null),G.current?.abort(),G.current=new AbortController;let a=await (0,bC.resilientFetch)("/api/config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sources:k.filter(a=>a.path.trim()),pollInterval:o,theme:r,retentionDays:t,hiddenProjects:v}),signal:G.current.signal});if(!a.ok){if(a.error.isAborted)return;C("error"),E(a.error.message),A(!1);return}let b=a.data;f(b),l(b.sources.map(a=>({...a}))),q(b.pollInterval),s(b.theme),u(b.retentionDays),w(b.hiddenProjects??[]),C("success"),b.theme!==c&&d(),setTimeout(()=>C(null),2e3),A(!1)},[k,o,r,t,v,c,d]),M=e&&(JSON.stringify(k)!==JSON.stringify(e.sources)||o!==e.pollInterval||r!==e.theme||t!==e.retentionDays||JSON.stringify(v.slice().sort())!==JSON.stringify((e.hiddenProjects??[]).slice().sort()));return(0,m.jsx)(aK,{open:a,onOpenChange:a=>{a||b()},children:(0,m.jsxs)(aP,{children:[(0,m.jsx)(aR,{className:"fixed inset-0 z-50 bg-black/60"}),(0,m.jsx)(aV,{className:"fixed inset-0 z-50 flex items-center justify-center p-4","data-testid":"settings-modal",children:(0,m.jsxs)("div",{className:"relative z-50 rounded-lg border border-border bg-card shadow-xl w-full max-w-lg max-h-[80vh] flex flex-col",children:[(0,m.jsxs)("div",{className:"flex items-center justify-between p-4 border-b border-border",children:[(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)(br,{className:"h-4 w-4 text-foreground-muted"}),(0,m.jsx)(a$,{className:"text-sm font-medium text-foreground",children:"Settings"})]}),(0,m.jsx)(a2,{asChild:!0,children:(0,m.jsx)("button",{className:"rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-foreground transition-colors",children:(0,m.jsx)(bb.X,{className:"h-4 w-4"})})})]}),(0,m.jsx)(a0,{asChild:!0,children:(0,m.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:i?(0,m.jsxs)("div",{className:"flex items-center justify-center py-12 text-foreground-muted",children:[(0,m.jsx)(bx.Loader2,{className:"h-4 w-4 animate-spin mr-2"}),(0,m.jsx)("p",{className:"text-sm",children:"Loading configuration..."})]}):g?(0,m.jsxs)("div",{className:"rounded-lg border border-error/20 bg-error-muted p-3 text-sm text-error",children:["Failed to load config: ",g]}):e?(0,m.jsxs)("div",{className:"space-y-5",children:[(0,m.jsxs)("section",{children:[(0,m.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,m.jsx)(bs.FolderOpen,{className:"h-4 w-4 text-foreground-muted"}),(0,m.jsx)("span",{className:"text-xs font-medium text-foreground-secondary",children:"Watch Sources"})]}),(0,m.jsx)("div",{className:"space-y-2",children:k.map((a,b)=>(0,m.jsxs)("div",{className:"rounded-md border border-border bg-background p-2.5 space-y-2",children:[(0,m.jsxs)("div",{className:"flex items-start gap-2",children:[(0,m.jsxs)("div",{className:"flex-1",children:[(0,m.jsx)("label",{className:"text-xs uppercase tracking-wider text-foreground-muted mb-1 block",children:"Path"}),(0,m.jsx)("input",{type:"text",value:a.path,onChange:a=>H(b,"path",a.target.value),placeholder:"/path/to/projects",className:"w-full rounded-md border border-border bg-background-secondary px-2.5 py-1.5 font-mono text-xs text-foreground placeholder:text-foreground-muted/50 focus:outline-none focus:ring-1 focus:ring-primary/50"})]}),(0,m.jsx)("button",{onClick:()=>I(b),className:"mt-4 rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-error hover:bg-error/10 transition-colors",title:"Remove source",children:(0,m.jsx)(bw,{className:"h-3.5 w-3.5"})})]}),(0,m.jsx)("div",{className:"flex items-center gap-3",children:(0,m.jsxs)("div",{className:"w-20",children:[(0,m.jsx)("label",{className:"text-xs uppercase tracking-wider text-foreground-muted mb-1 block",children:"Depth"}),(0,m.jsx)("input",{type:"number",value:a.depth,onChange:a=>H(b,"depth",Math.max(0,Math.min(10,parseInt(a.target.value)||0))),min:0,max:10,className:"w-full rounded-md border border-border bg-background-secondary px-2.5 py-1.5 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary/50"})]})})]},b))}),(0,m.jsxs)("button",{onClick:J,className:"mt-2 flex items-center gap-1.5 rounded-md px-2.5 py-1.5 min-h-[44px] text-xs text-foreground-muted hover:text-foreground hover:bg-background-secondary transition-colors",children:[(0,m.jsx)(bv,{className:"h-3.5 w-3.5"}),"Add Source"]})]}),(0,m.jsxs)("section",{children:[(0,m.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,m.jsx)(bt,{className:"h-4 w-4 text-foreground-muted"}),(0,m.jsx)("span",{className:"text-xs font-medium text-foreground-secondary",children:"Poll Interval"})]}),(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)("input",{type:"number",value:o,onChange:a=>q(Math.max(500,parseInt(a.target.value)||500)),min:500,step:500,className:"w-28 rounded-md border border-border bg-background-secondary px-2.5 py-1.5 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,m.jsx)("span",{className:"text-xs text-foreground-muted",children:"ms"})]})]}),(0,m.jsxs)("section",{children:[(0,m.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,m.jsx)(bu,{className:"h-4 w-4 text-foreground-muted"}),(0,m.jsx)("span",{className:"text-xs font-medium text-foreground-secondary",children:"Theme"})]}),(0,m.jsx)("div",{className:"flex rounded-md border border-border overflow-hidden",children:["dark","light"].map(a=>(0,m.jsx)("button",{onClick:()=>s(a),className:(0,a9.cn)("flex-1 px-4 py-1.5 min-h-[44px] text-xs font-medium transition-colors capitalize",r===a?"bg-primary/15 text-primary":"bg-background-secondary text-foreground-muted hover:text-foreground"),children:a},a))})]}),(0,m.jsxs)("section",{children:[(0,m.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,m.jsx)(bz,{className:"h-4 w-4 text-foreground-muted"}),(0,m.jsx)("span",{className:"text-xs font-medium text-foreground-secondary",children:"Run Retention"})]}),(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)("span",{className:"text-xs text-foreground-muted",children:"Show runs from the last"}),(0,m.jsx)("input",{type:"number",value:t,onChange:a=>u(Math.max(1,Math.min(365,parseInt(a.target.value)||30))),min:1,max:365,className:"w-20 rounded-md border border-border bg-background-secondary px-2.5 py-1.5 font-mono text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,m.jsx)("span",{className:"text-xs text-foreground-muted",children:"days"})]}),(0,m.jsx)("p",{className:"text-xs text-foreground-muted mt-1.5",children:"Older completed/failed runs are hidden from the dashboard. Active runs are always shown."})]}),x.length>0&&(0,m.jsxs)("section",{children:[(0,m.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,m.jsx)(bA.Eye,{className:"h-4 w-4 text-foreground-muted"}),(0,m.jsx)("span",{className:"text-xs font-medium text-foreground-secondary",children:"Project Visibility"})]}),(0,m.jsx)("p",{className:"text-xs text-foreground-muted mb-2",children:"Hidden projects will not appear on the dashboard."}),(0,m.jsx)("div",{className:"space-y-1",children:x.map(a=>{let b=v.includes(a);return(0,m.jsxs)("div",{className:"flex items-center justify-between rounded-md border border-border bg-background px-2.5 py-1.5",children:[(0,m.jsx)("span",{className:(0,a9.cn)("text-xs font-mono truncate",b?"text-foreground-muted line-through":"text-foreground"),children:a}),(0,m.jsx)("button",{onClick:()=>{w(c=>b?c.filter(b=>b!==a):[...c,a])},className:(0,a9.cn)("rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center transition-colors",b?"text-foreground-muted hover:text-foreground hover:bg-background-secondary":"text-foreground-secondary hover:text-foreground-muted hover:bg-background-secondary"),title:b?"Show project":"Hide project",children:b?(0,m.jsx)(bB.EyeOff,{className:"h-3.5 w-3.5"}):(0,m.jsx)(bA.Eye,{className:"h-3.5 w-3.5"})})]},a)})})]}),"success"===B&&(0,m.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-success/20 bg-success/5 px-3 py-2 text-xs text-success",children:[(0,m.jsx)(by.Check,{className:"h-3.5 w-3.5"}),"Settings saved successfully"]}),"error"===B&&(0,m.jsx)("div",{className:"rounded-md border border-error/20 bg-error/5 px-3 py-2 text-xs text-error",children:D||"Failed to save settings"})]}):null})}),e&&(0,m.jsxs)("div",{className:"flex items-center justify-between border-t border-border px-4 py-3",children:[(0,m.jsxs)("p",{className:"text-xs text-foreground-muted",children:["Config file: ",(0,m.jsx)("span",{className:"font-mono",children:"~/.a5c/observer.json"})]}),(0,m.jsxs)("div",{className:"flex items-center gap-2",children:[(0,m.jsx)("button",{onClick:K,disabled:z,className:"rounded-md px-3 py-1.5 min-h-[44px] text-xs text-foreground-muted hover:text-foreground hover:bg-background-secondary transition-colors disabled:opacity-50",children:"Cancel"}),(0,m.jsx)("button",{onClick:L,disabled:z||!M,className:(0,a9.cn)("rounded-md px-3 py-1.5 min-h-[44px] text-xs font-medium transition-colors",M?"bg-primary text-primary-foreground hover:bg-primary/90":"bg-background-secondary text-foreground-muted cursor-not-allowed",z&&"opacity-50"),children:z?(0,m.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,m.jsx)(bx.Loader2,{className:"h-3 w-3 animate-spin"}),"Saving..."]}):"Save"})]})]})]})})]})})}let bE=(0,bl.default)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),bF=(0,bl.default)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]),bG=(0,bl.default)("HelpCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),bH=(0,bl.default)("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]),bI=(0,bl.default)("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),bJ=(0,bl.default)("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);function bK(){let{theme:a,toggle:b}=p(),{connected:c}=(0,s.useEventStream)(),{notifications:d,dismiss:e}=(0,r.useNotificationContext)(),[f,g]=(0,n.useState)(!1),[h,i]=(0,n.useState)(!1),j=(0,n.useCallback)(()=>{g(a=>!a)},[]);return(0,bc.useKeyboard)([{key:"n",action:j,description:"Toggle notifications"}]),(0,n.useEffect)(()=>{let a=()=>i(!0);return window.addEventListener("open-settings",a),()=>window.removeEventListener("open-settings",a)},[]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:top-2 focus:left-2 focus:z-[100] focus:px-4 focus:py-2 focus:bg-primary focus:text-primary-foreground focus:rounded-md",children:"Skip to main content"}),(0,m.jsx)("header",{className:"sticky top-0 z-30 border-b border-border bg-background/80 backdrop-blur-md",children:(0,m.jsxs)("div",{className:"mx-auto max-w-[1600px] px-6 py-3 flex items-center gap-3",children:[(0,m.jsx)(bA.Eye,{className:"h-5 w-5 text-primary"}),(0,m.jsx)("h1",{className:"text-base font-semibold",children:(0,m.jsx)(bg.default,{href:"/",className:"text-foreground hover:text-primary transition-colors",children:"Babysitter Observer"})}),(0,m.jsx)("a",{href:"https://www.a5c.ai/",target:"_blank",rel:"noopener noreferrer",className:"text-xs leading-tight font-medium text-primary/60 hover:text-primary transition-colors hidden sm:block",children:"a5c.ai"}),(0,m.jsx)("a",{href:"https://github.com/a5c-ai/babysitter",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-foreground-muted hover:text-foreground-secondary transition-colors hidden sm:block",title:"Babysitter on GitHub",children:(0,m.jsx)(bJ,{className:"h-3.5 w-3.5"})}),(0,m.jsx)("span",{className:"text-xs text-foreground-muted hidden md:block",children:"Real-time orchestration dashboard"}),(0,m.jsxs)("div",{className:"ml-auto flex items-center gap-1.5",children:[(0,m.jsxs)("span",{"data-testid":"sse-status",role:"status","aria-live":"polite",className:(0,a9.cn)("inline-flex items-center gap-1.5 rounded-full px-2.5 py-1 text-xs font-medium mr-1 transition-all",c?"bg-success/10 text-success border border-success/20":"bg-error/10 text-error border border-error/20"),title:c?"Live updates connected":"Live updates disconnected",children:[c?(0,m.jsx)(bH,{className:"h-3 w-3"}):(0,m.jsx)(bI,{className:"h-3 w-3"}),(0,m.jsx)("span",{className:"hidden sm:inline",children:c?"Live":"Offline"})]}),(0,m.jsxs)("button",{"data-testid":"notification-bell",onClick:j,className:"relative rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-foreground-secondary hover:bg-background-secondary transition-colors",title:"Notifications","aria-label":`Notifications${d.length>0?` (${d.length} unread)`:""}`,children:[(0,m.jsx)(bm,{className:"h-4 w-4"}),d.length>0&&(0,m.jsx)("span",{"data-testid":"notification-badge",className:"absolute -top-0.5 -right-0.5 flex h-4 w-4 items-center justify-center rounded-full bg-primary text-[10px] font-bold text-primary-foreground tabular-nums",children:d.length>9?"9+":d.length})]}),(0,m.jsx)("button",{onClick:()=>window.dispatchEvent(new CustomEvent("open-shortcuts-help")),className:"rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-foreground-secondary hover:bg-background-secondary transition-colors",title:"Keyboard shortcuts","aria-label":"Keyboard shortcuts",children:(0,m.jsx)(bG,{className:"h-4 w-4"})}),(0,m.jsx)("button",{onClick:()=>i(!0),className:"rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-foreground-secondary hover:bg-background-secondary transition-colors",title:"Settings","aria-label":"Settings",children:(0,m.jsx)(br,{className:"h-4 w-4"})}),(0,m.jsx)("button",{"data-testid":"theme-toggle",onClick:b,className:"rounded-md p-2 min-h-[44px] min-w-[44px] flex items-center justify-center text-foreground-muted hover:text-foreground-secondary hover:bg-background-secondary transition-colors",title:`Switch to ${"dark"===a?"light":"dark"} theme`,"aria-label":`Switch to ${"dark"===a?"light":"dark"} theme`,children:"dark"===a?(0,m.jsx)(bE,{className:"h-4 w-4"}):(0,m.jsx)(bF,{className:"h-4 w-4"})})]})]})}),(0,m.jsx)(bq,{open:f,notifications:d,onDismiss:e,onClose:()=>g(!1)}),(0,m.jsx)(bD,{open:h,onClose:()=>i(!1)})]})}var bL=a.i(377907);function bM(){let[a,b]=(0,n.useState)({app:"5.0.1-staging.69cb593ea536",babysitter:process.env.NEXT_PUBLIC_BABYSITTER_VERSION||"…"});return(0,n.useEffect)(()=>{fetch("/api/version").then(a=>a.json()).then(a=>{(a.app||a.babysitter)&&b(b=>({app:a.app||b.app,babysitter:a.babysitter||b.babysitter}))}).catch(()=>{})},[]),(0,m.jsx)("footer",{className:"border-t border-border bg-background/80 backdrop-blur-sm",children:(0,m.jsxs)("div",{className:"mx-auto max-w-[1600px] px-6 py-3 flex flex-wrap items-center justify-between gap-3 text-xs text-foreground-muted",children:[(0,m.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,m.jsx)(bA.Eye,{className:"h-3.5 w-3.5 text-primary/40"}),(0,m.jsxs)("span",{className:"font-medium",children:["Babysitter Observer"," ",(0,m.jsxs)("span",{className:"rounded-full bg-primary/10 border border-primary/20 px-1.5 py-px text-[10px] font-medium text-primary tabular-nums",children:["v",a.app]})]}),(0,m.jsx)("span",{className:"text-foreground-muted/30 select-none",children:"·"}),(0,m.jsxs)("span",{className:"text-xs font-normal text-foreground-muted",children:["Babysitter"," ",(0,m.jsxs)("span",{className:"rounded-full bg-muted/50 border border-border px-1.5 py-px text-[10px] font-normal text-foreground-muted tabular-nums",children:["v",a.babysitter]})]})]}),(0,m.jsxs)("div",{className:"flex items-center gap-4",children:[(0,m.jsxs)("a",{href:"https://github.com/a5c-ai/babysitter/tree/main/packages/observer-dashboard#readme",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 hover:text-foreground-secondary transition-colors",children:[(0,m.jsx)(bJ,{className:"h-3 w-3"}),"Docs"]}),(0,m.jsxs)("a",{href:"https://github.com/a5c-ai/babysitter",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 hover:text-foreground-secondary transition-colors",children:[(0,m.jsx)(bJ,{className:"h-3 w-3"}),"Babysitter"]}),(0,m.jsxs)("a",{href:"https://www.a5c.ai/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 hover:text-primary transition-colors",children:["a5c.ai",(0,m.jsx)(bL.ExternalLink,{className:"h-3 w-3"})]})]})]})})}a.s(["Providers",0,function({children:a}){return(0,m.jsx)(q,{children:(0,m.jsx)(r.NotificationProvider,{children:(0,m.jsxs)(u,{children:[(0,m.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,m.jsx)(bK,{}),(0,m.jsx)("main",{id:"main-content",className:"flex-1 flex flex-col",children:a}),(0,m.jsx)(bM,{})]}),(0,m.jsx)(bf,{})]})})})}],843881)}];
6
6
 
7
7
  //# sourceMappingURL=packages_observer-dashboard_src_components_providers_tsx_03_vrrn._.js.map