@straiffi/archon 1.2.16 → 1.2.17

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@straiffi/archon",
3
- "version": "1.2.16",
3
+ "version": "1.2.17",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",
@@ -1,5 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-BYbx6iT9.js";import{At as t,Mt as n,Nt as r,Rt as i,Wt as a,_t as o,a as s,c,h as l,i as u,l as d,m as f,n as p,o as m,r as ee,s as te,t as h,u as g,zt as _}from"./dropdown-menu-CHiEwVjq.js";import{a as v,c as y,d as b,f as x,h as S,i as C,l as w,m as ne,n as T,o as E,p as D,r as O,s as re,t as k,u as ie}from"./index-BpEzCfrc.js";var A=e(a(),1),ae=(e,t)=>_(r(`/projects/${e}/test-sessions`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to open the test runner right now.`}),oe=(e,t)=>_(r(`/tickets/${e}/test-sessions${t?`?project_id=${encodeURIComponent(t)}`:``}`),{method:`POST`,fallbackErrorMessage:`Unable to open the test runner right now.`}),se=(e,t={})=>_(r(`/test-sessions/${e}/discovery${t.commandId?`?command_id=${encodeURIComponent(t.commandId)}`:``}`),{signal:t.signal,fallbackErrorMessage:`Unable to discover tests right now.`}),ce=(e,t)=>_(r(`/test-sessions/${e}/run`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to start the selected tests right now.`}),le=e=>_(r(`/test-sessions/${e}/stop`),{method:`POST`,fallbackErrorMessage:`Unable to stop the test run right now.`}),ue=e=>i(r(`/test-sessions/${e}`),{method:`DELETE`,fallbackErrorMessage:`Unable to close the test runner right now.`}),j=t(),M=256*1024,N=24,P=RegExp(`\x1B\\[[0-9;?]*[ -/]*[@-~]`,`g`),F=(e,t)=>m.t(`common:testsDialog.${e}`,t),de=(e,t)=>{let n=`${e}${t}`;return n.length<=M?n:n.slice(-M)},I=e=>e.replace(P,``),fe=e=>e.scrollHeight-e.scrollTop-e.clientHeight<=N,L=e=>{e.scrollTop=e.scrollHeight},pe=(e,t=!1)=>{L(e);let n=0,r=0;return n=window.requestAnimationFrame(()=>{L(e),t&&(r=window.requestAnimationFrame(()=>{L(e)}))}),()=>{window.cancelAnimationFrame(n),r!==0&&window.cancelAnimationFrame(r)}},me=e=>{if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.flatMap(e=>{if(!e||typeof e!=`object`||Array.isArray(e))return[];let t=e;if(typeof t.id!=`string`||typeof t.name!=`string`||typeof t.command!=`string`)return[];let n=t.runner===`vitest`||t.runner===`jest`||t.runner===`unknown`?t.runner:`auto`;return[{id:t.id,name:t.name,command:t.command,runner:n,...typeof t.cwd==`string`&&t.cwd.trim()!==``?{cwd:t.cwd}:{}}]}):[]}catch{return[]}},R=e=>e===`running`?`border-sky-400/40 bg-sky-500/10 text-sky-200`:e===`passed`?`border-emerald-400/40 bg-emerald-500/10 text-emerald-200`:e===`failed`||e===`error`?`border-rose-400/40 bg-rose-500/10 text-rose-200`:e===`stopped`?`border-amber-400/40 bg-amber-500/10 text-amber-200`:`border-border/70 bg-background/60 text-muted-foreground`,he=e=>e==null?null:e<1e3?`${e} ms`:`${(e/1e3).toFixed(e>=1e4?0:1)} s`,z=e=>{let t=e.split(`/`);return t[t.length-1]||e},B=e=>e.toLowerCase().trim().split(/\s+/).filter(Boolean),V=(e,t)=>e.length===0?!0:e.every(e=>t.some(t=>t.includes(e))),H=(e,t)=>{let n=B(t);return n.length===0?e:e.flatMap(e=>{let t=z(e.path);if(V(n,[t.toLowerCase(),e.path.toLowerCase()]))return[e];let r=e.cases.filter(r=>V(n,[t.toLowerCase(),e.path.toLowerCase(),r.name.toLowerCase()]));return r.length===0?[]:[{...e,cases:r}]})},U=e=>F(e===`passed`?`status.passed`:e===`failed`?`status.failed`:e===`running`?`status.running`:e===`error`?`status.error`:e===`stopped`?`status.stopped`:`status.idle`),ge=e=>e?.selection?e.selection.kind===`all`?F(`selection.allTests`):e.selection.kind===`case`?e.selection.name:z(e.selection.path):F(`selection.noRunYet`),W=e=>/(^|\s)(?:FAIL|✗)(\s|$)|\b(?:failed|error|stderr|Expected:|Received:)\b/i.test(e)?`failure`:/(^|\s)(?:PASS|✓)(\s|$)|\bpassed\b/i.test(e)?`success`:/\b(?:WARN|warning|skipped|todo|pending)\b/i.test(e)?`warning`:`default`,G=e=>e===`failure`?`text-rose-200`:e===`success`?`text-emerald-200`:e===`warning`?`text-amber-200`:`text-slate-200`,_e=(e,t)=>e===t?!0:e.length===t.length?e.every((e,n)=>{let r=t[n];return r!=null&&e.id===r.id&&e.name===r.name&&e.command===r.command&&e.cwd===r.cwd&&e.runner===r.runner}):!1,ve=`min-w-24 justify-center shadow-none transition-none disabled:opacity-100`,K=({line:e,tone:t})=>(0,j.jsx)(`div`,{"data-tone":t,className:l(`whitespace-pre-wrap break-words`,G(t)),children:e===``?` `:e}),q=(0,A.memo)(({canRunGranular:e,filePath:t,isActive:n,name:r,onRunCase:i})=>(0,j.jsxs)(`button`,{type:`button`,"aria-label":F(`caseRow.runAriaLabel`,{name:r}),title:r,className:l(`flex w-full min-w-0 items-center gap-2.5 rounded-xl px-2.5 py-1.5 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,e?`cursor-pointer hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,n&&`bg-sky-500/10`),disabled:!e,onClick:()=>{i(t,r)},children:[(0,j.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full bg-sky-300/80`}),(0,j.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:r})]}));q.displayName=`TestCaseRow`;var J=(0,A.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:r,file:i,isExpanded:a,onRunCase:o,onRunFile:s,onToggleFile:c})=>{let u=e===`file`&&n===i.path,p=e===`case`&&n===i.path;return(0,j.jsx)(O,{open:a,onOpenChange:e=>{c(i.path,e)},children:(0,j.jsxs)(`div`,{className:`space-y-1`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,j.jsx)(v,{asChild:!0,children:(0,j.jsx)(f,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":F(a?`fileRow.collapseAriaLabel`:`fileRow.expandAriaLabel`,{path:i.path}),className:`mt-1 shrink-0 text-muted-foreground hover:text-foreground`,children:(0,j.jsx)(d,{className:l(`h-4 w-4 transition-transform`,a&&`rotate-180`)})})}),(0,j.jsx)(`button`,{type:`button`,"aria-label":F(`fileRow.runAriaLabel`,{path:i.path}),className:l(`min-w-0 flex-1 rounded-xl border border-border/60 bg-background/20 px-2.5 py-2 text-left transition-colors outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,r?`cursor-pointer hover:border-sky-400/35 hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,(u||p)&&`border-sky-400/45 bg-sky-500/10`),disabled:!r,onClick:()=>{s(i.path)},children:(0,j.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,j.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-md border border-border/70 bg-background/60 text-sky-200`,children:(0,j.jsx)(T,{className:`h-3.5 w-3.5`})}),(0,j.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-start justify-between gap-3`,children:[(0,j.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,j.jsx)(`span`,{className:`block truncate text-xs font-medium text-foreground`,children:z(i.path)}),(0,j.jsx)(`span`,{className:`mt-0.5 block truncate text-[11px] text-muted-foreground`,children:i.path})]}),(0,j.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:F(`fileRow.testCount`,{count:i.cases.length})})]})]})})]}),(0,j.jsx)(C,{children:(0,j.jsx)(`div`,{className:`ml-4 border-l border-border/60 pl-6`,children:i.cases.length===0?(0,j.jsx)(`p`,{className:`px-2.5 py-1.5 text-xs text-muted-foreground`,children:F(`fileRow.noNamedTests`)}):(0,j.jsx)(`div`,{className:`space-y-1`,children:i.cases.map(a=>{let s=e===`case`&&n===i.path&&t===a.name;return(0,j.jsx)(q,{canRunGranular:r,filePath:i.path,isActive:s,name:a.name,onRunCase:o},a.id)})})})})]})})});J.displayName=`DiscoveryFileRow`;var ye=(0,A.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,availableCommands:r,canRunGranular:i,discovery:a,expandedFiles:o,fullSuiteOnlyNotice:s,isLoading:m,selectedCommandId:_,selectedCommandName:v,sessionError:y,sessionStatus:b,shouldShowCommandSelector:x,onRunCase:S,onRunFile:C,onSelectCommand:w,onToggleFile:ne})=>{let[T,E]=(0,A.useState)(``),D=(0,A.useMemo)(()=>H(a,T),[a,T]),O=(0,A.useMemo)(()=>D.reduce((e,t)=>e+t.cases.length,0),[D]),re=B(T).length>0;return(0,j.jsx)(`aside`,{className:`min-h-0 border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:(0,j.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[x&&(0,j.jsxs)(`div`,{className:`space-y-2`,children:[(0,j.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:F(`scope.label`)}),(0,j.jsxs)(h,{children:[(0,j.jsx)(u,{asChild:!0,children:(0,j.jsxs)(f,{type:`button`,variant:`outline`,className:`w-full justify-between rounded-xl border-border/70 bg-background/60`,"aria-label":F(`scope.selectedCommandAriaLabel`),disabled:r.length===0||b===`running`,children:[(0,j.jsx)(`span`,{className:`truncate`,children:v??F(`scope.selectTestScope`)}),(0,j.jsx)(d,{className:`h-4 w-4 text-muted-foreground`})]})}),(0,j.jsx)(p,{align:`start`,className:`w-72`,children:r.map(e=>(0,j.jsx)(ee,{className:l(_===e.id&&`bg-accent text-accent-foreground`),onSelect:()=>{w(e.id)},children:(0,j.jsx)(`span`,{className:`truncate`,children:e.name})},e.id))})]})]}),s&&(0,j.jsx)(`div`,{className:`rounded-2xl border border-border/70 bg-background/30 px-4 py-3 text-sm text-muted-foreground`,children:s}),(a.length>0||T.length>0)&&(0,j.jsxs)(`div`,{className:`relative mt-1 shrink-0`,children:[(0,j.jsx)(g,{type:`search`,value:T,onChange:e=>{E(e.target.value)},placeholder:F(`filter.placeholder`),"aria-label":F(`filter.ariaLabel`),className:`pr-10`}),T.length>0&&(0,j.jsx)(f,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":F(`filter.clearAriaLabel`),className:`absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:()=>{E(``)},children:(0,j.jsx)(te,{className:`size-4`})})]}),!r.length&&(0,j.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-4 text-sm text-muted-foreground`,children:F(`discovery.noCommands`)}),y&&(0,j.jsx)(`div`,{className:`rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:y}),(0,j.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-3 overflow-hidden rounded-2xl border border-border/70 bg-background/20 p-4`,children:[(0,j.jsxs)(`div`,{className:`shrink-0 flex items-start justify-between gap-3`,children:[(0,j.jsx)(`div`,{className:`min-w-0`,children:(0,j.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[F(`discovery.fileCount`,{count:D.length}),`, `,F(`discovery.caseCount`,{count:O})]})}),m&&(0,j.jsx)(c,{className:`h-4 w-4 animate-spin text-muted-foreground`})]}),(0,j.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto pr-1`,children:a.length===0&&!m?(0,j.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:F(`discovery.noFilesDetected`)}):D.length===0?(0,j.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:F(`discovery.noFilterMatches`)}):D.map(r=>(0,j.jsx)(J,{activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:i,file:r,isExpanded:re||(o[r.path]??!1),onRunCase:S,onRunFile:C,onToggleFile:ne},r.path))})]})]})})});ye.displayName=`DiscoveryPane`;var be=(0,A.memo)(({durationMs:e,output:t,outputTruncated:n,selectionLabel:r,status:i,summaryCounts:a,viewportRef:o,onScroll:c})=>{let u=(0,A.useMemo)(()=>t?I(t).replaceAll(`\r
2
- `,`
3
- `).replaceAll(`\r`,`
4
- `).split(`
5
- `).map(e=>({line:e,tone:W(e)})):[],[t]);return(0,j.jsx)(`section`,{className:`min-h-0 px-4 py-4`,children:(0,j.jsxs)(`div`,{className:`flex h-full flex-col gap-3`,children:[(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,j.jsx)(`span`,{className:`font-medium text-foreground`,children:r}),i&&(0,j.jsx)(s,{variant:`outline`,className:l(`px-3 py-1 text-xs uppercase tracking-[0.2em]`,R(i)),children:U(i)}),a&&(0,j.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-xs font-medium uppercase tracking-[0.18em]`,children:[(0,j.jsxs)(`span`,{className:`text-rose-200`,children:[a.failed.count,` `,a.failed.label]}),(0,j.jsxs)(`span`,{className:`text-emerald-200`,children:[a.passed.count,` `,a.passed.label]})]}),e!=null&&(0,j.jsx)(`span`,{className:`text-muted-foreground`,children:he(e)}),n&&(0,j.jsx)(s,{variant:`outline`,className:`border-amber-400/30 bg-amber-500/10 text-amber-200`,children:F(`output.trimmed`)})]}),(0,j.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden rounded-2xl border border-border/70 bg-[#0d1017]`,children:(0,j.jsx)(`div`,{ref:o,"aria-label":F(`output.ariaLabel`),className:`h-full overflow-auto px-4 py-4`,onScroll:c,children:(0,j.jsx)(`div`,{className:`font-mono text-xs leading-5`,children:u.length>0?u.map((e,t)=>(0,j.jsx)(K,{line:e.line,tone:e.tone},`${t}:${e.line}`)):(0,j.jsx)(`div`,{className:`text-slate-200`,children:F(`output.empty`)})})})})]})})});be.displayName=`OutputPane`;var xe=({testCommands:e,onClose:t,...r})=>{let i=r.scope,a=r.projectId,s=r.scope===`ticket`?r.ticketId:null,c=r.scope===`project`?r.targetKind:null,l=r.scope===`project`?r.targetBundleId:null,[u,d]=(0,A.useState)(e),[p,m]=(0,A.useState)(null),[ee,h]=(0,A.useState)([]),[g,_]=(0,A.useState)(``),[v,C]=(0,A.useState)({}),[T,O]=(0,A.useState)(!0),[M,N]=(0,A.useState)(!1),[P,I]=(0,A.useState)(!1),[L,R]=(0,A.useState)(null),[he,z]=(0,A.useState)(!1),[B,V]=(0,A.useState)(!1),H=(0,A.useRef)(null),U=(0,A.useRef)(!1),W=(0,A.useRef)(null),G=(0,A.useRef)(!0),K=(0,A.useRef)(null),q=(0,A.useRef)(null),J=p?.selection?.kind??null,xe=p?.selection?.kind===`all`?null:p?.selection?.path??null,Se=p?.selection?.kind===`case`?p.selection.name:null,Y=p?.id??null,X=p?.status??null,Z=(0,A.useMemo)(()=>u.find(e=>e.id===g)??null,[u,g]),Ce=(0,A.useMemo)(()=>{if(p?.summary?.failed_count==null&&p?.summary?.passed_count==null&&p?.summary?.failed_file_count==null&&p?.summary?.passed_file_count==null)return null;let e=p?.summary?.failed_count==null&&p?.summary?.passed_count==null;return{failed:X===`failed`&&p?.summary?.failed_count==null&&p?.summary?.failed_file_count!=null||e?{count:p?.summary?.failed_file_count??0,label:F(`summaryCounts.filesFailed`)}:{count:p?.summary?.failed_count??0,label:F(`summaryCounts.failed`)},passed:e?{count:p?.summary?.passed_file_count??0,label:F(`summaryCounts.filesPassed`)}:{count:p?.summary?.passed_count??p?.summary?.passed_file_count??0,label:F(`summaryCounts.passed`)}}},[p?.summary?.failed_count,p?.summary?.passed_count,p?.summary?.failed_file_count,p?.summary?.passed_file_count,X]),we=Z?.runner===`unknown`?F(`scope.fullSuiteOnlyNotice`):null,Te=!!(Z&&p?.status!==`running`&&!M&&!P),Ee=Te,De=Te&&B,Oe=u.length>1;(0,A.useEffect)(()=>{g||u.length===0||_(u[0]?.id??``)},[u,g]),(0,A.useEffect)(()=>{e.length>0&&d(t=>_e(t,e)?t:e)},[e]),(0,A.useEffect)(()=>{if(u.length>0||!a)return;let e=new AbortController;return o(e.signal).then(e=>{let t=e.find(e=>e.id===a);t&&d(e=>{let n=me(t.test_commands);return _e(e,n)?e:n})}).catch(()=>{}),()=>{e.abort()}},[u.length,a]),(0,A.useEffect)(()=>{let e=e=>{!e||e.id!==H.current||m(e)},t=e=>{!e||e.session_id!==H.current||m(t=>!t||t.id!==e.session_id?t:{...t,output:de(t.output,e.chunk),output_truncated:e.output_truncated})};return k.on(`test-session:updated`,e),k.on(`test-session:output`,t),()=>{k.off(`test-session:updated`,e),k.off(`test-session:output`,t)}},[]),(0,A.useEffect)(()=>{let e=W.current;if(!e){K.current=p?.output??null,q.current=p?.status??null;return}let t=K.current!==(p?.output??null),n=q.current!==`running`&&p?.status===`running`,r=q.current===`running`&&p?.status!==`running`;if(n&&(G.current=!0),n||t&&p?.status===`running`&&G.current||r&&G.current){let t=pe(e,r);return K.current=p?.output??null,q.current=p?.status??null,t}K.current=p?.output??null,q.current=p?.status??null},[p?.output,p?.status]),(0,A.useEffect)(()=>{let e=!1;return(async()=>{try{let t=i===`project`?await ae(a,{target_kind:c??`repo_root`,target_bundle_id:l??null}):await oe(s??``,a);if(e)return;H.current=t.id,m(t)}catch(t){e||R(t instanceof n?t.message:F(`messages.loadRunnerError`))}finally{!e&&H.current==null&&O(!1)}})(),()=>{e=!0}},[a,i,l,c,s]),(0,A.useEffect)(()=>{if(!p?.id){V(!1);return}if(u.length>0&&!g){V(!1);return}let e=new AbortController,t=!1;return O(!0),V(!1),se(p.id,{commandId:g||null,signal:e.signal}).then(e=>{t||(h(e.files),V(e.supports_granular_selection))}).catch(r=>{t||e.signal.aborted||R(r instanceof n?r.message:F(`messages.discoverError`))}).finally(()=>{t||O(!1)}),()=>{t=!0,e.abort()}},[u.length,g,p?.id]),(0,A.useEffect)(()=>()=>{let e=H.current;!e||U.current||(U.current=!0,ue(e).catch(()=>{}))},[]);let Q=(0,A.useCallback)(async e=>{if(!(!Y||X===`running`||!Z||M||P)){R(null),N(!0);try{m(await ce(Y,{command_id:Z.id,selection:e}))}catch(e){R(e instanceof n?e.message:F(`messages.startError`))}finally{N(!1)}}},[M,P,Z,Y,X]),ke=(0,A.useCallback)(async()=>{if(!(!Y||X!==`running`||P)){R(null),I(!0);try{m(await le(Y))}catch(e){R(e instanceof n?e.message:F(`messages.stopError`))}finally{I(!1)}}},[P,Y,X]),$=(0,A.useCallback)(()=>{let e=H.current;if(!e||U.current){t();return}U.current=!0,t(),ue(e).catch(()=>{})},[t]),Ae=(0,A.useCallback)(()=>{if(X===`running`){z(!0);return}$()},[$,X]),je=(0,A.useCallback)(()=>{let e=W.current;e&&(G.current=fe(e))},[]),Me=(0,A.useCallback)(e=>{_(e)},[]),Ne=(0,A.useCallback)((e,t)=>{C(n=>(n[e]??!1)===t?n:{...n,[e]:t})},[]),Pe=(0,A.useCallback)(e=>{Q({kind:`file`,path:e})},[Q]),Fe=(0,A.useCallback)((e,t)=>{Q({kind:`case`,path:e,name:t})},[Q]);return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(w,{open:!0,onOpenChange:e=>{e||Ae()},children:(0,j.jsxs)(b,{showCloseButton:!1,overlayClassName:`bg-black/70`,className:`flex h-[calc(100vh-2rem)] max-h-[58rem] w-full max-w-[calc(100%-1rem)] flex-col gap-0 overflow-hidden rounded-3xl border border-[#2a2a38] bg-[#16161f] p-0 shadow-2xl sm:max-w-7xl`,children:[(0,j.jsx)(S,{className:`sr-only`,children:F(`dialog.srTitle`)}),(0,j.jsx)(x,{className:`sr-only`,children:F(`dialog.srDescription`)}),(0,j.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border px-6 py-4`,children:[(0,j.jsx)(`div`,{className:`min-w-0`,children:(0,j.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,j.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-2xl border border-border/70 bg-background/60 text-sky-200`,children:(0,j.jsx)(y,{className:`h-5 w-5`})}),(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{className:`text-2xl font-semibold text-foreground`,children:F(`dialog.title`)}),(0,j.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:p?.target_label??F(`dialog.preparingTarget`)})]})]})}),(0,j.jsx)(ie,{asChild:!0,children:(0,j.jsx)(f,{type:`button`,"aria-label":F(`dialog.closeAriaLabel`),variant:`ghost`,size:`icon-sm`,className:`cursor-pointer text-muted-foreground hover:text-foreground`,children:(0,j.jsx)(te,{className:`h-4 w-4`})})})]}),(0,j.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-0 lg:grid-cols-[22rem_minmax(0,1fr)]`,children:[(0,j.jsx)(ye,{activeSelectionKind:J,activeSelectionName:Se,activeSelectionPath:xe,availableCommands:u,canRunGranular:De,discovery:ee,expandedFiles:v,fullSuiteOnlyNotice:we,isLoading:T,selectedCommandId:g,selectedCommandName:Z?.name??null,sessionError:L,sessionStatus:X,shouldShowCommandSelector:Oe,onRunCase:Fe,onRunFile:Pe,onSelectCommand:Me,onToggleFile:Ne}),(0,j.jsx)(be,{durationMs:p?.duration_ms??null,output:p?.output??``,outputTruncated:p?.output_truncated??!1,selectionLabel:ge(p),status:X,summaryCounts:Ce,viewportRef:W,onScroll:je})]}),(0,j.jsx)(D,{className:`border-t border-border/70 px-6 py-4 sm:flex-row sm:items-center sm:justify-end`,children:(0,j.jsx)(`div`,{className:`flex items-center justify-end gap-2`,children:p?.status===`running`?(0,j.jsxs)(f,{type:`button`,variant:`destructive`,className:ve,onClick:()=>{ke()},disabled:P,children:[(0,j.jsx)(E,{className:`h-4 w-4`}),(0,j.jsx)(`span`,{children:F(`actions.stop`)})]}):(0,j.jsxs)(f,{type:`button`,variant:`success`,className:ve,disabled:!Ee,onClick:()=>{Q({kind:`all`})},children:[(0,j.jsx)(re,{className:`h-4 w-4`}),(0,j.jsx)(`span`,{children:F(`actions.run`)})]})})})]})}),(0,j.jsx)(w,{open:he,onOpenChange:z,children:(0,j.jsxs)(b,{showCloseButton:!1,overlayClassName:`z-[60] bg-black/60`,className:`z-[60] max-w-md rounded-2xl border border-border bg-card p-6 shadow-2xl`,children:[(0,j.jsxs)(ne,{children:[(0,j.jsx)(S,{className:`text-sm font-semibold uppercase tracking-widest text-muted-foreground`,children:F(`closeConfirmation.title`)}),(0,j.jsx)(x,{className:`text-sm text-foreground whitespace-pre-line`,children:F(`closeConfirmation.description`)})]}),(0,j.jsxs)(D,{className:`sm:flex-row sm:justify-end`,children:[(0,j.jsx)(f,{type:`button`,variant:`ghost`,onClick:()=>z(!1),children:F(`closeConfirmation.keepRunning`)}),(0,j.jsx)(f,{type:`button`,variant:`destructive`,onClick:()=>{z(!1),$()},children:F(`closeConfirmation.stopAndClose`)})]})]})})]})};export{xe as TestsDialog};