@straiffi/archon 1.8.21 → 1.8.23

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 (133) hide show
  1. package/dist/client/assets/{ActivityView-BcguXTZ5.js → ActivityView-BaIZ8eHC.js} +1 -1
  2. package/dist/client/assets/GitHubActionsDialog-BFCqikDY.js +1 -0
  3. package/dist/client/assets/VerificationDialog-B1_6HMdt.js +4 -0
  4. package/dist/client/assets/{architectureDiagram-3BPJPVTR-DnC7Twj0.js → architectureDiagram-3BPJPVTR-Dl5UF67P.js} +1 -1
  5. package/dist/client/assets/{blockDiagram-GPEHLZMM-D0VbjiKd.js → blockDiagram-GPEHLZMM-DCcERfrZ.js} +1 -1
  6. package/dist/client/assets/{c4Diagram-AAUBKEIU-CzQ3l15K.js → c4Diagram-AAUBKEIU-BGhbASFm.js} +1 -1
  7. package/dist/client/assets/channel-BfskvH2B.js +1 -0
  8. package/dist/client/assets/{chunk-2J33WTMH-B5UGiqLW.js → chunk-2J33WTMH-C1ARozTV.js} +1 -1
  9. package/dist/client/assets/{chunk-3OPIFGDE-SCksTqtu.js → chunk-3OPIFGDE-BEovLizF.js} +1 -1
  10. package/dist/client/assets/{chunk-5ZQYHXKU-IOkwLOtG.js → chunk-5ZQYHXKU-C5MmlLa_.js} +1 -1
  11. package/dist/client/assets/{chunk-727SXJPM-Do60Xs9p.js → chunk-727SXJPM-8y8jBk4n.js} +1 -1
  12. package/dist/client/assets/{chunk-AQP2D5EJ-CuQT3imB.js → chunk-AQP2D5EJ-q-mByAd3.js} +1 -1
  13. package/dist/client/assets/{chunk-CSCIHK7Q-BkxMIESX.js → chunk-CSCIHK7Q-BOx2mLSz.js} +1 -1
  14. package/dist/client/assets/{chunk-KSCS5N6A-uUU3sWgR.js → chunk-KSCS5N6A-zEwQFq7q.js} +1 -1
  15. package/dist/client/assets/{chunk-L5ZTLDWV-DLYccV6J.js → chunk-L5ZTLDWV-C80z6rY_.js} +1 -1
  16. package/dist/client/assets/{chunk-LZXEDZCA-CgJFfCRZ.js → chunk-LZXEDZCA-BLaEsGPd.js} +2 -2
  17. package/dist/client/assets/{chunk-ND2GUHAM-D7IQSQfK.js → chunk-ND2GUHAM-x26BZ95L.js} +1 -1
  18. package/dist/client/assets/{chunk-NZK2D7GU-B4O6JWAo.js → chunk-NZK2D7GU-D2WAxr1p.js} +1 -1
  19. package/dist/client/assets/{chunk-O5CBEL6O-DidlQEqb.js → chunk-O5CBEL6O-DDPCrzKh.js} +1 -1
  20. package/dist/client/assets/{chunk-WU5MYG2G-2-oq_Gue.js → chunk-WU5MYG2G-CE-JcvIc.js} +1 -1
  21. package/dist/client/assets/classDiagram-4FO5ZUOK-D4HPfxL3.js +1 -0
  22. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-DQQ_WqAU.js +1 -0
  23. package/dist/client/assets/{dagre-BM42HDAG-TubuN0hR.js → dagre-BM42HDAG-Bf7wpUk_.js} +1 -1
  24. package/dist/client/assets/{diagram-2AECGRRQ-DNcUk6rV.js → diagram-2AECGRRQ-BQoKmc3B.js} +1 -1
  25. package/dist/client/assets/{diagram-5GNKFQAL-B1sJn4w_.js → diagram-5GNKFQAL-D2jarPLn.js} +1 -1
  26. package/dist/client/assets/{diagram-KO2AKTUF-CnW6ZuQe.js → diagram-KO2AKTUF-Bcbbjvsl.js} +1 -1
  27. package/dist/client/assets/{diagram-LMA3HP47-YHUmDzyS.js → diagram-LMA3HP47-t862RRBQ.js} +1 -1
  28. package/dist/client/assets/{diagram-OG6HWLK6-BkOQphxq.js → diagram-OG6HWLK6-CacbMcO0.js} +1 -1
  29. package/dist/client/assets/{erDiagram-TEJ5UH35-oNMxAdxN.js → erDiagram-TEJ5UH35-DRQ79baI.js} +1 -1
  30. package/dist/client/assets/{flowDiagram-I6XJVG4X-ByuCV-Am.js → flowDiagram-I6XJVG4X-BfW4KEdc.js} +1 -1
  31. package/dist/client/assets/{ganttDiagram-6RSMTGT7-CRkNH8Ft.js → ganttDiagram-6RSMTGT7-BPIl0TAj.js} +1 -1
  32. package/dist/client/assets/{gitGraphDiagram-PVQCEYII-DRXzXjd8.js → gitGraphDiagram-PVQCEYII-CRIusBMV.js} +1 -1
  33. package/dist/client/assets/index-CZ1z72fo.js +276 -0
  34. package/dist/client/assets/index-SMj5ZmMs.css +2 -0
  35. package/dist/client/assets/{infoDiagram-5YYISTIA-CJ4-hWch.js → infoDiagram-5YYISTIA-DTKzK8EJ.js} +1 -1
  36. package/dist/client/assets/{ishikawaDiagram-YF4QCWOH-CW1xqvim.js → ishikawaDiagram-YF4QCWOH-DVIHZLvL.js} +1 -1
  37. package/dist/client/assets/{journeyDiagram-JHISSGLW-BVVFg8_h.js → journeyDiagram-JHISSGLW-CQBZ4tCx.js} +1 -1
  38. package/dist/client/assets/{kanban-definition-UN3LZRKU-AcLZ63tA.js → kanban-definition-UN3LZRKU-D7naegR0.js} +1 -1
  39. package/dist/client/assets/{line-CG_TG6Ci.js → line-CizZlaeV.js} +1 -1
  40. package/dist/client/assets/{mermaid-parser.core-UDLSm_c3.js → mermaid-parser.core-NrDqgpZa.js} +1 -1
  41. package/dist/client/assets/{mermaid.core-IvBk22DF.js → mermaid.core-CwVO3oX0.js} +3 -3
  42. package/dist/client/assets/{mindmap-definition-RKZ34NQL-BflWNtnl.js → mindmap-definition-RKZ34NQL-BWxy3Aa_.js} +1 -1
  43. package/dist/client/assets/{pieDiagram-4H26LBE5-Dm1iGMm7.js → pieDiagram-4H26LBE5-B3gXpmBn.js} +1 -1
  44. package/dist/client/assets/{quadrantDiagram-W4KKPZXB-CM4zJd_R.js → quadrantDiagram-W4KKPZXB-Dpp4g8Al.js} +1 -1
  45. package/dist/client/assets/{requirementDiagram-4Y6WPE33-miuP86cp.js → requirementDiagram-4Y6WPE33-lFKXnxml.js} +1 -1
  46. package/dist/client/assets/{sankeyDiagram-5OEKKPKP-zUcRagtr.js → sankeyDiagram-5OEKKPKP-BBdtwqrS.js} +1 -1
  47. package/dist/client/assets/{sequenceDiagram-3UESZ5HK-BRYqVpsT.js → sequenceDiagram-3UESZ5HK-ANpVZzqm.js} +1 -1
  48. package/dist/client/assets/{stateDiagram-AJRCARHV-DwcF0DJm.js → stateDiagram-AJRCARHV-D58ZxmKY.js} +1 -1
  49. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-Cv8cmDfz.js +1 -0
  50. package/dist/client/assets/{timeline-definition-PNZ67QCA-BzH929s_.js → timeline-definition-PNZ67QCA-B6FK8IQC.js} +1 -1
  51. package/dist/client/assets/{vennDiagram-CIIHVFJN-BIq8rooy.js → vennDiagram-CIIHVFJN-lFWtZEEY.js} +1 -1
  52. package/dist/client/assets/{wardleyDiagram-YWT4CUSO-CyV_gL5J.js → wardleyDiagram-YWT4CUSO-DteAVp4l.js} +1 -1
  53. package/dist/client/assets/{xychartDiagram-2RQKCTM6-Dxo-U-qe.js → xychartDiagram-2RQKCTM6-CNcDlRLN.js} +1 -1
  54. package/dist/client/index.html +2 -2
  55. package/dist/server/db.js +359 -21
  56. package/dist/server/db.js.map +1 -1
  57. package/dist/server/index.js +152 -4
  58. package/dist/server/index.js.map +1 -1
  59. package/dist/server/lib/approvalReconciliation.js +101 -0
  60. package/dist/server/lib/approvalReconciliation.js.map +1 -0
  61. package/dist/server/lib/approvalRequests.js +587 -0
  62. package/dist/server/lib/approvalRequests.js.map +1 -0
  63. package/dist/server/lib/approvalRoutes.js +143 -0
  64. package/dist/server/lib/approvalRoutes.js.map +1 -0
  65. package/dist/server/lib/buildExecutionEnvironment.js +128 -11
  66. package/dist/server/lib/buildExecutionEnvironment.js.map +1 -1
  67. package/dist/server/lib/checkDefinitions.js +29 -1
  68. package/dist/server/lib/checkDefinitions.js.map +1 -1
  69. package/dist/server/lib/checkRunner.js +306 -27
  70. package/dist/server/lib/checkRunner.js.map +1 -1
  71. package/dist/server/lib/checkRuns.js +4 -2
  72. package/dist/server/lib/checkRuns.js.map +1 -1
  73. package/dist/server/lib/consequentialActionAuthority.js +142 -0
  74. package/dist/server/lib/consequentialActionAuthority.js.map +1 -0
  75. package/dist/server/lib/consequentialActions.js +231 -0
  76. package/dist/server/lib/consequentialActions.js.map +1 -0
  77. package/dist/server/lib/dockerSandboxEnvironmentOperations.js +119 -0
  78. package/dist/server/lib/dockerSandboxEnvironmentOperations.js.map +1 -1
  79. package/dist/server/lib/dockerSandboxExecutionEnvironment.js +194 -14
  80. package/dist/server/lib/dockerSandboxExecutionEnvironment.js.map +1 -1
  81. package/dist/server/lib/dockerSandboxExecutionProvider.js +1 -1
  82. package/dist/server/lib/dockerSandboxExecutionProvider.js.map +1 -1
  83. package/dist/server/lib/dockerSandboxNetworkPolicy.js +222 -0
  84. package/dist/server/lib/dockerSandboxNetworkPolicy.js.map +1 -0
  85. package/dist/server/lib/executionEnvironmentContexts.js +4 -2
  86. package/dist/server/lib/executionEnvironmentContexts.js.map +1 -1
  87. package/dist/server/lib/executionEnvironmentLifecycle.js +34 -0
  88. package/dist/server/lib/executionEnvironmentLifecycle.js.map +1 -1
  89. package/dist/server/lib/executionEnvironmentRoutes.js +68 -6
  90. package/dist/server/lib/executionEnvironmentRoutes.js.map +1 -1
  91. package/dist/server/lib/executionEnvironmentValidation.js +71 -5
  92. package/dist/server/lib/executionEnvironmentValidation.js.map +1 -1
  93. package/dist/server/lib/executionEnvironmentValidationOperations.js +155 -11
  94. package/dist/server/lib/executionEnvironmentValidationOperations.js.map +1 -1
  95. package/dist/server/lib/executionEnvironments.js +11 -5
  96. package/dist/server/lib/executionEnvironments.js.map +1 -1
  97. package/dist/server/lib/executionProfileStore.js +12 -3
  98. package/dist/server/lib/executionProfileStore.js.map +1 -1
  99. package/dist/server/lib/executionProfiles.js +131 -8
  100. package/dist/server/lib/executionProfiles.js.map +1 -1
  101. package/dist/server/lib/executionReconciliation.js +206 -143
  102. package/dist/server/lib/executionReconciliation.js.map +1 -1
  103. package/dist/server/lib/executionRunAuthority.js +175 -7
  104. package/dist/server/lib/executionRunAuthority.js.map +1 -1
  105. package/dist/server/lib/executionRuns.js +26 -4
  106. package/dist/server/lib/executionRuns.js.map +1 -1
  107. package/dist/server/lib/executionTimeline.js +2 -1
  108. package/dist/server/lib/executionTimeline.js.map +1 -1
  109. package/dist/server/lib/git.js +52 -10
  110. package/dist/server/lib/git.js.map +1 -1
  111. package/dist/server/lib/gitPushApprovals.js +367 -0
  112. package/dist/server/lib/gitPushApprovals.js.map +1 -0
  113. package/dist/server/lib/mobileAccess.js +115 -1
  114. package/dist/server/lib/mobileAccess.js.map +1 -1
  115. package/dist/server/lib/productionCheckApprovals.js +106 -0
  116. package/dist/server/lib/productionCheckApprovals.js.map +1 -0
  117. package/dist/server/lib/reviewFindings.js +14 -8
  118. package/dist/server/lib/reviewFindings.js.map +1 -1
  119. package/dist/server/lib/types.js +40 -0
  120. package/dist/server/lib/types.js.map +1 -1
  121. package/dist/server/lib/workspaceProcessEnvironment.js +2 -2
  122. package/dist/server/lib/workspaceProcessEnvironment.js.map +1 -1
  123. package/dist/server/workers/review.js +19 -11
  124. package/dist/server/workers/review.js.map +1 -1
  125. package/package.json +1 -1
  126. package/dist/client/assets/GitHubActionsDialog-BGecTzoq.js +0 -1
  127. package/dist/client/assets/VerificationDialog-D4QkMLZr.js +0 -4
  128. package/dist/client/assets/channel-BwRO4uiw.js +0 -1
  129. package/dist/client/assets/classDiagram-4FO5ZUOK-BIszcze-.js +0 -1
  130. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-D5dvxldS.js +0 -1
  131. package/dist/client/assets/index-CYPgEn1h.css +0 -2
  132. package/dist/client/assets/index-Ck2OKMsl.js +0 -276
  133. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-DmICWsmn.js +0 -1
