import{t as e}from"./jsx-runtime-ZfyQks-z.js";import{t}from"./Play.es-D9AQgyVC.js";import{L as n,_ as r,g as i,h as a,v as o,y as s}from"./index-DW3P6_Qc.js";import{t as c}from"./renderers-hYnJAoYZ.js";var l=e();function u(e){let c=e.evals.find(t=>t.id===e.selectedEvalId)??e.evals[0];return e.enabled?(0,l.jsx)(`section`,{className:`grid min-h-0 overflow-auto bg-background/45`,children:(0,l.jsxs)(`div`,{className:`mx-auto grid w-full max-w-6xl content-start gap-5 p-6`,children:[(0,l.jsxs)(`header`,{className:`flex min-w-0 items-start justify-between gap-4 border-b border-border/80 pb-5`,children:[(0,l.jsxs)(`div`,{className:`min-w-0`,children:[(0,l.jsx)(`p`,{className:`m-0 font-mono text-[10px] font-semibold uppercase tracking-[0.16em] text-muted-foreground`,children:`Evals`}),(0,l.jsx)(`h1`,{className:`m-0 mt-2 text-2xl font-semibold tracking-tight text-foreground`,children:c?.name??`Eval suite`}),c?.description===void 0?null:(0,l.jsx)(`p`,{className:`m-0 mt-2 max-w-2xl text-sm leading-6 text-muted-foreground`,children:c.description})]}),(0,l.jsxs)(n,{className:`h-9 shrink-0 rounded-lg px-3 text-sm font-semibold`,disabled:c===void 0||e.runState===`running`,onClick:e.onRun,children:[(0,l.jsx)(t,{className:`mr-1.5 h-3.5 w-3.5`}),e.runState===`running`?`Running`:`Run`]})]}),(0,l.jsxs)(`div`,{className:`grid gap-5 lg:grid-cols-[320px_minmax(0,1fr)]`,children:[(0,l.jsxs)(`aside`,{className:`grid content-start gap-4`,children:[(0,l.jsxs)(`label`,{className:`grid gap-2`,htmlFor:`eval-suite-select`,children:[(0,l.jsx)(`span`,{className:`font-mono text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground`,children:`Suite`}),(0,l.jsxs)(a,{value:c?.id??``,onValueChange:e.onSelectEval,children:[(0,l.jsx)(o,{id:`eval-suite-select`,className:`h-9 w-full rounded-lg border-primary/55 bg-background font-mono text-[11px]`,children:(0,l.jsx)(s,{placeholder:`Select eval`})}),(0,l.jsx)(i,{children:e.evals.map(e=>(0,l.jsx)(r,{value:e.id,children:e.name},e.id))})]})]}),c===void 0?null:(0,l.jsxs)(`div`,{className:`grid gap-2`,children:[(0,l.jsx)(d,{label:`Cases`,value:String(c.caseCount)}),(0,l.jsx)(d,{label:`Metrics`,value:String(c.metricNames.length)}),(0,l.jsx)(d,{label:`Concurrency`,value:String(c.concurrency??1)})]})]}),(0,l.jsx)(`main`,{className:`min-w-0`,children:e.result===void 0?(0,l.jsx)(`div`,{className:`rounded-lg border border-border/80 bg-card/25 p-5 text-sm font-medium text-muted-foreground`,children:`Run a suite to inspect pass, fail, invalid, and per-case metric results.`}):(0,l.jsx)(f,{result:e.result})})]})]})}):(0,l.jsx)(`section`,{className:`grid min-h-0 place-items-center p-8 text-center`,children:(0,l.jsxs)(`div`,{className:`grid max-w-lg gap-3`,children:[(0,l.jsx)(`h1`,{className:`m-0 text-2xl font-semibold text-foreground`,children:`Evals unavailable`}),(0,l.jsx)(`p`,{className:`m-0 text-sm leading-6 text-muted-foreground`,children:`Register eval suites with Studio to run them from this workspace.`})]})})}function d(e){return(0,l.jsxs)(`div`,{className:`rounded-lg bg-card/35 px-3 py-3`,children:[(0,l.jsx)(`div`,{className:`font-mono text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground`,children:e.label}),(0,l.jsx)(`div`,{className:`mt-1 font-mono text-base font-semibold tabular-nums text-foreground`,children:e.value})]})}function f(e){let t=e.result.result;return(0,l.jsxs)(`article`,{className:`grid gap-4 rounded-lg border border-border/80 bg-card/25 p-4`,children:[(0,l.jsxs)(`div`,{className:`grid grid-cols-4 gap-2`,children:[(0,l.jsx)(d,{label:`Passed`,value:String(t.passed??0)}),(0,l.jsx)(d,{label:`Failed`,value:String(t.failed??0)}),(0,l.jsx)(d,{label:`Invalid`,value:String(t.invalid??0)}),(0,l.jsx)(d,{label:`Duration`,value:`${t.durationMs??e.result.durationMs}ms`})]}),(0,l.jsxs)(`div`,{className:`grid gap-2`,children:[(0,l.jsx)(`div`,{className:`font-mono text-[9px] font-semibold uppercase tracking-[0.14em] text-muted-foreground`,children:`Result`}),(0,l.jsx)(`pre`,{className:`max-h-[60vh] overflow-auto whitespace-pre-wrap break-words rounded-lg border border-border/80 bg-background/55 p-3 font-mono text-xs leading-5 text-foreground`,children:(0,l.jsx)(c,{text:JSON.stringify(e.result.result,null,2)})})]})]})}export{u as EvalsPage};
//# sourceMappingURL=evals-page-GEsRKWxr.js.map