import{r as v,k as e}from"./index-BVfpSx5Q.js";import{L as q}from"./layout-NiehYZnq.js";import{P as U,C as N,e as K,d as w,h as C,H,V as z,a as J,S as k}from"./ui-DGkmnhL-.js";import{c as O,d as h,S as T}from"./workcells-CX1pJNAx.js";import{c as Q,d as X,b as Y,u as Z}from"./hooks-B5MrA7_i.js";import{R as D,f as P}from"./generateCategoricalChart-C3RFeikY.js";import{a as M,L as V}from"./LineChart-60khDhjR.js";import"./types-CcGq3kAE.js";import"./YAxis-BcKAP-pG.js";const l="#c9b787",A={"lyte-revenue":"#c9b787","vessels-maritime":"#8a8a8a","terra-real-estate":"#c9b787","aegis-defense":"#f5f5f5","prism-counsel":"#8a8a8a","carlota-jo":"#c9b787","alloy-core":"#5e5e5e"},S={"lyte-revenue":"Revenue","vessels-maritime":"Maritime","terra-real-estate":"Real Estate","aegis-defense":"Defense","prism-counsel":"Legal","carlota-jo":"Carlota Jo","alloy-core":"Core"},ee={achieved:"#22c55e",missed:"#ef4444",blocked:"#f97316",in_progress:l,at_risk:"#f97316",running:l,paused:"#8a8a8a",error:"#ef4444",completed:"#22c55e",waiting_approval:"#f97316"};function oe(d){try{const c=new Date(d),n=Date.now()-c.getTime(),u=Math.round(n/6e4);if(u<60)return`${u}m ago`;const b=Math.round(n/36e5);return b<24?`${b}h ago`:`${Math.round(b/24)}d ago`}catch{return d}}const te=Array.from({length:24},(d,c)=>({h:c,actions:Math.floor(8+Math.sin(c*.5)*4+(c>8&&c<18?6:0))})),re=Array.from({length:24},(d,c)=>({h:c,pct:Math.round(88+Math.sin(c*.3)*4)})),B=[{id:"cascade",name:"Cascade Navigator",vertical:"vessels-maritime",status:"pending_approval",lastAction:"Port standby — awaiting VP",trust:97},{id:"counsel",name:"Counsel Sentinel",vertical:"prism-counsel",status:"active",lastAction:"Talbot escalation complete",trust:99},{id:"pipeline",name:"Pipeline Oracle",vertical:"lyte-revenue",status:"active",lastAction:"Q2 pipeline analysis running",trust:91},{id:"guardian",name:"Guardian",vertical:"aegis-defense",status:"active",lastAction:"Perimeter hardening verified",trust:99},{id:"domaine",name:"Terra Analyst",vertical:"terra-real-estate",status:"active",lastAction:"Cap rate model updated",trust:88},{id:"watchdog",name:"Fabric Watchdog",vertical:"alloy-core",status:"active",lastAction:"Layer health: all nominal",trust:100}];function pe(){var I;const[d,c]=v.useState(null),[n,u]=v.useState({}),[b,_]=v.useState(0),{data:y,fetching:E}=Q({limit:100}),{data:R}=X({limit:50}),{data:x}=Y(),{data:G}=Z({status:"pending",limit:5}),i=y.length>0;v.useEffect(()=>{const o=setInterval(()=>_(r=>r+1),4e3);return()=>clearInterval(o)},[]);const f=v.useMemo(()=>i?y.map(o=>({id:o.id,vertical:o.domain??"",severity:o.severity??"medium",status:o.status??"active",title:o.title??"",description:o.description??"",detectedAt:o.createdAt??"",owner:o.ownerUserId??"",businessImpact:"",evidenceRefs:[]})):O.map(o=>({id:o.id,vertical:o.vertical,severity:o.severity,status:o.status,title:o.title,description:o.description,detectedAt:o.detectedAt,owner:o.owner,businessImpact:o.businessImpact,evidenceRefs:o.evidenceRefs})),[i,y]),j=f.filter(o=>o.severity==="critical"||o.severity==="high").slice(0,20),L=h.filter(o=>o.requiresApproval&&o.status==="running").slice(0,4),$=T.slice(0,6),s=f.find(o=>o.id===d)??null,t=v.useMemo(()=>{if(!s)return null;if(i){const r=R.find(a=>a.triggerId===s.id);return r?{id:r.id,name:r.name,status:r.status,requiresApproval:r.requiresApproval,approvalState:r.approvalState,description:r.description??"",domain:r.domain??"",priority:r.priority??"medium",isLive:!0,steps:r.steps.map(a=>({step:a.step,name:a.name,status:a.status}))}:null}const o=h.find(r=>r.signals.includes(s.id));return o?{id:o.id,name:o.name,status:o.status,requiresApproval:o.requiresApproval,approvalState:"none",description:o.objective,domain:o.vertical,priority:o.actionBrief.priority,isLive:!1,steps:[],actionBrief:o.actionBrief,mirrorEval:{verdict:o.mirrorEvalResult.verdict,score:o.mirrorEvalResult.score,dimensions:o.mirrorEvalResult.dimensions},pceContractId:o.pceContractId,verificationStatus:o.verificationResult.status}:null},[s,i,R]),W=[{label:"ACTIVE SIGNALS",value:i?f.filter(o=>o.status==="active").length:O.filter(o=>o.status==="active"||o.status==="escalated").length,sub:`${f.filter(o=>o.severity==="critical").length} critical`,color:"#ef4444"},{label:"RUNNING WORKCELLS",value:i?(x==null?void 0:x.runningRuns)??0:h.filter(o=>o.status==="running").length,sub:"active now",color:l},{label:"PENDING APPROVALS",value:i?G.length:h.filter(o=>o.requiresApproval&&o.status==="running").length,sub:"awaiting gate",color:"#f97316"},{label:"VERIFIED ACTIONS",value:i?(x==null?void 0:x.totalRuns)??47:47,sub:"last 24h",color:"#22c55e"},{label:"PROOF COVERAGE",value:"91%",sub:"1,204 of 1,324",color:l},{label:"AGENT TRUST",value:94,sub:"avg out of 100",color:l},{label:"OUTCOMES AT RISK",value:T.filter(o=>o.status==="blocked"||o.status==="missed").length,sub:"blocked or missed",color:"#f97316"},{label:"PCE HEALTH",value:"96%",sub:"19 of 20 valid",color:"#22c55e"}];function m(o,r){u(a=>({...a,[o]:r}))}function p(o){u(r=>{const a={...r};return delete a[o],a})}return e.jsxs(q,{children:[e.jsx(U,{label:"COMMAND SURFACE",title:"Unified Operator Command",subtitle:"Real-time signal feed · Active agents & workcells · Outcome scorecard · Approval queue — all in a single unified view.",status:i?"LIVE":E?"CONNECTING":"LIVE",children:e.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",style:{color:l},children:[e.jsx("span",{className:"w-2 h-2 rounded-full animate-pulse",style:{backgroundColor:l}}),i?"Connected to fabric":"All fabric layers operational"]})}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 lg:grid-cols-8 gap-2 mb-6",children:W.map(o=>e.jsxs("div",{className:"rounded-lg border p-2.5",style:{backgroundColor:"var(--color-a11oy-card)",borderColor:"var(--color-a11oy-border)",borderTop:`2px solid ${o.color}`},children:[e.jsx("div",{className:"text-xs font-mono mb-1",style:{color:"var(--color-a11oy-text-ghost)",fontSize:9,letterSpacing:"0.06em"},children:o.label}),e.jsx("div",{className:"text-xl font-bold font-mono",style:{color:o.color},children:o.value}),e.jsx("div",{className:"text-xs mt-0.5",style:{color:"var(--color-a11oy-text-ghost)",fontSize:10},children:o.sub})]},o.label))}),e.jsxs("div",{className:"grid xl:grid-cols-3 gap-4 mb-4",children:[e.jsxs("div",{className:"xl:col-span-2 flex flex-col gap-4",children:[e.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[e.jsxs(N,{style:{padding:12},children:[e.jsx("div",{className:"text-xs font-mono mb-2",style:{color:"var(--color-a11oy-text-ghost)"},children:"EXECUTION VELOCITY — 24h"}),e.jsx(D,{width:"100%",height:80,children:e.jsxs(M,{data:te,margin:{top:2,right:2,bottom:2,left:-20},children:[e.jsx(V,{type:"monotone",dataKey:"actions",stroke:l,strokeWidth:1.5,dot:!1}),e.jsx(P,{contentStyle:{backgroundColor:"#0a0a0a",border:"1px solid rgba(255,255,255,0.08)",borderRadius:4,fontSize:10},formatter:o=>[`${o}`,"Actions/hr"]})]})}),e.jsxs("div",{className:"flex justify-between text-xs mt-1",style:{color:"var(--color-a11oy-text-ghost)"},children:[e.jsx("span",{children:"12h ago"}),e.jsx("span",{children:"12.4 avg/hr"}),e.jsx("span",{children:"now"})]})]}),e.jsxs(N,{style:{padding:12},children:[e.jsx("div",{className:"text-xs font-mono mb-2",style:{color:"var(--color-a11oy-text-ghost)"},children:"PROOF COVERAGE — 24h"}),e.jsx(D,{width:"100%",height:80,children:e.jsxs(M,{data:re,margin:{top:2,right:2,bottom:2,left:-20},children:[e.jsx(V,{type:"monotone",dataKey:"pct",stroke:"#22c55e",strokeWidth:1.5,dot:!1}),e.jsx(P,{contentStyle:{backgroundColor:"#0a0a0a",border:"1px solid rgba(255,255,255,0.08)",borderRadius:4,fontSize:10},formatter:o=>[`${o}%`,"Coverage"]})]})}),e.jsxs("div",{className:"flex justify-between text-xs mt-1",style:{color:"var(--color-a11oy-text-ghost)"},children:[e.jsx("span",{children:"12h ago"}),e.jsx("span",{style:{color:"#22c55e"},children:"91% now"}),e.jsx("span",{children:"now"})]})]})]}),e.jsxs("div",{className:"flex gap-0 border rounded-lg overflow-hidden",style:{borderColor:"var(--color-a11oy-border)",minHeight:420},children:[e.jsxs("div",{className:"flex-1 overflow-y-auto border-r",style:{borderColor:"var(--color-a11oy-border)"},children:[e.jsxs("div",{className:"p-3 border-b sticky top-0 z-10 flex items-center justify-between",style:{backgroundColor:"rgba(10,10,10,0.92)",backdropFilter:"blur(8px)",borderColor:"var(--color-a11oy-border)"},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-mono",style:{color:"var(--color-a11oy-text-ghost)"},children:"SIGNAL FEED"}),i&&e.jsx("span",{className:"w-1.5 h-1.5 rounded-full animate-pulse",style:{backgroundColor:"#c9b787"}})]}),e.jsxs("span",{className:"text-xs font-mono",style:{color:"var(--color-a11oy-text-ghost)"},children:[j.length," events"]})]}),e.jsx("div",{className:"flex flex-col divide-y",style:{borderColor:"rgba(255,255,255,0.04)"},children:E&&j.length===0?e.jsxs("div",{className:"p-8 text-center text-xs",style:{color:"var(--color-a11oy-text-ghost)"},children:[e.jsx("span",{className:"w-2 h-2 rounded-full animate-pulse inline-block mr-2",style:{backgroundColor:"#5e5e5e"}}),"Connecting to fabric..."]}):j.map((o,r)=>{const a=A[o.vertical]??"#5e5e5e",g=o.id===d,F=b%5===0&&r===0;return e.jsxs("div",{className:"p-3 cursor-pointer transition-all",onClick:()=>c(g?null:o.id),style:{backgroundColor:g?"rgba(201,183,135,0.05)":F?"rgba(201,183,135,0.03)":"var(--color-a11oy-card)",borderLeft:g?`2px solid ${l}`:"2px solid transparent"},children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(K,{severity:o.severity}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-0.5 flex-wrap",children:[e.jsx(w,{severity:o.severity}),e.jsx(C,{vertical:S[o.vertical]??o.vertical,color:a})]}),e.jsx("div",{className:"text-xs font-medium truncate",style:{color:"var(--color-a11oy-text)"},children:o.title}),g&&e.jsx("div",{className:"text-xs mt-1",style:{color:"var(--color-a11oy-text-sub)"},children:o.description})]}),e.jsx("div",{className:"text-xs font-mono flex-shrink-0",style:{color:"var(--color-a11oy-text-ghost)"},children:oe(o.detectedAt)})]}),g&&t&&e.jsxs("div",{className:"mt-2 px-2 py-1.5 rounded text-xs",style:{backgroundColor:"rgba(201,183,135,0.06)",border:"1px solid rgba(201,183,135,0.15)"},children:[e.jsxs("span",{style:{color:"#c9b787"},children:["↗ Linked ",t.isLive?"workflow":"workcell",": "]}),e.jsx("span",{style:{color:"var(--color-a11oy-text-sub)"},children:t.name})]})]},o.id)})})]}),e.jsx("div",{className:"w-72 flex-shrink-0 overflow-y-auto",style:{backgroundColor:"var(--color-a11oy-deep)"},children:s?e.jsxs("div",{className:"p-4",children:[e.jsx("div",{className:"text-xs font-mono uppercase tracking-widest mb-3",style:{color:"var(--color-a11oy-text-ghost)"},children:"SIGNAL DETAIL"}),e.jsx("div",{className:"text-sm font-semibold mb-1",style:{color:"var(--color-a11oy-text)"},children:s.title}),e.jsx(H,{id:s.id}),e.jsxs("div",{className:"flex flex-wrap gap-1.5 mb-2 mt-2",children:[e.jsx(w,{severity:s.severity}),e.jsx(C,{vertical:S[s.vertical]??s.vertical,color:A[s.vertical]??"#5e5e5e"})]}),e.jsx("p",{className:"text-xs mb-3",style:{color:"var(--color-a11oy-text-sub)"},children:s.description}),s.businessImpact&&e.jsx("div",{className:"text-xs p-2 rounded mb-3",style:{backgroundColor:"rgba(201,183,135,0.08)",color:l,border:"1px solid rgba(201,183,135,0.2)"},children:s.businessImpact}),t&&t.actionBrief&&e.jsxs("div",{className:"border-t pt-3 mb-3",style:{borderColor:"var(--color-a11oy-border)"},children:[e.jsx("div",{className:"text-xs font-mono uppercase tracking-widest mb-2",style:{color:"var(--color-a11oy-text-ghost)"},children:"ACTION BRIEF"}),e.jsx("div",{className:"text-xs font-medium mb-1",style:{color:"var(--color-a11oy-text)"},children:t.actionBrief.title}),e.jsx("div",{className:"text-xs mb-2",style:{color:"var(--color-a11oy-text-ghost)"},children:t.actionBrief.description}),e.jsx("div",{className:"text-xs font-mono mb-2",style:{color:l},children:t.actionBrief.estimatedImpact})]}),t&&t.isLive&&e.jsxs("div",{className:"border-t pt-3 mb-3",style:{borderColor:"var(--color-a11oy-border)"},children:[e.jsx("div",{className:"text-xs font-mono uppercase tracking-widest mb-2",style:{color:"var(--color-a11oy-text-ghost)"},children:"LINKED WORKFLOW"}),e.jsx("div",{className:"text-xs font-medium mb-1",style:{color:"var(--color-a11oy-text)"},children:t.name}),e.jsx("div",{className:"text-xs mb-2",style:{color:"var(--color-a11oy-text-sub)"},children:t.description}),e.jsxs("div",{className:"flex items-center gap-2 text-xs flex-wrap",children:[e.jsx("span",{className:"font-mono px-1.5 py-0.5 rounded",style:{backgroundColor:"rgba(201,183,135,0.12)",color:"#c9b787"},children:t.status}),t.requiresApproval&&e.jsxs("span",{className:"font-mono px-1.5 py-0.5 rounded",style:{backgroundColor:"rgba(245,245,245,0.08)",color:"#f5f5f5"},children:["approval: ",t.approvalState]})]}),t.steps.length>0&&e.jsxs("div",{className:"mt-2",children:[e.jsx("div",{className:"text-xs font-mono mb-1",style:{color:"var(--color-a11oy-text-ghost)"},children:"STEPS"}),t.steps.map(o=>e.jsxs("div",{className:"text-xs flex items-center gap-2 mb-0.5",children:[e.jsx("span",{className:"font-mono",style:{color:o.status==="completed"?"#c9b787":o.status==="running"?"#f5f5f5":"var(--color-a11oy-text-ghost)"},children:o.status==="completed"?"✓":o.status==="running"?"▸":"·"}),e.jsx("span",{style:{color:"var(--color-a11oy-text-sub)"},children:o.name})]},o.step))]})]}),t&&t.mirrorEval&&e.jsxs("div",{className:"border-t pt-3 mb-3",style:{borderColor:"var(--color-a11oy-border)"},children:[e.jsx("div",{className:"text-xs font-mono uppercase tracking-widest mb-2",style:{color:"var(--color-a11oy-text-ghost)"},children:"MIRROREVAL"}),e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(z,{verdict:t.mirrorEval.verdict}),e.jsxs("span",{className:"text-xs font-mono",style:{color:"var(--color-a11oy-text-ghost)"},children:[Math.round(t.mirrorEval.score*100),"% confidence"]})]})]}),t&&t.requiresApproval&&!n[t.id]&&e.jsxs("div",{className:"border-t pt-3",style:{borderColor:"var(--color-a11oy-border)"},children:[e.jsx("div",{className:"text-xs font-mono uppercase tracking-widest mb-2",style:{color:"var(--color-a11oy-text-ghost)"},children:"APPROVAL CONTROL"}),e.jsx(J,{label:`Approval ${t.isLive?`state: ${t.approvalState}`:`tier: ${((I=t.actionBrief)==null?void 0:I.approvalTier)??"—"}`}`}),e.jsxs("div",{className:"flex gap-1.5 mt-2 flex-wrap",children:[e.jsx("button",{onClick:()=>m(t.id,"approved"),className:"text-xs px-3 py-1.5 rounded",style:{backgroundColor:"rgba(34,197,94,0.12)",color:"#22c55e",border:"1px solid rgba(34,197,94,0.3)",cursor:"pointer"},children:"✓ Approve"}),e.jsx("button",{onClick:()=>m(t.id,"deferred"),className:"text-xs px-3 py-1.5 rounded",style:{backgroundColor:"rgba(201,183,135,0.08)",color:"#c9b787",border:"1px solid rgba(201,183,135,0.2)",cursor:"pointer"},children:"⏸ Defer"}),e.jsx("button",{onClick:()=>m(t.id,"rejected"),className:"text-xs px-3 py-1.5 rounded",style:{backgroundColor:"rgba(239,68,68,0.08)",color:"#ef4444",border:"1px solid rgba(239,68,68,0.2)",cursor:"pointer"},children:"✕ Reject"})]})]}),t&&n[t.id]==="approved"&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"text-xs font-mono px-2 py-1 rounded",style:{backgroundColor:"rgba(34,197,94,0.1)",color:"#22c55e",border:"1px solid rgba(34,197,94,0.2)"},children:"✓ Approved"}),e.jsx("button",{onClick:()=>p(t.id),className:"text-xs font-mono",style:{color:"var(--color-a11oy-text-ghost)",background:"none",border:"none",cursor:"pointer"},children:"undo"})]}),t&&n[t.id]==="deferred"&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"text-xs font-mono px-2 py-1 rounded",style:{backgroundColor:"rgba(201,183,135,0.1)",color:"#c9b787",border:"1px solid rgba(201,183,135,0.2)"},children:"⏸ Deferred"}),e.jsx("button",{onClick:()=>p(t.id),className:"text-xs font-mono",style:{color:"var(--color-a11oy-text-ghost)",background:"none",border:"none",cursor:"pointer"},children:"undo"})]}),t&&n[t.id]==="rejected"&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"text-xs font-mono px-2 py-1 rounded",style:{backgroundColor:"rgba(239,68,68,0.08)",color:"#ef4444",border:"1px solid rgba(239,68,68,0.2)"},children:"✕ Rejected"}),e.jsx("button",{onClick:()=>p(t.id),className:"text-xs font-mono",style:{color:"var(--color-a11oy-text-ghost)",background:"none",border:"none",cursor:"pointer"},children:"undo"})]}),s.evidenceRefs.length>0&&e.jsxs("div",{className:"mt-3 border-t pt-3",style:{borderColor:"var(--color-a11oy-border)"},children:[e.jsx("div",{className:"text-xs font-mono uppercase tracking-widest mb-2",style:{color:"var(--color-a11oy-text-ghost)"},children:"EVIDENCE REFS"}),e.jsx("div",{className:"flex flex-col gap-1",children:s.evidenceRefs.map(o=>e.jsx("div",{className:"text-xs font-mono px-2 py-1 rounded",style:{backgroundColor:"var(--color-a11oy-muted)",color:"var(--color-a11oy-text-ghost)"},children:o},o))})]})]}):e.jsxs("div",{className:"p-6 text-center text-xs",style:{color:"var(--color-a11oy-text-ghost)"},children:[e.jsx("div",{className:"text-3xl mb-2",style:{color:"var(--color-a11oy-border)"},children:"▸"}),"Select a signal to view details and action controls."]})})]})]}),e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs("div",{children:[e.jsxs(k,{children:["Active Agents (",B.length,")"]}),e.jsx("div",{className:"flex flex-col gap-2",children:B.map(o=>{const r=A[o.vertical]??"#5e5e5e",a=o.status==="pending_approval";return e.jsxs("div",{className:"rounded-lg border p-3",style:{backgroundColor:"var(--color-a11oy-card)",borderColor:"var(--color-a11oy-border)",borderLeft:`2px solid ${a?"#f97316":r}`},children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsx("span",{className:"text-xs font-medium",style:{color:"var(--color-a11oy-text)"},children:o.name}),e.jsx("span",{className:"text-xs font-mono",style:{color:l},children:o.trust})]}),e.jsx("div",{className:"text-xs mb-1 truncate",style:{color:"var(--color-a11oy-text-ghost)"},children:o.lastAction}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(C,{vertical:S[o.vertical]??o.vertical,color:r}),a&&e.jsx("span",{className:"text-xs font-mono",style:{color:"#f97316"},children:"⚬ approval"})]})]},o.id)})})]}),e.jsxs("div",{children:[e.jsxs(k,{children:["Pending Approvals (",L.length,")"]}),e.jsx("div",{className:"flex flex-col gap-2",children:L.map(o=>e.jsxs(N,{children:[e.jsx("div",{className:"text-xs font-medium mb-1 truncate",style:{color:"var(--color-a11oy-text)"},children:o.actionBrief.title}),e.jsxs("div",{className:"text-xs mb-2",style:{color:"var(--color-a11oy-text-ghost)"},children:["Tier: ",o.actionBrief.approvalTier," · ",o.actionBrief.priority," priority"]}),n[o.id]?n[o.id]==="approved"?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-mono",style:{color:"#22c55e"},children:"✓ Approved"}),e.jsx("button",{onClick:()=>p(o.id),className:"text-xs font-mono",style:{color:"var(--color-a11oy-text-ghost)",background:"none",border:"none",cursor:"pointer"},children:"undo"})]}):n[o.id]==="deferred"?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-mono",style:{color:"#c9b787"},children:"⏸ Deferred"}),e.jsx("button",{onClick:()=>p(o.id),className:"text-xs font-mono",style:{color:"var(--color-a11oy-text-ghost)",background:"none",border:"none",cursor:"pointer"},children:"undo"})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs font-mono",style:{color:"#ef4444"},children:"✕ Rejected"}),e.jsx("button",{onClick:()=>p(o.id),className:"text-xs font-mono",style:{color:"var(--color-a11oy-text-ghost)",background:"none",border:"none",cursor:"pointer"},children:"undo"})]}):e.jsxs("div",{className:"flex gap-1.5 flex-wrap",children:[e.jsx("button",{onClick:()=>m(o.id,"approved"),className:"text-xs px-2.5 py-1 rounded",style:{backgroundColor:"rgba(34,197,94,0.12)",color:"#22c55e",border:"1px solid rgba(34,197,94,0.25)",cursor:"pointer"},children:"✓ Approve"}),e.jsx("button",{onClick:()=>m(o.id,"deferred"),className:"text-xs px-2.5 py-1 rounded",style:{backgroundColor:"rgba(201,183,135,0.08)",color:"#c9b787",border:"1px solid rgba(201,183,135,0.2)",cursor:"pointer"},children:"⏸ Defer"}),e.jsx("button",{onClick:()=>m(o.id,"rejected"),className:"text-xs px-2.5 py-1 rounded",style:{backgroundColor:"rgba(239,68,68,0.08)",color:"#ef4444",border:"1px solid rgba(239,68,68,0.2)",cursor:"pointer"},children:"✕ Reject"})]})]},o.id))})]}),e.jsxs("div",{children:[e.jsx(k,{children:"Outcome Scorecard"}),e.jsx("div",{className:"flex flex-col gap-1.5",children:$.map(o=>{const r=ee[o.status]??l;return e.jsxs("div",{className:"flex items-center justify-between text-xs px-3 py-2 rounded-lg",style:{backgroundColor:"var(--color-a11oy-card)",border:"1px solid var(--color-a11oy-border)"},children:[e.jsx("span",{className:"truncate flex-1",style:{color:"var(--color-a11oy-text-sub)"},children:o.title.slice(0,32)}),e.jsx("span",{className:"font-mono ml-2 flex-shrink-0",style:{color:r},children:o.status.replace(/_/g," ")})]},o.id)})})]})]})]}),e.jsx("div",{className:"mt-2 text-xs text-center",style:{color:"var(--color-a11oy-text-ghost)"},children:i?"Live mode — connected to execution fabric.":"Governed execution fabric — all approval decisions are cryptographically signed and logged to the Proof Ledger."})]})}export{pe as CommandSurface};