@@ -1 +1 @@
1
- import{ft as e,r as t}from"./index-Ck2OKMsl.js";var n=e(),r=({projectId:e,onClose:r,onNavigateToLifecycleSource:i,initialRunId:a,initialEventId:o,onRunSelectionChange:s,onUnavailable:c})=>e?(0,n.jsx)(t,{projectId:e,scope:{type:`project`},initialRunId:a,initialEventId:o,onRunSelectionChange:s,onUnavailable:c,onClose:r,onNavigateToLifecycleSource:i}):null;export{r as ActivityView};
1
+ import{pt as e,r as t}from"./index-CZ1z72fo.js";var n=e(),r=({projectId:e,onClose:r,onNavigateToLifecycleSource:i,initialRunId:a,initialEventId:o,onRunSelectionChange:s,onUnavailable:c})=>e?(0,n.jsx)(t,{projectId:e,scope:{type:`project`},initialRunId:a,initialEventId:o,onRunSelectionChange:s,onUnavailable:c,onClose:r,onNavigateToLifecycleSource:i}):null;export{r as ActivityView};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-BNv3lrIs.js";import{C as t,D as n,E as r,G as i,H as a,I as o,K as s,L as c,O as l,P as u,S as d,T as f,U as p,V as m,W as h,X as g,Y as _,Z as v,bt as y,dt as ee,f as b,ft as x,gt as te,lt as S,mt as C,pt as w,ut as ne,w as T}from"./index-CZ1z72fo.js";var E=e(y(),1),D=w(),re=`https://docs.github.com/en/actions`,ie=5e3,O=(e,t)=>n.t(`common:githubActions.${e}`,t),k=e=>O(`status.${e}`),A=e=>e?O(`conclusion.${e}`):null,j=e=>e.status===`completed`?e.conclusion===`success`?`border-emerald-400/40 bg-emerald-500/10 text-emerald-200`:e.conclusion===`failure`||e.conclusion===`timed_out`?`border-rose-400/40 bg-rose-500/10 text-rose-200`:e.conclusion===`cancelled`?`border-amber-400/40 bg-amber-500/10 text-amber-200`:`border-border/70 bg-background/60 text-muted-foreground`:e.status===`in_progress`?`border-sky-400/40 bg-sky-500/10 text-sky-200`:e.status===`queued`?`border-violet-400/40 bg-violet-500/10 text-violet-200`:`border-border/70 bg-background/60 text-muted-foreground`,M=e=>e.status===`completed`?e.conclusion===`success`?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:e.conclusion===`failure`?`border-rose-400/30 bg-rose-500/10 text-rose-200`:`border-border/70 bg-background/60 text-muted-foreground`:e.status===`in_progress`?`border-sky-400/30 bg-sky-500/10 text-sky-200`:`border-border/70 bg-background/60 text-muted-foreground`,N=e=>{let t=e.run_started_at??e.created_at,n=e.updated_at;if(!t||!n)return null;let r=Date.parse(t),i=Date.parse(n);if(!Number.isFinite(r)||!Number.isFinite(i)||i<r)return null;let a=i-r;if(a<1e3)return`${a} ms`;let o=Math.floor(a/1e3),s=Math.floor(o/3600),c=Math.floor(o%3600/60),l=o%60;return s>0?`${s}h ${c}m ${l}s`:c>0?`${c}m ${l}s`:`${(a/1e3).toFixed(a>=1e4?0:1)} s`},P=e=>e.status===`completed`?A(e.conclusion)??O(`status.completed`):k(e.status),F=e=>{let t={};for(let n of e){if(n.type===`boolean`){t[n.name]=n.default===!0;continue}typeof n.default==`string`&&n.default!==``&&(t[n.name]=n.default)}return t},ae=({workflow:e,inputsState:t,isSelected:n,onSelect:r})=>{let i=e.state===`active`,a=t?.dispatchable??!0,s=i&&a&&!t?.isLoading,l=e.path.split(`/`).pop();return(0,D.jsxs)(`div`,{className:v(`flex flex-col gap-3 rounded-2xl border px-4 py-3 transition-colors`,n?`border-sky-400/45 bg-sky-500/10`:`border-border/60 bg-background/20 hover:bg-accent/20`),children:[(0,D.jsx)(`p`,{className:`line-clamp-2 break-words text-sm font-medium text-foreground`,children:e.name}),(0,D.jsx)(`p`,{className:`min-w-0 break-words text-[11px] text-muted-foreground`,children:l}),(0,D.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,D.jsx)(d,{variant:`outline`,className:v(`px-2 py-0.5 text-[10px] uppercase tracking-[0.18em]`,i?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:`border-border/70 bg-background/60 text-muted-foreground`),children:O(i?`workflows.stateActive`:`workflows.stateDisabled`)}),(0,D.jsxs)(g,{type:`button`,variant:n?`secondary`:`outline`,size:`sm`,className:`h-8 gap-1.5 px-3 text-xs`,disabled:!s,"aria-label":O(`workflows.runAriaLabel`,{name:e.name}),title:!a&&t?O(`inputs.notDispatchable`):void 0,onClick:r,children:[t?.isLoading?(0,D.jsx)(c,{className:`h-3.5 w-3.5 animate-spin`}):(0,D.jsx)(o,{className:`h-3.5 w-3.5`}),(0,D.jsx)(`span`,{children:O(`actions.run`)})]})]})]})},I=({workflow:e,inputsState:t,refValue:n,onRefChange:i,values:s,onValueChange:l,isDispatching:u,onDispatch:d,onCancel:f})=>{let p=t.inputs.filter(e=>e.required&&!L(s[e.name],e)),h=t.dispatchable&&!t.isLoading&&!t.error&&n.trim()!==``&&p.length===0&&!u;return(0,D.jsxs)(`div`,{className:`space-y-4 rounded-2xl border border-border/70 bg-background/20 p-4`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:O(`inputs.title`)}),(0,D.jsx)(`p`,{className:`mt-0.5 truncate text-sm font-medium text-foreground`,children:e.name})]}),(0,D.jsx)(g,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":O(`actions.cancel`),onClick:f,children:(0,D.jsx)(r,{className:`h-4 w-4`})})]}),(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(m,{htmlFor:`github-actions-ref`,children:O(`inputs.refLabel`)}),(0,D.jsx)(a,{id:`github-actions-ref`,type:`text`,value:n,onChange:e=>{i(e.target.value)},placeholder:O(`inputs.refPlaceholder`),"aria-label":O(`inputs.refAriaLabel`)})]}),t.isLoading&&(0,D.jsxs)(`div`,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,D.jsx)(c,{className:`h-3.5 w-3.5 animate-spin`}),(0,D.jsx)(`span`,{children:O(`inputs.loading`)})]}),t.error&&(0,D.jsx)(`p`,{className:`text-xs text-rose-200`,children:t.error}),!t.dispatchable&&!t.isLoading&&!t.error&&(0,D.jsx)(`p`,{className:`text-xs text-amber-200`,children:O(`inputs.notDispatchable`)}),t.inputs.map(e=>(0,D.jsx)(R,{input:e,value:s[e.name],onChange:t=>{l(e.name,t)}},e.name)),p.length>0&&(0,D.jsx)(`p`,{className:`text-xs text-rose-200`,children:O(`inputs.requiredValidationError`)}),(0,D.jsxs)(`div`,{className:`flex items-center justify-end gap-2`,children:[(0,D.jsx)(g,{type:`button`,variant:`ghost`,onClick:f,disabled:u,children:O(`actions.cancel`)}),(0,D.jsxs)(g,{type:`button`,variant:`success`,onClick:d,disabled:!h,children:[u?(0,D.jsx)(c,{className:`h-4 w-4 animate-spin`}):(0,D.jsx)(o,{className:`h-4 w-4`}),(0,D.jsx)(`span`,{children:O(`actions.dispatch`)})]})]})]})},L=(e,t)=>t.type===`boolean`?typeof e==`boolean`:typeof e==`string`&&e.trim()!==``,R=({input:e,value:t,onChange:n})=>{let r=`github-actions-input-${e.name}`;return(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsxs)(m,{htmlFor:r,className:`flex items-center gap-2`,children:[(0,D.jsx)(`span`,{children:e.name}),e.required&&(0,D.jsx)(`span`,{className:`text-[10px] uppercase tracking-[0.18em] text-rose-200/80`,children:O(`inputs.requiredLabel`)})]}),e.description&&(0,D.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:e.description}),z(e,r,t,n)]})},z=(e,t,n,r)=>{if(e.type===`boolean`){let i=typeof n==`boolean`?n:e.default===!0;return(0,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,D.jsx)(b,{id:t,checked:i,onCheckedChange:e=>{r(e)}}),(0,D.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:O(i?`inputs.booleanYes`:`inputs.booleanNo`)})]})}if(e.type===`choice`){let i=e.options??[],a=typeof n==`string`?n:typeof e.default==`string`?e.default:``;return(0,D.jsxs)(`select`,{id:t,className:`h-9 w-full rounded-lg border border-border/70 bg-background/60 px-3 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/50`,value:a,onChange:e=>{r(e.target.value)},children:[a===``&&(0,D.jsx)(`option`,{value:``,children:O(`inputs.selectPlaceholder`)}),i.map(e=>(0,D.jsx)(`option`,{value:e,children:e},e))]})}return(0,D.jsx)(a,{id:t,type:`text`,value:typeof n==`string`?n:typeof e.default==`string`?e.default:``,onChange:e=>{r(e.target.value)}})},B=({job:e})=>e.steps.length===0?null:(0,D.jsx)(`div`,{className:`mt-2 ml-4 space-y-1 border-l border-border/60 pl-4`,children:e.steps.map(t=>(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(d,{variant:`outline`,className:v(`px-2 py-0 text-[10px] uppercase tracking-[0.16em]`,M(t)),children:t.status===`completed`?A(t.conclusion)??O(`status.completed`):k(t.status)}),(0,D.jsx)(`span`,{className:`truncate text-[11px] text-muted-foreground`,children:t.name})]},`${e.id}-${t.number}`))}),V=({run:e})=>{let n=N(e),r=P(e);return(0,D.jsxs)(`div`,{className:`rounded-2xl border border-border/60 bg-background/20 px-4 py-3`,children:[(0,D.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,D.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,D.jsx)(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e.name??`#${e.id}`}),(0,D.jsx)(d,{variant:`outline`,className:v(`px-2 py-0.5 text-[10px] uppercase tracking-[0.18em]`,j(e)),children:r})]}),(0,D.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2`,children:[n&&(0,D.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:n}),e.html_url&&(0,D.jsxs)(`a`,{href:e.html_url,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-[11px] text-sky-200 hover:text-sky-100`,children:[O(`actions.openOnGithub`),(0,D.jsx)(t,{className:`h-3 w-3`})]})]})]}),e.head_branch&&(0,D.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:e.head_branch}),e.jobs.map(e=>(0,D.jsxs)(`div`,{className:`mt-2`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(d,{variant:`outline`,className:v(`px-2 py-0 text-[10px] uppercase tracking-[0.16em]`,j(e)),children:e.status===`completed`?A(e.conclusion)??O(`status.completed`):k(e.status)}),(0,D.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:e.name})]}),(0,D.jsx)(B,{job:e})]},e.id))]})},H=({tracked:e})=>{let t=e.state===`resolving`,n=e.failure?.message??O(`runs.trackingState.${e.state}`);return(0,D.jsxs)(`div`,{className:v(`flex items-start gap-2 rounded-2xl border px-4 py-3`,t?`border-border/60 bg-background/20`:`border-red-400/25 bg-red-500/8`),children:[t&&(0,D.jsx)(c,{className:`mt-0.5 h-3.5 w-3.5 animate-spin text-muted-foreground`}),(0,D.jsxs)(`div`,{className:`min-w-0`,children:[(0,D.jsx)(`span`,{className:v(`block break-words text-xs`,t?`text-muted-foreground`:`text-red-200`),children:n}),(0,D.jsx)(`span`,{className:`mt-1 block text-[11px] text-muted-foreground`,children:e.ref??O(`runs.unknownRef`)})]})]})},U=(e,t)=>{let n=new Map(e.map(e=>[e.id,e]));for(let e of t){let t=n.get(e.id);(!t||(e.updated_at??``)>=(t.updated_at??``))&&n.set(e.id,e)}return[...n.values()]},W=(e,t)=>{let n=new Map(e.map(e=>[e.execution_run_id,e]));for(let e of t){let t=n.get(e.execution_run_id),r=t&&![`queued`,`waiting`,`running`].includes(t.execution_status),i=[`queued`,`waiting`,`running`].includes(e.execution_status);(!r||!i)&&n.set(e.execution_run_id,e)}return[...n.values()]},oe=(e,t,n)=>{let r=t.filter(e=>e.run===null),i=new Set(r.map(e=>e.tracking_key));return W(e.filter(e=>i.has(e.tracking_key)||n.get(e.tracking_key)?.run===null),r.filter(e=>!n.has(e.tracking_key)))},se=e=>({ref:e??`main`}),G=({projectId:e,defaultBranch:n,onClose:a})=>{let[o,d]=(0,E.useState)([]),[m,v]=(0,E.useState)(!0),[y,b]=(0,E.useState)(null),[w,k]=(0,E.useState)([]),[A,j]=(0,E.useState)([]),[M,N]=(0,E.useState)({}),[P,L]=(0,E.useState)(null),[R,z]=(0,E.useState)(!1),[B]=(0,E.useState)(()=>se(n)),W=(0,E.useRef)({}),G=(0,E.useRef)({}),K=(0,E.useRef)(null),q=(0,E.useRef)(!1),J=(0,E.useRef)(0),Y=(0,E.useRef)(new Map),X=(0,E.useCallback)(async t=>{N(e=>{let n=e[t.id];return n?.isLoading?e:{...e,[t.id]:{inputs:n?.inputs??[],dispatchable:n?.dispatchable??!0,isLoading:!0,error:null}}});try{let n=await ne(e,t.id,t.path);return N(e=>({...e,[t.id]:{inputs:n.inputs,dispatchable:n.dispatchable,isLoading:!1,error:null}})),n}catch(e){return N(n=>({...n,[t.id]:{inputs:[],dispatchable:!0,isLoading:!1,error:e instanceof C?e.message:O(`workflows.loadError`)}})),null}},[e]),Z=(0,E.useCallback)(async()=>{v(!0),b(null);try{let t=await x(e);d(t.workflows),Promise.allSettled(t.workflows.map(e=>X(e)))}catch(e){b(e instanceof C?e.message:O(`workflows.loadError`))}finally{v(!1)}},[X,e]),Q=(0,E.useCallback)(async t=>{if(q.current)return;q.current=!0;let n=J.current;try{let r=await ee(e,t);k(e=>U(e,r.runs)),j(e=>{let t=new Map([...Y.current.entries()].filter(([,e])=>e.revision>n).map(([e,t])=>[e,t.event]));return oe(e,r.tracked_runs??[],t)})}catch(e){te(e)||console.warn(`[github-actions] unable to load runs`,e)}finally{q.current=!1}},[e]);(0,E.useEffect)(()=>{Z()},[Z]),(0,E.useEffect)(()=>{let e=new AbortController,t=()=>{document.visibilityState===`visible`&&Q(e.signal)};t();let n=window.setInterval(t,ie),r=f(t);return()=>{e.abort(),window.clearInterval(n),r()}},[Q]);let ce=(0,E.useCallback)(async e=>{if(P?.workflow.id===e.id)return;K.current=e.id,L({workflow:e,ref:B.ref,values:{}});let t=M[e.id];if(t&&!t.isLoading&&!t.error){L(n=>!n||n.workflow.id!==e.id?n:{...n,values:F(t.inputs)});return}let n=await X(e);n&&L(t=>!t||t.workflow.id!==e.id?t:{...t,values:F(n.inputs)})},[B.ref,M,X,P]),le=(0,E.useCallback)(async()=>{if(!P)return;let t=M[P.workflow.id];if(!t||!t.dispatchable)return;z(!0);let n={};for(let e of t.inputs){let t=P.values[e.name];e.type===`boolean`?n[e.name]=typeof t==`boolean`?t:e.default===!0:typeof t==`string`&&t!==``?n[e.name]=t:typeof e.default==`string`&&e.default!==``&&(n[e.name]=e.default)}try{await S(e,P.workflow.id,{ref:P.ref,workflowName:P.workflow.name,workflowUrl:P.workflow.url,inputs:n}),u.success(O(`messages.dispatched`)),L(null),Q()}catch(e){u.error(e instanceof C?e.message:O(`messages.dispatchError`))}finally{z(!1)}},[M,Q,e,P]);(0,E.useEffect)(()=>{let t=t=>{!t||t.project_id!==e||(J.current+=1,Y.current.set(t.tracking_key,{revision:J.current,event:t}),j(e=>{let n=e.filter(e=>e.tracking_key!==t.tracking_key);return t.run?n:[...n,t]}),t.run&&k(e=>U(e,[t.run])))};return T.on(`github-actions:updated`,t),()=>{T.off(`github-actions:updated`,t)}},[e]),(0,E.useEffect)(()=>{let e=P?.workflow.id;!e||K.current!==e||(W.current[e]?.scrollIntoView({block:`nearest`}),G.current[e]?.scrollIntoView({block:`nearest`}),K.current=null)},[P?.workflow.id]);let $=(0,E.useMemo)(()=>[...w].sort((e,t)=>{let n=e.updated_at?Date.parse(e.updated_at):0;return(t.updated_at?Date.parse(t.updated_at):0)-n}),[w]);return(0,D.jsx)(p,{open:!0,onOpenChange:e=>{e||a()},children:(0,D.jsxs)(i,{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-5xl`,onInteractOutside:e=>e.preventDefault(),children:[(0,D.jsx)(_,{className:`sr-only`,children:O(`dialog.srTitle`)}),(0,D.jsx)(s,{className:`sr-only`,children:O(`dialog.srDescription`)}),(0,D.jsxs)(`div`,{className:`flex items-start justify-between gap-4 border-b border-border px-6 py-4`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,D.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-2xl border border-border/70 bg-background/60 text-violet-200`,children:(0,D.jsx)(l,{className:`h-5 w-5`})}),(0,D.jsx)(`div`,{children:(0,D.jsx)(`h2`,{className:`text-2xl font-semibold text-foreground`,children:O(`dialog.title`)})})]}),(0,D.jsx)(h,{asChild:!0,children:(0,D.jsx)(g,{type:`button`,"aria-label":O(`dialog.closeAriaLabel`),variant:`ghost`,size:`icon-sm`,className:`cursor-pointer text-muted-foreground hover:text-foreground`,children:(0,D.jsx)(r,{className:`h-4 w-4`})})})]}),(0,D.jsxs)(`div`,{className:`grid min-h-0 flex-1 gap-0 overflow-hidden lg:grid-cols-[22rem_minmax(0,1fr)]`,children:[(0,D.jsxs)(`aside`,{"aria-label":O(`workflows.ariaLabel`),className:`flex min-h-0 flex-col gap-3 overflow-y-auto border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:[(0,D.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,D.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:O(`workflows.title`)}),(0,D.jsx)(g,{type:`button`,variant:`ghost`,size:`sm`,className:`h-7 px-2 text-xs text-muted-foreground hover:text-foreground`,onClick:()=>{Z(),Q()},children:O(`actions.refresh`)})]}),m&&(0,D.jsxs)(`div`,{className:`flex items-center gap-2 px-2 text-xs text-muted-foreground`,children:[(0,D.jsx)(c,{className:`h-3.5 w-3.5 animate-spin`}),(0,D.jsx)(`span`,{children:O(`workflows.loading`)})]}),y&&(0,D.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}),!m&&o.length===0&&!y&&(0,D.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:[(0,D.jsx)(`p`,{children:O(`workflows.empty`)}),(0,D.jsx)(`p`,{className:`mt-1`,children:O(`workflows.emptyHint`)}),(0,D.jsxs)(`a`,{href:re,target:`_blank`,rel:`noreferrer`,className:`mt-2 inline-flex items-center gap-1 text-xs text-sky-200 hover:text-sky-100`,children:[O(`workflows.docsLink`),(0,D.jsx)(t,{className:`h-3 w-3`})]})]}),(0,D.jsx)(`div`,{className:`space-y-2`,children:o.map(e=>{let t=P?.workflow.id===e.id;return(0,D.jsxs)(`div`,{className:`space-y-2`,children:[(0,D.jsx)(`div`,{ref:t=>{W.current[e.id]=t},children:(0,D.jsx)(ae,{workflow:e,inputsState:M[e.id]??null,isSelected:t,onSelect:()=>{ce(e)}})}),t&&P&&(0,D.jsx)(`div`,{ref:t=>{G.current[e.id]=t},children:(0,D.jsx)(I,{workflow:e,inputsState:M[e.id]??{inputs:[],dispatchable:!0,isLoading:!1,error:null},refValue:P.ref,onRefChange:e=>{L(t=>t&&{...t,ref:e})},values:P.values,onValueChange:(e,t)=>{L(n=>n&&{...n,values:{...n.values,[e]:t}})},isDispatching:R,onDispatch:()=>{le()},onCancel:()=>{L(null)}})})]},e.id)})})]}),(0,D.jsxs)(`section`,{className:`flex min-h-0 flex-col gap-3 overflow-y-auto px-4 py-4`,children:[(0,D.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:O(`runs.title`)}),A.map(e=>(0,D.jsx)(H,{tracked:e},e.tracking_key)),$.map(e=>(0,D.jsx)(V,{run:e},e.id)),$.length===0&&A.length===0&&(0,D.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:O(`runs.empty`)})]})]})]})})};export{G as GitHubActionsDialog};
@@ -0,0 +1,4 @@
1
+ import{a as e}from"./chunk-BNv3lrIs.js";import{$ as t,A as n,B as r,D as i,E as a,F as o,G as s,H as c,I as l,J as u,K as d,L as f,M as p,N as m,Q as h,R as g,S as _,U as v,X as y,Y as ee,Z as b,_ as x,_t as S,a as C,at as te,b as w,bt as T,c as ne,ct as E,d as D,et as re,g as O,gt as ie,h as k,ht as A,i as j,it as M,j as ae,k as oe,l as se,m as ce,mt as le,n as ue,nt as de,o as fe,ot as pe,p as me,pt as he,q as ge,rt as _e,s as N,st as ve,t as ye,tt as be,v as P,vt as F,w as xe,x as I,y as Se,yt as L,z as R}from"./index-CZ1z72fo.js";var z=e(T(),1),B=he(),V=e=>{if(!e.file_path)return null;if(!e.start_line)return e.file_path;let t=`${e.start_line}${e.start_column?`:${e.start_column}`:``}`,n=e.end_line?`-${e.end_line}${e.end_column?`:${e.end_column}`:``}`:``;return`${e.file_path}:${t}${n}`},H=[`error`,`warning`,`info`,`unknown`],U=e=>{let t={error:0,warning:0,info:0,unknown:0};return e.forEach(e=>{t[e.severity]+=1}),t},Ce=({counts:e,totalCount:t})=>{let{t:n}=L(`common`,{keyPrefix:`checksDialog.diagnostics`}),r=H.filter(t=>e[t]>0);return(0,B.jsxs)(`div`,{"aria-label":n(`severitySummaryLabel`),className:`mt-3 flex flex-wrap items-center gap-2`,children:[r.map(t=>(0,B.jsx)(`span`,{className:`rounded-full border border-border/70 bg-background/45 px-2 py-1 text-[11px] text-muted-foreground`,children:n(`severityCount`,{count:e[t],severity:n(`severity.${t}`)})},t)),t>0&&t!==r.reduce((t,n)=>t+e[n],0)&&(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:n(`totalAvailable`,{count:t})})]})},W=({attempt:e,parser:t,repair:n,ticketRequired:i,selectedTicketId:a,onSelectedTicketChange:o})=>{let{t:s}=L(`common`,{keyPrefix:`checksDialog.diagnostics`}),c=e.currency??`unavailable`;return(0,B.jsxs)(Se,{className:`mt-4 rounded-xl border border-border/60 bg-background/25`,children:[(0,B.jsx)(I,{asChild:!0,children:(0,B.jsxs)(`button`,{type:`button`,"aria-label":s(`technicalDetails`),className:`group flex w-full items-center gap-2 rounded-xl px-3 py-2.5 text-left outline-none transition-colors hover:bg-accent/40 focus-visible:ring-2 focus-visible:ring-ring/60`,children:[(0,B.jsx)(`span`,{className:`text-xs font-semibold text-foreground`,children:s(`technicalDetails`)}),(0,B.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-muted-foreground`,children:s(`technicalDetailsHint`)}),(0,B.jsx)(r,{className:`size-4 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-180`})]})}),(0,B.jsxs)(w,{className:`border-t border-border/60 px-3 py-3`,children:[(0,B.jsxs)(`dl`,{className:`grid gap-3 text-xs sm:grid-cols-2`,children:[t&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:s(`parserLabel`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-foreground`,children:s(`parser.${t.parser_kind}`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:s(`parserStateLabel`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-foreground`,children:s(`state.${t.status}`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:s(`parserRetentionLabel`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-foreground`,children:s(`retentionState.${t.retention_state}`)})]})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:s(`outputRetentionLabel`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-foreground`,children:s(`retentionState.${e.output_retention_state}`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:s(`applicabilityLabel`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-foreground`,children:s(`applicability`,{state:s(`applicabilityState.${c}`)})})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:s(`sourceLabel`)}),(0,B.jsx)(`dd`,{className:`mt-1 break-words text-foreground`,children:e.command_snapshot.name})]}),n&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-muted-foreground`,children:s(`destinationTitle`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-foreground`,children:s(`destination.${n.destination}`)}),(0,B.jsx)(`dd`,{className:`mt-1 text-muted-foreground`,children:s(`destinationHint`)})]})]}),i&&n&&(0,B.jsxs)(`label`,{className:`mt-3 block text-xs text-muted-foreground`,children:[s(`ticketLabel`),(0,B.jsxs)(`select`,{value:a,onChange:e=>o(e.target.value),className:`mt-1 h-10 w-full rounded-xl border border-border bg-card px-3 text-sm text-foreground`,children:[(0,B.jsx)(`option`,{value:``,children:s(`ticketPlaceholder`)}),n.candidate_tickets.map(e=>(0,B.jsx)(`option`,{value:e.id,children:e.title},e.id))]})]})]})]})},G=({attempt:e,diagnostics:t,repair:n,selectedDiagnosticIds:r,selectedRawOutputAttemptRunIds:i,selectedAttemptRunIds:a,selectedTicketId:o,pending:s,activeRepair:c,autoFix:l,onSelectedTicketChange:u,onToggleDiagnostic:d,onToggleRawOutput:f,onStartRepair:p,onStopRepair:m})=>{let{t:h}=L(`common`,{keyPrefix:`checksDialog.diagnostics`}),{t:g}=L(`common`,{keyPrefix:`checksDialog`});if(e.execution_status!==`failed`)return null;let _=t?.parser??null,v=t?.diagnostics??[],ee=U(v),b=!!(l&&!l.terminal_reason),x=l?.attempts[l.attempts.length-1]??null,S=c?.terminal_result===null||b,C=!!(n?.eligibility.eligible&&n.eligible_attempt_run_ids.includes(e.execution_run_id)&&_?.status===`complete`&&_.retention_state===`retained`),te=!!(n?.eligibility.eligible&&n.eligible_raw_output_attempt_run_ids.includes(e.execution_run_id)&&e.output_retention_state===`retained`&&e.retained_output),w=i.has(e.execution_run_id),T=r.size,ne=T>=32,E=a.size>=8&&!a.has(e.execution_run_id),D=ne?h(`diagnosticLimit`,{count:32}):E?h(`attemptLimit`,{count:8}):null,re=!!(n?.accepts_ticket_id&&n.candidate_tickets.length>1),O=T+i.size,ie=O>0&&(!re||o!==``),k=n&&!n.eligibility.eligible?h(`disabled.${n.eligibility.reason}`):null,A=_&&t&&(_.status===`interrupted`||v.length===0&&[`unsupported`,`malformed`].includes(_.status))?_.status:null,j=!!(_&&t&&v.length===0&&_.status===`complete`&&_.retention_state===`retained`&&_.diagnostic_count===0),M=!!(_&&t&&v.length===0&&_.status===`complete`&&_.retention_state===`retained`&&_.diagnostic_count>0),ae=_?.diagnostic_count??v.length;return(0,B.jsxs)(`section`,{"aria-labelledby":`diagnostics-${e.execution_run_id}`,className:`mt-5 rounded-2xl border border-border/70 bg-background/25 p-4`,children:[(0,B.jsx)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{id:`diagnostics-${e.execution_run_id}`,className:`text-sm font-semibold text-foreground`,children:h(`title`)}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:_&&_.status===`pending`?h(`loading`):_&&ae>0?M||_.retention_state===`expired`?h(`totalAvailable`,{count:ae}):h(`availableCount`,{count:ae}):h(t?`noneAvailable`:`loading`)}),(0,B.jsx)(`p`,{className:`mt-1 text-xs text-muted-foreground`,children:h(`failureOutcome`,{outcome:e.outcome?g(`outcomeValue.${e.outcome}`):g(`status.${e.execution_status}`)})}),t&&v.length>0&&(0,B.jsx)(Ce,{counts:ee,totalCount:ae})]})}),_?.retention_state===`expired`&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-amber-200`,children:h(`expired`)}),_?.truncated&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-amber-200`,children:h(`truncated`)}),A&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:h(`fallback.${A}`)}),j&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:h(`noStructuredDiagnostics`)}),M&&(0,B.jsx)(`p`,{className:`mt-3 text-sm text-muted-foreground`,children:h(`structuredDetailsUnavailable`)}),te&&(0,B.jsxs)(`label`,{className:`mt-4 flex items-start gap-3 rounded-xl border border-amber-400/25 bg-amber-500/5 p-3`,children:[(0,B.jsx)(`input`,{type:`checkbox`,className:`mt-1 size-4 accent-primary`,"aria-label":h(`rawOutputSelect`),checked:w,disabled:S||!w&&E,onChange:e=>f(e.target.checked)}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block text-sm font-medium text-foreground`,children:h(`rawOutputSelect`)}),(0,B.jsx)(`span`,{className:`mt-1 block text-xs text-muted-foreground`,children:h(`rawOutputHint`)}),e.retained_start_offset>0&&(0,B.jsx)(`span`,{className:`mt-1 block text-xs text-amber-200`,children:h(`rawOutputTruncated`)})]})]}),t&&v.length>0&&(0,B.jsxs)(`fieldset`,{className:`mt-4`,children:[(0,B.jsx)(`legend`,{className:`text-xs font-medium text-muted-foreground`,children:h(`selectLegend`)}),(0,B.jsx)(`ul`,{className:`mt-2 space-y-2`,children:v.map(e=>{let t=V(e),n=r.has(e.id);return(0,B.jsx)(`li`,{children:(0,B.jsxs)(`label`,{className:`flex items-start gap-3 rounded-xl border border-border/60 bg-background/35 p-3`,children:[(0,B.jsx)(`input`,{type:`checkbox`,className:`mt-1 size-4 accent-primary`,checked:n,disabled:!C||S||!n&&D!==null,onChange:t=>d(e.id,t.target.checked)}),(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsxs)(`span`,{className:`flex flex-wrap gap-2 text-xs text-muted-foreground`,children:[(0,B.jsx)(`span`,{className:`font-semibold uppercase text-foreground`,children:h(`severity.${e.severity}`)}),e.code&&(0,B.jsx)(`code`,{children:e.code})]}),(0,B.jsx)(`span`,{className:`mt-1 block break-words text-sm text-foreground`,children:e.message}),t&&(0,B.jsx)(`span`,{className:`mt-1 block break-all font-mono text-xs text-muted-foreground`,children:t})]})]})},e.id)})})]}),k&&(0,B.jsx)(`p`,{className:`mt-3 text-xs text-amber-200`,children:k}),D&&(0,B.jsx)(`p`,{className:`mt-3 text-xs text-amber-200`,children:D}),c&&(0,B.jsxs)(`div`,{className:`mt-4 rounded-xl border border-sky-400/25 bg-sky-500/10 p-3 text-sm`,children:[(0,B.jsx)(`p`,{className:`font-medium text-sky-100`,children:h(c.terminal_result?`repairResult.${c.terminal_result}`:`repairRunning`)}),c.terminal_message&&(0,B.jsx)(`p`,{className:`mt-1 text-xs text-sky-100/80`,children:c.terminal_message})]}),l&&(0,B.jsxs)(`div`,{className:`mt-4 rounded-xl border border-sky-400/25 bg-sky-500/10 p-3 text-sm`,role:`status`,children:[(0,B.jsx)(`p`,{className:`font-medium text-sky-100`,children:l.terminal_reason?h(`autoFix.terminal.${l.terminal_reason}`):x?.fallback_used?h(`autoFix.phase.fallback`):h(`autoFix.phase.${l.phase}`)}),!l.terminal_reason&&l.attempt_count>0&&(0,B.jsx)(`p`,{className:`mt-1 text-xs text-sky-100/80`,children:h(`autoFix.attempt`,{current:l.attempt_count,total:l.max_attempts})})]}),(0,B.jsxs)(`div`,{className:`mt-4 flex flex-wrap items-center justify-between gap-3`,children:[(0,B.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:h(`selectedEvidence`,{count:O})}),(0,B.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,B.jsx)(y,{type:`button`,size:`sm`,disabled:n?.eligibility.eligible!==!0||!ie||s||S,title:k??void 0,onClick:p,children:s?h(`starting`):h(`repairSelectedEvidence`,{count:O})}),S&&(0,B.jsx)(y,{type:`button`,variant:`destructive`,size:`sm`,disabled:s||l?.phase===`stopping`,onClick:m,children:h(b?`autoFix.stop`:`stopRepair`)})]})]}),(0,B.jsx)(W,{attempt:e,parser:_,repair:n,ticketRequired:re,selectedTicketId:o,onSelectedTicketChange:u})]})},K=({attempt:e})=>{let{t}=L(`common`,{keyPrefix:`checksDialog`}),n=e.retained_output?j(e.retained_output):``;return(0,B.jsxs)(D,{title:t(`rawOutput`),defaultOpen:!0,children:[e.output_retention_state===`expired`&&(0,B.jsx)(`p`,{className:`rounded-xl border border-border bg-background/30 p-4 text-sm text-muted-foreground`,children:t(`outputExpired`)}),e.output_retention_state===`retained`&&!n&&(0,B.jsx)(`p`,{className:`rounded-xl border border-border bg-background/30 p-4 text-sm text-muted-foreground`,children:t(`outputEmpty`)}),e.output_retention_state===`retained`&&n&&(0,B.jsx)(`pre`,{className:`max-h-80 overflow-auto whitespace-pre-wrap break-words rounded-xl border border-border bg-[#090b12] p-4 font-mono text-xs text-slate-200`,children:n}),e.retained_start_offset>0&&(0,B.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:t(`outputTruncated`)})]})},q=({definition:e,policy:t})=>{let{t:n}=L(`common`,{keyPrefix:`checksDialog`});return(0,B.jsxs)(`article`,{"aria-labelledby":`configured-check-${e.id}`,children:[(0,B.jsx)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h2`,{id:`configured-check-${e.id}`,className:`text-lg font-semibold text-foreground`,children:e.name}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n(`status.notRun`)})]})}),(0,B.jsx)(`p`,{className:`mt-4 rounded-xl border border-dashed border-border px-3 py-2 text-sm text-muted-foreground`,children:n(`notRunDescription`)}),(0,B.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-sm sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:n(`command`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 break-words font-mono text-xs text-foreground`,children:e.command})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:n(`directory`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:e.cwd??n(`targetRoot`)})]}),t&&(0,B.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:n(`policyLabel`)}),(0,B.jsxs)(`dd`,{className:`mt-0.5 break-words text-foreground`,children:[n(t.required?`required`:`optional`),` · `,n(t.preReview?`preReview`:`finalOnly`)]})]})]})]})},we=({attempt:e,definition:t,diagnostics:n,repair:r,selectedDiagnosticIds:i,selectedRawOutputAttemptRunIds:a,selectedAttemptRunIds:o,selectedTicketId:s,pending:c,activeRepair:l,autoFix:u,onSelectedTicketChange:d,onToggleDiagnostic:f,onToggleRawOutput:p,onStartRepair:m,onStopRepair:h,policy:g,projectId:_})=>{let{t:v}=L(`common`,{keyPrefix:`checksDialog`}),{t:y}=L(`common`,{keyPrefix:`activityView`});return e?(0,B.jsxs)(`article`,{"aria-labelledby":`selected-check-${e.execution_run_id}`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h2`,{id:`selected-check-${e.execution_run_id}`,className:`text-lg font-semibold text-foreground`,children:e.command_snapshot.name}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:v(`status.${e.execution_status}`)})]}),e.outcome&&(0,B.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1 text-xs text-muted-foreground`,children:v(`outcomeValue.${e.outcome}`)})]}),(0,B.jsxs)(`dl`,{className:`mt-4 grid gap-3 text-sm sm:grid-cols-2`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:v(`command`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 break-words font-mono text-xs text-foreground`,children:e.command_snapshot.command})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:v(`directory`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:e.command_snapshot.cwd??v(`targetRoot`)})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:v(`outcome`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:e.outcome?v(`outcomeValue.${e.outcome}`):v(`status.${e.execution_status}`)})]}),e.currency&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:v(`currencyLabel`)}),(0,B.jsx)(`dd`,{className:`mt-0.5 text-foreground`,children:y(`currency.${e.currency}`)})]}),g&&(0,B.jsxs)(`div`,{className:`sm:col-span-2`,children:[(0,B.jsx)(`dt`,{className:`text-xs text-muted-foreground`,children:v(`policyLabel`)}),(0,B.jsxs)(`dd`,{className:`mt-0.5 break-words text-foreground`,children:[v(g.required?`required`:`optional`),` · `,v(g.preReview?`preReview`:`finalOnly`)]})]})]}),(0,B.jsx)(N,{projectId:_,executionRunId:e.execution_run_id}),e.execution_status===`failed`&&(0,B.jsx)(G,{attempt:e,diagnostics:n,repair:r,selectedDiagnosticIds:i,selectedRawOutputAttemptRunIds:a,selectedAttemptRunIds:o,selectedTicketId:s,pending:c,activeRepair:l,autoFix:u,onSelectedTicketChange:d,onToggleDiagnostic:f,onToggleRawOutput:p,onStartRepair:m,onStopRepair:h}),(0,B.jsx)(K,{attempt:e},e.execution_run_id)]}):t?(0,B.jsx)(q,{definition:t,policy:g}):(0,B.jsxs)(`section`,{"aria-labelledby":`selected-check-heading`,className:`rounded-2xl border border-dashed border-border p-6`,children:[(0,B.jsx)(`h2`,{id:`selected-check-heading`,className:`font-medium text-foreground`,children:v(`selectAttemptTitle`)}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:v(`selectAttemptDescription`)})]})},J={current:`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`,stale:`border-amber-400/30 bg-amber-500/10 text-amber-200`,failed:`border-red-400/30 bg-red-500/10 text-red-200`,missing:`border-border bg-muted/40 text-muted-foreground`,interrupted:`border-orange-400/30 bg-orange-500/10 text-orange-200`,blocked:`border-amber-400/30 bg-amber-500/10 text-amber-200`},Te=(e,t)=>e.presentApplicability.appliesToCurrentState===!1?`stale`:t?t.execution_status===`interrupted`||t.execution_status===`cancelled`?`interrupted`:t.execution_status===`failed`?`failed`:t.currency===`stale`?`stale`:t.outcome&&t.outcome!==`passed`?`failed`:t.outcome===`passed`&&t.currency===`current`?`current`:e.decision===`blocked`?`blocked`:`current`:`missing`,Ee=e=>e===!0?`gateApplicability.overallCurrent`:e===!1?`gateApplicability.overallStale`:`gateApplicability.overallUnverifiable`,De=({evaluation:e})=>{let{t}=L(`common`,{keyPrefix:`checksDialog`}),n=e.presentApplicability.appliesToCurrentState===!1?`gateStale`:e.presentApplicability.appliesToCurrentState===null?`gateUnverifiable`:e.decision===`passed`?`gatePassed`:`gateBlocked`,r=e.reasonCodes[0],i=r?t(`gateReasonSummary`,{reason:t(`reason.${r}`)}):e.decision===`passed`?t(`gatePassedSummary`):t(`gateBlockedSummary`);return(0,B.jsxs)(`section`,{"aria-labelledby":`automated-delivery-gate-heading`,className:`mb-5 rounded-2xl border border-border/70 bg-background/30 p-4`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h2`,{id:`automated-delivery-gate-heading`,className:`font-semibold text-foreground`,children:t(`gateTitle`)}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:i})]}),(0,B.jsx)(`span`,{className:b(`shrink-0 rounded-full border px-2.5 py-1 text-xs font-medium`,e.decision===`passed`&&e.presentApplicability.appliesToCurrentState===!0?J.current:J.blocked),children:t(n)})]}),(0,B.jsx)(D,{title:t(`gateDetails`),children:(0,B.jsxs)(`div`,{className:`space-y-3 text-xs text-muted-foreground`,children:[(0,B.jsx)(`p`,{children:t(`gateScope`)}),(0,B.jsxs)(`div`,{className:`grid gap-2 sm:grid-cols-2`,children:[(0,B.jsx)(`p`,{children:t(`gateBoundary.label`,{boundary:t(`gateBoundary.${e.boundaryKind}`)})}),(0,B.jsx)(`p`,{className:`break-all`,children:t(`gatePolicy`,{fingerprint:e.policy.fingerprint.slice(0,12)})}),(0,B.jsx)(`p`,{children:t(`gatePolicyStatus`,{status:t(e.policy.status===`valid`?`gatePolicyValid`:`gatePolicyInvalid`)})}),(0,B.jsx)(`p`,{className:`break-all`,children:e.sourceBatchRunId?t(`gateSourceBatch`,{batchId:e.sourceBatchRunId}):t(`gateNoBatch`)}),(0,B.jsx)(`p`,{className:`break-words`,children:t(`gateApplicability.label`,{workspace:t(`gateApplicability.${e.presentApplicability.workspace}`),policy:t(`gateApplicability.${e.presentApplicability.policy}`),overall:t(Ee(e.presentApplicability.appliesToCurrentState))})})]}),e.reasonCodes.length>0&&(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`font-medium text-foreground`,children:t(`gateReasonsTitle`)}),(0,B.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e.reasonCodes.map(e=>(0,B.jsx)(`li`,{children:t(`reason.${e}`)},e))})]}),(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`h3`,{className:`font-medium text-foreground`,children:t(`gateEvidenceTitle`)}),(0,B.jsx)(`div`,{className:`mt-2 space-y-2`,children:e.policy.definitions.map(n=>{let r=Te(e,e.evaluatedAttempts.find(e=>e.definition_id===n.id));return(0,B.jsxs)(`div`,{className:`flex items-start justify-between gap-3 rounded-xl border border-border/60 p-3`,children:[(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`p`,{className:`break-words text-sm font-medium text-foreground`,children:n.name}),(0,B.jsx)(`code`,{className:`mt-1 block break-all text-xs text-muted-foreground`,children:n.command})]}),(0,B.jsx)(`span`,{className:b(`shrink-0 rounded-full border px-2 py-1 text-xs`,J[r]),children:t(`evidence.${r}`)})]},n.id)})})]}),e.policy.status===`invalid`&&(0,B.jsx)(`p`,{className:`break-words text-amber-200`,children:e.policy.error})]})})]})},Oe=e=>e.execution_status===`completed`?`border-emerald-400/30 bg-emerald-500/10 text-emerald-200`:e.execution_status===`failed`||e.execution_status===`interrupted`?`border-red-400/30 bg-red-500/10 text-red-200`:e.execution_status===`running`||e.execution_status===`queued`?`border-sky-400/30 bg-sky-500/10 text-sky-200`:`border-border bg-muted/40 text-muted-foreground`,ke=e=>e.execution_status===`completed`&&e.outcome&&e.outcome!==`passed`?`outcomeValue.${e.outcome}`:`status.${e.execution_status}`,Ae=(e,t,n,r)=>((t?.attempts.find(t=>t.attempt_run_id===e.execution_run_id))?.diagnostics.filter(e=>n.has(e.id)).length??0)+ +!!r.has(e.execution_run_id),je=({definitions:e,attempts:t,requiredDefinitionIds:n,preReviewDefinitionIds:r,selectedDefinitionIds:i,selectedCheckId:a,diagnostics:o,selectedDiagnosticIds:s,selectedRawOutputAttemptRunIds:c,onToggleDefinition:l,onSelectCheck:u})=>{let{t:d}=L(`common`,{keyPrefix:`checksDialog`}),f=new Set(n),p=new Set(r),m=new Set(e.map(e=>e.id)),h=[...e.map(e=>({definition:e,attempt:t.find(t=>t.definition_id===e.id),historical:!1})),...t.filter(e=>!m.has(e.definition_id)).map(e=>({definition:e.command_snapshot,attempt:e,historical:!0}))];return(0,B.jsxs)(`section`,{"aria-labelledby":`configured-checks-heading`,className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsxs)(`header`,{className:`shrink-0 border-b border-border/60 px-4 py-4 sm:px-5`,children:[(0,B.jsxs)(`div`,{className:`flex flex-col items-start gap-1`,children:[(0,B.jsx)(`h2`,{id:`configured-checks-heading`,className:`text-sm font-semibold text-foreground`,children:d(`configured`)}),(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:d(`selectionHint`)})]}),(0,B.jsxs)(`div`,{className:`mt-3 rounded-xl border border-border/70 bg-background/35 p-3 text-xs text-muted-foreground`,children:[(0,B.jsx)(`p`,{className:`font-medium text-foreground`,children:d(`policySummary.title`)}),(0,B.jsx)(`p`,{className:`mt-1`,children:d(`policySummary.counts`,{requiredCount:n.length,preReviewCount:r.length})})]})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-5 md:max-h-none md:py-5 max-md:max-h-[min(35vh,18rem)]`,children:(0,B.jsx)(`ul`,{"aria-label":d(`configured`),className:`space-y-2`,children:h.map(({definition:e,attempt:t,historical:n})=>{let r=a===e.id,m=t?Ae(t,o,s,c):0,h=f.has(e.id),g=p.has(e.id),_=`${d(`category.${e.category}`)} · ${d(h?`required`:`optional`)} · ${d(g?`preReview`:`finalOnly`)}`;return(0,B.jsx)(`li`,{className:`rounded-xl border border-border/60 bg-background/30 p-2.5`,children:(0,B.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[!n&&(0,B.jsx)(`input`,{type:`checkbox`,className:`mt-1 size-4 shrink-0 accent-primary`,checked:i.has(e.id),"aria-label":d(`selectForRun`,{name:e.name}),onChange:t=>l(e.id,t.target.checked)}),t?(0,B.jsxs)(`button`,{type:`button`,className:b(`min-w-0 flex-1 cursor-pointer rounded-lg px-1.5 py-1 text-left outline-none transition-colors hover:bg-accent/60 focus-visible:ring-2 focus-visible:ring-ring/60`,r&&`bg-accent/60`),"aria-label":d(`inspectAttempt`,{name:e.name,status:d(ke(t))}),"aria-pressed":r,"aria-current":r?`true`:void 0,onClick:()=>u(e.id),children:[(0,B.jsxs)(`span`,{className:`flex min-w-0 items-center justify-between gap-2`,children:[(0,B.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-foreground`,children:e.name}),(0,B.jsx)(`span`,{className:b(`shrink-0 rounded-full border px-2 py-0.5 text-[11px] font-medium`,Oe(t)),children:d(ke(t))})]}),(0,B.jsx)(`span`,{className:`mt-1 block truncate text-[11px] text-muted-foreground`,children:_}),m>0&&(0,B.jsx)(`span`,{"data-evidence-selected":`true`,className:`mt-1.5 inline-flex rounded-full border border-amber-400/30 bg-amber-500/10 px-2 py-0.5 text-[11px] text-amber-200`,children:d(`evidenceSelected`,{count:m})})]}):(0,B.jsxs)(`button`,{type:`button`,className:b(`min-w-0 flex-1 cursor-pointer rounded-lg px-1.5 py-1 text-left outline-none transition-colors hover:bg-accent/60 focus-visible:ring-2 focus-visible:ring-ring/60`,r&&`bg-accent/60`),"aria-label":d(`inspectAttempt`,{name:e.name,status:d(`status.notRun`)}),"aria-pressed":r,"aria-current":r?`true`:void 0,onClick:()=>u(e.id),children:[(0,B.jsx)(`span`,{className:`flex min-w-0 items-center justify-between gap-2`,children:(0,B.jsx)(`span`,{className:`min-w-0 truncate text-sm font-medium text-foreground`,children:e.name})}),(0,B.jsx)(`span`,{className:`mt-1 block truncate text-[11px] text-muted-foreground`,children:_})]})]})},t?.execution_run_id??e.id)})})})]})},Me=(e,t)=>{let n=new Set(t?.attempts.filter(e=>e.parser.status===`complete`&&e.parser.retention_state===`retained`&&e.diagnostics.length>0).map(e=>e.attempt_run_id)??[]);return e.find(e=>e.execution_status===`failed`&&n.has(e.execution_run_id))??e.find(e=>e.execution_status===`failed`)??e.find(e=>e.execution_status===`running`)??e[0]??null},Ne=new Set([`queued`,`running`,`waiting`]),Pe=75,Fe=32,Ie=64,Le=3,Re=32,ze=8,Y=(e,t)=>e instanceof le?e.message:t,Be=e=>{let t=new Set(e.repair.eligibility.eligible?e.repair.eligible_attempt_run_ids:[]);return new Set(e.attempts.filter(e=>t.has(e.attempt_run_id)).flatMap(e=>e.diagnostics.map(e=>e.id)))},Ve=e=>new Set(e.repair.eligibility.eligible?e.repair.eligible_raw_output_attempt_run_ids:[]),He=({projectId:e,targetKind:n,targetBundleId:r,definitions:i,requiredDefinitionIds:a=[],preReviewDefinitionIds:o=[],gateEvaluationId:s=null,directBatchRunId:c=null,directAttemptRunId:l=null,onSelectionChange:u,onUnavailable:d,onStatusChange:f})=>{let{t:p}=L(`common`,{keyPrefix:`checksDialog`}),m=se(),[h,g]=(0,z.useState)(()=>new Set(i.map(e=>e.id))),[_,v]=(0,z.useState)(null),[ee,b]=(0,z.useState)(null),[x,S]=(0,z.useState)(null),[w,T]=(0,z.useState)(null),[D,O]=(0,z.useState)(!0),[k,A]=(0,z.useState)(null),[j,ae]=(0,z.useState)(null),[oe,ce]=(0,z.useState)(new Set),[ue,me]=(0,z.useState)(new Set),[he,ge]=(0,z.useState)(``),[N,ye]=(0,z.useState)(null),[P,F]=(0,z.useState)(!1),[xe,I]=(0,z.useState)(0),[Se,R]=(0,z.useState)(null),V=(0,z.useRef)(_),H=(0,z.useRef)(null),U=(0,z.useRef)(new Set),Ce=(0,z.useRef)(new Map),W=(0,z.useRef)(0),G=(0,z.useRef)(0),K=(0,z.useRef)(null),q=(0,z.useRef)(!1),J=(0,z.useRef)(!0),Te=(0,z.useRef)(null),Ee=(0,z.useRef)(`automatic`),Oe=(0,z.useRef)(null),ke=(0,z.useRef)(async()=>void 0),Ae=(0,z.useRef)(async()=>void 0),He=(0,z.useRef)(()=>void 0),Ue=(0,z.useRef)(0),We=(0,z.useRef)(j);V.current=_,We.current=j,J.current=D||k!==null;let X=(0,z.useCallback)((e,t)=>{Te.current=e,Ee.current=t,S(e)},[]),Ge=(0,z.useCallback)(e=>{ae(e),ye(e.latest_repair?.source_batch_run_id===e.batch_run_id?e.latest_repair:null),ce(t=>{let n=Be(e);return new Set([...t].filter(e=>n.has(e)))}),me(t=>{let n=Ve(e);return new Set([...t].filter(e=>n.has(e)))}),ge(t=>e.repair.candidate_tickets.some(e=>e.id===t)?t:e.repair.candidate_tickets.length===1&&e.repair.accepts_ticket_id?e.repair.candidate_tickets[0].id:``);let t=V.current;Ee.current===`automatic`&&t?.batch.execution_run_id===e.batch_run_id&&X(Me(t.attempts,e)?.execution_run_id??null,`automatic`)},[X]),Ke=(0,z.useCallback)(e=>{let t=Ce.current;if(!t.has(e.attempt_run_id)&&t.size>=Fe){let e=t.keys().next().value;e&&(t.delete(e),U.current.delete(e))}let n=t.get(e.attempt_run_id)??[];t.set(e.attempt_run_id,[...n.slice(-(Ie-1)),e])},[]),qe=(0,z.useCallback)((e,t,n=`route`)=>{let r=V.current?.batch.execution_run_id===e.batch.execution_run_id?V.current:null,i=!1,a=new Set(e.attempts.map(e=>e.execution_run_id));for(let e of Ce.current.keys())a.has(e)||(Ce.current.delete(e),U.current.delete(e));let o=e.attempts.map(e=>{let t=!1,n=r?.attempts.find(t=>t.execution_run_id===e.execution_run_id),a=n&&n.output_revision>e.output_revision?n:e,o=Ce.current.get(e.execution_run_id)??[];for(let e of[...o].sort((e,t)=>e.revision-t.revision)){let n=fe(C(a),e);if(n.status===`refetch`){t=!0,i=!0;continue}n.status===`applied`&&(a={...a,output_revision:n.snapshot.revision,retained_start_offset:n.snapshot.retainedStartOffset,retained_end_offset:n.snapshot.totalByteCount,total_persisted_bytes:n.snapshot.totalByteCount,retained_output:n.snapshot.retainedText})}return t?U.current.add(e.execution_run_id):(U.current.delete(e.execution_run_id),Ce.current.delete(e.execution_run_id)),a}),s={...e,attempts:o};K.current=e.batch.execution_run_id,V.current=s,v(s);let c=t?s.attempts.find(e=>e.execution_run_id===t):null,l=Te.current,f=Ee.current,m=!!(l&&s.attempts.some(e=>e.execution_run_id===l)),h=Me(s.attempts,We.current?.batch_run_id===s.batch.execution_run_id?We.current:null),g=Oe.current,_=!!(g&&g.batchRunId===s.batch.execution_run_id&&g.attemptRunId===t),y=!!(g&&g.previousBatchRunId===s.batch.execution_run_id&&g.previousAttemptRunId===t);if(n===`reset`)X(h?.execution_run_id??null,`automatic`);else if(t)if(c)if(_)X(c.execution_run_id,`manual`);else if(y&&f===`manual`)X(m?l:h?.execution_run_id??null,m?`manual`:`automatic`);else{let e=f!==`external`||l!==c.execution_run_id;X(c.execution_run_id,`external`),e&&u?.(s.batch.execution_run_id,c.execution_run_id)}else _||y?f===`manual`&&m?X(l,`manual`):X(h?.execution_run_id??null,`automatic`):(X(t,`external`),d?.());else n===`preserve`?f===`external`&&l?m?X(l,`external`):(X(l,`external`),d?.()):f===`manual`&&m?X(l,`manual`):X(f===`automatic`&&m?l:h?.execution_run_id??null,`automatic`):f===`manual`&&m?X(l,`manual`):X(h?.execution_run_id??null,`automatic`);i?He.current(e.batch.execution_run_id):Ue.current=0,q.current&&!H.current&&(q.current=!1,H.current=setTimeout(()=>{H.current=null,Ae.current().catch(e=>R(Y(e,p(`errors.load`))))},Pe))},[u,d,p,X]),Z=(0,z.useCallback)(async(n,r)=>{let i=++W.current,a=await t(e,n,r);if(i!==W.current||a.batch.execution_run_id!==n||K.current!==null&&K.current!==n){a.batch.execution_run_id!==n&&d?.();return}qe(a,n===c?l:null)},[l,c,qe,d,e]);ke.current=Z,He.current=(0,z.useCallback)(e=>{if(H.current)return;if(Ue.current>=Le){Ue.current=0,U.current.clear(),Ce.current.clear();return}let t=Pe*2**Ue.current;H.current=setTimeout(()=>{H.current=null,Ue.current+=1,ke.current(e).catch(t=>{R(Y(t,p(`errors.load`))),U.current.size>0&&He.current(e)})},t)},[p]);let Je=(0,z.useCallback)(async t=>{let i=++W.current,a=await _e(e,n,r,t);if(i===W.current){if(a.batch_run_id){K.current=a.batch_run_id,await Z(a.batch_run_id,t);return}!t?.aborted&&i===W.current&&(K.current=null,V.current=null,v(null),X(null,`automatic`))}},[Z,e,r,n,X]),Q=(0,z.useCallback)(async()=>{if(s||c){let e=K.current;e&&await Z(e);return}await Je()},[c,s,Z,Je]);Ae.current=Q;let Ye=(0,z.useCallback)(e=>{H.current||=setTimeout(()=>{H.current=null,Z(e).catch(e=>R(Y(e,p(`errors.load`))))},Pe)},[Z,p]);(0,z.useEffect)(()=>{let t=new AbortController;return O(!0),R(null),(async()=>{if(c){if(b(null),l){let n=await ne(e,l,t.signal);if(n.run.kind!==`check_attempt`||n.details.kind!==`check_attempt`||!n.details.available||!n.details.attempt||n.details.attempt.batch_run_id!==c){d?.();return}}K.current=c,await Z(c,t.signal);return}if(!s){b(null),await Je(t.signal);return}let n=await be(e,s,t.signal);if(b(n),n.sourceBatchRunId){K.current=n.sourceBatchRunId,await Z(n.sourceBatchRunId,t.signal);return}K.current=null,V.current=null,v(null),X(null,`automatic`)})().catch(e=>{ie(e)||(e instanceof le&&e.status===404&&d?.(),R(Y(e,p(`errors.load`))))}).finally(()=>{t.signal.aborted||(O(!1),J.current=!1,q.current&&!H.current&&(q.current=!1,H.current=setTimeout(()=>{H.current=null,Ae.current().catch(e=>R(Y(e,p(`errors.load`))))},Pe)))}),()=>t.abort()},[l,c,s,Z,Je,d,e,p,X]),(0,z.useEffect)(()=>{let t=_?.batch.execution_run_id;if(!t){G.current+=1,ae(null),ce(new Set),me(new Set),ge(``),ye(null);return}We.current?.batch_run_id!==t&&(ae(null),ce(new Set),me(new Set),ge(``),ye(null));let n=++G.current,r=new AbortController;return re(e,t,r.signal).then(e=>{n===G.current&&e.batch_run_id===t&&K.current===t&&Ge(e)}).catch(e=>{ie(e)||R(Y(e,p(`errors.diagnostics`)))}),()=>r.abort()},[_?.batch.execution_run_id,xe,Ge,e,p]),(0,z.useEffect)(()=>{let t=t=>{if(t.project_id!==e)return;let n=K.current;if(n!==null&&t.batch_run_id!==n)return;let r=V.current;if(!r||U.current.has(t.attempt_run_id)){Ke(t),r&&U.current.has(t.attempt_run_id)&&He.current(r.batch.execution_run_id);return}let i=r.attempts.findIndex(e=>e.execution_run_id===t.attempt_run_id);if(i<0){Ke(t),Ye(r.batch.execution_run_id);return}let a=r.attempts[i],o=fe(C(a),t);if(o.status===`ignored`)return;if(o.status===`refetch`){U.current.add(t.attempt_run_id),Ke(t),He.current(r.batch.execution_run_id);return}let s=[...r.attempts];s[i]={...a,output_revision:o.snapshot.revision,retained_start_offset:o.snapshot.retainedStartOffset,retained_end_offset:o.snapshot.totalByteCount,total_persisted_bytes:o.snapshot.totalByteCount,retained_output:o.snapshot.retainedText};let c={...r,attempts:s};V.current=c,v(c)},n=t=>{if(t.project_id&&t.project_id!==e)return;if(J.current){q.current=!0;return}let n=V.current,r=t.execution_run_id??t.id;if(I(e=>e+1),N&&r===N.execution_run_id&&N.source_batch_run_id===K.current&&de(e,N.execution_run_id).then(ye).catch(()=>void 0),n&&(r===n.batch.execution_run_id||n.attempts.some(e=>e.execution_run_id===r))){W.current+=1,Ye(n.batch.execution_run_id);return}q.current=!0,!J.current&&!H.current&&(q.current=!1,H.current=setTimeout(()=>{H.current=null,Ae.current().catch(e=>R(Y(e,p(`errors.load`))))},Pe))},r=()=>{I(e=>e+1),Q().catch(e=>R(Y(e,p(`errors.load`))))};return m.on(`check-attempt:output`,t),m.on(`execution-run:updated`,n),m.on(`lifecycle-event:created`,n),m.on(`connect`,r),()=>{m.off(`check-attempt:output`,t),m.off(`execution-run:updated`,n),m.off(`lifecycle-event:created`,n),m.off(`connect`,r)}},[N,Ke,e,Q,Ye,m,p]),(0,z.useEffect)(()=>()=>{H.current&&clearTimeout(H.current),U.current.clear(),Ce.current.clear()},[]);let Xe=(e,t)=>{W.current+=1,K.current=e.batch.execution_run_id,qe(e,null,t)},Ze=async(e,t)=>{W.current+=1,J.current=!0,A(e),R(null);try{let n=await t();e!==`stop`&&(Oe.current=null),Xe(n,e===`stop`?`preserve`:`reset`),e!==`stop`&&u?.(n.batch.execution_run_id,void 0)}catch(t){R(Y(t,p(`errors.${e}`))),t instanceof le&&t.status===409&&await Q().catch(()=>void 0)}finally{A(null),J.current=D,q.current&&!H.current&&(q.current=!1,H.current=setTimeout(()=>{H.current=null,Ae.current().catch(e=>R(Y(e,p(`errors.load`))))},Pe))}},Qe=_?Ne.has(_.batch.execution_status):!1,$e=_?Qe?`running`:_.batch.execution_status===`completed`?`finished`:_.batch.execution_status===`cancelled`||_.batch.execution_status===`interrupted`?`interrupted`:`error`:`inactive`,et=_?.batch.execution_run_id??null,$=j?.batch_run_id===et?j:null,tt=N?.source_batch_run_id===et?N:null,nt=$?.auto_fix??null,rt=!!(nt&&!nt.terminal_reason),it=$?Be($):new Set,at=$?Ve($):new Set,ot=new Set([...oe].filter(e=>it.has(e))),st=new Set([...ue].filter(e=>at.has(e))),ct=[...h],lt=_?.attempts.filter(e=>e.execution_status!==`completed`).length??0,ut=async()=>{let t=[...ot],n=[...st];if(!(!$||!et||K.current!==et||$.repair.eligibility.eligible!==!0||tt?.terminal_result===null||nt&&!nt.terminal_reason||t.length===0&&n.length===0)){F(!0),R(null);try{let r=await pe(e,t,n,$.repair.accepts_ticket_id?$.repair.candidate_tickets.some(e=>e.id===he)?he:$.repair.candidate_tickets[0]?.id||null:null);ye(r.source_batch_run_id===et?r:null)}catch(t){if(R(Y(t,p(`errors.repair`))),t instanceof le&&t.status===409&&_){let t=_.batch.execution_run_id,n=++G.current;re(e,t).then(e=>{n===G.current&&e.batch_run_id===t&&K.current===t&&Ge(e)}).catch(()=>void 0)}}finally{F(!1)}}},dt=async()=>{let t=nt&&!nt.terminal_reason?nt.execution_run_id:tt?.execution_run_id;if(t){F(!0),R(null);try{let n=await E(e,t);`source_batch_run_id`in n&&ye(n),I(e=>e+1)}catch(e){R(Y(e,p(`errors.repairStop`)))}finally{F(!1)}}},ft=new Set([...$?.attempts.filter(e=>e.diagnostics.some(e=>ot.has(e.id))).map(e=>e.attempt_run_id)??[],...st]),pt=(e,t,n)=>{ce(r=>{let i=new Set(r);if(!n)return i.delete(t),i;if(i.size>=Re||!$||!it.has(t))return r;let a=new Set($.attempts.filter(e=>e.diagnostics.some(e=>i.has(e.id))).map(e=>e.attempt_run_id)??[]);return!a.has(e)&&a.size>=ze?r:(i.add(t),i)})},mt=(e,t)=>{me(n=>{let r=new Set(n);return t?!ft.has(e)&&ft.size>=ze||!at.has(e)?n:(r.add(e),r):(r.delete(e),r)})},ht=(e,t)=>{g(n=>{let r=new Set(n);return t?r.add(e):r.delete(e),r})},gt=e=>{_&&(T(null),Oe.current={batchRunId:_.batch.execution_run_id,attemptRunId:e,previousBatchRunId:c===_.batch.execution_run_id?c:null,previousAttemptRunId:c===_.batch.execution_run_id?l:null},X(e,`manual`),u?.(_.batch.execution_run_id,e))},_t=e=>{let t=_?.attempts.find(t=>t.definition_id===e);if(t){gt(t.execution_run_id);return}T(e)},vt=w?_?.attempts.find(e=>e.definition_id===w)??null:_?.attempts.find(e=>e.execution_run_id===x)??null,yt=vt?.command_snapshot??i.find(e=>e.id===w)??null,bt=w??vt?.definition_id??null,xt=yt?{required:a.includes(yt.id),preReview:o.includes(yt.id)}:null;return(0,z.useEffect)(()=>{f?.($e)},[$e,f]),(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[Se&&(0,B.jsx)(`p`,{role:`alert`,className:`mx-4 mt-3 rounded-xl border border-red-400/25 bg-red-500/10 px-3 py-2 text-sm text-red-200 sm:mx-6`,children:Se}),(0,B.jsxs)(`div`,{role:`toolbar`,"aria-label":p(`runActions`),className:`flex shrink-0 flex-wrap items-center justify-between gap-3 border-y border-border/70 bg-background/30 px-4 py-3 sm:px-6`,children:[(0,B.jsx)(`div`,{className:`min-w-0`,children:(0,B.jsx)(`h2`,{className:`text-sm font-semibold text-foreground`,children:p(`runActions`)})}),(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(y,{type:`button`,size:`sm`,disabled:ct.length===0||Qe||rt||k!==null,onClick:()=>void Ze(`run`,()=>te(e,{targetKind:n,targetBundleId:r,definitionIds:ct})),children:p(k===`run`?`starting`:`runSelected`)}),_&&Qe&&(0,B.jsx)(y,{type:`button`,variant:`destructive`,size:`sm`,disabled:k!==null||P,onClick:()=>void(rt?dt():Ze(`stop`,()=>ve(e,_.batch.execution_run_id))),children:p(k===`stop`||P?`stopping`:`stop`)}),_&&!Qe&&(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(y,{type:`button`,variant:`outline`,size:`xs`,disabled:rt||k!==null,onClick:()=>void Ze(`rerun`,()=>M(e,_.batch.execution_run_id,{mode:`all`})),children:p(`rerunAll`)}),(0,B.jsx)(y,{type:`button`,variant:`outline`,size:`xs`,disabled:rt||k!==null||lt===0,onClick:()=>void Ze(`rerun`,()=>M(e,_.batch.execution_run_id,{mode:`failed_only`})),children:p(`rerunFailed`)})]})]})]}),(0,B.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-rows-[minmax(0,auto)_minmax(0,1fr)] overflow-hidden md:grid-cols-[19rem_minmax(0,1fr)] md:grid-rows-1`,children:[(0,B.jsx)(`aside`,{className:`flex min-h-0 flex-col border-b border-border/70 md:border-r md:border-b-0`,children:(0,B.jsx)(je,{definitions:i,attempts:_?.attempts??[],requiredDefinitionIds:a,preReviewDefinitionIds:o,selectedDefinitionIds:h,selectedCheckId:bt,diagnostics:$,selectedDiagnosticIds:ot,selectedRawOutputAttemptRunIds:st,onToggleDefinition:ht,onSelectCheck:_t})}),(0,B.jsxs)(`main`,{className:`min-h-0 overflow-y-auto p-4 sm:p-6`,children:[s&&!ee&&D&&(0,B.jsx)(`p`,{role:`status`,className:`mb-4 text-sm text-muted-foreground`,children:p(`gateLoading`)}),ee&&(0,B.jsx)(De,{evaluation:ee}),D&&(0,B.jsx)(`p`,{role:`status`,className:`text-sm text-muted-foreground`,children:p(`loading`)}),!D&&!_&&!yt&&(0,B.jsxs)(`div`,{className:`rounded-2xl border border-dashed border-border p-6 text-center`,children:[(0,B.jsx)(`h2`,{className:`font-medium text-foreground`,children:p(`emptyTitle`)}),(0,B.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:p(`emptyDescription`)})]}),_&&(0,B.jsx)(B.Fragment,{children:(0,B.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-2`,children:[(0,B.jsx)(`span`,{className:`rounded-full border border-border px-2 py-1 text-xs text-muted-foreground`,children:p(`status.${_.batch.execution_status}`)}),(0,B.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:p(`summary`,{passed:_.batch.passed_count,failed:_.batch.failed_count,running:_.batch.running_count,queued:_.batch.queued_count})}),_.batch.stop_requested&&(0,B.jsx)(`span`,{className:`text-xs text-amber-200`,children:p(`stopRequested`)})]})}),(_||yt)&&(0,B.jsx)(B.Fragment,{children:(0,B.jsx)(we,{projectId:e,attempt:vt,definition:yt,diagnostics:$?.attempts.find(e=>e.attempt_run_id===vt?.execution_run_id)??null,repair:$?.repair??null,selectedDiagnosticIds:ot,selectedRawOutputAttemptRunIds:st,selectedAttemptRunIds:ft,selectedTicketId:he,pending:P,activeRepair:tt,autoFix:nt,policy:xt,onSelectedTicketChange:ge,onToggleDiagnostic:(e,t)=>vt&&pt(vt.execution_run_id,e,t),onToggleRawOutput:e=>vt&&mt(vt.execution_run_id,e),onStartRepair:()=>void ut(),onStopRepair:()=>void dt()})})]})]})]})},Ue=(e,t)=>F(A(`/projects/${e}/test-sessions`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to open the test runner right now.`}),We=(e,t)=>F(A(`/tickets/${e}/test-sessions${t?`?project_id=${encodeURIComponent(t)}`:``}`),{method:`POST`,fallbackErrorMessage:`Unable to open the test runner right now.`}),X=(e,t={})=>F(A(`/test-sessions/${e}/discovery${t.commandId?`?command_id=${encodeURIComponent(t.commandId)}`:``}`),{signal:t.signal,fallbackErrorMessage:`Unable to discover tests right now.`}),Ge=(e,t)=>F(A(`/test-sessions/${e}/run`),{method:`POST`,body:t,fallbackErrorMessage:`Unable to start the selected tests right now.`}),Ke=e=>F(A(`/test-sessions/${e}/stop`),{method:`POST`,fallbackErrorMessage:`Unable to stop the test run right now.`}),qe=e=>S(A(`/test-sessions/${e}`),{method:`DELETE`,fallbackErrorMessage:`Unable to close the test runner right now.`}),Z=256*1024,Je=24,Q=(e,t)=>i.t(`common:testsDialog.${e}`,t),Ye=(e,t)=>{let n=`${e}${t}`;return n.length<=Z?n:n.slice(-Z)},Xe=(e,t)=>e?e.run_id&&t.run_id&&e.run_id!==t.run_id?e.status===`running`||t.status!==`running`?e:t:e.status!==`idle`&&e.status!==`running`&&t.status===`running`?e:e.run_id===t.run_id&&e.output.length>t.output.length?{...t,output:e.output,output_truncated:e.output_truncated||t.output_truncated}:t:t,Ze=e=>e.scrollHeight-e.scrollTop-e.clientHeight<=Je,Qe=e=>{e.scrollTop=e.scrollHeight},$e=(e,t=!1)=>{Qe(e);let n=0,r=0;return n=window.requestAnimationFrame(()=>{Qe(e),t&&(r=window.requestAnimationFrame(()=>{Qe(e)}))}),()=>{window.cancelAnimationFrame(n),r!==0&&window.cancelAnimationFrame(r)}},et=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`,$=e=>{if(e==null)return null;if(e<1e3)return`${e} ms`;let t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),i=t%60;return n>0?`${n}h ${r}m ${i}s`:r>0?`${r}m ${i}s`:`${(e/1e3).toFixed(e>=1e4?0:1)} s`},tt=e=>{let t=e.split(`/`);return t[t.length-1]||e},nt=e=>e.toLowerCase().trim().split(/\s+/).filter(Boolean),rt=(e,t)=>e.length===0?!0:e.every(e=>t.some(t=>t.includes(e))),it=(e,t)=>{let n=nt(t);return n.length===0?e:e.flatMap(e=>{let t=tt(e.path);if(rt(n,[t.toLowerCase(),e.path.toLowerCase()]))return[e];let r=e.cases.filter(r=>rt(n,[t.toLowerCase(),e.path.toLowerCase(),r.name.toLowerCase()]));return r.length===0?[]:[{...e,cases:r}]})},at=e=>Q(e===`passed`?`status.passed`:e===`failed`?`status.failed`:e===`running`?`status.running`:e===`error`?`status.error`:e===`stopped`?`status.stopped`:`status.idle`),ot=e=>e?.selection?e.selection.kind===`all`?Q(`selection.allTests`):e.selection.kind===`case`?e.selection.name:tt(e.selection.path):Q(`selection.noRunYet`),st=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`,ct=e=>e===`failure`?`text-rose-200`:e===`success`?`text-emerald-200`:e===`warning`?`text-amber-200`:`text-slate-200`,lt=(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,ut=`min-w-24 justify-center shadow-none transition-none disabled:opacity-100`,dt=({line:e,tone:t})=>(0,B.jsx)(`div`,{"data-tone":t,className:b(`whitespace-pre-wrap break-words`,ct(t)),children:e===``?` `:e}),ft=(0,z.memo)(({canRunGranular:e,filePath:t,isActive:n,name:r,onRunCase:i})=>(0,B.jsxs)(`button`,{type:`button`,"aria-label":Q(`caseRow.runAriaLabel`,{name:r}),title:r,className:b(`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,B.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full bg-sky-300/80`}),(0,B.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:r})]}));ft.displayName=`TestCaseRow`;var pt=(0,z.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:n,canRunGranular:i,file:a,isExpanded:o,onRunCase:s,onRunFile:c,onToggleFile:l})=>{let u=e===`file`&&n===a.path,d=e===`case`&&n===a.path;return(0,B.jsx)(Se,{open:o,onOpenChange:e=>{l(a.path,e)},children:(0,B.jsxs)(`div`,{className:`space-y-1`,children:[(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,B.jsx)(I,{asChild:!0,children:(0,B.jsx)(y,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":Q(o?`fileRow.collapseAriaLabel`:`fileRow.expandAriaLabel`,{path:a.path}),className:`mt-1 shrink-0 text-muted-foreground hover:text-foreground`,children:(0,B.jsx)(r,{className:b(`h-4 w-4 transition-transform`,o&&`rotate-180`)})})}),(0,B.jsx)(`button`,{type:`button`,"aria-label":Q(`fileRow.runAriaLabel`,{path:a.path}),className:b(`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`,i?`cursor-pointer hover:border-sky-400/35 hover:bg-sky-500/10`:`cursor-not-allowed opacity-60`,(u||d)&&`border-sky-400/45 bg-sky-500/10`),disabled:!i,onClick:()=>{c(a.path)},children:(0,B.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,B.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,B.jsx)(g,{className:`h-3.5 w-3.5`})}),(0,B.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-start justify-between gap-3`,children:[(0,B.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,B.jsx)(`span`,{className:`block truncate text-xs font-medium text-foreground`,children:tt(a.path)}),(0,B.jsx)(`span`,{className:`mt-0.5 block truncate text-[11px] text-muted-foreground`,children:a.path})]}),(0,B.jsx)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:Q(`fileRow.testCount`,{count:a.cases.length})})]})]})})]}),(0,B.jsx)(w,{children:(0,B.jsx)(`div`,{className:`ml-4 border-l border-border/60 pl-6`,children:a.cases.length===0?(0,B.jsx)(`p`,{className:`px-2.5 py-1.5 text-xs text-muted-foreground`,children:Q(`fileRow.noNamedTests`)}):(0,B.jsx)(`div`,{className:`space-y-1`,children:a.cases.map(r=>{let o=e===`case`&&n===a.path&&t===r.name;return(0,B.jsx)(ft,{canRunGranular:i,filePath:a.path,isActive:o,name:r.name,onRunCase:s},r.id)})})})})]})})});pt.displayName=`DiscoveryFileRow`;var mt=(0,z.memo)(({activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:i,availableCommands:o,canRunGranular:s,discovery:l,expandedFiles:u,fullSuiteOnlyNotice:d,isLoading:h,selectedCommandId:g,selectedCommandName:_,sessionError:v,sessionStatus:ee,shouldShowCommandSelector:x,onRunCase:S,onRunFile:C,onSelectCommand:te,onToggleFile:w})=>{let[T,ne]=(0,z.useState)(``),E=(0,z.useMemo)(()=>it(l,T),[l,T]),D=(0,z.useMemo)(()=>E.reduce((e,t)=>e+t.cases.length,0),[E]),re=nt(T).length>0;return(0,B.jsx)(`aside`,{className:`min-h-0 border-b border-border/70 px-4 py-4 lg:border-r lg:border-b-0`,children:(0,B.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-3`,children:[x&&(0,B.jsxs)(`div`,{className:`space-y-2`,children:[(0,B.jsx)(`p`,{className:`text-xs uppercase tracking-[0.22em] text-muted-foreground`,children:Q(`scope.label`)}),(0,B.jsxs)(n,{children:[(0,B.jsx)(m,{asChild:!0,children:(0,B.jsxs)(y,{type:`button`,variant:`outline`,className:`w-full justify-between rounded-xl border-border/70 bg-background/60`,"aria-label":Q(`scope.selectedCommandAriaLabel`),disabled:o.length===0||ee===`running`,children:[(0,B.jsx)(`span`,{className:`truncate`,children:_??Q(`scope.selectTestScope`)}),(0,B.jsx)(r,{className:`h-4 w-4 text-muted-foreground`})]})}),(0,B.jsx)(ae,{align:`start`,className:`w-72`,children:o.map(e=>(0,B.jsx)(p,{className:b(g===e.id&&`bg-accent text-accent-foreground`),onSelect:()=>{te(e.id)},children:(0,B.jsx)(`span`,{className:`truncate`,children:e.name})},e.id))})]})]}),d&&(0,B.jsx)(`div`,{className:`rounded-2xl border border-border/70 bg-background/30 px-4 py-3 text-sm text-muted-foreground`,children:d}),(l.length>0||T.length>0)&&(0,B.jsxs)(`div`,{className:`relative mt-1 shrink-0`,children:[(0,B.jsx)(c,{type:`search`,value:T,onChange:e=>{ne(e.target.value)},placeholder:Q(`filter.placeholder`),"aria-label":Q(`filter.ariaLabel`),className:`pr-10`}),T.length>0&&(0,B.jsx)(y,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":Q(`filter.clearAriaLabel`),className:`absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground hover:text-foreground`,onClick:()=>{ne(``)},children:(0,B.jsx)(a,{className:`size-4`})})]}),!o.length&&(0,B.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-4 text-sm text-muted-foreground`,children:Q(`discovery.noCommands`)}),v&&(0,B.jsx)(`div`,{className:`rounded-2xl border border-rose-500/30 bg-rose-500/10 px-4 py-3 text-sm text-rose-200`,children:v}),(0,B.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,B.jsxs)(`div`,{className:`shrink-0 flex items-start justify-between gap-3`,children:[(0,B.jsx)(`div`,{className:`min-w-0`,children:(0,B.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[Q(`discovery.fileCount`,{count:E.length}),`, `,Q(`discovery.caseCount`,{count:D})]})}),h&&(0,B.jsx)(f,{className:`h-4 w-4 animate-spin text-muted-foreground`})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 space-y-2 overflow-y-auto pr-1`,children:l.length===0&&!h?(0,B.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:Q(`discovery.noFilesDetected`)}):E.length===0?(0,B.jsx)(`div`,{className:`rounded-2xl border border-dashed border-border/70 bg-background/20 px-4 py-5 text-sm text-muted-foreground`,children:Q(`discovery.noFilterMatches`)}):E.map(n=>(0,B.jsx)(pt,{activeSelectionKind:e,activeSelectionName:t,activeSelectionPath:i,canRunGranular:s,file:n,isExpanded:re||(u[n.path]??!1),onRunCase:S,onRunFile:C,onToggleFile:w},n.path))})]})]})})});mt.displayName=`DiscoveryPane`;var ht=(0,z.memo)(({durationMs:e,output:t,outputTruncated:n,selectionLabel:r,status:i,summaryCounts:a,viewportRef:o,onScroll:s})=>{let c=(0,z.useMemo)(()=>t?j(t).replace(/\r\n/g,`
2
+ `).replace(/\r/g,`
3
+ `).split(`
4
+ `).map(e=>({line:e,tone:st(e)})):[],[t]);return(0,B.jsx)(`section`,{className:`min-h-0 px-4 py-4`,children:(0,B.jsxs)(`div`,{className:`flex h-full flex-col gap-3`,children:[(0,B.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 text-sm`,children:[(0,B.jsx)(`span`,{className:`font-medium text-foreground`,children:r}),i&&(0,B.jsx)(_,{variant:`outline`,className:b(`px-3 py-1 text-xs uppercase tracking-[0.2em]`,et(i)),children:at(i)}),a&&(0,B.jsxs)(`span`,{className:`flex flex-wrap items-center gap-2 text-xs font-medium uppercase tracking-[0.18em]`,children:[(0,B.jsxs)(`span`,{className:`text-rose-200`,children:[a.failed.count,` `,a.failed.label]}),(0,B.jsxs)(`span`,{className:`text-emerald-200`,children:[a.passed.count,` `,a.passed.label]})]}),e!=null&&(0,B.jsx)(`span`,{className:`text-muted-foreground`,children:$(e)}),n&&(0,B.jsx)(_,{variant:`outline`,className:`border-amber-400/30 bg-amber-500/10 text-amber-200`,children:Q(`output.trimmed`)})]}),(0,B.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden rounded-2xl border border-border/70 bg-[#0d1017]`,children:(0,B.jsx)(`div`,{ref:o,"aria-label":Q(`output.ariaLabel`),className:`h-full overflow-auto px-4 py-4`,onScroll:s,children:(0,B.jsx)(`div`,{className:`font-mono text-xs leading-5`,children:c.length>0?c.map((e,t)=>(0,B.jsx)(dt,{line:e.line,tone:e.tone},`${t}:${e.line}`)):(0,B.jsx)(`div`,{className:`text-slate-200`,children:Q(`output.empty`)})})})})]})})});ht.displayName=`OutputPane`;var gt=(0,z.forwardRef)(({testCommands:e,onStatusChange:t,onTargetLabelChange:n,onClose:r,...i},a)=>{let c=i.scope,f=i.projectId,p=i.scope===`ticket`?i.ticketId:null,m=i.scope===`project`?i.targetKind:null,g=i.scope===`project`?i.targetBundleId:null,[_,b]=(0,z.useState)(e),[x,S]=(0,z.useState)(null),[C,te]=(0,z.useState)([]),[w,T]=(0,z.useState)(``),[ne,E]=(0,z.useState)({}),[D,re]=(0,z.useState)(!0),[O,ie]=(0,z.useState)(!1),[k,A]=(0,z.useState)(!1),[j,M]=(0,z.useState)(null),[ae,oe]=(0,z.useState)(!1),[se,ce]=(0,z.useState)(!1),de=(0,z.useRef)(null),fe=(0,z.useRef)(!1),pe=(0,z.useRef)(null),he=(0,z.useRef)(!0),_e=(0,z.useRef)(null),N=(0,z.useRef)(null),ve=x?.selection?.kind??null,ye=x?.selection?.kind===`all`?null:x?.selection?.path??null,be=x?.selection?.kind===`case`?x.selection.name:null,P=x?.id??null,F=x?.status??null,I=(0,z.useMemo)(()=>_.find(e=>e.id===w)??null,[_,w]),Se=(0,z.useMemo)(()=>{if(x?.summary?.failed_count==null&&x?.summary?.passed_count==null&&x?.summary?.failed_file_count==null&&x?.summary?.passed_file_count==null)return null;let e=x?.summary?.failed_count==null&&x?.summary?.passed_count==null;return{failed:F===`failed`&&x?.summary?.failed_count==null&&x?.summary?.failed_file_count!=null||e?{count:x?.summary?.failed_file_count??0,label:Q(`summaryCounts.filesFailed`)}:{count:x?.summary?.failed_count??0,label:Q(`summaryCounts.failed`)},passed:e?{count:x?.summary?.passed_file_count??0,label:Q(`summaryCounts.filesPassed`)}:{count:x?.summary?.passed_count??x?.summary?.passed_file_count??0,label:Q(`summaryCounts.passed`)}}},[x?.summary?.failed_count,x?.summary?.passed_count,x?.summary?.failed_file_count,x?.summary?.passed_file_count,F]),L=I?.runner===`unknown`?Q(`scope.fullSuiteOnlyNotice`):null,R=!!(I&&x?.status!==`running`&&!O&&!k),V=R,H=R&&se,U=_.length>1,{runs:Ce}=ue(f),W=x?.run_id?Ce.find(e=>e.id===x.run_id)??null:null;(0,z.useEffect)(()=>{w||_.length===0||T(_[0]?.id??``)},[_,w]),(0,z.useEffect)(()=>{e.length>0&&b(t=>lt(t,e)?t:e)},[e]),(0,z.useEffect)(()=>{if(_.length>0||!f)return;let e=new AbortController;return h(e.signal).then(e=>{let t=e.find(e=>e.id===f);t&&b(e=>{let n=me(t);return lt(e,n)?e:n})}).catch(()=>{}),()=>{e.abort()}},[_.length,f]),(0,z.useEffect)(()=>{let e=e=>{!e||e.id!==de.current||S(t=>Xe(t,e))},t=e=>{!e||e.session_id!==de.current||S(t=>!t||t.id!==e.session_id||e.run_id&&t.run_id&&e.run_id!==t.run_id?t:{...t,output:Ye(t.output,e.chunk),output_truncated:e.output_truncated})};return xe.on(`test-session:updated`,e),xe.on(`test-session:output`,t),()=>{xe.off(`test-session:updated`,e),xe.off(`test-session:output`,t)}},[]),(0,z.useEffect)(()=>{let e=pe.current;if(!e){_e.current=x?.output??null,N.current=x?.status??null;return}let t=_e.current!==(x?.output??null),n=N.current!==`running`&&x?.status===`running`,r=N.current===`running`&&x?.status!==`running`;if(n&&(he.current=!0),n||t&&x?.status===`running`&&he.current||r&&he.current){let t=$e(e,r);return _e.current=x?.output??null,N.current=x?.status??null,t}_e.current=x?.output??null,N.current=x?.status??null},[x?.output,x?.status]),(0,z.useEffect)(()=>{let e=!1;return(async()=>{try{let t;if(c===`project`){if(!f)return;t=await Ue(f,{target_kind:m??`repo_root`,target_bundle_id:g??null})}else t=await We(p??``,f);if(e){qe(t.id).catch(()=>{});return}de.current=t.id,S(t)}catch(t){e||M(t instanceof le?t.message:Q(`messages.loadRunnerError`))}finally{!e&&de.current==null&&re(!1)}})(),()=>{e=!0}},[f,c,g,m,p]),(0,z.useEffect)(()=>{W&&S(e=>{if(!e||e.run_id!==W.id)return e;let t=W.status===`completed`?`passed`:W.status===`failed`?`failed`:W.status===`cancelled`||W.status===`interrupted`?`stopped`:`running`;return e.status===t&&e.error===(W.failure?.message??e.error)?e:{...e,status:t,error:W.failure?.message??e.error,started_at:W.started_at??e.started_at,completed_at:W.completed_at??e.completed_at}})},[W]),(0,z.useEffect)(()=>{if(!x?.id){ce(!1);return}if(_.length>0&&!w){ce(!1);return}let e=new AbortController,t=!1;return re(!0),ce(!1),X(x.id,{commandId:w||null,signal:e.signal}).then(e=>{t||(te(e.files),ce(e.supports_granular_selection))}).catch(n=>{t||e.signal.aborted||M(n instanceof le?n.message:Q(`messages.discoverError`))}).finally(()=>{t||re(!1)}),()=>{t=!0,e.abort()}},[_.length,w,x?.id]),(0,z.useEffect)(()=>()=>{let e=de.current;!e||fe.current||(fe.current=!0,qe(e).catch(()=>{}))},[]);let G=(0,z.useCallback)(async e=>{if(!(!P||F===`running`||!I||O||k)){M(null),ie(!0);try{let t=await Ge(P,{command_id:I.id,selection:e});S(e=>Xe(e,t))}catch(e){M(e instanceof le?e.message:Q(`messages.startError`))}finally{ie(!1)}}},[O,k,I,P,F]),K=(0,z.useCallback)(async()=>{if(!(!P||F!==`running`||k)){M(null),A(!0);try{let e=await Ke(P);S(t=>Xe(t,e))}catch(e){M(e instanceof le?e.message:Q(`messages.stopError`))}finally{A(!1)}}},[k,P,F]),q=(0,z.useCallback)(()=>{let e=de.current;if(!e||fe.current){r();return}fe.current=!0,r(),qe(e).catch(()=>{})},[r]),we=(0,z.useCallback)(()=>{if(F===`running`){oe(!0);return}q()},[q,F]);(0,z.useImperativeHandle)(a,()=>({requestClose:we}),[we]),(0,z.useEffect)(()=>{t?.(F===`running`?`running`:F===`passed`?`finished`:F===`failed`||F===`error`?`error`:F===`stopped`?`interrupted`:`inactive`)},[t,F]),(0,z.useEffect)(()=>{x?.target_label&&n?.(x.target_label)},[n,x?.target_label]);let J=(0,z.useCallback)(()=>{let e=pe.current;e&&(he.current=Ze(e))},[]),Te=(0,z.useCallback)(e=>{T(e)},[]),Ee=(0,z.useCallback)((e,t)=>{E(n=>(n[e]??!1)===t?n:{...n,[e]:t})},[]),De=(0,z.useCallback)(e=>{G({kind:`file`,path:e})},[G]),Oe=(0,z.useCallback)((e,t)=>{G({kind:`case`,path:e,name:t})},[G]);return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,"data-testid":`tests-panel-layout`,children:[(0,B.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-rows-[minmax(0,1fr)_minmax(0,1fr)] gap-0 lg:grid-cols-[22rem_minmax(0,1fr)] lg:grid-rows-1`,children:[(0,B.jsx)(mt,{activeSelectionKind:ve,activeSelectionName:be,activeSelectionPath:ye,availableCommands:_,canRunGranular:H,discovery:C,expandedFiles:ne,fullSuiteOnlyNotice:L,isLoading:D,selectedCommandId:w,selectedCommandName:I?.name??null,sessionError:j,sessionStatus:F,shouldShowCommandSelector:U,onRunCase:Oe,onRunFile:De,onSelectCommand:Te,onToggleFile:Ee}),(0,B.jsx)(ht,{durationMs:x?.duration_ms??null,output:x?.output??``,outputTruncated:x?.output_truncated??!1,selectionLabel:ot(x),status:F,summaryCounts:Se,viewportRef:pe,onScroll:J})]}),(0,B.jsx)(ge,{className:`shrink-0 border-t border-border/70 px-6 py-4 sm:flex-row sm:items-center sm:justify-end`,children:(0,B.jsx)(`div`,{className:`flex items-center justify-end gap-2`,children:x?.status===`running`?(0,B.jsxs)(y,{type:`button`,variant:`destructive`,className:ut,onClick:()=>{K()},disabled:k,children:[(0,B.jsx)(o,{className:`h-4 w-4`}),(0,B.jsx)(`span`,{children:Q(`actions.stop`)})]}):(0,B.jsxs)(y,{type:`button`,variant:`success`,className:ut,disabled:!V,onClick:()=>{G({kind:`all`})},children:[(0,B.jsx)(l,{className:`h-4 w-4`}),(0,B.jsx)(`span`,{children:Q(`actions.run`)})]})})})]}),(0,B.jsx)(v,{open:ae,onOpenChange:oe,children:(0,B.jsxs)(s,{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,B.jsxs)(u,{children:[(0,B.jsx)(ee,{className:`text-sm font-semibold uppercase tracking-widest text-muted-foreground`,children:Q(`closeConfirmation.title`)}),(0,B.jsx)(d,{className:`text-sm text-foreground whitespace-pre-line`,children:Q(`closeConfirmation.description`)})]}),(0,B.jsxs)(ge,{className:`sm:flex-row sm:justify-end`,children:[(0,B.jsx)(y,{type:`button`,variant:`ghost`,onClick:()=>oe(!1),children:Q(`closeConfirmation.keepRunning`)}),(0,B.jsx)(y,{type:`button`,variant:`destructive`,onClick:()=>{oe(!1),q()},children:Q(`closeConfirmation.stopAndClose`)})]})]})})]})});gt.displayName=`TestsPanel`;var _t=`archon.verification-tab`,vt=()=>{try{let e=window.localStorage.getItem(_t);return e===`checks`||e===`tests`?e:null}catch{return null}},yt=e=>{try{window.localStorage.setItem(_t,e)}catch{}},bt=({targetLabel:e,definitions:t,requiredDefinitionIds:n=[],preReviewDefinitionIds:r=[],checksTarget:i,testsTarget:o,onClose:c,onOpenActivity:l,requestedInitialTab:u,directBatchRunId:f,directAttemptRunId:p,onCheckSelectionChange:m,onUnavailable:h})=>{let{t:g}=L(`common`,{keyPrefix:`verificationDialog`}),_=ce(t),b=i!==null&&(t.length>0||!!i.gateEvaluationId||!!f),S=o!==null&&_.length>0,[C,te]=(0,z.useState)(()=>{if(u===`checks`&&b||u===`tests`&&S)return u;let e=vt();return e===`checks`&&b||e===`tests`&&S?e:b?`checks`:`tests`}),[w,T]=(0,z.useState)(()=>new Set([C])),[ne,E]=(0,z.useState)(`inactive`),[D,re]=(0,z.useState)(`inactive`),ie=(0,z.useRef)(null),A=(0,z.useRef)(null);(0,z.useEffect)(()=>{if(C===`checks`&&!b||C===`tests`&&!S){let e=b?`checks`:`tests`;te(e),T(t=>new Set(t).add(e))}},[C,b,S]);let j=e=>{if(A.current=e??null,o){let e=ie.current;if(e){e.requestClose();return}}(e??c)()},M=()=>{let e=A.current??c;A.current=null,e()};return(0,B.jsx)(v,{open:!0,onOpenChange:e=>{e||j()},children:(0,B.jsxs)(s,{showCloseButton:!1,className:`flex h-[calc(100vh-1rem)] max-h-[58rem] w-full max-w-[calc(100%-1rem)] flex-col gap-0 overflow-hidden rounded-3xl p-0 sm:h-[calc(100vh-2rem)] sm:max-w-7xl`,onInteractOutside:e=>e.preventDefault(),onEscapeKeyDown:e=>e.stopPropagation(),children:[(0,B.jsx)(ee,{className:`sr-only`,children:g(`title`)}),(0,B.jsx)(d,{className:`sr-only`,children:g(`description`)}),(0,B.jsxs)(`header`,{className:`flex shrink-0 items-start justify-between gap-4 border-b border-border/70 px-4 py-4 sm:px-6`,children:[(0,B.jsxs)(`div`,{className:`flex min-w-0 gap-3`,children:[(0,B.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center rounded-2xl border border-border bg-background/60 text-sky-200`,children:(0,B.jsx)(R,{className:`size-5`})}),(0,B.jsxs)(`div`,{className:`min-w-0`,children:[(0,B.jsx)(`h1`,{className:`text-xl font-semibold text-foreground`,children:g(`title`)}),(0,B.jsx)(`p`,{className:`truncate text-sm text-muted-foreground`,children:e})]})]}),(0,B.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l&&(0,B.jsx)(y,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>j(l),children:g(`openActivity`)}),(0,B.jsx)(y,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":g(`close`),onClick:()=>j(),children:(0,B.jsx)(a,{className:`size-4`})})]})]}),(0,B.jsxs)(k,{value:C,onValueChange:e=>{e!==`checks`&&e!==`tests`||(te(e),T(t=>new Set(t).add(e)),yt(e))},className:`flex min-h-0 flex-1 flex-col`,children:[(0,B.jsxs)(`div`,{className:`shrink-0 border-b border-border/70 px-4 py-3 sm:px-6`,children:[(0,B.jsxs)(x,{"aria-label":g(`tabsAriaLabel`),children:[b&&(0,B.jsxs)(P,{value:`checks`,className:`gap-2`,children:[(0,B.jsx)(R,{className:`size-4`}),(0,B.jsx)(`span`,{children:g(`tabs.checks.label`)}),(0,B.jsx)(`span`,{className:`inline-flex shrink-0`,role:`status`,"aria-label":g(`status.checks.${ne}`),children:(0,B.jsx)(oe,{state:ne})})]}),S&&(0,B.jsxs)(P,{value:`tests`,className:`gap-2`,children:[(0,B.jsx)(ye,{className:`size-4`}),(0,B.jsx)(`span`,{children:g(`tabs.tests.label`)}),(0,B.jsx)(`span`,{className:`inline-flex shrink-0`,role:`status`,"aria-label":g(`status.tests.${D}`),children:(0,B.jsx)(oe,{state:D})})]})]}),(0,B.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:g(`tabs.${C}.description`)})]}),b&&i&&w.has(`checks`)&&(0,B.jsx)(O,{value:`checks`,forceMount:!0,className:`mt-0 flex min-h-0 flex-1 flex-col overflow-hidden data-[state=inactive]:hidden`,children:(0,B.jsx)(He,{...i,definitions:t,requiredDefinitionIds:n,preReviewDefinitionIds:r,directBatchRunId:f,directAttemptRunId:p,onSelectionChange:C===`checks`?m:void 0,onUnavailable:h,onStatusChange:E})}),o&&_.length>0&&w.has(`tests`)&&(0,B.jsx)(O,{value:`tests`,forceMount:!0,className:`mt-0 flex min-h-0 flex-1 flex-col overflow-hidden data-[state=inactive]:hidden`,children:(0,B.jsx)(gt,{ref:ie,...o,testCommands:_,onStatusChange:re,onClose:M})})]})]})})};export{bt as VerificationDialog};