@vostride/agent-qa-dashboard-ui 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{arrow-up-down-CKc1J6oh.js → arrow-up-down-CkXEPOSU.js} +1 -1
- package/dist/assets/{badge-B-yh3kbi.js → badge-MmnLIMMu.js} +1 -1
- package/dist/assets/batch-action-bar-Bg_1IyjJ.js +4 -0
- package/dist/assets/check-B2JBwjSe.js +1 -0
- package/dist/assets/circle-Xrl9blhh.js +1 -0
- package/dist/assets/{circle-dashed-WDoZ8ADk.js → circle-dashed-D2UVSTYi.js} +1 -1
- package/dist/assets/circle-slash-iyfIklmt.js +1 -0
- package/dist/assets/{circle-x-1lf_9y_c.js → circle-x-CTm-Znd9.js} +1 -1
- package/dist/assets/config-yByyzBwq.js +3 -0
- package/dist/assets/{cssMode-CIWhUqfG.js → cssMode-BBQdjXbL.js} +1 -1
- package/dist/assets/{display-step-opeACkeD.js → display-step-Cgs30Ul7.js} +1 -1
- package/dist/assets/{dist-Cy8QoEce.js → dist-DTBPY93S.js} +1 -1
- package/dist/assets/{empty-state-2mwYYmoQ.js → empty-state-D-rPbKI6.js} +1 -1
- package/dist/assets/{file-code-BTJCyvvJ.js → file-code-DJGTlQdo.js} +1 -1
- package/dist/assets/filename-validation-DBEhHOy2.js +1 -0
- package/dist/assets/{freemarker2-BiVXttLB.js → freemarker2-DrFcSVs8.js} +1 -1
- package/dist/assets/{grip-vertical-B87oMfre.js → grip-vertical-mXei0XVt.js} +1 -1
- package/dist/assets/{handlebars-C_rmhix8.js → handlebars-SaK5Z7lY.js} +1 -1
- package/dist/assets/hook-editor-B9JLXhOJ.js +1 -0
- package/dist/assets/{hook-runtime-8xwsNog-.js → hook-runtime-CdKy24OK.js} +1 -1
- package/dist/assets/hook-viewer-DRWIRku4.js +1 -0
- package/dist/assets/{hooks-BIXR5djX.js → hooks-DZxZ7qbD.js} +1 -1
- package/dist/assets/{html-v4GGDD2l.js → html-DUrLTy3t.js} +1 -1
- package/dist/assets/{htmlMode-DsnRJeF2.js → htmlMode-CpegtGCG.js} +1 -1
- package/dist/assets/{id-badge-CIbcJUv0.js → id-badge-NMDEQDag.js} +3 -3
- package/dist/assets/index-0ktcxgei.js +116 -0
- package/dist/assets/index-HFKr1ctG.css +2 -0
- package/dist/assets/{insights-CfqFVe4T.js → insights-B0435q79.js} +1 -1
- package/dist/assets/{insights-line-grid-EcYgqiLS.js → insights-line-grid-CtoahJE7.js} +6 -6
- package/dist/assets/{javascript-B12FD1Gz.js → javascript-C-l8zO8e.js} +1 -1
- package/dist/assets/{jsonMode-C_mhVvGR.js → jsonMode-Beeoi3Xk.js} +1 -1
- package/dist/assets/knowledge-view-CD1TFSLc.js +1 -0
- package/dist/assets/{label-CYpyu7PJ.js → label-D_Jf6y0L.js} +1 -1
- package/dist/assets/{liquid-l2oB7oKx.js → liquid-bJdsKvv8.js} +1 -1
- package/dist/assets/live-run-CyJ-cAet.js +1 -0
- package/dist/assets/live-step-row-CrstaK1U.js +1 -0
- package/dist/assets/{lspLanguageFeatures-By4f0cSm.js → lspLanguageFeatures-Cn6BXYdZ.js} +1 -1
- package/dist/assets/{mdx-Cyix08OW.js → mdx-LnT6x9vm.js} +1 -1
- package/dist/assets/{monaco-editor-BQB4vEk_.js → monaco-editor-B6mFBq9L.js} +2 -2
- package/dist/assets/{monaco-editor-inner-DBI8AgAJ.js → monaco-editor-inner-8PnIDLQz.js} +4 -4
- package/dist/assets/{monaco.contribution-C7Dknl5j.js → monaco.contribution-BBzv4yE3.js} +2 -2
- package/dist/assets/plus-Dat6AM-D.js +1 -0
- package/dist/assets/popover-DrbdiGRd.js +1 -0
- package/dist/assets/{python-cdSYU9zt.js → python-DPgrly9F.js} +1 -1
- package/dist/assets/radio-group-D7bWnAJ7.js +1 -0
- package/dist/assets/{razor-BWMXhgx8.js → razor-DjDnQwdx.js} +1 -1
- package/dist/assets/{refresh-cw-BQdOC6UA.js → refresh-cw-DpNAPQYT.js} +1 -1
- package/dist/assets/{resizable-om0nWp3k.js → resizable-BDrAG61s.js} +1 -1
- package/dist/assets/run-detail-CQ6Y6dQj.js +1 -0
- package/dist/assets/run-status-badge-L4mzeuUy.js +1 -0
- package/dist/assets/{run-stream-reducer-BXMulZq1.js → run-stream-reducer-BSkFyxB_.js} +1 -1
- package/dist/assets/runs-DBLAcB4A.js +1 -0
- package/dist/assets/scroll-area-C34fPAjC.js +1 -0
- package/dist/assets/select-B9PD0Kau.js +1 -0
- package/dist/assets/{shortcut-hints-_J-i7rAL.js → shortcut-hints-eZAIE8bW.js} +1 -1
- package/dist/assets/split-button-DdscN9va.js +1 -0
- package/dist/assets/suite-editor-YpS3BwjZ.js +5 -0
- package/dist/assets/suite-navbar-CFZjqNjD.js +1 -0
- package/dist/assets/suite-viewer-Bsz6Epuw.js +1 -0
- package/dist/assets/suites-BglVjv_G.js +1 -0
- package/dist/assets/switch-xSMwKr9Z.js +1 -0
- package/dist/assets/tab-console-BF977T6r.js +1 -0
- package/dist/assets/table-C-9N3ArO.js +1 -0
- package/dist/assets/{tabs-CsAJVEvt.js → tabs-BKL0XmCI.js} +1 -1
- package/dist/assets/test-editor-C6XNOFkP.js +9 -0
- package/dist/assets/test-navbar-qJSqUdYb.js +7 -0
- package/dist/assets/test-viewer-Bh0p09uO.js +1 -0
- package/dist/assets/tests-DgBSme3j.js +1 -0
- package/dist/assets/tests-suites-table-widths-BrDJsNpi.js +1 -0
- package/dist/assets/{textarea-BP7XqG3v.js → textarea-DK29qckP.js} +1 -1
- package/dist/assets/{trash-2-87f7wzeR.js → trash-2-2JD8nWR7.js} +1 -1
- package/dist/assets/{tsMode-CqMhxF8i.js → tsMode-Cajyh71r.js} +1 -1
- package/dist/assets/{typescript-DOy-nOZu.js → typescript-_xcF03po.js} +1 -1
- package/dist/assets/use-clipboard-copy-BlWDP3HN.js +1 -0
- package/dist/assets/{use-hook-run-session-DnSkzl1A.js → use-hook-run-session-CMEz70il.js} +1 -1
- package/dist/assets/{use-keyboard-shortcuts-befVnBO6.js → use-keyboard-shortcuts-Bz9HvJxb.js} +1 -1
- package/dist/assets/{use-page-title-fn79XYtf.js → use-page-title-qvGn8USj.js} +1 -1
- package/dist/assets/{use-run-status-favicon-vVlATUoT.js → use-run-status-favicon-Bt0tLQkk.js} +1 -1
- package/dist/assets/use-selection-queue-DE4YxhK4.js +1 -0
- package/dist/assets/{workers-By3SZV-o.js → workers-e5BAAjmc.js} +1 -1
- package/dist/assets/{wrench-y-wKZ-0A.js → wrench-Cgh_pk3j.js} +1 -1
- package/dist/assets/{xml-BEMkcljk.js → xml-DI6VDnOP.js} +1 -1
- package/dist/assets/{yaml-CfPYAxWJ.js → yaml-BzXIuQuW.js} +1 -1
- package/dist/assets/{zap-DKRM77fm.js → zap-B27P6HHM.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +4 -4
- package/dist/assets/batch-action-bar-MMUxALHz.js +0 -4
- package/dist/assets/check-DH5_3cK-.js +0 -1
- package/dist/assets/checkbox-B5x0V2a2.js +0 -1
- package/dist/assets/circle-DjggEctd.js +0 -1
- package/dist/assets/circle-slash-Baq9Dw6f.js +0 -1
- package/dist/assets/config-CnN4bOco.js +0 -3
- package/dist/assets/filename-validation-I94bcMf7.js +0 -1
- package/dist/assets/globe-B0WEPp3h.js +0 -1
- package/dist/assets/hook-editor-DetIWjh8.js +0 -1
- package/dist/assets/hook-viewer-C_nzb-qD.js +0 -1
- package/dist/assets/index-0GfHLQ0v.css +0 -2
- package/dist/assets/index-CXuVkD6-.js +0 -116
- package/dist/assets/knowledge-view-BHNh7MwX.js +0 -1
- package/dist/assets/live-run-DOfPiVKU.js +0 -1
- package/dist/assets/live-step-row-BtLYYCKS.js +0 -1
- package/dist/assets/plus-DNc2RueT.js +0 -1
- package/dist/assets/popover-DThBIgGA.js +0 -1
- package/dist/assets/radio-group-DDMpRS3x.js +0 -1
- package/dist/assets/run-detail-C9oixuvH.js +0 -1
- package/dist/assets/run-status-badge-DRzXddrc.js +0 -1
- package/dist/assets/runs-BDKh94Pq.js +0 -1
- package/dist/assets/scroll-area-WFIgUp-0.js +0 -1
- package/dist/assets/select-JI5Kadjp.js +0 -1
- package/dist/assets/split-button-BHdketN3.js +0 -1
- package/dist/assets/suite-editor-Ce16nUF9.js +0 -5
- package/dist/assets/suite-navbar-D8RcUReD.js +0 -1
- package/dist/assets/suite-viewer-Bc78bHVL.js +0 -1
- package/dist/assets/suites-D2VXpj7W.js +0 -1
- package/dist/assets/switch-BgfA6DyL.js +0 -1
- package/dist/assets/tab-console-CpnOoTyg.js +0 -1
- package/dist/assets/table-e38rtLis.js +0 -1
- package/dist/assets/test-editor-vZsQDd2R.js +0 -9
- package/dist/assets/test-navbar-BfzeL-K8.js +0 -7
- package/dist/assets/test-viewer-Cek_cnB3.js +0 -1
- package/dist/assets/tests-CzPu8CPe.js +0 -1
- package/dist/assets/tests-suites-table-widths-nMJHxqRN.js +0 -1
- package/dist/assets/use-clipboard-copy-Bmyv0FFY.js +0 -1
- package/dist/assets/use-selection-queue-BAssrkmC.js +0 -1
- /package/dist/assets/{abap-CpHUwCVK.js → abap-CK68cr9-.js} +0 -0
- /package/dist/assets/{apex-DlD7oJX6.js → apex-BHHyAVNb.js} +0 -0
- /package/dist/assets/{azcli-CmXFAbc-.js → azcli-C56lfIEP.js} +0 -0
- /package/dist/assets/{bat-DdNJq4hH.js → bat-BLamSaf-.js} +0 -0
- /package/dist/assets/{bicep-Bppz7WOA.js → bicep-lrOcEItS.js} +0 -0
- /package/dist/assets/{cameligo-0MRMdSmg.js → cameligo-BK_p0bgU.js} +0 -0
- /package/dist/assets/{clojure-B5dKj863.js → clojure-BQ7JOykv.js} +0 -0
- /package/dist/assets/{coffee-DSbWjzk7.js → coffee-BD3DiL5s.js} +0 -0
- /package/dist/assets/{cpp-SBF8SAh9.js → cpp-splnCwCh.js} +0 -0
- /package/dist/assets/{csharp-Lzuq_1t-.js → csharp-BCpsl-o3.js} +0 -0
- /package/dist/assets/{csp-BEzxZqi1.js → csp-tkCWrZmb.js} +0 -0
- /package/dist/assets/{css-C3D3PKln.js → css-B_xdnReq.js} +0 -0
- /package/dist/assets/{cypher-CQ3dEPmv.js → cypher-OL1zq-y3.js} +0 -0
- /package/dist/assets/{dart-DCPmxolI.js → dart-CtTlOkrm.js} +0 -0
- /package/dist/assets/{dockerfile-B_2_aaTO.js → dockerfile-DcQ5CNiW.js} +0 -0
- /package/dist/assets/{ecl-rADUeXsV.js → ecl-DZpiDRt6.js} +0 -0
- /package/dist/assets/{editor.api2-DXR_ThFM.js → editor.api2-S_Xxx4WR.js} +0 -0
- /package/dist/assets/{elixir-DOd-TuJO.js → elixir-Dzj2lqtK.js} +0 -0
- /package/dist/assets/{flow9-Bf7zg_j0.js → flow9-CFENCHIZ.js} +0 -0
- /package/dist/assets/{format-BpI4TiHn.js → format-Y_Dbfary.js} +0 -0
- /package/dist/assets/{fsharp-BqROZjbA.js → fsharp-D-4bv7FB.js} +0 -0
- /package/dist/assets/{go-oQTP5uLe.js → go-djxbTJq7.js} +0 -0
- /package/dist/assets/{graphql-CSHfTU3q.js → graphql-DHIFrkZ6.js} +0 -0
- /package/dist/assets/{hcl-CeG-RoFJ.js → hcl-CXVoowNb.js} +0 -0
- /package/dist/assets/{ini-B2Dv4ohc.js → ini-Crzc5kly.js} +0 -0
- /package/dist/assets/{java-aUDDeufb.js → java-CYLaJrdE.js} +0 -0
- /package/dist/assets/{julia-C5LbruO5.js → julia-BJ7tUU-T.js} +0 -0
- /package/dist/assets/{kotlin-C6mOuSKk.js → kotlin-CeWcU3lC.js} +0 -0
- /package/dist/assets/{less-D5qC3caW.js → less-CviwWNG4.js} +0 -0
- /package/dist/assets/{lexon-Dr2La-fj.js → lexon-Dt28jqDS.js} +0 -0
- /package/dist/assets/{lua-Zy6u5z6Z.js → lua-B6AOaJSi.js} +0 -0
- /package/dist/assets/{m3-C7XHeDz_.js → m3-VnMkHJcy.js} +0 -0
- /package/dist/assets/{markdown-PiF7r-2h.js → markdown-8vKNdvIM.js} +0 -0
- /package/dist/assets/{mips-nn07GiyE.js → mips-DoEcuzan.js} +0 -0
- /package/dist/assets/{msdax-DaKFVMST.js → msdax-CNzvHyEp.js} +0 -0
- /package/dist/assets/{mysql-C6d6xrbU.js → mysql-Buk3vUtL.js} +0 -0
- /package/dist/assets/{numeric-input-DcozBggQ.js → numeric-input-BfrTvhxN.js} +0 -0
- /package/dist/assets/{objective-c-B6KMtI-k.js → objective-c-DfOmda-5.js} +0 -0
- /package/dist/assets/{pascal-DYr8MPE7.js → pascal-DoAA2yjy.js} +0 -0
- /package/dist/assets/{pascaligo-B3pd-jJ_.js → pascaligo-C65Vn1fu.js} +0 -0
- /package/dist/assets/{perl-z2xUzoaL.js → perl-INlfQ_ro.js} +0 -0
- /package/dist/assets/{pgsql-DUvT-09-.js → pgsql-DtwRzglx.js} +0 -0
- /package/dist/assets/{php-CGyOmJfy.js → php-DfHqVNet.js} +0 -0
- /package/dist/assets/{pla-CMqgvyD0.js → pla-D3dNVRYk.js} +0 -0
- /package/dist/assets/{postiats-Dx5LUn4Z.js → postiats-UKXD1rM4.js} +0 -0
- /package/dist/assets/{powerquery-DazYxvJ6.js → powerquery-zE3E3O7s.js} +0 -0
- /package/dist/assets/{powershell-B3nwlDka.js → powershell-Df9b3zQl.js} +0 -0
- /package/dist/assets/{protobuf-BGuu2u2s.js → protobuf-BF0nUVrW.js} +0 -0
- /package/dist/assets/{pug-Dbte1MXA.js → pug-Bj6Yikv_.js} +0 -0
- /package/dist/assets/{qsharp-DJLwBOvG.js → qsharp-BI4h-raZ.js} +0 -0
- /package/dist/assets/{r-DmGBRSHj.js → r-DhpnmaXx.js} +0 -0
- /package/dist/assets/{redis-VvUYn0a4.js → redis-DwYYPr4d.js} +0 -0
- /package/dist/assets/{redshift-6GdDrxg3.js → redshift-D2f3Bc-4.js} +0 -0
- /package/dist/assets/{restructuredtext-CfAB8aRU.js → restructuredtext-Dkiif6fe.js} +0 -0
- /package/dist/assets/{ruby-CIYK6MXY.js → ruby-C6hLmHy0.js} +0 -0
- /package/dist/assets/{rust-CTHZfjj9.js → rust-X8WAGtxB.js} +0 -0
- /package/dist/assets/{sb-CkKTdkz_.js → sb-4M2la0Kr.js} +0 -0
- /package/dist/assets/{scala-Bx-Wr9TM.js → scala-CaCXz58E.js} +0 -0
- /package/dist/assets/{scheme-Dcfi6f83.js → scheme-CMdjpmP7.js} +0 -0
- /package/dist/assets/{scss-ByL-7PFQ.js → scss-QopmvPyp.js} +0 -0
- /package/dist/assets/{shell-Csnb9Yqd.js → shell-CDBchS00.js} +0 -0
- /package/dist/assets/{solidity-Dbw5-0QP.js → solidity-DvBfi5mC.js} +0 -0
- /package/dist/assets/{sophia-ZQ3saZQx.js → sophia-HSnXR17u.js} +0 -0
- /package/dist/assets/{sparql-BEtOel8u.js → sparql-DhG_ppup.js} +0 -0
- /package/dist/assets/{sql-DGPDbzB7.js → sql-DHeIS-tf.js} +0 -0
- /package/dist/assets/{st-GeW2MOgh.js → st-CMWchiRU.js} +0 -0
- /package/dist/assets/{swift-BVYTN8jq.js → swift-CDXvBefj.js} +0 -0
- /package/dist/assets/{systemverilog-Deg2a8Lr.js → systemverilog-0RTukYUE.js} +0 -0
- /package/dist/assets/{tcl-6DnLmROF.js → tcl-CbBF_Ttl.js} +0 -0
- /package/dist/assets/{twig-XbbXW9Yz.js → twig-DCcGd8FE.js} +0 -0
- /package/dist/assets/{typespec-CRlV8GhI.js → typespec-HTphp-Uh.js} +0 -0
- /package/dist/assets/{vb-BHE2izPH.js → vb-Cb_yUcVd.js} +0 -0
- /package/dist/assets/{viewer-url-state-BnbixmdH.js → viewer-url-state-BfJV-cGM.js} +0 -0
- /package/dist/assets/{wgsl-Bf5vkfmY.js → wgsl-DrKU3YXj.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{a as t,o as n}from"./run-stream-reducer-BSkFyxB_.js";import{a as r,c as i,l as a,m as o,o as s,p as c,r as l,s as u,t as d,u as f}from"./use-clipboard-copy-BlWDP3HN.js";import{A as p,C as m,D as h,E as g,M as _,N as v,O as y,S as b,T as x,_ as S,a as C,b as w,c as T,d as ee,f as E,g as D,h as O,i as k,j as A,k as j,l as M,m as N,n as te,o as P,p as F,r as I,s as L,t as ne,u as R,v as re,w as z,x as B,y as ie}from"./tab-console-BF977T6r.js";import{t as V}from"./check-B2JBwjSe.js";import{a as ae,i as oe,n as se,r as ce,t as le}from"./select-B9PD0Kau.js";import{n as ue,r as de,t as fe}from"./textarea-DK29qckP.js";import{t as pe}from"./circle-dashed-D2UVSTYi.js";import{a as me,i as he,n as ge,r as _e,t as ve}from"./use-run-status-favicon-Bt0tLQkk.js";import{t as H}from"./circle-slash-iyfIklmt.js";import{t as ye}from"./circle-x-CTm-Znd9.js";import{t as be}from"./circle-Xrl9blhh.js";import{n as xe,r as Se}from"./shortcut-hints-eZAIE8bW.js";import{t as Ce}from"./plus-Dat6AM-D.js";import{t as we}from"./refresh-cw-DpNAPQYT.js";import{t as Te}from"./zap-B27P6HHM.js";import{t as Ee}from"./label-D_Jf6y0L.js";import{n as De,r as Oe,t as ke}from"./popover-DrbdiGRd.js";import{n as Ae,t as je}from"./radio-group-D7bWnAJ7.js";import{i as Me,n as Ne,r as U,t as Pe}from"./tabs-BKL0XmCI.js";import{A as W,An as Fe,Bn as Ie,D as Le,Dr as Re,E as ze,Er as Be,Et as Ve,F as He,Fn as Ue,Ft as We,G as Ge,Gt as G,H as Ke,Ht as K,It as qe,K as Je,Kt as Ye,M as Xe,Mt as Ze,N as Qe,Nn as $e,Nt as et,O as tt,P as nt,Pn as rt,Qs as it,R as q,Rn as at,Ss as ot,St as st,Tr as ct,Vt as lt,Xs as ut,Ys as dt,Yt as ft,Zs as pt,_r as mt,_s as ht,_t as J,bt as gt,ds as _t,ec as vt,er as yt,f as bt,h as xt,j as St,jt as Ct,k as Y,kn as wt,m as Tt,n as Et,p as Dt,q as Ot,tc as kt,ur as At,v as jt,vr as Mt,w as Nt,wt as Pt,xn as Ft,xs as It,y as Lt,yr as Rt,z as X}from"./index-0ktcxgei.js";import{t as zt}from"./use-page-title-qvGn8USj.js";import{t as Bt}from"./badge-MmnLIMMu.js";import{t as Vt}from"./scroll-area-C34fPAjC.js";import{i as Ht,n as Ut,r as Wt,t as Gt}from"./resizable-BDrAG61s.js";import{t as Kt}from"./empty-state-D-rPbKI6.js";import{t as qt}from"./use-keyboard-shortcuts-Bz9HvJxb.js";import{$ as Jt,A as Yt,B as Xt,C as Zt,D as Qt,E as $t,F as en,G as tn,I as nn,J as rn,K as an,L as on,M as sn,N as cn,O as ln,P as un,Q as dn,R as fn,S as pn,T as mn,U as hn,W as gn,X as _n,Y as vn,Z as yn,_ as bn,a as xn,b as Sn,c as Cn,d as wn,et as Tn,f as En,g as Dn,h as On,i as kn,j as An,k as jn,l as Mn,m as Nn,n as Pn,o as Fn,p as In,q as Ln,r as Rn,s as zn,t as Bn,tt as Vn,v as Hn,w as Un,x as Wn,y as Gn,z as Kn}from"./knowledge-view-CD1TFSLc.js";import{a as qn,i as Jn,n as Yn,o as Xn,s as Zn}from"./display-step-Cgs30Ul7.js";var Qn=G(`accessibility`,[[`circle`,{cx:`16`,cy:`4`,r:`1`,key:`1grugj`}],[`path`,{d:`m18 19 1-7-6 1`,key:`r0i19z`}],[`path`,{d:`m5 8 3-3 5.5 3-2.36 3.5`,key:`9ptxx2`}],[`path`,{d:`M4.24 14.5a5 5 0 0 0 6.88 6`,key:`10kmtu`}],[`path`,{d:`M13.76 17.5a5 5 0 0 0-6.88-6`,key:`2qq6rc`}]]),$n=G(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),er=G(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),tr=G(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),nr=G(`circle-minus`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 12h8`,key:`1wcyev`}]]),rr=G(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),ir=G(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),ar=G(`corner-down-right`,[[`path`,{d:`m15 10 5 5-5 5`,key:`qqa56n`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]),or=G(`cpu`,[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]),sr=G(`crosshair`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`22`,x2:`18`,y1:`12`,y2:`12`,key:`l9bcsi`}],[`line`,{x1:`6`,x2:`2`,y1:`12`,y2:`12`,key:`13hhkx`}],[`line`,{x1:`12`,x2:`12`,y1:`6`,y2:`2`,key:`10w3f3`}],[`line`,{x1:`12`,x2:`12`,y1:`22`,y2:`18`,key:`15g9kq`}]]),cr=G(`flask-conical`,[[`path`,{d:`M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2`,key:`18mbvz`}],[`path`,{d:`M6.453 15h11.094`,key:`3shlmq`}],[`path`,{d:`M8.5 2h7`,key:`csnxdl`}]]),lr=G(`history`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]]),ur=G(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),dr=G(`layers`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),fr=G(`list-checks`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}]]),pr=G(`list-x`,[[`path`,{d:`M16 5H3`,key:`m91uny`}],[`path`,{d:`M11 12H3`,key:`51ecnj`}],[`path`,{d:`M16 19H3`,key:`zzsher`}],[`path`,{d:`m15.5 9.5 5 5`,key:`ytk86i`}],[`path`,{d:`m20.5 9.5-5 5`,key:`17o44f`}]]),mr=G(`maximize-2`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`m21 3-7 7`,key:`1l2asr`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M9 21H3v-6`,key:`wtvkvv`}]]),hr=G(`message-square-plus`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]),gr=G(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),_r=G(`minimize-2`,[[`path`,{d:`m14 10 7-7`,key:`oa77jy`}],[`path`,{d:`M20 10h-6V4`,key:`mjg0md`}],[`path`,{d:`m3 21 7-7`,key:`tjx5ai`}],[`path`,{d:`M4 14h6v6`,key:`rmj7iw`}]]),vr=G(`panel-right-open`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`m10 15-3-3 3-3`,key:`1pgupc`}]]),yr=G(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),br=G(`replace`,[[`path`,{d:`M14 4a1 1 0 0 1 1-1`,key:`dhj8ez`}],[`path`,{d:`M15 10a1 1 0 0 1-1-1`,key:`1mnyi5`}],[`path`,{d:`M21 4a1 1 0 0 0-1-1`,key:`sfs9ap`}],[`path`,{d:`M21 9a1 1 0 0 1-1 1`,key:`mp6qeo`}],[`path`,{d:`m3 7 3 3 3-3`,key:`x25e72`}],[`path`,{d:`M6 10V5a2 2 0 0 1 2-2h2`,key:`15xut4`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}]]),xr=G(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Sr=G(`target`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`circle`,{cx:`12`,cy:`12`,r:`6`,key:`1vlfrh`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),Cr=G(`thumbs-down`,[[`path`,{d:`M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z`,key:`m61m77`}],[`path`,{d:`M17 14V2`,key:`8ymqnk`}]]),wr=G(`thumbs-up`,[[`path`,{d:`M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z`,key:`emmmcr`}],[`path`,{d:`M7 10v12`,key:`1qc93n`}]]),Z=e(kt(),1),Q=ft(),Tr=`Toggle`,Er=Z.forwardRef((e,t)=>{let{pressed:n,defaultPressed:r,onPressedChange:i,...a}=e,[o,s]=gt({prop:n,onChange:i,defaultProp:r??!1,caller:Tr});return(0,Q.jsx)(Ve.button,{type:`button`,"aria-pressed":o,"data-state":o?`on`:`off`,"data-disabled":e.disabled?``:void 0,...a,ref:t,onClick:st(e.onClick,()=>{e.disabled||s(!o)})})});Er.displayName=Tr;var Dr=`ToggleGroup`,[Or,kr]=Pt(Dr,[Ot]),Ar=Ot(),jr=Z.forwardRef((e,t)=>{let{type:n,...r}=e;if(n===`single`)return(0,Q.jsx)(Pr,{...r,ref:t});if(n===`multiple`)return(0,Q.jsx)(Fr,{...r,ref:t});throw Error(`Missing prop \`type\` expected on \`${Dr}\``)});jr.displayName=Dr;var[Mr,Nr]=Or(Dr),Pr=Z.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=gt({prop:n,defaultProp:r??``,onChange:i,caller:Dr});return(0,Q.jsx)(Mr,{scope:e.__scopeToggleGroup,type:`single`,value:Z.useMemo(()=>o?[o]:[],[o]),onItemActivate:s,onItemDeactivate:Z.useCallback(()=>s(``),[s]),children:(0,Q.jsx)(Rr,{...a,ref:t})})}),Fr=Z.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...a}=e,[o,s]=gt({prop:n,defaultProp:r??[],onChange:i,caller:Dr}),c=Z.useCallback(e=>s((t=[])=>[...t,e]),[s]),l=Z.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return(0,Q.jsx)(Mr,{scope:e.__scopeToggleGroup,type:`multiple`,value:o,onItemActivate:c,onItemDeactivate:l,children:(0,Q.jsx)(Rr,{...a,ref:t})})});jr.displayName=Dr;var[Ir,Lr]=Or(Dr),Rr=Z.forwardRef((e,t)=>{let{__scopeToggleGroup:n,disabled:r=!1,rovingFocus:i=!0,orientation:a,dir:o,loop:s=!0,...c}=e,l=Ar(n),u=J(o),d={role:`group`,dir:u,...c};return(0,Q.jsx)(Ir,{scope:n,rovingFocus:i,disabled:r,children:i?(0,Q.jsx)(Je,{asChild:!0,...l,orientation:a,dir:u,loop:s,children:(0,Q.jsx)(Ve.div,{...d,ref:t})}):(0,Q.jsx)(Ve.div,{...d,ref:t})})}),zr=`ToggleGroupItem`,Br=Z.forwardRef((e,t)=>{let n=Nr(zr,e.__scopeToggleGroup),r=Lr(zr,e.__scopeToggleGroup),i=Ar(e.__scopeToggleGroup),a=n.value.includes(e.value),o=r.disabled||e.disabled,s={...e,pressed:a,disabled:o},c=Z.useRef(null);return r.rovingFocus?(0,Q.jsx)(Ge,{asChild:!0,...i,focusable:!o,active:a,ref:c,children:(0,Q.jsx)(Vr,{...s,ref:t})}):(0,Q.jsx)(Vr,{...s,ref:t})});Br.displayName=zr;var Vr=Z.forwardRef((e,t)=>{let{__scopeToggleGroup:n,value:r,...i}=e,a=Nr(zr,n),o={role:`radio`,"aria-checked":e.pressed,"aria-pressed":void 0};return(0,Q.jsx)(Er,{...a.type===`single`?o:void 0,...i,ref:t,onPressedChange:e=>{e?a.onItemActivate(r):a.onItemDeactivate(r)}})}),Hr=jr,Ur=Br;function Wr(e,t,n=document.createElement(`video`)){return new Promise(r=>{let i=!1,a,o=e=>{i||(i=!0,clearTimeout(a),n.removeEventListener(`loadedmetadata`,s),n.removeEventListener(`durationchange`,s),n.removeEventListener(`error`,c),t.removeEventListener(`abort`,c),n.removeAttribute(`src`),n.load(),r(e))},s=()=>{Number.isFinite(n.duration)&&n.duration>0&&o(n.duration*1e3)},c=()=>o();if(t.aborted){o();return}n.preload=`metadata`,n.muted=!0,n.addEventListener(`loadedmetadata`,s),n.addEventListener(`durationchange`,s),n.addEventListener(`error`,c),t.addEventListener(`abort`,c,{once:!0}),a=setTimeout(c,1e4),n.src=e})}function Gr(e,t){let n=e.flatMap(e=>{let n=e.member.recording;return n?.state===`present`&&!n.ref.evidenceIncomplete?[{key:`${t}:${e.member.testIndex}:${n.ref.sha}`,sha:n.ref.sha}]:[]}),r=n.map(e=>e.key).join(`|`),i=(0,Z.useRef)(new Map),[a,o]=(0,Z.useState)();(0,Z.useEffect)(()=>{let e=new AbortController,a=new Set(n.map(e=>e.key));for(let e of i.current.keys())a.has(e)||i.current.delete(e);let s=n.filter(e=>!i.current.has(e.key)),c=0;return Promise.all(Array.from({length:Math.min(3,s.length)},async()=>{for(;!e.signal.aborted&&c<s.length;){let n=s[c++],r=await Wr(Rt.runArtifact(t,n.sha),e.signal);e.signal.aborted||i.current.set(n.key,r)}})).then(()=>{e.signal.aborted||o({signature:r,values:new Map(i.current)})}),()=>e.abort()},[r,t]);let s=a?.signature===r;return{groups:(0,Z.useMemo)(()=>e.map(e=>{let n=e.member.recording,r=s&&n?.state===`present`?a.values.get(`${t}:${e.member.testIndex}:${n.ref.sha}`):void 0;return r===void 0||n?.state!==`present`?e:{...e,member:{...e.member,recording:{...n,durationMs:r}}}}),[e,a,s,t]),ready:s,decodedDurations:(0,Z.useMemo)(()=>new Map(e.flatMap(e=>{let n=e.member.recording,r=s&&n?.state===`present`?a.values.get(`${t}:${e.member.testIndex}:${n.ref.sha}`):void 0;return r===void 0?[]:[[e.member.testIndex,r]]})),[e,a,s,t])}}var Kr={complete:{Glyph:lt,glyphClass:`text-emerald-500`,wordClass:`text-muted-foreground`},running:{Glyph:pe,glyphClass:`text-amber-500 motion-safe:animate-pulse`,wordClass:`text-muted-foreground`},pending:{Glyph:be,glyphClass:`text-muted-foreground`,wordClass:`text-muted-foreground`},failed:{Glyph:ye,glyphClass:`text-destructive`,wordClass:`text-destructive`},skipped:{Glyph:nr,glyphClass:`text-muted-foreground`,wordClass:`text-muted-foreground`},unavailable:{Glyph:nr,glyphClass:`text-muted-foreground`,wordClass:`text-muted-foreground`}},qr=`inline-flex items-center gap-1 min-h-6 rounded-sm text-xs`,Jr=`focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`;function Yr(e,t){return e===void 0?[]:[{kind:`outcome`,text:e.outcome},...e.note===void 0?[]:[{kind:`note`,text:e.note}],...e.timing===void 0?[]:[{kind:`timing`,text:e.timing}],...e.retry===void 0?[]:[{kind:`retry`,text:e.retry}],...t===void 0?[]:[{kind:`door`,text:_n[t]}]]}function Xr({stage:e,lines:t,children:n}){return t.length===0?n:(0,Q.jsxs)(ze,{children:[(0,Q.jsx)(Y,{asChild:!0,children:n}),(0,Q.jsx)(Le,{side:`bottom`,align:`start`,sideOffset:4,className:`max-w-[320px] text-left break-words`,"data-stage-card":e,children:(0,Q.jsx)(`div`,{className:`space-y-1`,children:t.map((e,t)=>(0,Q.jsx)(`p`,{"data-stage-card-line":e.kind,className:t===0?`font-medium`:`text-muted-foreground`,children:e.text},e.kind))})})]})}function Zr({stage:e,chip:t,onActivate:n,door:r}){let{Glyph:i,glyphClass:a,wordClass:o}=Kr[t.state],s=n!==void 0&&r!==void 0,c=Yr(t.card,s?r:void 0),l=(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(i,{"aria-hidden":`true`,className:`h-3.5 w-3.5 ${a}`}),(0,Q.jsx)(`span`,{className:o,children:t.word})]});return s?(0,Q.jsx)(Xr,{stage:e,lines:c,children:(0,Q.jsx)(`button`,{type:`button`,"data-chip":e,"data-chip-status":t.status,"data-stage-state":t.state,onClick:n,"aria-label":e===`curation`?Jt(t):Vn(e,t.state,t.card?.outcome,r),className:`${qr} ${Jr} cursor-pointer transition-colors hover:text-foreground`,children:l})}):(0,Q.jsx)(Xr,{stage:e,lines:c,children:(0,Q.jsxs)(`span`,{"data-chip":e,"data-chip-status":t.status,"data-stage-state":t.state,tabIndex:0,className:`${qr} ${Jr} cursor-default`,children:[l,(0,Q.jsx)(`span`,{className:`sr-only`,children:Vn(e,t.state,t.card?.outcome)})]})})}function Qr({view:e,onCurationClick:t,onOpenVerdict:n}){if(e===void 0)return(0,Q.jsxs)(`span`,{"data-chips-state":`loading`,role:`status`,className:`text-xs text-muted-foreground shrink-0`,children:[`…`,(0,Q.jsx)(`span`,{className:`sr-only`,children:yn})]});if(e.kind===`unavailable`){let{Glyph:t,glyphClass:n,wordClass:r}=Kr.unavailable;return(0,Q.jsx)(Xr,{stage:`unavailable`,lines:[{kind:`outcome`,text:vn},{kind:`error`,text:e.error},...e.reason===void 0?[]:[{kind:`reason`,text:e.reason}]],children:(0,Q.jsxs)(`span`,{"data-chips-state":`unavailable`,"data-stage-state":`unavailable`,tabIndex:0,className:`${qr} ${Jr} cursor-default ${r}`,children:[(0,Q.jsx)(t,{"aria-hidden":`true`,className:`h-3.5 w-3.5 ${n}`}),dn]})})}return(0,Q.jsxs)(`span`,{"data-chips-state":`chips`,...e.skipped===void 0?{}:{"data-postprocessing-skipped":e.skipped.reason},className:`inline-flex items-center gap-2 min-w-0`,children:[(0,Q.jsx)(Zr,{stage:`analysis`,chip:e.analysis,onActivate:n,door:`verdict`}),(0,Q.jsx)(Zr,{stage:`curation`,chip:e.curation,onActivate:t,door:`knowledge`})]})}function $r(e,t){let n=O(e),r=g(e);return[{kind:`totals`,text:y(e)},...n===void 0?[]:[{kind:`cached`,text:n}],...r===void 0?[]:[{kind:`coverage`,text:r}],...h(t).map(e=>({kind:e.kind,text:e.text}))]}function ei({tokens:e,models:t}){return(0,Q.jsx)(Le,{side:`bottom`,align:`end`,sideOffset:4,className:`max-w-[320px] text-left break-words`,"data-usage-card":!0,children:(0,Q.jsx)(`div`,{className:`space-y-1 text-xs tabular-nums`,children:$r(e,t).map((e,t)=>(0,Q.jsx)(`p`,{"data-usage-line":e.kind,className:e.kind===`totals`?`font-medium`:`text-muted-foreground`,children:e.text},`${e.kind}-${String(t)}`))})})}var ti={note:``};function ni(e){return ht(e)}function ri(e){return e.kind===void 0&&e.note===``}function ii({stepIndex:e,member:t}){let n=t===void 0?void 0:`${ie(t)} ${w(t.testIndex)}`;return e===void 0?n??`this test`:n===void 0?`step ${String(e+1)}`:`step ${String(e+1)} of ${n}`}function ai(e,t){let n=e.member!==void 0&&t.member!==void 0&&e.member.testIndex!==t.member.testIndex,r=n?e:{stepIndex:e.stepIndex},i=t.stepIndex===void 0||n?t:{stepIndex:t.stepIndex};return`You're viewing ${ii(r)} — this feedback is about ${ii(i)}.`}function oi(e){return`Switch to ${ii(e)}`}function si(e){return`Unsent draft: ${ii(e)}`}var ci=`Note (optional)`,li=2e3;function ui(e){return`${String(e)} / ${String(li)}`}var di={"false-fail":`This should have passed`,"false-pass":`This should have failed`,"confirmed-bug":`This is a real product bug`},fi={failed:[`false-fail`,`confirmed-bug`,`false-pass`],passed:[`false-pass`,`confirmed-bug`,`false-fail`]},pi=`Which is true?`,mi={failed:{"false-fail":`The app behaved correctly; the test was wrong to fail.`,"confirmed-bug":`The failure is real — the app is broken here.`,"false-pass":`The test missed a problem it should have caught.`},passed:{"false-fail":`The pass is right; this confirms the test.`,"confirmed-bug":`The app has a real bug here, even though the test passed.`,"false-pass":`The app was broken here, but the test passed anyway.`}};function hi(e){return e===`passed`||e===`healed`?`passed`:`failed`}function gi(e,t){return hi(e??t)}function _i({member:e,step:t,runStatus:n}){let r=t?.verifierVerdict;return r==null?gi(e?.outcome,n):r.pass?`passed`:`failed`}function vi(e){return`${e.prefix}${e.name??``}${e.suffix??``}`}var yi=`Whole test`,bi=`One step`,xi={passed:`recorded: passed`,healed:`recorded: healed — counts as passed`,failed:`recorded: failed`,timeout:`recorded: timed out — counts as failed`,cancelled:`recorded: cancelled — counts as failed`,skipped:`recorded: skipped — counts as failed`};function Si(e){return`no step verdict recorded — using the test's result (${e})`}function Ci(e){return e!==void 0&&Object.hasOwn(xi,e)?e:void 0}function wi({member:e,step:t,stepCount:n,suite:r}){return t===void 0?r?{prefix:`Feedback on `,name:ie(e),suffix:` ${w(e.testIndex)}`}:{prefix:`Feedback on `,name:ie(e)}:{prefix:`Feedback on step ${String(t.stepIndex+1)} of ${String(n)} · `,name:t.stepText??`Untitled step`}}function Ti(e,t){return xi[Ci(e.outcome??t)??gi(e.outcome,t)]}function Ei(e,t,n){let r=e.verifierVerdict;if(r==null)return Si(Ti(t,n));let i=r.pass?`passed`:`failed`,a=Ci(e.status);return xi[a!==void 0&&gi(a)===i?a:i]}function Di({member:e,step:t,suite:n,runStatus:r}){if(t===void 0)return{prefix:`${yi} · ${Ti(e,r)}`};let i=Ei(t,e,r);return n?{prefix:`${bi} in `,name:ie(e),suffix:` ${w(e.testIndex)} · ${i}`}:{prefix:`${bi} · ${i}`}}function Oi({detail:e,target:t,runStatus:n}){let r=e?.members.find(e=>e.testIndex===t.testIndex),i=r??{testIndex:t.testIndex},a=e?.steps.filter(e=>e.testIndex===t.testIndex)??[],o=t.stepIndex===void 0?void 0:a.find(e=>e.stepIndex===t.stepIndex)??{stepIndex:t.stepIndex},s=(e?.members.length??0)>1,c=Math.max(r?.totalSteps??a.length,o===void 0?0:o.stepIndex+1);return{outcomeClass:_i({member:i,step:o,runStatus:n}),heading:wi({member:i,step:o,stepCount:c,suite:s}),scopeLine:Di({member:i,step:o,suite:s,runStatus:n}),stepCount:c}}function ki({detail:e,selectedStep:t,memberFilter:n,runStatus:r}){let i=e?.members??[],a=e=>e===void 0?void 0:i.find(t=>t.testIndex===e),o=i.length===1?i[0]:a(t?.testIndex)??a(n)??i.find(e=>gi(e.outcome,r)===`failed`)??i[0];return o===void 0?void 0:{testIndex:o.testIndex}}var Ai=`Test`,ji=`This test has no unique address in this run, so feedback can't be recorded for it.`;function Mi(e,t){let n=e?.members??[],r=n.find(e=>e.testIndex===t);return r===void 0?!1:n.length<=1?!0:!!r.testId&&n.filter(e=>e.testId===r.testId).length===1}function Ni(e,t){return t&&e>0&&e<768?`stacked`:`docked`}var Pi={tree:`run-tree`,evidence:`run-evidence`,feedback:`run-feedback`},Fi={tree:`run-tree-stacked`,evidence:`run-evidence-stacked`,feedback:`run-feedback-stacked`};function Ii(e){return e===`stacked`?Fi:Pi}function Li(e,t){let n=Ii(e);if(e===`stacked`)return{[n.tree]:30,[n.evidence]:30,[n.feedback]:40};let r=t>0?Math.min(Math.max(384/t*100,320/t*100),50):30,i=(100-r)*.35;return{[n.tree]:i,[n.evidence]:100-r-i,[n.feedback]:r}}function Ri(e,t,n){return{kind:n,...e.testId?{testId:e.testId}:{},...t.stepIndex===void 0?{}:{stepIndex:t.stepIndex}}}function zi(e){return JSON.stringify([e.kind,e.testIndex,e.stepIndex??`run`])}var Bi=new Set(_t),Vi=`This test can't be marked from the dashboard.`,Hi=`Choose one of the three options.`,Ui=`Checking what this will do…`,Wi=`Consequences couldn't be checked — retry above.`,Gi=`This mark can't be recorded — see above.`,Ki=`You already said this — there's nothing new to record.`,qi=`Sending…`;function Ji(e){if(e.noUniqueAddress===!0)return Vi;if(e.kind===void 0)return Hi;let t=e.landedOutcome;return t===void 0||e.landedKey!==e.currentKey?Ui:t===`failed`?Wi:Bi.has(t)?Gi:t!==`consequences`&&t!==`quarantined`?Ki:e.inFlight?qi:``}var Yi=`Send feedback`,Xi=`What this will do`,Zi=`Sending feedback…`,Qi=`Give feedback on this test`,$i=`Close feedback`,ea=`Close (Esc)`,ta=`Draft kept. Check the message above before sending again.`;function na({scope:e,stepNumber:t,memberName:n,handle:r,markedChoice:i}){let a=e===`step`?`Give feedback on step ${String(t)}`:r===void 0?Qi:`Give feedback on ${n??``} ${r}`;return i===void 0?a:`${a} — already marked: ${di[i]}`}function ra(e,t){return t?`Step ${String(e)} is already marked — review or change`:`Give feedback on step ${String(e)}`}function ia(e){return`Marked: ${di[e]}`}var aa={applied:{fact:`Recorded — a knowledge fact was added`,caution:`Recorded — a caution was added`,"procedure-hint":`Recorded — a procedure hint was added`,"test-edit":`Recorded — the test file was edited`},drafted:`Recorded — a fix was drafted (older mark)`,"no-draftable-fix":`Recorded — no fix could be drafted`,"confirmed-bug":`Recorded — kept as a real product bug; nothing changed`,"not-applied":{"target-not-found":`Recorded — the fix was not applied: the knowledge it replaces is gone`,"policy-materialize-refused":`Recorded — the fix was not applied: its policy text was refused`,"outside-workspace":`Recorded — the fix was not applied: the test file is outside the workspace`}};function oa(e){switch(e.kind){case`quarantined`:return`Recorded — quarantined (${e.class})`;case`applied`:return aa.applied[e.fix];case`drafted`:return aa.drafted;case`no-draftable-fix`:return aa[`no-draftable-fix`];case`confirmed-bug`:return aa[`confirmed-bug`];case`not-applied`:return aa[`not-applied`][e.reason];default:return e}}function sa(e){return`Feedback recorded — ${oa(e).replace(/^Recorded — /,``)}.`}function ca({kind:e,landed:t}){if(e===void 0)return`idle`;if(t===void 0)return`loading`;if(t.kind===`failed`)return`failed`;let n=t.result.kind;return Bi.has(n)?`refused`:n===`consequences`||n===`quarantined`?n:`already-marked`}var la=`Updating…`,ua=`Choose an option above to see what this will do.`,da={knowledge:`Knowledge`,change:`Change`};function fa(e,t){if(t===0)return`No knowledge records are reached`;let n=[e.confirmed===0?void 0:`${String(e.confirmed)} ${e.confirmed===1?`record`:`records`} confirmed`,e.overturned===0?void 0:`${String(e.overturned)} counted against`].filter(e=>e!==void 0);return n.length>0?n.join(` · `):t===1?`1 record reached — it can't be read`:`${String(t)} records reached — none can be read`}function pa(e){return`Show records (${String(e)})`}var ma={confirm:`confirms`,overturn:`counts against`},ha=`This record can't be read — it keeps its place, and nothing is applied to it.`;function ga(e){if(e.evidence.kind===`unreadable`)return ha;let{effects:t}=e.evidence,n=t.filter(e=>e.direction===`overturn`).length;return[t.some(e=>e.direction===`confirm`)?ma.confirm:void 0,n===0?void 0:n===1?ma.overturn:`${ma.overturn} × ${String(n)}`].filter(e=>e!==void 0).join(` · `)}var _a={"not-found":`Record content not found`,"scan-incomplete":`Record content could not be fully read`,"not-bound":`Record content isn't available on this host`},va={knowledge:{fact:`A knowledge fact will be added`,caution:`A caution will be added`,"procedure-hint":`A procedure hint will be added`},"test-edit":`The test file will be edited`,"no-draftable-fix":`No fix can be made from this run`,"confirmed-bug":`Nothing changes — a real product bug needs a product fix, not a test or knowledge change`};function ya(e){switch(e.kind){case`knowledge`:return va.knowledge[e.fix];case`test-edit`:return va[`test-edit`];case`no-draftable-fix`:return va[`no-draftable-fix`];case`confirmed-bug`:return va[`confirmed-bug`];default:return e}}var ba=`The exact wording isn't shown here — it's written when you send.`;function xa(e){return e.kind===`knowledge`||e.kind===`test-edit`}function Sa(e,t){return`Replaces your earlier mark (${t===void 0?`#${String(e)}`:`#${String(e)}, ${t}`}); what it changed stays`}function Ca(e,t,n,r){let i=`This marks step ${String(n)} of ${String(r)} — `;switch(e){case`failing-step`:return`${i}the first step that failed.`;case`passing-verdict`:return t===`false-pass`?`${i}the last step, where the test finished.`:`${i}the last step, because no step failed.`;case`step-mark`:return;default:return e}}function wa(e){return`Show step ${String(e)}`}var Ta={timeout:`a timeout`,flake:`a flaky run`,environment:`an environment problem`};function Ea(e){return`This test failed from ${Ta[e]}, so your mark is recorded but quarantined — no knowledge or tests change.`}function Da(e){return`You already said this${e===void 0?``:` (${e})`}. A new note alone isn't recorded.`}var Oa={"run-not-found":()=>`This run is no longer in the run store, so feedback can't be recorded.`,"member-not-found":()=>`This test can't be found in the run, so feedback can't be recorded.`,"step-not-found":e=>e.stepCount===0?`This test recorded no steps, so there is nothing to mark.`:`This test recorded ${String(e.stepCount)} ${e.stepCount===1?`step`:`steps`}, so there is no step ${String(e.stepIndex+1)} to mark.`,"ambiguous-address":e=>`${String(e.candidates.length)} tests in this run share this address, so the mark can't be placed.`};function ka(e){return Bi.has(e.kind)}function Aa(e){switch(e.kind){case`run-not-found`:return Oa[e.kind]();case`member-not-found`:return Oa[e.kind]();case`step-not-found`:return Oa[e.kind](e);case`ambiguous-address`:return Oa[e.kind](e);default:return e}}var ja={network:`the dashboard server didn't answer`,"ledger-corrupt":`this run's feedback ledger is damaged`,"ledger-unavailable":`this run's feedback ledger can't be read right now`,refused:`the server refused the request`,shape:`the server's answer didn't match the expected shape`};function Ma(e){return ja[e]}function Na(e){return`Couldn't check what this will do — ${e}.`}var Pa={prefix:`You can still record feedback from the CLI (`,name:`agent-qa runs mark`,suffix:`) or over MCP.`};vi(Pa);var Fa=`Retry`,Ia=`${Fa} checking what this will do`,La=`Technical details`,Ra={kind:`Mark kind`,address:`Address`,testId:`Test id`,records:`Reached records`,basis:`Basis`};function za(e){let t=e.priorMarkOrdinal===void 0?``:` · prior mark #${String(e.priorMarkOrdinal)}`;return`ledger ordinal ${String(e.ledgerOrdinal)}${t}`}function Ba(e){if(e===void 0)return`loading`;if(e.kind===`failed`)return`failed`;let{result:t}=e;return t.kind===`history`?t.entries.length===0?`empty`:`history`:t.kind}var Va={step:`Feedback on this step`,test:`Feedback on this test`};function Ha(e,t){return`${Va[e]} (${String(t)})`}function Ua(e){return`All feedback on this run (${String(e)})`}var Wa=`Active`;function Ga(e){return e===void 0?`Replaced by your later mark`:`Replaced by your later mark at ${e}`}var Ka=`Only your latest mark on a test or step counts.`;function qa(e){return`${e} (content unavailable)`}function Ja(e){let{disposition:t}=e;if(t.kind===`drafted`)return{kind:`unavailable`};if(t.kind!==`applied`)return;if(t.change.kind===`test-file`)return{kind:`test-file`,filePath:t.change.filePath};if(t.change.recordIds.length===0)return{kind:`unavailable`};let n=new Map((e.changedRecords??[]).map(e=>[e.recordId,e.recordContent?.content]));return{kind:`knowledge`,records:t.change.recordIds.map(e=>{let t=n.get(e);return t===void 0?{recordId:e}:{recordId:e,content:t}})}}var Ya=`its content was not recorded.`,Xa=`what it changed was not recorded.`,Za=`A fix stays when you mark again: correct knowledge with new feedback or by forgetting it, and revert a test edit with git.`,Qa={step:`No feedback on this step yet.`,test:`No feedback on this test yet.`,run:`No feedback on this run yet.`};function $a(e,t){switch(e){case`run-not-found`:return`This run's feedback history can't be found.`;case`ledger-corrupt`:return`This run's feedback history is damaged at line ${String(t)}, so it can't be shown.`;case`ledger-unavailable`:return`This run's feedback history can't be read right now.`;default:return e}}function eo(e){return`Couldn't load this run's feedback history — ${e}.`}var to=`${Fa} loading feedback history`,no=new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`});function ro(e){return e===void 0||!Number.isFinite(e)?void 0:no.format(new Date(e))}function io(e,t){let n=Oi({detail:t,target:e.stepIndex===void 0?{testIndex:e.testIndex}:{testIndex:e.testIndex,stepIndex:e.stepIndex},runStatus:void 0});return e.stepIndex===void 0?{prefix:``,name:ie(t?.members.find(t=>t.testIndex===e.testIndex)??{testIndex:e.testIndex}),suffix:` ${w(e.testIndex)} · whole test`}:{prefix:`Step ${String(e.stepIndex+1)} of ${String(n.stepCount)} · `,name:n.heading.name}}function ao({scope:e,label:t,target:n,marked:r,expanded:i,controls:a,onOpen:o,tooltip:s}){let c=r?gr:hr;return(0,Q.jsxs)(ze,{children:[(0,Q.jsx)(Y,{asChild:!0,children:(0,Q.jsx)(q,{variant:`ghost`,size:`icon-sm`,className:X(`shrink-0`,e===`step`&&`size-7`,r?`text-foreground`:`text-muted-foreground hover:text-foreground`),"data-feedback-entry":e,"data-feedback-target":n,"data-feedback-marked":String(r),"aria-label":t,"aria-expanded":i,"aria-controls":a,onClick:e=>o(e.currentTarget),children:(0,Q.jsx)(c,{className:X(`h-3.5 w-3.5`,r&&`fill-current`),"aria-hidden":`true`})})}),(0,Q.jsx)(Le,{side:e===`step`?`left`:`bottom`,children:s??(r?`Already marked — review or change`:`Give feedback`)})]})}function oo({scope:e,target:t,kind:n}){return(0,Q.jsx)(`span`,{role:`img`,"aria-label":ia(n),"data-feedback-mark-glyph":e,"data-feedback-target":t,className:`inline-flex size-4 shrink-0 items-center justify-center text-muted-foreground`,children:(0,Q.jsx)(gr,{className:`size-3 fill-current`,"aria-hidden":`true`})})}function so({status:e}){let{label:t,...n}=Re(e);return(0,Q.jsx)(Bt,{"data-verdict-badge":e,...n,className:X(n.className,`text-sm font-medium px-2 py-1 rounded-sm`),children:t})}function co({run:e,tokens:t,models:n,shortcutsOpen:r,onToggleShortcuts:i,onOpenArtifacts:a,postProcessing:o,hasPostProcessing:s=!1,onCurationClick:c,onOpenVerdict:l,retrievalRung:u,feedbackEntry:d}){let f=ut(),p=e.suiteId!=null,m=p&&e.suiteId?Rt.suiteView(e.suiteId):e.testId?Rt.testView(e.testId):null,h=p&&e.suiteId?`Open suite`:`Open test`,g=()=>{At({file:e.filePath??e.name}).then(e=>{Lt.success(`Re-run started`),f(Rt.runLive(e.runId))}).catch(()=>Lt.error(`Failed to start re-run`))};return(0,Q.jsxs)(`div`,{className:`shrink-0 @container`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-col gap-y-2 min-h-14 border-b px-4 py-2 min-w-0 @5xl:flex-row @5xl:items-center @5xl:justify-between @5xl:gap-y-0 @5xl:py-0`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,Q.jsx)(`button`,{onClick:()=>f(Rt.runs),className:`text-sm text-muted-foreground hover:text-foreground transition-colors shrink-0`,children:`Runs`}),(0,Q.jsx)(K,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,Q.jsx)(`span`,{className:`text-sm font-medium truncate min-w-[96px]`,title:e.name,children:e.name}),m?(0,Q.jsx)(`a`,{href:m,target:`_blank`,rel:`noopener noreferrer`,"aria-label":h,className:`shrink-0 text-muted-foreground transition-colors hover:text-foreground`,children:(0,Q.jsx)(er,{className:`h-3.5 w-3.5`})}):null,(0,Q.jsx)(so,{status:e.status}),d===void 0?null:(0,Q.jsx)(ao,{scope:`test`,...d})]}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-4 gap-y-2 shrink-0`,children:[s?(0,Q.jsx)(Qr,{view:o,onCurationClick:c,onOpenVerdict:l}):null,t===void 0?null:(0,Q.jsxs)(ze,{children:[(0,Q.jsx)(Y,{asChild:!0,children:(0,Q.jsxs)(`span`,{"data-run-token-summary":!0,tabIndex:0,className:`text-xs text-muted-foreground flex items-center gap-1 tabular-nums cursor-default rounded-sm focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,children:[(0,Q.jsx)(or,{className:`h-3.5 w-3.5`}),x(t),(0,Q.jsx)(`span`,{className:`sr-only`,children:N})]})}),(0,Q.jsx)(ei,{tokens:t,models:n})]}),(0,Q.jsxs)(`span`,{"data-run-duration":!0,className:`text-xs text-muted-foreground flex items-center gap-1`,children:[(0,Q.jsx)(rr,{className:`h-3.5 w-3.5`}),Ke(e.duration)]}),(0,Q.jsxs)(`div`,{className:`ml-auto flex items-center gap-3`,children:[(0,Q.jsx)(`div`,{className:`h-4 w-px bg-border`}),(0,Q.jsx)(q,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run artifacts`,title:`Run details (I/C/M)`,onClick:()=>a?.(`test`),children:(0,Q.jsx)(vr,{className:`h-3.5 w-3.5`})}),(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(q,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,"aria-expanded":r,title:`Shortcuts (Shift+?)`,onClick:i,children:(0,Q.jsx)(Se,{className:`h-3.5 w-3.5`})}),r?(0,Q.jsx)(`div`,{role:`dialog`,"aria-label":`Keyboard shortcuts`,className:`absolute right-0 top-full z-50 mt-2 w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md`,children:(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Navigation`}),(0,Q.jsx)(xe,{hints:[{key:`← →`,label:`Previous / next action`},{key:`Space`,label:`Play / pause`},{key:`V`,label:`Frames / Video`},{key:`↑ / K`,label:`Previous item`},{key:`↓ / J`,label:`Next item`},{key:`Shift+↑`,label:`Previous step`},{key:`Shift+↓`,label:`Next step`}]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Tabs`}),(0,Q.jsx)(xe,{hints:[{key:`1`,label:`Overview`},{key:`2`,label:`Env`},{key:`3`,label:`Network`},{key:`4`,label:`Console`},{key:`5`,label:`ARIA`},{key:`6`,label:`A11y`},{key:`7`,label:`Knowledge`}]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Phases`}),(0,Q.jsx)(xe,{hints:[{key:`Shift+1`,label:`Toggle Observe`},{key:`Shift+2`,label:`Toggle Plan`},{key:`Shift+3`,label:`Toggle Execute`},{key:`Shift+4`,label:`Toggle Verify`}]})]}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Actions`}),(0,Q.jsx)(xe,{hints:[{key:`I`,label:`Details: Attributes`},{key:`C`,label:`Artifacts: Config`},{key:`M`,label:`Knowledge tab`},{key:`R`,label:`Re-run`},{key:`Shift+?`,label:`Shortcuts`},{key:`Esc`,label:`Close`}]})]})]})}):null]}),(0,Q.jsx)(q,{variant:`ghost`,size:`icon-sm`,"aria-label":`Re-run`,title:`Re-run (R)`,onClick:g,children:(0,Q.jsx)(xr,{className:`h-3.5 w-3.5`})})]})]})]}),(0,Q.jsx)(_e,{rung:u?.rung,reason:u?.reason})]})}var $={test:`Test`,config:`Config`,testAsWritten:`Test as written`,resolvedDefinition:`Resolved definition`,suiteMembers:`Suite members`,runTests:`Tests in this run`,runAttributes:`Run attributes`,effectiveConfig:`Effective config`,globalConfigAsWritten:`Global config as written`,model:`Model`,runtime:`Runtime`,errors:`Errors`,notCaptured:`Not captured`,configNotCaptured:`Config not captured`,unsealedCapture:`This run's setup capture didn't finish, so the test and config shown here may be incomplete.`,technicalDetails:`Technical details`,runId:`Run ID`,artifactKind:`Artifact kind`,schemaVersion:`Schema version`,captureSealedAt:`Capture sealed at`,copyRunId:`Copy run ID`,retry:`Retry loading run details`},lo={test:`Test`,unknown:`Not recorded`};function uo(e){return e.finalizedAt?`sealed`:`unsealed`}function fo(e){return`Run ${e}`}function po(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:{}}function mo(e){return typeof e==`string`&&e.trim()&&e.trim().toLowerCase()!==`unknown`?e:void 0}function ho(e){let t=po(e),n=po(t.runtime),r=po(t.effectiveConfig),i=po(r.use),a=po(i.browser),o=po(po(t.model).planner);return[mo(n.targetName)??mo(r.baseUrl),[mo(n.platform)??mo(i.platform),mo(a.name)].filter(Boolean).join(` `),mo(o.model)].filter(e=>typeof e==`string`&&e.length>0)}function go(e){return Object.entries(e).sort(([e],[t])=>{let n=e.startsWith(`agent-qa.`);return n===t.startsWith(`agent-qa.`)?e.localeCompare(t):n?-1:1})}function _o(e){navigator.clipboard?.writeText(e)}function vo({attributes:e}){let t=go(e);return t.length===0?(0,Q.jsxs)(`div`,{className:`rounded-[2px] border border-border p-4`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`No run attributes`}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`This run did not record any attributes.`})]}):(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`div`,{className:`flex justify-end`,children:(0,Q.jsxs)(q,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>_o(JSON.stringify(Object.fromEntries(t),null,2)),children:[(0,Q.jsx)(ue,{className:`size-4`}),`Copy JSON`]})}),(0,Q.jsx)(`div`,{className:`overflow-hidden rounded-[2px] border border-border`,children:(0,Q.jsx)(`table`,{className:`w-full table-fixed text-sm`,children:(0,Q.jsx)(`tbody`,{children:t.map(([e,t])=>(0,Q.jsxs)(`tr`,{className:`border-b border-border/70 last:border-b-0`,children:[(0,Q.jsx)(`th`,{className:`w-[240px] align-top px-3 py-2 text-left font-mono text-xs font-medium text-muted-foreground`,children:e}),(0,Q.jsx)(`td`,{className:`align-top px-3 py-2`,children:(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 break-all font-mono text-xs text-foreground`,children:t}),(0,Q.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Copy ${e} value`,title:`Copy value`,onClick:()=>_o(t),children:(0,Q.jsx)(ue,{className:`size-3.5`})})]})})]},e))})})})]})}function yo(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function bo(e){return Array.isArray(e)}function xo(e,t=`Not captured`){return e===void 0?t:e===null?`None`:typeof e==`boolean`?e?`true`:`false`:typeof e==`number`?Number.isFinite(e)?String(e):`None`:typeof e==`string`?e.length>0?e:`None`:Array.isArray(e)?`${e.length} ${e.length===1?`item`:`items`}`:yo(e)?`${Object.keys(e).length} ${Object.keys(e).length===1?`field`:`fields`}`:String(e)}function So({title:e,badges:t=[],children:n,className:r,"data-drawer-section":i}){return(0,Q.jsxs)(`section`,{"data-drawer-section":i,className:X(`rounded-[2px] border border-border bg-transparent`,r),children:[(0,Q.jsxs)(`header`,{className:`flex min-w-0 items-center gap-2 border-b px-4 py-3`,children:[(0,Q.jsx)(`h3`,{className:`min-w-0 flex-1 truncate text-sm font-medium text-foreground`,children:e}),t.map(e=>(0,Q.jsx)(Bt,{variant:`outline`,className:`text-[10px]`,children:e},e))]}),(0,Q.jsx)(`div`,{className:`space-y-3 px-4 py-4`,children:n})]})}function Co({rows:e}){return(0,Q.jsx)(`div`,{className:`divide-y divide-border/50`,children:e.map(e=>(0,Q.jsxs)(`div`,{className:`grid gap-1 py-1.5 text-xs sm:grid-cols-[160px_minmax(0,1fr)] sm:gap-3`,children:[(0,Q.jsx)(`dt`,{className:`font-medium text-muted-foreground`,children:e.label}),(0,Q.jsx)(`dd`,{className:X(`min-w-0 break-words text-foreground`,e.mono&&`break-all font-mono`),children:e.value})]},e.label))})}function wo({value:e}){return(0,Q.jsx)(`span`,{className:X(`break-words`,(e==null||typeof e==`boolean`||typeof e==`number`)&&`font-mono text-[11px]`,e==null?`text-muted-foreground`:`text-foreground`),children:xo(e)})}function To({value:e,label:t=`root`,level:n=0}){if(bo(e))return(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{className:`group flex w-full min-w-0 items-center gap-1.5 py-1.5 text-left text-xs hover:text-foreground`,children:[(0,Q.jsx)(K,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90`}),(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-medium text-muted-foreground`,children:t}),(0,Q.jsxs)(`span`,{className:`font-mono text-[11px] text-foreground`,children:[e.length,` `,e.length===1?`item`:`items`]})]}),(0,Q.jsx)(p,{children:(0,Q.jsx)(`div`,{className:`ml-3 border-l border-border pl-3`,children:e.length===0?(0,Q.jsx)(`div`,{className:`py-1.5 text-xs text-muted-foreground`,children:`None`}):e.map((e,r)=>(0,Q.jsx)(To,{label:`${r}`,value:e,level:n+1},`${t}-${r}`))})})]});if(yo(e)){let r=Object.entries(e);return(0,Q.jsxs)(j,{defaultOpen:n===0,children:[(0,Q.jsxs)(A,{className:`group flex w-full min-w-0 items-center gap-1.5 py-1.5 text-left text-xs hover:text-foreground`,children:[(0,Q.jsx)(K,{className:`h-3 w-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90`}),(0,Q.jsx)(`span`,{className:`min-w-0 truncate font-medium text-muted-foreground`,children:t}),(0,Q.jsxs)(`span`,{className:`font-mono text-[11px] text-foreground`,children:[r.length,` `,r.length===1?`field`:`fields`]})]}),(0,Q.jsx)(p,{children:(0,Q.jsx)(`div`,{className:`ml-3 border-l border-border pl-3`,children:r.length===0?(0,Q.jsx)(`div`,{className:`py-1.5 text-xs text-muted-foreground`,children:`None`}):r.map(([e,t])=>(0,Q.jsx)(To,{label:e,value:t,level:n+1},e))})})]})}return(0,Q.jsxs)(`div`,{className:`grid gap-1 py-1.5 text-xs sm:grid-cols-[160px_minmax(0,1fr)] sm:gap-3`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 break-words font-medium text-muted-foreground`,children:t}),(0,Q.jsx)(wo,{value:e})]})}function Eo({label:e,content:t}){return t?(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{className:`group flex w-full items-center gap-1.5 rounded-[2px] py-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,Q.jsx)(K,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),e]}),(0,Q.jsx)(p,{children:(0,Q.jsx)(`pre`,{className:`mt-2 max-h-80 overflow-x-auto overflow-y-auto rounded-[2px] border border-border bg-muted/30 p-3 font-mono text-[11px] leading-relaxed whitespace-pre text-foreground`,children:t})})]}):null}function Do(e,t){return e?e[t]:void 0}function Oo(e,t){let n=Do(e,t);return typeof n==`string`&&n.length>0?n:null}function ko(e,t){let n=Do(e,t);return yo(n)?n:null}function Ao(e,t){let n=Do(e,t);return bo(n)?n:[]}function jo(e){return yo(e)&&[Oo(e,`code`),Oo(e,`phase`),Oo(e,`message`)].filter(Boolean).join(` - `)||null}function Mo(e){if(!e||typeof e!=`object`||Array.isArray(e))return{};let t=Object.entries(e).filter(e=>typeof e[1]==`string`);return Object.fromEntries(t)}function No(e){let t=Mo(e.run.attributes);if(Object.keys(t).length>0)return t;let n=e.artifact?.payload;return Mo(ko(ko(yo(n)?n:null,`metadata`),`attributes`))}function Po({config:e}){let t=Do(e,`runtime`),n=Do(e,`timeouts`),r=Do(e,`model`);return(0,Q.jsxs)(`div`,{"data-member-config":!0,children:[t==null?null:(0,Q.jsx)(To,{label:`runtime`,value:t}),n==null?null:(0,Q.jsx)(To,{label:`timeouts`,value:n}),r==null?null:(0,Q.jsx)(To,{label:`model`,value:r})]})}function Fo({source:e,kind:t}){let n=Ao(e,`members`).filter(yo).sort((e,t)=>(typeof e.index==`number`?e.index:0)-(typeof t.index==`number`?t.index:0));return(0,Q.jsx)(So,{title:t===`tests`?$.runTests:$.suiteMembers,"data-drawer-section":t===`tests`?`run-tests`:`suite-members`,children:(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[n.length===0?$.notCaptured:null,n.map(e=>{let n=ko(e,`ref`),r=typeof e.index==`number`?e.index:0,i=Oo(e,`childRunId`),a=jo(Do(e,`error`)),o=ko(e,`config`),s=o?ho(o).join(` · `):``;return(0,Q.jsxs)(`div`,{"data-suite-member-index":r,className:`rounded-[2px] border border-border p-3`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2`,children:[(0,Q.jsxs)(Bt,{variant:`outline`,className:`text-[10px]`,children:[`#`,r+1]}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1 break-words text-sm font-medium`,children:Oo(e,`name`)??Oo(n,`test`)??`Unnamed member`}),(0,Q.jsx)(Bt,{variant:`outline`,className:`text-[10px]`,children:xo(Oo(e,`loadStatus`))})]}),(0,Q.jsx)(Co,{rows:[{label:`Test ID`,value:xo(Oo(e,`testId`)),mono:!0},{label:`Ref`,value:xo(Oo(n,`test`)),mono:!0},{label:`Ref ID`,value:xo(Oo(n,`id`)),mono:!0},{label:`Path`,value:xo(Oo(e,`filePath`)),mono:!0},{label:`Target`,value:xo(Oo(e,`target`))},{label:`Child run`,value:i?(0,Q.jsx)(`a`,{className:`break-all text-primary hover:underline`,href:Rt.runDetail(i),children:i}):`Not captured`,mono:!!i},{label:`Error`,value:a??`None`},...o?[{label:`Ran against`,value:s||$.notCaptured}]:[]]}),(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{className:`group mt-2 flex w-full items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,Q.jsx)(K,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),`Member snapshots`]}),(0,Q.jsxs)(p,{className:`mt-2 space-y-2`,children:[(0,Q.jsx)(Eo,{label:t===`tests`?`Raw test YAML`:`Raw member YAML`,content:Oo(e,`rawYaml`)}),Do(e,`resolvedDefinition`)===void 0?null:(0,Q.jsx)(To,{label:`resolvedDefinition`,value:Do(e,`resolvedDefinition`)}),o?(0,Q.jsx)(Po,{config:o}):null]})]})]},`${r}-${Oo(e,`testId`)??Oo(n,`test`)??`member`}`)})]})})}function Io({response:e}){let t=e.artifact?.payload,n=ko(yo(t)?t:null,`source`),r=e.missingSections.includes(`source`)?null:n,i=Oo(n,`kind`),a=Oo(r,`rawYaml`),o=Do(r,`resolvedDefinition`),s=No(e);return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[i===`tests`?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(So,{title:$.testAsWritten,"data-drawer-section":`test-as-written`,children:a?(0,Q.jsx)(Eo,{label:i===`suite`?`Raw suite YAML`:`Raw test YAML`,content:a}):$.notCaptured}),(0,Q.jsx)(So,{title:$.resolvedDefinition,"data-drawer-section":`resolved-definition`,children:o==null?$.notCaptured:(0,Q.jsx)(To,{label:`resolvedDefinition`,value:o})})]}),i===`suite`||i===`tests`?(0,Q.jsx)(Fo,{source:r??{},kind:i}):null,Object.keys(s).length>0?(0,Q.jsx)(So,{title:$.runAttributes,"data-drawer-section":`run-attributes`,children:(0,Q.jsx)(vo,{attributes:s})}):null]})}function Lo(e,t){return e?e[t]:void 0}function Ro(e,t){let n=Lo(e,t);return typeof n==`string`&&n.length>0?n:null}function zo(e,t){let n=Lo(e,t);return yo(n)?n:null}function Bo(e,t){let n=Lo(e,t);return bo(n)?n:[]}function Vo(e){return yo(e)&&[Ro(e,`code`),Ro(e,`phase`),Ro(e,`message`)].filter(Boolean).join(` - `)||null}function Ho({response:e}){let t=e.artifact?.payload,n=yo(t)?t:null,r=e.missingSections.includes(`config`)?null:zo(n,`config`),i=Lo(r,`effectiveConfig`),a=Ro(r,`rawConfigContent`),o=Lo(r,`model`),s=Lo(n,`runtime`),c=Bo(n,`errors`);return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[(0,Q.jsx)(So,{title:$.effectiveConfig,"data-drawer-section":`effective-config`,children:i==null?$.notCaptured:(0,Q.jsx)(To,{label:`effectiveConfig`,value:i})}),(0,Q.jsx)(So,{title:$.globalConfigAsWritten,"data-drawer-section":`global-config`,children:a?(0,Q.jsx)(Eo,{label:`Raw global config`,content:a}):$.notCaptured}),(0,Q.jsx)(So,{title:$.model,"data-drawer-section":`model`,children:o==null?$.notCaptured:(0,Q.jsx)(To,{label:`model`,value:o})}),(0,Q.jsx)(So,{title:$.runtime,"data-drawer-section":`runtime`,children:s==null?$.notCaptured:(0,Q.jsx)(To,{label:`runtime`,value:s})}),(0,Q.jsx)(So,{title:$.errors,"data-drawer-section":`errors`,children:c.length>0?(0,Q.jsx)(`div`,{className:`space-y-2`,children:c.map((e,t)=>(0,Q.jsx)(`div`,{className:`rounded-[2px] border border-red-500/20 bg-red-500/5 p-3 text-sm`,children:Vo(e)??JSON.stringify(e)},t))}):$.notCaptured})]})}function Uo({runId:e,artifact:t}){return(0,Q.jsxs)(j,{"data-technical-details":!0,className:`shrink-0 border-t bg-muted/40 p-4`,children:[(0,Q.jsxs)(A,{className:`group flex w-full items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,Q.jsx)(K,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),$.technicalDetails]}),(0,Q.jsx)(p,{children:(0,Q.jsxs)(`dl`,{className:`mt-4 grid grid-cols-[auto_minmax(0,1fr)] items-start gap-x-4 gap-y-2 text-xs`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:$.runId}),(0,Q.jsxs)(`dd`,{className:`flex min-w-0 items-start gap-2 break-all font-mono`,children:[(0,Q.jsx)(`span`,{className:`min-w-0 flex-1`,children:e}),(0,Q.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":$.copyRunId,onClick:()=>{navigator.clipboard?.writeText(e)},children:(0,Q.jsx)(ue,{className:`size-3.5`})})]}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:$.artifactKind}),(0,Q.jsx)(`dd`,{className:`break-all`,children:lo[t.kind]}),(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:$.schemaVersion}),(0,Q.jsx)(`dd`,{className:`break-all font-mono`,children:t.schemaVersion}),uo(t)===`sealed`?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:$.captureSealedAt}),(0,Q.jsx)(`dd`,{className:`break-all`,children:t.finalizedAt})]}):null]})})]})}function Wo(){return(0,Q.jsxs)(`div`,{className:`space-y-4`,"aria-label":`Loading artifact data`,children:[(0,Q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Loading artifact data...`}),[0,1,2].map(e=>(0,Q.jsxs)(`div`,{className:`rounded-[2px] border border-border p-4`,children:[(0,Q.jsx)(W,{className:`h-4 w-40`}),(0,Q.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[(0,Q.jsx)(W,{className:`h-3 w-full`}),(0,Q.jsx)(W,{className:`h-3 w-5/6`}),(0,Q.jsx)(W,{className:`h-3 w-3/5`})]})]},e))]})}function Go({error:e,onRetry:t}){return(0,Q.jsx)(`div`,{className:`rounded-[2px] border border-red-500/20 bg-red-500/5 p-4`,children:(0,Q.jsxs)(`div`,{className:`flex items-start gap-3`,children:[(0,Q.jsx)(de,{className:`mt-0.5 h-4 w-4 shrink-0 text-red-500`}),(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Could not load artifact data`}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Retry the request. If it continues, verify the dashboard server can read run artifacts.`}),(0,Q.jsx)(`p`,{className:`mt-2 break-words font-mono text-xs text-red-500`,children:e}),(0,Q.jsx)(q,{className:`mt-3`,size:`sm`,variant:`outline`,onClick:t,children:$.retry})]})]})})}function Ko(){return(0,Q.jsxs)(`div`,{className:`rounded-[2px] border border-border p-4`,children:[(0,Q.jsx)(`h3`,{className:`text-sm font-medium text-foreground`,children:`Artifact data is not available for this run`}),(0,Q.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`This run does not have a persisted artifact record.`})]})}function qo({tab:e,response:t}){return e===`test`?(0,Q.jsx)(Io,{response:t}):(0,Q.jsx)(Ho,{response:t})}function Jo({tab:e,response:t,loading:n,error:r,onRetry:i}){return n?(0,Q.jsx)(Wo,{}):r?(0,Q.jsx)(Go,{error:r,onRetry:i}):!t||e!==`test`&&!t.artifact?(0,Q.jsx)(Ko,{}):(0,Q.jsx)(qo,{tab:e,response:t})}function Yo({run:e,open:t,tab:n=`test`,response:r,loading:i,error:a,onOpenChange:o,onTabChange:s,onRetry:c}){let l=r?.artifact??null,u=e.name||fo(e.id),d=ho(l?.payload.config),f=d.length>0?d.join(` · `):$.configNotCaptured;return(0,Q.jsx)(St,{open:t,onOpenChange:o,children:(0,Q.jsxs)(Xe,{side:`right`,className:`w-[min(820px,92vw)] sm:max-w-none gap-0 overflow-hidden p-0`,children:[(0,Q.jsxs)(nt,{className:`border-b px-4 py-3 pr-12`,children:[(0,Q.jsx)(He,{className:`text-base leading-snug font-medium line-clamp-2`,children:u}),(0,Q.jsx)(Qe,{className:`truncate text-xs`,children:f})]}),l&&uo(l)===`unsealed`?(0,Q.jsxs)(`div`,{role:`status`,"data-capture-state":`unsealed`,className:`m-4 flex items-start gap-2 rounded-sm border border-amber-500/25 bg-amber-500/5 p-3 text-sm`,children:[(0,Q.jsx)(et,{className:`h-4 w-4 shrink-0 text-amber-500`}),(0,Q.jsx)(`span`,{children:$.unsealedCapture})]}):null,(0,Q.jsxs)(Pe,{value:n,onValueChange:e=>s(e),className:`min-h-0 flex-1 overflow-hidden`,children:[(0,Q.jsx)(`div`,{className:`border-b px-3`,children:(0,Q.jsxs)(U,{variant:`line`,className:`h-9 w-full justify-start`,children:[(0,Q.jsx)(Me,{value:`test`,className:`max-w-32 flex-none`,children:$.test}),(0,Q.jsx)(Me,{value:`config`,className:`max-w-32 flex-none`,children:$.config})]})}),(0,Q.jsxs)(Vt,{className:`min-h-0 flex-1`,children:[(0,Q.jsx)(Ne,{value:`test`,className:`m-0 px-4 py-4`,children:(0,Q.jsx)(Jo,{tab:`test`,response:r,loading:i,error:a,onRetry:c})}),(0,Q.jsx)(Ne,{value:`config`,className:`m-0 px-4 py-4`,children:(0,Q.jsx)(Jo,{tab:`config`,response:r,loading:i,error:a,onRetry:c})})]})]}),l?(0,Q.jsx)(Uo,{runId:e.id,artifact:l}):null]})})}function Xo({variant:e}){return(0,Q.jsx)(L,{kind:`frame`,state:`unavailable`,incomplete:!0,variant:e,title:e===`inline`?E:T.frame.unavailable.title,explanation:M})}var Zo=`LLM verdict`,Qo=`deterministic fallback`,$o=`analysis running — this may upgrade`,es=`analysis failed — showing deterministic fallback`;function ts(e,t){return e===`analyze-run`?`${Zo} · ${t.toFixed(2)}`:Qo}function ns(e){switch(e){case`pending`:case`running`:return`provisional`;case`failed`:return`failed`;case`complete`:case void 0:return}}function rs(e){if(e!==void 0)return e===`provisional`?$o:es}function is(e){return`step ${String(e)}`}var as=`screenshot`;function os(e){return`same failure as ${String(e)} other ${e===1?`test`:`tests`}`}var ss=`memory on path: none declared`,cs=`All records on path`;function ls(e){return`memory on path: ${String(e)} ${e===1?`record`:`records`}`}function us(e){return{onPath:e,onPathText:e.length===0?ss:ls(e.length)}}function ds(e){let t=e.total===1?`cited artifact`:`cited artifacts`;return`${String(e.missing)} of ${String(e.total)} ${t} unavailable`}function fs(e,t,n){let r=new Map;if(e===void 0)return r;let i=ns(t),a=rs(i),o=new Map(e.sentences.map(e=>[e.perTest,e.sentence])),s=new Map;for(let t of e.clusters)for(let e of t.members)s.has(e.testIndex)||s.set(e.testIndex,t.members.filter(t=>t.testIndex!==e.testIndex).map(e=>({testIndex:e.testIndex,testId:e.testId})));for(let t of e.verdicts){let e=(t.evidence?.citedArtifacts??[]).map(e=>({id:e.id,sha:e.sha,incomplete:e.present===!1||e.evidenceIncomplete===!0})),c=e.filter(e=>e.incomplete).length,l=c===0?void 0:{missing:c,total:e.length},u=s.get(t.perTest)??[];r.set(t.perTest,{...(()=>{let e=n?.members.find(e=>e.testIndex===t.perTest)?.marks;return e===void 0?{}:{marks:e}})(),testIndex:t.perTest,sentence:o.get(t.perTest)??``,producer:t.producer,confidence:t.confidence,provenance:ts(t.producer,t.confidence),marker:i,markerText:a,citedSteps:t.evidence?.citedSteps??[],citedArtifacts:e,siblings:u,siblingText:u.length===0?void 0:os(u.length),missingEvidence:l,missingEvidenceText:l===void 0?void 0:ds(l),...t.memoryOnPath===void 0?{}:{memoryOnPath:us(t.memoryOnPath)}})}return r}var ps=`rounded-[2px] border border-border/60 bg-background/60 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground`,ms=`inline-block max-w-full break-all rounded-[2px] border border-border/60 bg-background/60 px-1.5 py-0.5 font-mono text-xs text-muted-foreground`;function hs({view:e,onCitedStep:t,onSelectMember:n,onCitedArtifact:r}){return(0,Q.jsxs)(`div`,{"data-verdict-block":!0,"data-verdict-producer":e.producer,"data-verdict-confidence":String(e.confidence),tabIndex:-1,className:`mx-2 mt-1 mb-1.5 rounded-[2px] border border-border/60 bg-muted/10 px-3 py-2 text-xs focus:outline-none focus:ring-2 focus:ring-ring/50`,children:[(0,Q.jsx)(`span`,{"data-verdict-sentence":!0,className:`select-text text-foreground/80`,children:e.sentence}),(0,Q.jsxs)(`div`,{className:`mt-1 flex flex-wrap items-center gap-x-2 gap-y-1 text-[10px] text-muted-foreground`,children:[e.marker===void 0?null:(0,Q.jsx)(`span`,{"data-verdict-marker":e.marker,className:`whitespace-nowrap text-amber-500`,children:e.markerText}),(0,Q.jsx)(`span`,{"data-verdict-provenance":!0,className:`whitespace-nowrap`,children:e.provenance})]}),e.citedSteps.length===0?null:(0,Q.jsx)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-1`,children:e.citedSteps.map(n=>(0,Q.jsx)(`button`,{type:`button`,"data-cited-step":String(n),onClick:()=>{t(e.testIndex,n)},className:ps,children:is(n)},n))}),e.citedArtifacts.length===0?null:(0,Q.jsx)(`div`,{className:`mt-1.5 flex flex-wrap items-center gap-1`,children:e.citedArtifacts.map(e=>e.incomplete?(0,Q.jsx)(`span`,{"data-cited-artifact-state":`unavailable`,"data-cited-artifact-sha":e.sha,className:`inline-flex items-center`,children:(0,Q.jsx)(Xo,{variant:`inline`})},e.id):(0,Q.jsx)(`button`,{type:`button`,"data-cited-artifact":e.sha,onClick:()=>{r(e.sha)},className:ps,children:as},e.id))}),e.missingEvidence===void 0?null:(0,Q.jsx)(`div`,{"data-evidence-incomplete":`${String(e.missingEvidence.missing)}/${String(e.missingEvidence.total)}`,className:`mt-1.5 text-[10px] text-muted-foreground`,children:e.missingEvidenceText}),e.memoryOnPath===void 0?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`mt-1.5 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground`,children:(0,Q.jsx)(`span`,{"data-misdirection-on-path":!0,className:`min-w-0`,children:e.memoryOnPath.onPathText})}),e.memoryOnPath.onPath.length===0?null:(0,Q.jsx)(`dl`,{className:`mt-2 space-y-2 text-xs text-muted-foreground`,children:(0,Q.jsxs)(`div`,{"data-misdirection-exposed":String(e.memoryOnPath.onPath.length),children:[(0,Q.jsx)(`dt`,{className:`mb-1`,children:cs}),(0,Q.jsx)(`dd`,{children:(0,Q.jsx)(`ul`,{className:`flex flex-wrap items-start gap-1`,children:e.memoryOnPath.onPath.map(e=>(0,Q.jsx)(`li`,{className:`min-w-0 max-w-full`,children:(0,Q.jsx)(`span`,{"data-misdirection-on-path-record":e.recordId,"data-misdirection-trust":e.trust,className:ms,children:e.recordId})},e.recordId))})})]})})]}),e.siblings.length===0?null:(0,Q.jsxs)(`div`,{"data-cluster-siblings":String(e.siblings.length),className:`mt-1.5 flex flex-wrap items-center gap-1 text-[10px] text-muted-foreground`,children:[(0,Q.jsx)(`span`,{className:`whitespace-nowrap`,children:e.siblingText}),e.siblings.map(e=>(0,Q.jsx)(`button`,{type:`button`,"data-cluster-sibling":String(e.testIndex),onClick:()=>{n(e.testIndex)},className:ps,children:w(e.testIndex)},e.testIndex))]})]})}var gs=()=>{};function _s({group:e}){let t=B(e.member,e),{failureSummary:n}=e.member;return(0,Q.jsxs)(`div`,{className:`mx-2 mb-1.5 rounded-[2px] border border-border/60 bg-muted/10 px-3 py-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(`span`,{"data-member-note":!0,children:t}),n?(0,Q.jsx)(`span`,{"data-member-failure-summary":!0,className:`ml-2 select-text text-foreground/70`,children:n}):null]})}function vs({group:e,showChrome:t,verdict:n,onCitedStep:r=gs,onSelectMember:i=gs,onCitedArtifact:a=gs,children:o}){let[s,c]=(0,Z.useState)(!0),{member:l}=e,u=e.steps.length===0,d=m(l.attempts),f=l.outcome===void 0?void 0:Re(l.outcome),p=l.marks?.find(e=>e.stepIndex===void 0),h=u?(0,Q.jsx)(_s,{group:e}):(0,Q.jsx)(`ul`,{role:`group`,children:o}),g=n===void 0?null:(0,Q.jsx)(hs,{view:n,onCitedStep:r,onSelectMember:i,onCitedArtifact:a});return t?(0,Q.jsxs)(`li`,{role:`none`,"data-member":String(l.testIndex),children:[(0,Q.jsxs)(`div`,{className:`mt-3 mb-1 flex items-center gap-2 bg-muted/30 px-3 py-1.5 text-xs font-medium text-muted-foreground first:mt-0`,children:[(0,Q.jsx)(`button`,{type:`button`,"data-member-toggle":!0,...n===void 0?{}:{"data-member-has-verdict":``},"aria-expanded":s,"aria-label":ie(l),onClick:()=>c(e=>!e),className:`shrink-0 rounded-sm p-0.5 transition-colors hover:bg-muted/60`,children:(0,Q.jsx)(K,{className:X(`h-3 w-3 transition-transform`,s&&`rotate-90`)})}),(0,Q.jsx)(`span`,{className:`min-w-0 truncate`,children:ie(l)}),(0,Q.jsx)(`span`,{"data-member-handle":!0,className:`shrink-0 font-mono text-[10px] text-muted-foreground/70`,children:w(l.testIndex)}),p===void 0?null:(0,Q.jsx)(oo,{scope:`test`,target:ni({testIndex:l.testIndex}),kind:p.kind}),d?(0,Q.jsx)(`span`,{"data-member-rerun":!0,className:`shrink-0 text-[10px] text-amber-500`,children:d}):null,f===void 0?null:(0,Q.jsx)(Bt,{"data-member-outcome":l.outcome,variant:f.variant,className:X(`ml-auto shrink-0 text-[10px] uppercase tracking-wide`,f.className),children:f.label})]}),s?g:null,s?h:null]}):u?(0,Q.jsxs)(`li`,{role:`none`,children:[g,h]}):(0,Q.jsxs)(Q.Fragment,{children:[g===null?null:(0,Q.jsx)(`li`,{role:`none`,children:g}),o]})}function ys({sub:e,wrap:t=`free`,ordinal:n,wrapIcon:o}){let s=a(e),c=(0,Q.jsx)(s.family?r[s.family]:u,{"aria-hidden":`true`,className:X(`h-3.5 w-3.5 shrink-0 text-muted-foreground`,s.outcome===`failed`&&`text-red-500`)});return(0,Q.jsxs)(`span`,{"data-action-family":s.family??`unknown`,"data-action-outcome":s.outcome,className:`flex min-w-0 flex-1 items-center gap-2 text-xs text-muted-foreground`,children:[o?o(c):c,n!==void 0&&(0,Q.jsxs)(`span`,{className:`shrink-0`,children:[`#`,n]}),(0,Q.jsx)(`span`,{className:X(`min-w-0`,t===`free`?`break-words`:t),children:i(s)})]})}function bs({children:e,marker:t,state:n,tone:r,label:i}){let a=r===`primary`?`text-primary`:`text-amber-500`;return(0,Q.jsxs)(ze,{children:[(0,Q.jsx)(Y,{asChild:!0,children:(0,Q.jsxs)(`span`,{className:`relative inline-flex shrink-0 cursor-default`,children:[e,(0,Q.jsx)(`span`,{"data-cache-marker":t,"data-cache-state":n,"aria-label":i,className:X(`absolute -bottom-px -right-px inline-flex size-2 items-center justify-center rounded-full border border-background/90 bg-background/70 shadow-[0_0_0_1px_color-mix(in_srgb,var(--border)_70%,transparent)]`,a),children:(0,Q.jsx)(Te,{className:X(`size-1.5 fill-current stroke-[2.5]`,a)})})]})}),(0,Q.jsx)(Le,{children:i})]})}function xs(e){return It(e.result)?`no-input`:e.result.success?`success`:`failure`}function Ss({sub:e,stepId:t,cached:n,isSelected:r,isPlayheadRow:i=!1,onSelect:a}){let o=xs(e);return(0,Q.jsx)(`li`,{role:`treeitem`,"aria-level":2,"aria-selected":r,"aria-current":i?!0:void 0,"data-playhead-row":i?``:void 0,"data-sub-action":String(e.subActionIndex),"data-sub-action-result":o,"data-sub-action-id":`${t}-${String(e.subActionIndex)}`,children:(0,Q.jsx)(`button`,{className:X(`relative flex w-full items-center gap-2 py-1.5 px-3 text-left rounded-[2px] text-sm`,`hover:bg-muted/50 transition-colors`,(r||i)&&`rounded-md bg-primary/10 ring-1 ring-inset ring-primary/60`),onClick:a,children:(0,Q.jsx)(ys,{sub:e,wrap:`truncate`,wrapIcon:n?e=>(0,Q.jsx)(bs,{marker:`sub-action-status`,state:`cached`,tone:`primary`,label:`Cached action`,children:e}):void 0})})})}function Cs({log:e,isSelected:t,onSelect:n}){let r=e.type===`runjs`?ir:Ze,i=(0,Q.jsx)(`span`,{className:X(`h-1.5 w-1.5 rounded-full shrink-0`,e.status===`passed`?`bg-emerald-500`:`bg-red-500`)});return(0,Q.jsx)(`li`,{role:`treeitem`,"aria-level":2,"aria-selected":t,"data-execution-id":e.id,children:(0,Q.jsxs)(`button`,{className:X(`flex w-full items-center gap-2 py-1.5 px-3 text-left rounded-[2px] text-sm`,`hover:bg-muted/50 transition-colors`,t&&`bg-primary/10 ring-1 ring-primary/30`),onClick:n,children:[(0,Q.jsx)(`span`,{className:`inline-flex h-4 w-4 shrink-0 items-center justify-center`,children:i}),(0,Q.jsx)(r,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),e.phase===`inline`&&(0,Q.jsx)(`span`,{className:`text-[9px] px-1 py-0 rounded bg-amber-500/15 text-amber-400 border border-amber-500/20 font-medium shrink-0`,children:`pre`}),(0,Q.jsx)(`span`,{className:`flex-1 min-w-0 text-xs break-all text-muted-foreground`,children:e.name}),(0,Q.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:Ke(e.duration)})]})})}function ws({status:e}){switch(e){case`passed`:return(0,Q.jsx)(lt,{className:`h-4 w-4 text-emerald-500 shrink-0 mt-0.5`});case`failed`:return(0,Q.jsx)(ye,{className:`h-4 w-4 text-red-500 shrink-0 mt-0.5`});case`healed`:case`flaky`:return(0,Q.jsx)(we,{className:`h-4 w-4 text-amber-500 shrink-0 mt-0.5`});default:return(0,Q.jsx)(be,{className:`h-4 w-4 text-muted-foreground shrink-0 mt-0.5`})}}function Ts({step:e,isSelected:t,isExpanded:n,selection:r,playhead:i,onSelect:a,inlineLogs:o=[],embedded:s=!1,marks:c,onOpenFeedback:u,feedbackExpanded:d=!1,composerId:f=``}){let p=c?.find(t=>t.stepIndex===e.stepIndex),m=e.testIndex===void 0||e.stepIndex===void 0?void 0:ni({testIndex:e.testIndex,stepIndex:e.stepIndex}),h=t&&u!==void 0&&c!==void 0&&m!==void 0,g=(e.stepIndex??0)+1,_=e.subActions??[],v=_.length>0,y=e.cacheStatus===`hit`,b=v||o.length>0,x=(0,Q.jsx)(ws,{status:e.selfHealOccurred?`healed`:e.status}),S=y?(0,Q.jsx)(bs,{marker:`step-status`,state:`all`,tone:`primary`,label:`All actions cached`,children:x}):x;return(0,Q.jsxs)(`li`,{role:`treeitem`,"aria-expanded":b?n:void 0,"aria-selected":t&&r?.type===`step`,"aria-level":1,"data-step-id":e.id,className:X(`relative`,h&&`@container/row`,!s&&`mx-2 mb-1.5 rounded-[2px]`,b&&n&&!s&&`border border-border/70 bg-muted/15`),children:[(0,Q.jsxs)(`button`,{className:X(`flex w-full items-start gap-2 py-2 px-3 text-left rounded-[2px]`,`hover:bg-muted/50 transition-colors`,t&&`rounded-md ring-1 ring-inset ring-border`,t&&r?.type===`step`&&`bg-muted/30`,h&&`pr-9 @max-[14rem]/row:flex-wrap`),onClick:()=>a({type:`step`,stepId:e.id}),children:[S,(0,Q.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[e.displayStepTotal?(0,Q.jsxs)(`div`,{className:`text-[10px] font-medium uppercase tracking-wide text-muted-foreground/70`,children:[`Step `,e.displayStepOrder,` of `,e.displayStepTotal]}):null,(0,Q.jsx)(l,{step:e})]}),p!==void 0&&m!==void 0&&!h?(0,Q.jsx)(oo,{scope:`step`,target:m,kind:p.kind}):null,(0,Q.jsx)(`span`,{className:X(`text-xs text-muted-foreground shrink-0 pt-0.5`,h&&`@max-[14rem]/row:basis-full @max-[14rem]/row:pl-6`),children:Ke(e.duration)})]}),h?(0,Q.jsx)(`span`,{className:`absolute right-1 top-1`,children:(0,Q.jsx)(ao,{scope:`step`,label:na({scope:`step`,stepNumber:g,markedChoice:p?.kind}),tooltip:ra(g,p!==void 0),target:m,marked:p!==void 0,expanded:d,controls:f,onOpen:u})}):null,n&&b&&(0,Q.jsxs)(`ul`,{role:`group`,children:[o.map(t=>(0,Q.jsx)(Cs,{log:t,isSelected:r?.type===`execution`&&r.logId===t.id,onSelect:()=>a({type:`execution`,stepId:e.id,logId:t.id})},t.id)),_.map(t=>(0,Q.jsx)(Ss,{sub:t,stepId:e.id,cached:y,isPlayheadRow:i?.testIndex===t.testIndex&&i.stepIndex===t.stepIndex&&i.subActionIndex===t.subActionIndex,isSelected:r?.type===`subaction`&&r.stepId===e.id&&r.subIndex===t.subActionIndex,onSelect:()=>a({type:`subaction`,stepId:e.id,subIndex:t.subActionIndex})},t.subActionIndex))]})]})}function Es({log:e,isSelected:t,onSelect:n}){return(0,Q.jsx)(`li`,{role:`treeitem`,"aria-level":1,"aria-selected":t,children:(0,Q.jsxs)(`button`,{className:X(`flex w-full items-center gap-2 py-1.5 px-3 text-left rounded-[2px] text-sm`,`hover:bg-muted/50 transition-colors`,t&&`bg-primary/10 ring-1 ring-primary/30`),onClick:n,children:[e.status===`passed`?(0,Q.jsx)(lt,{className:`h-3 w-3 text-emerald-500 shrink-0`}):e.status===`running`?(0,Q.jsx)(be,{className:`h-3 w-3 text-blue-500 shrink-0`}):(0,Q.jsx)(ye,{className:`h-3 w-3 text-red-500 shrink-0`}),(0,Q.jsx)(Ze,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,Q.jsx)(`span`,{className:`flex-1 min-w-0 text-xs truncate`,children:e.name}),(0,Q.jsx)(`span`,{className:`text-[10px] text-muted-foreground shrink-0`,children:Ke(e.duration)})]})})}function Ds({title:e}){return(0,Q.jsx)(`div`,{className:`px-3 py-1.5 text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/60`,children:e})}function Os({title:e,hooks:t,selection:n,onSelect:r}){return t.length===0?null:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Ds,{title:e}),(0,Q.jsx)(`div`,{className:`mx-2 mb-1.5 rounded-[2px] border border-border/70 bg-muted/15`,children:(0,Q.jsx)(`ul`,{role:`group`,children:t.map(e=>(0,Q.jsx)(Es,{log:e,isSelected:n?.type===`hook`&&n.hookId===e.id,onSelect:()=>r({type:`hook`,hookId:e.id})},e.id))})})]})}function ks({groups:e,showMemberChrome:t=!1,analysisView:n,onCitedStep:r,onSelectMember:i,onCitedArtifact:a,selection:o,playhead:s,onSelect:c,setupHooks:l=[],teardownHooks:u=[],inlineLogs:d=[],feedback:f}){let p=(0,Z.useMemo)(()=>{let t=Yn(e),n=0;return e.map(e=>{let r=t.slice(n,n+e.steps.length);return n+=e.steps.length,{group:e,steps:r}})},[e]),m=(0,Z.useMemo)(()=>{let t=new Map;if(e.length!==1)return t;let[n]=p;if(!n)return t;for(let e of d){if(!e.stepId)continue;let r=Number(e.stepId),i=n.steps.find(e=>e.rawStepOrder===r)?.id??e.stepId,a=t.get(i)??[];a.push(e),t.set(i,a)}return t},[d,p,e.length]),h=p.some(e=>e.steps.length>0);return e.length===0&&!h?l.length>0||u.length>0?(0,Q.jsx)(Vt,{className:`flex-1`,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Os,{title:`Setup`,hooks:l,selection:o,onSelect:c}),(0,Q.jsx)(Os,{title:`Teardown`,hooks:u,selection:o,onSelect:c})]})}):(0,Q.jsx)(`div`,{className:`flex-1 flex items-center justify-center text-muted-foreground text-sm`,children:`No steps were executed.`}):(0,Q.jsx)(Vt,{className:`flex-1`,children:(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(Os,{title:`Setup`,hooks:l,selection:o,onSelect:c}),(0,Q.jsx)(Ds,{title:`Steps`}),(0,Q.jsx)(`ul`,{role:`tree`,"aria-label":`Test steps`,className:`py-1`,children:p.map(({group:e,steps:l})=>(0,Q.jsx)(vs,{group:e,showChrome:t,verdict:n?.get(e.member.testIndex),onCitedStep:r,onSelectMember:i,onCitedArtifact:a,children:l.map(t=>{let{testIndex:n,stepIndex:r}=t,i=f!==void 0&&n!==void 0&&r!==void 0;return(0,Q.jsx)(Ts,{step:t,onOpenFeedback:i?e=>f.onOpenStep(n,r,e):void 0,feedbackExpanded:i&&f.expandedAddress===ni({testIndex:n,stepIndex:r}),composerId:f?.composerId,marks:e.member.marks,isSelected:Jn(o)&&o.stepId===t.id,isExpanded:!0,selection:o,playhead:s,onSelect:c,inlineLogs:m.get(t.id)??[]},t.id)})},e.member.testIndex))}),(0,Q.jsx)(Os,{title:`Teardown`,hooks:u,selection:o,onSelect:c})]})})}function As(e,t){let n=e.split(/\s+/u).filter(e=>e!==``);return n.length<=t?{text:e,isTruncated:!1}:{text:`${n.slice(0,t).join(` `)}...`,isTruncated:!0}}var js={idle:``,copied:`Failure summary copied to the clipboard`,failed:`Could not copy the failure summary to the clipboard`};function Ms({summary:e}){let[t,n]=(0,Z.useState)(!1),[r,i]=(0,Z.useState)(`idle`),a=As(e,20),o=t||!a.isTruncated,s=e=>{i(e),setTimeout(()=>i(`idle`),2e3)};return(0,Q.jsx)(`div`,{"data-failure-banner":!0,"data-failure-banner-state":o?`full`:`truncated`,className:`mx-2 mt-2 rounded-[2px] border border-red-500/20 bg-red-500/5 px-3 py-2 shrink-0`,children:(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(de,{className:`h-4 w-4 text-red-400 shrink-0 mt-0.5`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{"data-failure-banner-text":!0,className:`flex-1 text-sm text-foreground/80 select-text`,children:t?e:a.text}),(0,Q.jsx)(`button`,{"data-failure-banner-copy":!0,"data-copy-status":r,onClick:()=>{let n=navigator.clipboard?.writeText(t?e:a.text);if(n===void 0){s(`failed`);return}n.then(()=>{s(`copied`)},()=>{s(`failed`)})},className:`shrink-0 mt-0.5 p-0.5 rounded-sm hover:bg-red-500/10 transition-colors`,"aria-label":`Copy failure summary`,title:`Copy failure summary`,children:r===`copied`?(0,Q.jsx)(V,{className:`h-3.5 w-3.5 text-emerald-400`,"aria-hidden":`true`}):(0,Q.jsx)(ue,{className:X(`h-3.5 w-3.5`,r===`failed`?`text-red-400`:`text-muted-foreground`),"aria-hidden":`true`})}),(0,Q.jsx)(`span`,{"data-failure-banner-copy-status":!0,role:`status`,"aria-live":`polite`,className:`sr-only`,children:js[r]}),a.isTruncated&&(0,Q.jsx)(`button`,{"data-failure-banner-toggle":!0,"aria-label":t?`Show less`:`Show full failure summary`,onClick:()=>n(e=>!e),className:`shrink-0 mt-0.5 p-0.5 rounded-sm hover:bg-red-500/10 transition-colors`,children:(0,Q.jsx)(K,{"aria-hidden":`true`,className:X(`h-3.5 w-3.5 text-muted-foreground transition-transform`,t&&`rotate-90`)})})]})})}var Ns=e(vt(),1);function Ps({annotation:e,refLabel:t,renderedW:n,renderedH:r,offsetX:i=0,offsetY:a=0}){let o=(0,Z.useId)(),s=n/(e.viewport?.width||1),c=r/(e.viewport?.height||1);return(0,Q.jsxs)(Q.Fragment,{children:[e.failureHighlight&&(0,Q.jsx)(`div`,{"data-annotation":`failure`,className:`absolute border-2 border-red-500/70 rounded-sm bg-red-500/15 animate-pulse pointer-events-none`,style:{left:i+e.failureHighlight.x*s,top:a+e.failureHighlight.y*c,width:e.failureHighlight.width*s,height:e.failureHighlight.height*c}}),e.boundingBox&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{"data-annotation":`region`,className:`absolute border-2 border-emerald-500/70 rounded-sm bg-emerald-500/10 pointer-events-none`,style:{left:i+e.boundingBox.x*s,top:a+e.boundingBox.y*c,width:e.boundingBox.width*s,height:e.boundingBox.height*c}}),t&&(0,Q.jsx)(`div`,{className:`absolute text-[10px] font-mono font-bold text-white bg-emerald-600/90 px-1 rounded-sm pointer-events-none leading-tight`,style:{left:i+e.boundingBox.x*s,top:a+e.boundingBox.y*c-14},children:t})]}),e.clickPoint&&(0,Q.jsx)(`div`,{"data-annotation":`point`,className:`absolute pointer-events-none`,style:{left:i+e.clickPoint.x*s,top:a+e.clickPoint.y*c,transform:`translate(-50%, -50%)`,zIndex:1},children:(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-full bg-turquoise-500 border-[1.5px] border-black/60 shadow-[0_0_0_1px_rgba(255,255,255,0.4)]`}),(0,Q.jsx)(`div`,{className:`absolute rounded-full border-2 border-turquoise-500/50 animate-ping`,style:{width:22,height:22,left:-8.5,top:-8.5}})]})}),e.startPoint&&e.endPoint&&(()=>{let t=e.type===`drag`?`oklch(0.65 0.19 150)`:`oklch(0.65 0.19 210)`,n=e.type===`drag`?`oklch(0.65 0.19 150 / 0.4)`:`oklch(0.65 0.19 210 / 0.4)`,r=i+e.startPoint.x*s,o=a+e.startPoint.y*c,l=i+e.endPoint.x*s,u=a+e.endPoint.y*c;return(0,Q.jsxs)(Q.Fragment,{children:[Array.from({length:4},(e,t)=>{let i=(t+1)/5;return(0,Q.jsx)(`div`,{className:`absolute pointer-events-none animate-gesture-trail`,style:{left:r+(l-r)*i,top:o+(u-o)*i,transform:`translate(-50%, -50%)`,zIndex:1,animationDelay:`${t*.15}s`},children:(0,Q.jsx)(`div`,{className:`w-1.5 h-1.5 rounded-full`,style:{backgroundColor:n}})},`trail-${t}`)}),(0,Q.jsx)(`div`,{className:`absolute pointer-events-none`,style:{left:r,top:o,transform:`translate(-50%, -50%)`,zIndex:1},children:(0,Q.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-full border-[1.5px] border-black/50 shadow-[0_0_0_1px_rgba(255,255,255,0.3)]`,style:{backgroundColor:t}})}),(0,Q.jsx)(`div`,{className:`absolute pointer-events-none`,style:{left:l,top:u,transform:`translate(-50%, -50%)`,zIndex:1},children:(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(`div`,{className:`w-2 h-2 rounded-full border-[1.5px] border-black/50 shadow-[0_0_0_1px_rgba(255,255,255,0.3)]`,style:{backgroundColor:t}}),(0,Q.jsx)(`div`,{className:`absolute rounded-full border-[1.5px] animate-ping`,style:{borderColor:n,width:18,height:18,left:-7,top:-7}})]})})]})})(),e.direction&&!e.startPoint&&(()=>{let t=e.clickPoint?i+e.clickPoint.x*s:i+n/2,l=e.clickPoint?a+e.clickPoint.y*c:a+r/2,u=Math.min(r,n)*.35,[d,f]={up:[0,-u],down:[0,u],left:[-u,0],right:[u,0]}[e.direction]||[0,0];return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`svg`,{className:`absolute pointer-events-none`,style:{left:i,top:a,zIndex:1},width:n,height:r,children:[(0,Q.jsxs)(`defs`,{children:[(0,Q.jsx)(`marker`,{id:`scroll-arrow-border-${o}`,markerWidth:`16`,markerHeight:`14`,refX:`14`,refY:`7`,orient:`auto`,markerUnits:`userSpaceOnUse`,children:(0,Q.jsx)(`path`,{d:`M1 1 L14 7 L1 13`,fill:`none`,stroke:`oklch(0 0 0 / 0.5)`,strokeWidth:`3`,strokeLinejoin:`round`,strokeLinecap:`round`})}),(0,Q.jsx)(`marker`,{id:`scroll-arrow-${o}`,markerWidth:`16`,markerHeight:`14`,refX:`14`,refY:`7`,orient:`auto`,markerUnits:`userSpaceOnUse`,children:(0,Q.jsx)(`path`,{d:`M1 1 L14 7 L1 13`,fill:`none`,stroke:`oklch(0.719 0.119 209.8)`,strokeWidth:`2`,strokeLinejoin:`round`,strokeLinecap:`round`})})]}),(0,Q.jsx)(`line`,{x1:t-i,y1:l-a,x2:t-i+d,y2:l-a+f,stroke:`oklch(0 0 0 / 0.5)`,strokeWidth:4,strokeLinecap:`round`,markerEnd:`url(#scroll-arrow-border-${o})`}),(0,Q.jsx)(`line`,{x1:t-i,y1:l-a,x2:t-i+d,y2:l-a+f,stroke:`oklch(0.719 0.119 209.8 / 0.8)`,strokeWidth:2.5,strokeLinecap:`round`,markerEnd:`url(#scroll-arrow-${o})`})]}),(0,Q.jsx)(`div`,{className:`absolute pointer-events-none`,style:{left:t,top:l,transform:`translate(-50%, -50%)`,zIndex:2},children:(0,Q.jsxs)(`div`,{className:`relative flex items-center justify-center`,style:{width:22,height:22},children:[(0,Q.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-full bg-turquoise-500 border-[1.5px] border-black/60 shadow-[0_0_0_1px_rgba(255,255,255,0.4)]`}),(0,Q.jsx)(`div`,{className:`absolute inset-0 rounded-full border-2 border-turquoise-500/50 animate-ping`})]})})]})})(),e.pinchScale&&(()=>{let t=e.startPoint?i+e.startPoint.x*s:i+n/2,o=e.startPoint?a+e.startPoint.y*c:a+r/2,l=e.pinchScale===`out`?`animate-gesture-pinch-out`:`animate-gesture-pinch-in`;return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{className:`absolute pointer-events-none ${l}`,style:{left:t-24,top:o,transform:`translate(-50%, -50%)`,zIndex:1},children:(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-full bg-turquoise-500 border-[1.5px] border-black/50 shadow-[0_0_0_1px_rgba(255,255,255,0.3)]`}),(0,Q.jsx)(`div`,{className:`absolute rounded-full border-[1.5px] border-turquoise-500/40 animate-ping`,style:{width:18,height:18,left:-6.5,top:-6.5}})]})}),(0,Q.jsx)(`div`,{className:`absolute pointer-events-none ${l}`,style:{left:t+24,top:o,transform:`translate(-50%, -50%)`,zIndex:1,animationDirection:`reverse`},children:(0,Q.jsxs)(`div`,{className:`relative`,children:[(0,Q.jsx)(`div`,{className:`w-2.5 h-2.5 rounded-full bg-turquoise-500 border-[1.5px] border-black/50 shadow-[0_0_0_1px_rgba(255,255,255,0.3)]`}),(0,Q.jsx)(`div`,{className:`absolute rounded-full border-[1.5px] border-turquoise-500/40 animate-ping`,style:{width:18,height:18,left:-6.5,top:-6.5}})]})})]})})()]})}function Fs({children:e,width:t,height:n,annotation:r,annotationLabel:i,magnifier:a=!1,fullscreen:o=!1,mediaKey:s}){let c=(0,Z.useRef)(null),l=(0,Z.useRef)(null),u=(0,Z.useRef)(!1),[d,f]=(0,Z.useState)({width:0,height:0}),[p,m]=(0,Z.useState)(null),[h,g]=(0,Z.useState)(!1);(0,Z.useEffect)(()=>{let e=c.current;if(!e)return;let t=new ResizeObserver(e=>{let t=e[0]?.contentRect;t&&f({width:t.width,height:t.height})});return t.observe(e),()=>t.disconnect()},[]);let _=t>0&&n>0?Math.min(d.width/t,d.height/n):0,v=t*_,y=n*_,b=(d.width-v)/2,x=(d.height-y)/2,S=Math.min(150,d.width,d.height),C=2.5,w=p?Math.max(0,Math.min(d.width-S,p.x+20+S>d.width?p.x-S-10:p.x+20)):0,T=p?Math.max(0,Math.min(d.height-S,p.y+20+S>d.height?p.y-S-10:p.y+20)):0,ee=p?S/2-(p.x-b)*C:0,E=p?S/2-(p.y-x)*C:0;return(0,Z.useEffect)(()=>{m(null)},[a,o,s,t,n,d.width,d.height]),(0,Z.useEffect)(()=>{u.current=!1},[s]),(0,Z.useEffect)(()=>{if(g(!1),!a||!p||S<=0)return;let e=c.current?.querySelector(`video, img`),t=l.current;if(!(e instanceof HTMLVideoElement||e instanceof HTMLImageElement)||!t)return;let n=t.getContext(`2d`);if(!n)return;let r,i=!1,o=()=>{r!==void 0&&cancelAnimationFrame(r),r=void 0},s=()=>{if(r=void 0,!i){try{n.clearRect(0,0,S,S),n.drawImage(e,ee,E,v*C,y*C),g(!0)}catch{g(!1)}e instanceof HTMLVideoElement&&!e.paused&&!e.ended&&(r=requestAnimationFrame(s))}},d=()=>{o(),s()},f=()=>{u.current=!0,o(),m(null)};for(let t of[`loadeddata`,`seeked`,`play`,`pause`])e.addEventListener(t,d);return e.addEventListener(`error`,f),s(),()=>{i=!0,o();for(let t of[`loadeddata`,`seeked`,`play`,`pause`])e.removeEventListener(t,d);e.removeEventListener(`error`,f)}},[a,p,S,ee,E,v,y,s]),(0,Q.jsxs)(`div`,{ref:c,"data-media-viewport":!0,className:`relative w-full overflow-hidden rounded-lg border bg-muted/20`,onPointerMove:e=>{if(!a||u.current||e.pointerType===`touch`||_<=0)return;let t=e.currentTarget.getBoundingClientRect(),n=e.clientX-t.left-e.currentTarget.clientLeft,r=e.clientY-t.top-e.currentTarget.clientTop;m(n>=b&&n<=b+v&&r>=x&&r<=x+y?{x:n,y:r}:null)},onPointerLeave:()=>m(null),style:{height:o?`72vh`:`50vh`},children:[(0,Q.jsxs)(`div`,{"data-media-transform":!0,style:{position:`absolute`,width:v,height:y,left:b,top:x},children:[e,r&&_>0&&(0,Q.jsx)(Ps,{annotation:r,renderedW:v,renderedH:y})]}),a&&p&&(0,Q.jsxs)(`div`,{"data-media-lens":!0,"aria-hidden":`true`,className:`pointer-events-none absolute z-10 overflow-hidden rounded-full border-2 border-muted-foreground/50 bg-background shadow-lg`,style:{width:S,height:S,left:w,top:T,visibility:h?`visible`:`hidden`},children:[(0,Q.jsx)(`canvas`,{ref:l,width:S,height:S,className:`absolute inset-0`}),r&&(0,Q.jsx)(`div`,{"data-lens-annotation":!0,style:{position:`absolute`,left:ee,top:E,width:v,height:y,transform:`scale(${C})`,transformOrigin:`top left`},children:(0,Q.jsx)(Ps,{annotation:r,renderedW:v,renderedH:y})})]}),i&&(0,Q.jsx)(`span`,{"data-video-action-cue":!0,className:`absolute bottom-1 left-1 rounded bg-background/90 px-2 py-1 text-xs`,children:i})]})}function Is({src:e,annotation:t,refLabel:n,className:r,onUnavailable:i,embedded:a}){let o=(0,Z.useRef)(null),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)({width:0,height:0}),[p,m]=(0,Z.useState)({width:0,height:0}),[h,g]=(0,Z.useState)(!1),[_,v]=(0,Z.useState)({x:0,y:0}),[y,b]=(0,Z.useState)(!1),[x,S]=(0,Z.useState)(!1),[C,w]=(0,Z.useState)(!0);(0,Z.useEffect)(()=>{c(!1),u(!1)},[e]),(0,Z.useEffect)(()=>{let e=o.current;if(!e)return;let t=new ResizeObserver(e=>{for(let t of e)f({width:t.contentRect.width,height:t.contentRect.height})});return t.observe(e),()=>t.disconnect()},[]),(0,Z.useEffect)(()=>{if(!x)return;let e=e=>{e.key===`Escape`&&S(!1)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[x]);let T=(0,Z.useCallback)(e=>{let t=e.currentTarget;m({width:t.naturalWidth,height:t.naturalHeight}),c(!0),a?.onAvailability?.(!0)},[a?.onAvailability]),ee=(0,Z.useCallback)(e=>{let t=e.currentTarget.getBoundingClientRect();v({x:e.clientX-t.left,y:e.clientY-t.top})},[]),E=d.width,D=d.height,O=p.width/(p.height||1),k=E/(D||1),A=E,j=D,M=0,N=0;s&&p.width>0&&(O>k?(A=E,j=E/O,N=(D-j)/2):(j=D,A=D*O,M=(E-A)/2));let te=2.5,P=A*te,F=j*te,I=-((_.x-M)*te-150/2),L=-((_.y-N)*te-150/2),ne=_.x+20,R=_.y+20;ne+150>E&&(ne=_.x-150-10),R+150>D&&(R=_.y-150-10),ne<0&&(ne=0),R<0&&(R=0);let re=y&&h&&s;if(l)return(0,Q.jsx)(`div`,{className:X(`relative rounded-lg border bg-muted/20 flex items-center justify-center`,r),style:{aspectRatio:`16 / 9`,maxHeight:`50vh`},children:(0,Q.jsxs)(`div`,{className:`text-muted-foreground flex flex-col items-center gap-2`,children:[(0,Q.jsx)(tr,{className:`h-8 w-8`}),(0,Q.jsx)(`span`,{className:`text-sm`,children:`Screenshot unavailable`})]})});let z=!!(t?.clickPoint||t?.boundingBox||t?.failureHighlight||t?.startPoint||t?.endPoint||t?.direction||t?.pinchScale),B=s&&t&&C&&(0,Q.jsx)(Ps,{annotation:t,refLabel:n,renderedW:A,renderedH:j,offsetX:M,offsetY:N});return a?(0,Q.jsx)(Fs,{width:p.width,height:p.height,magnifier:a.magnifier,fullscreen:a.fullscreen,mediaKey:e,annotation:s&&a.annotationsVisible?t??void 0:void 0,children:(0,Q.jsx)(`img`,{src:e,alt:`Step screenshot`,className:`h-full w-full object-contain`,onLoad:T,onError:()=>{u(!0),a.onAvailability?.(!1),i?.()}})}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{ref:o,className:X(`relative overflow-hidden rounded-lg border bg-muted/20 group w-full`,r),style:{aspectRatio:s&&p.width>0?`${p.width} / ${p.height}`:`16 / 9`,maxHeight:`50vh`},onMouseMove:y?ee:void 0,onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),children:[!s&&(0,Q.jsx)(W,{className:`absolute inset-0 rounded-lg`}),(0,Q.jsx)(`img`,{src:e,alt:`Step screenshot`,className:X(`w-full h-full object-contain`,!s&&`opacity-0`),onLoad:T,onError:()=>{u(!0),i?.()}}),B,re&&(0,Q.jsx)(`div`,{className:`absolute rounded-full border-2 border-primary/50 shadow-lg pointer-events-none z-10`,style:{width:150,height:150,left:ne,top:R,backgroundImage:`url(${e})`,backgroundSize:`${P}px ${F}px`,backgroundPosition:`${I}px ${L}px`,backgroundRepeat:`no-repeat`}}),s&&(0,Q.jsxs)(`div`,{className:`absolute top-2 right-2 flex gap-1 opacity-0 group-hover:opacity-100 transition-opacity z-20`,children:[z&&(0,Q.jsx)(q,{variant:`secondary`,size:`icon-sm`,className:`h-7 w-7 bg-background/80 backdrop-blur-sm`,onClick:e=>{e.stopPropagation(),w(!C)},title:C?`Hide annotations`:`Show annotations`,children:(0,Q.jsx)(sr,{className:X(`h-3.5 w-3.5`,C&&`text-primary`)})}),(0,Q.jsx)(q,{variant:`secondary`,size:`icon-sm`,className:`h-7 w-7 bg-background/80 backdrop-blur-sm`,onClick:e=>{e.stopPropagation(),b(!y)},title:y?`Disable magnifier`:`Enable magnifier`,children:(0,Q.jsx)(We,{className:X(`h-3.5 w-3.5`,y&&`text-primary`)})}),(0,Q.jsx)(q,{variant:`secondary`,size:`icon-sm`,className:`h-7 w-7 bg-background/80 backdrop-blur-sm`,onClick:e=>{e.stopPropagation(),S(!0)},title:`View full size`,children:(0,Q.jsx)(mr,{className:`h-3.5 w-3.5`})})]})]}),x&&(0,Q.jsxs)(`div`,{className:`fixed inset-0 z-50 bg-black/80 backdrop-blur-sm flex items-center justify-center`,onClick:()=>S(!1),children:[(0,Q.jsx)(q,{variant:`secondary`,size:`icon-sm`,className:`absolute top-4 right-4 h-8 w-8 bg-background/80 backdrop-blur-sm z-10`,onClick:()=>S(!1),children:(0,Q.jsx)(Ct,{className:`h-4 w-4`})}),(0,Q.jsx)(`img`,{src:e,alt:`Step screenshot (full size)`,className:`object-contain rounded-lg`,style:{maxWidth:`90vw`,maxHeight:`90vh`},onClick:e=>e.stopPropagation()})]})]})}var Ls=Ye(`inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-transparent`,outline:`border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground`},size:{default:`h-9 min-w-9 px-2`,sm:`h-8 min-w-8 px-1.5`,lg:`h-10 min-w-10 px-2.5`}},defaultVariants:{variant:`default`,size:`default`}}),Rs=Z.createContext({size:`default`,variant:`default`,spacing:0});function zs({className:e,variant:t,size:n,spacing:r=0,children:i,...a}){return(0,Q.jsx)(Hr,{"data-slot":`toggle-group`,"data-variant":t,"data-size":n,"data-spacing":r,style:{"--gap":r},className:X(`group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs`,e),...a,children:(0,Q.jsx)(Rs.Provider,{value:{variant:t,size:n,spacing:r},children:i})})}function Bs({className:e,children:t,variant:n,size:r,...i}){let a=Z.useContext(Rs);return(0,Q.jsx)(Ur,{"data-slot":`toggle-group-item`,"data-variant":a.variant||n,"data-size":a.size||r,"data-spacing":a.spacing,className:X(Ls({variant:a.variant||n,size:a.size||r}),`w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10`,`data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l`,e),...i,children:t})}function Vs(e){let t=e?.result.annotation;if(!t||!e)return;let n={type:e.plannedAction.type,viewport:t.viewport,direction:t.direction,failureHighlight:t.failureHighlight};switch(t.kind){case`point`:return{...n,clickPoint:t.point,boundingBox:t.point.boundingBox};case`region`:return{...n,boundingBox:t.region.boundingBox};case`path`:return{...n,startPoint:t.path.start,endPoint:t.path.end};case`pinch`:return{...n,startPoint:t.pinch.center,pinchScale:t.pinch.scale>1?`out`:`in`}}}function Hs(e,t,n,r){let i=e.result.annotation,a=i?.recording;if(!(!i||!a||!ot(i)||!Number.isFinite(t)||n!==a.width||r!==a.height||t<a.startMs||t>=a.endMs))return Vs(e)}function Us(e){let t=e.result.annotation,n=t?.recording;return t&&n&&ot(t)&&n.endMs>n.startMs?(n.startMs+n.endMs)/2:e.recordingOffsetMs}function Ws(e,t,n,r){for(let[i,a]of e.entries()){let o=Hs(a,t,n,r);if(o)return{annotation:o,recent:!1};let s=a.result.annotation?.recording,c=e[i+1],l=c?.result.annotation?.recording;if(!s||c&&(!l||!ot(c.result.annotation)))continue;let u=Math.min(s.endMs+350,l?.startMs??1/0);if(t>=s.endMs&&t<u){let e=Hs(a,(s.startMs+s.endMs)/2,n,r);if(e)return{annotation:e,recent:!0}}}}function Gs(e){return e!==void 0&&e.evidenceIncomplete!==!0&&e.present!==!1}function Ks(e){for(let t=e.length-1;t>=0;t--){let n=e[t],r=D(n);if(Gs(r))return{index:n.subActionIndex,ref:r,...t===e.length-1?{}:{substitution:{shown:t+1,total:e.length}}}}}function qs(e){return{testIndex:e.step.testIndex,stepIndex:e.step.stepIndex,subActionIndex:Ks(e.subActions)?.index??e.subActions.at(-1)?.subActionIndex??null}}function Js(e){return Number.isSafeInteger(e)&&e>=0}function Ys(e){if(e?.type!==`step`&&e?.type!==`subaction`)return null;let t=Xn(e.stepId);return!t||e.type===`subaction`&&!Js(e.subIndex)?null:{...t,subActionIndex:e.type===`subaction`?e.subIndex:null}}function Xs(e){if(!e||!Js(e.testIndex)||!Js(e.stepIndex)||e.subActionIndex!==null&&!Js(e.subActionIndex))return null;let t=Zn(e.testIndex,e.stepIndex);return e.subActionIndex===null?{type:`step`,stepId:t}:{type:`subaction`,stepId:t,subIndex:e.subActionIndex}}function Zs(e){let t=[...e.steps].sort((e,t)=>e.step.stepIndex-t.step.stepIndex).map(e=>({...e,subActions:[...e.subActions].sort((e,t)=>e.subActionIndex-t.subActionIndex)})),n=e.member.recording,r=n?.state===`present`?n.durationMs:void 0,i=r!==void 0&&Number.isFinite(r)&&r>=0&&t.every(e=>e.subActions.every(e=>e.recordingOffsetMs!==void 0))?`time`:`ordinal`,a=i===`time`?r:t.reduce((e,t)=>e+Math.max(1,t.subActions.length),0),o=[],s=0,c=t.map(e=>{let t=s,n=e.subActions.map(e=>{let t=D(e),n=e.recordingOffsetMs,r=Us(e),c={testIndex:e.testIndex,stepIndex:e.stepIndex,subActionIndex:e.subActionIndex,ordinal:o.length+1,position:i===`time`?a===0?+(r>0):Math.min(1,Math.max(0,r/a)):(s+.5)/a,result:It(e.result)?`no-input`:e.result.success?`passed`:`failed`,frame:Gs(t)?`available`:`absent`,...t?{ref:t}:{},...n===void 0?{}:{recordingOffsetMs:n},subAction:e};return s++,o.push(c),c});return e.subActions.length===0&&s++,{...e,start:t/a,end:s/a,markers:n}});if(i===`time`){let e=1;for(let t=c.length-1;t>=0;t--){let n=c[t];n.start=n.markers[0]?.position??e,n.end=e,e=n.start}}return{testIndex:e.member.testIndex,axis:i,extent:a,segments:c,markers:o,playhead:t[0]?qs(t[0]):null}}function Qs(e,t){let n,r=1/0;for(let i of t){let t=Math.abs(e-i.centrePx);(t<r||t===r&&n&&i.marker.ordinal<n.ordinal)&&(n=i.marker,r=t)}return n}function $s(e,t){return Qs(e,t.filter(t=>Math.abs(e-t.centrePx)<=12))}function ec(e,t){return e.markers.find(e=>e.ref?.sha===t)}function tc(e,t=`readout`){if(e===void 0||!Number.isFinite(e)||e<0)return;let n=Math.floor(e/1e3),r=Math.floor(n/60),i=String(n%60).padStart(2,`0`),a=r<60?`${r}:${i}`:`${Math.floor(r/60)}:${String(r%60).padStart(2,`0`)}:${i}`;return t===`popover`?`${a}.${Math.floor(e/100)%10}`:a}var nc={frames:`Frames`,video:`Video`,source:`Playback source`,framesTooltip:`The exact screenshots the model saw when it decided`,play:`Play recording`,pause:`Pause recording`,speed:`Playback speed`,substitution:(e,t)=>`Showing #${e} of ${t} — the latest sub-action with a screenshot`,lightboxTitle:`Cited screenshot`,lightboxClose:`Close screenshot`,lightboxNote:`This screenshot is cited by the analysis but does not belong to a recorded sub-action, so it has no place on the timeline.`},rc=`agent-qa.run-detail.player-source`,ic=[.5,1,2,4,8,16],ac=`This recording cannot be synchronized with the selected action. Switch to Frames to see its screenshot.`;function oc(e,t,n){if(e?.state!==`present`||t===`ordinal`)return`frames`;try{return(n??globalThis.localStorage)?.getItem(`agent-qa.run-detail.player-source`)===`frames`?`frames`:`video`}catch{return`video`}}function sc(e,t){try{(t??globalThis.localStorage)?.setItem(rc,e)}catch{}}function cc(e,t){return t.status===404||t.blobAbsent?{state:`unavailable`,incomplete:!0,...T[e].unavailable,explanation:T.frame.unavailable.explanation}:{state:`failed`,failure:`load`,...T[e].failed.load,actionLabel:R[e]}}function lc(e,t){return{sentence:a(e.subAction),ordinal:e.ordinal,result:s[e.result],offset:tc(e.recordingOffsetMs),...t?.substitution?{substitution:nc.substitution(t.substitution.shown,t.substitution.total),frameSourceSubAction:t.index}:{}}}async function uc(e,t){try{let n=await fetch(e,{method:`GET`,headers:{Range:`bytes=0-0`},signal:t});try{await n.body?.cancel()}catch{}return{status:n.status}}catch{return{}}}function dc({runId:e,frame:t,annotation:n,wholeStep:r=!1,embedded:i}){let[a,o]=(0,Z.useState)(),[s,c]=(0,Z.useState)(0),l=(0,Z.useRef)(null),u=t?Rt.runArtifact(e,t.sha):void 0;return(0,Z.useEffect)(()=>()=>l.current?.abort(),[u]),a||t&&!Gs(t)?(0,Q.jsx)(`div`,{"data-artifact-state":`unavailable`,className:`p-3`,children:(0,Q.jsx)(L,{kind:`frame`,...a??cc(`frame`,{blobAbsent:!0}),onAction:()=>{o(void 0),c(e=>e+1)}})}):Gs(t)?(0,Q.jsx)(`div`,{"data-artifact-state":`available`,className:`p-3`,children:(0,Q.jsx)(Is,{src:u,annotation:n,embedded:i,onUnavailable:()=>{l.current?.abort();let e=new AbortController;l.current=e,uc(u,e.signal).then(t=>{e.signal.aborted||o(cc(`frame`,t))})}},s)}):(0,Q.jsx)(`div`,{"data-artifact-state":`unavailable`,className:`p-3`,children:(0,Q.jsx)(L,{kind:`frame`,state:`not-captured`,...T.frame[`not-captured`][r?`step`:`sub-action`]})})}function fc({timeline:e,caption:t,controls:n,note:r,readout:i}){return(0,Q.jsxs)(`div`,{"data-player-footer":!0,className:`pb-2`,children:[(0,Q.jsxs)(`div`,{"data-player-timeline-row":!0,className:`flex min-w-0 items-start pr-3`,children:[e,i]}),(0,Q.jsxs)(`div`,{"data-player-actions":!0,className:`flex min-w-0 flex-wrap items-center gap-x-3 gap-y-1 px-3`,children:[t,(0,Q.jsx)(`div`,{"data-player-controls":!0,className:`ml-auto flex min-w-0 flex-wrap items-center justify-end gap-2`,children:n})]}),r&&(0,Q.jsx)(`p`,{className:`px-3 pt-1 text-xs text-muted-foreground`,children:r})]})}var pc=2;function mc(e){return e?`${e.testIndex}:${e.stepIndex}:${e.subActionIndex}`:``}function hc({model:e,playhead:t,recording:n,runId:r,media:i,seekFraction:a,seekRevision:o,onPlayheadChange:s,onPlayheadObserved:c,onProgress:l,onRecordingEnded:u,autoPlay:d,speed:f,setSpeed:p,isTimelineKeyIgnored:m,readoutHost:h,transportHost:g,toolbar:_,view:v,clock:y}){let b=(0,Z.useRef)(null),x=(0,Z.useRef)(null),S=(0,Z.useRef)({model:e,playhead:t,onPlayheadChange:s,onPlayheadObserved:c,onProgress:l,onRecordingEnded:u});S.current={model:e,playhead:t,onPlayheadChange:s,onPlayheadObserved:c,onProgress:l,onRecordingEnded:u};let C=(0,Z.useRef)(``),w=(0,Z.useRef)(!1),T=(0,Z.useRef)(null),ee=(0,Z.useRef)(!1),E=(0,Z.useRef)(void 0),[D,O]=(0,Z.useState)(!1),[k,A]=(0,Z.useState)(!1),[j,M]=(0,Z.useState)(0),[N,te]=(0,Z.useState)({width:0,height:0}),[P,F]=(0,Z.useState)(),[I,ne]=(0,Z.useState)(0),R=Rt.runArtifact(r,n.ref.sha),re=e.markers.find(e=>mc(e)===mc(t)),z=re?Us(re.subAction):void 0,B=mc(t),ie=v.annotationsVisible?Ws(e.markers.map(e=>e.subAction),j*1e3,N.width,N.height):void 0;(0,Z.useEffect)(()=>{let e=i??b.current;if(!e)return;x.current=e,w.current=!1,T.current=null,ee.current=!1,E.current=void 0,O(!1);let t=new AbortController,n,r=()=>{n!==void 0&&cancelAnimationFrame(n),n=void 0},a=()=>{w.current=!0,O(!0),v.onAvailability?.(!0),M(e.currentTime),te({width:b.current?.videoWidth??0,height:b.current?.videoHeight??0})},o=()=>{let t=E.current;t===void 0||!V(e)||(E.current=void 0,e.currentTime=t,M(e.currentTime))},s=()=>{ee.current=!0,o()},c=()=>{l(),o()},l=()=>{if(M(e.currentTime),S.current.onProgress?.(S.current.model.testIndex,e.currentTime),e.paused||S.current.model.axis!==`time`)return;let t=S.current.model.markers.filter(t=>Us(t.subAction)<=e.currentTime*1e3).reduce((e,t)=>!e||Us(t.subAction)>=Us(e.subAction)?t:e,void 0);!t||mc(t)===mc(S.current.playhead)||mc(t)===C.current||(C.current=mc(t),(S.current.onPlayheadObserved??S.current.onPlayheadChange)({testIndex:t.testIndex,stepIndex:t.stepIndex,subActionIndex:t.subActionIndex}))},u=()=>{n=void 0,!(e.paused||t.signal.aborted)&&(l(),n=requestAnimationFrame(u))},d={loadedmetadata:a,resize:a,loadeddata:s,timeupdate:l,seeked:c,ended:()=>{r(),e.pause(),A(!1),M(e.currentTime),S.current.onRecordingEnded?.()},error:()=>{e.pause(),v.onAvailability?.(!1),uc(R,t.signal).then(e=>{t.signal.aborted||(F(cc(`video`,e)),O(!1))})},play:()=>{A(!0),r(),n=requestAnimationFrame(u)},pause:()=>{A(!1),r()}};for(let[t,n]of Object.entries(d))e.addEventListener(t,n);return e.paused||e.pause(),!i&&b.current&&b.current.readyState>=1&&a(),()=>{t.abort(),r();for(let[t,n]of Object.entries(d))e.removeEventListener(t,n);e.paused||e.pause(),x.current=null}},[i,R,I]),(0,Z.useEffect)(()=>{if(!(!D||!w.current||e.axis!==`time`||z===void 0||!x.current)){if(C.current===B){C.current=``;return}ue(x.current,z/1e3)}},[D,e.axis,B,z]),(0,Z.useEffect)(()=>{if(a===void 0||!Number.isFinite(a)){T.current=null;return}!D||!w.current||e.axis!==`time`||n.durationMs===void 0||!x.current||T.current?.fraction===a&&T.current.revision===o||(C.current=``,ue(x.current,Math.max(0,Math.min(1,a))*n.durationMs/1e3),T.current={fraction:a,revision:o})},[D,e.axis,a,o,n.durationMs,i,R,I]);function V(e){return(ee.current||e.readyState>=pc)&&!e.seeking}function ue(e,t){if(!V(e)){E.current=t;return}E.current=void 0,e.currentTime=t,M(e.currentTime)}(0,Z.useEffect)(()=>{x.current&&(x.current.playbackRate=f)},[f,I]),(0,Z.useEffect)(()=>{D&&d&&x.current?.play().catch(()=>{F(cc(`video`,{})),O(!1),v.onAvailability?.(!1)})},[D,d]);function de(){let e=x.current;if(!D||!e)return!1;e.paused?e.play().catch(()=>{F(cc(`video`,{})),O(!1),v.onAvailability?.(!1)}):e.pause()}return qt({" ":e=>!m||m(e)?!1:de()}),(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(`div`,{"data-player-preview":!0,className:`relative px-3 pt-3`,"data-artifact-state":P?`unavailable`:`available`,children:[P?(0,Q.jsx)(L,{...P,kind:`video`,onAction:()=>{F(void 0),O(!1),A(!1),C.current=``,ne(e=>e+1)}}):(0,Q.jsx)(Fs,{...N,magnifier:v.magnifier,fullscreen:v.fullscreen,mediaKey:`${R}:${I}`,annotation:ie?.annotation,annotationLabel:ie?.recent?`Last recorded action`:void 0,children:(0,Q.jsx)(`video`,{ref:b,src:R,preload:`metadata`,muted:!0,playsInline:!0,className:`h-full w-full object-contain`},I)}),_]}),h&&(0,Ns.createPortal)((0,Q.jsx)(gc,{elapsedMs:y?y.offsetMs===void 0?void 0:y.offsetMs+j*1e3:j*1e3,totalMs:y?y.totalMs:n.durationMs}),h),g&&(0,Ns.createPortal)((0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(q,{size:`icon-sm`,variant:`ghost`,"aria-label":k?nc.pause:nc.play,disabled:!D,onClick:de,children:k?(0,Q.jsx)(yr,{className:`h-4 w-4`}):(0,Q.jsx)(qe,{className:`h-4 w-4`})}),(0,Q.jsxs)(le,{value:String(f),onValueChange:e=>{let t=Number(e);ic.some(e=>e===t)&&(p(t),x.current&&(x.current.playbackRate=t))},children:[(0,Q.jsx)(oe,{"aria-label":nc.speed,size:`sm`,className:`w-[60px] shrink-0 gap-0.5 px-1.5 [&>svg]:size-3`,children:(0,Q.jsx)(ae,{})}),(0,Q.jsx)(se,{children:ic.map(e=>(0,Q.jsxs)(ce,{value:String(e),children:[e,`×`]},e))})]})]}),g)]})}function gc({elapsedMs:e,totalMs:t}){return(0,Q.jsxs)(`span`,{"data-player-time":!0,"data-player-elapsed-ms":e,"data-player-total-ms":t,title:t===void 0?`Full playback time is unavailable because a recording duration is missing or still loading.`:void 0,className:`mt-2.5 min-w-0 font-mono text-xs leading-4 tabular-nums`,children:[(0,Q.jsx)(`span`,{"data-player-timestamp":!0,className:`inline-block max-w-full [overflow-wrap:anywhere]`,children:tc(e)??`—`}),` / `,(0,Q.jsx)(`span`,{"data-player-timestamp":!0,className:`inline-block max-w-full [overflow-wrap:anywhere]`,children:tc(t)??`—`})]})}function _c(e){let[t,n]=(0,Z.useState)(1),[r,i]=(0,Z.useState)(!1),[a,o]=(0,Z.useState)(!0),[s,c]=(0,Z.useState)(!1),[l,u]=(0,Z.useState)(!1),[d,f]=(0,Z.useState)(null),[p,m]=(0,Z.useState)(null),h=(0,Z.useRef)(null),g=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{if(!s)return;let e=document.body.style.overflow;document.body.style.overflow=`hidden`,g.current?.focus();let t=e=>{if(e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),c(!1)),e.key===`Tab`){let t=[...h.current.querySelectorAll(`button:not(:disabled), [tabindex="0"]`)],n=t[0],r=t.at(-1);e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())}};return window.addEventListener(`keydown`,t,!0),()=>{document.body.style.overflow=e,window.removeEventListener(`keydown`,t,!0),g.current?.focus()}},[s]);let{model:_,playhead:v,source:y,recording:b,frame:x,runId:S,onSourceChange:C}=e,w=_.markers.find(e=>e.testIndex===v?.testIndex&&e.stepIndex===v.stepIndex&&e.subActionIndex===v.subActionIndex),T=x?.ref??w?.ref;(0,Z.useEffect)(()=>{u(!1)},[S,_.testIndex,y,y===`frames`?T?.sha:void 0,b?.state===`present`?b.ref.sha:void 0]);let E=x?_.markers.find(e=>e.testIndex===v?.testIndex&&e.stepIndex===v.stepIndex&&e.subActionIndex===x.index&&e.ref?.sha===x.ref.sha):w,D=w?lc(w,x):void 0,O=ee({kind:`video`,selection:`sub-action`,entry:b,read:`idle`}),k=O.kind===`state`,A=k?`${nc.video} — ${O.title}`:nc.video,j=l&&(y===`frames`?Gs(T):!k),M=y===`frames`?!!Vs(E?.subAction):_.markers.some(e=>e.subAction.result.annotation&&ot(e.subAction.result.annotation)),N=y===`video`&&!M?`This recording has no saved timing to place action highlights on the video. Open Frames to see any saved action highlights.`:a?`Hide annotations`:`Show annotations`,te=(0,Q.jsxs)(zs,{type:`single`,value:y,"aria-label":nc.source,onValueChange:e=>{(e===`frames`||e===`video`)&&(sc(e),C(e))},children:[(0,Q.jsx)(Bs,{value:`frames`,title:nc.framesTooltip,className:`text-xs`,children:nc.frames}),(0,Q.jsx)(Bs,{value:`video`,"aria-label":A,title:A,className:`text-xs${k?` opacity-60`:``}`,children:nc.video})]}),P=(0,Q.jsxs)(`div`,{"data-player-preview-toolbar":!0,className:`absolute bottom-2 right-5 z-20 flex flex-col rounded-md border bg-background/90 p-0.5 text-muted-foreground shadow-sm`,children:[(0,Q.jsx)(q,{size:`icon-sm`,variant:`ghost`,className:`h-7 w-7${r?` bg-primary/15 text-primary ring-1 ring-inset ring-primary/40`:``}`,"aria-label":r?`Disable magnifier`:`Enable magnifier`,"aria-pressed":r,disabled:!j,onClick:()=>i(e=>!e),children:(0,Q.jsx)(We,{className:`h-3.5 w-3.5`})}),(0,Q.jsx)(`span`,{title:N,tabIndex:M?void 0:0,"aria-label":M?void 0:N,children:(0,Q.jsx)(q,{size:`icon-sm`,variant:`ghost`,className:`h-7 w-7`,"aria-label":a?`Hide annotations`:`Show annotations`,"aria-pressed":a,disabled:!j||!M,onClick:()=>o(e=>!e),children:(0,Q.jsx)(sr,{className:`h-3.5 w-3.5`})})}),(0,Q.jsx)(q,{ref:g,size:`icon-sm`,variant:`ghost`,className:`h-7 w-7`,"aria-label":s?`Exit fullscreen`:`Enter fullscreen`,disabled:!j&&!s,onClick:()=>c(e=>!e),children:s?(0,Q.jsx)(_r,{className:`h-3.5 w-3.5`}):(0,Q.jsx)(mr,{className:`h-3.5 w-3.5`})})]}),F={magnifier:r,annotationsVisible:a,fullscreen:s,onAvailability:u},I=w&&D&&(0,Q.jsxs)(`div`,{"data-player-caption":!0,"data-frame-source-sub-action":D.frameSourceSubAction,className:`min-w-0 flex-1 basis-40 text-sm font-medium [overflow-wrap:anywhere] [&_[data-action-family]]:text-sm [&_[data-action-family]]:font-medium`,children:[(0,Q.jsx)(ys,{sub:w.subAction,wrap:`free`}),D.substitution&&(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:D.substitution})]});return(0,Q.jsxs)(`section`,{ref:h,"data-player":!0,"data-player-source":y,role:s?`dialog`:void 0,"aria-modal":s?!0:void 0,"aria-label":s?`Evidence media fullscreen`:void 0,className:s?`fixed inset-0 z-50 overflow-auto bg-background p-4`:void 0,children:[y===`video`&&b?.state===`present`&&!k?(0,Q.jsx)(hc,{...e,speed:t,setSpeed:n,recording:b,readoutHost:d,transportHost:p,toolbar:P,view:F},`${S}:${_.testIndex}:${b.ref.sha}`):(0,Q.jsxs)(`div`,{"data-player-preview":!0,className:`relative [&>[data-artifact-state]]:pb-0`,children:[y===`frames`&&(0,Q.jsx)(dc,{runId:S,frame:T,annotation:Vs(E?.subAction),wholeStep:!w,embedded:F},`${S}:${T?.sha??`none`}:${v?.stepIndex}:${v?.subActionIndex}`),y===`video`&&O.kind===`state`&&(0,Q.jsx)(`div`,{className:`p-3`,"data-artifact-state":`unavailable`,children:(0,Q.jsx)(L,{...O,kind:`video`})}),P]}),(0,Q.jsx)(fc,{timeline:e.timeline,caption:I,note:y===`video`&&b?.state===`present`&&!k&&_.axis===`ordinal`?ac:void 0,readout:(0,Q.jsx)(`span`,{ref:f,className:y===`video`?`flex w-[13ch] shrink-0 font-mono text-xs`:`contents`,children:y===`video`&&(b?.state!==`present`||k)&&(0,Q.jsx)(gc,{totalMs:e.clock?.totalMs})}),controls:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{ref:m,className:`contents`}),te]})})]})}function vc(e){return It(e.result)?s[`no-input`]:e.result.success?`success`:`failure`}function yc(e){return It(e.result)?`text-muted-foreground`:e.result.success?`text-emerald-500`:`text-red-500`}function bc(e){let n=[];if(n.push({key:`reasoning`,label:`Reasoning`,icon:v,content:null,duration:null,children:(0,Q.jsx)(`p`,{"data-sub-action-plan":!0,className:`m-0 whitespace-pre-wrap break-words text-sm text-muted-foreground [overflow-wrap:anywhere]`,children:e.plan})}),n.push({key:`plannedAction`,label:`Planned Action`,icon:qe,content:null,duration:null,children:(0,Q.jsx)(`pre`,{"data-sub-action-planned-action":!0,className:`max-w-full min-w-0 text-[10px] font-mono bg-muted/30 rounded-sm p-2 overflow-x-auto whitespace-pre-wrap break-words`,children:JSON.stringify(e.plannedAction,null,2)})}),n.push({key:`result`,label:`Result`,icon:t,content:null,duration:null,outcome:(0,Q.jsx)(`span`,{className:`text-xs font-medium ${yc(e)}`,children:vc(e)}),children:e.result.error===void 0?null:(0,Q.jsx)(`div`,{className:`bg-destructive/10 text-destructive rounded-sm p-2 text-xs break-words [overflow-wrap:anywhere]`,children:e.result.error})}),e.grounding!==void 0){let{role:t,name:r}=e.grounding.descriptor,i=[t,r===void 0?void 0:f(r)].filter(e=>e!==void 0&&e!==``).join(` `);i!==``&&n.push({key:`grounding`,label:`Grounding`,icon:Sr,content:null,duration:null,children:(0,Q.jsx)(`p`,{"data-grounding-descriptor":!0,className:`m-0 text-sm text-muted-foreground break-words`,children:i})})}return n}function xc({step:e,subAction:t,runId:n,model:r,playhead:i=null,recording:a,frame:o,playerSource:s=`frames`,onPlayerSourceChange:c=()=>{},onPlayheadChange:l=()=>{},seekFraction:u,isTimelineKeyIgnored:d,pipelineRef:f,timeline:p,clock:m,seekRevision:h,onProgress:g,onPlayheadObserved:_,onRecordingEnded:v,autoPlay:y}){return(0,Q.jsxs)(`div`,{"data-overview":!0,children:[r&&n&&(0,Q.jsx)(_c,{timeline:p,model:r,playhead:i,recording:a,frame:o,source:s,runId:n,onSourceChange:c,onPlayheadChange:l,seekFraction:u,seekRevision:h,clock:m,onProgress:g,onPlayheadObserved:_,onRecordingEnded:v,autoPlay:y,isTimelineKeyIgnored:d}),(0,Q.jsx)(`div`,{className:`border-t`,children:(0,Q.jsxs)(`div`,{className:`p-3 space-y-3 min-w-0`,children:[t===null?null:(0,Q.jsx)(C,{ref:f,mode:`static`,sections:bc(t)}),e?.error?(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground font-medium mb-0.5`,children:`Error`}),(0,Q.jsx)(`div`,{"data-step-error":!0,className:`bg-destructive/10 text-destructive rounded-sm p-2 text-sm break-words [overflow-wrap:anywhere]`,children:e.error})]}):null]})})]})}function Sc({step:e,subAction:t,runId:n,selection:r=t?`sub-action`:e?`step`:`none`}){let i=t?.ariaEvidence,{read:a,retry:o}=k(t?{runId:n??``,testIndex:t.testIndex,stepIndex:t.stepIndex,subActionIndex:t.subActionIndex,kind:`aria`}:null,r===`sub-action`&&i?.state===`present`&&!i.ref.evidenceIncomplete),s=ee({kind:`aria`,selection:t?r:`none`,entry:i,read:a});return s.kind===`loading`?(0,Q.jsx)(P,{kind:`aria`}):s.kind===`state`?(0,Q.jsx)(L,{...s,kind:`aria`,actionLabel:s.action?.label,onAction:s.action?.type===`retry`?o:void 0}):s.document.kind===`aria`?(0,Q.jsx)(Vt,{className:`h-full min-h-0 w-full`,children:(0,Q.jsx)(`pre`,{className:`p-3 font-mono text-xs whitespace-pre-wrap break-words`,children:s.document.tree})}):null}function Cc(e){switch(e){case`critical`:return`bg-red-500/15 text-red-500 border-red-500/20`;case`serious`:return`bg-orange-500/15 text-orange-500 border-orange-500/20`;case`moderate`:return`bg-amber-500/15 text-amber-500 border-amber-500/20`;case`minor`:return`bg-blue-500/15 text-blue-500 border-blue-500/20`;default:return`bg-muted text-muted-foreground`}}function wc({records:e}){return(0,Q.jsx)(`div`,{className:`p-3`,children:[`critical`,`serious`,`moderate`,`minor`].map(t=>{let n=e.filter(e=>e.impact===t);return n.length===0?null:(0,Q.jsxs)(`section`,{"data-a11y-impact":t,className:`space-y-3 [&+section]:pt-6`,children:[(0,Q.jsxs)(`h3`,{className:`text-[10px] font-medium uppercase tracking-wider`,children:[t,` · `,n.length]}),n.map((e,t)=>(0,Q.jsxs)(`div`,{className:`border border-border/50 rounded-sm p-3 space-y-1.5`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Q.jsx)(Bt,{className:X(`text-[10px] px-1.5 py-0`,Cc(e.impact)),children:e.impact}),(0,Q.jsx)(`span`,{className:`text-sm font-medium`,children:e.help})]}),(0,Q.jsx)(`div`,{className:`text-[10px] font-mono text-muted-foreground`,children:e.ruleId}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.description}),e.nodes.length>0&&(0,Q.jsx)(`div`,{className:`space-y-1 mt-1`,children:e.nodes.map((e,t)=>(0,Q.jsx)(`pre`,{className:`text-[10px] font-mono bg-muted/30 rounded p-1.5 overflow-x-auto whitespace-pre-wrap break-words`,children:e.html},t))}),(0,Q.jsx)(`a`,{href:e.helpUrl,target:`_blank`,rel:`noopener noreferrer`,className:`text-[10px] text-blue-500 hover:underline`,children:`Learn more`})]},t))]},t)})})}function Tc({step:e,runId:t,selection:n=e?`step`:`none`,allSteps:r=[],onSelectStep:i}){let a=e?.evidence?.a11y,o=e?.testIndex,s=e?.stepIndex,c=a?.state===`present`&&!a.ref.evidenceIncomplete&&(n===`step`||n===`sub-action`),{read:l,retry:u}=k(o!==void 0&&s!==void 0?{runId:t??``,testIndex:o,stepIndex:s,kind:`a11y`}:null,c),d=r.filter(e=>e.testIndex===o&&e.stepIndex!==void 0).map(e=>({...e,stepIndex:e.stepIndex})),f=ee({kind:`a11y`,selection:n,entry:a,read:l,elsewhere:s===void 0?void 0:{steps:d,currentStepIndex:s}});if(f.kind===`loading`)return(0,Q.jsx)(P,{kind:`a11y`});if(f.kind===`state`){let e=f.action;return(0,Q.jsx)(L,{...f,kind:`a11y`,explanation:e?.type===`step`?`${f.explanation} ${e.description}`:f.explanation,actionLabel:e?.label,onAction:e?.type===`retry`?u:e?.type===`step`&&i?()=>{let t=d.find(t=>t.stepIndex===e.stepIndex);t&&i(t.id)}:void 0})}return f.document.kind===`a11y`?(0,Q.jsx)(wc,{records:f.document.records}):null}var Ec=`inline rounded-sm text-primary tabular-nums underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`;function Dc({address:e,stepRefs:t,testName:n,children:r}){return t===void 0||!t.resolvable(e)?(0,Q.jsx)(`span`,{className:`tabular-nums`,children:r}):(0,Q.jsx)(`button`,{type:`button`,"data-step-ref":!0,"data-step-ref-test":String(e.testIndex),"data-step-ref-step":String(e.stepIndex),"aria-label":tn(e,n),className:Ec,onClick:()=>{t.onSelect(e)},children:r})}function Oc({segments:e,stepRefs:t,testNames:n=t?.testNames}){return(0,Q.jsx)(Q.Fragment,{children:e.map((e,r)=>(0,Q.jsx)(Z.Fragment,{children:e.kind===`text`?e.text:(0,Q.jsx)(Dc,{address:e.address,stepRefs:t,testName:n?.get(e.address.testIndex),children:e.label})},r))})}var kc=`text-base font-medium leading-snug`,Ac=`focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,jc={contradicted:ye,harmful:Cr,"replay-stopped":pr,confirmed:lt,helpful:wr,"replay-complete":fr,pending:c,unknown:me},Mc={problem:{glyph:`text-destructive`,sentence:`text-destructive font-medium`},positive:{glyph:`text-emerald-500`,sentence:`text-foreground`},pending:{glyph:`text-amber-500`,sentence:`text-foreground`},unknown:{glyph:`text-muted-foreground`,sentence:`text-muted-foreground`}};function Nc({view:e,stepRefs:t,testNames:n=t?.testNames}){let r=(0,Z.useId)(),i=(0,Z.useId)();return(0,Q.jsxs)(`section`,{"data-knowledge-section":`effect`,"aria-labelledby":r,className:`space-y-2`,children:[(0,Q.jsx)(`h4`,{id:r,className:kc,children:Cn}),e.entries.length===0?(0,Q.jsx)(`p`,{"data-section-absence":!0,className:`text-sm text-muted-foreground`,children:e.absence}):(0,Q.jsx)(`ul`,{"data-effect-list":!0,className:`space-y-2`,children:e.entries.map(e=>(0,Q.jsx)(Pc,{entry:e,stepRefs:t,testNames:n},e.key))}),e.uncounted===void 0?null:(0,Q.jsx)(`p`,{"data-effect-uncounted":String(e.uncounted.count),className:`text-xs text-muted-foreground`,children:(0,Q.jsxs)(ze,{children:[(0,Q.jsx)(Y,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,"aria-describedby":i,className:`cursor-help rounded-sm text-left underline decoration-dotted underline-offset-4 ${Ac}`,children:e.uncounted.line})}),(0,Q.jsx)(`span`,{id:i,hidden:!0,children:mn}),(0,Q.jsx)(Le,{side:`bottom`,align:`start`,sideOffset:4,className:`max-w-[320px] text-left`,children:mn})]})}),e.unmeasured===void 0?null:(0,Q.jsx)(`p`,{"data-effect-unmeasured":String(e.unmeasured.count),className:`text-xs text-muted-foreground tabular-nums`,children:e.unmeasured.line})]})}function Pc({entry:e,stepRefs:t,testNames:n}){let r=jc[e.outcome],i=Mc[e.tone];return(0,Q.jsxs)(`li`,{"data-effect-entry":!0,"data-effect-outcome":e.outcome,"data-effect-tone":e.tone,className:`grid grid-cols-[auto_minmax(0,1fr)] gap-x-2 gap-y-1`,children:[(0,Q.jsx)(r,{className:`mt-0.5 size-3.5 ${i.glyph}`,"aria-hidden":!0}),(0,Q.jsxs)(`p`,{"data-effect-sentence":!0,className:`text-sm ${i.sentence}`,children:[e.parts.lead,` `,(0,Q.jsx)(Oc,{segments:un(e.addresses,n),stepRefs:t,testNames:n}),e.parts.tail]}),(0,Q.jsx)(`p`,{"data-effect-record":!0,className:`col-start-2 text-xs text-muted-foreground wrap-anywhere`,children:e.record})]})}function Fc({id:e,className:t}){let{status:n,copy:r}=d();return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(q,{type:`button`,variant:`ghost`,size:`icon-xs`,"data-record-id-copy":!0,"data-copy-status":n,"aria-label":sn(e),onClick:()=>r(e),className:`shrink-0 align-middle ${t??``}`,children:n===`copied`?(0,Q.jsx)(V,{className:`size-3.5 text-success`,"aria-hidden":`true`}):(0,Q.jsx)(ue,{className:`size-3.5`,"aria-hidden":`true`})}),(0,Q.jsx)(`span`,{"data-record-id-copy-status":!0,role:`status`,"aria-live":`polite`,className:`sr-only`,children:n===`copied`?Hn:n===`failed`?Xt(e):``})]})}var Ic=`group flex items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,Lc=`font-mono text-xs text-muted-foreground tabular-nums`,Rc=`text-xs text-muted-foreground`;function zc(e){switch(e){case`confirmed`:case`helpful`:case`contradicted`:case`harmful`:return jn(e);case`pending`:return Bn;case`not-attributed`:return Nn;case`unknown`:return Rn;case`skipped`:return Pn}}function Bc({line:e}){return(0,Q.jsxs)(`li`,{"data-served-channel":`1`,"data-served-as-canary":e.servedAsCanary?`true`:`false`,...e.canaryOutcome===void 0?{}:{"data-canary-outcome":e.canaryOutcome},"data-trace-state":e.why.kind===`answered`?`answered`:e.why.reason,className:`space-y-1`,children:[(0,Q.jsx)(`span`,{className:`block text-xs wrap-anywhere`,children:e.summary}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(`p`,{className:`${Lc} min-w-0 wrap-anywhere`,children:e.id}),(0,Q.jsx)(Fc,{id:e.id})]}),e.servedAsCanary?(0,Q.jsx)(`span`,{className:Rc,children:wn}):null]}),(0,Q.jsx)(`p`,{className:Lc,children:rn(e.trust,e.tier,e.status)}),(0,Q.jsx)(Vc,{line:e}),e.canaryOutcome===void 0?null:(0,Q.jsx)(`p`,{className:Rc,children:zc(e.canaryOutcome)})]})}function Vc({line:e}){return e.why.kind===`answered`?(0,Q.jsx)(`p`,{className:Lc,children:an(e.why.leg,e.why.rank,e.why.score)}):e.why.reason===`artifact-missing`?(0,Q.jsx)(Xo,{variant:`inline`}):(0,Q.jsx)(`p`,{className:Rc,children:e.why.reason===`pre-trace-run`?bn:Zt})}function Hc({view:e}){return(0,Q.jsxs)(`p`,{"data-row-applicability":!0,className:`text-xs text-muted-foreground wrap-anywhere`,children:[e.lead,e.phrases.map((e,t)=>(0,Q.jsxs)(Z.Fragment,{children:[` · `,(0,Q.jsx)(Uc,{phrase:e})]},t))]})}function Uc({phrase:e}){return e.literal===void 0?(0,Q.jsx)(`span`,{"data-anchor-type":e.type,className:e.type===`unparsed`?`font-mono wrap-anywhere`:void 0,children:e.text}):(0,Q.jsxs)(`span`,{"data-anchor-type":e.type,children:[e.text,` `,(0,Q.jsx)(`code`,{className:`font-mono wrap-anywhere`,children:e.literal})]})}function Wc({content:e}){let{confirmations:t,contradictions:n,trustNarrative:r}=e.currentTrust;return(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{className:Ic,children:[(0,Q.jsx)(K,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),Wn]}),(0,Q.jsxs)(p,{"data-full-record":!0,className:`mt-1 rounded-md bg-muted/40 px-3 py-2 space-y-2`,children:[(0,Q.jsx)(`p`,{"data-record-current-status":!0,className:`text-xs text-muted-foreground`,children:cn(e.currentStatus)}),(0,Q.jsx)(`p`,{"data-record-content":!0,className:`text-sm whitespace-pre-wrap wrap-anywhere`,children:e.content}),(0,Q.jsx)(`p`,{"data-trust-counts":!0,className:`text-xs text-muted-foreground tabular-nums`,children:Ln(t,n)}),r===void 0?null:(0,Q.jsxs)(`div`,{"data-evidence-note":!0,className:`border-l-2 border-border pl-2 space-y-1`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium text-muted-foreground`,children:Mn}),(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground whitespace-pre-wrap wrap-anywhere`,children:r})]})]})]})}var Gc=`text-base font-medium leading-snug`,Kc=`focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`,qc={added:Ce,confirmed:V,superseded:br,deprecated:$n,proposed:ur};function Jc({view:e}){let t=(0,Z.useId)(),n=e.rows.filter(e=>e.section!==`since-then`),r=e.rows.filter(e=>e.section===`since-then`);return(0,Q.jsxs)(`section`,{"data-knowledge-section":`changes`,"aria-labelledby":t,"data-learned-state":e.state,...e.scanIncomplete===!0?{"data-learned-read":`incomplete`}:{},"data-learned-snapshot":e.curationSnapshot===void 0?`absent`:`recorded`,...e.curationSnapshot?.sinceThenCount===void 0?{}:{"data-learned-since-then":String(e.curationSnapshot.sinceThenCount)},className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,Q.jsx)(`h4`,{id:t,className:Gc,children:In}),e.countLine===void 0?null:(0,Q.jsx)(`span`,{"data-learned-count-line":!0,className:`text-xs text-muted-foreground tabular-nums`,children:e.countLine})]}),e.countNote===void 0?null:(0,Q.jsx)(`p`,{"data-learned-count-note":!0,className:`text-xs text-muted-foreground`,children:e.countNote}),e.curationSnapshot?.reconciliation===void 0?null:(0,Q.jsxs)(`div`,{"data-learned-reconciliation":!0,className:`space-y-1`,children:[(0,Q.jsx)(`p`,{"data-learned-reconciliation-count":!0,className:`text-xs text-muted-foreground tabular-nums`,children:e.curationSnapshot.reconciliation.count}),(0,Q.jsx)(`p`,{"data-learned-reconciliation-cause":!0,className:`text-xs text-muted-foreground tabular-nums`,children:e.curationSnapshot.reconciliation.cause})]}),e.sentence===void 0?null:(0,Q.jsx)(`p`,{"data-learned-sentence":!0,"data-section-absence":!0,className:`text-sm text-muted-foreground`,children:e.sentence}),n.length===0?null:(0,Q.jsx)(`ul`,{className:`divide-y divide-border`,children:n.map(e=>(0,Q.jsx)(Yc,{row:e},e.key))}),r.length===0?null:(0,Q.jsxs)(`div`,{"data-since-this-run":String(r.length),className:`space-y-1 pt-2`,children:[(0,Q.jsx)(`h5`,{className:`text-xs font-medium text-muted-foreground tabular-nums`,children:gn(r.length)}),(0,Q.jsx)(`ul`,{className:`divide-y divide-border`,children:r.map(e=>(0,Q.jsx)(Yc,{row:e},e.key))})]}),e.chainNote===void 0?null:(0,Q.jsx)(`p`,{"data-learned-chain-note":!0,className:`text-xs text-muted-foreground`,children:e.chainNote}),e.readNote===void 0?null:(0,Q.jsx)(`p`,{"data-learned-read-note":!0,className:`text-xs text-muted-foreground`,children:e.readNote})]})}function Yc({row:e}){return(0,Q.jsxs)(`li`,{"data-record-change":e.bucket,...e.section===void 0?{}:{"data-learned-section":e.section},className:`py-2 space-y-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-1`,children:[(0,Q.jsx)(Xc,{bucket:e.bucket}),(0,Q.jsx)(`span`,{"data-row-primary":!0,className:`text-sm wrap-anywhere`,children:e.primary}),e.note===void 0?null:(0,Q.jsxs)(`span`,{"data-proposed-note":!0,className:`text-xs text-muted-foreground`,children:[`· `,e.note]})]}),e.was===void 0?null:(0,Q.jsxs)(`p`,{"data-superseded-was":!0,className:`flex items-baseline gap-1 text-xs text-muted-foreground wrap-anywhere`,children:[(0,Q.jsx)(ar,{className:`size-3 shrink-0`,"aria-hidden":!0}),(0,Q.jsxs)(`span`,{children:[ln,` `,e.was.primary]})]}),e.applicability===void 0?null:(0,Q.jsx)(Hc,{view:e.applicability}),e.sinceDetail===void 0?null:(0,Q.jsx)(`p`,{"data-since-detail":!0,className:`text-xs text-muted-foreground`,children:e.sinceDetail}),e.content===void 0?null:(0,Q.jsx)(Wc,{content:e.content})]})}function Xc({bucket:e}){let t=qc[e],n=(0,Z.useId)();return(0,Q.jsxs)(ze,{children:[(0,Q.jsx)(Y,{asChild:!0,children:(0,Q.jsxs)(`button`,{type:`button`,"data-bucket-label":e,"aria-describedby":n,className:`inline-flex items-center gap-1 cursor-help rounded-sm text-xs font-medium uppercase tracking-wider text-muted-foreground underline decoration-dotted underline-offset-4 ${Kc}`,children:[(0,Q.jsx)(t,{className:`size-3`,"aria-hidden":!0}),kn[e]]})}),(0,Q.jsx)(`span`,{id:n,hidden:!0,children:xn[e]}),(0,Q.jsx)(Le,{side:`bottom`,align:`start`,sideOffset:4,className:`max-w-[320px] text-left`,children:xn[e]})]})}var Zc=`text-base font-medium leading-snug`,Qc=`focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50`;function $c({view:e,stepRefs:t}){let n=(0,Z.useId)();return(0,Q.jsxs)(`section`,{"data-knowledge-section":`used`,"aria-labelledby":n,className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,Q.jsx)(`h4`,{id:n,className:Zc,children:$t}),e.countLine===void 0?null:(0,Q.jsx)(`span`,{"data-used-count-line":!0,className:`text-xs text-muted-foreground tabular-nums`,children:e.countLine})]}),e.retrieval===void 0?null:(0,Q.jsx)(he,{view:e.retrieval}),e.records.length===0?(0,Q.jsx)(`p`,{"data-section-absence":!0,className:`text-sm text-muted-foreground`,children:e.absence}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`ul`,{className:`divide-y divide-border`,children:e.records.slice(0,50).map(e=>(0,Q.jsx)(el,{record:e,stepRefs:t},e.key))}),e.records.length<=50?null:(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{"data-used-show-all":String(e.records.length),className:Ic,children:[(0,Q.jsx)(K,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),hn(e.records.length)]}),(0,Q.jsx)(p,{className:`mt-2`,children:(0,Q.jsx)(`ul`,{className:`divide-y divide-border`,children:e.records.slice(50).map(e=>(0,Q.jsx)(el,{record:e,stepRefs:t},e.key))})})]})]})]})}function el({record:e,stepRefs:t}){return(0,Q.jsxs)(`li`,{"data-used-record":!0,"data-use-verbs":e.uses.map(e=>e.verb).join(` `),...e.kind===void 0?{}:{"data-record-kind":e.kind},...e.onTrial===void 0?{}:{"data-on-trial":`true`},...e.sinceStatus===void 0?{}:{"data-since-status":e.sinceStatus},...e.contentAbsence===void 0?{}:{"data-content-absence":e.contentAbsence.reason},className:`py-2 space-y-1`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-x-2 gap-y-1`,children:[e.kind===void 0?null:(0,Q.jsx)(Bt,{variant:`outline`,className:`text-muted-foreground`,children:Gn[e.kind]}),(0,Q.jsx)(`span`,{"data-row-primary":!0,className:`text-sm wrap-anywhere`,children:e.primary}),e.onTrial===void 0?null:(0,Q.jsx)(tl,{}),e.sinceStatus===void 0?null:(0,Q.jsxs)(Bt,{variant:`outline`,className:`text-muted-foreground`,children:[(0,Q.jsx)(lr,{className:`size-3`,"aria-hidden":!0}),pn[e.sinceStatus]]})]}),e.applicability===void 0?null:(0,Q.jsx)(Hc,{view:e.applicability}),e.contentAbsence===void 0?null:(0,Q.jsx)(`p`,{"data-row-absence-reason":!0,className:`text-xs text-muted-foreground wrap-anywhere`,children:zn[e.contentAbsence.reason]}),(0,Q.jsx)(`p`,{"data-row-uses":!0,className:`text-xs text-muted-foreground tabular-nums`,children:e.uses.map((e,n)=>(0,Q.jsxs)(Z.Fragment,{children:[n>0?` · `:null,n===0?Qt[e.verb].lead:Qt[e.verb].follow,` `,(0,Q.jsx)(Oc,{segments:un(e.addresses,t?.testNames),stepRefs:t})]},e.verb))}),e.content===void 0?null:(0,Q.jsx)(Wc,{content:e.content})]})}function tl(){let e=(0,Z.useId)();return(0,Q.jsxs)(ze,{children:[(0,Q.jsx)(Y,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,"aria-describedby":e,className:`inline-flex rounded-md ${Qc}`,children:(0,Q.jsxs)(Bt,{variant:`outline`,className:`cursor-help text-muted-foreground`,children:[(0,Q.jsx)(cr,{className:`size-3`,"aria-hidden":!0}),On]})})}),(0,Q.jsx)(`span`,{id:e,hidden:!0,children:Dn}),(0,Q.jsx)(Le,{side:`bottom`,align:`start`,sideOffset:4,className:`max-w-[320px] text-left`,children:Dn})]})}var nl=`text-xs uppercase tracking-wider font-medium text-muted-foreground`,rl=`pl-5 space-y-2`,il=`font-mono text-xs text-muted-foreground tabular-nums`,al=`CUT CANDIDATES`;function ol({detail:e}){return(0,Q.jsxs)(`div`,{className:`space-y-4`,children:[e.channel1.length>0?(0,Q.jsx)(sl,{lines:e.channel1}):null,e.channel2.length>0?(0,Q.jsxs)(`section`,{"data-ledger-channel":`2`,className:`space-y-2`,children:[(0,Q.jsx)(`p`,{className:nl,children:Fn[2]}),(0,Q.jsx)(`ul`,{className:rl,children:e.channel2.map(e=>(0,Q.jsxs)(`li`,{"data-served-channel":`2`,className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,Q.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(`span`,{className:`${il} wrap-anywhere`,children:e.id}),(0,Q.jsx)(Fc,{id:e.id})]}),(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.detailLevel}),(0,Q.jsx)(`span`,{className:`${il} wrap-anywhere`,children:e.bodyDigest})]},e.id))})]}):null,e.channel3.length>0?(0,Q.jsxs)(`section`,{"data-ledger-channel":`3`,className:`space-y-2`,children:[(0,Q.jsx)(`p`,{className:nl,children:Fn[3]}),(0,Q.jsx)(`ul`,{className:rl,children:e.channel3.map(e=>(0,Q.jsxs)(`li`,{"data-served-channel":`3`,className:`space-y-1`,children:[(0,Q.jsx)(`span`,{className:`block text-xs wrap-anywhere`,children:e.summary}),(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(`p`,{className:`${il} min-w-0 wrap-anywhere`,children:e.id}),(0,Q.jsx)(Fc,{id:e.id})]})]},e.id))})]}):null,e.cut===void 0?null:(0,Q.jsx)(`div`,{"data-cut-candidates":String(e.cut.lines.length),children:(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{className:Ic,children:[(0,Q.jsx)(K,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),e.cut.label]}),(0,Q.jsxs)(p,{className:`mt-2 space-y-1`,children:[(0,Q.jsx)(`p`,{className:nl,children:al}),(0,Q.jsx)(`ul`,{className:rl,children:e.cut.lines.map(e=>(0,Q.jsxs)(`li`,{className:`${il} wrap-anywhere`,children:[e.recordId,` · leg `,e.leg,` · rank `,String(e.rank),` · score`,` `,e.score.toFixed(3)]},e.recordId))})]})]})}),e.planSource===void 0?null:(0,Q.jsx)(cl,{planSource:e.planSource}),e.rung===void 0?null:(0,Q.jsx)(`p`,{"data-ledger-rung":!0,className:`text-xs text-muted-foreground`,children:nn(e.rung.rung,e.rung.reason)})]})}function sl({lines:e}){let t=An(e);return(0,Q.jsxs)(`section`,{"data-ledger-channel":`1`,className:`space-y-2`,children:[(0,Q.jsx)(`p`,{className:nl,children:Fn[1]}),(0,Q.jsx)(`ul`,{className:rl,children:t.lines.map(e=>(0,Q.jsx)(Bc,{line:e},e.id))}),t.showAllLabel===void 0?null:(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{"data-channel-show-all":String(e.length),className:Ic,children:[(0,Q.jsx)(K,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),t.showAllLabel]}),(0,Q.jsx)(p,{className:`mt-2`,children:(0,Q.jsx)(`ul`,{className:rl,children:e.slice(50).map(e=>(0,Q.jsx)(Bc,{line:e},e.id))})})]})]})}function cl({planSource:e}){return(0,Q.jsxs)(`div`,{"data-plan-source-outcome":e.tone,className:`space-y-1`,children:[(0,Q.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1`,children:[(0,Q.jsx)(`span`,{className:`${il} wrap-anywhere`,children:e.procedureId}),(0,Q.jsx)(Fc,{id:e.procedureId})]}),(0,Q.jsx)(`p`,{className:`text-xs`,children:e.sentence}),e.missReason===void 0?null:(0,Q.jsx)(`p`,{className:il,children:e.missReason})]})}function ll({ledger:e}){let t=(0,Z.useId)();return(0,Q.jsx)(`section`,{"data-knowledge-section":`retrieval-details`,"aria-labelledby":t,className:`border-t pt-4`,children:(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{id:t,className:Ic,children:[(0,Q.jsx)(K,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),Sn]}),(0,Q.jsxs)(p,{className:`mt-4 space-y-4`,children:[(0,Q.jsx)(`p`,{"data-used-summary":!0,className:`text-xs text-muted-foreground tabular-nums`,children:e.summary}),e.steps.length>0?(0,Q.jsx)(`ul`,{className:`space-y-1`,children:e.steps.map(e=>(0,Q.jsx)(ul,{row:e},`${String(e.testIndex)}:${String(e.stepIndex)}`))}):null,e.changes.length===0?null:(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[(0,Q.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-wider text-muted-foreground`,children:In}),e.changes.map(e=>(0,Q.jsx)(pl,{entry:e},e.key))]})]})]})})}function ul({row:e}){return(0,Q.jsx)(j,{asChild:!0,children:(0,Q.jsxs)(`li`,{"data-step-index":String(e.stepIndex),"data-test-index":String(e.testIndex),"data-plan-source":e.planSource,"data-brief-lines":String(e.briefLines),"data-canary-lines":String(e.canaryLines),children:[(0,Q.jsxs)(A,{className:`group flex w-full items-center gap-2 py-1 text-left text-xs font-medium hover:text-foreground`,children:[(0,Q.jsx)(K,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]:rotate-90`}),(0,Q.jsx)(`span`,{className:`truncate`,children:e.title}),e.noBrief===!0?(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:Un}):(0,Q.jsx)(`span`,{className:`flex flex-wrap items-center gap-1`,children:e.facts.map(e=>(0,Q.jsx)(Bt,{variant:`outline`,className:`text-xs font-medium`,children:e},e))})]}),(0,Q.jsx)(p,{className:`bg-muted/40 rounded-[var(--radius)] px-3 py-2 space-y-2`,children:(0,Q.jsx)(`div`,{"data-step-detail":!0,children:(0,Q.jsx)(ol,{detail:e.detail})})})]})})}function dl(e){return e.map((e,t)=>(0,Q.jsx)(`span`,{className:`block`,children:e},t))}function fl(e){return e.map((e,t)=>(0,Q.jsxs)(`span`,{className:`block`,children:[e,(0,Q.jsx)(Fc,{id:e,className:`ml-1`})]},t))}function pl({entry:e}){let t=[[`bucket`,e.bucket],[`record`,fl(e.recordIds)]];return e.events.length>0&&t.push([`events`,dl(e.events.map(en))]),e.promotionPath!==void 0&&t.push([`promotion`,Kn(e.promotionPath)]),e.promotionReceiptDigest!==void 0&&t.push([`receipt`,e.promotionReceiptDigest]),e.evidenceTokens.length>0&&t.push([`evidence`,dl(e.evidenceTokens)]),e.observationIds.length>0&&t.push([`observation`,dl(e.observationIds)]),e.sourceRunIds.length>0&&t.push([`sourceRun`,dl(e.sourceRunIds)]),e.validity!==void 0&&t.push([`validity`,on(e.validity)]),e.ref!==void 0&&t.push([`link`,e.href===void 0?e.ref:(0,Q.jsx)(`a`,{href:e.href,className:`text-primary underline-offset-4 hover:underline`,children:e.ref})]),(0,Q.jsx)(`dl`,{"data-ledger-changes":!0,className:`grid grid-cols-[auto_minmax(0,1fr)] items-start gap-x-4 gap-y-2 text-xs`,children:t.map(([e,t])=>(0,Q.jsxs)(Z.Fragment,{children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:En[e]}),(0,Q.jsx)(`dd`,{"data-ledger-row":e,className:`font-mono break-all select-text`,children:t})]},e))})}var ml=`px-3 py-4 space-y-4`,hl=`text-base font-medium leading-snug`,gl=`text-sm text-muted-foreground break-words`;function _l({view:e,stepRefs:t}){return e===void 0?(0,Q.jsx)(`div`,{"data-knowledge-state":`loading`,className:ml,children:(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(W,{className:`h-4`}),(0,Q.jsx)(W,{className:`h-4`}),(0,Q.jsx)(W,{className:`h-4`})]})}):e.state===`error`?(0,Q.jsxs)(`div`,{"data-knowledge-state":`error`,className:ml,children:[(0,Q.jsx)(`h4`,{className:hl,children:e.heading}),(0,Q.jsx)(`p`,{className:gl,children:e.body})]}):e.state===`evidence-incomplete`?(0,Q.jsx)(`div`,{"data-knowledge-state":`evidence-incomplete`,className:`px-3`,children:(0,Q.jsx)(Xo,{variant:`pane`})}):e.state===`empty-no-store`?(0,Q.jsxs)(`div`,{"data-knowledge-state":`empty-no-store`,className:ml,children:[(0,Q.jsx)(`h4`,{className:hl,children:e.heading}),(0,Q.jsx)(`p`,{className:gl,children:e.body})]}):(0,Q.jsxs)(`div`,{"data-knowledge-state":`ready`,className:`px-3 py-4 space-y-6`,children:[(0,Q.jsx)($c,{view:e.used,stepRefs:t}),(0,Q.jsx)(Nc,{view:e.effect,stepRefs:t,testNames:t?.testNames}),(0,Q.jsx)(Jc,{view:e.learned}),(0,Q.jsx)(ll,{ledger:e.ledger})]})}var vl={high:`text-red-500`,moderate:`text-amber-500`},yl={variables:`Variables`,network:`Network`,console:`Console`,aria:`ARIA Tree`,a11y:`A11y`};function bl(e){let t=e?.console,n=e?.network,r=e?.a11y,i=e=>e>0?e:void 0;return{console:t?.state===`present`&&!t.ref.evidenceIncomplete?i(t.counts.errors):void 0,network:n?.state===`present`&&!n.ref.evidenceIncomplete?i(n.counts.failed+n.counts.errored):void 0,a11y:r?.state===`present`&&!r.ref.evidenceIncomplete?i(r.counts.minor+r.counts.moderate+r.counts.serious+r.counts.critical):void 0}}function xl(e){let t=bl(e),n=n=>{let r=t[n];if(r===void 0)return;let i=e?.a11y;return{kind:`problem`,count:r,severity:n===`a11y`&&i?.state===`present`&&i.counts.critical===0&&i.counts.serious===0?`moderate`:`high`}};return{console:n(`console`),network:n(`network`),a11y:n(`a11y`)}}function Sl(e,t,n=`sub-action`){let r=xl(e),i=i=>{let a=i===`aria`?t:e?.[i],o=ee({kind:i,entry:a,selection:n,read:`idle`});if(o.kind===`state`)return{kind:`absent`,title:o.title};if(!a||a.state!==`present`||a.kind===`aria`)return;if(a.kind!==`variables`){let e=r[a.kind];if(e!==void 0)return e}let s=a.kind===`variables`?a.counts.count:a.kind===`a11y`?0:a.counts.total;return s>0?{kind:`total`,count:s}:{kind:`absent`,title:T[i].empty.title}};return{variables:i(`variables`),network:i(`network`),console:i(`console`),aria:i(`aria`),a11y:i(`a11y`)}}function Cl(e,t){let{count:n}=t,r=t.kind===`problem`?{console:[`error`,`errors`],network:[`failed request`,`failed requests`],a11y:[`violation`,`violations`]}:{console:[`message`,`messages`],network:[`request`,`requests`],a11y:[`violation`,`violations`]},i=e===`variables`||e===`aria`?``:` ${r[e][n===1?0:1]}`;return`${yl[e]}, ${n}${i}`}function wl(e,t){return`${yl[e]} — ${t}`}var Tl=(e,t)=>`Step ${e} of ${t} · whole step`,El=(e,t,n)=>`Sub-action #${e} of ${t} · step ${n}`;function Dl({scope:e,step:t,total:n,subAction:r}){return e===`sub-action`&&r===void 0?null:(0,Q.jsx)(`div`,{"data-evidence-scope":e,className:`shrink-0 px-3 py-2 border-b text-xs text-muted-foreground tabular-nums`,children:e===`step`?Tl(t,n):El(r,n,t)})}function Ol({activeTab:e,onTabChange:t,step:n,subAction:r,runId:i,allSteps:a,executionLogs:s=[],platform:c,model:l,playhead:u,recording:d,frame:f,playerSource:p,onPlayerSourceChange:m,onPlayheadChange:h,seekFraction:g,isTimelineKeyIgnored:_,pipelineRef:v,timeline:y,clock:b,seekRevision:x,onProgress:S,onPlayheadObserved:C,onRecordingEnded:w,autoPlay:T,knowledge:ee,knowledgeStepRefs:E,onSelectStep:D}){let O=s.length>0,k=(0,Z.useRef)(null),A=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{if(e!==`console`&&e!==`network`)return;let t=e===`console`?k:A,n=()=>{let e=t.current?.querySelector(`[data-slot="scroll-area-viewport"]`);e&&(e.scrollTop=e.scrollHeight)},r=requestAnimationFrame(n),i=new MutationObserver(n);return t.current&&i.observe(t.current,{childList:!0,subtree:!0}),()=>{cancelAnimationFrame(r),i.disconnect()}},[e,n?.id]);let j=O?s.some(e=>e.type===`hook`)?`hook`:`execution-log`:n?r?`sub-action`:`step`:`none`,M=Sl(n?.evidence,r?.ariaEvidence,j),N=!O&&n?.testIndex!==void 0&&n.stepIndex!==void 0?n:null,P=e=>N&&(0,Q.jsx)(Dl,{scope:e,step:N.displayStepOrder,total:e===`step`?N.displayStepTotal??a.length:N.subActions?.length??0,subAction:r?r.subActionIndex+1:void 0}),F=(e,t,n)=>{let r=e===`console`&&O?void 0:M[e],i=r?.kind===`absent`?wl(e,r.title):r?Cl(e,r):void 0,a=e===`console`?ye:e===`network`?o:Qn,s=(0,Q.jsxs)(Me,{value:t,"aria-label":i||void 0,className:`text-xs rounded-none flex-initial${r?.kind===`absent`?` opacity-60 data-[state=active]:opacity-100`:``}`,children:[n,r&&r.kind!==`absent`&&(0,Q.jsxs)(`span`,{"data-tab-count":r.count,"data-tab-count-kind":r.kind,"aria-hidden":`true`,className:`inline-flex items-center gap-1 tabular-nums ${r.kind===`total`?`text-muted-foreground`:vl[r.severity]}`,children:[r.kind===`problem`&&(0,Q.jsx)(a,{className:`h-3.5 w-3.5 size-3.5`}),r.count]})]});return r?.kind===`absent`?(0,Q.jsxs)(ze,{children:[(0,Q.jsx)(Y,{asChild:!0,children:s}),(0,Q.jsx)(Le,{children:i})]}):s};return(0,Q.jsx)(tt,{children:(0,Q.jsxs)(Pe,{value:e,onValueChange:t,className:`flex h-full min-h-0 flex-col overflow-hidden gap-0`,children:[(0,Q.jsxs)(U,{variant:`line`,className:`w-full justify-start overflow-x-auto border-b px-3 h-9 shrink-0 rounded-none [&_[role=tab]]:shrink-0`,children:[(0,Q.jsx)(Me,{value:`overview`,className:`text-xs rounded-none flex-initial`,children:`Overview`}),F(`variables`,`env`,`Variables`),F(`network`,`network`,`Network`),F(`console`,`console`,O?`stdout`:`Console`),F(`aria`,`aria`,`ARIA Tree`),F(`a11y`,`a11y`,`A11y`),(0,Q.jsx)(Me,{value:`knowledge`,className:`text-xs rounded-none flex-initial`,children:`Knowledge`})]}),(0,Q.jsx)(Ne,{value:`overview`,className:`flex-1 min-h-0`,children:(0,Q.jsx)(Vt,{className:`h-full`,children:(n||l)&&(0,Q.jsx)(xc,{timeline:y,step:n,subAction:r,runId:i,model:l,playhead:u,recording:d,frame:f,playerSource:p,onPlayerSourceChange:m,onPlayheadChange:h,seekFraction:g,seekRevision:x,clock:b,onProgress:S,onPlayheadObserved:C,onRecordingEnded:w,autoPlay:T,isTimelineKeyIgnored:_,pipelineRef:v})})}),(0,Q.jsx)(Ne,{value:`env`,className:`flex-1 min-h-0`,children:(0,Q.jsxs)(Vt,{className:`h-full`,children:[P(`step`),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(I,{step:n,executionLogs:s,runId:i,selection:j,allSteps:a,onSelectStep:D})})]})}),(0,Q.jsx)(Ne,{value:`network`,className:`flex-1 min-h-0`,children:(0,Q.jsx)(`div`,{ref:A,className:`h-full`,children:(0,Q.jsxs)(Vt,{className:`h-full`,children:[P(`step`),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(te,{step:n,allSteps:a,platform:c,runId:i,selection:j,evidenceSteps:a,onSelectStep:D})})]})})}),(0,Q.jsx)(Ne,{value:`console`,className:`flex-1 min-h-0`,children:(0,Q.jsx)(`div`,{ref:k,className:`h-full`,children:(0,Q.jsxs)(Vt,{className:`h-full`,children:[P(`step`),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(ne,{step:n,allSteps:a,executionLogs:s,isHookStep:O,runId:i,selection:j,evidenceSteps:a,onSelectStep:D})})]})})}),(0,Q.jsxs)(Ne,{value:`aria`,className:`flex flex-col flex-1 min-h-0 overflow-hidden`,children:[P(`sub-action`),(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 overflow-hidden`,children:(0,Q.jsx)(Sc,{step:n,subAction:r,runId:i,selection:j})})]}),(0,Q.jsx)(Ne,{value:`a11y`,className:`flex-1 min-h-0`,children:(0,Q.jsxs)(Vt,{className:`h-full`,children:[P(`step`),(0,Q.jsx)(`div`,{children:(0,Q.jsx)(Tc,{step:n,runId:i,selection:j,allSteps:a,onSelectStep:D})})]})}),(0,Q.jsx)(Ne,{value:`knowledge`,className:`flex-1 min-h-0`,children:(0,Q.jsx)(Vt,{className:`h-full`,children:(0,Q.jsx)(_l,{view:ee,stepRefs:E})})})]})})}function kl({neutralReason:e}){return(0,Q.jsxs)(`div`,{"data-entry":`denial`,className:`flex items-start gap-2 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-sm`,children:[(0,Q.jsx)(n,{className:`mt-0.5 size-4 shrink-0 text-destructive`,"aria-hidden":`true`}),(0,Q.jsx)(`p`,{className:`text-foreground`,children:e})]})}function Al({parts:e}){return(0,Q.jsxs)(Q.Fragment,{children:[e.prefix,e.name,e.suffix]})}function jl({scope:e,address:t,read:n,detail:r,newMarkId:i,onRetry:a}){let o=(0,Z.useId)(),s=Ba(n),c=n?.kind===`read`&&n.result.kind===`history`?n.result.entries:[],l=s===`history`||s===`empty`,u=[...c].reverse(),d=u.filter(e=>ht(e)===t),f=s===`history`&&d.length===0?`empty`:s,m=e=>ro(c.find(t=>t.markId===e)?.markedAt),h=c.some(e=>!e.active),g=c.some(e=>e.disposition.kind===`applied`);return(0,Q.jsxs)(`div`,{className:`space-y-3`,children:[h?(0,Q.jsx)(`p`,{"data-feedback-replaced-note":!0,className:`text-xs text-muted-foreground`,children:Ka}):null,g?(0,Q.jsx)(`p`,{"data-feedback-correction-note":!0,className:`text-xs text-muted-foreground`,children:Za}):null,(0,Q.jsxs)(`section`,{"data-feedback-history":`target`,"data-history-state":f,"aria-labelledby":o,className:`space-y-2`,children:[(0,Q.jsx)(`h3`,{id:o,className:`text-sm font-medium`,children:l?Ha(e,d.length):Va[e]}),s===`loading`?(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(W,{className:`h-10 motion-reduce:animate-none`}),(0,Q.jsx)(W,{className:`h-10 motion-reduce:animate-none`})]}):l?d.length===0?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:Qa[e]}):(0,Q.jsx)(`ol`,{className:`space-y-2`,children:d.map(e=>(0,Q.jsx)(Nl,{entry:e,replacedAt:m(e.supersededBy),isNew:e.markId===i},e.markId))}):(0,Q.jsx)(Ml,{read:n,onRetry:a})]}),l?(0,Q.jsx)(`div`,{"data-feedback-history":`run`,"data-history-state":s,children:(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{className:`group flex w-full items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,Q.jsx)(K,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),Ua(c.length)]}),(0,Q.jsx)(p,{children:u.length===0?(0,Q.jsx)(`p`,{className:`mt-2 text-xs text-muted-foreground`,children:Qa.run}):(0,Q.jsx)(`ol`,{className:`mt-2 space-y-2`,children:u.map(e=>(0,Q.jsx)(Nl,{entry:e,replacedAt:m(e.supersededBy),target:io(e,r)},e.markId))})})]})}):null]})}function Ml({read:e,onRetry:t}){let n,r=!1;if(e===void 0)return null;if(e.kind===`failed`)n=eo(Ma(e.reason)),r=!0;else if(e.result.kind===`ledger-corrupt`)n=$a(`ledger-corrupt`,e.result.line);else if(e.result.kind===`run-not-found`||e.result.kind===`ledger-unavailable`)n=$a(e.result.kind),r=e.result.kind===`ledger-unavailable`;else return null;return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(`p`,{className:`break-words text-xs text-muted-foreground`,children:n}),r?(0,Q.jsx)(q,{variant:`outline`,size:`sm`,"data-feedback-history-retry":!0,"aria-label":to,onClick:()=>t?.(),children:Fa}):null]})}function Nl({entry:e,replacedAt:t,target:n,isNew:r=!1}){let i=ro(e.markedAt),a=Ja(e);return(0,Q.jsxs)(`li`,{"data-history-entry":!0,"data-mark-id":e.markId,"data-history-active":String(e.active),"data-history-new":r?`true`:void 0,className:X(`space-y-1 rounded-md border px-3 py-2 text-xs`,!e.active&&`text-muted-foreground`),children:[(0,Q.jsxs)(`div`,{className:`flex items-baseline justify-between gap-2`,children:[(0,Q.jsxs)(`span`,{className:`min-w-0 break-words`,children:[n===void 0?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`span`,{"data-history-target":!0,children:(0,Q.jsx)(Al,{parts:n})}),` · `]}),(0,Q.jsx)(`span`,{className:`font-medium`,children:di[e.kind]})]}),i===void 0?null:(0,Q.jsx)(`time`,{dateTime:new Date(e.markedAt).toISOString(),className:`shrink-0 tabular-nums text-muted-foreground`,children:i})]}),(0,Q.jsx)(`p`,{className:e.active?`font-medium text-foreground`:void 0,children:e.active?Wa:Ga(t)}),e.note===void 0?null:(0,Q.jsxs)(`p`,{className:`break-words`,children:[`“`,e.note,`”`]}),(0,Q.jsxs)(`p`,{"data-history-disposition":!0,"data-history-applied":a?.kind,className:`break-words`,children:[(0,Q.jsx)(`span`,{"data-history-disposition-lead":!0,children:oa(e.disposition)}),a===void 0?null:(0,Q.jsx)(Pl,{applied:a,drafted:e.disposition.kind===`drafted`})]})]})}function Pl({applied:e,drafted:t}){switch(e.kind){case`knowledge`:return(0,Q.jsxs)(Q.Fragment,{children:[`: `,e.records.map((e,t)=>(0,Q.jsxs)(`span`,{"data-history-applied-record":e.recordId,children:[t===0?null:`; `,e.content===void 0?qa(e.recordId):(0,Q.jsxs)(Q.Fragment,{children:[`“`,e.content,`”`]})]},e.recordId))]});case`test-file`:return(0,Q.jsxs)(Q.Fragment,{children:[`: `,(0,Q.jsx)(`code`,{className:`font-mono`,children:e.filePath})]});case`unavailable`:return(0,Q.jsx)(Q.Fragment,{children:`; ${t?Xa:Ya}`});default:return e}}var Fl=[`w-full`,`w-5/6`,`w-2/3`,`w-3/4`];function Il({state:e,current:t,read:n,updating:r=!1,replacesTime:i,alreadyMarkedTime:a,timeFor:o,failure:s,onRetry:c}){let l=(0,Z.useId)();return(0,Q.jsxs)(`section`,{"data-feedback-preview":!0,"data-preview-state":e,"data-preview-current":String(t),"aria-labelledby":l,"aria-busy":e===`loading`||r,className:`space-y-2`,children:[(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-baseline gap-2`,children:[(0,Q.jsx)(`h3`,{id:l,className:`text-sm font-medium`,children:Xi}),r?(0,Q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:la}):null]}),e===`idle`?(0,Q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:ua}):e===`loading`?(0,Q.jsx)(`div`,{className:`space-y-2`,children:Fl.map(e=>(0,Q.jsx)(W,{className:X(`h-4 motion-reduce:animate-none`,e)},e))}):(0,Q.jsx)(`div`,{className:X(r&&`opacity-60`),children:e===`consequences`&&n?.kind===`consequences`?(0,Q.jsx)(zl,{read:n,replacesTime:i??(n.latest.kind===`supersedes`?o?.(n.latest.markId):void 0)}):e===`quarantined`&&n?.kind===`quarantined`?(0,Q.jsx)(`div`,{"data-preview-line":`quarantined`,className:Ll,children:Ea(n.class)}):e===`already-marked`&&n?.kind===`already-marked`?(0,Q.jsx)(`div`,{"data-preview-line":`already-marked`,className:Ll,children:Da(a??o?.(n.prior.markId))}):e===`refused`&&n!==void 0&&ka(n)?(0,Q.jsx)(`div`,{"data-preview-refusal":n.kind,children:(0,Q.jsx)(kl,{neutralReason:Aa(n)})}):e===`failed`&&s!==void 0?(0,Q.jsx)(Rl,{failure:s,onRetry:c}):null})]})}var Ll=`rounded-md bg-muted/40 px-3 py-2 text-xs`;function Rl({failure:e,onRetry:t}){return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsx)(kl,{neutralReason:Na(Ma(e))}),(0,Q.jsx)(q,{variant:`outline`,size:`sm`,"data-feedback-preview-retry":!0,"aria-label":Ia,onClick:()=>t?.(),children:Fa}),(0,Q.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[Pa.prefix,(0,Q.jsx)(`span`,{className:`font-mono`,children:Pa.name}),Pa.suffix]})]})}function zl({read:e,replacesTime:t}){let{knowledge:n,draft:r,latest:i}=e;return(0,Q.jsxs)(`div`,{className:`space-y-2`,children:[(0,Q.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-2 text-xs`,children:[(0,Q.jsx)(`dt`,{className:`font-medium text-muted-foreground`,children:da.knowledge}),(0,Q.jsxs)(`dd`,{"data-preview-line":`knowledge`,className:`space-y-1 break-words text-foreground`,children:[(0,Q.jsx)(`p`,{children:fa(n.evidence,n.records.length)}),n.records.length===0?null:(0,Q.jsxs)(j,{children:[(0,Q.jsxs)(A,{className:`group flex items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,Q.jsx)(K,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),pa(n.records.length)]}),(0,Q.jsx)(p,{children:(0,Q.jsx)(`ul`,{className:`mt-2 space-y-2`,children:n.records.map(e=>(0,Q.jsx)(Bl,{record:e},e.recordId))})})]})]}),(0,Q.jsx)(`dt`,{className:`font-medium text-muted-foreground`,children:da.change}),(0,Q.jsxs)(`dd`,{"data-preview-line":`change`,className:`space-y-1 break-words text-foreground`,children:[(0,Q.jsx)(`p`,{children:ya(r)}),xa(r)?(0,Q.jsx)(`p`,{className:`text-muted-foreground`,children:ba}):null]})]}),i.kind===`supersedes`?(0,Q.jsx)(`p`,{"data-preview-line":`replaces`,className:`text-xs text-foreground`,children:Sa(i.ordinal,t)}):null]})}function Bl({record:e}){return(0,Q.jsxs)(`li`,{"data-preview-record":e.evidence.kind===`unreadable`?`unreadable`:e.served?`served`:`unserved`,className:`space-y-0.5 break-words`,children:[(0,Q.jsx)(`p`,{className:`text-foreground`,children:e.recordContent===void 0?e.contentAbsence===void 0?null:_a[e.contentAbsence.reason]:e.recordContent.content}),(0,Q.jsx)(`p`,{className:`text-muted-foreground`,children:ga(e)})]})}function Vl({kind:e,address:t,testId:n,recordIds:r=[],basis:i}){let a=[];return e!==void 0&&a.push([`kind`,e]),a.push([`address`,t]),n&&a.push([`testId`,n]),r.length>0&&a.push([`records`,r.join(`, `)]),i!==void 0&&a.push([`basis`,za(i)]),(0,Q.jsxs)(j,{className:`mt-6`,children:[(0,Q.jsxs)(A,{className:`group flex w-full items-center gap-1.5 text-left text-xs font-medium text-muted-foreground hover:text-foreground`,children:[(0,Q.jsx)(K,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),La]}),(0,Q.jsx)(p,{children:(0,Q.jsx)(`div`,{"data-feedback-technical":!0,className:`mt-2 rounded-md bg-muted/40 px-3 py-2`,children:(0,Q.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-xs`,children:a.map(([e,t])=>(0,Q.jsxs)(Z.Fragment,{children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:Ra[e]}),(0,Q.jsx)(`dd`,{"data-technical-row":e,className:`font-mono break-all select-text`,children:t})]},e))})})})]})}function Hl({parts:e}){return(0,Q.jsxs)(Q.Fragment,{children:[e.prefix,e.name,e.suffix]})}function Ul({composerId:e,headingId:t,heading:n,scopeLine:r,state:i,scope:a,target:o,outcomeClass:s,selected:c,onChoose:l,noUniqueAddress:u=!1,testSwitcher:d,pinned:f,unsentDrafts:p=[],note:m=``,onNoteChange:h,previewState:g,previewCurrent:_,previewRead:v,previewUpdating:y=!1,previewReplacesTime:b,previewAlreadyMarkedTime:x,timeFor:S,history:C,previewFailure:w,onPreviewRetry:T,stepCount:ee=0,testId:E,onShowStep:D,submitReason:O,onSubmit:k,status:A,denial:j,headingRef:M,onClose:N,layout:te=`docked`}){let P=(0,Z.useId)(),F=`${P}-submit-reason`,I=`${P}-test-switcher`,L=`${P}-note`,ne=(0,Z.useRef)(null),R=C?.newMarkId,re=C?.read;(0,Z.useEffect)(()=>{if(R===void 0)return;let e=ne.current?.querySelector(`[data-history-new]`),t=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1;e?.scrollIntoView({block:`nearest`,behavior:t?`auto`:`smooth`})},[R,re]);let z=O!==``,B=fi[s],ie=a===`test`&&c!==void 0&&g!==`idle`&&!_,V=a===`test`&&c!==void 0&&_&&(v?.kind===`consequences`||v?.kind===`quarantined`)?v.resolvedStep:void 0,ue=_&&(v?.kind===`consequences`||v?.kind===`quarantined`)?v:void 0,de=V===void 0||c===void 0?void 0:Ca(V.reason,c,V.stepIndex+1,ee);return(0,Q.jsxs)(`section`,{id:e,"aria-labelledby":t,"data-feedback-composer":!0,"data-feedback-state":i,"data-feedback-scope":a,"data-feedback-target":o,"data-feedback-layout":te,className:`flex h-full min-h-0 flex-col`,onKeyDown:e=>{e.stopPropagation(),e.key===`Escape`&&!e.defaultPrevented&&N()},children:[(0,Q.jsxs)(`div`,{className:`shrink-0 space-y-1 border-b px-3 py-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(`h2`,{id:t,ref:M,tabIndex:-1,className:`min-w-0 flex-1 break-words text-base font-medium leading-snug`,children:(0,Q.jsx)(Hl,{parts:n})}),(0,Q.jsxs)(ze,{children:[(0,Q.jsx)(Y,{asChild:!0,children:(0,Q.jsx)(q,{variant:`ghost`,size:`icon-sm`,"data-feedback-close":!0,"aria-label":$i,onClick:N,children:(0,Q.jsx)(Ct,{className:`h-3.5 w-3.5`,"aria-hidden":`true`})})}),(0,Q.jsx)(Le,{side:`bottom`,children:ea})]})]}),(0,Q.jsx)(`p`,{"data-feedback-scope-line":!0,className:`break-words text-xs text-muted-foreground`,children:(0,Q.jsx)(Hl,{parts:r})}),d===void 0?null:(0,Q.jsxs)(`div`,{className:`space-y-1 pt-1`,children:[(0,Q.jsx)(Ee,{htmlFor:I,className:`text-xs font-medium`,children:Ai}),(0,Q.jsxs)(le,{value:String(d.value),onValueChange:e=>{let t=d.options.find(t=>String(t.testIndex)===e);t!==void 0&&d.onChange(t.testIndex)},children:[(0,Q.jsx)(oe,{id:I,className:`w-full h-8 text-xs`,"data-feedback-test-switcher":!0,children:(0,Q.jsx)(ae,{})}),(0,Q.jsx)(se,{children:d.options.map(e=>(0,Q.jsx)(ce,{value:String(e.testIndex),children:e.label},e.testIndex))})]})]})]}),(0,Q.jsxs)(`div`,{ref:ne,className:`min-h-0 flex-1 space-y-4 overflow-y-auto px-3 py-4`,children:[f===void 0&&p.length===0?null:(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[f===void 0?null:(0,Q.jsxs)(`div`,{"data-feedback-pinned":!0,role:`note`,className:`rounded-md bg-muted/40 px-3 py-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(`p`,{children:f.text}),(0,Q.jsx)(q,{variant:`ghost`,size:`xs`,"data-feedback-switch":!0,className:`-ml-2 mt-1`,onClick:f.onSwitch,children:f.switchLabel})]}),p.map(e=>(0,Q.jsx)(q,{variant:`ghost`,size:`xs`,"data-feedback-unsent-draft":e.address,className:`text-muted-foreground hover:text-foreground`,onClick:e.onOpen,children:e.label},e.address))]}),u?(0,Q.jsx)(`div`,{"data-feedback-no-address":!0,children:(0,Q.jsx)(kl,{neutralReason:ji})}):null,(0,Q.jsxs)(`fieldset`,{className:`space-y-2`,children:[(0,Q.jsx)(`legend`,{className:`text-xs font-medium text-muted-foreground`,children:pi}),(0,Q.jsx)(je,{className:`gap-2`,"data-feedback-choices":!0,"data-feedback-outcome-class":s,value:c??``,onValueChange:e=>{let t=B.find(t=>t===e);t!==void 0&&l(t)},children:B.map((e,t)=>{let n=`${P}-${e}`,r=`${n}-meaning`;return(0,Q.jsxs)(Ee,{htmlFor:n,"data-feedback-choice":e,"data-choice-position":t+1,className:`flex items-start gap-2 rounded-md border px-3 py-2 font-normal leading-normal cursor-pointer hover:bg-muted/40 has-[[data-state=checked]]:border-primary/60 has-[[data-state=checked]]:bg-primary/5`,children:[(0,Q.jsx)(Ae,{id:n,value:e,"aria-describedby":r,className:`mt-0.5`}),(0,Q.jsxs)(`span`,{className:`min-w-0 space-y-1`,children:[(0,Q.jsx)(`span`,{className:`block text-sm font-medium leading-normal`,children:di[e]}),(0,Q.jsx)(`span`,{id:r,className:`block text-xs text-muted-foreground`,children:mi[s][e]})]})]},e)})})]}),ie?(0,Q.jsx)(W,{"data-feedback-resolved-step-pending":!0,className:`h-4 w-3/4 motion-reduce:animate-none`}):V!==void 0&&de!==void 0?(0,Q.jsxs)(`div`,{"data-feedback-resolved-step":!0,"data-resolved-reason":V.reason,className:`flex flex-wrap items-center gap-x-2 text-xs`,children:[(0,Q.jsx)(`p`,{className:`break-words`,children:de}),(0,Q.jsx)(q,{variant:`ghost`,size:`xs`,"data-feedback-show-step":!0,onClick:()=>D?.(V.stepIndex),children:wa(V.stepIndex+1)})]}):null,(0,Q.jsxs)(`div`,{className:`space-y-1`,children:[(0,Q.jsx)(Ee,{htmlFor:L,className:`text-xs font-medium`,children:ci}),(0,Q.jsx)(fe,{id:L,"data-feedback-note":!0,maxLength:li,value:m,onChange:e=>h?.(e.target.value),className:`max-h-40 overflow-y-auto`}),m.length>=1800?(0,Q.jsx)(`p`,{"aria-live":`off`,className:`text-xs text-muted-foreground tabular-nums`,children:ui(m.length)}):null]}),(0,Q.jsx)(Il,{state:g,current:_,read:v,updating:y,replacesTime:b,alreadyMarkedTime:x,timeFor:S,failure:w,onRetry:T}),C===void 0?null:(0,Q.jsx)(`div`,{className:`mt-6 border-t pt-6`,children:(0,Q.jsx)(jl,{scope:a,address:o,...C})}),(0,Q.jsx)(Vl,{kind:c,address:o,testId:E,recordIds:ue?.kind===`consequences`?ue.knowledge.records.map(e=>e.recordId):void 0,basis:ue?.basis})]}),(0,Q.jsxs)(`div`,{className:`shrink-0 space-y-2 border-t px-3 py-2`,children:[j===void 0?null:(0,Q.jsx)(`div`,{"data-feedback-denied":!0,role:`alert`,children:(0,Q.jsx)(kl,{neutralReason:j.reason})}),(0,Q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,Q.jsx)(q,{size:`sm`,"data-feedback-submit":!0,"aria-disabled":z,"aria-describedby":F,className:`aria-disabled:cursor-not-allowed aria-disabled:opacity-50`,onClick:()=>{z||k()},children:Yi}),(0,Q.jsx)(`p`,{id:F,"data-feedback-submit-reason":!0,className:`text-xs text-muted-foreground`,children:O})]}),(0,Q.jsx)(`p`,{"data-feedback-status":!0,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`text-xs text-muted-foreground`,children:A})]})]})}var Wl={state:`composing`,status:``};function Gl(e){let[t,n]=e.split(`:`);return n===`run`?{testIndex:Number(t)}:{testIndex:Number(t),stepIndex:Number(n)}}function Kl({runId:e,runStatus:t,detail:n,onMark:r,markPending:i,selectedStep:a,memberFilter:o,markDenial:s,reloadDetail:c,setSelection:l,beforeOpen:u}){let d=(0,Z.useId)(),f=`${d}-feedback`,p=`${d}-feedback-heading`,[m,h]=(0,Z.useState)(!1),[g,_]=(0,Z.useState)(null),[v,y]=(0,Z.useState)(()=>new Map),[b,x]=(0,Z.useState)(),S=(0,Z.useRef)(void 0),[C,T]=(0,Z.useState)(!1),[ee,E]=(0,Z.useState)(()=>new Map),[D,O]=(0,Z.useState)(()=>new Map),[k,A]=(0,Z.useState)(0),j=(0,Z.useRef)(null),M=(0,Z.useRef)(null),N=(0,Z.useRef)(0),[te,P]=(0,Z.useState)(),F=(0,Z.useRef)(0),I=(0,Z.useRef)(void 0),L=(0,Z.useRef)(void 0),ne=(0,Z.useRef)(e),R=(0,Z.useRef)(n);(0,Z.useEffect)(()=>{R.current=n},[n]),(0,Z.useEffect)(()=>{k>0&&j.current?.focus()},[k]),(0,Z.useEffect)(()=>{s!==void 0&&O(e=>new Map(e).set(ni(s),{reason:s.reason}))},[s]),(0,Z.useEffect)(()=>(ne.current=e,N.current+=1,F.current+=1,P(void 0),clearTimeout(I.current),L.current=void 0,M.current=null,h(!1),_(null),y(new Map),x(void 0),S.current=void 0,T(!1),E(new Map),O(new Map),()=>{N.current+=1,F.current+=1,clearTimeout(I.current)}),[e]);let re=()=>{let e=ne.current;if(e===void 0)return;let t=++F.current;Fe(e).then(n=>{F.current!==t||ne.current!==e||P(n)})},z=g===null?void 0:ni(g),B=(z===void 0?void 0:v.get(z))??ti,{state:V,status:ae}=(z===void 0?void 0:ee.get(z))??Wl,oe=V===`submitting`,se=(e,t)=>E(n=>new Map(n).set(e,t)),ce=g===null||B.kind===void 0?``:zi({kind:B.kind,...g}),le=b!==void 0&&b.address===z?b:void 0,ue=le===void 0?void 0:le.read.kind===`read`?le.read.result.kind:`failed`,de=le!==void 0&&ce!==``&&le.key===ce,fe=g===null||Mi(n,g.testIndex),pe=fe?ca({kind:B.kind,landed:le?.read}):`idle`,me=le?.read.kind===`failed`?le.read.reason:void 0,he=pe!==`idle`&&pe!==`loading`&&!de||C&&pe===`failed`,ge=Ji({noUniqueAddress:!fe,kind:B.kind,currentKey:ce,landedKey:le?.key,landedOutcome:ue,inFlight:i||V===`submitting`}),_e=(e,t,n=300)=>{clearTimeout(I.current),T(!1);let r=++N.current,i=zi({kind:t,...e});if(S.current=i,!Mi(R.current,e.testIndex))return;let a=()=>{if(N.current!==r)return;let n=ne.current,a=R.current?.members.find(t=>t.testIndex===e.testIndex);if(n===void 0||a===void 0)return;let o=ni(e);wt(n,Ri(a,e,t)).then(e=>{N.current!==r||ne.current!==n||(T(!1),x({key:i,address:o,kind:t,read:e}))})};n===0?a():I.current=setTimeout(a,n)},ve=()=>{g===null||B.kind===void 0||oe||(_e(g,B.kind,0),T(!0))};(0,Z.useEffect)(()=>{!m||g===null||B.kind===void 0||oe||S.current!==ce&&_e(g,B.kind)},[m,ce]);let H=(e,t)=>{u?.(),M.current=t,c?.().catch(()=>void 0),re();let n=ni(e);if(z!==n){N.current+=1;let t=v.get(n)?.kind;t===void 0?clearTimeout(I.current):_e(e,t)}_(e),h(!0),A(e=>e+1)},ye=e=>{let t=ni(e);if(V===`submitting`||t===z)return;N.current+=1,_(e),A(e=>e+1),re();let n=v.get(t)?.kind;n===void 0?clearTimeout(I.current):_e(e,n)},be=()=>{h(!1),(M.current?.isConnected?M.current:document.querySelector(`[data-feedback-entry="test"]`)??document.querySelector(`[role="tab"][aria-selected="true"]`))?.focus()},xe=e=>{se(e,Wl)},Se=e=>{z===void 0||oe||(y(t=>new Map(t).set(z,{...t.get(z)??ti,note:e})),xe(z))},Ce=e=>{g===null||z===void 0||oe||(y(t=>new Map(t).set(z,{...t.get(z)??ti,kind:e})),xe(z),_e(g,e))},we=async()=>{if(g===null||z===void 0||B.kind===void 0||ge!==``||L.current)return;let e={},t=g;L.current=e,se(z,{state:`submitting`,status:Zi}),O(e=>{let t=new Map(e);return t.delete(z),t});try{let n=await r(t.testIndex,t.stepIndex,B.kind,B.note||void 0);if(L.current!==e)return;n===`refreshed`?(y(e=>{let t=new Map(e);return t.delete(z),t}),x(void 0),se(z,{state:`recorded`,status:``}),re()):n===`retained`?se(z,{state:`retained`,status:ta}):se(z,Wl)}finally{L.current===e&&(L.current=void 0)}},Te=V!==`recorded`||g===null?void 0:n?.members.find(e=>e.testIndex===g.testIndex)?.marks?.find(e=>e.stepIndex===g.stepIndex),Ee=V===`recorded`?Te===void 0?``:sa(Te.disposition):ae,De=te?.kind===`read`&&te.result.kind===`history`?te.result.entries:[],Oe=e=>ro(De.find(t=>t.markId===e)?.markedAt),ke=g===null?void 0:Oi({detail:n,target:g,runStatus:t}),Ae=n?.members??[],je=g===null||g.stepIndex!==void 0||Ae.length<=1?void 0:{value:g.testIndex,options:Ae.map(e=>({testIndex:e.testIndex,label:`${ie(e)} ${w(e.testIndex)}`})),onChange:e=>ye({testIndex:e})},Me=(n?.members.length??0)>1,Ne=e=>Me?Ae.find(t=>t.testIndex===e)??{testIndex:e}:void 0,U=a,Pe=!(g!==null&&U!==null&&(g.stepIndex===void 0?U.testIndex!==g.testIndex:ni(U)!==z))||g===null||U===null?void 0:{text:ai({stepIndex:U.stepIndex,member:Ne(U.testIndex)},{stepIndex:g.stepIndex,member:Ne(g.testIndex)}),switchLabel:oi(g.stepIndex===void 0?{member:Ne(U.testIndex)}:{stepIndex:U.stepIndex,member:U.testIndex===g.testIndex?void 0:Ne(U.testIndex)}),onSwitch:()=>ye(g.stepIndex===void 0?{testIndex:U.testIndex}:U)},W=e=>({stepIndex:e.stepIndex,member:e.stepIndex!==void 0&&e.testIndex===g?.testIndex?void 0:Ne(e.testIndex)}),Ie=[...v].filter(([e,t])=>e!==z&&!ri(t)).map(([e])=>{let t=Gl(e);return{address:e,label:si(W(t)),onOpen:()=>ye(t)}}),Le=V===`retained`&&z!==void 0?D.get(z):void 0,Re=!m||g===null||z===void 0||ke===void 0?void 0:{composerId:f,headingId:p,heading:ke.heading,scopeLine:ke.scopeLine,state:V,scope:g.stepIndex===void 0?`test`:`step`,target:z,outcomeClass:ke.outcomeClass,selected:B.kind,onChoose:Ce,noUniqueAddress:!fe,testSwitcher:je,pinned:Pe,unsentDrafts:Ie,note:B.note,onNoteChange:Se,previewState:pe,previewCurrent:de,previewRead:le?.read.kind===`read`?le.read.result:void 0,previewUpdating:he,previewFailure:me,onPreviewRetry:ve,timeFor:Oe,history:{read:te,detail:n,newMarkId:Te?.markId,onRetry:re},stepCount:ke.stepCount,testId:Ae.find(e=>e.testIndex===g.testIndex)?.testId,onShowStep:e=>{l?.({type:`step`,stepId:Zn(g.testIndex,e)})},submitReason:ge,onSubmit:()=>{we()},status:Ee,denial:Le,headingRef:j,onClose:be},ze=ki({detail:n,selectedStep:a,memberFilter:o,runStatus:t}),Be=ze===void 0?void 0:n?.members.find(e=>e.testIndex===ze.testIndex),Ve=Be?.marks?.find(e=>e.stepIndex===void 0),He=ze===void 0||Be?.marks===void 0?void 0:{label:na({scope:`test`,...Me?{memberName:ie(Be),handle:w(Be.testIndex)}:{},...Ve===void 0?{}:{markedChoice:Ve.kind}}),target:ni(ze),marked:Ve!==void 0,expanded:m&&g?.stepIndex===void 0,controls:f,onOpen:e=>H(ze,e)},Ue=(e,t,n)=>H({testIndex:e,stepIndex:t},n);return{open:m,target:g,composerId:f,openFeedback:H,openStepFeedback:Ue,retarget:ye,composer:Re,headerEntry:He,tree:{composerId:f,expandedAddress:m&&g?.stepIndex!==void 0?z:void 0,onOpenStep:Ue}}}function ql({runId:e,sha:t,open:n,onOpenChange:r,returnFocus:i}){let a=(0,Z.useRef)(null);return(0,Q.jsx)(bt,{open:n,onOpenChange:r,children:(0,Q.jsxs)(Tt,{"data-player-lightbox":!0,showCloseButton:!1,className:`sm:max-w-4xl`,onOpenAutoFocus:()=>{a.current=i??(document.activeElement instanceof HTMLElement?document.activeElement:null)},onCloseAutoFocus:e=>{e.preventDefault(),a.current?.focus()},children:[(0,Q.jsx)(jt,{className:`pr-8 text-sm font-medium`,children:nc.lightboxTitle}),(0,Q.jsx)(dc,{runId:e,frame:{id:`decision-screenshot:${t}`,sha:t}},`${e}:${t}`),(0,Q.jsx)(xt,{className:`py-8 text-xs`,children:nc.lightboxNote}),(0,Q.jsx)(Dt,{asChild:!0,children:(0,Q.jsx)(q,{size:`icon-sm`,variant:`ghost`,className:`absolute right-4 top-4`,"aria-label":nc.lightboxClose,children:(0,Q.jsx)(Ct,{className:`h-4 w-4`})})})]})})}function Jl(e,t,n){let r=0,i;for(let a of e.members){a.model.testIndex===n&&(i=r);let e=t.get(a.model.testIndex);r=r!==void 0&&e!==void 0&&Number.isFinite(e)&&e>0?r+e:void 0}return{offsetMs:i,totalMs:r}}function Yl(e){let t=e.map(Zs),n=t.length>0&&t.every(e=>e.axis===`time`),r=t.map(e=>n?e.extent:Math.max(1,e.segments.reduce((e,t)=>e+Math.max(1,t.subActions.length),0))),i=r.reduce((e,t)=>e+t,0),a=0,o=0,s=e.map((n,o)=>{let s=i===0?o/e.length:a/i;a+=r[o];let c=i===0?(o+1)/e.length:a/i;return{group:n,model:t[o],start:s,end:c,label:`${w(n.member.testIndex)} · ${ie(n.member)}`}}),c=s.flatMap(e=>e.model.segments.map(t=>({...t,start:e.start+t.start*(e.end-e.start),end:e.start+t.end*(e.end-e.start),markers:t.markers.map(t=>({...t,ordinal:++o,position:e.start+t.position*(e.end-e.start)}))})));return{testIndex:t[0]?.testIndex??0,axis:n?`time`:`ordinal`,extent:i,members:s,segments:c,markers:c.flatMap(e=>e.markers),playhead:t[0]?.playhead??null}}function Xl(e,t,n){let r=Math.max(0,Math.min(1,t)),i=n&&e.members.find(e=>e.model.testIndex===n.testIndex)||e.members.find(e=>r<e.end)||e.members.at(-1);if(!i)return;let a=i.end===i.start?0:Math.max(0,Math.min(1,(r-i.start)/(i.end-i.start))),o=i.model.markers;return{member:i,playhead:o.filter(e=>e.position<=a).at(-1)??o[0]??i.model.playhead,localFraction:i.model.axis===`time`?a:void 0}}function Zl(e,t,n){let r=e.members.find(e=>e.model.testIndex===t);if(!r||r.model.axis!==`time`||!Number.isFinite(n))return;let i=r.model.extent===0?0:Math.max(0,Math.min(1,n*1e3/r.model.extent));return r.start+i*(r.end-r.start)}var Ql={slider:`Test timeline`,signals:`Step signals`,results:s};function $l(e,t){let n=tc(e.recordingOffsetMs);return`Step ${e.stepIndex+1}, sub-action ${e.ordinal} of ${t}: ${i(a(e.subAction))}, ${s[e.result]}${n===void 0?``:`, ${n}`}`}function eu({model:e,playhead:t,source:n,memberLabel:i,seekFraction:o,observedPosition:s,mediaDurationsReady:c,onPlayheadChange:l,onSeekFraction:d}){let f=(0,Z.useRef)(null),[p,m]=(0,Z.useState)(320),[h,g]=(0,Z.useState)(null),_=e.members;(0,Z.useEffect)(()=>{let e=f.current;if(!e)return;let t=()=>{e.clientWidth>0&&m(e.clientWidth)};t();let n=new ResizeObserver(t);return n.observe(e),()=>n.disconnect()},[]);let v=(0,Z.useRef)(null),y=(0,Z.useRef)(null),b=e.markers.find(e=>e.testIndex===t?.testIndex&&e.stepIndex===t.stepIndex&&e.subActionIndex===t.subActionIndex),x=s??o,S=n===`video`&&x!==void 0?Math.max(0,Math.min(1,x)):b?.position;function C(e){l({testIndex:e.testIndex,stepIndex:e.stepIndex,subActionIndex:e.subActionIndex})}function w(t){let r=f.current.getBoundingClientRect();if(r.width<=0)return;let i=Math.max(0,Math.min(r.width,t-r.left)),a=e.markers.map(e=>({marker:e,centrePx:e.position*r.width})),o=n===`frames`?Qs(i,a):$s(i,a);if(o)C(o),n===`video`&&d(o.position,o);else if(n===`video`){let t=i/r.width,n=e.markers.filter(e=>e.position<=t).at(-1)??e.markers[0];n&&!_&&C(n),d(t)}}function T(e,t,n){e.button===0&&(e.preventDefault(),e.stopPropagation(),v.current?.focus({preventScroll:!0}),y.current={pointerId:e.pointerId,startX:e.clientX,moved:!1,group:n},f.current.setPointerCapture(e.pointerId),t?M(t):n===void 0&&w(e.clientX))}function ee(e){let t=y.current;t?.pointerId===e.pointerId&&(y.current=null,e.type===`pointerup`&&t.group!==void 0&&!t.moved&&g(e=>e===t.group?null:t.group),e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))}function E(t){let r=b?e.markers.indexOf(b):-1,i;switch(t.key){case`ArrowLeft`:i=e.markers[Math.max(0,r-1)];break;case`ArrowRight`:i=e.markers[Math.min(e.markers.length-1,r+1)];break;case`Home`:i=e.markers[0];break;case`End`:i=e.markers.at(-1);break;case`PageUp`:i=e.segments.slice(0,e.segments.findIndex(e=>b&&e.markers.includes(b))).filter(e=>e.markers.length>0).at(-1)?.markers[0];break;case`PageDown`:i=e.segments.slice(e.segments.findIndex(e=>b&&e.markers.includes(b))+1).find(e=>e.markers.length>0)?.markers[0];break;default:return}t.preventDefault(),t.stopPropagation(),i&&(C(i),n===`video`&&d(i.position,i))}let D=[],O=e=>e.position*p;for(let t of e.markers){let e=D.at(-1);e&&O(t)-O(e[0])<28?e.push(t):D.push([t])}let k=S??b?.position??0,A=D.find(e=>Math.abs(e[0].position-k)*p<=10),j=e=>{let t=_?.find(t=>t.model.testIndex===e.testIndex);return`${t?`${t.label}, `:``}Step ${e.stepIndex+1}`},M=e=>{C(e),n===`video`&&d(e.position,e),g(null)};return e.markers.length===0&&!_?.length?null:(0,Q.jsx)(`div`,{"data-timeline":!0,"data-timeline-axis":e.axis,"data-timeline-member":_?`suite`:e.testIndex,"data-media-durations-ready":c,className:`min-w-0 flex-1 px-5 py-1`,children:(0,Q.jsxs)(`div`,{ref:f,"data-timeline-track":!0,className:`relative h-7 touch-none cursor-pointer`,onPointerDown:e=>T(e),onPointerMove:e=>{let t=y.current;t?.pointerId===e.pointerId&&(Math.abs(e.clientX-t.startX)>3&&(t.moved=!0),(t.group===void 0||t.moved)&&w(e.clientX))},onPointerUp:ee,onPointerCancel:ee,onLostPointerCapture:()=>{y.current=null},children:[(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`absolute inset-x-0 top-3 h-1 rounded-full bg-muted`}),_?.map(e=>(0,Q.jsx)(`span`,{"data-timeline-member-span":e.model.testIndex,className:`absolute top-3 h-1 border-l border-background ${e.group.member.recording?.state===`present`?``:`bg-muted-foreground/30`}`,style:{left:`${e.start*100}%`,width:`${(e.end-e.start)*100}%`}},e.model.testIndex)),(b||S!==void 0)&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(`div`,{"aria-hidden":`true`,className:`absolute left-0 top-3 h-1 rounded-full bg-primary/50`,style:{width:`${k*100}%`}}),(0,Q.jsx)(`span`,{ref:v,"data-timeline-playhead":!0,role:`slider`,tabIndex:0,"aria-label":i?`${Ql.slider}: ${i}`:Ql.slider,"aria-orientation":`horizontal`,onKeyDown:E,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round((S??0)*100),"aria-valuetext":b?$l(b,e.markers.length):`No actions recorded for this test`,style:{left:`${k*100}%`},"data-playhead-circle":A?!0:void 0,className:`pointer-events-none absolute z-10 -translate-x-1/2 rounded-full ${A?`top-1 h-5 w-5 bg-transparent`:`top-[5px] h-[18px] w-1.5 bg-primary`} focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring`})]}),D.map(t=>{let n=t[0],i=a(n.subAction).family,o=i?r[i]:u,s={left:`${n.position*100}%`},c=t===A||!A&&t.some(e=>e===b),l=`absolute top-0 flex h-7 w-7 -translate-x-1/2 items-center justify-center rounded-full focus-visible:outline-2 focus-visible:outline-ring`,d=`flex h-5 w-5 items-center justify-center rounded-full border ${c?`border-primary bg-primary text-primary-foreground`:`border-muted-foreground/30 bg-background text-muted-foreground hover:bg-muted`}`;return t.length===1?(0,Q.jsx)(`button`,{type:`button`,"data-timeline-marker":n.ordinal,"data-timeline-active":c||void 0,"aria-current":c?`step`:void 0,style:s,className:l,"aria-label":`${j(n)}: ${$l(n,e.markers.length)}`,onPointerDown:e=>T(e,n),onClick:e=>{e.detail===0&&M(n)},children:(0,Q.jsx)(`span`,{"data-timeline-circle":!0,className:d,children:(0,Q.jsx)(o,{"aria-hidden":`true`,className:`h-3 w-3`})})},n.ordinal):(0,Q.jsxs)(ke,{open:h===n.ordinal,onOpenChange:e=>g(e?n.ordinal:null),children:[(0,Q.jsx)(Oe,{asChild:!0,children:(0,Q.jsx)(`button`,{type:`button`,"data-timeline-marker-group":!0,"data-timeline-active":c||void 0,"aria-current":c?`step`:void 0,style:s,className:l,"aria-label":`Choose from ${t.length} nearby actions`,onPointerDown:e=>T(e,void 0,n.ordinal),onClick:e=>{e.detail>0&&e.preventDefault()},children:(0,Q.jsx)(`span`,{"data-timeline-circle":!0,className:d,children:(0,Q.jsx)(dr,{"aria-hidden":`true`,className:`h-3 w-3`})})})}),(0,Q.jsx)(De,{className:`max-h-64 w-80 overflow-y-auto p-1`,"aria-label":`Nearby actions`,onPointerDown:e=>e.stopPropagation(),onCloseAutoFocus:e=>{document.activeElement!==document.body&&e.preventDefault()},children:t.map(e=>(0,Q.jsxs)(`button`,{type:`button`,"data-timeline-marker":e.ordinal,className:`block w-full rounded p-2 text-left hover:bg-muted`,onClick:()=>M(e),children:[(0,Q.jsx)(`span`,{className:`text-xs`,children:j(e)}),(0,Q.jsx)(ys,{sub:e.subAction})]},e.ordinal))})]},n.ordinal)}),_?.filter(e=>e.model.markers.length===0).map(e=>(0,Q.jsx)(`button`,{type:`button`,"data-timeline-empty-member":e.model.testIndex,"aria-label":`${e.label}: No actions recorded`,className:`absolute top-0 flex h-7 w-7 -translate-x-1/2 items-center justify-center rounded-full focus-visible:outline-2 focus-visible:outline-ring`,style:{left:`${(e.start+e.end)*50}%`},onPointerDown:e=>T(e),onClick:t=>{t.detail===0&&d((e.start+e.end)/2)},children:(0,Q.jsx)(`span`,{"data-timeline-circle":!0,className:`flex h-5 w-5 items-center justify-center rounded-full border border-muted-foreground/30 bg-background`,children:(0,Q.jsx)(H,{"aria-hidden":`true`,className:`h-3 w-3 text-muted-foreground`})})},`empty-${e.model.testIndex}`))]})})}var tu={message:`This run was recorded before evidence was saved. Variables, network, console, ARIA, accessibility and video were not recorded.`,dismiss:`Dismiss notice`};function nu(e){return`agent-qa.run-detail.notice-dismissed:${e}`}function ru(e){return e?.state===`absent`&&e.reason===`unavailable`&&e.evidenceIncomplete!==!0}function iu(e){return e.steps.length>0&&e.steps.every(e=>ru(e.evidence?.variables)&&ru(e.evidence?.network)&&ru(e.evidence?.console)&&ru(e.evidence?.a11y))&&e.subActions.every(e=>ru(e.ariaEvidence))&&e.members.every(e=>ru(e.recording))}function au({runId:e}){let t=nu(e),[n,r]=(0,Z.useState)(()=>{try{return sessionStorage.getItem(t)===`true`}catch{return!1}});return n?null:(0,Q.jsxs)(`div`,{"data-run-notice":!0,role:`status`,className:`flex items-center gap-2 border-b bg-muted/40 px-4 py-2 text-xs text-muted-foreground`,children:[(0,Q.jsx)(lr,{className:`h-4 w-4 shrink-0`,"aria-hidden":`true`}),(0,Q.jsx)(`span`,{className:`min-w-0 flex-1`,children:tu.message}),(0,Q.jsx)(q,{size:`icon-sm`,variant:`ghost`,className:`shrink-0`,"aria-label":tu.dismiss,onClick:()=>{r(!0);try{sessionStorage.setItem(t,`true`)}catch{}},children:(0,Q.jsx)(Ct,{className:`h-4 w-4`,"aria-hidden":`true`})})]})}var ou=[`overview`,`env`,`network`,`console`,`aria`,`a11y`,`knowledge`];function su(e){let t=e.get(`tab`);return ou.find(e=>e===t)??`overview`}function cu(e,t){let n=t.get(`step`),r=t.get(`sub`);if(n){let t=e.find(e=>e.id===n);if(t){if(r!=null){let e=/^\d+$/.test(r)?Number(r):NaN;return!Number.isSafeInteger(e)||!t.subActions?.some(t=>t.subActionIndex===e)?null:{type:`subaction`,stepId:t.id,subIndex:e}}return{type:`step`,stepId:t.id}}}return e.length>0?{type:`step`,stepId:e[0].id}:null}function lu(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=n.top+12,a=n.bottom-12;if(r.top>=i&&r.bottom<=a)return;let o=r.top<i?e.scrollTop+(r.top-i):e.scrollTop+(r.bottom-a),s=Math.max(0,o);if(typeof e.scrollTo==`function`){e.scrollTo({top:s,behavior:`smooth`});return}e.scrollTop=s}function uu(e){return!(e.target instanceof Element)||e.target.closest(`button, [role="tablist"], [role="radiogroup"], [role="tree"], [role="dialog"]:not([data-state="closed"]), dialog[open]`)!==null}function du(){let{id:e}=pt(),t=ut(),n=Mt(dt().state),[r,i]=it(),a=Nt()?.recordRunDetailStatus,[o,s]=(0,Z.useState)(null);zt(o?`Run - ${o.name}`:`Run`),ge(ve(o?.status));let[c,l]=(0,Z.useState)(void 0),[u,d]=(0,Z.useState)(),[f,m]=(0,Z.useState)(!1),h=(0,Z.useRef)(void 0),g=(0,Z.useRef)(0),v=(0,Z.useRef)(e);(0,Z.useEffect)(()=>(g.current+=1,v.current=e,h.current=void 0,m(!1),d(void 0),l(void 0),()=>{v.current=void 0,g.current+=1}),[e]);let y=(0,Z.useCallback)(async(t=g.current)=>{if(!e)return;let n=await at(e);if(!(v.current!==e||g.current!==t))return n.runId===e&&l(n),n},[e]),x=(0,Z.useCallback)(async(t,n,r,i)=>{if(!e||c?.runId!==e)return`stale`;if(h.current)return`retained`;let a=c.members.find(e=>e.testIndex===t);if(a?.marks===void 0)return`retained`;let o={testIndex:t,...n===void 0?{}:{stepIndex:n}};if(c.members.length>1&&(!a.testId||c.members.filter(e=>e.testId===a.testId).length!==1))return d({...o,reason:`This member has no unique mark address.`}),`retained`;let s={},l=g.current,u=()=>v.current===e&&g.current===l&&h.current===s;h.current=s,m(!0),d(void 0);try{let s=await yt(e,{kind:r,...a.testId?{testId:a.testId}:{},...n===void 0?{}:{stepIndex:n},...i?{note:i}:{}});if(!u())return`stale`;if(s.kind===`marked`||s.kind===`already-marked`){let i=await y(l);if(!u())return`stale`;let c=i?.runId===e?i.members.find(e=>e.testIndex===t&&e.testId===a.testId)?.marks?.find(e=>e.stepIndex===n):void 0;if(c?.markId===s.receipt.markId&&c.ordinal===s.receipt.ordinal&&c.kind===s.receipt.kind&&c.kind===r)return`refreshed`;d({...o,reason:`The matching mark receipt could not be refreshed. Reload this run before trying again.`})}else d({...o,reason:`Mark refused: ${s.kind}.`});return`retained`}catch{return u()?(d({...o,reason:`Could not complete the mark or refresh its receipt. Reload this run before trying again.`}),`retained`):`stale`}finally{u()&&(h.current=void 0,m(!1))}},[e,c,y]),[C,w]=(0,Z.useState)(null),[T,ee]=(0,Z.useState)(0);(0,Z.useEffect)(()=>{if(!C)return;let e=new ResizeObserver(e=>{let t=e[e.length-1];t&&ee(t.contentRect.width)});return e.observe(C),()=>e.disconnect()},[C]);let[E,D]=(0,Z.useState)(!0),[O,k]=(0,Z.useState)(!1),M=(0,Z.useRef)(null),N=(0,Z.useRef)(null),te=(0,Z.useRef)(null),[P,I]=(0,Z.useState)(null),[L,ne]=(0,Z.useState)(null),[R,B]=(0,Z.useState)(),[V,ue]=(0,Z.useState)(0),[de,fe]=(0,Z.useState)(),[pe,me]=(0,Z.useState)(),[he,_e]=(0,Z.useState)(),H=(0,Z.useCallback)(e=>{I(e),me(void 0),_e(void 0),fe(void 0),ne(null),B(void 0)},[]),ye=(0,Z.useCallback)(e=>{let t=Xs(e);Jn(t)&&(I(t),me(void 0),_e(void 0),fe(void 0),ne(e),B(void 0))},[]),[be,xe]=(0,Z.useState)([]),[Se,Ce]=(0,Z.useState)(void 0),[we,Te]=(0,Z.useState)(void 0),[Ee,De]=(0,Z.useState)(void 0),[Oe,ke]=(0,Z.useState)(!1),[Ae,je]=(0,Z.useState)(!1),[Me,Ne]=(0,Z.useState)(`test`),[U,Pe]=(0,Z.useState)(null),[W,Fe]=(0,Z.useState)(null),Le=(0,Z.useRef)(null);(0,Z.useEffect)(()=>{Pe(null)},[e]);let[Re,ze]=(0,Z.useState)(null),[Ve,He]=(0,Z.useState)(!1),[We,Ge]=(0,Z.useState)(null),G=(0,Z.useRef)(null),Ke=(0,Z.useRef)(0),[qe,Je]=(0,Z.useState)(()=>su(r));(0,Z.useEffect)(()=>{o?.status&&a?.(o.status)},[a,o?.status]),(0,Z.useEffect)(()=>{if(e)return Ce(void 0),mt(e,{onRead:Ce})},[e]);let Ye=Se?.kind===`read`?Se.status.chips.analysis:void 0;(0,Z.useEffect)(()=>{De(void 0)},[e]),(0,Z.useEffect)(()=>{if(!e)return;let t=!1;return rt(e).then(n=>{!t&&n.runId===e&&De(n)},()=>{}),()=>{t=!0}},[e,Ye]),(0,Z.useEffect)(()=>{if(!e)return;te.current=null;let i=!1,a=0,o=0,c;async function u(){try{let a=await $e(e);if(i)return;let d=Be(a.run.status);if(d&&n===void 0){t(Rt.runLive(e),{replace:!0});return}s(a.run),d&&o<8&&(o+=1,c=setTimeout(()=>{i||u()},250));try{let e=await y();if(i||e===void 0)return;H(cu(Yn(S(re(e),b(r.get(`member`)))),r))}catch{if(i)return;l(null),H(null)}}catch(e){if(i)return;if(e instanceof Error&&e.message.includes(`404`)){if(a<5){a++,setTimeout(()=>{i||u()},1e3);return}k(!0)}else Lt.error(`Failed to load run`)}finally{i||D(!1)}}return u(),()=>{i=!0,c!==void 0&&clearTimeout(c)}},[e,t,n]),(0,Z.useEffect)(()=>{if(!e||E)return;let t=!1;return Ft(e).then(({logs:e})=>{t||xe(e)}).catch(()=>{}),()=>{t=!0}},[e,E]),(0,Z.useEffect)(()=>{if(!e)return;let t=!1;return Te(void 0),Ie(e).then(e=>{t||Te({kind:`read`,projection:e})}).catch(e=>{t||Te({kind:`unavailable`,error:e instanceof Error?e.message:String(e)})}),()=>{t=!0}},[e]);let Xe=(0,Z.useMemo)(()=>we===void 0?void 0:fn(we),[we]);(0,Z.useEffect)(()=>{G.current=null,Ke.current+=1,ze(null),Ge(null),He(!1)},[o?.id]);let Ze=(0,Z.useCallback)(async()=>{if(!o?.id)return;let e=Ke.current+1;Ke.current=e,He(!0),Ge(null);try{let t=await Ue(o.id);if(Ke.current!==e)return;G.current=o.id,ze(t)}catch(t){if(Ke.current!==e)return;Ge(t instanceof Error?t.message:`Failed to load artifact data`)}finally{Ke.current===e&&He(!1)}},[o?.id]);(0,Z.useEffect)(()=>{!Ae||!o?.id||Ve||We||G.current===o.id&&Re||Ze()},[Ae,We,Ve,Re,Ze,o?.id]);let Qe=(0,Z.useCallback)((e=`test`)=>{Ne(e),je(!0)},[]),et=b(r.get(`member`)),{groups:nt,ready:q,decodedDurations:ot}=Gr((0,Z.useMemo)(()=>c?re(c):[],[c]),e??``),st=(0,Z.useMemo)(()=>S(nt,et),[nt,et]),lt=(0,Z.useMemo)(()=>fs(Ee,Ye,c),[Ee,Ye,c]),ft=(0,Z.useCallback)(()=>{let e=N.current??document,t=e.querySelector(`[data-verdict-block]`)??e.querySelector(`[data-member-toggle][data-member-has-verdict]`)??e.querySelector(`[data-member-toggle]`);if(t===null)return;let n=window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`auto`:`smooth`;t.scrollIntoView({block:`center`,behavior:n}),t.focus({preventScroll:!0})},[]),ht=c?z(c):!1,J=(0,Z.useMemo)(()=>Yn(st),[st]),gt=(0,Z.useMemo)(()=>Jn(P)?J.find(e=>e.id===P.stepId)??null:null,[P,J]),_t=Kl({runId:e,runStatus:o?.status,detail:c,onMark:x,markPending:f,selectedStep:gt?.testIndex!==void 0&>.stepIndex!==void 0?{testIndex:gt.testIndex,stepIndex:gt.stepIndex}:null,memberFilter:et===`all`?void 0:et,markDenial:u,reloadDetail:y,setSelection:H}),vt=_t.composer!==void 0,bt=Ni(T,vt),xt=Ii(bt),St=Ht(),Ct=(0,Z.useRef)(void 0);(0,Z.useEffect)(()=>{if(!vt){Ct.current=void 0;return}if(Ct.current===bt)return;let e=Ct.current===void 0;Ct.current=bt,e||St.current?.setLayout(Li(bt,T))},[vt,bt,T,St]);let Y=(0,Z.useMemo)(()=>{let e=Ys(P);if(!e||!gt)return null;if(L?.testIndex===e.testIndex&&L.stepIndex===e.stepIndex)return L;if(P?.type===`subaction`)return e;let t=nt.find(t=>t.member.testIndex===e.testIndex)?.steps.find(t=>t.step.stepIndex===e.stepIndex);return t?qs(t):null},[P,gt,L,nt]),wt=(0,Z.useMemo)(()=>gt?.subActions?.find(e=>e.subActionIndex===Y?.subActionIndex)??null,[gt,Y]),Tt=st.find(e=>e.member.testIndex===(pe??Y?.testIndex))??st[0],Dt=(0,Z.useMemo)(()=>Tt?Zs(Tt):null,[Tt]),Ot=(0,Z.useMemo)(()=>Yl(st),[st]),kt=Tt?.member.recording,[jt,Pt]=(0,Z.useState)(),It=`${e}:${Tt?.member.testIndex}:${kt?.state}`,X=jt?.member===It?jt.source:oc(kt,Dt?.axis??`ordinal`),Bt=e=>{_e(void 0),fe(void 0),Pt({member:It,source:e})},Vt=e=>{I(Xs(e)),ne(e)},Jt=(t,n)=>{let r=Xl(Ot,t,n);if(!r)return;n??r.playhead?ye(n??r.playhead):(H(null),me(r.member.model.testIndex));let i=r.member.group.member;X===`video`&&Pt({member:`${e}:${i.testIndex}:${i.recording?.state}`,source:`video`}),B(r.localFraction),ue(e=>e+1),fe(t)},Xt=()=>{let t=st.findIndex(e=>e===Tt),n=st[t+1];if(!n){_e(void 0);return}let r=Zs(n),i=r.markers[0]??r.playhead;i?ye(i):(H(null),me(n.member.testIndex));let a=n.member.recording;Pt({member:`${e}:${n.member.testIndex}:${a?.state}`,source:`video`}),B(r.axis===`time`?0:void 0),ue(e=>e+1),_e(a?.state===`present`&&!a.ref.evidenceIncomplete?n.member.testIndex:void 0),fe(Ot.members[t+1]?.start)},Zt=(0,Z.useCallback)(t=>{for(let n of nt){let a=ec(Zs(n),t);if(a){if(!st.includes(n)){Fe(t);let e=new URLSearchParams(r);e.delete(`member`),e.set(`step`,Zn(a.testIndex,a.stepIndex)),e.set(`sub`,String(a.subActionIndex)),e.delete(`tab`),i(e,{replace:!0});return}ye(a),Pt({member:`${e}:${n.member.testIndex}:${n.member.recording?.state}`,source:`frames`}),Je(`overview`);return}}Le.current=document.activeElement instanceof HTMLElement?document.activeElement:null,Pe(t)},[nt,st,r,i,ye,e]);(0,Z.useEffect)(()=>{W&&et===`all`&&(Fe(null),Zt(W))},[W,et,Zt]);let Qt=P?.type===`step`&&!L?Ks(gt?.subActions??[]):void 0,$t=Jn(P)?P.stepId:null,en=(0,Z.useMemo)(()=>be.filter(e=>e.stepId===null&&e.phase===`setup`),[be]),tn=(0,Z.useMemo)(()=>be.filter(e=>e.stepId===null&&e.phase===`teardown`),[be]),nn=(0,Z.useMemo)(()=>be.filter(e=>e.stepId!==null),[be]),rn=(0,Z.useMemo)(()=>P?.type===`hook`?be.find(e=>e.id===P.hookId)??null:null,[P,be]),an=(0,Z.useMemo)(()=>P?.type===`execution`?be.find(e=>e.id===P.logId)??null:null,[P,be]),on=(0,Z.useMemo)(()=>{let e=[];for(let t of en)e.push({type:`hook`,logId:t.id});for(let t of J){t.subActions?.length||e.push({type:`step`,stepId:t.id});for(let n of nn)st.length===1&&(n.stepId===t.id||Number(n.stepId)===t.rawStepOrder)&&e.push({type:`exec`,stepId:t.id,logId:n.id});for(let n of t.subActions??[])e.push({type:`sub`,stepId:t.id,subIndex:n.subActionIndex})}for(let t of tn)e.push({type:`hook`,logId:t.id});return e},[J,nn,en,tn,st.length]),sn=(0,Z.useMemo)(()=>{let e=P?.type===`step`&&Y?.subActionIndex!==null?Xs(Y):P;return e?on.findIndex(t=>e.type===`hook`&&t.type===`hook`?t.logId===e.hookId:e.type===`step`&&t.type===`step`?t.stepId===e.stepId:e.type===`subaction`&&t.type===`sub`?t.stepId===e.stepId&&t.subIndex===e.subIndex:e.type===`execution`&&t.type===`exec`?t.logId===e.logId:!1):-1},[on,P,Y]);function cn(e){return e.type===`hook`?{type:`hook`,hookId:e.logId}:e.type===`step`?{type:`step`,stepId:e.stepId}:e.type===`exec`?{type:`execution`,stepId:e.stepId,logId:e.logId}:{type:`subaction`,stepId:e.stepId,subIndex:e.subIndex}}function ln(e){let t=cn(e),n=Ys(t);e.type===`sub`&&n?ye(n):H(t)}qt((0,Z.useMemo)(()=>{let e=e=>e.target instanceof Element&&e.target.closest(`[role="dialog"]:not([data-state="closed"]), dialog[open], [role="listbox"], [role="combobox"]`)!==null,n=(e,t)=>{if(uu(e))return!1;let n=st.flatMap(e=>Zs(e).markers);if(n.length===0)return!1;let r=n.findIndex(e=>e.testIndex===Y?.testIndex&&e.stepIndex===Y.stepIndex&&e.subActionIndex===Y.subActionIndex);ye(n[r<0?t===1?0:n.length-1:Math.max(0,Math.min(n.length-1,r+t))])},r={arrowleft:e=>n(e,-1),arrowright:e=>n(e,1),v:e=>{if(uu(e))return!1;let t=X===`video`?`frames`:`video`;sc(t),Bt(t)},arrowdown:t=>{if(e(t))return!1;on.length!==0&&ln(sn===-1?on[0]:on[Math.min(sn+1,on.length-1)])},arrowup:t=>{if(e(t))return!1;on.length!==0&&ln(sn===-1?on[on.length-1]:on[Math.max(sn-1,0)])},j:e=>r.arrowdown(e),k:e=>r.arrowup(e),"shift+arrowdown":t=>{if(e(t))return!1;let n=J[J.findIndex(e=>e.id===$t)+1];n&&H({type:`step`,stepId:n.id})},"shift+arrowup":t=>{if(e(t))return!1;let n=J[J.findIndex(e=>e.id===$t)-1];n&&H({type:`step`,stepId:n.id})},1:()=>Je(ou[0]),2:()=>Je(ou[1]),3:()=>Je(ou[2]),4:()=>Je(ou[3]),5:()=>Je(ou[4]),6:()=>Je(ou[5]),7:()=>Je(ou[6]),i:()=>Qe(`test`),c:()=>Qe(`config`),m:()=>Je(`knowledge`),r:()=>{o&&At({file:o.filePath??o.name}).then(e=>{Lt.success(`Re-run started`),t(Rt.runLive(e.runId))}).catch(()=>Lt.error(`Failed to start re-run`))},escape:()=>{U?Pe(null):Ae?je(!1):H(null)},"shift+?":()=>ke(e=>!e),"shift+!":()=>M.current?.togglePhase(0),"shift+@":()=>M.current?.togglePhase(1),"shift+#":()=>M.current?.togglePhase(2),"shift+$":()=>M.current?.togglePhase(3)};return r},[on,sn,P,o,t,Ae,M,Qe,st,Y,X,It,U,J,$t])),(0,Z.useEffect)(()=>{if(E||c===void 0||W)return;let e=Jn(P)?J.find(e=>e.id===P.stepId):null,t=new URLSearchParams(r);e?t.set(`step`,e.id):t.delete(`step`),t.delete(`run`),Y?.subActionIndex==null?t.delete(`sub`):t.set(`sub`,String(Y.subActionIndex)),qe===`overview`?t.delete(`tab`):t.set(`tab`,qe),t.toString()!==r.toString()&&i(t,{replace:!0})},[P,Y,qe,J,r,i,E,c,W]),(0,Z.useEffect)(()=>{if(!Jn(P))return;let e=N.current;if(!e)return;if(P.type===`step`&&!r.has(`step`)&&!r.has(`sub`)&&J[0]?.id===P.stepId){te.current=P.stepId;return}te.current=null;let t=P.type===`step`?`[data-step-id="${P.stepId}"]`:P.type===`execution`?`[data-execution-id="${P.logId}"]`:qn(P)?`[data-sub-action-id="${P.stepId}-${P.subIndex}"]`:null;if(!t)return;let n=requestAnimationFrame(()=>{let n=e.querySelector(t);n&&lu(e,n)});return()=>cancelAnimationFrame(n)},[P,J,r]);let un=(0,Z.useCallback)(e=>{let t=new URLSearchParams(r);e===`all`?t.delete(`member`):t.set(`member`,e),i(t,{replace:!1})},[r,i]),dn=(0,Z.useCallback)((e,t)=>{let n=Zn(e,t);if(nt.some(n=>n.member.testIndex===e&&n.steps.some(({step:e})=>e.stepIndex===t))){if(!J.some(e=>e.id===n)){let e=new URLSearchParams(r);e.delete(`member`),i(e,{replace:!1})}H({type:`step`,stepId:n})}},[nt,J,r,i]),[pn,mn]=(0,Z.useState)(null),hn=(0,Z.useCallback)(e=>{requestAnimationFrame(()=>{let t=(N.current??document).querySelector(`[data-step-id="${e}"]`),n=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1;t?.scrollIntoView({block:`nearest`,behavior:n?`auto`:`smooth`})})},[]),gn=(0,Z.useCallback)(e=>{let t=Zn(e.testIndex,e.stepIndex);if(J.some(e=>e.id===t)){dn(e.testIndex,e.stepIndex),hn(t);return}if(!nt.some(t=>t.member.testIndex===e.testIndex&&t.steps.some(({step:t})=>t.stepIndex===e.stepIndex)))return;let n=new URLSearchParams(r);n.delete(`member`),i(n,{replace:!1}),mn(t)},[J,nt,dn,hn,r,i]);(0,Z.useEffect)(()=>{pn!==null&&J.some(e=>e.id===pn)&&(mn(null),H({type:`step`,stepId:pn}),hn(pn))},[pn,J,H,hn]);let _n=(0,Z.useMemo)(()=>({onSelect:gn,resolvable:e=>nt.some(t=>t.member.testIndex===e.testIndex&&t.steps.some(({step:t})=>t.stepIndex===e.stepIndex)),testNames:nt.length>1?new Map(nt.map(({member:e})=>[e.testIndex,ie(e)])):new Map}),[nt,gn]),vn=(0,Z.useCallback)(e=>{let t=new URLSearchParams(r);t.set(`member`,String(e)),i(t,{replace:!1})},[r,i]);return(0,Z.useEffect)(()=>{E||Jn(P)&&(J.some(e=>e.id===P.stepId)||H(J.length>0?{type:`step`,stepId:J[0].id}:null))},[J,P,E]),E?(0,Q.jsx)(Et,{}):O||!o?(0,Q.jsx)(Kt,{icon:_,title:`Run not found`,description:`This test run doesn't exist or has been deleted`,actionLabel:`View All Runs`,onAction:()=>t(Rt.runs)}):(0,Q.jsxs)(tt,{children:[U&&(0,Q.jsx)(ql,{runId:o.id,sha:U,open:!0,onOpenChange:e=>{e||Pe(null)},returnFocus:Le.current}),(0,Q.jsxs)(`div`,{ref:w,className:`flex h-full min-h-0 flex-col overflow-hidden`,children:[(0,Q.jsx)(co,{run:o,tokens:c?.tokens,models:c?.models,shortcutsOpen:Oe,onToggleShortcuts:()=>ke(e=>!e),onOpenArtifacts:Qe,onCurationClick:()=>Je(`knowledge`),onOpenVerdict:ct(o.status)===`fail`&<.size>0?ft:void 0,retrievalRung:Yt(we),feedbackEntry:_t.headerEntry,hasPostProcessing:!0,postProcessing:Se===void 0?void 0:Tn(Se)}),c&&iu(c)&&(0,Q.jsx)(au,{runId:o.id},o.id),(0,Q.jsxs)(Wt,{groupRef:St,orientation:bt===`stacked`?`vertical`:`horizontal`,className:`min-h-0 flex-1 overflow-hidden`,defaultLayout:vt?Li(bt,T):void 0,children:[(0,Q.jsx)(Ut,{id:xt.tree,defaultSize:35,minSize:20,children:(0,Q.jsxs)(`div`,{ref:N,className:`flex h-full min-h-0 min-w-0 flex-col overflow-y-auto`,children:[ht?(0,Q.jsx)(`div`,{className:`border-b px-3 py-2 shrink-0`,children:(0,Q.jsxs)(le,{value:et===`all`?`all`:String(et),onValueChange:un,children:[(0,Q.jsx)(oe,{className:`w-full h-8 text-xs`,"data-member-filter":!0,children:(0,Q.jsx)(ae,{})}),(0,Q.jsxs)(se,{children:[(0,Q.jsxs)(ce,{value:`all`,children:[`All tests (`,nt.length,`)`]}),nt.map(({member:e})=>(0,Q.jsx)(ce,{value:String(e.testIndex),children:ie(e)},e.testIndex))]})]})}):null,ct(o.status)===`fail`&&o.failureSummary&&(0,Q.jsx)(Ms,{summary:o.failureSummary}),ct(o.status)===`fail`&&o.errorLog&&(0,Q.jsxs)(j,{className:`mx-2 mt-1`,children:[(0,Q.jsxs)(A,{className:`flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors group w-full`,children:[(0,Q.jsx)(K,{className:`h-3 w-3 transition-transform group-data-[state=open]:rotate-90`}),(0,Q.jsx)(`span`,{children:`Error Details`})]}),(0,Q.jsx)(p,{children:(0,Q.jsx)(`pre`,{className:`mt-1 text-xs font-mono bg-muted/30 border border-border/50 rounded-[2px] px-3 py-2 overflow-x-auto whitespace-pre-wrap max-h-60 overflow-y-auto text-foreground/70 select-text`,children:o.errorLog})})]}),c===null?(0,Q.jsx)(`div`,{"data-run-detail-error":!0,className:`flex-1 flex items-center justify-center px-4 text-center text-sm text-muted-foreground`,children:F}):(0,Q.jsx)(ks,{groups:st,showMemberChrome:ht,analysisView:lt,onCitedStep:dn,onSelectMember:vn,onCitedArtifact:Zt,selection:P,playhead:Y,onSelect:H,setupHooks:en,teardownHooks:tn,inlineLogs:nn,feedback:c?_t.tree:void 0})]})},`tree`),(0,Q.jsx)(Gt,{withHandle:!0}),(0,Q.jsx)(Ut,{id:xt.evidence,defaultSize:65,minSize:30,"data-tour-id":`tour-run-detail-reasoning`,children:(0,Q.jsx)(`div`,{className:`flex h-full min-h-0 min-w-0 flex-col overflow-hidden`,children:c===null?(0,Q.jsx)(`div`,{"data-run-detail-error":!0,className:`flex flex-1 items-center justify-center px-4 text-center text-sm text-muted-foreground`,children:F}):(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:(0,Q.jsx)(Ol,{timeline:(0,Q.jsx)(eu,{model:Ot,mediaDurationsReady:q,playhead:Y,source:X,memberLabel:Ot.members.length>1?`All tests`:Ot.members[0]?.label,observedPosition:de,onPlayheadChange:ye,onSeekFraction:Jt}),activeTab:qe,onTabChange:Je,step:gt,subAction:wt,model:Dt,playhead:Y,recording:kt,frame:Qt,clock:Jl(Ot,ot,Tt?.member.testIndex??-1),playerSource:X,onPlayerSourceChange:Bt,onPlayheadChange:ye,seekFraction:R,seekRevision:V,onPlayheadObserved:Vt,onProgress:(e,t)=>fe(Zl(Ot,e,t)),onRecordingEnded:Xt,autoPlay:he===Tt?.member.testIndex,isTimelineKeyIgnored:uu,runId:gt?.rawRunId??o.id,allSteps:J,executionLogs:P?.type===`hook`&&rn?[rn]:P?.type===`execution`&&an?[an]:[],platform:o.platform,pipelineRef:M,knowledge:Xe,knowledgeStepRefs:_n,onSelectStep:e=>H({type:`step`,stepId:e})})})})})},`evidence`),_t.composer===void 0?null:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(Gt,{withHandle:!0}),(0,Q.jsx)(Ut,{id:xt.feedback,minSize:bt===`stacked`?`240px`:`320px`,maxSize:bt===`stacked`?void 0:`50%`,children:(0,Q.jsx)(Ul,{..._t.composer,layout:bt})},`feedback`)]})]}),Ae?(0,Q.jsx)(Yo,{run:o,open:Ae,tab:Me,response:Re,loading:Ve,error:We,onOpenChange:je,onTabChange:Ne,onRetry:Ze}):null]})]})}export{du as default,uu as isTimelineKeyIgnored};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Dr as e,Yt as t}from"./index-0ktcxgei.js";import{t as n}from"./badge-MmnLIMMu.js";var r=t();function i({status:t}){let{label:i,...a}=e(t);return(0,r.jsx)(n,{...a,children:i})}export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Gt as e}from"./index-0ktcxgei.js";var t=e(`ban`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]),n=e(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),r=[`passed`,`failed`,`healed`,`skipped`,`cancelled`],i=`did not run`;function a(){return{members:{},steps:[],handles:void 0,lastEnvelopeAt:void 0,lastSeq:0,verdict:void 0,terminal:!1,notices:[],gap:void 0}}function o(e){let t=e.status;return t!==void 0&&r.includes(t)?t:e.selfHealOccurred===!0?`healed`:e.verifierVerdict===void 0?`failed`:e.verifierVerdict.pass?`passed`:`failed`}function s(e,t,n){if(e.gap!==void 0)return e;let r=t+1,i=n-1;return i<r?e:{...e,gap:{from:r,to:i}}}function c(e,t){return e.members[t]??{testIndex:t,name:``,sawStepStarted:!1}}function l(e,t){return{...e.members,[t.testIndex]:t}}function u(e,t){let n=[...e],r=n.length;for(;r>0&&n[r-1].createdSeq>t.createdSeq;)--r;return n.splice(r,0,t),n}function d(e,t,n){let r=[...e];return r[t]=n,r}var f=(e,t,n)=>e.findIndex(e=>e.testIndex===t&&e.stepIndex===n);function p(e,t,n){let r={...e,lastEnvelopeAt:n,lastSeq:Math.max(e.lastSeq,t.seq)};if(e.terminal)return r;switch(t.type){case`runStarted`:{let e=t.payload;return{...r,handles:e.handles===void 0?void 0:[...e.handles]}}case`testStarted`:{let e=t.payload,n={...c(r,e.testIndex),testIndex:e.testIndex,name:e.name,totalSteps:e.totalSteps},i=e.stepTexts,a=e=>{if(!Array.isArray(i))return``;let t=i[e];return typeof t==`string`?t:``},o=r.steps;if(e.totalSteps!==void 0)for(let n=0;n<e.totalSteps;n+=1)f(o,e.testIndex,n)>=0||(o=u(o,{testIndex:e.testIndex,stepIndex:n,status:`pending`,text:a(n),ticks:0,createdSeq:t.seq}));return{...r,members:l(r,n),steps:o}}case`stepStarted`:{let e=t.payload,n={...c(r,e.testIndex),testIndex:e.testIndex,sawStepStarted:!0},i=f(r.steps,e.testIndex,e.stepIndex),a={testIndex:e.testIndex,stepIndex:e.stepIndex,status:`running`,text:e.stepText,startedAt:t.ts,ticks:0,lastTickAt:void 0,createdSeq:i>=0?r.steps[i].createdSeq:t.seq};return{...r,members:l(r,n),steps:i>=0?d(r.steps,i,a):u(r.steps,a)}}case`stepFinalized`:{let e=t.payload,n=o(e),i=f(r.steps,e.testIndex,e.stepIndex),a=r.retrievalRung??e.retrievalRung,s=a===void 0?{}:{retrievalRung:a};if(i<0)return{...r,...s,members:l(r,{...c(r,e.testIndex),testIndex:e.testIndex}),steps:u(r.steps,{testIndex:e.testIndex,stepIndex:e.stepIndex,status:n,text:``,ticks:0,durationMs:e.durationMs,createdSeq:t.seq})};let p=r.steps[i];return{...r,...s,steps:d(r.steps,i,{...p,status:n,durationMs:e.durationMs})}}case`subActionRecorded`:{let{testIndex:e,stepIndex:n}=t.payload,i=f(r.steps,e,n);if(i<0)return r;let a=r.steps[i];return{...r,steps:d(r.steps,i,{...a,ticks:a.ticks+1,lastTickAt:t.ts})}}case`testFinished`:{let e=t.payload,n=c(r,e.testIndex),a={...n,testIndex:e.testIndex,outcome:e.outcome,durationMs:e.durationMs,note:n.sawStepStarted?void 0:i},o=n.sawStepStarted?r.steps:r.steps.map(t=>t.testIndex===e.testIndex&&t.status===`pending`?{...t,status:`skipped`}:t);return{...r,members:l(r,a),steps:o}}case`testRetryScheduled`:{let e=t.payload;return{...r,members:l(r,{...c(r,e.testIndex),testIndex:e.testIndex,outcome:void 0,note:void 0}),steps:r.steps.map(t=>t.testIndex===e.testIndex?{...t,status:`pending`,ticks:0,lastTickAt:void 0,startedAt:void 0,durationMs:void 0}:t)}}case`verdict`:return r.verdict===void 0?{...r,verdict:t.payload.verdict}:r;case`runFinished`:return{...r,terminal:!0};case`runWarning`:case`runError`:{let e=t.payload;return{...r,notices:[...r.notices,{code:e.code,message:e.message}]}}default:return r}}export{n as a,p as i,a as n,t as o,s as r,i as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./arrow-up-down-CkXEPOSU.js";import{a as n,i as r,n as i,r as a,s as o,t as s}from"./select-B9PD0Kau.js";import{n as c,r as l}from"./shortcut-hints-eZAIE8bW.js";import{t as u}from"./plus-Dat6AM-D.js";import{t as d}from"./trash-2-2JD8nWR7.js";import{a as f,c as p,i as m,n as h,r as g,t as _}from"./batch-action-bar-Bg_1IyjJ.js";import{n as v,r as y,t as b}from"./popover-DrbdiGRd.js";import{i as x,r as ee,t as te}from"./tabs-BKL0XmCI.js";import{B as ne,D as S,E as C,H as re,Ht as ie,In as ae,It as oe,L as w,Ln as T,Mn as se,O as ce,Pt as E,Qs as D,R as O,Tr as k,U as A,V as le,Vn as ue,Xs as de,Yt as fe,a as pe,br as j,cn as me,fn as he,ir as ge,jt as _e,k as M,tc as N,ur as ve,xr as ye,y as P,yr as be,z as F}from"./index-0ktcxgei.js";import{t as xe}from"./use-page-title-qvGn8USj.js";import{t as I}from"./badge-MmnLIMMu.js";import{a as L,i as Se,n as R,o as z,r as B,t as V}from"./table-C-9N3ArO.js";import{n as H,t as Ce}from"./scroll-area-C34fPAjC.js";import{t as U}from"./empty-state-D-rPbKI6.js";import{t as we}from"./use-keyboard-shortcuts-Bz9HvJxb.js";import{n as Te,t as Ee}from"./use-selection-queue-DE4YxhK4.js";var W=e(N(),1),G=fe();function De({startedAt:e}){let[t,n]=(0,W.useState)(()=>{let t=new Date(A(e)).getTime();return Math.max(0,Math.floor((Date.now()-t)/1e3))});return(0,W.useEffect)(()=>{let t=new Date(A(e)).getTime(),r=setInterval(()=>{n(Math.max(0,Math.floor((Date.now()-t)/1e3)))},1e3);return()=>clearInterval(r)},[e]),(0,G.jsxs)(`span`,{className:`text-blue-500 tabular-nums`,children:[Math.floor(t/60),`m `,t%60,`s`]})}var Oe={select:`44px`,status:`clamp(112px, 13cqw, 136px)`,target:`clamp(96px, 12cqw, 180px)`,attributes:`260px`,duration:`104px`,createdAt:`128px`},K=`@max-[1200px]/runs:hidden`,q=[`agent-qa.trigger`,`agent-qa.runner`],ke=`agent-qa.gate-run`;function J(e){return e===`ios`?`iOS`:e.charAt(0).toUpperCase()+e.slice(1)}function Ae(e){return`${e.targetName?.trim()||`No target`} (${J(e.platform)})`}function je(e){return e.suiteId!=null}function Me(e,t){let n=new Map(t.map((e,t)=>[e,t])),r=new Map(q.map((e,t)=>[e,t]));return Object.entries(e??{}).filter(([,e])=>typeof e==`string`).sort(([e],[t])=>{let i=n.get(e),a=n.get(t);if(i!==void 0||a!==void 0)return(i??2**53-1)-(a??2**53-1);let o=r.get(e),s=r.get(t);return o!==void 0||s!==void 0?(o??2**53-1)-(s??2**53-1):e.localeCompare(t)})}function Ne({attributes:e,activeKeys:t}){let n=Me(e,t).filter(([e])=>e!==ke);if(n.length===0)return(0,G.jsx)(`span`,{className:`text-[12px] text-muted-foreground`,children:`No attributes`});let r=n.length>2?1:2,i=n.slice(0,r),a=n.length-i.length;return(0,G.jsxs)(C,{children:[(0,G.jsx)(M,{asChild:!0,children:(0,G.jsxs)(`div`,{className:`max-h-[38px] overflow-hidden text-[12px] leading-[18px]`,"aria-label":n.map(([e,t])=>`${e}=${t}`).join(`, `),children:[i.map(([e,t])=>(0,G.jsxs)(`div`,{className:`min-w-0 truncate font-mono`,children:[(0,G.jsxs)(`span`,{className:`text-muted-foreground`,children:[e,`=`]}),(0,G.jsx)(`span`,{className:`text-foreground`,children:t})]},e)),a>0?(0,G.jsxs)(`div`,{className:`font-mono text-[11px] text-muted-foreground`,children:[`+`,a,` more`]}):null]})}),(0,G.jsx)(S,{side:`top`,align:`start`,className:`max-w-[420px] p-2`,children:(0,G.jsx)(`div`,{className:`max-h-64 overflow-auto font-mono text-[11px] leading-5`,children:n.map(([e,t])=>(0,G.jsxs)(`div`,{className:`grid min-w-0 grid-cols-[minmax(0,1fr)_minmax(0,1fr)] gap-2`,children:[(0,G.jsx)(`span`,{className:`truncate text-muted-foreground`,children:e}),(0,G.jsx)(`span`,{className:`truncate text-foreground`,children:t})]},e))})})]})}function Pe({run:e,className:t}){let n=Ae(e);return(0,G.jsxs)(C,{children:[(0,G.jsx)(M,{asChild:!0,children:(0,G.jsx)(`span`,{className:F(`block truncate text-[13px] leading-snug`,t),children:n})}),(0,G.jsx)(S,{side:`top`,align:`start`,children:n})]})}function Y(e){return e.mode===`regex`?`${e.key} matches ${e.value}`:`${e.key} = ${e.value}`}function Fe({predicates:e,onChange:t}){let[n,r]=(0,W.useState)(!1),[i,a]=(0,W.useState)(``),[o,s]=(0,W.useState)(``),[c,l]=(0,W.useState)(`exact`),[f,p]=(0,W.useState)(null),[m,h]=(0,W.useState)([]),[g,_]=(0,W.useState)([]);(0,W.useEffect)(()=>{if(!n)return;let e=!1;return ae({q:i,limit:8}).then(t=>{e||h(t.keys)}).catch(()=>{e||h([])}),()=>{e=!0}},[i,n]),(0,W.useEffect)(()=>{if(!n||!i.trim()){_([]);return}let e=!1;return T(i.trim(),{q:o,limit:8}).then(t=>{e||_(t.values)}).catch(()=>{e||_([])}),()=>{e=!0}},[i,n,o]);function x(){let n=i.trim(),r=o.trim();if(!n||!r){p(`Enter an attribute key and value, or remove this filter.`);return}if(c===`regex`)try{new RegExp(r)}catch{p(`Enter a valid regular expression.`);return}p(null);let u=e.filter(e=>e.key!==n);t?.([...u,{key:n,value:r,mode:c}]),a(``),s(``),l(`exact`)}function ee(n){t?.(e.filter((e,t)=>t!==n))}return(0,G.jsxs)(b,{open:n,onOpenChange:r,children:[(0,G.jsx)(y,{asChild:!0,children:(0,G.jsxs)(O,{type:`button`,variant:e.length>0?`secondary`:`outline`,size:`sm`,"aria-label":`Filter by attributes`,className:`h-9 gap-2`,children:[(0,G.jsx)(E,{className:`size-4`}),`Attributes`,e.length>0?` (${e.length})`:``]})}),(0,G.jsxs)(v,{align:`start`,className:`w-[380px] p-0`,children:[(0,G.jsx)(`div`,{className:`border-b px-3 py-2`,children:(0,G.jsx)(`h3`,{className:`text-sm font-medium`,children:`Filter by attributes`})}),(0,G.jsxs)(`div`,{className:`space-y-3 p-3`,children:[(0,G.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`label`,{className:`text-[11px] font-medium text-muted-foreground`,htmlFor:`run-attribute-key`,children:`Key`}),(0,G.jsx)(w,{id:`run-attribute-key`,value:i,onChange:e=>{a(e.target.value),p(null)},placeholder:`git.branch`}),(0,G.jsx)(`div`,{className:`max-h-28 overflow-y-auto rounded border border-border/60`,children:m.length>0?m.map(e=>(0,G.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-2 px-2 py-1 text-left text-xs hover:bg-muted`,onClick:()=>a(e.key),children:[(0,G.jsx)(`span`,{className:`truncate font-mono`,children:e.key}),(0,G.jsx)(`span`,{className:`text-muted-foreground tabular-nums`,children:e.count})]},e.key)):(0,G.jsx)(`div`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`No attributes found`})})]}),(0,G.jsxs)(`div`,{className:`space-y-1`,children:[(0,G.jsx)(`label`,{className:`text-[11px] font-medium text-muted-foreground`,htmlFor:`run-attribute-value`,children:`Value`}),(0,G.jsx)(w,{id:`run-attribute-value`,value:o,onChange:e=>{s(e.target.value),p(null)},placeholder:c===`regex`?`^(master|main)$`:`master`,"aria-describedby":f?`run-attribute-filter-error`:void 0}),(0,G.jsx)(`div`,{className:`max-h-28 overflow-y-auto rounded border border-border/60`,children:g.length>0?g.map(e=>(0,G.jsxs)(`button`,{type:`button`,className:`flex w-full items-center justify-between gap-2 px-2 py-1 text-left text-xs hover:bg-muted`,onClick:()=>s(e.value),children:[(0,G.jsx)(`span`,{className:`truncate font-mono`,children:e.value}),(0,G.jsx)(`span`,{className:`text-muted-foreground tabular-nums`,children:e.count})]},e.value)):(0,G.jsx)(`div`,{className:`px-2 py-2 text-xs text-muted-foreground`,children:`No values found for this key`})})]})]}),(0,G.jsxs)(`div`,{className:`inline-flex rounded border border-border p-0.5`,children:[(0,G.jsx)(`button`,{type:`button`,className:F(`rounded-[2px] px-2 py-1 text-xs`,c===`exact`?`bg-primary text-primary-foreground`:`text-muted-foreground`),"aria-pressed":c===`exact`,onClick:()=>l(`exact`),children:`Exact match`}),(0,G.jsx)(`button`,{type:`button`,className:F(`rounded-[2px] px-2 py-1 text-xs`,c===`regex`?`bg-primary text-primary-foreground`:`text-muted-foreground`),"aria-pressed":c===`regex`,onClick:()=>l(`regex`),children:`Regex`})]}),f?(0,G.jsx)(`p`,{id:`run-attribute-filter-error`,className:`text-xs text-destructive`,children:f}):null,(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsxs)(O,{type:`button`,size:`sm`,onClick:x,children:[(0,G.jsx)(u,{className:`size-4`}),`Apply filter`]}),(0,G.jsx)(O,{type:`button`,size:`sm`,variant:`outline`,onClick:()=>t?.([]),disabled:e.length===0,children:`Clear attributes`})]}),e.length>0?(0,G.jsx)(`div`,{className:`space-y-1 border-t pt-3`,children:e.map((e,t)=>(0,G.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,G.jsx)(`span`,{className:`min-w-0 flex-1 break-all font-mono`,children:Y(e)}),(0,G.jsx)(O,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":`Remove ${e.key} filter`,onClick:()=>ee(t),children:(0,G.jsx)(d,{className:`size-3.5`})})]},`${e.key}-${e.mode}`))}):null]})]})]})}function X({status:e}){let t=j(e);return(0,G.jsx)(I,{className:ye(t.tone),children:t.label})}function Z({column:e,label:n}){return(0,G.jsx)(`div`,{className:`flex justify-end`,children:(0,G.jsxs)(O,{type:`button`,variant:`ghost`,size:`xs`,"data-runs-sort-button":`compact`,className:`h-7 max-w-full shrink justify-end px-1.5 text-[12px] leading-none text-foreground/90`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[(0,G.jsx)(`span`,{className:`truncate`,children:n}),(0,G.jsx)(t,{})]})})}var Q=[{accessorKey:`status`,header:({column:e})=>(0,G.jsxs)(O,{variant:`ghost`,className:`-ml-2`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Status`,(0,G.jsx)(t,{className:`ml-2 h-4 w-4`})]})},{accessorKey:`name`,header:({column:e})=>(0,G.jsxs)(O,{variant:`ghost`,className:`-ml-2`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Test Name`,(0,G.jsx)(t,{className:`ml-2 h-4 w-4`})]})},{id:`target`,accessorFn:e=>`${e.targetName??`No target`} ${e.platform}`,header:({column:e})=>(0,G.jsxs)(O,{variant:`ghost`,className:`-ml-2`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Target`,(0,G.jsx)(t,{className:`ml-2 h-4 w-4`})]})},{id:`attributes`,accessorFn:e=>Object.entries(e.attributes??{}).map(([e,t])=>`${e}=${t}`).join(` `),header:`Attributes`},{accessorKey:`duration`,header:({column:e})=>(0,G.jsx)(Z,{column:e,label:`Duration`})},{accessorKey:`createdAt`,header:({column:e})=>(0,G.jsx)(Z,{column:e,label:`Started`})}];function Ie(e){e.stopPropagation()}function Le(e){(e.key===`Enter`||e.key===` `)&&e.stopPropagation()}function Re(e,t){if(e.length===0)return!1;let n=e.filter(e=>t.has(e)).length;return n===0?!1:n===e.length?!0:`indeterminate`}function ze(e){let t=Oe[e];if(t)return{width:t,minWidth:t}}function Be(e){return F(`h-10 bg-background text-[13px] font-medium text-foreground/90`,e===`select`&&`w-11 px-2 text-center`,e===`status`&&`w-[clamp(112px,13cqw,136px)] px-3`,e===`name`&&`min-w-[280px] px-3`,e===`target`&&`w-[clamp(96px,12cqw,180px)] px-3`,e===`attributes`&&F(`w-[260px] px-3`,K),e===`duration`&&`w-[104px] px-3 text-right`,e===`createdAt`&&`w-[128px] px-3 text-right`)}function $(e,t){return F(`py-2 align-top`,e===`select`&&`w-11 px-2`,e===`status`&&`w-[clamp(112px,13cqw,136px)] px-3`,e===`name`&&F(`min-w-[280px] max-w-0 px-3`,t&&`pl-8`),e===`target`&&`w-[clamp(96px,12cqw,180px)] max-w-0 px-3 text-muted-foreground`,e===`attributes`&&F(`w-[260px] max-w-0 px-3`,K),e===`duration`&&`w-[104px] px-3 text-right tabular-nums`,e===`createdAt`&&`w-[128px] px-3 text-right tabular-nums`)}function Ve({isActive:e,isBatchSelected:t,isChild:n}){return F(`cursor-pointer outline-none hover:bg-muted/20 focus-visible:bg-primary/10`,n&&`bg-muted/[0.04]`,t&&!e&&`bg-muted/20`,e&&`bg-primary/10 ring-1 ring-inset ring-primary/60`)}function He(e,t){let n=[];for(let r of e)if(n.push({id:r.id,run:r,isChild:!1,parentId:null}),!(!je(r)||!t.has(r.id)))for(let e of r.tests??[])n.push({id:e.id,run:e,isChild:!0,parentId:r.id});return n}function Ue(e,t){return e.length===t.length?e.every((e,n)=>{let r=t[n];return!!r&&e.id===r.id&&e.isChild===r.isChild&&e.parentId===r.parentId&&e.run===r.run}):!1}function We({runs:e,total:t,isLoading:c,page:l,onPageChange:u,onSearchChange:d,searchValue:_,selectedRunId:v=null,onSelectedRunIdChange:y,expandedSuites:b=new Set,onToggleSuite:x,onOpenRun:ee,onVisibleRunsChange:te,platformFilter:ae=``,onPlatformChange:oe,targetFilter:T=``,targetOptions:se=[],onTargetChange:E,attributePredicates:D=[],onAttributePredicatesChange:A,sorting:ue,onSortingChange:de,headerActions:fe,topSlot:pe,enableSelection:j=!1,selectedRunIds:me=new Set,onToggleRunSelection:he,onToggleVisibleSelection:ge}){let[_e,N]=(0,W.useState)([]),ve=ue??_e,ye=de??N,P=m({data:e,columns:[...j?[{id:`select`,header:({table:e})=>(0,G.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,G.jsx)(h,{checked:Re(e.getRowModel().rows.map(e=>e.original.id),me),onCheckedChange:t=>ge?.(e.getRowModel().rows.map(e=>e.original),t===!0),onClick:e=>e.stopPropagation(),"aria-label":`Select all`})}),enableSorting:!1}]:[],...Q],getRowId:e=>e.id,getCoreRowModel:f(),getSortedRowModel:p(),onSortingChange:ye,state:{sorting:ve}}),be=P.getHeaderGroups(),F=P.getRowModel().rows,xe=(0,W.useMemo)(()=>F.map(e=>e.original),[F]),U=(0,W.useMemo)(()=>He(xe,b),[b,xe]),we=Math.ceil(t/50),Te=l*50+1,Ee=Math.min((l+1)*50,t),Oe=Array.from(new Set([T,...se].filter(e=>!!e))),q=[...j?[`select`]:[],`status`,`name`,`target`,`attributes`,`duration`,`createdAt`],J=(0,W.useMemo)(()=>D.map(e=>e.key),[D]),Ae=(0,W.useRef)([]);(0,W.useEffect)(()=>{te&&(Ue(Ae.current,U)||(Ae.current=U,te(U)))},[te,U]),(0,W.useEffect)(()=>{if(!v)return;let e=document.querySelector(`[data-runs-row-surface="${v}"]`);e&&document.activeElement!==e&&e.focus()},[v]);function Me(e){return e.status===`running`&&e.startedAt?(0,G.jsx)(`span`,{className:`text-sm tabular-nums`,children:(0,G.jsx)(De,{startedAt:e.startedAt})}):e.status===`running`?(0,G.jsx)(`span`,{className:`text-sm text-blue-500`,children:`Starting...`}):(0,G.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:re(e.duration)})}function Y(e,t){y?.(e.id),ee?.(e,t)}function Z(e,t){t.key===`Enter`&&(t.preventDefault(),Y(e,t))}return(0,G.jsx)(ce,{children:(0,G.jsxs)(`div`,{className:`flex min-h-0 w-full flex-1 flex-col gap-4`,children:[(0,G.jsxs)(`div`,{className:`shrink-0 space-y-4`,children:[pe,(0,G.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,G.jsx)(w,{placeholder:`Search runs...`,value:_,onChange:e=>d(e.target.value),className:`max-w-[220px]`}),oe&&(0,G.jsxs)(s,{value:ae||`all`,onValueChange:e=>oe(e===`all`?``:e),children:[(0,G.jsx)(r,{className:`w-[140px]`,children:(0,G.jsx)(n,{placeholder:`All platforms`})}),(0,G.jsxs)(i,{children:[(0,G.jsx)(a,{value:`all`,children:`All platforms`}),(0,G.jsx)(a,{value:`web`,children:`Web`}),(0,G.jsx)(a,{value:`android`,children:`Android`}),(0,G.jsx)(a,{value:`ios`,children:`iOS`})]})]}),E&&(0,G.jsxs)(s,{value:T||`all`,onValueChange:e=>E(e===`all`?``:e),children:[(0,G.jsx)(r,{className:`w-[180px]`,children:(0,G.jsx)(n,{placeholder:`All targets`})}),(0,G.jsxs)(i,{children:[(0,G.jsx)(a,{value:`all`,children:`All targets`}),Oe.map(e=>(0,G.jsx)(a,{value:e,children:e},e))]})]}),A&&(0,G.jsx)(Fe,{predicates:D,onChange:A}),(0,G.jsx)(`div`,{className:`flex-1`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[c&&(0,G.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:`Loading...`}),fe]})]})]}),(0,G.jsxs)(Ce,{"data-tour-id":`tour-runs-table`,className:`@container/runs min-h-0 flex-1 rounded-md border`,children:[(0,G.jsxs)(V,{className:`min-w-full table-fixed`,children:[(0,G.jsx)(`colgroup`,{children:q.map(e=>(0,G.jsx)(`col`,{style:ze(e),className:e===`attributes`?K:void 0},e))}),(0,G.jsx)(L,{children:be.map(e=>(0,G.jsx)(z,{className:`hover:bg-transparent`,children:e.headers.map(e=>(0,G.jsx)(Se,{className:Be(e.column.id),children:e.isPlaceholder?null:g(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,G.jsx)(R,{children:F.length?F.map(e=>{let t=e.original,n=je(t),r=n&&b.has(t.id),i=t.tests??[],a=i.filter(e=>k(e.status)===`pass`).length,s=v===t.id,c=me.has(t.id);return(0,G.jsxs)(W.Fragment,{children:[(0,G.jsxs)(z,{tabIndex:s?0:-1,"data-runs-row-surface":t.id,"data-active":String(s),"data-state":c?`selected`:void 0,"aria-selected":s,className:Ve({isActive:s,isBatchSelected:c,isChild:!1}),onClick:e=>Y(t,e),onFocus:()=>y?.(t.id),onKeyDown:e=>Z(t,e),children:[j&&(0,G.jsx)(B,{className:$(`select`,!1),onClick:e=>e.stopPropagation(),children:(0,G.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,G.jsx)(h,{checked:me.has(t.id),onCheckedChange:e=>he?.(t,e===!0),"aria-label":`Select row`})})}),(0,G.jsx)(B,{className:$(`status`,!1),children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(X,{status:t.status}),n&&i.length>0&&(0,G.jsxs)(`span`,{className:`text-[11px] text-muted-foreground/80 tabular-nums`,children:[a,`/`,i.length]})]})}),(0,G.jsx)(B,{className:$(`name`,!1),children:(0,G.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2.5`,children:[n&&(0,G.jsx)(`button`,{type:`button`,tabIndex:s?0:-1,className:`rounded p-0.5 hover:bg-muted`,onClick:e=>{Ie(e),x?.(t.id)},onKeyDown:Le,children:r?(0,G.jsx)(o,{className:`h-4 w-4 text-muted-foreground`}):(0,G.jsx)(ie,{className:`h-4 w-4 text-muted-foreground`})}),(0,G.jsx)(`span`,{className:`block whitespace-normal break-words text-sm font-medium leading-snug text-foreground`,children:t.name}),t.attributes?.[ke]===`true`&&(0,G.jsxs)(C,{children:[(0,G.jsx)(M,{asChild:!0,children:(0,G.jsx)(I,{variant:`secondary`,"data-slot":`badge`,tabIndex:s?0:-1,className:`mt-0.5`,onKeyDown:Le,children:`Verify run`})}),(0,G.jsx)(S,{side:`top`,children:`Started by authoring verify. Not used for learning.`})]})]})}),(0,G.jsx)(B,{className:$(`target`,!1),children:(0,G.jsx)(Pe,{run:t,className:`text-muted-foreground/90`})}),(0,G.jsx)(B,{className:$(`attributes`,!1),children:(0,G.jsx)(Ne,{attributes:t.attributes,activeKeys:J})}),(0,G.jsx)(B,{className:$(`duration`,!1),children:Me(t)}),(0,G.jsx)(B,{className:$(`createdAt`,!1),children:(0,G.jsxs)(C,{children:[(0,G.jsx)(M,{asChild:!0,children:(0,G.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:ne(t.createdAt)})}),(0,G.jsx)(S,{children:le(t.createdAt)})]})})]}),r&&i.map(t=>{let n=v===t.id;return(0,G.jsxs)(z,{tabIndex:n?0:-1,"data-runs-row-surface":t.id,"data-active":String(n),"aria-selected":n,className:Ve({isActive:n,isBatchSelected:!1,isChild:!0}),onClick:e=>Y(t,e),onFocus:()=>y?.(t.id),onKeyDown:e=>Z(t,e),children:[j&&(0,G.jsx)(B,{className:$(`select`,!0)}),(0,G.jsx)(B,{className:$(`status`,!0),children:(0,G.jsx)(X,{status:t.status})}),(0,G.jsx)(B,{className:$(`name`,!0),children:(0,G.jsx)(`span`,{className:`block whitespace-normal break-words text-sm leading-snug text-foreground/90`,children:t.name})}),(0,G.jsx)(B,{className:$(`target`,!0),children:(0,G.jsx)(Pe,{run:t,className:`text-muted-foreground`})}),(0,G.jsx)(B,{className:$(`attributes`,!0),children:(0,G.jsx)(Ne,{attributes:t.attributes,activeKeys:J})}),(0,G.jsx)(B,{className:$(`duration`,!0),children:Me(t)}),(0,G.jsx)(B,{className:$(`createdAt`,!0),children:(0,G.jsxs)(C,{children:[(0,G.jsx)(M,{asChild:!0,children:(0,G.jsx)(`span`,{className:`truncate text-sm text-muted-foreground`,children:ne(t.createdAt)})}),(0,G.jsx)(S,{children:le(t.createdAt)})]})})]},`${e.id}-child-${t.id}`)})]},e.id)}):(0,G.jsx)(z,{children:(0,G.jsx)(B,{colSpan:q.length,className:`h-24 text-center`,children:`No results.`})})})]}),(0,G.jsx)(H,{orientation:`horizontal`})]}),(0,G.jsxs)(`div`,{className:`flex items-center justify-between px-1`,children:[(0,G.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t>0?`Showing ${Te}-${Ee} of ${t}`:`No runs found`}),(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(O,{variant:`outline`,size:`sm`,onClick:()=>u(l-1),disabled:l===0,children:`Previous`}),(0,G.jsx)(O,{variant:`outline`,size:`sm`,onClick:()=>u(l+1),disabled:l>=we-1||we===0,children:`Next`})]})]})]})})}var Ge=new Set([`all`,`running`,`queued`,`completed`,`failed`]),Ke=new Set([`asc`,`desc`]);function qe(e){if(!e)return 1;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>1?t:1}function Je(e){let t=new URLSearchParams;e.tab!==`all`&&t.set(`tab`,e.tab),e.search&&t.set(`search`,e.search),e.platform&&t.set(`platform`,e.platform),e.target&&t.set(`target`,e.target);for(let n of e.attributePredicates){if(!n.key||!n.value)continue;let e=n.mode===`regex`?`attributes[${n.key}][regex]`:`attributes[${n.key}]`;t.set(e,n.value)}return e.sort&&(t.set(`sort`,e.sort),t.set(`order`,e.order)),e.page>1&&t.set(`page`,String(e.page)),t}function Ye(e){let t=[];for(let[n,r]of e.entries()){let e=/^attributes\[([^\]]+)\](?:\[(regex)\])?$/.exec(n);!e||!r||t.push({key:e[1],value:r,mode:e[2]===`regex`?`regex`:`exact`})}return t}function Xe(){let[e,t]=D(),n=e.get(`tab`),r=n&&Ge.has(n)?n:`all`,i=e.get(`search`)??``,a=e.get(`platform`)??``,o=e.get(`target`)??``,s=(0,W.useMemo)(()=>Ye(e),[e]),c=e.get(`sort`)??``,l=e.get(`order`)??`desc`,u=Ke.has(l)?l:`desc`,d=qe(e.get(`page`)),f=(0,W.useMemo)(()=>c?[{id:c,desc:u===`desc`}]:[],[c,u]),p=(0,W.useRef)(f);p.current=f;let m=(0,W.useMemo)(()=>({tab:r,search:i,platform:a,target:o,attributePredicates:s,sort:c,order:u,page:d}),[r,i,a,o,s,c,u,d]);(0,W.useEffect)(()=>{let n=Je(m);e.toString()!==n.toString()&&t(n,{replace:!0})},[e,t,m]);let h=(0,W.useCallback)((e,n)=>{let r={...m,...e};n?.resetPage&&(r.page=1),t(Je(r),{replace:!0})},[t,m]);return{tab:r,search:i,platform:a,target:o,attributePredicates:s,sort:c,order:u,page:d,sorting:f,onSortingChange:(0,W.useCallback)(e=>{let t=typeof e==`function`?e(p.current):e;t.length>0?h({sort:t[0].id,order:t[0].desc?`desc`:`asc`}):h({sort:``,order:`desc`})},[h]),setTab:(0,W.useCallback)(e=>h({tab:e},{resetPage:!0}),[h]),setSearch:(0,W.useCallback)(e=>h({search:e},{resetPage:!0}),[h]),setPlatform:(0,W.useCallback)(e=>h({platform:e},{resetPage:!0}),[h]),setTarget:(0,W.useCallback)(e=>h({target:e},{resetPage:!0}),[h]),setAttributePredicates:(0,W.useCallback)(e=>h({attributePredicates:e},{resetPage:!0}),[h]),setPage:(0,W.useCallback)(e=>h({page:e}),[h])}}var Ze=[],Qe={all:Ze,running:[`running`],queued:[`pending`],completed:[`passed`,`healed`,`failed`,`timeout`,`cancelled`],failed:[`failed`,`timeout`]};function $e(e){return e.length===0||e.length===1&&e[0]===`running`}function et(e,t){let n=e.trim().toLowerCase();if(!n)return!0;let r=t.runId.toLowerCase().includes(n),i=(t.testName??``).toLowerCase().includes(n);return r||i}function tt(){xe(`Runs`);let e=de(),[t,n]=(0,W.useState)([]),[r,i]=(0,W.useState)(0),[a,o]=(0,W.useState)([]),[s,u]=(0,W.useState)(!0),{tab:d,search:f,platform:p,target:m,attributePredicates:h,page:g,sorting:v,onSortingChange:y,setTab:b,setSearch:ne,setPlatform:re,setTarget:ie,setAttributePredicates:ae,setPage:w}=Xe(),[T,E]=(0,W.useState)(!1),[D,k]=(0,W.useState)(null),[A,le]=(0,W.useState)([]),[fe,j]=(0,W.useState)(()=>new Set),[N,ye]=(0,W.useState)(null),[F,L]=(0,W.useState)(!1),[Se,R]=(0,W.useState)(!1),[z,B]=(0,W.useState)(!0),V=(0,W.useCallback)(async(e,t,r,a)=>{try{if(!$e(r)){n(e),i(t);return}let{executions:o}=await he();if(o.length===0){n(e),i(t);return}let s=new Set(e.map(e=>e.id)),c=o.filter(e=>!s.has(e.runId)).filter(e=>et(a,e)).map(e=>({id:e.runId,name:e.testName??`Running test...`,filePath:null,status:`running`,duration:e.duration,attributes:{},environment:null,metadata:null,startedAt:e.startedAt,endedAt:null,failureSummary:null,errorLog:null,testId:null,suiteId:null,platform:`web`,testFileContent:null,modelName:null,llmProvider:null,attemptNumber:1,retryCount:0,maxRetries:0,createdAt:e.startedAt}));n([...c,...e]),i(t+c.length)}catch{n(e),i(t)}},[]),H=(0,W.useCallback)(e=>({limit:50,offset:(e.page-1)*50,name:e.name||void 0,statuses:e.statuses.length>0?e.statuses:void 0,platform:e.platform||void 0,target:e.target||void 0,attributes:e.attributes}),[]),Ce=Qe[d]??Ze,De=(0,W.useCallback)(async e=>{try{u(!0);let[t,n]=await Promise.all([ue(H(e)),se()]);ye(n),o(t.targets??[]),await V(t.runs,t.total,e.statuses,e.name)}catch{P.error(`Failed to load runs`)}finally{u(!1),E(!0)}},[V,H]),Oe=(0,W.useCallback)(async e=>{try{let[t,n]=await Promise.all([ue(H(e)),se()]);ye(n),o(t.targets??[]),await V(t.runs,t.total,e.statuses,e.name)}catch{}},[V,H]),K=(0,W.useMemo)(()=>({page:g,name:f,statuses:Ce,platform:p,target:m,attributes:h}),[g,f,Ce,p,m,h]);(0,W.useEffect)(()=>{De(K)},[De,K]),(0,W.useEffect)(()=>{if(!T)return;let e=setInterval(()=>{Oe(K)},5e3);return()=>clearInterval(e)},[T,Oe,K]),(0,W.useEffect)(()=>{k(null),j(new Set),le([])},[d,f,p,m,h,g]),(0,W.useEffect)(()=>{D&&(A.some(e=>e.id===D)||k(t.find(e=>e.tests?.some(e=>e.id===D))?.id??null))},[t,D,A]);let q=Ee({items:t,getId:e=>e.id,visibleIds:t.map(e=>e.id)}),ke=q.selectedIds,J=q.selectedItems,Ae=(0,W.useCallback)(()=>{q.clearSelection(),R(!1),B(!0)},[q]),je=(0,W.useCallback)(async()=>{if(J.length===0)return;let e=J.flatMap(e=>e.filePath?[e.filePath]:[]);if(e.length===0){P.error(`No selected runs can be rerun`);return}L(!0);try{let t=await Promise.allSettled(e.map(e=>ve({file:e,noCache:!z}))),n=t.filter(e=>e.status===`fulfilled`).length,r=t.length-n;r>0?P.error(`${n} runs queued, ${r} failed`):P.success(`${n} runs queued`),R(!1)}finally{L(!1)}},[J,z]),Me=(0,W.useCallback)(async()=>{L(!0);try{let{purged:e}=await ge();P.success(`Purged ${e} cached plan${e===1?``:`s`}`)}catch(e){P.error(`Cache purge failed: ${e instanceof Error?e.message:String(e)}`)}finally{L(!1)}},[]),Ne=(0,W.useCallback)(async()=>{if(J.length!==0){L(!0);try{let e=await Promise.allSettled(J.map(e=>me(e.id))),t=J.filter((t,n)=>e[n]?.status===`fulfilled`),r=new Set(e.flatMap(e=>e.status===`fulfilled`?e.value.deletedRunIds:[])),a=e.length-t.length;t.length>0&&(q.setItemsSelected(t,!1),n(e=>e.filter(e=>!r.has(e.id))),i(e=>Math.max(0,e-t.length)),R(!1)),a>0?P.error(`Deleted ${t.length} run${t.length===1?``:`s`}, ${a} failed`):P.success(`Deleted ${t.length} run${t.length===1?``:`s`}`)}finally{L(!1)}}},[J,q]),Pe=(0,W.useCallback)(e=>{j(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),Y=(0,W.useCallback)((t,n)=>{let r=be.runDetailOrLive(t.id,t.status);if(n?.metaKey||n?.ctrlKey||n?.button===1){window.open(r,`_blank`,`noopener,noreferrer`);return}e(r)},[e]),Fe=(0,W.useCallback)((e,t)=>{Y(e,t)},[Y]),X=(0,W.useMemo)(()=>A.findIndex(e=>e.id===D),[D,A]);we((0,W.useMemo)(()=>{let e=e=>{if(A.length!==0){if(X===-1){k(e>0?A[0].id:A[A.length-1].id);return}k(A[Math.max(0,Math.min(X+e,A.length-1))].id)}},t=()=>e(1),n=()=>e(-1);return{j:t,arrowdown:t,k:n,arrowup:n,enter:e=>{X<0||Y(A[X].run,e)}}},[Y,X,A]));let Z=N?.running.count??0,Q=N?.pending.count??0,Ie=Q>0||Z>0;if(!T)return(0,G.jsx)(pe,{});let Le=!!f||d!==`all`||!!p||!!m||h.length>0;if(t.length===0&&!Le)return(0,G.jsx)(`div`,{"data-tour-id":`tour-runs-table`,children:(0,G.jsx)(U,{icon:oe,title:`No test runs yet`,description:`Run your first test to see results here`,actionLabel:`View Tests`,onAction:()=>e(be.tests)})});let Re=(0,G.jsx)(te,{value:d,onValueChange:b,children:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsxs)(ee,{variant:`line`,children:[(0,G.jsx)(x,{value:`all`,children:`All`}),(0,G.jsxs)(x,{value:`running`,children:[`Running`,Z>0&&(0,G.jsx)(I,{variant:`secondary`,className:`ml-1 px-1.5 text-xs`,children:Z})]}),(0,G.jsxs)(x,{value:`queued`,children:[`Queued`,Q>0&&(0,G.jsx)(I,{variant:`secondary`,className:`ml-1 px-1.5 text-xs`,children:Q})]}),(0,G.jsx)(x,{value:`completed`,children:`Completed`}),(0,G.jsx)(x,{value:`failed`,children:`Failed`})]}),Ie&&N&&(0,G.jsxs)(I,{variant:`outline`,className:`text-xs`,children:[N.activeSlots,`/`,N.concurrency,` slots`]})]})});return(0,G.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col gap-4 overflow-hidden`,children:[(0,G.jsxs)(`div`,{className:`flex shrink-0 items-center justify-between gap-3`,children:[(0,G.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Runs`}),(0,G.jsx)(ce,{children:(0,G.jsxs)(C,{children:[(0,G.jsx)(M,{asChild:!0,children:(0,G.jsx)(O,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,children:(0,G.jsx)(l,{className:`h-4 w-4`})})}),(0,G.jsx)(S,{side:`bottom`,className:`p-3`,children:(0,G.jsx)(c,{hints:[{key:`J / ↓`,label:`Next row`},{key:`K / ↑`,label:`Previous row`},{key:`Enter`,label:`Open run`},{key:`⌘+Enter`,label:`Open in new tab`}]})})]})})]}),(0,G.jsx)(We,{topSlot:Re,runs:t,total:r,isLoading:s,page:g-1,onPageChange:e=>w(e+1),onSearchChange:ne,searchValue:f,selectedRunId:D,onSelectedRunIdChange:k,expandedSuites:fe,onToggleSuite:Pe,onOpenRun:Fe,onVisibleRunsChange:le,platformFilter:p,onPlatformChange:re,targetFilter:m,targetOptions:a,onTargetChange:ie,attributePredicates:h,onAttributePredicatesChange:ae,sorting:v,onSortingChange:y,enableSelection:!0,selectedRunIds:q.selectedIdSet,onToggleRunSelection:q.setItemSelected,onToggleVisibleSelection:q.setItemsSelected}),(0,G.jsx)(_,{selectedCount:ke.length,summaryMeta:q.hiddenCount>0?`${q.hiddenCount} hidden by filters`:void 0,secondaryIcon:(0,G.jsx)(_e,{className:`size-4`}),secondaryAriaLabel:`Clear queue`,onDelete:Ne,actionSlot:(0,G.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,G.jsx)(Te,{selectedCount:q.selectedCount,hiddenCount:q.hiddenCount,useCache:z,open:Se,onOpenChange:R,onUseCacheChange:B,onRun:je,disabled:F}),(0,G.jsx)(O,{variant:`outline`,size:`sm`,onClick:Me,disabled:F,children:`Purge all cached plans`})]}),onCancel:Ae,isRunning:F})]})}export{tt as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./chunk-CilyBKbf.js";import{Yt as e,tc as t,z as n}from"./index-0ktcxgei.js";t();var r=e();function i({className:e,children:t,type:i,scrollHideDelay:a,...o}){return(0,r.jsx)(`div`,{"data-slot":`scroll-area`,className:n(`relative overflow-auto [scrollbar-width:thin]`,e),...o,children:(0,r.jsx)(`div`,{"data-slot":`scroll-area-viewport`,className:`size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 [&>div]:!block`,children:t})})}function a({orientation:e=`vertical`,...t}){return null}export{a as n,i as t};
|