@vostride/agent-qa-dashboard-ui 0.2.2 → 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.
Files changed (199) hide show
  1. package/README.md +78 -0
  2. package/dist/assets/{arrow-up-down-CKc1J6oh.js → arrow-up-down-CkXEPOSU.js} +1 -1
  3. package/dist/assets/{badge-B-yh3kbi.js → badge-MmnLIMMu.js} +1 -1
  4. package/dist/assets/batch-action-bar-Bg_1IyjJ.js +4 -0
  5. package/dist/assets/check-B2JBwjSe.js +1 -0
  6. package/dist/assets/circle-Xrl9blhh.js +1 -0
  7. package/dist/assets/{circle-dashed-WDoZ8ADk.js → circle-dashed-D2UVSTYi.js} +1 -1
  8. package/dist/assets/circle-slash-iyfIklmt.js +1 -0
  9. package/dist/assets/{circle-x-1lf_9y_c.js → circle-x-CTm-Znd9.js} +1 -1
  10. package/dist/assets/config-yByyzBwq.js +3 -0
  11. package/dist/assets/{cssMode-CIWhUqfG.js → cssMode-BBQdjXbL.js} +1 -1
  12. package/dist/assets/{display-step-opeACkeD.js → display-step-Cgs30Ul7.js} +1 -1
  13. package/dist/assets/{dist-Cy8QoEce.js → dist-DTBPY93S.js} +1 -1
  14. package/dist/assets/{empty-state-2mwYYmoQ.js → empty-state-D-rPbKI6.js} +1 -1
  15. package/dist/assets/{file-code-BTJCyvvJ.js → file-code-DJGTlQdo.js} +1 -1
  16. package/dist/assets/filename-validation-DBEhHOy2.js +1 -0
  17. package/dist/assets/{freemarker2-BiVXttLB.js → freemarker2-DrFcSVs8.js} +1 -1
  18. package/dist/assets/{grip-vertical-B87oMfre.js → grip-vertical-mXei0XVt.js} +1 -1
  19. package/dist/assets/{handlebars-C_rmhix8.js → handlebars-SaK5Z7lY.js} +1 -1
  20. package/dist/assets/hook-editor-B9JLXhOJ.js +1 -0
  21. package/dist/assets/{hook-runtime-8xwsNog-.js → hook-runtime-CdKy24OK.js} +1 -1
  22. package/dist/assets/hook-viewer-DRWIRku4.js +1 -0
  23. package/dist/assets/{hooks-BIXR5djX.js → hooks-DZxZ7qbD.js} +1 -1
  24. package/dist/assets/{html-v4GGDD2l.js → html-DUrLTy3t.js} +1 -1
  25. package/dist/assets/{htmlMode-DsnRJeF2.js → htmlMode-CpegtGCG.js} +1 -1
  26. package/dist/assets/{id-badge-CIbcJUv0.js → id-badge-NMDEQDag.js} +3 -3
  27. package/dist/assets/index-0ktcxgei.js +116 -0
  28. package/dist/assets/index-HFKr1ctG.css +2 -0
  29. package/dist/assets/{insights-CfqFVe4T.js → insights-B0435q79.js} +1 -1
  30. package/dist/assets/{insights-line-grid-EcYgqiLS.js → insights-line-grid-CtoahJE7.js} +6 -6
  31. package/dist/assets/{javascript-B12FD1Gz.js → javascript-C-l8zO8e.js} +1 -1
  32. package/dist/assets/{jsonMode-C_mhVvGR.js → jsonMode-Beeoi3Xk.js} +1 -1
  33. package/dist/assets/knowledge-view-CD1TFSLc.js +1 -0
  34. package/dist/assets/{label-CYpyu7PJ.js → label-D_Jf6y0L.js} +1 -1
  35. package/dist/assets/{liquid-l2oB7oKx.js → liquid-bJdsKvv8.js} +1 -1
  36. package/dist/assets/live-run-CyJ-cAet.js +1 -0
  37. package/dist/assets/live-step-row-CrstaK1U.js +1 -0
  38. package/dist/assets/{lspLanguageFeatures-By4f0cSm.js → lspLanguageFeatures-Cn6BXYdZ.js} +1 -1
  39. package/dist/assets/{mdx-Cyix08OW.js → mdx-LnT6x9vm.js} +1 -1
  40. package/dist/assets/{monaco-editor-BQB4vEk_.js → monaco-editor-B6mFBq9L.js} +2 -2
  41. package/dist/assets/{monaco-editor-inner-DBI8AgAJ.js → monaco-editor-inner-8PnIDLQz.js} +4 -4
  42. package/dist/assets/{monaco.contribution-C7Dknl5j.js → monaco.contribution-BBzv4yE3.js} +2 -2
  43. package/dist/assets/plus-Dat6AM-D.js +1 -0
  44. package/dist/assets/popover-DrbdiGRd.js +1 -0
  45. package/dist/assets/{python-cdSYU9zt.js → python-DPgrly9F.js} +1 -1
  46. package/dist/assets/radio-group-D7bWnAJ7.js +1 -0
  47. package/dist/assets/{razor-BWMXhgx8.js → razor-DjDnQwdx.js} +1 -1
  48. package/dist/assets/{refresh-cw-BQdOC6UA.js → refresh-cw-DpNAPQYT.js} +1 -1
  49. package/dist/assets/{resizable-om0nWp3k.js → resizable-BDrAG61s.js} +1 -1
  50. package/dist/assets/run-detail-CQ6Y6dQj.js +1 -0
  51. package/dist/assets/run-status-badge-L4mzeuUy.js +1 -0
  52. package/dist/assets/{run-stream-reducer-BXMulZq1.js → run-stream-reducer-BSkFyxB_.js} +1 -1
  53. package/dist/assets/runs-DBLAcB4A.js +1 -0
  54. package/dist/assets/scroll-area-C34fPAjC.js +1 -0
  55. package/dist/assets/select-B9PD0Kau.js +1 -0
  56. package/dist/assets/{shortcut-hints-_J-i7rAL.js → shortcut-hints-eZAIE8bW.js} +1 -1
  57. package/dist/assets/split-button-DdscN9va.js +1 -0
  58. package/dist/assets/suite-editor-YpS3BwjZ.js +5 -0
  59. package/dist/assets/suite-navbar-CFZjqNjD.js +1 -0
  60. package/dist/assets/suite-viewer-Bsz6Epuw.js +1 -0
  61. package/dist/assets/suites-BglVjv_G.js +1 -0
  62. package/dist/assets/switch-xSMwKr9Z.js +1 -0
  63. package/dist/assets/tab-console-BF977T6r.js +1 -0
  64. package/dist/assets/table-C-9N3ArO.js +1 -0
  65. package/dist/assets/{tabs-CsAJVEvt.js → tabs-BKL0XmCI.js} +1 -1
  66. package/dist/assets/test-editor-C6XNOFkP.js +9 -0
  67. package/dist/assets/test-navbar-qJSqUdYb.js +7 -0
  68. package/dist/assets/test-viewer-Bh0p09uO.js +1 -0
  69. package/dist/assets/tests-DgBSme3j.js +1 -0
  70. package/dist/assets/tests-suites-table-widths-BrDJsNpi.js +1 -0
  71. package/dist/assets/{textarea-BP7XqG3v.js → textarea-DK29qckP.js} +1 -1
  72. package/dist/assets/{trash-2-87f7wzeR.js → trash-2-2JD8nWR7.js} +1 -1
  73. package/dist/assets/{tsMode-CqMhxF8i.js → tsMode-Cajyh71r.js} +1 -1
  74. package/dist/assets/{typescript-DOy-nOZu.js → typescript-_xcF03po.js} +1 -1
  75. package/dist/assets/use-clipboard-copy-BlWDP3HN.js +1 -0
  76. package/dist/assets/{use-hook-run-session-DnSkzl1A.js → use-hook-run-session-CMEz70il.js} +1 -1
  77. package/dist/assets/{use-keyboard-shortcuts-befVnBO6.js → use-keyboard-shortcuts-Bz9HvJxb.js} +1 -1
  78. package/dist/assets/{use-page-title-fn79XYtf.js → use-page-title-qvGn8USj.js} +1 -1
  79. package/dist/assets/{use-run-status-favicon-vVlATUoT.js → use-run-status-favicon-Bt0tLQkk.js} +1 -1
  80. package/dist/assets/use-selection-queue-DE4YxhK4.js +1 -0
  81. package/dist/assets/{workers-By3SZV-o.js → workers-e5BAAjmc.js} +1 -1
  82. package/dist/assets/{wrench-y-wKZ-0A.js → wrench-Cgh_pk3j.js} +1 -1
  83. package/dist/assets/{xml-BEMkcljk.js → xml-DI6VDnOP.js} +1 -1
  84. package/dist/assets/{yaml-CfPYAxWJ.js → yaml-BzXIuQuW.js} +1 -1
  85. package/dist/assets/{zap-DKRM77fm.js → zap-B27P6HHM.js} +1 -1
  86. package/dist/index.html +2 -2
  87. package/package.json +4 -4
  88. package/dist/assets/batch-action-bar-MMUxALHz.js +0 -4
  89. package/dist/assets/check-DH5_3cK-.js +0 -1
  90. package/dist/assets/checkbox-B5x0V2a2.js +0 -1
  91. package/dist/assets/circle-DjggEctd.js +0 -1
  92. package/dist/assets/circle-slash-Baq9Dw6f.js +0 -1
  93. package/dist/assets/config-CnN4bOco.js +0 -3
  94. package/dist/assets/filename-validation-I94bcMf7.js +0 -1
  95. package/dist/assets/globe-B0WEPp3h.js +0 -1
  96. package/dist/assets/hook-editor-DetIWjh8.js +0 -1
  97. package/dist/assets/hook-viewer-C_nzb-qD.js +0 -1
  98. package/dist/assets/index-0GfHLQ0v.css +0 -2
  99. package/dist/assets/index-CXuVkD6-.js +0 -116
  100. package/dist/assets/knowledge-view-BHNh7MwX.js +0 -1
  101. package/dist/assets/live-run-DOfPiVKU.js +0 -1
  102. package/dist/assets/live-step-row-BtLYYCKS.js +0 -1
  103. package/dist/assets/plus-DNc2RueT.js +0 -1
  104. package/dist/assets/popover-DThBIgGA.js +0 -1
  105. package/dist/assets/radio-group-DDMpRS3x.js +0 -1
  106. package/dist/assets/run-detail-C9oixuvH.js +0 -1
  107. package/dist/assets/run-status-badge-DRzXddrc.js +0 -1
  108. package/dist/assets/runs-BDKh94Pq.js +0 -1
  109. package/dist/assets/scroll-area-WFIgUp-0.js +0 -1
  110. package/dist/assets/select-JI5Kadjp.js +0 -1
  111. package/dist/assets/split-button-BHdketN3.js +0 -1
  112. package/dist/assets/suite-editor-Ce16nUF9.js +0 -5
  113. package/dist/assets/suite-navbar-D8RcUReD.js +0 -1
  114. package/dist/assets/suite-viewer-Bc78bHVL.js +0 -1
  115. package/dist/assets/suites-D2VXpj7W.js +0 -1
  116. package/dist/assets/switch-BgfA6DyL.js +0 -1
  117. package/dist/assets/tab-console-CpnOoTyg.js +0 -1
  118. package/dist/assets/table-e38rtLis.js +0 -1
  119. package/dist/assets/test-editor-vZsQDd2R.js +0 -9
  120. package/dist/assets/test-navbar-BfzeL-K8.js +0 -7
  121. package/dist/assets/test-viewer-Cek_cnB3.js +0 -1
  122. package/dist/assets/tests-CzPu8CPe.js +0 -1
  123. package/dist/assets/tests-suites-table-widths-nMJHxqRN.js +0 -1
  124. package/dist/assets/use-clipboard-copy-Bmyv0FFY.js +0 -1
  125. package/dist/assets/use-selection-queue-BAssrkmC.js +0 -1
  126. /package/dist/assets/{abap-CpHUwCVK.js → abap-CK68cr9-.js} +0 -0
  127. /package/dist/assets/{apex-DlD7oJX6.js → apex-BHHyAVNb.js} +0 -0
  128. /package/dist/assets/{azcli-CmXFAbc-.js → azcli-C56lfIEP.js} +0 -0
  129. /package/dist/assets/{bat-DdNJq4hH.js → bat-BLamSaf-.js} +0 -0
  130. /package/dist/assets/{bicep-Bppz7WOA.js → bicep-lrOcEItS.js} +0 -0
  131. /package/dist/assets/{cameligo-0MRMdSmg.js → cameligo-BK_p0bgU.js} +0 -0
  132. /package/dist/assets/{clojure-B5dKj863.js → clojure-BQ7JOykv.js} +0 -0
  133. /package/dist/assets/{coffee-DSbWjzk7.js → coffee-BD3DiL5s.js} +0 -0
  134. /package/dist/assets/{cpp-SBF8SAh9.js → cpp-splnCwCh.js} +0 -0
  135. /package/dist/assets/{csharp-Lzuq_1t-.js → csharp-BCpsl-o3.js} +0 -0
  136. /package/dist/assets/{csp-BEzxZqi1.js → csp-tkCWrZmb.js} +0 -0
  137. /package/dist/assets/{css-C3D3PKln.js → css-B_xdnReq.js} +0 -0
  138. /package/dist/assets/{cypher-CQ3dEPmv.js → cypher-OL1zq-y3.js} +0 -0
  139. /package/dist/assets/{dart-DCPmxolI.js → dart-CtTlOkrm.js} +0 -0
  140. /package/dist/assets/{dockerfile-B_2_aaTO.js → dockerfile-DcQ5CNiW.js} +0 -0
  141. /package/dist/assets/{ecl-rADUeXsV.js → ecl-DZpiDRt6.js} +0 -0
  142. /package/dist/assets/{editor.api2-DXR_ThFM.js → editor.api2-S_Xxx4WR.js} +0 -0
  143. /package/dist/assets/{elixir-DOd-TuJO.js → elixir-Dzj2lqtK.js} +0 -0
  144. /package/dist/assets/{flow9-Bf7zg_j0.js → flow9-CFENCHIZ.js} +0 -0
  145. /package/dist/assets/{format-BpI4TiHn.js → format-Y_Dbfary.js} +0 -0
  146. /package/dist/assets/{fsharp-BqROZjbA.js → fsharp-D-4bv7FB.js} +0 -0
  147. /package/dist/assets/{go-oQTP5uLe.js → go-djxbTJq7.js} +0 -0
  148. /package/dist/assets/{graphql-CSHfTU3q.js → graphql-DHIFrkZ6.js} +0 -0
  149. /package/dist/assets/{hcl-CeG-RoFJ.js → hcl-CXVoowNb.js} +0 -0
  150. /package/dist/assets/{ini-B2Dv4ohc.js → ini-Crzc5kly.js} +0 -0
  151. /package/dist/assets/{java-aUDDeufb.js → java-CYLaJrdE.js} +0 -0
  152. /package/dist/assets/{julia-C5LbruO5.js → julia-BJ7tUU-T.js} +0 -0
  153. /package/dist/assets/{kotlin-C6mOuSKk.js → kotlin-CeWcU3lC.js} +0 -0
  154. /package/dist/assets/{less-D5qC3caW.js → less-CviwWNG4.js} +0 -0
  155. /package/dist/assets/{lexon-Dr2La-fj.js → lexon-Dt28jqDS.js} +0 -0
  156. /package/dist/assets/{lua-Zy6u5z6Z.js → lua-B6AOaJSi.js} +0 -0
  157. /package/dist/assets/{m3-C7XHeDz_.js → m3-VnMkHJcy.js} +0 -0
  158. /package/dist/assets/{markdown-PiF7r-2h.js → markdown-8vKNdvIM.js} +0 -0
  159. /package/dist/assets/{mips-nn07GiyE.js → mips-DoEcuzan.js} +0 -0
  160. /package/dist/assets/{msdax-DaKFVMST.js → msdax-CNzvHyEp.js} +0 -0
  161. /package/dist/assets/{mysql-C6d6xrbU.js → mysql-Buk3vUtL.js} +0 -0
  162. /package/dist/assets/{numeric-input-DcozBggQ.js → numeric-input-BfrTvhxN.js} +0 -0
  163. /package/dist/assets/{objective-c-B6KMtI-k.js → objective-c-DfOmda-5.js} +0 -0
  164. /package/dist/assets/{pascal-DYr8MPE7.js → pascal-DoAA2yjy.js} +0 -0
  165. /package/dist/assets/{pascaligo-B3pd-jJ_.js → pascaligo-C65Vn1fu.js} +0 -0
  166. /package/dist/assets/{perl-z2xUzoaL.js → perl-INlfQ_ro.js} +0 -0
  167. /package/dist/assets/{pgsql-DUvT-09-.js → pgsql-DtwRzglx.js} +0 -0
  168. /package/dist/assets/{php-CGyOmJfy.js → php-DfHqVNet.js} +0 -0
  169. /package/dist/assets/{pla-CMqgvyD0.js → pla-D3dNVRYk.js} +0 -0
  170. /package/dist/assets/{postiats-Dx5LUn4Z.js → postiats-UKXD1rM4.js} +0 -0
  171. /package/dist/assets/{powerquery-DazYxvJ6.js → powerquery-zE3E3O7s.js} +0 -0
  172. /package/dist/assets/{powershell-B3nwlDka.js → powershell-Df9b3zQl.js} +0 -0
  173. /package/dist/assets/{protobuf-BGuu2u2s.js → protobuf-BF0nUVrW.js} +0 -0
  174. /package/dist/assets/{pug-Dbte1MXA.js → pug-Bj6Yikv_.js} +0 -0
  175. /package/dist/assets/{qsharp-DJLwBOvG.js → qsharp-BI4h-raZ.js} +0 -0
  176. /package/dist/assets/{r-DmGBRSHj.js → r-DhpnmaXx.js} +0 -0
  177. /package/dist/assets/{redis-VvUYn0a4.js → redis-DwYYPr4d.js} +0 -0
  178. /package/dist/assets/{redshift-6GdDrxg3.js → redshift-D2f3Bc-4.js} +0 -0
  179. /package/dist/assets/{restructuredtext-CfAB8aRU.js → restructuredtext-Dkiif6fe.js} +0 -0
  180. /package/dist/assets/{ruby-CIYK6MXY.js → ruby-C6hLmHy0.js} +0 -0
  181. /package/dist/assets/{rust-CTHZfjj9.js → rust-X8WAGtxB.js} +0 -0
  182. /package/dist/assets/{sb-CkKTdkz_.js → sb-4M2la0Kr.js} +0 -0
  183. /package/dist/assets/{scala-Bx-Wr9TM.js → scala-CaCXz58E.js} +0 -0
  184. /package/dist/assets/{scheme-Dcfi6f83.js → scheme-CMdjpmP7.js} +0 -0
  185. /package/dist/assets/{scss-ByL-7PFQ.js → scss-QopmvPyp.js} +0 -0
  186. /package/dist/assets/{shell-Csnb9Yqd.js → shell-CDBchS00.js} +0 -0
  187. /package/dist/assets/{solidity-Dbw5-0QP.js → solidity-DvBfi5mC.js} +0 -0
  188. /package/dist/assets/{sophia-ZQ3saZQx.js → sophia-HSnXR17u.js} +0 -0
  189. /package/dist/assets/{sparql-BEtOel8u.js → sparql-DhG_ppup.js} +0 -0
  190. /package/dist/assets/{sql-DGPDbzB7.js → sql-DHeIS-tf.js} +0 -0
  191. /package/dist/assets/{st-GeW2MOgh.js → st-CMWchiRU.js} +0 -0
  192. /package/dist/assets/{swift-BVYTN8jq.js → swift-CDXvBefj.js} +0 -0
  193. /package/dist/assets/{systemverilog-Deg2a8Lr.js → systemverilog-0RTukYUE.js} +0 -0
  194. /package/dist/assets/{tcl-6DnLmROF.js → tcl-CbBF_Ttl.js} +0 -0
  195. /package/dist/assets/{twig-XbbXW9Yz.js → twig-DCcGd8FE.js} +0 -0
  196. /package/dist/assets/{typespec-CRlV8GhI.js → typespec-HTphp-Uh.js} +0 -0
  197. /package/dist/assets/{vb-BHE2izPH.js → vb-Cb_yUcVd.js} +0 -0
  198. /package/dist/assets/{viewer-url-state-BnbixmdH.js → viewer-url-state-BfJV-cGM.js} +0 -0
  199. /package/dist/assets/{wgsl-Bf5vkfmY.js → wgsl-DrKU3YXj.js} +0 -0
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./check-DH5_3cK-.js";import{$ as n,B as r,Ct as i,Dt as a,Et as o,Kt as s,Q as c,Sc as l,St as u,Tt as d,X as f,Xt as p,Y as m,Z as h,_t as g,dt as _,ft as v,gt as y,ht as b,jt as x,kt as S,mt as C,pt as w,vt as T,wt as E,xc as D,xt as O,yt as k}from"./index-CXuVkD6-.js";var A=s(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),j=s(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),M=e(D(),1),N=e(l(),1);function P(e){let t=N.useRef({value:e,previous:e});return N.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function F(e,[t,n]){return Math.min(n,Math.max(t,e))}var I=p(),L=[` `,`Enter`,`ArrowUp`,`ArrowDown`],R=[` `,`Enter`],z=`Select`,[B,V,H]=E(z),[U,W]=d(z,[H,n]),G=n(),[ee,K]=U(z),[te,ne]=U(z),re=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:l,dir:u,name:d,autoComplete:f,disabled:p,required:m,form:h}=e,g=G(t),[_,v]=N.useState(null),[y,b]=N.useState(null),[x,S]=N.useState(!1),C=T(u),[w,E]=O({prop:r,defaultProp:i??!1,onChange:a,caller:z}),[D,A]=O({prop:o,defaultProp:s,onChange:l,caller:z}),j=N.useRef(null),M=_?h||!!_.closest(`form`):!0,[P,F]=N.useState(new Set),L=Array.from(P).map(e=>e.props.value).join(`;`);return(0,I.jsx)(c,{...g,children:(0,I.jsxs)(ee,{required:m,scope:t,trigger:_,onTriggerChange:v,valueNode:y,onValueNodeChange:b,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:k(),value:D,onValueChange:A,open:w,onOpenChange:E,dir:C,triggerPointerDownPosRef:j,disabled:p,children:[(0,I.jsx)(B.Provider,{scope:t,children:(0,I.jsx)(te,{scope:e.__scopeSelect,onNativeOptionAdd:N.useCallback(e=>{F(t=>new Set(t).add(e))},[]),onNativeOptionRemove:N.useCallback(e=>{F(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),M?(0,I.jsxs)(Ge,{"aria-hidden":!0,required:m,tabIndex:-1,name:d,autoComplete:f,value:D,onChange:e=>A(e.target.value),disabled:p,form:h,children:[D===void 0?(0,I.jsx)(`option`,{value:``}):null,Array.from(P)]},L):null]})})};re.displayName=z;var ie=`SelectTrigger`,q=N.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...o}=e,s=G(n),c=K(ie,n),l=c.disabled||r,u=x(t,c.onTriggerChange),d=V(n),f=N.useRef(`touch`),[p,h,g]=qe(e=>{let t=d().filter(e=>!e.disabled),n=Je(t,e,t.find(e=>e.value===c.value));n!==void 0&&c.onValueChange(n.value)}),_=e=>{l||(c.onOpenChange(!0),g()),e&&(c.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,I.jsx)(m,{asChild:!0,...s,children:(0,I.jsx)(a.button,{type:`button`,role:`combobox`,"aria-controls":c.contentId,"aria-expanded":c.open,"aria-required":c.required,"aria-autocomplete":`none`,dir:c.dir,"data-state":c.open?`open`:`closed`,disabled:l,"data-disabled":l?``:void 0,"data-placeholder":Ke(c.value)?``:void 0,...o,ref:u,onClick:i(o.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&_(e)}),onPointerDown:i(o.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(_(e),e.preventDefault())}),onKeyDown:i(o.onKeyDown,e=>{let t=p.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&h(e.key),!(t&&e.key===` `)&&L.includes(e.key)&&(_(),e.preventDefault())})})})});q.displayName=ie;var ae=`SelectValue`,oe=N.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:o,placeholder:s=``,...c}=e,l=K(ae,n),{onValueNodeHasChildrenChange:d}=l,f=o!==void 0,p=x(t,l.onValueNodeChange);return u(()=>{d(f)},[d,f]),(0,I.jsx)(a.span,{...c,ref:p,style:{pointerEvents:`none`},children:Ke(l.value)?(0,I.jsx)(I.Fragment,{children:s}):o})});oe.displayName=ae;var se=`SelectIcon`,ce=N.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,I.jsx)(a.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});ce.displayName=se;var le=`SelectPortal`,ue=e=>(0,I.jsx)(C,{asChild:!0,...e});ue.displayName=le;var J=`SelectContent`,de=N.forwardRef((e,t)=>{let n=K(J,e.__scopeSelect),[r,i]=N.useState();if(u(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?M.createPortal((0,I.jsx)(fe,{scope:e.__scopeSelect,children:(0,I.jsx)(B.Slot,{scope:e.__scopeSelect,children:(0,I.jsx)(`div`,{children:e.children})})}),t):null}return(0,I.jsx)(he,{...e,ref:t})});de.displayName=J;var Y=10,[fe,X]=U(J),pe=`SelectContentImpl`,me=S(`SelectContent.RemoveScroll`),he=N.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:s,side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:S,...C}=e,T=K(J,n),[E,D]=N.useState(null),[O,k]=N.useState(null),A=x(t,e=>D(e)),[j,M]=N.useState(null),[P,F]=N.useState(null),L=V(n),[R,z]=N.useState(!1),B=N.useRef(!1);N.useEffect(()=>{if(E)return _(E)},[E]),w();let H=N.useCallback(e=>{let[t,...n]=L().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&O&&(O.scrollTop=0),n===r&&O&&(O.scrollTop=O.scrollHeight),n?.focus(),document.activeElement!==i))return},[L,O]),U=N.useCallback(()=>H([j,E]),[H,j,E]);N.useEffect(()=>{R&&U()},[R,U]);let{onOpenChange:W,triggerPointerDownPosRef:G}=T;N.useEffect(()=>{if(E){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(G.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(G.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():E.contains(n.target)||W(!1),document.removeEventListener(`pointermove`,t),G.current=null};return G.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[E,W,G]),N.useEffect(()=>{let e=()=>W(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[W]);let[ee,te]=qe(e=>{let t=L().filter(e=>!e.disabled),n=Je(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),ne=N.useCallback((e,t,n)=>{let r=!B.current&&!n;(T.value!==void 0&&T.value===t||r)&&(M(e),r&&(B.current=!0))},[T.value]),re=N.useCallback(()=>E?.focus(),[E]),ie=N.useCallback((e,t,n)=>{let r=!B.current&&!n;(T.value!==void 0&&T.value===t||r)&&F(e)},[T.value]),q=r===`popper`?ye:_e,ae=q===ye?{side:c,sideOffset:l,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:m,sticky:h,hideWhenDetached:g,avoidCollisions:S}:{};return(0,I.jsx)(fe,{scope:n,content:E,viewport:O,onViewportChange:k,itemRefCallback:ne,selectedItem:j,onItemLeave:re,itemTextRefCallback:ie,focusSelectedItem:U,selectedItemText:P,position:r,isPositioned:R,searchRef:ee,children:(0,I.jsx)(v,{as:me,allowPinchZoom:!0,children:(0,I.jsx)(b,{asChild:!0,trapped:T.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:i(a,e=>{T.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,I.jsx)(y,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>T.onOpenChange(!1),children:(0,I.jsx)(q,{role:`listbox`,id:T.contentId,"data-state":T.open?`open`:`closed`,dir:T.dir,onContextMenu:e=>e.preventDefault(),...C,...ae,onPlaced:()=>z(!0),ref:A,style:{display:`flex`,flexDirection:`column`,outline:`none`,...C.style},onKeyDown:i(C.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=L().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>H(t)),e.preventDefault()}})})})})})})});he.displayName=pe;var ge=`SelectItemAlignedPosition`,_e=N.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,o=K(J,n),s=X(J,n),[c,l]=N.useState(null),[d,f]=N.useState(null),p=x(t,e=>f(e)),m=V(n),h=N.useRef(!1),g=N.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:y,focusSelectedItem:b}=s,S=N.useCallback(()=>{if(o.trigger&&o.valueNode&&c&&d&&_&&v&&y){let e=o.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=o.valueNode.getBoundingClientRect(),i=y.getBoundingClientRect();if(o.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Y,d=F(a,[Y,Math.max(Y,u-l)]);c.style.minWidth=s+`px`,c.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,s=e.width+o,l=Math.max(s,t.width),u=window.innerWidth-Y,d=F(a,[Y,Math.max(Y,u-l)]);c.style.minWidth=s+`px`,c.style.right=d+`px`}let a=m(),s=window.innerHeight-Y*2,l=_.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),b=parseInt(u.paddingBottom,10),x=f+p+l+b+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Y,D=s-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=a.length>0&&v===a[a.length-1].ref.current;c.style.bottom=`0px`;let t=d.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);c.style.height=n+`px`}else{let e=a.length>0&&v===a[0].ref.current;c.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;c.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}c.style.margin=`${Y}px 0`,c.style.minHeight=S+`px`,c.style.maxHeight=s+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[m,o.trigger,o.valueNode,c,d,_,v,y,o.dir,r]);u(()=>S(),[S]);let[C,w]=N.useState();return u(()=>{d&&w(window.getComputedStyle(d).zIndex)},[d]),(0,I.jsx)(be,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:h,onScrollButtonChange:N.useCallback(e=>{e&&g.current===!0&&(S(),b?.(),g.current=!1)},[S,b]),children:(0,I.jsx)(`div`,{ref:l,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,I.jsx)(a.div,{...i,ref:p,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});_e.displayName=ge;var ve=`SelectPopperPosition`,ye=N.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Y,...a}=e,o=G(n);return(0,I.jsx)(h,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});ye.displayName=ve;var[be,xe]=U(J,{}),Se=`SelectViewport`,Ce=N.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...o}=e,s=X(Se,n),c=xe(Se,n),l=x(t,s.onViewportChange),u=N.useRef(0);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,I.jsx)(B.Slot,{scope:n,children:(0,I.jsx)(a.div,{"data-radix-select-viewport":``,role:`presentation`,...o,ref:l,style:{position:`relative`,flex:1,overflow:`hidden auto`,...o.style},onScroll:i(o.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=c;if(r?.current&&n){let e=Math.abs(u.current-t.scrollTop);if(e>0){let r=window.innerHeight-Y*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}u.current=t.scrollTop})})})]})});Ce.displayName=Se;var we=`SelectGroup`,[Te,Ee]=U(we),De=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=k();return(0,I.jsx)(Te,{scope:n,id:i,children:(0,I.jsx)(a.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});De.displayName=we;var Oe=`SelectLabel`,ke=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Ee(Oe,n);return(0,I.jsx)(a.div,{id:i.id,...r,ref:t})});ke.displayName=Oe;var Z=`SelectItem`,[Ae,je]=U(Z),Me=N.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:o=!1,textValue:s,...c}=e,l=K(Z,n),u=X(Z,n),d=l.value===r,[f,p]=N.useState(s??``),[m,h]=N.useState(!1),g=x(t,e=>u.itemRefCallback?.(e,r,o)),_=k(),v=N.useRef(`touch`),y=()=>{o||(l.onValueChange(r),l.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,I.jsx)(Ae,{scope:n,value:r,disabled:o,textId:_,isSelected:d,onItemTextChange:N.useCallback(e=>{p(t=>t||(e?.textContent??``).trim())},[]),children:(0,I.jsx)(B.ItemSlot,{scope:n,value:r,disabled:o,textValue:f,children:(0,I.jsx)(a.div,{role:`option`,"aria-labelledby":_,"data-highlighted":m?``:void 0,"aria-selected":d&&m,"data-state":d?`checked`:`unchecked`,"aria-disabled":o||void 0,"data-disabled":o?``:void 0,tabIndex:o?void 0:-1,...c,ref:g,onFocus:i(c.onFocus,()=>h(!0)),onBlur:i(c.onBlur,()=>h(!1)),onClick:i(c.onClick,()=>{v.current!==`mouse`&&y()}),onPointerUp:i(c.onPointerUp,()=>{v.current===`mouse`&&y()}),onPointerDown:i(c.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:i(c.onPointerMove,e=>{v.current=e.pointerType,o?u.onItemLeave?.():v.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:i(c.onPointerLeave,e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()}),onKeyDown:i(c.onKeyDown,e=>{u.searchRef?.current!==``&&e.key===` `||(R.includes(e.key)&&y(),e.key===` `&&e.preventDefault())})})})})});Me.displayName=Z;var Q=`SelectItemText`,Ne=N.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...o}=e,s=K(Q,n),c=X(Q,n),l=je(Q,n),d=ne(Q,n),[f,p]=N.useState(null),m=x(t,e=>p(e),l.onItemTextChange,e=>c.itemTextRefCallback?.(e,l.value,l.disabled)),h=f?.textContent,g=N.useMemo(()=>(0,I.jsx)(`option`,{value:l.value,disabled:l.disabled,children:h},l.value),[l.disabled,l.value,h]),{onNativeOptionAdd:_,onNativeOptionRemove:v}=d;return u(()=>(_(g),()=>v(g)),[_,v,g]),(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(a.span,{id:l.textId,...o,ref:m}),l.isSelected&&s.valueNode&&!s.valueNodeHasChildren?M.createPortal(o.children,s.valueNode):null]})});Ne.displayName=Q;var Pe=`SelectItemIndicator`,Fe=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return je(Pe,n).isSelected?(0,I.jsx)(a.span,{"aria-hidden":!0,...r,ref:t}):null});Fe.displayName=Pe;var Ie=`SelectScrollUpButton`,Le=N.forwardRef((e,t)=>{let n=X(Ie,e.__scopeSelect),r=xe(Ie,e.__scopeSelect),[i,a]=N.useState(!1),o=x(t,r.onScrollButtonChange);return u(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(Be,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Le.displayName=Ie;var Re=`SelectScrollDownButton`,ze=N.forwardRef((e,t)=>{let n=X(Re,e.__scopeSelect),r=xe(Re,e.__scopeSelect),[i,a]=N.useState(!1),o=x(t,r.onScrollButtonChange);return u(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,I.jsx)(Be,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});ze.displayName=Re;var Be=N.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...o}=e,s=X(`SelectScrollButton`,n),c=N.useRef(null),l=V(n),d=N.useCallback(()=>{c.current!==null&&(window.clearInterval(c.current),c.current=null)},[]);return N.useEffect(()=>()=>d(),[d]),u(()=>{l().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[l]),(0,I.jsx)(a.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:i(o.onPointerDown,()=>{c.current===null&&(c.current=window.setInterval(r,50))}),onPointerMove:i(o.onPointerMove,()=>{s.onItemLeave?.(),c.current===null&&(c.current=window.setInterval(r,50))}),onPointerLeave:i(o.onPointerLeave,()=>{d()})})}),Ve=`SelectSeparator`,He=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,I.jsx)(a.div,{"aria-hidden":!0,...r,ref:t})});He.displayName=Ve;var $=`SelectArrow`,Ue=N.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=G(n),a=K($,n),o=X($,n);return a.open&&o.position===`popper`?(0,I.jsx)(f,{...i,...r,ref:t}):null});Ue.displayName=$;var We=`SelectBubbleInput`,Ge=N.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=N.useRef(null),s=x(r,i),c=P(t);return N.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(c!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[c,t]),(0,I.jsx)(a.select,{...n,style:{...o,...n.style},ref:s,defaultValue:t})});Ge.displayName=We;function Ke(e){return e===``||e===void 0}function qe(e){let t=g(e),n=N.useRef(``),r=N.useRef(0),i=N.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=N.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return N.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Je(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Ye(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Ye(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Xe=re,Ze=q,Qe=oe,$e=ce,et=ue,tt=de,nt=Ce,rt=Me,it=Ne,at=Fe,ot=Le,st=ze;function ct({...e}){return(0,I.jsx)(Xe,{"data-slot":`select`,...e})}function lt({...e}){return(0,I.jsx)(Qe,{"data-slot":`select-value`,...e})}function ut({className:e,size:t=`default`,children:n,...i}){return(0,I.jsxs)(Ze,{"data-slot":`select-trigger`,"data-size":t,className:r(`flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground`,e),...i,children:[n,(0,I.jsx)($e,{asChild:!0,children:(0,I.jsx)(A,{className:`size-4 opacity-50`})})]})}function dt({className:e,children:t,position:n=`item-aligned`,align:i=`center`,...a}){return(0,I.jsx)(et,{children:(0,I.jsxs)(tt,{"data-slot":`select-content`,className:r(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:i,...a,children:[(0,I.jsx)(pt,{}),(0,I.jsx)(nt,{className:r(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1`),children:t}),(0,I.jsx)(mt,{})]})})}function ft({className:e,children:n,...i}){return(0,I.jsxs)(rt,{"data-slot":`select-item`,className:r(`relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...i,children:[(0,I.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,I.jsx)(at,{children:(0,I.jsx)(t,{className:`size-4`})})}),(0,I.jsx)(it,{children:n})]})}function pt({className:e,...t}){return(0,I.jsx)(ot,{"data-slot":`select-scroll-up-button`,className:r(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,I.jsx)(j,{className:`size-4`})})}function mt({className:e,...t}){return(0,I.jsx)(st,{"data-slot":`select-scroll-down-button`,className:r(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,I.jsx)(A,{className:`size-4`})})}export{lt as a,ut as i,dt as n,P as o,ft as r,A as s,ct as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{s as t}from"./select-JI5Kadjp.js";import{t as n}from"./globe-B0WEPp3h.js";import{t as r}from"./shortcut-hints-_J-i7rAL.js";import{B as i,C as a,Kt as o,Lt as s,S as c,Sc as l,Xt as u,b as d,bn as f,w as p,x as m,z as h}from"./index-CXuVkD6-.js";var g=o(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),_=e(l(),1),v=null,y=null;function b(){let[e,t]=(0,_.useState)(()=>v?{...v,isLoading:!1}:{defaultRunMode:`local`,hasFarm:!1,isLoading:!0});return(0,_.useEffect)(()=>{if(v){t({...v,isLoading:!1});return}y||=f().then(e=>{let t=e.config,n=t.farm;v={defaultRunMode:t.defaultRunMode===`farm`?`farm`:`local`,hasFarm:!!n?.provider}}).catch(()=>{v={defaultRunMode:`local`,hasFarm:!1}}).finally(()=>{y=null}),y.then(()=>{t({...v,isLoading:!1})})},[]),e}var x=u();function S({onRun:e,onRunNoCache:o,onPurgeCache:l,disabled:u=!1,size:f=`default`,className:_,label:v,shortcutKey:y,runButtonTourId:S}){let{hasFarm:C}=b(),w=C||!!o||!!l,T=v??`Run`,E=y?(0,x.jsx)(r,{shortcut:y,className:`border-primary-foreground/20 bg-primary-foreground/10 text-primary-foreground`}):null;return w?(0,x.jsxs)(`div`,{className:i(`inline-flex items-center`,_),children:[(0,x.jsxs)(h,{size:f,disabled:u,onClick:()=>e(!0),className:`rounded-r-none`,"data-tour-id":S,children:[(0,x.jsx)(s,{className:`size-4`}),T,E]}),(0,x.jsxs)(d,{children:[(0,x.jsx)(p,{asChild:!0,children:(0,x.jsx)(h,{variant:`default`,size:f,disabled:u,className:`rounded-l-none border-l border-l-primary-foreground/20 px-2`,children:(0,x.jsx)(t,{className:`h-4 w-4`})})}),(0,x.jsxs)(m,{align:`end`,children:[(0,x.jsxs)(c,{onClick:()=>e(!0),children:[(0,x.jsx)(g,{className:`mr-2 h-4 w-4`}),`Run Local`]}),C&&(0,x.jsxs)(c,{onClick:()=>e(!1),children:[(0,x.jsx)(n,{className:`mr-2 h-4 w-4`}),`Run on Farm`]}),(o||l)&&(0,x.jsx)(a,{}),o&&(0,x.jsx)(c,{onClick:()=>o(!0),children:`Run without cache`}),l&&(0,x.jsx)(c,{onClick:l,children:`Purge cache`})]})]})]}):(0,x.jsxs)(h,{size:f,disabled:u,onClick:()=>e(!0),className:_,"data-tour-id":S,children:[(0,x.jsx)(s,{className:`size-4`}),T,E]})}export{b as n,g as r,S as t};
@@ -1,5 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./monaco-editor-BQB4vEk_.js";import{a as n,c as r,i,l as a,n as ee,o,r as te,s as ne,t as s}from"./filename-validation-I94bcMf7.js";import{n as re}from"./split-button-BHdketN3.js";import{c as ie}from"./id-badge-CIbcJUv0.js";import{t as ae}from"./label-CYpyu7PJ.js";import{i as oe,n as se,r as ce,t as le}from"./tabs-CsAJVEvt.js";import{A as ue,Bt as de,D as c,F as fe,G as pe,I as me,M as he,N as ge,O as _e,P as ve,R as ye,Sc as l,Sr as u,Xt as be,Zt as xe,_c as Se,_n as Ce,an as we,bn as Te,gr as Ee,in as De,pr as Oe,qn as ke,r as Ae,ur as je,vc as Me,vr as Ne,y as d,yc as Pe,zt as Fe}from"./index-CXuVkD6-.js";import{t as Ie}from"./use-page-title-fn79XYtf.js";import{n as Le}from"./dist-Cy8QoEce.js";import{n as f,r as Re,t as ze}from"./resizable-om0nWp3k.js";import{t as Be}from"./empty-state-2mwYYmoQ.js";import{t as Ve}from"./use-keyboard-shortcuts-befVnBO6.js";import{i as He,n as Ue,r as We,t as Ge}from"./suite-navbar-D8RcUReD.js";var p=e(l(),1);function Ke(e,t){return s(e,t,`suiteMatch`)}var m=be(),qe=`name: My Suite
2
- target: ""
3
- tests: []
4
- `;function Je(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function Ye(e){return e instanceof DOMException&&e.name===`AbortError`||e instanceof Error&&e.name===`AbortError`}function Xe({text:e}){return(0,m.jsxs)(c,{children:[(0,m.jsx)(ue,{asChild:!0,children:(0,m.jsx)(Fe,{className:`h-3 w-3 text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors cursor-help`})}),(0,m.jsx)(_e,{className:`max-w-[250px] text-[13px]`,children:e})]})}function h(){let e=Me()[`suite-id`]??``,s=Se(),[ue]=Pe(),c=pe(),{defaultRunMode:_e}=re(),{targets:l,globalUse:be,isLoading:Fe}=ie(),h=!e,Ze=ue.get(`live`)===`1`,g=(0,p.useRef)(null),Qe=(0,p.useRef)(null),$e=(0,p.useRef)(()=>{}),et=(0,p.useRef)(!1),_=(0,p.useRef)(null),v=(0,p.useRef)(null),[y,b]=(0,p.useState)(h?qe:``),[tt,nt]=(0,p.useState)(``),[x,rt]=(0,p.useState)(``),[S,it]=(0,p.useState)(!h),[at,ot]=(0,p.useState)(!1),[st,ct]=(0,p.useState)(!1),[lt,ut]=(0,p.useState)(!1),[dt,ft]=(0,p.useState)(!1),[C,pt]=(0,p.useState)(null),[mt,ht]=(0,p.useState)(!1),[gt,_t]=(0,p.useState)(!1),[vt,yt]=(0,p.useState)([]),[w,T]=(0,p.useState)(null),[E,D]=(0,p.useState)(null),[O,k]=(0,p.useState)(!1),[A,j]=(0,p.useState)(!1),[M,N]=(0,p.useState)(null),[bt,P]=(0,p.useState)(`reasoning`),[xt,F]=(0,p.useState)(null),[I,L]=(0,p.useState)({setup:[],teardown:[]}),[St,Ct]=(0,p.useState)([]),[wt,Tt]=(0,p.useState)(!1),[R,Et]=(0,p.useState)(``),Dt=!h&&y!==tt,Ot=h&&x?Ke(x.trim(),vt):null,kt=h&&!!x&&!!Ot,{suggestions:At}=ee(null),jt=(0,p.useMemo)(()=>At.filter(e=>e.namespace!==`capture`),[At]),z=(0,p.useMemo)(()=>We(y),[y]),Mt=z?.suiteId??``,Nt=z?.name||(h?`New Suite`:R),B=n(w,{tests:(0,p.useMemo)(()=>z?z.tests.map(e=>({draftId:e.id,testId:e.id,path:e.test,name:e.test.split(`/`).pop()??e.test,steps:[],setup:[],teardown:[]})):[],[z]),setupHooks:I.setup,teardownHooks:I.teardown,allowReconnect:!0}),V=B.terminateSession,H=B.sessionGone;Qe.current=w,$e.current=V;let U=z?.target?.trim()??``,W=A?`connecting`:B.connectionState,G=w!==null,K=G&&B.platform===`web`&&U?U:null,Pt=(0,p.useMemo)(()=>i(y),[y]),q=G&&z!==null&&(!Je(z.setup??[],I.setup)||!Je(z.teardown??[],I.teardown)),Ft=G&&W===`connected`&&z!==null&&z.tests.length>0,It=A||G,Lt=A||G||dt||C!==null||h||z===null||!z?.target.trim()||Fe;Ie((0,p.useMemo)(()=>G&&E!==null?`Live #${E} — ${z?.name?.trim()||Nt||`Suite`}`:h?`New Suite`:`Edit Suite`,[G,E,z?.name,Nt,h]));let J=(0,p.useMemo)(()=>{if(z)return{suiteName:z.name,suiteContext:z.context||void 0}},[z]),Rt=(0,p.useMemo)(()=>M===`ended`?{reason:`ended`,title:`Live session ended`,description:`The current draft is unchanged. Close live mode or start a fresh disposable session from this target.`}:M===`disconnected`?{reason:`disconnected`,title:`Live session disconnected`,description:`The connection dropped and could not be restored. Start a fresh session to continue.`}:null,[M]);(0,p.useEffect)(()=>{if(h)return;let t=!1;return ke(e).then(e=>{t||(b(e.content),nt(e.content),Et(e.path),it(!1))}).catch(()=>{t||(ot(!0),it(!1))}),()=>{t=!0}},[e,h]),(0,p.useEffect)(()=>{let e=!1;return Te().then(t=>{if(e)return;let n=t.config?.workspace?.suiteMatch;Array.isArray(n)&&yt(n)}).catch(()=>{}),()=>{e=!0}},[]),(0,p.useEffect)(()=>{h&&b(e=>He(e,[`suite-id`],Le()))},[h]),(0,p.useEffect)(()=>{if(h||S)return;let e=We(y);e&&!e.suiteId&&b(e=>He(e,[`suite-id`],Le()))},[h,S,tt]);let Y=(0,p.useCallback)(async()=>{ct(!0);try{if(h){let e=Ke(x.trim(),vt);if(e){d.error(e);return}await we(x.trim(),y),d.success(`Suite file created`);let t=z?.suiteId??``;if(!t){d.error(`Created suite is missing suite-id; please reload`);return}s(u.suiteEdit(t))}else await Ee(e,y),nt(y),d.success(`Saved`)}catch(e){e instanceof xe&&e.missingTests&&e.missingTests.length>0?d.error(`Cannot save — referenced tests not found: ${e.missingTests.map(e=>e.test).join(`, `)}`):d.error(`Failed to save: ${e instanceof Error?e.message:String(e)}`)}finally{ct(!1)}},[h,x,vt,y,e,z?.suiteId,s]),zt=(0,p.useCallback)(async()=>{ut(!0);try{let e=await Ne(y);e.valid?d.success(`Valid suite`):d.error(e.errors.map(e=>e.message).join(`
5
- `))}catch(e){d.error(`Validation failed: ${e instanceof Error?e.message:String(e)}`)}finally{ut(!1)}},[y]),Bt=(0,p.useCallback)(async e=>{if(!h){ft(!0);try{pt((await Oe({file:R,local:e})).runId),d.success(`Suite run started`)}catch(e){d.error(`Failed to start run: ${e instanceof Error?e.message:String(e)}`)}finally{ft(!1)}}},[h,R]),Vt=(0,p.useCallback)(()=>pt(null),[]),X=(0,p.useCallback)(()=>{o(`page`,`closing live mode`,{liveSessionId:w??void 0,terminalReason:M??void 0}),g.current?.abort(),g.current=null,w&&V(),j(!1),T(null),D(null),N(null),F(null),_.current=null,v.current=null,L({setup:[],teardown:[]}),k(!1)},[w,M,V]),Ht=(0,p.useCallback)(()=>{o(`page`,`ending live session from UI`,{liveSessionId:w??void 0}),g.current?.abort(),g.current=null,w&&V(),j(!1),T(null),D(null),N(`ended`),F(null),_.current=null,v.current=null,L({setup:[],teardown:[]}),k(!1)},[w,V]),Z=(0,p.useCallback)(async(e,t)=>{let n=e.target.trim();if(!n){d.error(`Select a target before starting live mode`);return}let r=new AbortController;g.current?.abort(),g.current=r,k(!0),N(null),P(`reasoning`),F(null),_.current=null,v.current=null,j(!0);try{t?.replaceCurrentSession&&Qe.current&&(V(),T(null),D(null));let i=te({content:y,targetName:n,targets:l,globalUse:be});o(`page`,`requesting live session`,{targetName:n,platform:i.platform,headless:i.headless??void 0,replacingSession:t?.replaceCurrentSession??!1});let a=[...e.setup??[]],ee=[...e.teardown??[]],ne=e.suiteId?{type:`suite`,id:e.suiteId}:void 0,{sessionId:s,sessionNumber:re}=await De({...i,setupHooks:a,teardownHooks:ee,entity:ne},r.signal);if(r.signal.aborted)return;L({setup:a,teardown:ee}),T(s),D(re),o(`page`,`live session created`,{sessionId:s,targetName:n})}catch(e){Ye(e)||(o(`page`,`failed to create live session`,{error:e instanceof Error?e.message:String(e),targetName:n}),d.error(e instanceof Error?e.message:`Failed to start live session`)),t?.replaceCurrentSession||k(!1)}finally{g.current===r&&(g.current=null),j(!1)}},[y,be,l,V]),Q=(0,p.useCallback)(async()=>{if(!Lt){if(!z){d.error(`Fix YAML errors before starting live mode`);return}await Z(z)}},[z,Z,Lt]),Ut=(0,p.useCallback)(async()=>{if(G){if(!z){d.error(`Fix YAML errors before restarting live mode`);return}await Z(z,{replaceCurrentSession:!0})}},[z,G,Z]),$=(0,p.useCallback)(async()=>{if(!K){Ct([]);return}try{Ct((await Ce({target:K})).authStates)}catch{Ct([])}},[K]);(0,p.useEffect)(()=>{$()},[$]);let Wt=(0,p.useCallback)(async e=>{if(!w||!K)throw Error(`Could not save auth state "${e.name}" for target "${K??`selected target`}".`);let t=`Could not save auth state "${e.name}" for target "${K}".`;Tt(!0);try{await je(w,{name:e.name,replace:e.replace}),d.success(`Saved auth state "${e.name}" for target "${K}".`),await $()}catch{throw Error(t)}finally{Tt(!1)}},[K,w,$]),Gt=(0,p.useCallback)(e=>{if(e){k(!0);return}X()},[X]),Kt=(0,p.useCallback)((e,t)=>{if(!G){d.error(`Start a live session first.`);return}let n=(e===`setup`?B.setupHooks:B.teardownHooks).find(e=>e.id===t);n&&F({type:`suite-hook`,phase:e,hookId:n.id}),P(`reasoning`),B.executeHookById(e,t)},[G,B]),qt=(0,p.useCallback)(e=>{F({type:`test`,testIndex:e}),P(`reasoning`),B.executeTestByIndex(e,J)},[J,B]);if((0,p.useEffect)(()=>()=>{g.current?.abort(),Qe.current&&$e.current()},[]),(0,p.useEffect)(()=>{w&&W===`disconnected`&&(H||(o(`page`,`live session moved to terminal state`,{liveSessionId:w,liveConnectionState:W}),T(null),D(null),j(!1),N(`disconnected`),F(null),_.current=null,v.current=null,L({setup:[],teardown:[]}),k(!0)))},[W,H,w]),(0,p.useEffect)(()=>{if(!O||B.runningTestIndex===null)return;let e=`${B.tests[B.runningTestIndex]?.testExecutionId??`pending`}:${B.runningTestIndex}`;_.current!==e&&(_.current=e,F({type:`test`,testIndex:B.runningTestIndex}),P(`reasoning`))},[B.runningTestIndex,B.tests,O]),(0,p.useEffect)(()=>{if(!O||B.runningTestIndex!==null)return;let e=B.tests.map((e,t)=>({index:t,test:e})).filter(({test:e})=>e.status===`failed`).sort((e,t)=>(t.test.lastRunAt??``).localeCompare(e.test.lastRunAt??``))[0];if(!e)return;let t=e.test.testExecutionId??e.test.lastRunAt??`failed:${e.index}`;v.current!==t&&(v.current=t,F({type:`test`,testIndex:e.index}),P(`reasoning`))},[B.runningTestIndex,B.tests,O]),(0,p.useEffect)(()=>{!Ze||et.current||h||S||at||A||O||G||!z||!z.target.trim()||(et.current=!0,s(u.suiteEdit(e),{replace:!0}),Q())},[z,Q,G,h,A,S,O,s,at,e,Ze]),Ve((0,p.useMemo)(()=>({r:()=>{h||Bt(_e===`local`)},escape:()=>{C&&Vt()}}),[h,C,Bt,Vt,_e])),(0,p.useEffect)(()=>{function e(e){(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),Y())}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[Y]),S)return(0,m.jsx)(Ae,{});if(at)return(0,m.jsx)(Be,{icon:de,title:`Suite not found`,description:`This suite doesn't exist`,actionLabel:`View All Suites`,onAction:()=>s(u.suites)});let Jt=(0,m.jsxs)(le,{defaultValue:`builder`,className:`flex-1 flex min-h-0 flex-col`,children:[(0,m.jsxs)(ce,{variant:`line`,className:`px-4`,children:[(0,m.jsx)(oe,{value:`builder`,children:`Builder`}),(0,m.jsx)(oe,{value:`yaml`,children:`YAML`})]}),(0,m.jsx)(se,{value:`builder`,className:`mt-2 flex-1 overflow-auto [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:bg-border [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb:hover]:bg-muted-foreground/50 [&::-webkit-scrollbar-track]:bg-transparent [scrollbar-width:thin]`,children:(0,m.jsx)(Ue,{content:y,onChange:b,suggestions:jt,isCreateMode:h,liveMode:O,liveTests:B.tests,liveSetupHooks:B.setupHooks,liveTeardownHooks:B.teardownHooks,runningTestIndex:B.runningTestIndex,canRunTest:G&&B.connectionState===`connected`,canRunAll:Ft,isRunningAll:B.isRunningAllTests,isStoppingRunAll:B.isStoppingRunAllTests,onRunTest:qt,onCancelTest:e=>{B.runningTestIndex===e&&B.cancelStep()},onRunAll:()=>void B.runAllTests(J),onStopAll:B.cancelRunAllTests,setupHooksStale:q,onRestartSession:q?()=>void Ut():void 0,selection:xt,onSelect:F,onRunLiveHook:Kt})}),(0,m.jsx)(se,{value:`yaml`,className:`flex-1 min-h-0 mt-2`,children:(0,m.jsx)(t,{value:y,onChange:b,onSave:Y,className:`h-full`,filePath:R||void 0})})]}),Yt=(0,m.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[h&&(0,m.jsx)(`div`,{className:`px-4 pt-3`,children:(0,m.jsxs)(`div`,{className:`rounded-md border bg-muted/15 px-3 py-2`,children:[(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,m.jsxs)(ae,{className:`flex items-center gap-1 text-xs font-medium`,children:[`File Path `,(0,m.jsx)(Xe,{text:`Path is relative to your workspace root. Must match your workspace's suiteMatch pattern. Directories are created automatically on save.`})]}),(0,m.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Created only when you save`})]}),(0,m.jsx)(ye,{placeholder:`my-suite.suite.yaml`,value:x,onChange:e=>rt(e.target.value),className:`mt-2 max-w-md h-8 text-sm font-mono ${kt?`border-red-500 focus-visible:ring-red-500`:``}`}),kt&&(0,m.jsx)(`p`,{className:`mt-1 text-xs text-red-500`,children:Ot})]})}),Jt]}),Xt=(0,m.jsx)(ne,{connectionState:B.connectionState,isLaunching:A,targetName:U||`Selected Target`,targetLabel:B.currentUrl||`Configured start URL`,liveSessionNumber:E,platform:B.platform,liveSessionId:w,sessionGone:B.sessionGone,currentUrl:B.currentUrl,pendingNavigation:B.pendingNavigation,steps:B.steps,setupHooks:B.setupHooks,teardownHooks:B.teardownHooks,tests:B.tests,selection:xt,runningStepId:B.runningStepId,terminalState:Rt,draftState:z===null?`invalid`:Dt||h?`unsaved`:`saved`,ariaTree:B.ariaTree,errorMessage:B.error,devtoolsTab:bt,canRunAll:Ft,isRunningAll:B.isRunningAllTests,isStoppingRunAll:B.isStoppingRunAllTests,setupHooksStale:q,executionUnit:`test`,runAllLabel:`Run All Tests`,stopAllLabel:`Stop Run All`,unitRowsSlot:null,onDevtoolsTabChange:P,onRunAll:()=>void B.runAllTests(J),onStopAll:B.cancelRunAllTests,onEndSession:Ht,onRestartSession:q?()=>void Ut():void 0,showEndSessionAction:c,onCloseLiveMode:X,onStartFreshSession:()=>void(H?Ut():Q()),onBack:B.goBack,onForward:B.goForward,onRefresh:B.refreshPage,onNavigate:B.navigate,onRequestAriaTree:B.requestAriaTree,authStateCapture:K&&w?{sessionId:w,targetName:K,initialName:Pt,authStates:St,isSaving:wt,onSave:Wt}:null});return(0,m.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,m.jsx)(Ge,{suiteName:Nt,suiteId:Mt,unsaved:Dt,isCreateMode:h,mode:`edit`,suiteHref:h?void 0:u.suiteView(e),isSaving:st,isValidating:lt,isRunning:dt,runDisabled:It,hasInvalidFilename:kt,shortcutsOpen:gt,hasLiveSession:G,liveConnectionState:W,isLiveActionDisabled:Lt,liveSessionNumber:E,onBack:()=>s(u.suites),onSave:Y,onValidate:zt,onRun:Bt,onLiveConnect:O?void 0:Q,onLiveEnd:G?Ht:void 0,onSettingsOpen:()=>ht(!0),onToggleShortcuts:()=>_t(e=>!e)}),C?(0,m.jsxs)(Re,{orientation:`horizontal`,className:`flex-1 rounded-md border border-border`,children:[(0,m.jsx)(f,{defaultSize:60,minSize:30,children:(0,m.jsx)(t,{value:y,onChange:b,onSave:Y,className:`h-full`})}),(0,m.jsx)(ze,{withHandle:!0}),(0,m.jsx)(f,{defaultSize:40,minSize:25,children:(0,m.jsx)(r,{runId:C,onClose:Vt})})]}):O&&!c?(0,m.jsxs)(Re,{orientation:`horizontal`,className:`flex-1 rounded-md border border-border`,children:[(0,m.jsx)(f,{defaultSize:45,minSize:30,children:Yt}),(0,m.jsx)(ze,{withHandle:!0}),(0,m.jsx)(f,{defaultSize:55,minSize:40,children:Xt})]}):Yt,(0,m.jsx)(he,{open:mt,onOpenChange:ht,children:(0,m.jsxs)(ge,{side:`right`,className:`sm:max-w-[400px] overflow-y-auto p-0`,children:[(0,m.jsxs)(fe,{className:`px-4 pt-4 pb-2`,children:[(0,m.jsx)(me,{children:`Suite Settings`}),(0,m.jsx)(ve,{children:`Advanced configuration for this suite`})]}),(0,m.jsx)(`div`,{className:`px-4 pb-4`,children:(0,m.jsx)(a,{content:y,onChange:b,selectedTarget:z?.target,showMeta:!1})})]})}),c&&(0,m.jsx)(he,{open:O,onOpenChange:Gt,children:(0,m.jsxs)(ge,{side:`bottom`,showCloseButton:!1,className:`h-[100dvh] max-h-[100dvh] rounded-none p-0`,children:[(0,m.jsxs)(fe,{className:`sr-only`,children:[(0,m.jsx)(me,{children:`Live Session`}),(0,m.jsx)(ve,{children:`Live execution workspace for the current suite draft.`})]}),Xt]})})]})}export{h as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{f as t,o as n}from"./use-clipboard-copy-Bmyv0FFY.js";import{a as r,i,n as a,r as o,t as s}from"./select-JI5Kadjp.js";import{r as c,t as l}from"./textarea-BP7XqG3v.js";import{t as u}from"./circle-dashed-WDoZ8ADk.js";import{n as d,r as f}from"./monaco-editor-BQB4vEk_.js";import{t as p}from"./circle-x-1lf_9y_c.js";import{t as m}from"./globe-B0WEPp3h.js";import{t as h}from"./grip-vertical-B87oMfre.js";import{n as g,r as _,t as v}from"./shortcut-hints-_J-i7rAL.js";import{t as y}from"./split-button-BHdketN3.js";import{t as b}from"./plus-DNc2RueT.js";import{t as x}from"./refresh-cw-BQdOC6UA.js";import{C as S,S as C,_ as w,a as T,b as E,c as D,d as O,f as ee,g as k,h as A,l as j,m as te,n as M,o as N,p as P,r as F,s as I,t as L,u as ne,v as re,w as R,x as ie,y as ae}from"./id-badge-CIbcJUv0.js";import{t as z}from"./label-CYpyu7PJ.js";import{n as oe,r as B,t as V}from"./popover-DThBIgGA.js";import{$n as se,A as H,B as U,D as W,Ht as G,Lt as ce,Mt as le,Nt as K,O as q,Pt as ue,R as de,Rt as fe,Sc as J,Ut as Y,Xt as pe,c as me,d as he,hc as X,l as ge,o as _e,s as ve,u as ye,z as Z,zt as be}from"./index-CXuVkD6-.js";import{t as xe}from"./badge-B-yh3kbi.js";import{n as Se}from"./dist-Cy8QoEce.js";import{r as Ce}from"./display-step-opeACkeD.js";var Q=e(J(),1),$=pe();function we({text:e}){return(0,$.jsxs)(W,{children:[(0,$.jsx)(H,{asChild:!0,children:(0,$.jsx)(be,{className:`h-3 w-3 text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors cursor-help`})}),(0,$.jsx)(q,{className:`max-w-[250px] text-[13px]`,children:e})]})}function Te({name:e,suiteId:n,target:c,context:u,isCreateMode:d,suggestions:f,hookLabels:p={},onChange:h,disabled:g=!1}){let{targets:_,isLoading:v}=j(),{targets:y}=D(),b=c?y[c]:void 0,S=(0,Q.useRef)(null),[C,w]=(0,Q.useState)(0),E=T({text:u,cursorPos:C,suggestions:f,anchorRef:S,onInsert:(e,t,n)=>{h(`context`,u.slice(0,t)+e+u.slice(n)),requestAnimationFrame(()=>S.current?.focus())}}),O=!v&&_.length>0;return(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(z,{htmlFor:`suite-name`,className:`text-xs flex items-center gap-1`,children:[`Suite Name `,(0,$.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,$.jsx)(de,{id:`suite-name`,value:e,onChange:e=>h(`name`,e.target.value),placeholder:`My Suite`,required:!0,disabled:g,className:`h-8 text-sm`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(z,{htmlFor:`suite-id`,className:`text-xs flex items-center gap-1`,children:[`Suite ID `,(0,$.jsx)(we,{text:`Unique identifier used for memory and analytics. Changing this breaks the association with past runs and observations.`})]}),d?(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(de,{id:`suite-id`,value:n,readOnly:!0,disabled:!0,className:`h-8 text-sm font-mono pr-9`}),(0,$.jsx)(Z,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:()=>h(`suite-id`,Se()),"aria-label":`Generate new ID`,disabled:g,className:`absolute right-1 top-1/2 -translate-y-1/2 h-6 w-6`,children:(0,$.jsx)(x,{className:`size-3.5`})})]}):(0,$.jsx)(`p`,{className:`text-[13px] font-mono text-muted-foreground`,children:n||`No ID assigned`})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(z,{htmlFor:`suite-target`,className:`text-xs flex items-center gap-1`,children:[`Target `,(0,$.jsx)(`span`,{className:`text-destructive`,children:`*`}),` `,(0,$.jsx)(we,{text:`A registered app target from your workspace config. Defines where the suite runs (web URL or mobile app).`})]}),O?(0,$.jsxs)(s,{value:c||void 0,onValueChange:e=>h(`target`,e),disabled:g,children:[(0,$.jsx)(i,{id:`suite-target`,className:`w-full h-8 text-sm`,children:(0,$.jsx)(r,{placeholder:`Select a target`})}),(0,$.jsx)(a,{children:_.map(e=>(0,$.jsx)(o,{value:e,children:e},e))})]}):v?null:(0,$.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[`No targets configured.`,` `,(0,$.jsx)(X,{to:`/config`,className:`text-primary underline underline-offset-4 hover:text-primary/80`,children:`Add targets in Settings.`})]}),b&&(0,$.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[13px] text-muted-foreground mt-1.5`,children:[b.platform===`web`?(0,$.jsx)(m,{className:`h-3.5 w-3.5 shrink-0`}):(0,$.jsx)(t,{className:`h-3.5 w-3.5 shrink-0`}),(0,$.jsx)(`span`,{className:`text-muted-foreground/70 uppercase text-[11px] tracking-wider shrink-0`,children:b.platform}),(0,$.jsxs)(`span`,{className:`font-mono truncate`,children:[b.product&&(0,$.jsx)(`span`,{className:`mr-1.5`,children:b.product}),b.platform===`web`&&b.url,b.platform===`android`&&`${b.appPackage}${b.appActivity?` / ${b.appActivity}`:``}`,b.platform===`ios`&&b.bundleId]})]})]}),(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(z,{htmlFor:`suite-context`,className:`text-xs flex items-center gap-1`,children:[`Context `,(0,$.jsx)(we,{text:`Additional instructions passed to every test in this suite before its own context. Use this for suite-wide setup notes or shared preconditions.`})]}),(0,$.jsxs)(`div`,{className:`relative`,children:[(0,$.jsx)(l,{ref:S,id:`suite-context`,value:u,onChange:e=>{h(`context`,e.target.value),w(e.target.selectionStart??0)},onKeyDown:e=>{E.handleKeyDown(e)},onBlur:()=>setTimeout(()=>E.setVisible(!1),150),placeholder:`Additional instructions applied to every test in this suite...`,disabled:g,className:`min-h-[60px] resize-none text-sm`,rows:2}),E.dropdown]}),I(u)&&(0,$.jsx)(N,{text:u,hookLabels:p})]})]})}function Ee(e){if(e<1e3)return`${Math.round(e)}ms`;let t=e/1e3;return t<10?`${t.toFixed(1)}s`:`${Math.round(t)}s`}function De({status:e}){switch(e){case`running`:return(0,$.jsx)(u,{className:`size-3 text-primary`});case`passed`:return(0,$.jsx)(G,{className:`size-3 text-emerald-500`});case`failed`:return(0,$.jsx)(ue,{className:`size-3 text-destructive`});default:return(0,$.jsx)(K,{className:`size-3 text-muted-foreground`})}}function Oe({status:e}){switch(e){case`running`:case`cancelling`:return(0,$.jsx)(u,{className:`size-3 text-primary`});case`passed`:return(0,$.jsx)(G,{className:`size-3 text-emerald-500`});case`failed`:return(0,$.jsx)(p,{className:`size-3 text-red-500`});case`cancelled`:return(0,$.jsx)(S,{className:`size-3 text-amber-500`});default:return(0,$.jsx)(u,{className:`size-3 text-muted-foreground/50`})}}function ke(e){return e.observation?e.observation:e.reasoning?e.reasoning:e.plannedAction==null?e.verifierReasoning?e.verifierReasoning:e.result===`no-input`?n[`no-input`]:e.result:`Planned action captured`}function Ae({id:e,name:t,path:n,testId:r,isMissing:i,onRemove:a,disabled:o=!1,actionsLocked:s=!1,sortableDisabled:c=!1,liveMode:l=!1,liveStatus:d=`idle`,liveDuration:f,liveError:m=null,liveSteps:g=[],runningStepIndex:_=null,perTestSetupHooks:v=[],perTestTeardownHooks:y=[],canRunTest:b=!0,onRunTest:x,onCancelTest:w,testIndex:T,selection:E=null,onSelect:D}){let{attributes:O,listeners:ee,setNodeRef:k,transform:A,transition:j,isDragging:M}=te({id:e,disabled:o||c}),N={transform:C.Transform.toString(A),transition:j,opacity:M?.55:1,zIndex:M?10:void 0},P=l&&d===`running`,F=l&&d===`passed`,I=l&&d===`failed`,L=l&&(F||I||l&&d===`cancelled`)&&f!=null,ne=l&&E?.type===`test`&&T!==void 0&&E.testIndex===T,re=l&&v.length+y.length>0,R=l?g.map(e=>({step:e,displayStep:Ce(e,e.stepIndex)})):[],ie=E&&`stepId`in E?E.stepId:null,ae=E?.type===`subaction`?E.subIndex:null;return(0,$.jsxs)(`div`,{ref:k,style:N,className:U(`relative overflow-hidden flex flex-col gap-0.5 rounded-md border bg-card/60 px-3 py-2 hover:bg-card transition-colors`,i&&`border-amber-500/30`,i&&`bg-amber-500/[0.06]`,!i&&`border-border/70`,M&&`shadow-lg ring-2 ring-primary/20`,o&&`opacity-60`,P&&`live-running-surface border-border/60 bg-primary/5`,I&&!P&&`border-destructive/30`,I&&!P&&!ne&&`ring-1 ring-destructive/20`,ne&&!P&&`bg-primary/10 ring-1 ring-primary/30`),children:[(0,$.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,$.jsx)(`button`,{type:`button`,className:`mt-0.5 flex shrink-0 items-center p-0.5 text-muted-foreground/40 hover:text-muted-foreground cursor-grab active:cursor-grabbing touch-none disabled:cursor-not-allowed`,...O,...ee,"aria-label":`Reorder ${t}`,"aria-disabled":o||c,disabled:o||c,children:(0,$.jsx)(h,{className:`size-3.5`})}),P&&(0,$.jsx)(u,{className:`size-4 shrink-0 mt-0.5 text-primary`}),F&&(0,$.jsx)(G,{className:`size-3.5 text-emerald-500 shrink-0 mt-1`}),I&&(0,$.jsx)(p,{className:`size-3.5 text-red-500 shrink-0 mt-1`}),(0,$.jsxs)(`div`,{className:U(`flex-1 min-w-0 space-y-0.5`,l&&D&&`cursor-pointer`),onClick:l&&D&&T!==void 0?()=>D({type:`test`,testIndex:T}):void 0,children:[(0,$.jsx)(`div`,{className:`text-sm font-medium text-foreground truncate`,children:t}),(0,$.jsx)(`div`,{className:`text-[11px] font-mono text-muted-foreground truncate`,children:n}),(0,$.jsx)(`div`,{className:`text-[10px] font-mono text-muted-foreground/70 truncate`,children:r}),R.length>0&&(0,$.jsx)(`div`,{className:`mt-1.5 space-y-1.5`,children:R.map(({step:e,displayStep:t},n)=>{let r=e.status===`running`||_===e.stepIndex,i=ne&&ie===null&&(r||_===null&&n===R.length-1),a=ie===e.id||i,o=t.liveSubActions??[];return(0,$.jsxs)(`div`,{className:U(`relative overflow-hidden rounded-sm border bg-background/60`,r?`live-running-surface border-border/60 bg-primary/5`:a?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-border/60`),children:[(0,$.jsxs)(`button`,{type:`button`,className:`flex w-full min-w-0 items-center gap-2 px-2 py-1.5 text-left`,onClick:t=>{t.stopPropagation(),D?.({type:`step`,stepId:e.id})},"aria-label":`Select step ${e.stepIndex+1} ${e.instruction}`,children:[(0,$.jsx)(Oe,{status:e.status}),(0,$.jsxs)(`span`,{className:`shrink-0 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:[`Step `,e.stepIndex+1]}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-foreground`,children:e.instruction})]}),(r||a)&&(0,$.jsxs)(`div`,{className:`flex flex-wrap gap-x-2 gap-y-0.5 px-2 pb-1 text-[11px] text-muted-foreground`,children:[r&&(0,$.jsx)(`span`,{children:`Current step`}),a&&(0,$.jsx)(`span`,{children:`Inspecting below`})]}),o.length>0&&(0,$.jsx)(`div`,{className:`space-y-1 border-t border-border/50 px-2 py-1.5`,children:o.map(t=>(0,$.jsxs)(`button`,{type:`button`,className:U(`flex w-full min-w-0 items-center gap-2 rounded-sm px-1.5 py-1 text-left text-[11px] transition-colors`,a&&ae===t.index?`bg-primary/15 text-foreground`:`text-muted-foreground hover:bg-muted/40`),onClick:n=>{n.stopPropagation(),D?.({type:`subaction`,stepId:e.id,subIndex:t.index})},"aria-label":`Select sub-action ${t.index+1} for step ${e.stepIndex+1}`,children:[(0,$.jsxs)(`span`,{className:`shrink-0 font-medium`,children:[`Sub `,t.index+1]}),(0,$.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:ke(t)})]},`${e.id}-sub-${t.index}`))})]},e.id)})}),i&&(0,$.jsx)(`div`,{className:`text-[11px] text-amber-700 dark:text-amber-300`,children:`This test file no longer exists in your workspace.`})]}),(0,$.jsxs)(`div`,{className:`mt-0.5 flex shrink-0 self-start items-center gap-1`,children:[L&&(0,$.jsx)(`span`,{className:`text-xs leading-none text-muted-foreground whitespace-nowrap shrink-0`,children:Ee(f)}),l&&!P&&(0,$.jsx)(Z,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:x,disabled:!b||!x||s,className:U(`text-muted-foreground hover:text-foreground`,(!b||!x||s)&&`text-muted-foreground/30`),"aria-label":d===`idle`?`Run test ${t}`:`Re-run test ${t}`,children:(0,$.jsx)(ce,{className:`size-3.5`})}),l&&P&&w&&(0,$.jsx)(Z,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:w,className:`text-muted-foreground hover:text-foreground`,"aria-label":`Cancel test ${t}`,children:(0,$.jsx)(S,{className:`size-3`})}),(0,$.jsx)(Z,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground hover:text-destructive`,onClick:a,disabled:o||s,"aria-label":`Remove ${t}`,children:(0,$.jsx)(le,{className:`size-3.5`})})]})]}),I&&m&&(0,$.jsxs)(`p`,{className:`text-destructive text-xs mt-1 ml-7 line-clamp-2`,children:[m,` — see Reasoning tab for details`]}),re&&(0,$.jsxs)(`ul`,{className:`mt-1.5 space-y-1 pl-5`,children:[v.map(e=>{let t=E?.type===`test-hook`&&E.hookId===e.id;return(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>T!==void 0&&D?.({type:`test-hook`,testIndex:T,phase:`setup`,hookId:e.id}),className:U(`relative flex w-full items-center gap-2 overflow-hidden rounded-sm border px-1.5 py-0.5 text-left transition-colors`,e.status===`running`?`live-running-surface border-border/60 bg-primary/5`:t?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-transparent bg-transparent hover:bg-muted/40`),children:[(0,$.jsx)(K,{className:`size-3 text-muted-foreground shrink-0`}),(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground truncate flex-1`,children:[`setup: `,e.name]}),(0,$.jsx)(De,{status:e.status})]})},`setup-${e.id}`)}),y.map(e=>{let t=E?.type===`test-hook`&&E.hookId===e.id;return(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>T!==void 0&&D?.({type:`test-hook`,testIndex:T,phase:`teardown`,hookId:e.id}),className:U(`relative flex w-full items-center gap-2 overflow-hidden rounded-sm border px-1.5 py-0.5 text-left transition-colors`,e.status===`running`?`live-running-surface border-border/60 bg-primary/5`:t?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-transparent bg-transparent hover:bg-muted/40`),children:[(0,$.jsx)(K,{className:`size-3 text-muted-foreground shrink-0`}),(0,$.jsxs)(`span`,{className:`text-xs text-muted-foreground truncate flex-1`,children:[`teardown: `,e.name]}),(0,$.jsx)(De,{status:e.status})]})},`teardown-${e.id}`)})]})]})}function je({availableTests:e,onAdd:t,disabled:n=!1}){return e.length===0?(0,$.jsxs)(`div`,{className:`rounded-md border bg-card/20 p-3 text-sm text-muted-foreground`,children:[`No test files found.`,` `,(0,$.jsx)(X,{to:`/tests/new`,className:`text-primary underline underline-offset-4 hover:text-primary/80`,children:`Create a test first.`})]}):(0,$.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,$.jsxs)(_e,{className:`rounded-md border`,children:[(0,$.jsx)(ge,{placeholder:`Search by test name, path, or ID...`,disabled:n}),(0,$.jsxs)(he,{className:`max-h-64`,children:[(0,$.jsx)(ve,{children:`No tests match your query.`}),(0,$.jsx)(me,{children:e.map(e=>(0,$.jsx)(ye,{value:`${e.name} ${e.path} ${e.testId??``}`,onSelect:()=>t({test:e.path,id:e.testId??``}),disabled:n,className:`px-2 py-1.5`,children:(0,$.jsxs)(`div`,{className:`flex flex-col gap-0.5 w-full min-w-0`,children:[(0,$.jsx)(`span`,{className:`text-sm font-medium truncate`,children:e.name}),(0,$.jsx)(`span`,{className:`text-[11px] font-mono text-muted-foreground truncate`,children:e.path}),(0,$.jsx)(`span`,{className:`text-[10px] font-mono text-muted-foreground/70 truncate`,children:e.testId??``})]})},e.path))})]})]}),(0,$.jsx)(`p`,{className:`text-[10px] text-muted-foreground/60`,children:`Type to filter by name, path, or test ID. Click to add. Same test can be added multiple times.`})]})}var Me=[`name`,`suite-id`,`target`,`use`,`context`,`setup`,`tests`,`teardown`];function Ne(e){function t(e,n){if(F(e)){n?e.items.sort((e,t)=>{let n=Me.indexOf(String(e.key)),r=Me.indexOf(String(t.key));return(n===-1?Me.length:n)-(r===-1?Me.length:r)}):e.items.sort((e,t)=>String(e.key).localeCompare(String(t.key)));for(let n of e.items)t(n.value,!1)}}t(e.contents,!0)}function Pe(e){return Ne(e),e.toString()}function Fe(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function Ie(e){return Array.isArray(e)?e.map(e=>{if(e&&typeof e==`object`&&`test`in e&&`id`in e){let t=e;if(typeof t.test==`string`&&typeof t.id==`string`)return{test:t.test,id:t.id}}return null}).filter(e=>e!==null):[]}function Le(e){try{let t=M(e);if(t.errors.length>0)return null;let n=t.toJSON();return!n||typeof n!=`object`?null:{name:n.name??``,suiteId:n[`suite-id`]??``,target:n.target??``,context:n.context??``,setup:Fe(n.setup),teardown:Fe(n.teardown),tests:Ie(n.tests)}}catch{return null}}function Re(e,t,n){try{let r=M(e);return n===void 0||Array.isArray(n)&&n.length===0||n===``?r.deleteIn(t):r.setIn(t,n),Pe(r)}catch{return e}}function ze(e,t,n){try{if(t===n||t<0||n<0)return e;let r=M(e),i=Ie(r.toJSON()?.tests);if(t>=i.length||n>=i.length)return e;let a=[...i],[o]=a.splice(t,1);return a.splice(n,0,o),r.setIn([`tests`],a),Pe(r)}catch{return e}}function Be(e,t){try{let n=M(e),r=Ie(n.toJSON()?.tests);return n.setIn([`tests`],[...r,t]),Pe(n)}catch{return e}}function Ve(e,t){try{let n=M(e),r=Ie(n.toJSON()?.tests);if(t<0||t>=r.length)return e;let i=r.filter((e,n)=>n!==t);return i.length===0?n.deleteIn([`tests`]):n.setIn([`tests`],i),Pe(n)}catch{return e}}function He({text:e}){return(0,$.jsxs)(W,{children:[(0,$.jsx)(H,{asChild:!0,children:(0,$.jsx)(be,{className:`h-3 w-3 text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors cursor-help`})}),(0,$.jsx)(q,{className:`max-w-[250px] text-[13px]`,children:e})]})}function Ue({status:e}){switch(e){case`running`:return(0,$.jsx)(u,{className:`size-3.5 text-primary`});case`passed`:return(0,$.jsx)(G,{className:`size-3.5 text-emerald-500`});case`failed`:return(0,$.jsx)(ue,{className:`size-3.5 text-destructive`});default:return(0,$.jsx)(K,{className:`size-3.5 text-muted-foreground`})}}function We(e){return e===`running`||e===`cancelling`}function Ge(e){return e===`running`||e===`cancelling`}function Ke(e){return e===`running`}function qe(e){return e.some(e=>Ke(e.status))}function Je(e){return We(e.status)||e.runningStepIndex!==null||e.liveSteps.some(e=>Ge(e.status))||qe(e.perTestSetupHooks)||qe(e.perTestTeardownHooks)}function Ye({title:e,hooks:t,selection:n,onSelect:r}){return t.length===0?null:(0,$.jsxs)(`div`,{className:`space-y-1`,children:[(0,$.jsx)(`div`,{className:`text-[10px] uppercase tracking-wider font-medium text-muted-foreground`,children:e}),(0,$.jsx)(`ul`,{className:`space-y-1`,children:t.map(e=>{let t=n?.type===`suite-hook`&&n.hookId===e.id;return(0,$.jsx)(`li`,{children:(0,$.jsxs)(`button`,{type:`button`,onClick:()=>r?.({type:`suite-hook`,phase:e.phase,hookId:e.id}),className:U(`relative flex w-full items-center gap-2 overflow-hidden rounded-md border px-3 py-1.5 text-left transition-colors`,e.status===`running`?`live-running-surface border-border/60 bg-primary/5`:t?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-border/60 bg-card/40 hover:bg-card/60`),children:[(0,$.jsx)(Ue,{status:e.status}),(0,$.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,$.jsx)(`div`,{className:`truncate text-sm`,children:e.name}),(0,$.jsx)(`div`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:e.id})]})]})},e.id)})})]})}function Xe({content:e,onChange:t,disabled:n=!1,suggestions:r,isCreateMode:i=!1,liveMode:a=!1,liveTests:o=[],liveSetupHooks:s=[],liveTeardownHooks:l=[],runningTestIndex:u=null,canRunTest:d=!0,canRunAll:p=!1,isRunningAll:m=!1,isStoppingRunAll:h=!1,onRunTest:g,onCancelTest:_,onRunAll:v,onStopAll:y,onRunLiveHook:x,setupHooksStale:C=!1,onRestartSession:T,selection:D=null,onSelect:j}){let te=(0,Q.useRef)(null),{hooks:M,warningCopy:N}=ne(),F=M??[],I=(0,Q.useMemo)(()=>Object.fromEntries(F.map(e=>[e.id,e.name])),[F]),[L,R]=(0,Q.useState)([]),[z,oe]=(0,Q.useState)(!1);(0,Q.useEffect)(()=>{se().then(e=>R(e.files)).catch(()=>{})},[]),(0,Q.useEffect)(()=>{if(!z)return;function e(e){e.key===`Escape`&&oe(!1)}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[z]);let B=Le(e),V=B===null,H=B??te.current;B&&(te.current=B);let U=ie(E(re,{activationConstraint:{distance:8}}),E(w,{coordinateGetter:P})),W=(0,Q.useCallback)((n,r)=>{t(Re(e,[n],r))},[e,t]),G=(0,Q.useCallback)(n=>{t(Be(e,n))},[e,t]),ce=(0,Q.useCallback)(n=>{t(Ve(e,n))},[e,t]),le=H?.tests.map((e,t)=>`test-${t}`)??[],q=a&&(m||h),de=a&&(u!==null||o.some(e=>Je(e))||qe(s)||qe(l)),J=q||de,Y=q,pe=n||V||J,me=(0,Q.useCallback)(r=>{if(n||V||J)return;let{active:i,over:a}=r;if(!a||i.id===a.id)return;let o=parseInt(String(i.id).replace(`test-`,``),10),s=parseInt(String(a.id).replace(`test-`,``),10);if(Number.isNaN(o)||Number.isNaN(s))return;let c=ze(e,o,s);c!==e&&t(c)},[e,n,t,J,V]);return(0,$.jsx)(`div`,{className:`flex flex-col`,children:(0,$.jsxs)(`div`,{className:`space-y-4 p-4`,children:[V&&(0,$.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive`,children:[(0,$.jsx)(c,{className:`size-4 shrink-0`}),(0,$.jsx)(`span`,{children:`YAML has errors — builder shows last valid state`})]}),a&&C&&(0,$.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-700 dark:text-amber-300`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2`,children:[(0,$.jsx)(ue,{className:`mt-0.5 size-4 shrink-0`}),(0,$.jsx)(`span`,{children:`Setup hooks changed — restart session to re-apply the latest setup and teardown hooks.`})]}),T&&(0,$.jsx)(Z,{type:`button`,size:`sm`,className:`shrink-0`,onClick:T,children:`Restart Live Session`})]}),H?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Te,{name:H.name,suiteId:H.suiteId,target:H.target,context:H.context,isCreateMode:i,suggestions:r,hookLabels:I,onChange:W,disabled:n||V}),a&&(0,$.jsx)(Ye,{title:`Setup Hooks (Live)`,hooks:s,selection:D,onSelect:j}),(0,$.jsxs)(`div`,{className:`space-y-3 rounded-md border bg-card/20 p-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsx)(K,{className:`size-4 text-muted-foreground`}),(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Hooks`})]}),(0,$.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/50`,children:[H.setup.length+H.teardown.length,` `,H.setup.length+H.teardown.length===1?`hook`:`hooks`]})]}),N&&(0,$.jsxs)(`div`,{className:`flex gap-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300`,children:[(0,$.jsx)(c,{className:`mt-0.5 size-3.5 shrink-0`}),(0,$.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,$.jsx)(`p`,{className:`font-medium`,children:N.title}),(0,$.jsx)(`p`,{children:N.body})]})]}),(0,$.jsxs)(`div`,{className:`space-y-3`,children:[(0,$.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Search hook names or paste an h_ ID. Saved as stable ID in YAML. Inline runHook uses the stable hook ID.`}),(0,$.jsx)(O,{phase:`setup`,label:`Setup`,values:H.setup,suggestions:F,disabled:pe,placeholder:`Search hook names or paste an h_ ID`,onChange:e=>W(`setup`,e)}),(0,$.jsx)(O,{phase:`teardown`,label:`Teardown`,values:H.teardown,suggestions:F,disabled:pe,placeholder:`Search hook names or paste an h_ ID`,onChange:e=>W(`teardown`,e)})]})]}),a&&(0,$.jsx)(Ye,{title:`Teardown Hooks (Live)`,hooks:l,selection:D,onSelect:j}),(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsxs)(`span`,{className:`text-xs font-medium text-muted-foreground flex items-center gap-1`,children:[`Tests in Suite`,` `,(0,$.jsx)(He,{text:`Tests run in the order shown. Drag to reorder. The suite fails fast if any referenced test is missing at save.`})]}),(0,$.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,$.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/50`,children:[H.tests.length,` `,H.tests.length===1?`test`:`tests`]}),a&&(0,$.jsx)(Z,{type:`button`,variant:`outline`,size:`sm`,onClick:m?y:v,disabled:h||!m&&!p,children:h?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(fe,{className:`size-3.5 animate-spin`}),`Stopping...`]}):m?(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(S,{className:`size-3.5`}),`Stop Run All`]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(f,{className:`size-3.5`}),`Run All Tests`]})})]})]}),H.tests.length===0?(0,$.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No tests added yet. Use the picker below.`}):(0,$.jsx)(k,{sensors:U,collisionDetection:ae,onDragEnd:me,children:(0,$.jsx)(ee,{items:le,strategy:A,children:(0,$.jsx)(`div`,{className:`space-y-1.5`,children:H.tests.map((e,t)=>{let r=L.find(t=>t.path===e.test),i=r?.name??e.test.split(`/`).pop()??e.test,s=L.length>0&&!r,c=a?o[t]:void 0,l=a?d&&u===null&&!Y:!0;return(0,$.jsx)(Ae,{id:`test-${t}`,name:i,path:e.test,testId:e.id,isMissing:s,onRemove:()=>ce(t),disabled:n||V,actionsLocked:Y,sortableDisabled:J,liveMode:a,liveStatus:c?.status,liveDuration:c?.duration,liveError:c?.error??null,liveSteps:c?.liveSteps??[],runningStepIndex:c?.runningStepIndex??null,perTestSetupHooks:c?.perTestSetupHooks??[],perTestTeardownHooks:c?.perTestTeardownHooks??[],canRunTest:l,onRunTest:a&&g?()=>g(t):void 0,onCancelTest:a&&_?()=>_(t):void 0,testIndex:t,selection:D,onSelect:j},`test-${t}`)})})})})]}),(0,$.jsxs)(`div`,{className:`space-y-2`,children:[(0,$.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,$.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Available Tests`}),(0,$.jsxs)(Z,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>oe(e=>!e),disabled:n||V||Y,"aria-expanded":z,"aria-controls":`suite-test-picker-region`,children:[(0,$.jsx)(b,{className:`size-3`}),z?`Hide picker`:`Add new test`]})]}),z&&(0,$.jsx)(`div`,{id:`suite-test-picker-region`,children:(0,$.jsx)(je,{availableTests:L,onAdd:G,disabled:n||V||Y})})]})]}):(0,$.jsx)(`div`,{className:`flex items-center justify-center py-12 text-sm text-muted-foreground`,children:`Enter valid YAML to use the visual builder`})]})})}function Ze({suiteName:e,suiteId:t,unsaved:n,isCreateMode:r,mode:i=`view`,suiteHref:a,isSaving:o,isValidating:s,isRunning:c,runDisabled:l=!1,hasInvalidFilename:u,shortcutsOpen:p,showSuiteId:m=!0,hasLiveSession:h=!1,liveConnectionState:b=`idle`,isLiveActionDisabled:x=!1,liveSessionNumber:C=null,onSave:w,onValidate:T,onRun:E,onLiveConnect:D,onLiveEnd:O,onSettingsOpen:ee,onToggleShortcuts:k}){let A=i===`view`&&!r,j=!!D||!!O||h||b===`connecting`,te=!r||j,M=!r&&!A&&i===`edit`,N=`Start a disposable live session for this suite. Setup hooks run on connect, included tests run serially on a shared browser context, teardown hooks run when the session ends, and changes are not saved automatically.`;return(0,$.jsxs)(`div`,{"data-testid":`suite-navbar-root`,className:`flex h-14 shrink-0 items-center justify-between border-b px-4 min-w-0`,children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,$.jsx)(X,{to:`/suites`,className:`text-sm text-muted-foreground hover:text-foreground transition-colors shrink-0`,children:`Suites`}),(0,$.jsx)(Y,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),r?(0,$.jsx)(`span`,{className:`text-sm font-medium truncate`,children:`New Suite`}):a&&!A?(0,$.jsx)(X,{to:a,className:`truncate text-sm font-medium hover:text-primary transition-colors`,children:e}):(0,$.jsx)(`span`,{className:`text-sm font-medium truncate`,children:e}),M&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(Y,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,$.jsx)(`span`,{className:`text-sm font-medium truncate`,children:`Edit`})]}),n&&(0,$.jsx)(xe,{variant:`outline`,className:`text-xs`,children:`Unsaved`}),!A&&!r&&t&&m&&(0,$.jsx)(L,{label:`S`,value:t})]}),(0,$.jsx)(`div`,{className:`flex items-center gap-3 shrink-0`,children:A?(0,$.jsxs)($.Fragment,{children:[a?(0,$.jsx)(Z,{variant:`outline`,size:`sm`,asChild:!0,children:(0,$.jsxs)(X,{to:a,children:[`Edit`,(0,$.jsx)(v,{shortcut:`E`})]})}):(0,$.jsxs)(Z,{variant:`outline`,size:`sm`,disabled:!0,children:[`Edit`,(0,$.jsx)(v,{shortcut:`E`})]}),(0,$.jsx)(y,{onRun:E,disabled:c||l,label:c?`Running...`:`Run`,shortcutKey:`R`,size:`sm`}),j&&(0,$.jsxs)(W,{children:[(0,$.jsx)(H,{asChild:!0,children:(0,$.jsxs)(Z,{size:`sm`,onClick:D,disabled:x||!D,children:[b===`connecting`?(0,$.jsx)(fe,{className:`h-3.5 w-3.5 animate-spin`}):(0,$.jsx)(f,{className:`h-3.5 w-3.5`}),b===`connecting`?`Connecting...`:`Connect Live Session`,(0,$.jsx)(v,{shortcut:`L`,className:`border-primary-foreground/20 bg-primary-foreground/10 text-primary-foreground`})]})}),(0,$.jsx)(q,{className:`max-w-sm text-[13px]`,children:N})]}),!r&&(0,$.jsxs)(V,{open:p,onOpenChange:e=>{e||k()},children:[(0,$.jsxs)(W,{children:[(0,$.jsx)(H,{asChild:!0,children:(0,$.jsx)(B,{asChild:!0,children:(0,$.jsx)(Z,{variant:`ghost`,size:`icon-sm`,onClick:k,"aria-label":`Shortcuts`,children:(0,$.jsx)(_,{className:`h-3.5 w-3.5`})})})}),(0,$.jsx)(q,{children:`Shortcuts`})]}),(0,$.jsx)(oe,{align:`end`,sideOffset:8,className:`w-72 p-4`,children:(0,$.jsx)(`div`,{className:`space-y-3`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Actions`}),(0,$.jsx)(g,{hints:[{key:`E`,label:`Edit`},{key:`R`,label:`Run`},{key:`L`,label:`Connect Live Session`}]})]})})})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(Z,{variant:`ghost`,size:`sm`,onClick:T,disabled:s||u,children:[(0,$.jsx)(G,{className:`h-3.5 w-3.5`}),s?`Validating...`:`Validate`]}),(0,$.jsxs)(Z,{variant:`ghost`,size:`sm`,onClick:w,disabled:o||u,children:[(0,$.jsx)(d,{className:`h-3.5 w-3.5`}),o?`Saving...`:`Save`]}),(0,$.jsxs)(Z,{variant:`ghost`,size:`sm`,onClick:ee,children:[(0,$.jsx)(R,{className:`h-3.5 w-3.5`}),`Settings`]}),te&&(0,$.jsx)(`div`,{className:`h-4 w-px bg-border`}),!r&&(0,$.jsxs)(W,{children:[(0,$.jsx)(H,{asChild:!0,children:(0,$.jsx)(`span`,{className:`inline-flex`,children:(0,$.jsx)(y,{onRun:E,disabled:c||l||h,label:c?`Running...`:`Run Suite`,size:`sm`})})}),h&&(0,$.jsx)(q,{children:`End the live session to queue a new suite run.`})]}),j&&(h&&b!==`connecting`?(0,$.jsxs)(Z,{variant:`destructive`,size:`sm`,onClick:O,disabled:!O,children:[(0,$.jsx)(S,{className:`h-3.5 w-3.5`}),`End Live Session`]}):(0,$.jsxs)(W,{children:[(0,$.jsx)(H,{asChild:!0,children:(0,$.jsxs)(Z,{size:`sm`,onClick:D,disabled:x||!D,children:[b===`connecting`?(0,$.jsx)(fe,{className:`h-3.5 w-3.5 animate-spin`}):(0,$.jsx)(f,{className:`h-3.5 w-3.5`}),b===`connecting`?`Connecting...`:`Connect Live Session`]})}),(0,$.jsx)(q,{className:`max-w-sm text-[13px]`,children:N})]})),!A&&h&&typeof C==`number`&&(b===`connected`||b===`executing`)&&(0,$.jsxs)(xe,{variant:`outline`,"aria-live":`polite`,className:`text-[10px] tracking-wider font-medium text-muted-foreground bg-muted/50 border-border/50`,children:[`Session #`,C]}),!r&&(0,$.jsxs)(V,{open:p,onOpenChange:e=>{e||k()},children:[(0,$.jsxs)(W,{children:[(0,$.jsx)(H,{asChild:!0,children:(0,$.jsx)(B,{asChild:!0,children:(0,$.jsx)(Z,{variant:`ghost`,size:`icon-sm`,onClick:k,children:(0,$.jsx)(_,{className:`h-3.5 w-3.5`})})})}),(0,$.jsx)(q,{children:`Shortcuts`})]}),(0,$.jsx)(oe,{align:`end`,sideOffset:8,className:`w-72 p-4`,children:(0,$.jsx)(`div`,{className:`space-y-3`,children:(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Actions`}),(0,$.jsx)(g,{hints:[{key:`R`,label:`Run suite`},{key:`Cmd+S`,label:`Save`},{key:`Esc`,label:`Close results panel`}]})]})})})]})]})})]})}export{Re as i,Xe as n,Le as r,Ze as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./monaco-editor-BQB4vEk_.js";import{t as n}from"./file-code-BTJCyvvJ.js";import{n as r}from"./split-button-BHdketN3.js";import{t as i}from"./zap-DKRM77fm.js";import{a,n as o,o as ee,t as s}from"./insights-line-grid-EcYgqiLS.js";import{i as c,n as l,r as u,t as d}from"./tabs-CsAJVEvt.js";import{A as f,D as p,H as m,Kn as te,O as h,Sc as g,Sr as _,U as v,V as y,W as b,Xt as x,_c as ne,hc as S,k as re,pr as ie,qn as ae,r as oe,vc as se,y as C,yc as ce,z as w}from"./index-CXuVkD6-.js";import{t as le}from"./use-page-title-fn79XYtf.js";import{t as ue}from"./badge-B-yh3kbi.js";import{a as T,i as E,n as D,o as O,r as k,t as A}from"./table-e38rtLis.js";import{t as de}from"./empty-state-2mwYYmoQ.js";import{t as fe}from"./use-keyboard-shortcuts-befVnBO6.js";import{n as pe,t as me}from"./suite-navbar-D8RcUReD.js";import{t as j}from"./run-status-badge-DRzXddrc.js";import{n as M,t as he}from"./viewer-url-state-BnbixmdH.js";var N=e(g(),1),P=x(),ge=[`builder`,`yaml`];function _e(e){let t=e.trim();return t.length>=2&&(t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith(`'`)&&t.endsWith(`'`))?t.slice(1,-1).trim():t}function F(e){return{suiteId:e,total:0,flakyScore:0,isFlaky:!1,runs:[],trends:{daily:[],passRate:null,totalRuns:0,avgDuration:0}}}function I(e){return e===null?`—`:`${Math.round(e*100)}%`}function L(e){if(!e)return``;let t=new Date(b(e)),n=Date.now()-t.getTime(),r=Math.floor(n/1e3);if(r<60)return`just now`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);if(a<24)return`${a}h ago`;let o=Math.floor(a/24);return o<7?`${o}d ago`:y(e)}function R({configured:e,mode:t,scopedCount:n,totalCount:r,onModeChange:i}){return e?(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,P.jsx)(`div`,{className:`inline-flex rounded border border-border p-0.5`,children:[`scoped`,`all`].map(e=>(0,P.jsx)(w,{type:`button`,size:`xs`,variant:t===e?`default`:`ghost`,"aria-pressed":t===e,className:`h-7 rounded-[2px] px-2 text-xs`,onClick:()=>i(e),children:e===`scoped`?`Scoped`:`All runs`},e))}),(0,P.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[n,` scoped / `,r,` total runs`]})]}):(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No analytics scope configured`})}function z({runs:e,compactDate:t=!1}){return e.length===0?(0,P.jsx)(`div`,{className:`flex items-center justify-center h-16 text-sm text-muted-foreground`,children:`No runs yet`}):(0,P.jsxs)(A,{children:[(0,P.jsx)(T,{children:(0,P.jsxs)(O,{children:[(0,P.jsx)(E,{children:`Status`}),(0,P.jsx)(E,{children:`Duration`}),(0,P.jsx)(E,{children:`Date`})]})}),(0,P.jsx)(D,{children:e.map(e=>(0,P.jsxs)(O,{className:`relative cursor-pointer hover:bg-muted/50`,children:[(0,P.jsxs)(k,{children:[(0,P.jsx)(S,{to:_.runDetailOrLive(e.id,e.status),className:`absolute inset-0`,tabIndex:-1}),(0,P.jsx)(j,{status:e.status})]}),(0,P.jsx)(k,{children:e.status===`running`?(0,P.jsx)(`span`,{className:`text-blue-500 text-sm`,children:`In progress...`}):(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:v(e.duration)})}),(0,P.jsx)(k,{children:t?(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:L(e.createdAt)}):(0,P.jsxs)(p,{children:[(0,P.jsx)(f,{asChild:!0,children:(0,P.jsx)(`span`,{className:`text-muted-foreground`,children:y(e.createdAt)})}),(0,P.jsx)(h,{children:m(e.createdAt)})]})})]},e.id))})]})}function B(){let e=se(),f=ne(),[p,m]=ce(),{defaultRunMode:h}=r(),g=e[`suite-id`]??``,y=(0,N.useMemo)(()=>he(p,ge),[p]),b=(0,N.useMemo)(()=>M(y,p),[p,y]),x=y.tab,S=y.view,[w,T]=(0,N.useState)(``),[E,D]=(0,N.useState)(``),[O,k]=(0,N.useState)(!0),[A,j]=(0,N.useState)(!1),[L,B]=(0,N.useState)(()=>F(g)),[V,H]=(0,N.useState)(`all`),[U,W]=(0,N.useState)(!1),[ve,ye]=(0,N.useState)(!1),G=(0,N.useMemo)(()=>{let e=w.match(/^name:\s*(.+)$/m);return e?_e(e[1]):null},[w]);le(G||`Suite`);let K=L.scope?.configured===!0,q=V===`scoped`&&K&&L.scopedTrends?L.scopedTrends:L.trends,J=V===`scoped`&&K&&L.scopedFlakyScore!==void 0?L.scopedFlakyScore:L.flakyScore,be=V===`scoped`&&K?L.scopedRuns??[]:L.runs,xe=(0,N.useMemo)(()=>q.daily.filter(e=>e.passed+e.failed>0).map(e=>({date:e.date,passRate:Math.round(e.passed/(e.passed+e.failed)*1e3)/10})),[q]),Se=(0,N.useMemo)(()=>L.trends.daily.map(e=>({date:e.date,duration:e.avgDuration})),[L]),Y=be;(0,N.useEffect)(()=>{H(L.scope?.configured?`scoped`:`all`)},[L]),(0,N.useEffect)(()=>{b.toString()!==p.toString()&&m(b,{replace:!0})},[b,p,m]),(0,N.useEffect)(()=>{if(!g){j(!0),k(!1),B(F(``));return}let e=!1;return k(!0),j(!1),T(``),D(``),B(F(g)),ae(g).then(t=>{e||(T(t.content),D(t.path))}).catch(()=>{e||(j(!0),C.error(`Failed to load suite file`))}).finally(()=>{e||k(!1)}),()=>{e=!0}},[g]),(0,N.useEffect)(()=>{if(!g)return;let e=!1;return te(g,{limit:50}).then(t=>{e||B(t)}).catch(()=>{e||B(F(g))}),()=>{e=!0}},[g]);let X=async e=>{if(!(U||!E)){W(!0);try{let t=await ie({file:E,local:e});C.success(`Run started`),f(_.runLive(t.runId))}catch(e){C.error(`Failed to start run: ${e instanceof Error?e.message:String(e)}`)}finally{W(!1)}}},Z=_.suiteEdit(g),Q=`${Z}?live=1`;fe({e:()=>f(Z),r:()=>{E&&X(h===`local`)},l:()=>f(Q)});let $=e=>{m(M(e,p),{replace:!0})};if(O)return(0,P.jsx)(oe,{});if(A)return(0,P.jsx)(de,{icon:n,title:`Suite not found`,description:`This suite doesn't exist`,actionLabel:`View All Suites`,onAction:()=>f(_.suites)});let Ce=(0,P.jsx)(pe,{content:w,onChange:()=>{},disabled:!0,suggestions:[]}),we=(0,P.jsx)(t,{value:w,onChange:()=>{},readOnly:!0,className:`h-full`}),Te=(0,P.jsxs)(`aside`,{"data-testid":`suite-detail-analytics-sidebar`,className:`flex flex-col gap-0 overflow-y-auto border-t border-border md:border-t-0 md:border-l md:border-border`,children:[(0,P.jsx)(`div`,{className:`border-b border-border px-3 py-2`,children:(0,P.jsx)(R,{configured:K,mode:V,scopedCount:L.scope?.scopedCount??0,totalCount:L.scope?.totalCount??L.total,onModeChange:H})}),(0,P.jsxs)(o,{className:`grid-cols-2 divide-x divide-y-0 border-x-0 border-t-0`,children:[(0,P.jsxs)(s,{className:`flex flex-col gap-0.5 px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Pass Rate`}),(0,P.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:I(q.passRate)})]}),(0,P.jsxs)(s,{className:`flex flex-col gap-0.5 px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Avg Duration`}),(0,P.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:v(L.trends.avgDuration)})]}),(0,P.jsxs)(s,{className:`flex flex-col gap-0.5 border-t border-border px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Total Runs`}),(0,P.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:L.total.toLocaleString()})]}),(0,P.jsxs)(s,{className:`flex flex-col gap-0.5 border-t border-border px-3 py-2`,children:[(0,P.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Flaky Score`}),(0,P.jsxs)(`span`,{className:`text-xl font-semibold text-foreground`,children:[(J*100).toFixed(0),`%`]})]})]}),(0,P.jsx)(o,{className:`border-x-0 border-y-0`,children:(0,P.jsxs)(s,{className:`flex flex-col gap-2 px-3 py-3`,children:[(0,P.jsxs)(`span`,{className:`text-sm font-medium text-foreground`,children:[V===`scoped`&&K?`Scoped Runs`:`All Runs`,` (`,Y.length,`)`]}),(0,P.jsx)(z,{runs:Y.slice(0,5),compactDate:!0})]})})]});return(0,P.jsx)(re,{children:(0,P.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,P.jsx)(me,{suiteName:G||`Suite`,suiteId:g,unsaved:!1,isCreateMode:!1,mode:`view`,suiteHref:Z,isSaving:!1,isValidating:!1,isRunning:U,runDisabled:!E,hasInvalidFilename:!1,shortcutsOpen:ve,showSuiteId:!1,onBack:()=>f(_.suites),onSave:()=>{},onValidate:()=>{},onRun:e=>X(e),onLiveConnect:()=>f(Q),onSettingsOpen:()=>{},onToggleShortcuts:()=>ye(e=>!e)}),(0,P.jsxs)(d,{value:x,onValueChange:e=>$({tab:e,view:S}),className:`flex-1 min-h-0 flex flex-col`,children:[(0,P.jsx)(`div`,{className:`px-4 border-b border-border`,children:(0,P.jsxs)(u,{variant:`line`,children:[(0,P.jsx)(c,{value:`overview`,children:`Overview`}),(0,P.jsx)(c,{value:`insights`,children:`Insights`})]})}),(0,P.jsxs)(l,{value:`overview`,className:`flex-1 min-h-0 mt-0 grid grid-cols-1 md:grid-cols-[minmax(480px,1fr)_minmax(260px,320px)]`,children:[(0,P.jsx)(`div`,{className:`min-w-0 min-h-0 flex flex-col`,children:(0,P.jsxs)(d,{value:S,onValueChange:e=>$({tab:x,view:e}),className:`flex-1 min-h-0 flex flex-col`,children:[(0,P.jsx)(`div`,{className:`border-b border-border`,children:(0,P.jsxs)(u,{variant:`line`,className:`w-full grid grid-cols-2 px-4 md:w-fit md:inline-flex`,children:[(0,P.jsx)(c,{value:`builder`,children:`Builder`}),(0,P.jsx)(c,{value:`yaml`,children:`YAML`})]})}),(0,P.jsxs)(`div`,{className:`relative flex-1 min-h-0`,children:[(0,P.jsx)(l,{value:`builder`,className:`absolute inset-0 overflow-y-auto data-[state=inactive]:hidden`,children:Ce}),(0,P.jsx)(l,{value:`yaml`,className:`absolute inset-0 data-[state=inactive]:hidden`,children:we})]})]})}),Te]}),(0,P.jsx)(l,{value:`insights`,className:`flex-1 overflow-y-auto mt-0`,children:(0,P.jsxs)(`div`,{"data-testid":`suite-detail-insights`,className:`space-y-3 px-4 py-3`,children:[L.isFlaky&&(0,P.jsxs)(ue,{variant:`destructive`,children:[(0,P.jsx)(i,{className:`size-3`}),`Flaky (score: `,L.flakyScore.toFixed(2),`)`]}),(0,P.jsxs)(o,{className:`grid-cols-2 divide-x divide-y-0 md:grid-cols-4`,children:[(0,P.jsx)(s,{className:`border-b border-border md:border-b-0`,children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Total Runs`}),(0,P.jsx)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:L.total.toLocaleString()})]})}),(0,P.jsx)(s,{className:`border-b border-border md:border-b-0 md:border-r`,children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Pass Rate`}),(0,P.jsx)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:I(q.passRate)})]})}),(0,P.jsx)(s,{children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Avg Duration`}),(0,P.jsx)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:v(L.trends.avgDuration)})]})}),(0,P.jsx)(s,{children:(0,P.jsxs)(`div`,{children:[(0,P.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Flaky Score`}),(0,P.jsxs)(`p`,{className:`mt-0.5 text-2xl font-semibold`,children:[(J*100).toFixed(0),`%`]})]})})]}),(0,P.jsx)(o,{children:(0,P.jsx)(s,{className:`px-4 py-3`,children:(0,P.jsx)(R,{configured:K,mode:V,scopedCount:L.scope?.scopedCount??0,totalCount:L.scope?.totalCount??L.total,onModeChange:H})})}),q.daily.length>0&&(0,P.jsxs)(o,{className:`md:grid-cols-2 md:divide-x md:divide-y-0`,children:[(0,P.jsxs)(s,{className:`px-4 py-3`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Pass Rate`}),(0,P.jsx)(`div`,{className:`h-[160px] overflow-hidden`,children:(0,P.jsx)(ee,{data:xe})})]}),(0,P.jsxs)(s,{className:`px-4 py-3`,children:[(0,P.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Duration`}),(0,P.jsx)(`div`,{className:`h-[160px] overflow-hidden`,children:(0,P.jsx)(a,{data:Se})})]})]}),(0,P.jsx)(o,{children:(0,P.jsxs)(s,{className:`px-4 py-3`,children:[(0,P.jsxs)(`p`,{className:`text-sm font-medium mb-2`,children:[V===`scoped`&&K?`Scoped Runs`:`All Runs`,` (`,Y.length,`)`]}),(0,P.jsx)(z,{runs:Y})]})})]})})]})]})})}export{B as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./arrow-up-down-CKc1J6oh.js";import{a as n,i as r,n as i,r as a,t as o}from"./select-JI5Kadjp.js";import{n as s,r as c}from"./shortcut-hints-_J-i7rAL.js";import{t as ee}from"./plus-DNc2RueT.js";import{A as te,B as l,Bt as ne,D as re,Jn as ie,O as ae,Or as u,R as oe,Sc as d,Sr as f,V as se,Xt as p,Yn as ce,_c as le,a as ue,dn as de,hc as fe,k as pe,pn as m,pr as h,y as g,yc as _,z as v}from"./index-CXuVkD6-.js";import{t as me}from"./use-page-title-fn79XYtf.js";import{a as he,i as y,n as ge,o as b,r as x,t as _e}from"./table-e38rtLis.js";import{n as ve,t as ye}from"./scroll-area-WFIgUp-0.js";import{t as be}from"./empty-state-2mwYYmoQ.js";import{t as xe}from"./use-keyboard-shortcuts-befVnBO6.js";import{a as Se,i as Ce,n as S,o as we,r as Te,s as Ee,t as De}from"./batch-action-bar-MMUxALHz.js";import{t as C}from"./run-status-badge-DRzXddrc.js";import{n as w,r as T,t as E}from"./tests-suites-table-widths-nMJHxqRN.js";var D=e(d(),1);function Oe(){let[e,t]=_(),n=e.get(`status`)??``,r=e.get(`platform`)??``,i=e.get(`sort`)??``,a=e.get(`order`)??`desc`,o=(0,D.useCallback)((e,n)=>{t(t=>{let r=new URLSearchParams(t);return n?r.set(e,n):r.delete(e),r},{replace:!0})},[t]),s=(0,D.useMemo)(()=>i?[{id:i,desc:a===`desc`}]:[],[i,a]),c=(0,D.useRef)(s);return c.current=s,{status:n,platform:r,sort:i,order:a,sorting:s,onSortingChange:(0,D.useCallback)(e=>{let n=typeof e==`function`?e(c.current):e;t(e=>{let t=new URLSearchParams(e);return n.length>0?(t.set(`sort`,n[0].id),t.set(`order`,n[0].desc?`desc`:`asc`)):(t.delete(`sort`),t.delete(`order`)),t},{replace:!0})},[t]),setStatus:(0,D.useCallback)(e=>o(`status`,e),[o]),setPlatform:(0,D.useCallback)(e=>o(`platform`,e),[o])}}var O=p(),ke=50;function Ae(e){return e?e===`ios`?`iOS`:e.charAt(0).toUpperCase()+e.slice(1):`—`}function k(e){return e.replace(/\\/g,`/`)}function A(e){return e?.createdAt||e?.startedAt||``}function je(e){return l(`h-10 bg-background text-[13px] font-medium text-foreground/90`,e===`select`?`px-2 text-center`:`px-3`,(e===`passRate`||e===`lastRun`)&&`text-right`)}function Me(e){return l(`py-2 align-top`,e===`select`&&`px-2`,e===`name`&&`max-w-0 px-3`,e===`targetName`&&`max-w-0 px-3`,e===`platform`&&`px-3`,e===`passRate`&&`px-3 text-right`,e===`lastRun`&&`max-w-0 px-3 text-right`)}function Ne({isActive:e,isBatchSelected:t}){return l(`cursor-pointer outline-none hover:bg-muted/20 focus-visible:bg-primary/10 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-primary/60`,t&&!e&&`bg-muted/20`,e&&`bg-primary/10 ring-1 ring-inset ring-primary/60`)}function j(){me(`Suites`);let[e,d]=(0,D.useState)([]),[p,_]=(0,D.useState)(null),[j,M]=(0,D.useState)(!0),[N,P]=(0,D.useState)({}),[Pe,F]=(0,D.useState)(!1),[Fe,Ie]=(0,D.useState)([]),[I,L]=(0,D.useState)(-1),R=(0,D.useRef)([]),z=le(),{status:B,platform:V,sorting:Le,onSortingChange:Re,setStatus:ze,setPlatform:Be}=Oe();(0,D.useEffect)(()=>{let e=!1,t=ce().then(e=>Array.isArray(e?.suites)?e.suites:null).catch(()=>null);return Promise.all([ie(),t]).then(([t,n])=>{e||(d(t.files),_(n===null?null:new Map(n.map(e=>[k(e.path),e]))),n===null&&g.error(`Failed to load run history`))}).catch(()=>{e||g.error(`Failed to load suites`)}).finally(()=>{e||M(!1)}),()=>{e=!0}},[]);let H=(0,D.useMemo)(()=>e.map(e=>{let t=p?.get(k(e.path)),n=t?.lastRun??null;return{path:e.path,suiteId:e.suiteId,name:e.name,platform:e.platform??t?.platform??null,historyKnown:t!==void 0,lastRunStatus:n?.status??null,lastRun:n,targetName:t?.targetName??null,passRate:t&&t.passRate!==null?Math.round(t.passRate*100):null,passCount:t?.passed??0,completedRunCount:t?.decided??0}}),[e,p]),U=(0,D.useMemo)(()=>{let e=H;if(B===`no-runs`)e=e.filter(e=>e.historyKnown&&e.lastRun===null);else if(B){let t=u(B);e=e.filter(e=>e.historyKnown&&t!==void 0&&u(e.lastRunStatus??``)===t)}return V&&(e=e.filter(e=>e.platform===V)),e},[H,B,V]),Ve={id:`select`,header:({table:e})=>(0,O.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,O.jsx)(T,{checked:e.getIsAllPageRowsSelected()||e.getIsSomePageRowsSelected()&&`indeterminate`,onCheckedChange:t=>e.toggleAllPageRowsSelected(t),ariaLabel:`Select all`})}),cell:({row:e})=>(0,O.jsx)(T,{checked:e.getIsSelected(),onCheckedChange:t=>e.toggleSelected(t)}),enableSorting:!1,size:48},W=(0,D.useMemo)(()=>[{accessorKey:`name`,header:({column:e})=>(0,O.jsxs)(v,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Name`,(0,O.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>(0,O.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,O.jsx)(`span`,{className:`block whitespace-normal break-words text-sm font-medium leading-snug text-foreground`,children:e.getValue(`name`)}),(0,O.jsx)(`span`,{className:`block whitespace-normal break-all text-xs leading-snug text-muted-foreground`,children:e.original.path})]}),size:400,filterFn:(e,t,n)=>{let r=e.getValue(`name`).toLowerCase(),i=e.original.path.toLowerCase(),a=n.toLowerCase();return r.includes(a)||i.includes(a)}},{accessorKey:`targetName`,header:({column:e})=>(0,O.jsxs)(v,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Target`,(0,O.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>e.original.historyKnown?(0,O.jsx)(`span`,{className:`block whitespace-normal break-words text-sm leading-snug text-muted-foreground`,children:e.original.targetName??`No target`}):null},{accessorKey:`platform`,header:({column:e})=>(0,O.jsxs)(v,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Platform`,(0,O.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>{let t=e.getValue(`platform`);return!e.original.historyKnown&&!t?null:(0,O.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:Ae(t)})}},{accessorKey:`passRate`,header:({column:e})=>(0,O.jsxs)(v,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Pass rate`,(0,O.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>e.original.historyKnown?e.original.passRate===null?(0,O.jsxs)(`div`,{className:`space-y-0.5 text-right`,children:[(0,O.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`—`}),(0,O.jsx)(`div`,{className:`text-xs tabular-nums text-muted-foreground`,children:`0 completed`})]}):(0,O.jsxs)(`div`,{className:`space-y-0.5 text-right`,children:[(0,O.jsxs)(`div`,{className:`text-sm font-medium tabular-nums text-foreground`,children:[e.original.passRate,`%`]}),(0,O.jsxs)(`div`,{className:`text-xs tabular-nums text-muted-foreground`,children:[e.original.passCount,`/`,e.original.completedRunCount]})]}):null},{id:`lastRun`,accessorFn:e=>A(e.lastRun),header:({column:e})=>(0,O.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,O.jsxs)(v,{variant:`ghost`,className:`h-auto justify-end px-0 text-[13px] font-medium text-foreground/90 hover:bg-transparent`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Last run`,(0,O.jsx)(t,{className:`ml-2 h-4 w-4`})]})}),cell:({row:e})=>e.original.historyKnown?e.original.lastRun?(0,O.jsxs)(fe,{to:f.runDetail(e.original.lastRun.id),className:`relative z-10 flex w-full flex-col items-end gap-1 rounded-sm text-right focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/60`,onClick:e=>e.stopPropagation(),children:[(0,O.jsx)(C,{status:e.original.lastRun.status}),(0,O.jsx)(`span`,{className:`whitespace-normal break-words text-xs leading-snug text-muted-foreground`,children:se(A(e.original.lastRun))})]}):(0,O.jsx)(`span`,{className:`block text-sm text-muted-foreground`,children:`No runs`}):null}],[]),G=(0,D.useMemo)(()=>Object.keys(N).filter(e=>N[e]),[N]),K=(0,D.useMemo)(()=>U.filter(e=>G.includes(e.path)),[U,G]),He=(0,D.useCallback)(async e=>{if(K.length!==0){F(!0);try{let t=await Promise.allSettled(K.map(t=>h({file:t.path,local:e}))),n=t.filter(e=>e.status===`fulfilled`).length,r=t.length-n;if(r>0){let e=m(t);g.error(`${n} runs queued, ${r} failed${e===void 0?``:`. ${e}`}`)}else g.success(`${n} runs queued`);P({})}finally{F(!1)}}},[K]),Ue=(0,D.useCallback)(async e=>{if(K.length!==0){F(!0);try{let t=await Promise.allSettled(K.map(t=>h({file:t.path,noCache:!0,local:e}))),n=t.filter(e=>e.status===`fulfilled`).length,r=t.length-n;if(r>0){let e=m(t);g.error(`${n} runs queued (no cache), ${r} failed${e===void 0?``:`. ${e}`}`)}else g.success(`${n} runs queued (no cache)`);P({})}finally{F(!1)}}},[K]),We=(0,D.useCallback)(async()=>{if(K.length!==0){F(!0);try{let e=await Promise.allSettled(K.map(e=>de(e.path))),t=K.filter((t,n)=>e[n]?.status===`fulfilled`),n=new Set(t.map(e=>e.path)),r=e.length-t.length;t.length>0&&(d(e=>e.filter(e=>!n.has(e.path))),P(e=>Object.fromEntries(Object.entries(e).filter(([e])=>!n.has(e))))),r>0?g.error(`Deleted ${t.length} suite${t.length===1?``:`s`}, ${r} failed`):g.success(`Deleted ${t.length} suite${t.length===1?``:`s`}`)}finally{F(!1)}}},[K]),q=Te({data:U,columns:[Ve,...W],getCoreRowModel:Ce(),getSortedRowModel:Ee(),getFilteredRowModel:Se(),getPaginationRowModel:we(),onSortingChange:Re,onColumnFiltersChange:Ie,enableRowSelection:!0,onRowSelectionChange:P,getRowId:e=>e.path,state:{sorting:Le,columnFilters:Fe,rowSelection:N},initialState:{pagination:{pageSize:ke}}}),J=q.getRowModel().rows,Y=q.getColumn(`name`)?.getFilterValue()??``,Ge=(0,D.useCallback)(e=>{q.getColumn(`name`)?.setFilterValue(e||void 0),q.setPageIndex(0),L(-1),P({})},[q]);xe((0,D.useMemo)(()=>{let e=()=>L(e=>Math.min(e+1,J.length-1)),t=()=>L(e=>Math.max(e-1,0));return{j:e,arrowdown:e,k:t,arrowup:t,enter:e=>{if(I>=0&&J[I]){let t=J[I].original;if(!t.suiteId)return;let n=f.suiteView(t.suiteId);e.metaKey||e.ctrlKey?window.open(n,`_blank`):z(n)}}}},[J,I,z])),(0,D.useEffect)(()=>{if(I<0)return;let e=R.current[I];e&&document.activeElement!==e&&e.focus()},[I,J.length]);let X=(0,D.useCallback)((e,t)=>{e.suiteId&&(t&&t.preventDefault(),z(f.suiteView(e.suiteId)))},[z]);if(j)return(0,O.jsx)(ue,{});if(e.length===0)return(0,O.jsx)(`div`,{"data-tour-id":`tour-suites-table`,children:(0,O.jsx)(be,{icon:ne,title:`No suites found`,description:`Create your first suite file`,actionLabel:`New Suite`,onAction:()=>z(f.suiteNew)})});let Z=q.getFilteredRowModel().rows.length,Ke=q.getState().pagination.pageIndex,Q=q.getState().pagination.pageSize,$=Ke*Q+1,qe=Math.min($+Q-1,Z);return(0,O.jsx)(pe,{children:(0,O.jsxs)(`div`,{className:`space-y-4`,children:[(0,O.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,O.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Suites`}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsxs)(re,{children:[(0,O.jsx)(te,{asChild:!0,children:(0,O.jsx)(v,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,children:(0,O.jsx)(c,{className:`h-4 w-4`})})}),(0,O.jsx)(ae,{side:`bottom`,className:`p-3`,children:(0,O.jsx)(s,{hints:[{key:`J / ↓`,label:`Next row`},{key:`K / ↑`,label:`Previous row`},{key:`Enter`,label:`Open suite`},{key:`⌘+Enter`,label:`Open in new tab`}]})})]}),(0,O.jsxs)(v,{size:`sm`,"data-tour-id":`tour-suites-new`,onClick:()=>z(f.suiteNew),children:[(0,O.jsx)(ee,{className:`size-4`}),`New Suite`]})]})]}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,O.jsx)(oe,{placeholder:`Search suites...`,value:Y,onChange:e=>Ge(e.target.value),className:`max-w-[220px]`}),(0,O.jsxs)(o,{value:B||`all`,onValueChange:e=>{ze(e===`all`?``:e),L(-1),P({})},children:[(0,O.jsx)(r,{className:`w-[150px]`,children:(0,O.jsx)(n,{placeholder:`All statuses`})}),(0,O.jsxs)(i,{children:[(0,O.jsx)(a,{value:`all`,children:`All statuses`}),(0,O.jsx)(a,{value:`passed`,children:`Passed`}),(0,O.jsx)(a,{value:`failed`,children:`Failed`}),(0,O.jsx)(a,{value:`running`,children:`Running`}),(0,O.jsx)(a,{value:`no-runs`,children:`No runs`})]})]}),(0,O.jsxs)(o,{value:V||`all`,onValueChange:e=>{Be(e===`all`?``:e),L(-1),P({})},children:[(0,O.jsx)(r,{className:`w-[140px]`,children:(0,O.jsx)(n,{placeholder:`All platforms`})}),(0,O.jsxs)(i,{children:[(0,O.jsx)(a,{value:`all`,children:`All platforms`}),(0,O.jsx)(a,{value:`web`,children:`Web`}),(0,O.jsx)(a,{value:`android`,children:`Android`}),(0,O.jsx)(a,{value:`ios`,children:`iOS`})]})]})]}),(0,O.jsxs)(ye,{"data-tour-id":`tour-suites-table`,className:`rounded-md border`,children:[(0,O.jsxs)(_e,{className:`min-w-full table-fixed`,children:[(0,O.jsx)(`colgroup`,{children:E.map(e=>{let t=w(e);return(0,O.jsx)(`col`,{"data-column-id":e,style:t?{width:t}:void 0},e)})}),(0,O.jsx)(he,{children:q.getHeaderGroups().map(e=>(0,O.jsx)(b,{className:`hover:bg-transparent`,children:e.headers.map(e=>(0,O.jsx)(y,{className:je(e.column.id),children:e.isPlaceholder?null:S(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,O.jsx)(ge,{children:J.length?J.map((e,t)=>{let n=t===I,r=e.getIsSelected();return(0,O.jsx)(b,{ref:e=>{R.current[t]=e},"data-runs-row-surface":e.id,tabIndex:n?0:-1,"aria-selected":n,className:Ne({isActive:n,isBatchSelected:r}),onClick:()=>{L(t),X(e.original)},onFocus:()=>L(t),onKeyDown:t=>{t.key===`Enter`&&X(e.original,t)},children:e.getVisibleCells().map(e=>{let t=e.column.id===`select`;return(0,O.jsx)(x,{className:l(Me(e.column.id),t&&`relative z-10`),children:S(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)}):(0,O.jsx)(b,{children:(0,O.jsx)(x,{colSpan:W.length+1,className:`h-24 text-center`,children:`No results.`})})})]}),(0,O.jsx)(ve,{orientation:`horizontal`})]}),(0,O.jsxs)(`div`,{className:`flex items-center justify-between px-2`,children:[(0,O.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:Z>0?`Showing ${$}-${qe} of ${Z}${Y||B||V?` (${H.length} total)`:``}`:`No suites found`}),(0,O.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,O.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>q.previousPage(),disabled:!q.getCanPreviousPage(),children:`Previous`}),(0,O.jsx)(v,{variant:`outline`,size:`sm`,onClick:()=>q.nextPage(),disabled:!q.getCanNextPage(),children:`Next`})]})]}),(0,O.jsx)(De,{selectedCount:G.length,onRun:He,onRunNoCache:Ue,onDelete:We,onCancel:()=>P({}),isRunning:Pe})]})})}export{j as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{o as t}from"./select-JI5Kadjp.js";import{B as n,Ct as r,Dt as i,Sc as a,Tt as o,Xt as s,et as c,jt as l,xt as u}from"./index-CXuVkD6-.js";var d=e(a(),1),f=s(),p=`Switch`,[m,h]=o(p),[g,_]=m(p),v=d.forwardRef((e,t)=>{let{__scopeSwitch:n,name:a,checked:o,defaultChecked:s,required:c,disabled:m,value:h=`on`,onCheckedChange:_,form:v,...y}=e,[b,x]=d.useState(null),w=l(t,e=>x(e)),T=d.useRef(!1),E=b?v||!!b.closest(`form`):!0,[D,O]=u({prop:o,defaultProp:s??!1,onChange:_,caller:p});return(0,f.jsxs)(g,{scope:n,checked:D,disabled:m,children:[(0,f.jsx)(i.button,{type:`button`,role:`switch`,"aria-checked":D,"aria-required":c,"data-state":C(D),"data-disabled":m?``:void 0,disabled:m,value:h,...y,ref:w,onClick:r(e.onClick,e=>{O(e=>!e),E&&(T.current=e.isPropagationStopped(),T.current||e.stopPropagation())})}),E&&(0,f.jsx)(S,{control:b,bubbles:!T.current,name:a,value:h,checked:D,required:c,disabled:m,form:v,style:{transform:`translateX(-100%)`}})]})});v.displayName=p;var y=`SwitchThumb`,b=d.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,a=_(y,n);return(0,f.jsx)(i.span,{"data-state":C(a.checked),"data-disabled":a.disabled?``:void 0,...r,ref:t})});b.displayName=y;var x=`SwitchBubbleInput`,S=d.forwardRef(({__scopeSwitch:e,control:n,checked:r,bubbles:i=!0,...a},o)=>{let s=d.useRef(null),u=l(s,o),p=t(r),m=c(n);return d.useEffect(()=>{let e=s.current;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set;if(p!==r&&n){let t=new Event(`click`,{bubbles:i});n.call(e,r),e.dispatchEvent(t)}},[p,r,i]),(0,f.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:r,...a,tabIndex:-1,ref:u,style:{...a.style,...m,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});S.displayName=x;function C(e){return e?`checked`:`unchecked`}var w=v,T=b;function E({className:e,size:t=`default`,...r}){return(0,f.jsx)(w,{"data-slot":`switch`,"data-size":t,className:n(`peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80`,e),...r,children:(0,f.jsx)(T,{"data-slot":`switch-thumb`,className:n(`pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-muted-foreground`)})})}export{E as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{o as t,t as n}from"./run-stream-reducer-BXMulZq1.js";import{t as r}from"./check-DH5_3cK-.js";import{a as i,i as a,n as o,r as s,t as c}from"./select-JI5Kadjp.js";import{n as l}from"./textarea-BP7XqG3v.js";import{t as u}from"./circle-dashed-WDoZ8ADk.js";import{t as d}from"./circle-x-1lf_9y_c.js";import{B as f,Ct as p,Dt as m,Hn as h,Ht as g,Is as _,It as v,Kt as y,Mt as b,Pt as ee,Sc as te,St as ne,Tt as re,U as x,Ut as S,Xt as ie,bt as ae,j as C,jt as oe,xt as se,yt as ce,z as le}from"./index-CXuVkD6-.js";import{t as w}from"./badge-B-yh3kbi.js";import{t as T}from"./format-BpI4TiHn.js";var ue=y(`brain`,[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]),de=y(`file-question-mark`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]]),fe=y(`file-search`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`11.5`,cy:`14.5`,r:`2.5`,key:`1bq0ko`}],[`path`,{d:`M13.3 16.3 15 18`,key:`2quom7`}]]),pe=y(`mouse-pointer-click`,[[`path`,{d:`M14 4.1 12 6`,key:`ita8i4`}],[`path`,{d:`m5.1 8-2.9-.8`,key:`1go3kf`}],[`path`,{d:`m6 12-1.9 2`,key:`mnht97`}],[`path`,{d:`M7.2 2.2 8 5.1`,key:`1cfko1`}],[`path`,{d:`M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z`,key:`s0h3yz`}]]),E=e(te(),1),D=ie(),O=`Collapsible`,[me,he]=re(O),[ge,k]=me(O),A=E.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:a,onOpenChange:o,...s}=e,[c,l]=se({prop:r,defaultProp:i??!1,onChange:o,caller:O});return(0,D.jsx)(ge,{scope:n,disabled:a,contentId:ce(),open:c,onOpenToggle:E.useCallback(()=>l(e=>!e),[l]),children:(0,D.jsx)(m.div,{"data-state":N(c),"data-disabled":a?``:void 0,...s,ref:t})})});A.displayName=O;var _e=`CollapsibleTrigger`,ve=E.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=k(_e,n);return(0,D.jsx)(m.button,{type:`button`,"aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":N(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:p(e.onClick,i.onOpenToggle)})});ve.displayName=_e;var j=`CollapsibleContent`,M=E.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=k(j,e.__scopeCollapsible);return(0,D.jsx)(ae,{present:n||i.open,children:({present:e})=>(0,D.jsx)(ye,{...r,ref:t,present:e})})});M.displayName=j;var ye=E.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...a}=e,o=k(j,n),[s,c]=E.useState(r),l=E.useRef(null),u=oe(t,l),d=E.useRef(0),f=d.current,p=E.useRef(0),h=p.current,g=o.open||s,_=E.useRef(g),v=E.useRef(void 0);return E.useEffect(()=>{let e=requestAnimationFrame(()=>_.current=!1);return()=>cancelAnimationFrame(e)},[]),ne(()=>{let e=l.current;if(e){v.current=v.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();d.current=t.height,p.current=t.width,_.current||(e.style.transitionDuration=v.current.transitionDuration,e.style.animationName=v.current.animationName),c(r)}},[o.open,r]),(0,D.jsx)(m.div,{"data-state":N(o.open),"data-disabled":o.disabled?``:void 0,id:o.contentId,hidden:!g,...a,ref:u,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":h?`${h}px`:void 0,...e.style},children:g&&i})});function N(e){return e?`open`:`closed`}var be=A;function P({...e}){return(0,D.jsx)(be,{"data-slot":`collapsible`,...e})}function F({...e}){return(0,D.jsx)(ve,{"data-slot":`collapsible-trigger`,...e})}function I({...e}){return(0,D.jsx)(M,{"data-slot":`collapsible-content`,...e})}var xe=n,L=`tokens not measured`,Se=`Models`,Ce=`Token usage — details`,R=`evidence incomplete`,we=`Could not load this run’s steps.`;function z(e,t){return`${String(e)} ${String(t)}`}function Te(e){let t=new Map;for(let n of e.subActions){let e=z(n.testIndex,n.stepIndex),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}let n=new Map;for(let t of e.steps){let e=n.get(t.testIndex);e===void 0?n.set(t.testIndex,[t]):e.push(t)}return[...e.members].sort((e,t)=>e.testIndex-t.testIndex).map(e=>({member:e,steps:[...n.get(e.testIndex)??[]].sort((e,t)=>e.stepIndex-t.stepIndex).map(e=>({step:e,subActions:[...t.get(z(e.testIndex,e.stepIndex))??[]].sort((e,t)=>e.subActionIndex-t.subActionIndex)}))}))}function Ee(e,t){return t===`all`?[...e]:e.filter(e=>e.member.testIndex===t)}function De(e){if(e==null||e===``||!/^\d+$/.test(e))return`all`;let t=Number(e);return Number.isSafeInteger(t)?t:`all`}function Oe(e,t){return t.steps.length===0?xe:void 0}function ke(e){return e.name??`Test ${String(e.testIndex+1)}`}function Ae(e){return`#${String(e)}`}function je(e){return e>1?`re-ran after failure ×${String(e-1)}`:void 0}var B=new Intl.NumberFormat(`en-US`);function Me(e){let{measuredSteps:t,promptTokens:n,completionTokens:r}=e;return t===0||n===void 0||r===void 0?L:`${T(n)} in · ${T(r)} out`}function Ne(e){let{measuredSteps:t,promptTokens:n,completionTokens:r,totalTokens:i}=e;return t===0||i===void 0||n===void 0||r===void 0?L:`${B.format(i)} total · ${B.format(n)} in · ${B.format(r)} out`}function Pe(e){let{measuredSteps:t,unmeasuredSteps:n}=e;if(n===0||t===0)return;let r=t+n;return`measured ${String(t)} of ${String(r)} steps — totals are an undercount`}function Fe(e){let{measuredSteps:t,cachedInputTokens:n,cachedMeasuredSteps:r,cachedInputMeasuredTokens:i}=e;if(n===void 0)return;let a=B.format(n);return r===void 0||r>=t||i===void 0?`cached input ${a} (provider-reported)`:`cached input ${a} of ${B.format(i)} (provider-reported) over ${String(r)} of ${String(t)} measured steps`}function V(e){return e.provider===void 0?e.modelId:`${e.modelId} (${e.provider})`}function Ie(e){if(e===void 0)return[];let{declared:t,responding:n}=e;if(t===void 0&&n===void 0)return[];let r=new Set((t??[]).map(e=>e.modelId)),i=(n??[]).filter(e=>!r.has(e.modelId));return t?.length===1&&(n===void 0||n.length<=1)?[{kind:`model`,text:`Model ${V(t[0])}`},...i.map(e=>({kind:`responded`,text:`responded as ${e.modelId}`}))]:[{kind:`heading`,text:Se},...(t??[]).map(e=>({kind:`models`,text:`${V(e)} × ${String(e.stepCount)} steps`})),...i.map(e=>({kind:`responded`,text:`responded as ${e.modelId} × ${String(e.stepCount)} steps`}))]}function Le(e){return e.members.length>1}var Re=`decision-screenshot:`;function ze(e){return e.artifactRefs?.find(e=>e.id.startsWith(Re))}var Be={empty:`empty`,"not-captured":`not-captured`,unsupported:`unsupported`,unavailable:`unavailable`,failed:`failed`},Ve={empty:`positive`,"not-captured":`neutral`,unsupported:`neutral`,unavailable:`neutral`,failed:`alert`,"no-selection":`neutral`},He={empty:g,"not-captured":u,unsupported:t,unavailable:de,failed:ee,"no-selection":pe},Ue=`Loading records`,H=`${R} — this was recorded, but the saved file is no longer on disk.`,We=e=>`Recorded on step ${e}`,Ge=e=>`Go to step ${e}`,U={variables:`Retry loading variables`,network:`Retry loading network records`,console:`Retry loading console records`,aria:`Retry loading the ARIA tree`,a11y:`Retry loading accessibility results`,video:`Retry loading the recording`,frame:`Retry loading the screenshot`},W={variables:{empty:{title:`No variables at this step`,explanation:`No variables were set when this step ran.`},"not-captured":{title:`Variables not recorded for this step`,explanation:`No variable snapshot was saved for this step.`},unsupported:{title:`Variables aren't recorded on this platform`,explanation:`This run's platform does not support saving a variable snapshot.`},unavailable:{title:`Variables unavailable for this run`,explanation:`Variables were not recorded when this run happened, so there is nothing to show.`},failed:{capture:{title:`Variable capture failed`,explanation:`Saving the variable snapshot failed while the run was in progress. There is nothing to retry.`},load:{title:`Couldn't load variables`,explanation:`The variables were recorded but didn't load.`}},"no-selection":{title:`No step selected`,explanation:`Variables are shown per step. Pick a step in the tree or on the timeline to see them.`}},network:{empty:{title:`No network requests`,explanation:`The page made no requests during this step.`},"not-captured":{title:`Network not recorded for this step`,explanation:`No network activity was saved for this step.`},unsupported:{title:`Network isn't recorded on this platform`,explanation:`This run's platform does not support capturing network requests.`},unavailable:{title:`Network unavailable for this run`,explanation:`Network activity was not recorded when this run happened. This does not mean the run made no requests.`},failed:{capture:{title:`Network capture failed`,explanation:`Capturing network activity failed while the run was in progress. There is nothing to retry.`},load:{title:`Couldn't load network records`,explanation:`The records exist but didn't load.`}},"no-selection":{title:`No step selected`,explanation:`Network requests are shown per step. Pick a step in the tree or on the timeline to see them.`}},console:{empty:{title:`No console output`,explanation:`The page logged nothing during this step.`},"not-captured":{title:`Console not recorded for this step`,explanation:`No console output was saved for this step.`},unsupported:{title:`Console isn't recorded on this platform`,explanation:`This run's platform does not support capturing console output.`},unavailable:{title:`Console unavailable for this run`,explanation:`Console output was not recorded when this run happened. This does not mean the page logged nothing.`},failed:{capture:{title:`Console capture failed`,explanation:`Capturing console output failed while the run was in progress. There is nothing to retry.`},load:{title:`Couldn't load console records`,explanation:`The records exist but didn't load.`}},"no-selection":{title:`No step selected`,explanation:`Console output is shown per step. Pick a step in the tree or on the timeline to see it.`}},aria:{empty:{title:`Empty accessibility tree`,explanation:`The screen exposed no accessible elements when this action was decided.`},"not-captured":{title:`ARIA tree not recorded for this action`,explanation:`No accessibility tree was saved for this sub-action.`},unsupported:{title:`ARIA tree isn't recorded on this platform`,explanation:`This run's platform does not support capturing an accessibility tree.`},unavailable:{title:`ARIA tree unavailable for this run`,explanation:`The accessibility tree was not recorded when this run happened.`},failed:{capture:{title:`ARIA tree capture failed`,explanation:`Capturing the accessibility tree failed while the run was in progress. There is nothing to retry.`},load:{title:`Couldn't load the ARIA tree`,explanation:`The tree was recorded but didn't load.`}},"no-selection":{title:`No sub-action selected`,explanation:`The accessibility tree is shown per sub-action. Pick a sub-action in the tree or on the timeline to see what the model saw.`}},a11y:{empty:{title:`No accessibility violations found`,explanation:`The checks ran on this step and found nothing to fix.`},"not-captured":{title:`Accessibility checks not recorded for this step`,explanation:`No accessibility results were saved for this step.`},unsupported:{title:`Accessibility checks aren't supported on this platform`,explanation:`This run's platform cannot run accessibility checks.`},unavailable:{title:`Accessibility results unavailable for this run`,explanation:`Accessibility checks were not recorded when this run happened. This does not mean the run had no violations.`},failed:{capture:{title:`Accessibility checks failed to run`,explanation:`The checks hit an error while the run was in progress, so there are no results. There is nothing to retry.`},load:{title:`Couldn't load accessibility results`,explanation:`The results exist but didn't load.`}},"no-selection":{title:`No step selected`,explanation:`Accessibility results are shown per step. Pick a step in the tree or on the timeline to see them.`},retry:U.a11y},video:{empty:{title:`Recording has no video`,explanation:`A recording was saved for this test but it contains nothing to play.`},"not-captured":{title:`No recording for this test`,explanation:`No video was saved for this test. Frames still show what the model saw at each decision.`},unsupported:{title:`Recording isn't supported on this platform`,explanation:`This run's platform does not record video. Frames still show what the model saw at each decision.`},unavailable:{title:`Recording unavailable for this run`,explanation:`Video was not recorded when this run happened. Frames still show what the model saw at each decision.`},failed:{capture:{title:`Recording failed`,explanation:`The video could not be saved when this test finished. There is nothing to retry. Frames still show what the model saw at each decision.`},load:{title:`Couldn't load the recording`,explanation:`The recording exists but didn't load. Retry, or switch to Frames.`}},"no-selection":{title:`No step selected`,explanation:`The recording follows the timeline. Pick a step in the tree or on the timeline to position it.`}},frame:{"not-captured":{"sub-action":{title:`No screenshot for this action`,explanation:`No screenshot was saved for this sub-action.`},step:{title:`No screenshots for this step`,explanation:`None of this step's sub-actions saved a screenshot.`}},unavailable:{title:`Screenshot unavailable`,explanation:H},failed:{load:{title:`Couldn't load the screenshot`,explanation:`The screenshot exists but didn't load.`}}}};function Ke(e,t,n){let r;for(let i of e){if(i.stepIndex===t||i.evidence?.[n].state!==`present`)continue;let e=Math.abs(i.stepIndex-t),a=r?Math.abs(r.stepIndex-t):1/0;(e<a||e===a&&i.stepIndex>r.stepIndex)&&(r=i)}return r}function G({kind:e,selection:t,entry:n,read:r,elsewhere:i}){let a=(t,n,r)=>{let a={kind:`state`,state:t,...t===`failed`?W[e].failed[n??`capture`]:W[e][t],...n?{failure:n}:{},...r?{incomplete:!0,explanation:H}:{}};if(t===`failed`&&n===`load`)a.action={type:`retry`,label:U[e]};else if(t===`not-captured`&&i&&e!==`aria`&&e!==`video`){let t=Ke(i.steps,i.currentStepIndex,e);t&&(a.action={type:`step`,stepIndex:t.stepIndex,label:Ge(t.stepIndex+1),description:We(t.stepIndex+1)})}return a},o=e=>{if(e.evidenceIncomplete)return a(`unavailable`,void 0,!0);let t=Be[e.reason];return a(t,t===`failed`?`capture`:void 0)};if(t===`none`||t===`hook`||t===`execution-log`||e===`aria`&&t!==`sub-action`)return a(`no-selection`);if(!n)return a(`unavailable`);if(n.state===`absent`)return o(n);if(`ref`in n&&n.ref.evidenceIncomplete)return a(`unavailable`,void 0,!0);if(r===`idle`||r===`loading`)return{kind:`loading`};if(r.kind===`failed`||r.result.outcome===`read-error`)return a(`failed`,`load`);if(r.result.outcome===`absent`)return o(r.result.evidence);let s=r.result.document;return s.kind===e?(s.kind===`aria`?s.tree.length===0:s.kind===`variables`?Object.keys(s.records).length===0:s.records.length===0)?a(`empty`):{kind:`records`,document:s}:a(`failed`,`load`)}var K={positive:`text-emerald-500`,neutral:`text-muted-foreground`,alert:`text-destructive`};function q({kind:e,state:t,failure:n,incomplete:r,title:i,explanation:a,actionLabel:o,onAction:s,variant:c=`pane`}){let l=Ve[t],u=He[t],d={"data-evidence-state":t,"data-evidence-kind":e,"data-evidence-tone":l,"data-evidence-failure":t===`failed`?n:void 0,"data-evidence-incomplete":r?!0:void 0,role:l===`alert`?`alert`:`status`};return c===`inline`?(0,D.jsxs)(w,{...d,variant:`outline`,className:`gap-1 align-baseline border-border font-normal`,children:[(0,D.jsx)(u,{className:f(`h-3 w-3`,K[l]),"aria-hidden":`true`}),i]}):(0,D.jsxs)(`div`,{...d,className:`flex min-h-[16rem] w-full flex-col items-center justify-center gap-2 py-12 text-center`,children:[(0,D.jsx)(u,{className:f(`h-8 w-8`,K[l]),"aria-hidden":`true`}),(0,D.jsx)(`span`,{className:`text-sm font-medium text-foreground`,children:i}),(0,D.jsx)(`p`,{className:`max-w-sm text-xs text-muted-foreground`,children:a}),o&&s&&(0,D.jsx)(le,{size:`sm`,variant:t===`not-captured`?`link`:`outline`,onClick:s,children:o})]})}function J({kind:e}){return(0,D.jsxs)(`div`,{"data-evidence-loading":!0,"data-evidence-kind":e,"aria-busy":`true`,className:`space-y-2 p-3`,children:[(0,D.jsx)(`span`,{role:`status`,className:`sr-only`,children:Ue}),(0,D.jsx)(C,{className:`h-8 w-full`}),(0,D.jsx)(C,{className:`h-8 w-full`}),(0,D.jsx)(C,{className:`h-8 w-full`})]})}function qe({config:e,content:t,duration:n,outcome:r,children:i,open:a,onOpenChange:o,sectionRef:s}){let[c,l]=(0,E.useState)(!1),u=a!==void 0,d=u?a:c,p=u?o:l,m=e.icon,h=t||i;return(0,D.jsxs)(P,{open:d,onOpenChange:p,children:[(0,D.jsxs)(F,{ref:s,className:`flex w-full items-center gap-2 py-1.5 text-left group sticky top-0 z-20 bg-background`,children:[(0,D.jsx)(`div`,{className:`flex items-center justify-center h-4 w-4 rounded-full bg-background border shrink-0`,children:(0,D.jsx)(m,{className:`h-2.5 w-2.5 text-muted-foreground`})}),(0,D.jsx)(`span`,{className:`text-sm font-medium`,children:e.label}),n!=null&&(0,D.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:x(n)}),r,(0,D.jsx)(`span`,{className:`flex-1`}),h&&(0,D.jsx)(S,{className:f(`h-3 w-3 text-muted-foreground transition-transform duration-200`,d&&`rotate-90`)})]}),h&&(0,D.jsx)(I,{className:`overflow-hidden min-w-0 max-w-full`,children:(0,D.jsxs)(`div`,{className:`min-w-0 max-w-full pl-6 pb-2 space-y-2`,children:[t&&(0,D.jsx)(`div`,{"data-reasoning-content-shell":`true`,className:`min-w-0 max-w-full rounded-sm`,children:(0,D.jsx)(`div`,{"data-reasoning-prose":`true`,className:`m-0 whitespace-pre-wrap break-words text-sm text-muted-foreground [overflow-wrap:anywhere]`,children:t})}),i&&(0,D.jsx)(`div`,{"data-reasoning-children":`true`,className:`min-w-0 max-w-full`,children:i})]})})]})}var Je=(0,E.forwardRef)(function({sections:e},t){let[n,r]=(0,E.useState)(()=>e.map(()=>!1)),i=(0,E.useRef)([]),a=(0,E.useCallback)(e=>{r(t=>{let n=[...t],r=n[e];return n[e]=!r,r||requestAnimationFrame(()=>{i.current[e]?.scrollIntoView({block:`start`,behavior:`smooth`})}),n})},[]);return(0,E.useImperativeHandle)(t,()=>({togglePhase:a}),[a]),(0,D.jsxs)(`div`,{className:`relative space-y-0`,children:[(0,D.jsx)(`div`,{className:`absolute left-[7px] top-4 bottom-4 w-px bg-border`}),e.map((e,t)=>(0,D.jsx)(qe,{config:{key:e.key,label:e.label,icon:e.icon},content:e.content,duration:e.duration,outcome:e.outcome,open:n[t],onOpenChange:e=>r(n=>{let r=[...n];return r[t]=e,r}),sectionRef:e=>{i.current[t]=e},children:e.children},e.key))]})}),Ye=(0,E.forwardRef)(function({sections:e},t){return(0,D.jsx)(Je,{sections:e,ref:t})});function Y(e,t){let n=e?.runId,r=e?.testIndex,i=e?.stepIndex,a=e?.kind,o=e?.subActionIndex,[s,c]=(0,E.useState)(0),l=JSON.stringify([t,n,r,i,a,o,s]),[u,d]=(0,E.useState)({address:l});u.address!==l&&d({address:l});let f=(0,E.useCallback)(()=>c(e=>e+1),[]);return(0,E.useEffect)(()=>{if(!t||!n||r===void 0||i===void 0||!a)return;let e=!1,s=setTimeout(()=>{h({runId:_(n),testIndex:r,stepIndex:i,kind:a,...o===void 0?{}:{subActionIndex:o}}).catch(e=>({kind:`failed`,error:e instanceof Error?e.message:String(e)})).then(t=>{e||d({address:l,read:t})})},250);return()=>{e=!0,clearTimeout(s)}},[t,n,r,i,a,o,l,s]),{read:!t||!e?`idle`:n?u.address===l&&u.read?u.read:`loading`:{kind:`failed`,error:`Missing run address`},retry:f}}function Xe(e){switch(e){case`env`:return`bg-blue-500/15 text-blue-400 border-blue-500/20`;case`capture`:return`bg-emerald-500/15 text-emerald-400 border-emerald-500/20`;case`cli`:return`bg-purple-500/15 text-purple-400 border-purple-500/20`;case`inline`:return`bg-amber-500/15 text-amber-400 border-amber-500/20`;case`suite`:return`bg-cyan-500/15 text-cyan-400 border-cyan-500/20`;case`test`:return`bg-pink-500/15 text-pink-400 border-pink-500/20`;case`hook`:return`bg-orange-500/15 text-orange-400 border-orange-500/20`;case`step`:return`bg-teal-500/15 text-teal-400 border-teal-500/20`;default:return`bg-muted text-muted-foreground`}}function X({title:e,count:t,defaultOpen:n,children:r}){return(0,D.jsxs)(P,{defaultOpen:n,children:[(0,D.jsxs)(F,{className:`flex items-center gap-1.5 w-full px-3 py-2 text-xs font-medium text-muted-foreground hover:text-foreground transition-colors`,children:[(0,D.jsx)(S,{className:`h-3 w-3 transition-transform duration-200 [[data-state=open]>&]:rotate-90`}),e,(0,D.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/60`,children:[`(`,t,`)`]})]}),(0,D.jsx)(I,{children:r})]})}function Ze({message:e}){return(0,D.jsx)(`div`,{className:`px-4 py-3 text-xs text-muted-foreground/60 italic`,children:e})}function Qe({step:e,executionLogs:t=[],runId:n,selection:r=e?`step`:`none`,allSteps:i=[],onSelectStep:a}){let o=e?.evidence?.variables,{read:s,retry:c}=Y(e?.testIndex!==void 0&&e.stepIndex!==void 0?{runId:n??``,testIndex:e.testIndex,stepIndex:e.stepIndex,kind:`variables`}:null,o?.state===`present`&&(r===`step`||r===`sub-action`));if(e&&e.testIndex===void 0&&r===`step`)return(0,D.jsx)($e,{step:e,executionLogs:t});let l=i.filter(t=>t.testIndex===e?.testIndex&&t.stepIndex!==void 0).map(e=>({...e,stepIndex:e.stepIndex})),u=G({kind:`variables`,selection:r,entry:o,read:s,elsewhere:e?.stepIndex===void 0?void 0:{steps:l,currentStepIndex:e.stepIndex}});if(u.kind===`loading`)return(0,D.jsx)(J,{kind:`variables`});if(u.kind===`state`){let e=u.action;return(0,D.jsx)(q,{...u,kind:`variables`,explanation:e?.type===`step`?`${u.explanation} ${e.description}`:u.explanation,actionLabel:e?.label,onAction:e?.type===`retry`?c:e?.type===`step`&&a?()=>{let t=l.find(t=>t.stepIndex===e.stepIndex);t&&a(t.id)}:void 0})}return u.document.kind===`variables`?(0,D.jsx)($e,{step:{variableSnapshot:u.document.records}}):null}function $e({step:e,executionLogs:t=[]}){let n=e.variableSnapshot,r=n?Object.entries(n):[],i=t.filter(e=>e.type===`runjs`),a=t.filter(e=>e.type===`hook`);return(0,D.jsxs)(`div`,{className:`py-1`,children:[(0,D.jsx)(X,{title:`Env`,count:r.length,defaultOpen:r.length>0,children:r.length===0?(0,D.jsx)(q,{kind:`variables`,state:`empty`,...W.variables.empty}):(0,D.jsx)(`div`,{className:`px-3 pb-2`,children:(0,D.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,D.jsx)(`thead`,{children:(0,D.jsxs)(`tr`,{className:`border-b`,children:[(0,D.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground`,children:`Variable`}),(0,D.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground`,children:`Value`}),(0,D.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground`,children:`Source`})]})}),(0,D.jsx)(`tbody`,{children:r.map(([e,t])=>(0,D.jsxs)(`tr`,{className:`border-b border-border/50`,children:[(0,D.jsx)(`td`,{className:`py-1.5 px-2 font-mono text-xs text-muted-foreground`,children:e}),(0,D.jsx)(`td`,{className:`py-1.5 px-2 font-mono text-xs break-all`,children:t.value}),(0,D.jsx)(`td`,{className:`py-1.5 px-2`,children:(0,D.jsx)(w,{className:f(`text-[10px] px-1.5 py-0 border`,Xe(t.source)),children:t.source})})]},e))})]})})}),(0,D.jsx)(X,{title:`runJS`,count:i.length,defaultOpen:i.length>0,children:i.length===0?(0,D.jsx)(Ze,{message:`No runJS executions for this step`}):(0,D.jsx)(`div`,{className:`px-3 pb-2 space-y-2`,children:i.map(e=>(0,D.jsxs)(`div`,{className:`rounded-md border border-border/50 p-2 text-xs`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2 mb-1.5`,children:[e.status===`passed`?(0,D.jsx)(g,{className:`h-3.5 w-3.5 text-emerald-500 shrink-0`}):(0,D.jsx)(d,{className:`h-3.5 w-3.5 text-red-500 shrink-0`}),(0,D.jsx)(`span`,{className:`font-medium truncate`,children:e.name}),(0,D.jsx)(`span`,{className:`text-muted-foreground ml-auto shrink-0`,children:x(e.duration)})]}),e.stdout&&(0,D.jsx)(`pre`,{className:`mt-1 p-1.5 rounded bg-muted/50 font-mono text-[11px] whitespace-pre-wrap break-all overflow-hidden`,children:e.stdout}),e.returnData!=null&&(0,D.jsxs)(`div`,{className:`mt-1 p-1.5 rounded bg-muted/50`,children:[(0,D.jsx)(`span`,{className:`text-muted-foreground`,children:`Return: `}),(0,D.jsx)(`span`,{className:`font-mono text-[11px]`,children:typeof e.returnData==`string`?e.returnData:JSON.stringify(e.returnData)})]})]},e.id))})}),(0,D.jsx)(X,{title:`Hooks`,count:a.length,defaultOpen:a.length>0,children:a.length===0?(0,D.jsx)(Ze,{message:`No hooks ran for this step`}):(0,D.jsx)(`div`,{className:`px-3 pb-2 space-y-2`,children:a.map(e=>(0,D.jsxs)(`div`,{className:`rounded-md border border-border/50 p-2 text-xs`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2 mb-1`,children:[e.status===`passed`?(0,D.jsx)(g,{className:`h-3.5 w-3.5 text-emerald-500 shrink-0`}):(0,D.jsx)(d,{className:`h-3.5 w-3.5 text-red-500 shrink-0`}),(0,D.jsx)(`span`,{className:`font-medium truncate`,children:e.name}),(0,D.jsx)(`span`,{className:`text-muted-foreground ml-auto shrink-0`,children:x(e.duration)})]}),e.variables&&Object.keys(e.variables).length>0&&(0,D.jsxs)(`div`,{className:`mt-1.5 space-y-0.5`,children:[(0,D.jsx)(`span`,{className:`text-muted-foreground text-[10px]`,children:`Emitted variables:`}),Object.entries(e.variables).map(([e,t])=>(0,D.jsxs)(`div`,{className:`flex gap-2 pl-2 font-mono text-[11px]`,children:[(0,D.jsxs)(`span`,{className:`text-muted-foreground`,children:[e,`:`]}),(0,D.jsx)(`span`,{className:`break-all`,children:t})]},e))]}),e.stdout&&(0,D.jsx)(`pre`,{className:`mt-1 p-1.5 rounded bg-muted/50 font-mono text-[11px] whitespace-pre-wrap break-all overflow-hidden max-h-24 overflow-y-auto`,children:e.stdout})]},e.id))})})]})}function et(e){return e>=1e3?`+${(e/1e3).toFixed(1)}s`:`+${Math.round(e)}ms`}function tt(e){return Object.entries(e).filter(([e,t])=>e!==`startTime`&&t>0)}function nt(e){return e>=200&&e<300?`text-emerald-500`:e>=300&&e<400?`text-amber-500`:e>=400?`text-red-500`:`text-muted-foreground`}function rt({headers:e}){let t=Object.entries(e);return t.length===0?(0,D.jsx)(`span`,{className:`text-xs text-muted-foreground italic`,children:`None`}):(0,D.jsx)(`div`,{className:`space-y-0.5`,children:t.map(([e,t])=>(0,D.jsxs)(`div`,{className:`flex gap-2 text-xs font-mono`,children:[(0,D.jsxs)(`span`,{className:`text-muted-foreground shrink-0`,children:[e,`:`]}),(0,D.jsx)(`span`,{className:`break-all`,children:t})]},e))})}function Z({label:e,children:t}){return(0,D.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,D.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium`,children:e}),t]})}function it({text:e}){let[t,n]=(0,E.useState)(!1);return(0,D.jsx)(`button`,{onClick:(0,E.useCallback)(t=>{t.stopPropagation(),navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),1500)},[e]),className:`text-muted-foreground hover:text-foreground`,children:t?(0,D.jsx)(r,{className:`h-3 w-3`}):(0,D.jsx)(l,{className:`h-3 w-3`})})}function at({body:e,contentType:t}){if(t.toLowerCase().includes(`application/json`))try{return(0,D.jsx)(`pre`,{className:`text-xs font-mono bg-background/60 rounded-sm px-3 py-2 overflow-x-auto max-h-48 whitespace-pre-wrap break-all`,children:JSON.stringify(JSON.parse(e),null,2)})}catch{return(0,D.jsx)(`pre`,{className:`text-xs font-mono bg-background/60 rounded-sm px-3 py-2 overflow-x-auto max-h-48 whitespace-pre-wrap break-all`,children:e})}return(0,D.jsx)(`pre`,{className:`text-xs font-mono bg-background/60 rounded-sm px-3 py-2 overflow-x-auto max-h-48 whitespace-pre-wrap break-all`,children:e})}function ot({entry:e}){let t=e.method===`POST`||e.method===`PUT`||e.method===`PATCH`;return(0,D.jsx)(`tr`,{children:(0,D.jsx)(`td`,{colSpan:6,className:`px-0 py-0`,children:(0,D.jsxs)(`div`,{className:`bg-muted/20 border-b border-border/50 px-4 py-3 space-y-4`,children:[(0,D.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,D.jsx)(Z,{label:`Request Headers`,children:(0,D.jsx)(rt,{headers:e.requestHeaders??{}})}),(0,D.jsx)(Z,{label:`Response Headers`,children:(0,D.jsx)(rt,{headers:e.responseHeaders??{}})})]}),t&&(0,D.jsx)(Z,{label:`Request Body`,children:e.requestBody?(0,D.jsx)(`pre`,{className:`text-xs font-mono bg-background/60 rounded-sm px-3 py-2 overflow-x-auto max-h-48 whitespace-pre-wrap break-all`,children:e.requestBody}):(0,D.jsx)(`span`,{className:`text-xs text-muted-foreground italic`,children:`No request body`})}),(0,D.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,D.jsxs)(`div`,{className:`flex justify-between items-center`,children:[(0,D.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium`,children:`Response Body`}),e.body&&(0,D.jsx)(it,{text:e.body})]}),e.body?(0,D.jsx)(at,{body:e.body,contentType:e.responseHeaders?.[`content-type`]??``}):(0,D.jsx)(`span`,{className:`text-xs text-muted-foreground italic`,children:`Not captured`})]}),e.timing&&(()=>{let t=tt(e.timing);return t.length===0?null:(0,D.jsx)(Z,{label:`Timing`,children:(0,D.jsx)(`div`,{className:`flex flex-wrap gap-3`,children:t.map(([e,t])=>(0,D.jsxs)(`div`,{className:`text-xs font-mono`,children:[(0,D.jsxs)(`span`,{className:`text-muted-foreground`,children:[e,`:`]}),` `,(0,D.jsxs)(`span`,{children:[Math.round(t),`ms`]})]},e))})})})()]})})})}function Q({text:e,query:t}){let n=t?e.toLowerCase().indexOf(t.toLowerCase()):-1;return n===-1?(0,D.jsx)(D.Fragment,{children:e}):(0,D.jsxs)(D.Fragment,{children:[e.slice(0,n),(0,D.jsx)(`mark`,{className:`bg-yellow-400/30 text-inherit rounded-sm px-0.5`,children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function st({step:e,allSteps:t,platform:n,runId:r,selection:i=e?`step`:`none`,evidenceSteps:a=[],onSelectStep:o}){let s=e?.evidence?.network,{read:c,retry:l}=Y(e?.testIndex!==void 0&&e.stepIndex!==void 0?{runId:r??``,testIndex:e.testIndex,stepIndex:e.stepIndex,kind:`network`}:null,s?.state===`present`&&!s.ref.evidenceIncomplete&&(i===`step`||i===`sub-action`));if(e&&e.testIndex===void 0&&(i===`step`||i===`sub-action`))return(0,D.jsx)(ct,{step:e,allSteps:t,platform:n});let u=a.filter(t=>t.testIndex===e?.testIndex&&t.stepIndex!==void 0).map(e=>({...e,stepIndex:e.stepIndex})),d=G({kind:`network`,selection:i,entry:s,read:c,elsewhere:e?.stepIndex===void 0?void 0:{steps:u,currentStepIndex:e.stepIndex}});if(d.kind===`loading`)return(0,D.jsx)(J,{kind:`network`});if(d.kind===`state`){let e=d.action;return(0,D.jsx)(q,{...d,kind:`network`,explanation:e?.type===`step`?`${d.explanation} ${e.description}`:d.explanation,actionLabel:e?.label,onAction:e?.type===`retry`?l:e?.type===`step`&&o?()=>{let t=u.find(t=>t.stepIndex===e.stepIndex);t&&o(t.id)}:void 0})}if(d.document.kind!==`network`||!e)return null;let f={...e,networkLogs:d.document.records};return(0,D.jsx)(ct,{step:f,allSteps:[f],platform:n},`${r}:${e.testIndex}:${e.stepIndex}`)}function ct({step:e,allSteps:t,platform:n}){let[r,i]=(0,E.useState)(new Set),a=(0,E.useMemo)(()=>{let n=e.displayStepOrder??e.stepOrder,r=[];for(let e of t){let t=e.displayStepOrder??e.stepOrder;if(t>n)continue;let i=t===n;for(let t of e.networkLogs??[])r.push({...t,isCurrent:i})}return r.sort((e,t)=>e.startTime-t.startTime)},[e,t]),o=(0,E.useMemo)(()=>a.length===0?0:Math.min(...a.map(e=>e.startTime)),[a]),[s,c]=(0,E.useState)(``),l=(0,E.useDeferredValue)(s),u=(0,E.useMemo)(()=>{if(!l)return a;let e=l.toLowerCase();return a.filter(t=>t.url.toLowerCase().includes(e)||t.method.toLowerCase().includes(e)||String(t.status).includes(e))},[a,l]);(0,E.useEffect)(()=>{i(new Set)},[l]);let d=(0,E.useCallback)(e=>{i(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]);if(a.length===0){let e=n===`android`||n===`ios`?`unsupported`:`empty`;return(0,D.jsx)(q,{kind:`network`,state:e,...W.network[e]})}return(0,D.jsxs)(`div`,{children:[(0,D.jsxs)(`div`,{className:`sticky top-0 z-10 bg-background border-b border-border/50 px-3 py-1.5 flex items-center gap-2`,children:[(0,D.jsx)(v,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,D.jsx)(`input`,{value:s,onChange:e=>c(e.target.value),placeholder:`Filter...`,className:`flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`}),s&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`span`,{className:`text-xs text-muted-foreground shrink-0`,children:[u.length,` of `,a.length]}),(0,D.jsx)(`button`,{onClick:()=>c(``),className:`text-muted-foreground hover:text-foreground`,children:(0,D.jsx)(b,{className:`h-3.5 w-3.5`})})]})]}),(0,D.jsx)(`div`,{className:`p-3`,children:(0,D.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,D.jsx)(`thead`,{children:(0,D.jsxs)(`tr`,{className:`border-b`,children:[(0,D.jsx)(`th`,{className:`w-6`}),(0,D.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground w-16`,children:`Method`}),(0,D.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground`,children:`URL`}),(0,D.jsx)(`th`,{className:`text-left py-1.5 px-2 text-xs font-medium text-muted-foreground w-16`,children:`Status`}),(0,D.jsx)(`th`,{className:`text-right py-1.5 px-2 text-xs font-medium text-muted-foreground w-20`,children:`Time`}),(0,D.jsx)(`th`,{className:`text-right py-1.5 px-2 text-xs font-medium text-muted-foreground w-20`,children:`Duration`})]})}),(0,D.jsx)(`tbody`,{children:u.map((e,t)=>{let n=e.endTime-e.startTime,i=r.has(t);return(0,D.jsxs)(E.Fragment,{children:[(0,D.jsxs)(`tr`,{onClick:()=>d(t),className:f(`border-b border-border/50 cursor-pointer hover:bg-muted/30 transition-colors`,i&&`bg-muted/20`,!e.isCurrent&&`opacity-40`),children:[(0,D.jsx)(`td`,{className:`py-1.5 pl-2 pr-0 w-6`,children:(0,D.jsx)(S,{className:f(`h-3 w-3 text-muted-foreground transition-transform`,i&&`rotate-90`)})}),(0,D.jsx)(`td`,{className:`py-1.5 px-2`,children:(0,D.jsx)(w,{variant:`outline`,className:`text-[10px] px-1.5 py-0 font-mono`,children:(0,D.jsx)(Q,{text:e.method,query:l})})}),(0,D.jsx)(`td`,{className:`py-1.5 px-2 text-xs font-mono truncate max-w-0 min-w-0`,children:(0,D.jsx)(Q,{text:e.url,query:l})}),(0,D.jsx)(`td`,{className:`py-1.5 px-2`,children:(0,D.jsx)(`span`,{className:f(`text-xs font-mono`,nt(e.status)),children:(0,D.jsx)(Q,{text:String(e.status),query:l})})}),(0,D.jsx)(`td`,{className:`py-1.5 px-2 text-xs font-mono text-muted-foreground text-right`,children:et(e.startTime-o)}),(0,D.jsxs)(`td`,{className:`py-1.5 px-2 text-xs text-muted-foreground text-right`,children:[n<1?`<1`:Math.round(n),`ms`]})]}),i&&(0,D.jsx)(ot,{entry:e})]},t)})})]})})]})}function lt(e){switch(e.toLowerCase()){case`error`:return`text-red-400`;case`warn`:case`warning`:return`text-amber-400`;case`info`:return`text-blue-400`;case`debug`:return`text-cyan-400`;default:return`text-muted-foreground`}}function ut(e){switch(e){case`setup`:return`bg-blue-500/15 text-blue-400 border-blue-500/20`;case`teardown`:return`bg-purple-500/15 text-purple-400 border-purple-500/20`;case`inline`:return`bg-emerald-500/15 text-emerald-400 border-emerald-500/20`;default:return`bg-muted text-muted-foreground`}}var dt=[`error`,`warn`,`info`,`log`,`debug`];function ft({text:e,query:t}){let n=t?e.toLowerCase().indexOf(t.toLowerCase()):-1;return n===-1?(0,D.jsx)(D.Fragment,{children:e}):(0,D.jsxs)(D.Fragment,{children:[e.slice(0,n),(0,D.jsx)(`mark`,{className:`bg-yellow-400/30 text-inherit rounded-sm px-0.5`,children:e.slice(n,n+t.length)}),e.slice(n+t.length)]})}function pt({step:e,allSteps:t,executionLogs:n,isHookStep:r,runId:i,selection:a=e?`step`:`none`,evidenceSteps:o=[],onSelectStep:s}){let c=!!(r&&n?.length),l=e?.evidence?.console,{read:u,retry:d}=Y(e?.testIndex!==void 0&&e.stepIndex!==void 0?{runId:i??``,testIndex:e.testIndex,stepIndex:e.stepIndex,kind:`console`}:null,!c&&l?.state===`present`&&!l.ref.evidenceIncomplete&&(a===`step`||a===`sub-action`));if(c)return(0,D.jsx)($,{step:{stepOrder:0,displayStepOrder:0},allSteps:[],executionLogs:n,isHookStep:!0});if(e&&e.testIndex===void 0&&(a===`step`||a===`sub-action`))return(0,D.jsx)($,{step:e,allSteps:t});let f=o.filter(t=>t.testIndex===e?.testIndex&&t.stepIndex!==void 0).map(e=>({...e,stepIndex:e.stepIndex})),p=G({kind:`console`,selection:a,entry:l,read:u,elsewhere:e?.stepIndex===void 0?void 0:{steps:f,currentStepIndex:e.stepIndex}});if(p.kind===`loading`)return(0,D.jsx)(J,{kind:`console`});if(p.kind===`state`){let e=p.action;return(0,D.jsx)(q,{...p,kind:`console`,explanation:e?.type===`step`?`${p.explanation} ${e.description}`:p.explanation,actionLabel:e?.label,onAction:e?.type===`retry`?d:e?.type===`step`&&s?()=>{let t=f.find(t=>t.stepIndex===e.stepIndex);t&&s(t.id)}:void 0})}if(p.document.kind!==`console`||!e)return null;let m={...e,consoleLogs:p.document.records};return(0,D.jsx)($,{step:m,allSteps:[m]},`${i}:${e.testIndex}:${e.stepIndex}`)}function $({step:e,allSteps:t,executionLogs:n,isHookStep:r}){let l=(0,E.useMemo)(()=>{let n=e.displayStepOrder??e.stepOrder,r=[];for(let e of t){let t=e.displayStepOrder??e.stepOrder;if(t>n)continue;let i=t===n;for(let t of e.consoleLogs??[])r.push({...t,isCurrent:i})}return r.sort((e,t)=>e.timestamp-t.timestamp)},[e,t]),[u,d]=(0,E.useState)(``),p=(0,E.useDeferredValue)(u),[m,h]=(0,E.useState)(`all`),g=(0,E.useMemo)(()=>{let e=l;if(m!==`all`&&(e=e.filter(e=>{let t=e.level.toLowerCase(),n=dt.indexOf(m);if(n===-1)return!0;let r=dt.indexOf(t);return r!==-1&&r>=n})),p){let t=p.toLowerCase();e=e.filter(e=>e.text.toLowerCase().includes(t)||e.level.toLowerCase().includes(t))}return e},[l,p,m]),_=r&&n&&n.length>0,y=l.length>0;return!_&&!y?(0,D.jsx)(q,{kind:`console`,state:`empty`,...W.console.empty}):(0,D.jsxs)(`div`,{className:`w-full overflow-hidden`,children:[y&&(0,D.jsxs)(`div`,{className:`sticky top-0 z-10 bg-background border-b border-border/50 px-3 py-1.5 flex items-center gap-2`,children:[(0,D.jsx)(v,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,D.jsx)(`input`,{value:u,onChange:e=>d(e.target.value),placeholder:`Filter...`,className:`flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground`}),u&&(0,D.jsxs)(`span`,{className:`text-xs text-muted-foreground shrink-0`,children:[g.length,` of `,l.length]}),(0,D.jsx)(`div`,{className:`h-3 w-px bg-border/50 shrink-0`}),(0,D.jsxs)(c,{value:m,onValueChange:h,children:[(0,D.jsx)(a,{size:`sm`,className:`h-6 rounded-sm text-xs px-2 gap-1 border-border/50 min-w-0 w-auto`,children:(0,D.jsx)(i,{})}),(0,D.jsxs)(o,{className:`rounded-sm`,children:[(0,D.jsx)(s,{value:`all`,className:`text-xs`,children:`All levels`}),(0,D.jsx)(s,{value:`error`,className:`text-xs`,children:`Errors`}),(0,D.jsx)(s,{value:`warn`,className:`text-xs`,children:`Warnings`}),(0,D.jsx)(s,{value:`info`,className:`text-xs`,children:`Info`}),(0,D.jsx)(s,{value:`log`,className:`text-xs`,children:`Log`}),(0,D.jsx)(s,{value:`debug`,className:`text-xs`,children:`Debug`})]})]}),u&&(0,D.jsx)(`button`,{onClick:()=>d(``),className:`text-muted-foreground hover:text-foreground shrink-0`,children:(0,D.jsx)(b,{className:`h-3.5 w-3.5`})})]}),(0,D.jsxs)(`div`,{className:`p-3 space-y-0.5 overflow-x-hidden w-full max-w-full`,children:[_&&(0,D.jsx)(`div`,{className:`space-y-2 mb-3`,children:n.map(e=>(0,D.jsxs)(`div`,{className:`border border-border/50 rounded-sm overflow-hidden`,children:[(0,D.jsxs)(`div`,{className:`flex items-center gap-2 px-2 py-1.5 bg-muted/20 border-b border-border/30`,children:[(0,D.jsx)(w,{variant:`outline`,className:`text-[10px] px-1.5 py-0 font-mono`,children:e.name}),(0,D.jsx)(w,{className:f(`text-[10px] px-1.5 py-0`,ut(e.phase)),children:e.phase}),(0,D.jsx)(`span`,{className:f(`text-[10px] font-mono`,e.status===`passed`?`text-emerald-500`:`text-red-500`),children:e.status}),(0,D.jsxs)(`span`,{className:`text-[10px] text-muted-foreground ml-auto`,children:[e.duration,`ms`]})]}),e.stdout&&(0,D.jsx)(`pre`,{className:`px-3 py-2 font-mono text-xs whitespace-pre-wrap text-foreground/90`,children:e.stdout}),e.stderr&&(0,D.jsx)(`pre`,{className:`px-3 py-2 font-mono text-xs whitespace-pre-wrap text-red-400/80 border-t border-border/30`,children:e.stderr})]},e.id))}),_&&y&&(0,D.jsx)(`div`,{className:`border-t border-border/30 pt-2 mb-1`,children:(0,D.jsx)(`span`,{className:`text-[10px] text-muted-foreground uppercase tracking-wider`,children:`Browser Console`})}),y&&g.map((e,t)=>(0,D.jsxs)(`div`,{className:f(`flex items-start gap-1.5 py-0.5 px-2 hover:bg-muted/30 font-mono text-xs overflow-hidden max-w-full`,!e.isCurrent&&`opacity-40`),children:[(0,D.jsx)(`span`,{className:f(`shrink-0 text-[10px]`,lt(e.level)),children:e.level}),(0,D.jsx)(`span`,{className:`text-muted-foreground/60 shrink-0 text-[10px] tabular-nums`,children:new Date(e.timestamp).toLocaleTimeString()}),(0,D.jsx)(`span`,{className:`flex-1 min-w-0 break-all whitespace-pre-wrap overflow-hidden`,children:(0,D.jsx)(ft,{text:e.text,query:p})})]},t))]})]})}export{I as A,je as C,Ie as D,Pe as E,fe as M,ue as N,Ne as O,De as S,Me as T,Ee as _,Ye as a,Ae as b,W as c,G as d,R as f,ze as g,Fe as h,Y as i,F as j,P as k,H as l,Ce as m,st as n,J as o,we as p,Qe as r,q as s,pt as t,U as u,Te as v,Le as w,Oe as x,ke as y};
@@ -1 +0,0 @@
1
- import"./chunk-CilyBKbf.js";import{B as e,Sc as t,Xt as n}from"./index-CXuVkD6-.js";t();var r=n();function i({className:t,...n}){return(0,r.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto`,children:(0,r.jsx)(`table`,{"data-slot":`table`,className:e(`w-full caption-bottom text-sm`,t),...n})})}function a({className:t,...n}){return(0,r.jsx)(`thead`,{"data-slot":`table-header`,className:e(`[&_tr]:border-b`,t),...n})}function o({className:t,...n}){return(0,r.jsx)(`tbody`,{"data-slot":`table-body`,className:e(`[&_tr:last-child]:border-0`,t),...n})}function s({className:t,...n}){return(0,r.jsx)(`tr`,{"data-slot":`table-row`,className:e(`border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted`,t),...n})}function c({className:t,...n}){return(0,r.jsx)(`th`,{"data-slot":`table-head`,className:e(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,t),...n})}function l({className:t,...n}){return(0,r.jsx)(`td`,{"data-slot":`table-cell`,className:e(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,t),...n})}export{a,c as i,o as n,s as o,l as r,i as t};
@@ -1,9 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./monaco-editor-BQB4vEk_.js";import{a as n,c as r,i,l as a,n as o,o as s,r as ee,s as te,t as c}from"./filename-validation-I94bcMf7.js";import{t as ne}from"./file-code-BTJCyvvJ.js";import{n as re}from"./split-button-BHdketN3.js";import{c as ie}from"./id-badge-CIbcJUv0.js";import{i as ae,n as oe,r as se,t as ce}from"./test-navbar-BfzeL-K8.js";import{t as le}from"./label-CYpyu7PJ.js";import{i as ue,n as de,r as fe,t as pe}from"./tabs-CsAJVEvt.js";import{A as l,D as me,F as he,G as ge,I as _e,M as ve,N as ye,O as u,P as be,Qn as xe,R as Se,Sc as Ce,Sr as d,Xt as f,Zt as we,_c as Te,_n as Ee,_r as De,bn as Oe,in as ke,on as Ae,pr as je,r as Me,ur as Ne,vc as Pe,y as p,yc as Fe,yr as Ie,zt as Le}from"./index-CXuVkD6-.js";import{t as Re}from"./use-page-title-fn79XYtf.js";import{r as ze}from"./dist-Cy8QoEce.js";import{n as m,r as Be,t as Ve}from"./resizable-om0nWp3k.js";import{t as He}from"./empty-state-2mwYYmoQ.js";import{t as Ue}from"./use-keyboard-shortcuts-befVnBO6.js";var h=e(Ce(),1),g=f(),We=`name: My Test
2
- test-id: ""
3
- target: ""
4
- context: ""
5
- steps:
6
- - Navigate to the homepage
7
- - Verify the page loads
8
- `;function Ge({text:e}){return(0,g.jsxs)(me,{children:[(0,g.jsx)(l,{asChild:!0,children:(0,g.jsx)(Le,{className:`h-3 w-3 text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors cursor-help`})}),(0,g.jsx)(u,{className:`max-w-[250px] text-[13px]`,children:e})]})}function _(e){return e.map(e=>e.line?`Line ${e.line}: ${e.message}`:e.message).join(`
9
- `)}function Ke(e){if(!(e instanceof we)||e.payload?.error!==`invalid_test_file`)return null;let t=e.payload.errors;return Array.isArray(t)?t:null}function qe(e){return e instanceof DOMException&&e.name===`AbortError`||e instanceof Error&&e.name===`AbortError`}function Je(e,t,n){if(t===`web`)return n||e?.url||`Configured start URL`;let r=e?.device;return(typeof r?.deviceName==`string`?r.deviceName:typeof r?.name==`string`?r.name:null)||e?.product||e?.bundleId||e?.appPackage||(t===`android`?`Android device`:`iOS device`)}function v(e){return JSON.stringify({text:e.text,overrides:e.overrides??null})}function Ye(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function Xe(e){let t=(0,h.useRef)([]);return(0,h.useMemo)(()=>{let n=t.current,r=new Set,i=e.map((e,t)=>{let i=v(e),a=n[t];if(a&&a.signature===i)return r.add(a.id),{id:a.id,instruction:e.text,signature:i};let o=n.find(e=>e.signature===i&&!r.has(e.id));return o?(r.add(o.id),{id:o.id,instruction:e.text,signature:i}):a&&!r.has(a.id)?(r.add(a.id),{id:a.id,instruction:e.text,signature:i}):{id:crypto.randomUUID(),instruction:e.text,signature:i}});return t.current=i.map(({id:e,signature:t})=>({id:e,signature:t})),i},[e])}function Ze(){let{t_id:e}=Pe(),l=Te(),[me]=Fe(),u=ge(),{defaultRunMode:Ce}=re(),{targets:f,globalUse:we,isLoading:Le}=ie(),v=e??``,{suggestions:Ze}=o(v||null),y=!e,Qe=me.get(`live`)===`1`,$e=(0,h.useRef)(null),b=(0,h.useRef)(null),et=(0,h.useRef)(null),tt=(0,h.useRef)(()=>{}),nt=(0,h.useRef)(!1),[x,S]=(0,h.useState)(y?We:``),[rt,it]=(0,h.useState)(``),[C,at]=(0,h.useState)(``),[ot,st]=(0,h.useState)(!y),[ct,lt]=(0,h.useState)(!1),[ut,dt]=(0,h.useState)(!1),[ft,pt]=(0,h.useState)(!1),[mt,ht]=(0,h.useState)(!1),[w,gt]=(0,h.useState)(null),[T,E]=(0,h.useState)(null),[D,O]=(0,h.useState)(null),[k,A]=(0,h.useState)(!1),[j,M]=(0,h.useState)(!1),[N,P]=(0,h.useState)(null),[_t,F]=(0,h.useState)(`reasoning`),[vt,I]=(0,h.useState)(null),[yt,L]=(0,h.useState)({setup:[],teardown:[]}),[R,bt]=(0,h.useState)(null),[xt,St]=(0,h.useState)(!1),[Ct,wt]=(0,h.useState)(!1),[z,Tt]=(0,h.useState)(void 0),[Et,Dt]=(0,h.useState)([]),[Ot,kt]=(0,h.useState)(!1),[B,At]=(0,h.useState)(``),V=!y&&x!==rt,jt=y&&C?c(C.trim(),z,`testMatch`):null,Mt=y&&!!C&&!!jt;(0,h.useEffect)(()=>{if(y)return;let e=!1;return st(!0),xe(v).then(t=>{e||(S(t.content),it(t.content),At(t.path))}).catch(()=>{e||(lt(!0),p.error(`Failed to load test file`))}).finally(()=>{e||st(!1)}),()=>{e=!0}},[v,y]),(0,h.useEffect)(()=>{if(!y)return;let e=!1;return Oe().then(t=>{if(e)return;let n=t.config.workspace?.testMatch;Tt(Array.isArray(n)?n:[])}).catch(()=>{e||Tt([])}),()=>{e=!0}},[y]),(0,h.useEffect)(()=>{if(!y)return;let e=ze();S(t=>se(t,[`test-id`],e))},[y]);let H=(0,h.useMemo)(()=>ae(x),[x]);H&&($e.current=H);let U=H??$e.current,W=Xe(U?.steps??[]),Nt=(0,h.useMemo)(()=>W.map(e=>({draftId:e.id,instruction:e.instruction})),[W]),G=(0,h.useMemo)(()=>H?{testName:H.name.trim()||`Untitled Live Draft`,testContext:H.context.trim()||void 0}:null,[H]),K=n(T,{steps:Nt,setupHooks:yt.setup,teardownHooks:yt.teardown,allowReconnect:!0}),q=K.terminateSession,Pt=K.sessionGone;et.current=T,tt.current=q;let J=U?.target?.trim()??``,Ft=J?f[J]:void 0,It=T?K.platform:Ft?.platform??`web`,Lt=(0,h.useMemo)(()=>Je(Ft,It,K.currentUrl),[Ft,It,K.currentUrl]),Rt=H===null?`invalid`:V||y?`unsaved`:`saved`,zt=(0,h.useMemo)(()=>W.map(e=>e.id),[W]),Y=j?`connecting`:K.connectionState,X=T!==null,Z=X&&It===`web`&&J?J:null,Bt=(0,h.useMemo)(()=>i(x),[x]),Vt=X&&H!==null&&!Ye(H.setup,yt.setup);Re((0,h.useMemo)(()=>X&&D!==null?`Live #${D} — ${U?.name?.trim()||v||`Test`}`:y?`New Test`:`Edit Test`,[X,D,U?.name,v,y]));let Ht=(0,h.useMemo)(()=>N===`ended`?{reason:`ended`,title:`Live session ended`,description:`The current draft is unchanged. Close live mode or start a fresh disposable session from this target.`}:N===`disconnected`?{reason:`disconnected`,title:`Live session disconnected`,description:`The connection dropped and could not be restored. Start a fresh session to continue.`}:null,[N]),Ut=X&&Y===`connected`&&H!==null&&H.steps.some(e=>e.text.trim()),Wt=j||X,Gt=j||X||mt||w!==null||H===null||!H?.target.trim()||Le,Q=(0,h.useCallback)(async()=>{let e=await Ie(x,B||C.trim());return e.valid?!1:(p.error(_(e.errors)),!0)},[x,B,C]),Kt=(0,h.useCallback)(()=>{let e=H?.testId?.trim();e&&l(d.testView(e))},[H,l]),$=(0,h.useCallback)(async()=>{dt(!0);try{if(y){let e=c(C.trim(),z,`testMatch`);if(e){p.error(e);return}if(await Q())return;await Ae(C.trim(),x),p.success(`Test file created`),Kt()}else{if(await Q())return;await De(v,x),it(x),p.success(`Saved`)}}catch(e){let t=Ke(e);p.error(t?_(t):`Failed to save: ${e instanceof Error?e.message:String(e)}`)}finally{dt(!1)}},[y,C,z,x,v,Q,Kt]),qt=(0,h.useCallback)(()=>{s(`page`,`closing live mode`,{liveSessionId:T??void 0,terminalReason:N??void 0}),b.current?.abort(),b.current=null,T&&q(),M(!1),E(null),O(null),P(null),I(null),L({setup:[],teardown:[]}),A(!1)},[T,N,q]),Jt=(0,h.useCallback)(()=>{s(`page`,`ending live session from UI`,{liveSessionId:T??void 0}),b.current?.abort(),b.current=null,T&&q(),M(!1),E(null),O(null),P(`ended`),I(null),L({setup:[],teardown:[]}),A(!0)},[T,q]),Yt=(0,h.useCallback)(async(e,t)=>{let n=e.target.trim();if(!n){p.error(`Select a target before starting live mode`);return}let r=new AbortController;b.current?.abort(),b.current=r,A(!0),P(null),F(`reasoning`),I(null),M(!0);try{t?.replaceCurrentSession&&T&&(q(),E(null),O(null));let i=ee({content:x,targetName:n,targets:f,globalUse:we});s(`page`,`requesting live session`,{targetName:n,platform:i.platform,headless:i.headless??void 0,replacingSession:t?.replaceCurrentSession??!1});let a=[...e.setup],o=[...e.teardown],te=e.testId?.trim()||null,c=te?{type:`test`,id:te}:void 0,{sessionId:ne,sessionNumber:re}=await ke({...i,setupHooks:a,teardownHooks:o,entity:c},r.signal);if(r.signal.aborted)return;L({setup:a,teardown:o}),E(ne),O(re),s(`page`,`live session created`,{sessionId:ne,targetName:n})}catch(e){qe(e)||(s(`page`,`failed to create live session`,{error:e instanceof Error?e.message:String(e),targetName:n}),p.error(e instanceof Error?e.message:`Failed to start live session`)),t?.replaceCurrentSession||A(!1)}finally{b.current===r&&(b.current=null),M(!1)}},[x,we,T,f,q]),Xt=(0,h.useCallback)(async()=>{if(!Gt){if(!H){p.error(`Fix YAML errors before starting live mode`);return}await Yt(H)}},[H,Yt,Gt]),Zt=(0,h.useCallback)(async()=>{if(X){if(!H){p.error(`Fix YAML errors before restarting live mode`);return}await Yt(H,{replaceCurrentSession:!0})}},[H,X,Yt]),Qt=(0,h.useCallback)(async()=>{if(!Z){Dt([]);return}try{Dt((await Ee({target:Z})).authStates)}catch{Dt([])}},[Z]);(0,h.useEffect)(()=>{Qt()},[Qt]);let $t=(0,h.useCallback)(async e=>{if(!T||!Z)throw Error(`Could not save auth state "${e.name}" for target "${Z??`selected target`}".`);let t=`Could not save auth state "${e.name}" for target "${Z}".`;kt(!0);try{await Ne(T,{name:e.name,replace:e.replace}),p.success(`Saved auth state "${e.name}" for target "${Z}".`),await Qt()}catch{throw Error(t)}finally{kt(!1)}},[Z,T,Qt]),en=(0,h.useCallback)(e=>{if(e){A(!0);return}qt()},[qt]),tn=async()=>{pt(!0);try{let e=await Ie(x,B||C.trim());e.valid?p.success(`Valid YAML`):p.error(_(e.errors))}catch(e){p.error(`Validation error: ${e instanceof Error?e.message:String(e)}`)}finally{pt(!1)}},nn=(0,h.useCallback)(async e=>{if(!mt){try{if(y){let e=c(C.trim(),z,`testMatch`);if(e){p.error(e);return}if(await Q())return;await Ae(C.trim(),x),Kt();return}if(V){if(await Q())return;await De(v,x),it(x)}}catch(e){let t=Ke(e);p.error(t?_(t):`Failed to save before run: ${e instanceof Error?e.message:String(e)}`);return}ht(!0);try{gt((await je({file:B,local:e})).runId),p.success(`Run started`)}catch(e){p.error(`Failed to start run: ${e instanceof Error?e.message:String(e)}`),ht(!1)}}},[mt,y,C,z,x,V,v,B,Q,Kt]),rn=(0,h.useCallback)(()=>{gt(null),ht(!1)},[]),an=(0,h.useCallback)(e=>{if(!X)return;if(!G){p.error(`Fix YAML errors before running live steps. Live mode uses the current valid draft, not the last valid snapshot.`);return}let t=K.steps[e]?.id;t&&I({type:`step`,stepId:t}),F(`reasoning`),K.executeStepByIndex(e,G)},[G,X,K]),on=(0,h.useCallback)(e=>{K.runningStepIndex===e&&(F(`reasoning`),K.cancelStep())},[K]),sn=(0,h.useCallback)((e,t)=>{if(!X)return;if(e===`setup`){p.error(`Setup hooks only run when a live session starts`);return}let n=K.teardownHooks.find(e=>e.id===t);n&&I({type:`hook`,hookId:n.id}),F(`reasoning`),K.executeHookById(e,t)},[X,K]);if((0,h.useEffect)(()=>()=>{b.current?.abort(),et.current&&tt.current()},[]),(0,h.useEffect)(()=>{T&&Y===`disconnected`&&(Pt||(s(`page`,`live session moved to terminal state`,{liveSessionId:T,liveConnectionState:Y}),E(null),O(null),M(!1),P(`disconnected`),I(null),L({setup:[],teardown:[]}),A(!0)))},[Y,Pt,T]),(0,h.useEffect)(()=>{!Qe||nt.current||y||ot||ct||j||k||X||!H||!H.target.trim()||(nt.current=!0,l(d.testEdit(v),{replace:!0}),Xt())},[H,Xt,X,y,j,ot,k,l,ct,Qe,v]),(0,h.useEffect)(()=>{R&&!zt.includes(R)&&bt(null)},[zt,R]),(0,h.useEffect)(()=>{if(!k){I(null);return}let e=[...K.setupHooks,...K.teardownHooks];if(K.steps.length===0&&e.length===0){I(null);return}I(t=>t?.type===`hook`&&e.some(e=>e.id===t.hookId)||t&&`stepId`in t&&K.steps.some(e=>e.id===t.stepId)?t:e.length>0?{type:`hook`,hookId:e[0].id}:{type:`step`,stepId:K.steps[0].id})},[K.setupHooks,K.steps,K.teardownHooks,k]),Ue((0,h.useMemo)(()=>({r:()=>{y||nn(Ce===`local`)},escape:()=>{w&&rn()}}),[y,w,nn,rn,Ce])),(0,h.useEffect)(()=>{function e(e){(e.metaKey||e.ctrlKey)&&e.key===`s`&&(e.preventDefault(),$())}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[$]),ot)return(0,g.jsx)(Me,{});if(ct)return(0,g.jsx)(He,{icon:ne,title:`Test not found`,description:`This test file doesn't exist`,actionLabel:`View All Tests`,onAction:()=>l(d.tests)});let cn=(0,g.jsx)(oe,{content:x,onChange:S,isCreateMode:y,showLiveStepActions:X,canRunLiveStep:Y===`connected`&&H!==null,canRunLiveHook:Y===`connected`&&H!==null,liveEditorSteps:K.steps,draftStepIds:zt,liveSetupHooks:K.setupHooks,liveTeardownHooks:K.teardownHooks,onRunLiveStep:an,onCancelLiveStep:on,onRunLiveHook:sn,openStepSettingsId:R,onOpenStepSettingsChange:bt,selection:vt,onSelect:I,variableSuggestions:Ze}),ln=(0,g.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[y&&(0,g.jsx)(`div`,{className:`px-4 pt-3`,children:(0,g.jsxs)(`div`,{className:`rounded-md border bg-muted/15 px-3 py-2`,children:[(0,g.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,g.jsxs)(le,{className:`flex items-center gap-1 text-xs font-medium`,children:[`File Path `,(0,g.jsx)(Ge,{text:`Path is relative to your workspace root. Must match your workspace's testMatch pattern. Directories are created automatically on save.`})]}),(0,g.jsx)(`span`,{className:`text-[11px] text-muted-foreground`,children:`Created only when you save`})]}),(0,g.jsx)(Se,{placeholder:`my-test.yaml`,value:C,onChange:e=>at(e.target.value),className:`mt-2 max-w-md ${Mt?`border-red-500 focus-visible:ring-red-500`:``}`}),Mt&&(0,g.jsx)(`p`,{className:`mt-1 text-xs text-red-500`,children:jt})]})}),(0,g.jsxs)(pe,{defaultValue:`builder`,className:`flex-1 flex min-h-0 flex-col`,children:[(0,g.jsxs)(fe,{variant:`line`,className:`px-4`,children:[(0,g.jsx)(ue,{value:`builder`,children:`Builder`}),(0,g.jsx)(ue,{value:`yaml`,children:`YAML`})]}),(0,g.jsx)(de,{value:`builder`,className:`mt-2 flex-1 overflow-auto`,children:cn}),(0,g.jsx)(de,{value:`yaml`,className:`flex-1 min-h-0 mt-2`,children:(0,g.jsx)(t,{value:x,onChange:S,onSave:$,showErrors:!0,className:`h-full`})})]})]}),un=(0,g.jsx)(te,{connectionState:K.connectionState,isLaunching:j,targetName:J||`Selected Target`,targetLabel:Lt,liveSessionNumber:D,platform:It,liveSessionId:T,sessionGone:K.sessionGone,currentUrl:K.currentUrl,pendingNavigation:K.pendingNavigation,steps:K.steps,setupHooks:K.setupHooks,teardownHooks:K.teardownHooks,selection:vt,runningStepId:K.runningStepId,terminalState:Ht,draftState:Rt,ariaTree:K.ariaTree,errorMessage:K.error,devtoolsTab:_t,canRunAll:Ut,isRunningAll:K.isRunningAll,isStoppingRunAll:K.isStoppingRunAll,setupHooksStale:Vt,onDevtoolsTabChange:F,onRunAll:()=>{if(!G){p.error(`Fix YAML errors before running live steps. Live mode uses the current valid draft, not the last valid snapshot.`);return}K.runAll(G)},onStopAll:K.cancelRunAll,onEndSession:Jt,onRestartSession:Vt?()=>void Zt():void 0,showEndSessionAction:u,onCloseLiveMode:qt,onStartFreshSession:()=>void(Pt?Zt():Xt()),onBack:K.goBack,onForward:K.goForward,onRefresh:K.refreshPage,onNavigate:K.navigate,onRequestAriaTree:K.requestAriaTree,authStateCapture:Z&&T?{sessionId:T,targetName:Z,initialName:Bt,authStates:Et,isSaving:Ot,onSave:$t}:null});return(0,g.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,g.jsx)(ce,{testName:y?`New Test`:U?.name??v,testId:U?.testId??``,unsaved:V,isCreateMode:y,mode:y?`view`:`edit`,testHref:y?void 0:d.testView(v),isSaving:ut,isValidating:ft,isRunning:mt,runDisabled:Wt,hasInvalidFilename:Mt,showTestId:!1,hasLiveSession:X,liveConnectionState:Y,isLiveActionDisabled:Gt,liveSessionNumber:D,onBack:()=>l(y?d.tests:d.testView(v)),onSave:$,onValidate:tn,onRun:nn,onLiveConnect:k?void 0:Xt,onLiveEnd:X?Jt:void 0,onSettingsOpen:()=>St(!0),shortcutsOpen:Ct,onToggleShortcuts:()=>wt(e=>!e)}),w?(0,g.jsxs)(Be,{orientation:`horizontal`,className:`flex-1 rounded-md border border-border`,children:[(0,g.jsx)(m,{defaultSize:60,minSize:30,children:(0,g.jsx)(t,{value:x,onChange:S,onSave:$,className:`h-full`})}),(0,g.jsx)(Ve,{withHandle:!0}),(0,g.jsx)(m,{defaultSize:40,minSize:25,children:(0,g.jsx)(r,{runId:w,onClose:rn})})]}):k&&!u?(0,g.jsxs)(Be,{orientation:`horizontal`,className:`flex-1 rounded-md border border-border`,children:[(0,g.jsx)(m,{defaultSize:42,minSize:34,children:ln}),(0,g.jsx)(Ve,{withHandle:!0}),(0,g.jsx)(m,{defaultSize:58,minSize:38,children:un})]}):ln,(0,g.jsx)(ve,{open:xt,onOpenChange:St,children:(0,g.jsxs)(ye,{side:`right`,className:`sm:max-w-[400px] overflow-y-auto p-0`,children:[(0,g.jsxs)(he,{className:`px-4 pt-4 pb-2`,children:[(0,g.jsx)(_e,{children:`Test Settings`}),(0,g.jsx)(be,{children:`Advanced configuration for this test`})]}),(0,g.jsx)(`div`,{className:`px-4 pb-4`,children:(0,g.jsx)(a,{content:x,onChange:S,selectedTarget:U?.target})})]})}),u&&(0,g.jsx)(ve,{open:k,onOpenChange:en,children:(0,g.jsxs)(ye,{side:`bottom`,showCloseButton:!1,className:`h-[100dvh] max-h-[100dvh] rounded-none p-0`,children:[(0,g.jsxs)(he,{className:`sr-only`,children:[(0,g.jsx)(_e,{children:`Live Session`}),(0,g.jsx)(be,{children:`Live execution workspace for the current draft.`})]}),un]})})]})}export{Ze as default};
@@ -1,7 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{f as t,o as n}from"./use-clipboard-copy-Bmyv0FFY.js";import{a as r,i,n as a,r as o,t as s}from"./select-JI5Kadjp.js";import{r as c,t as l}from"./textarea-BP7XqG3v.js";import{t as u}from"./circle-dashed-WDoZ8ADk.js";import{n as d,r as f}from"./monaco-editor-BQB4vEk_.js";import{t as p}from"./circle-slash-Baq9Dw6f.js";import{t as m}from"./globe-B0WEPp3h.js";import{t as h}from"./grip-vertical-B87oMfre.js";import{n as g,r as _,t as v}from"./shortcut-hints-_J-i7rAL.js";import{t as y}from"./split-button-BHdketN3.js";import{t as b}from"./plus-DNc2RueT.js";import{t as x}from"./refresh-cw-BQdOC6UA.js";import{C as S,S as C,_ as w,a as ee,b as T,c as E,d as D,f as O,g as te,h as k,l as A,m as j,n as M,o as N,p as P,r as F,s as ne,t as re,u as I,v as ie,w as ae,x as oe,y as se}from"./id-badge-CIbcJUv0.js";import{t as L}from"./label-CYpyu7PJ.js";import{n as R,r as ce,t as z}from"./popover-DThBIgGA.js";import{t as le}from"./switch-BgfA6DyL.js";import{A as B,At as ue,B as V,Ct as de,D as H,Ft as fe,Ht as U,Lt as pe,Mt as me,Nt as he,O as W,Pt as ge,R as G,Rt as K,Sc as _e,Tt as ve,Ut as ye,Xt as be,at as xe,ct as Se,hc as q,it as Ce,jt as we,lt as Te,nt as Ee,ot as De,rt as Oe,st as ke,tt as Ae,ut as je,z as J,zt as Me}from"./index-CXuVkD6-.js";import{t as Ne}from"./badge-B-yh3kbi.js";import{r as Pe}from"./dist-Cy8QoEce.js";var Y=e(_e(),1),X=be(),Fe=`AlertDialog`,[Ie,Le]=ve(Fe,[je]),Z=je(),Re=e=>{let{__scopeAlertDialog:t,...n}=e,r=Z(t);return(0,X.jsx)(De,{...r,...n,modal:!0})};Re.displayName=Fe;var ze=`AlertDialogTrigger`,Be=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,X.jsx)(Se,{...i,...r,ref:t})});Be.displayName=ze;var Ve=`AlertDialogPortal`,He=e=>{let{__scopeAlertDialog:t,...n}=e,r=Z(t);return(0,X.jsx)(xe,{...r,...n})};He.displayName=Ve;var Ue=`AlertDialogOverlay`,We=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,X.jsx)(Ce,{...i,...r,ref:t})});We.displayName=Ue;var Q=`AlertDialogContent`,[Ge,Ke]=Ie(Q),qe=ue(`AlertDialogContent`),Je=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=Z(n),o=Y.useRef(null),s=we(t,o),c=Y.useRef(null);return(0,X.jsx)(Te,{contentName:Q,titleName:Ye,docsSlug:`alert-dialog`,children:(0,X.jsx)(Ge,{scope:n,cancelRef:c,children:(0,X.jsxs)(Ee,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:de(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,X.jsx)(qe,{children:r}),(0,X.jsx)(rt,{contentRef:o})]})})})});Je.displayName=Q;var Ye=`AlertDialogTitle`,Xe=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,X.jsx)(ke,{...i,...r,ref:t})});Xe.displayName=Ye;var Ze=`AlertDialogDescription`,Qe=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,X.jsx)(Oe,{...i,...r,ref:t})});Qe.displayName=Ze;var $e=`AlertDialogAction`,et=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=Z(n);return(0,X.jsx)(Ae,{...i,...r,ref:t})});et.displayName=$e;var tt=`AlertDialogCancel`,nt=Y.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Ke(tt,n),a=Z(n),o=we(t,i);return(0,X.jsx)(Ae,{...a,...r,ref:o})});nt.displayName=tt;var rt=({contentRef:e})=>{let t=`\`${Q}\` requires a description for the component to be accessible for screen reader users.
2
-
3
- You can add a description to the \`${Q}\` by passing a \`${Ze}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
4
-
5
- Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Q}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
6
-
7
- For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return Y.useEffect(()=>{document.getElementById(e.current?.getAttribute(`aria-describedby`))||console.warn(t)},[t,e]),null},it=Re,at=Be,ot=He,st=We,ct=Je,lt=et,ut=nt,dt=Xe,ft=Qe;function pt({...e}){return(0,X.jsx)(it,{"data-slot":`alert-dialog`,...e})}function mt({...e}){return(0,X.jsx)(at,{"data-slot":`alert-dialog-trigger`,...e})}function ht({...e}){return(0,X.jsx)(ot,{"data-slot":`alert-dialog-portal`,...e})}function gt({className:e,...t}){return(0,X.jsx)(st,{"data-slot":`alert-dialog-overlay`,className:V(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}function _t({className:e,size:t=`default`,...n}){return(0,X.jsxs)(ht,{children:[(0,X.jsx)(gt,{}),(0,X.jsx)(ct,{"data-slot":`alert-dialog-content`,"data-size":t,className:V(`group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-md border bg-background p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[size=default]:sm:max-w-lg`,e),...n})]})}function vt({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`alert-dialog-header`,className:V(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function yt({className:e,...t}){return(0,X.jsx)(`div`,{"data-slot":`alert-dialog-footer`,className:V(`flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function bt({className:e,...t}){return(0,X.jsx)(dt,{"data-slot":`alert-dialog-title`,className:V(`text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function xt({className:e,...t}){return(0,X.jsx)(ft,{"data-slot":`alert-dialog-description`,className:V(`text-sm text-muted-foreground`,e),...t})}function St({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,X.jsx)(J,{variant:t,size:n,asChild:!0,children:(0,X.jsx)(lt,{"data-slot":`alert-dialog-action`,className:V(e),...r})})}function Ct({className:e,variant:t=`outline`,size:n=`default`,...r}){return(0,X.jsx)(J,{variant:t,size:n,asChild:!0,children:(0,X.jsx)(ut,{"data-slot":`alert-dialog-cancel`,className:V(e),...r})})}var wt={running:{label:`Running`,badgeClass:`border-primary/30 bg-primary/10 text-primary`,cardClass:`live-running-surface border-border/60 bg-primary/5`},cancelling:{label:`Cancelling`,badgeClass:`border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400`,cardClass:`border-amber-500/30 bg-amber-500/5`},passed:{label:`Passed`,badgeClass:`border-emerald-500/30 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400`,cardClass:`border-emerald-500/25 bg-emerald-500/[0.03]`},failed:{label:`Failed`,badgeClass:`border-destructive/30 bg-destructive/10 text-destructive`,cardClass:`border-destructive/25 bg-destructive/[0.03]`},cancelled:{label:`Cancelled`,badgeClass:`border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400`,cardClass:`border-amber-500/25 bg-amber-500/[0.03]`}};function Tt(e){let t=[];return e.timeout&&t.push(`TIMEOUT: ${e.timeout.toUpperCase()}`),e.retries!=null&&t.push(`RETRIES: ${e.retries}`),e.screenshot!=null&&t.push(`SCREENSHOT: ${e.screenshot?`ON`:`OFF`}`),t.length>0?t.join(` · `):null}function Et(e){return e instanceof HTMLElement?!!e.closest(`button, textarea, input, select, label, [role="switch"]`):!1}function Dt({result:e}){switch(e){case`success`:return(0,X.jsx)(U,{className:`size-3.5 text-emerald-500`});case`failure`:return(0,X.jsx)(ge,{className:`size-3.5 text-destructive`});case`no-input`:return(0,X.jsx)(p,{className:`size-3.5 text-muted-foreground`,"aria-label":n[`no-input`],children:(0,X.jsx)(`title`,{children:n[`no-input`]})});default:return(0,X.jsx)(u,{className:`size-3.5 text-muted-foreground`})}}function Ot({status:e}){switch(e){case`running`:return(0,X.jsx)(K,{className:`size-3.5 animate-spin text-primary`});case`cancelling`:return(0,X.jsx)(K,{className:`size-3.5 animate-spin text-amber-500`});case`passed`:return(0,X.jsx)(U,{className:`size-3.5 text-emerald-500`});case`failed`:return(0,X.jsx)(ge,{className:`size-3.5 text-destructive`});case`cancelled`:return(0,X.jsx)(u,{className:`size-3.5 text-amber-500`})}}function kt(e){if(!e.plannedAction)return`Sub-action ${e.index+1}`;try{let t=typeof e.plannedAction==`string`?JSON.parse(e.plannedAction):e.plannedAction;if(t&&typeof t==`object`){let e=[t.type||t.action||``,t.target||t.selector||t.ref||``].filter(Boolean).join(` `);if(e)return e}}catch{if(typeof e.plannedAction==`string`)return e.plannedAction}return`Sub-action ${e.index+1}`}function At({id:e,index:t,value:n,overrides:r,onChange:i,onOverrideChange:a,onDelete:o,disabled:s=!1,liveStatus:c=`idle`,showLiveControls:l=!1,canRunLiveStep:u=!1,onRunLiveStep:d,onCancelLiveStep:f,stepError:p,isSettingsOpen:m=!1,onToggleSettings:g,isSelected:_=!1,onSelectStep:v,subActions:y,selectedSubActionIndex:b=null,onSelectSubAction:x,suggestions:w=[],hookLabels:T={}}){let E=c===`running`||c===`cancelling`,{attributes:D,listeners:O,setNodeRef:te,transform:k,transition:A,isDragging:M}=j({id:e,disabled:s||E}),P=(0,Y.useRef)(null),[F,re]=(0,Y.useState)(0),I=ee({text:n,cursorPos:F,suggestions:w,anchorRef:P,onInsert:(0,Y.useCallback)((e,r,a)=>{i(t,n.slice(0,r)+e+n.slice(a)),requestAnimationFrame(()=>{let t=P.current;if(t){let n=r+e.length;t.selectionStart=n,t.selectionEnd=n,t.focus()}})},[n,i,t])}),ie=(0,Y.useMemo)(()=>Object.fromEntries(w.filter(e=>e.namespace===`runHook`&&e.insertValue).map(e=>[e.insertValue,e.name])),[w]),ae=(0,Y.useMemo)(()=>({...T,...ie}),[T,ie]),oe=Tt(r),se=oe!==null,R=c===`idle`?null:wt[c],ce=_||m||E,z=(0,Y.useCallback)(()=>{let e=P.current;e&&(e.style.height=`0`,e.style.height=`${e.scrollHeight}px`)},[]);(0,Y.useEffect)(()=>{z()},[n,z]),(0,Y.useEffect)(()=>{let e=P.current;if(!e)return;let t=new ResizeObserver(()=>z());return t.observe(e.parentElement??e),()=>t.disconnect()},[z]);let B={transform:C.Transform.toString(k),transition:A,opacity:M?.5:1,zIndex:M?10:void 0},ue=(0,Y.useCallback)(t=>{!v||Et(t)||v(e)},[e,v]);return(0,X.jsxs)(`div`,{ref:te,style:B,onClick:e=>ue(e.target),className:V(`group/step relative overflow-hidden rounded-md border bg-card/60 transition-colors`,`hover:bg-card`,M&&`shadow-lg ring-2 ring-primary/20`,R?.cardClass,_&&`ring-2 ring-primary/35 ring-offset-1 ring-offset-background bg-primary/[0.04]`,s&&`pointer-events-none opacity-60`),children:[(0,X.jsxs)(`div`,{className:`flex items-start gap-2 px-3 py-2`,children:[(0,X.jsx)(`button`,{type:`button`,className:`mt-0.5 flex shrink-0 items-center p-0.5 text-muted-foreground/40 hover:text-muted-foreground cursor-grab active:cursor-grabbing touch-none disabled:cursor-not-allowed`,"aria-label":`Reorder step ${t+1}`,disabled:s||E,...D,...O,children:(0,X.jsx)(h,{className:`size-3.5`})}),(0,X.jsxs)(`span`,{className:`mt-[3px] shrink-0 text-[11px] tabular-nums text-muted-foreground/50`,children:[`#`,t+1]}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[c!==`idle`&&R&&(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[11px] text-muted-foreground`,children:[(0,X.jsx)(Ot,{status:c}),(0,X.jsx)(`span`,{className:`font-medium`,children:R.label})]}),(0,X.jsxs)(`div`,{className:`relative`,children:[(0,X.jsx)(`textarea`,{ref:P,value:n,onChange:e=>{i(t,e.target.value),re(e.target.selectionStart??0),z()},onKeyDown:e=>{I.handleKeyDown(e)},onBlur:()=>{setTimeout(()=>I.setVisible(!1),150)},placeholder:`Describe what this step should do...`,disabled:s||E,rows:1,className:`min-w-0 w-full resize-none overflow-hidden border-none bg-transparent p-0 text-sm text-foreground outline-none placeholder:text-muted-foreground/40`,"aria-haspopup":I.visible?`listbox`:void 0,"aria-expanded":I.visible||void 0}),I.dropdown]}),ne(n)&&(0,X.jsx)(N,{text:n,hookLabels:ae}),(se||m)&&(0,X.jsxs)(`div`,{className:`flex min-w-0 items-center gap-1 text-muted-foreground/70`,children:[(0,X.jsx)(fe,{className:`size-3 shrink-0`}),(0,X.jsx)(`span`,{className:`truncate text-[11px] font-mono uppercase tracking-wide`,children:oe??`Step settings open`})]})]}),(0,X.jsx)(`div`,{className:`flex shrink-0 items-start gap-2`,children:(0,X.jsxs)(`div`,{className:V(`mt-0.5 flex shrink-0 items-center gap-1 transition-opacity`,ce?`opacity-100`:`opacity-0 pointer-events-none group-hover/step:pointer-events-auto group-hover/step:opacity-100 group-focus-within/step:pointer-events-auto group-focus-within/step:opacity-100`),children:[l&&(E?(0,X.jsxs)(J,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>f?.(t),disabled:s||!f,children:[c===`cancelling`?(0,X.jsx)(K,{className:`size-3 animate-spin`}):(0,X.jsx)(S,{className:`size-3`}),`Cancel`]}):(0,X.jsxs)(J,{type:`button`,variant:`outline`,size:`xs`,onClick:()=>d?.(t),disabled:s||!u||!d,children:[(0,X.jsx)(pe,{className:`size-3`}),`Run`]})),(0,X.jsx)(J,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:()=>g?.(e),disabled:s,className:V(`shrink-0 text-muted-foreground/70 hover:text-foreground`,m&&`bg-muted/60 text-foreground`),"aria-label":`Open settings for step ${t+1}`,title:`Step settings`,children:(0,X.jsx)(fe,{className:`size-3.5`})}),(0,X.jsxs)(pt,{children:[(0,X.jsx)(mt,{asChild:!0,children:(0,X.jsx)(J,{type:`button`,variant:`ghost`,size:`icon-sm`,disabled:s||E,"aria-label":`Delete step ${t+1}`,title:`Delete step`,className:`text-muted-foreground/70 hover:text-destructive`,children:(0,X.jsx)(me,{className:`size-3.5`})})}),(0,X.jsxs)(_t,{size:`sm`,children:[(0,X.jsxs)(vt,{children:[(0,X.jsx)(bt,{children:`Delete step?`}),(0,X.jsxs)(xt,{children:[`Step #`,t+1,` will be removed. This cannot be undone.`]})]}),(0,X.jsxs)(yt,{children:[(0,X.jsx)(Ct,{children:`Cancel`}),(0,X.jsx)(St,{variant:`destructive`,onClick:()=>o(t),children:`Delete`})]})]})]})]})})]}),m&&(0,X.jsx)(`div`,{className:`border-t px-3 py-3`,children:(0,X.jsxs)(`div`,{className:`grid grid-cols-1 gap-3 md:grid-cols-2`,children:[(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(L,{htmlFor:`step-${t}-timeout`,className:`text-[11px] text-muted-foreground`,children:`Timeout`}),(0,X.jsx)(G,{id:`step-${t}-timeout`,value:r.timeout??``,onChange:e=>a(t,`timeout`,e.target.value||void 0),placeholder:`e.g. 30s`,disabled:s,className:`h-8 text-xs`})]}),(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(L,{htmlFor:`step-${t}-retries`,className:`text-[11px] text-muted-foreground`,children:`Retries`}),(0,X.jsx)(G,{id:`step-${t}-retries`,type:`number`,min:0,value:r.retries??``,onChange:e=>a(t,`retries`,e.target.value?Number(e.target.value):void 0),placeholder:`0`,disabled:s,className:`h-8 text-xs`})]}),(0,X.jsxs)(`div`,{className:`space-y-1`,children:[(0,X.jsx)(L,{className:`text-[11px] text-muted-foreground`,children:`Screenshot`}),(0,X.jsx)(`div`,{className:`flex h-8 items-center`,children:(0,X.jsx)(le,{checked:r.screenshot??!1,onCheckedChange:e=>a(t,`screenshot`,e?!0:void 0),disabled:s})})]})]})}),y&&y.length>0&&(0,X.jsxs)(`div`,{className:`border-t px-3 py-2`,children:[(0,X.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,X.jsx)(`span`,{className:`text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:`Sub-actions`}),(0,X.jsx)(Ne,{variant:`outline`,className:`text-[10px]`,children:y.length})]}),(0,X.jsx)(`div`,{className:`space-y-1`,children:y.map((t,n)=>(0,X.jsxs)(`button`,{type:`button`,onClick:()=>x?.(e,n),className:V(`flex w-full items-center gap-2 rounded-md border px-2.5 py-2 text-left text-xs transition-colors`,b===n?`border-primary/40 bg-primary/10 text-foreground`:`border-border/60 bg-background/70 text-muted-foreground hover:border-border hover:text-foreground`),children:[(0,X.jsx)(Dt,{result:t.result}),(0,X.jsxs)(`span`,{className:`shrink-0 text-[11px] text-muted-foreground`,children:[`#`,n+1]}),(0,X.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:kt(t)})]},`${e}-sub-${n}`))})]}),c===`failed`&&(0,X.jsx)(`div`,{className:`border-t px-3 py-2 text-xs text-destructive`,children:p||`Step failed. Select the step to inspect reasoning, env, network, or console output.`})]})}function jt({text:e}){return(0,X.jsxs)(H,{children:[(0,X.jsx)(B,{asChild:!0,children:(0,X.jsx)(Me,{className:`h-3 w-3 text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors cursor-help`})}),(0,X.jsx)(W,{className:`max-w-[250px] text-[13px]`,children:e})]})}function Mt({name:e,testId:n,target:c,context:u,isCreateMode:d,onChange:f,disabled:p=!1}){let{targets:h,isLoading:g}=A(),{targets:_}=E(),v=c?_[c]:void 0;return(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsxs)(L,{htmlFor:`test-name`,className:`text-xs`,children:[`Test Name `,(0,X.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,X.jsx)(G,{id:`test-name`,value:e,onChange:e=>f(`name`,e.target.value),placeholder:`My Test`,disabled:p,className:`h-8 text-sm`})]}),(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsxs)(L,{htmlFor:`test-id`,className:`text-xs flex items-center gap-1`,children:[`Test ID `,(0,X.jsx)(jt,{text:`Unique identifier used for memory and analytics. Changing this breaks the association with past runs and observations.`})]}),d?(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(G,{id:`test-id`,value:n,readOnly:!0,disabled:!0,className:`h-8 text-sm font-mono flex-1`}),(0,X.jsx)(J,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:()=>f(`test-id`,Pe()),"aria-label":`Generate new ID`,disabled:p,children:(0,X.jsx)(x,{className:`size-3.5`})})]}):(0,X.jsx)(`p`,{className:`text-[13px] font-mono text-muted-foreground`,children:n||`No ID assigned`})]}),(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsxs)(L,{htmlFor:`test-target`,className:`text-xs flex items-center gap-1`,children:[`Target `,(0,X.jsx)(`span`,{className:`text-destructive`,children:`*`}),` `,(0,X.jsx)(jt,{text:`A registered app target from your workspace config. Defines where the test runs (web URL or mobile app).`})]}),!g&&h.length===0?(0,X.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[`No targets configured.`,` `,(0,X.jsx)(q,{to:`/config`,className:`text-primary underline underline-offset-4 hover:text-primary/80`,children:`Add targets in Settings`}),`.`]}):(0,X.jsxs)(s,{value:c||void 0,onValueChange:e=>f(`target`,e),disabled:p||g,children:[(0,X.jsx)(i,{className:`w-full h-8 text-sm`,children:(0,X.jsx)(r,{placeholder:`Select a target`})}),(0,X.jsx)(a,{children:h.map(e=>(0,X.jsx)(o,{value:e,children:e},e))})]}),v&&(0,X.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[13px] text-muted-foreground mt-1.5`,children:[v.platform===`web`?(0,X.jsx)(m,{className:`h-3.5 w-3.5 shrink-0`}):(0,X.jsx)(t,{className:`h-3.5 w-3.5 shrink-0`}),(0,X.jsx)(`span`,{className:`text-muted-foreground/70 uppercase text-[11px] tracking-wider shrink-0`,children:v.platform}),(0,X.jsxs)(`span`,{className:`font-mono truncate`,children:[v.product&&(0,X.jsx)(`span`,{className:`mr-1.5`,children:v.product}),v.platform===`web`&&v.url,v.platform===`android`&&`${v.appPackage}${v.appActivity?` / ${v.appActivity}`:``}`,v.platform===`ios`&&v.bundleId]})]})]}),(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,X.jsxs)(L,{htmlFor:`test-context`,className:`text-xs flex items-center gap-1`,children:[`Context `,(0,X.jsx)(jt,{text:`Additional instructions the AI agent receives before executing steps. Use this for login credentials, test-specific rules, or environment details.`})]}),(0,X.jsx)(l,{id:`test-context`,value:u,onChange:e=>f(`context`,e.target.value),placeholder:`Additional instructions for the AI agent...`,disabled:p,className:`min-h-[60px] resize-none text-sm`,rows:2})]})]})}var Nt=[`name`,`test-id`,`target`,`use`,`meta`,`context`,`setup`,`steps`,`teardown`];function Pt(e){function t(e,n){if(F(e)){n?e.items.sort((e,t)=>{let n=Nt.indexOf(String(e.key)),r=Nt.indexOf(String(t.key));return(n===-1?Nt.length:n)-(r===-1?Nt.length:r)}):e.items.sort((e,t)=>String(e.key).localeCompare(String(t.key)));for(let n of e.items)t(n.value,!1)}}t(e.contents,!0)}function $(e){return Pt(e),e.toString()}function Ft(e,t,n){let r=[...e],[i]=r.splice(t,1);return r.splice(n,0,i),r}function It(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function Lt(e){try{let t=M(e);if(t.errors.length>0)return null;let n=t.toJSON();return!n||typeof n!=`object`?null:{name:n.name??``,testId:n[`test-id`]??``,target:n.target??``,context:n.context??``,setup:It(n.setup),steps:Array.isArray(n.steps)?n.steps.map(e=>{if(typeof e==`string`)return{text:e,overrides:{}};let t=e;return{text:t.step??``,overrides:{timeout:t.timeout,retries:t.retries,screenshot:t.screenshot}}}):[],teardown:It(n.teardown)}}catch{return null}}function Rt(e,t,n){try{let r=M(e);return n===void 0||Array.isArray(n)&&n.length===0?r.deleteIn(t):r.setIn(t,n),$(r)}catch{return e}}function zt(e,t,n){try{let r=M(e),i=r.getIn([`steps`,t]);if(i&&typeof i==`object`&&`toJSON`in i){let e=i.toJSON();if(e&&typeof e==`object`&&`step`in e)return r.setIn([`steps`,t,`step`],n),$(r)}return r.setIn([`steps`,t],n),$(r)}catch{return e}}function Bt(e,t,n,r){try{let i=M(e),a=i.getIn([`steps`,t]),o=a&&typeof a==`object`&&`toJSON`in a?a.toJSON():a;if(typeof o==`string`||!o){let e=typeof o==`string`?o:``;i.setIn([`steps`,t],{step:e,[n]:r})}else if(r===void 0||r===``||r===null){i.deleteIn([`steps`,t,n]);let e=i.getIn([`steps`,t])?.toJSON?.();e&&typeof e==`object`&&Object.keys(e).filter(e=>e!==`step`).length===0&&i.setIn([`steps`,t],e.step??``)}else i.setIn([`steps`,t,n],r);return $(i)}catch{return e}}function Vt(e,t){try{let n=M(e),r=n.getIn([`steps`]);return r&&typeof r.deleteIn==`function`&&r.deleteIn([t]),$(n)}catch{return e}}function Ht(e){try{let t=M(e),n=t.toJSON(),r=Array.isArray(n?.steps)?[...n.steps,``]:[``];return t.setIn([`steps`],r),$(t)}catch{return e}}function Ut(e,t,n,r){try{if(n===r||n<0||r<0)return e;let i=M(e),a=i.getIn([t]),o=a&&typeof a==`object`&&`toJSON`in a&&typeof a.toJSON==`function`?a.toJSON():a;return!Array.isArray(o)||n>=o.length||r>=o.length?e:(i.setIn([t],Ft(o,n,r)),$(i))}catch{return e}}function Wt({status:e}){switch(e){case`running`:return(0,X.jsx)(u,{className:`size-3.5 text-primary`});case`passed`:return(0,X.jsx)(U,{className:`size-3.5 text-emerald-500`});case`failed`:return(0,X.jsx)(ge,{className:`size-3.5 text-destructive`});default:return(0,X.jsx)(he,{className:`size-3.5 text-muted-foreground`})}}function Gt({phase:e,title:t,hooks:n,selection:r,onSelect:i,canRunHook:a=!1,onRunHook:o}){return n.length===0?null:(0,X.jsxs)(`div`,{"data-live-hook-section":e,className:`space-y-1.5`,children:[(0,X.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:t}),(0,X.jsx)(`div`,{className:`space-y-1.5`,children:n.map(e=>(0,X.jsxs)(`div`,{className:V(`relative overflow-hidden flex items-center gap-2 rounded-md border bg-muted/15 px-3 py-2 transition-colors`,e.status===`running`?`live-running-surface border-border/60 bg-primary/5`:r?.type===`hook`&&r.hookId===e.id?`border-primary/20 bg-primary/10 ring-1 ring-primary/30`:`border-border/60 hover:border-border hover:bg-muted/25`),children:[(0,X.jsxs)(`button`,{type:`button`,onClick:()=>i?.({type:`hook`,hookId:e.id}),className:`flex min-w-0 flex-1 items-center gap-2 text-left`,children:[(0,X.jsx)(Wt,{status:e.status}),(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,X.jsx)(`div`,{className:`truncate text-sm font-medium`,children:e.name}),(0,X.jsx)(`div`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:e.id}),(0,X.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:e.status===`pending`?`Waiting for session lifecycle`:e.status===`running`?`Running hook`:e.status===`passed`?`Completed`:e.error??`Hook failed`})]})]}),a&&(0,X.jsxs)(J,{type:`button`,variant:`outline`,size:`xs`,className:`shrink-0`,onClick:t=>{t.stopPropagation(),i?.({type:`hook`,hookId:e.id}),o?.(e.phase,e.id)},disabled:e.status===`running`||!o,children:[(0,X.jsx)(pe,{className:`size-3`}),`Run`]})]},e.id))})]})}function Kt({content:e,onChange:t,isCreateMode:n,disabled:r=!1,showLiveStepActions:i=!1,canRunLiveStep:a=!1,canRunLiveHook:o=!1,liveEditorSteps:s,draftStepIds:l,liveSetupHooks:u,liveTeardownHooks:d,onRunLiveStep:f,onCancelLiveStep:p,onRunLiveHook:m,openStepSettingsId:h,onOpenStepSettingsChange:g,selection:_,onSelect:v,variableSuggestions:y}){let x=(0,Y.useRef)(null),{hooks:S,warningCopy:C}=I(),ee=(0,Y.useMemo)(()=>Object.fromEntries(S.map(e=>[e.id,e.name])),[S]),E=Lt(e),A=E===null,j=E??x.current;E&&(x.current=E);let M=oe(T(ie,{activationConstraint:{distance:8}}),T(w,{coordinateGetter:P})),N=(0,Y.useCallback)((n,r)=>{t(Rt(e,[n],r))},[e,t]),F=(0,Y.useCallback)((n,r)=>{t(zt(e,n,r))},[e,t]),ne=(0,Y.useCallback)((n,r,i)=>{t(Bt(e,n,r,i))},[e,t]),re=(0,Y.useCallback)(n=>{t(Vt(e,n))},[e,t]),ae=(0,Y.useCallback)(()=>{t(Ht(e))},[e,t]),L=(0,Y.useMemo)(()=>j?.steps.map((e,t)=>l?.[t]??s?.[t]?.id??`draft-step-${t}`)??[],[j?.steps,l,s]),R=(0,Y.useCallback)(n=>{if(r||A)return;let{active:i,over:a}=n;if(!a||i.id===a.id)return;let o=L.indexOf(String(i.id)),s=L.indexOf(String(a.id));if(o===-1||s===-1)return;let c=Ut(e,`steps`,o,s);c!==e&&t(c)},[e,r,t,L,A]);return(0,X.jsx)(`div`,{className:`flex flex-col`,children:(0,X.jsxs)(`div`,{className:`space-y-4 p-4`,children:[A&&(0,X.jsxs)(`div`,{className:`flex items-center gap-2 rounded-md border border-destructive/50 bg-destructive/10 p-3 text-sm text-destructive`,children:[(0,X.jsx)(c,{className:`size-4 shrink-0`}),(0,X.jsx)(`span`,{children:`YAML has errors — builder shows last valid state`})]}),j?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Mt,{name:j.name,testId:j.testId,target:j.target,context:j.context,isCreateMode:n??!1,onChange:N,disabled:r||A}),(0,X.jsxs)(`div`,{className:`space-y-3 rounded-md border bg-card/20 p-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,X.jsx)(he,{className:`size-4 text-muted-foreground`}),(0,X.jsx)(`span`,{className:`text-xs font-medium text-muted-foreground`,children:`Hooks`})]}),(0,X.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/50`,children:[j.setup.length+j.teardown.length,` `,j.setup.length+j.teardown.length===1?`hook`:`hooks`]})]}),C&&(0,X.jsxs)(`div`,{className:`flex gap-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300`,children:[(0,X.jsx)(c,{className:`mt-0.5 size-3.5 shrink-0`}),(0,X.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,X.jsx)(`p`,{className:`font-medium`,children:C.title}),(0,X.jsx)(`p`,{children:C.body})]})]}),(0,X.jsxs)(`div`,{className:`space-y-3`,children:[(0,X.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Search hook names or paste an h_ ID. Saved as stable ID in YAML. Inline runHook uses the stable hook ID.`}),(0,X.jsx)(D,{phase:`setup`,label:`Setup`,values:j.setup,suggestions:S,disabled:r||A,placeholder:`Search hook names or paste an h_ ID`,onChange:e=>N(`setup`,e)}),(0,X.jsx)(D,{phase:`teardown`,label:`Teardown`,values:j.teardown,suggestions:S,disabled:r||A,placeholder:`Search hook names or paste an h_ ID`,onChange:e=>N(`teardown`,e)})]})]}),(0,X.jsxs)(`div`,{className:`space-y-1.5`,children:[i&&(0,X.jsx)(Gt,{phase:`setup`,title:`Setup Run Status`,hooks:u??[],selection:_??null,onSelect:v,canRunHook:!1,onRunHook:m}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,X.jsxs)(`span`,{className:`text-xs font-medium text-muted-foreground flex items-center gap-1`,children:[`Steps`,(0,X.jsxs)(H,{children:[(0,X.jsx)(B,{asChild:!0,children:(0,X.jsx)(Me,{className:`h-3 w-3 text-muted-foreground/40 hover:text-muted-foreground/70 transition-colors cursor-help`})}),(0,X.jsx)(W,{className:`max-w-[250px] text-[13px]`,children:`Plain-English instructions the AI agent executes in order. Each step is interpreted and acted upon independently.`})]})]}),(0,X.jsxs)(`span`,{className:`text-[10px] text-muted-foreground/50`,children:[j.steps.length,` `,j.steps.length===1?`step`:`steps`]})]}),(0,X.jsx)(te,{sensors:M,collisionDetection:se,onDragEnd:R,children:(0,X.jsx)(O,{items:L,strategy:k,children:(0,X.jsx)(`div`,{className:`space-y-1.5`,children:j.steps.map((e,t)=>(()=>{let n=s?.[t],o=L[t]??n?.id??`draft-step-${t}`,c=_?.type===`subaction`&&_.stepId===o?_.subIndex:null,l=_?.type===`step`||_?.type===`subaction`?_.stepId===o:!1,u=n?.status??`idle`;return(0,X.jsx)(At,{id:o,index:t,value:e.text,overrides:e.overrides,onChange:F,onOverrideChange:ne,onDelete:re,disabled:r||A,liveStatus:u,showLiveControls:i,canRunLiveStep:a&&!!e.text.trim(),onRunLiveStep:f,onCancelLiveStep:p,stepError:n?.error,isSettingsOpen:h===o,onToggleSettings:e=>g?.(h===e?null:e),isSelected:l,onSelectStep:e=>v?.({type:`step`,stepId:e}),subActions:n?.liveSubActions??null,selectedSubActionIndex:c,onSelectSubAction:(e,t)=>v?.({type:`subaction`,stepId:e,subIndex:t}),suggestions:y,hookLabels:ee},o)})())})})}),(0,X.jsxs)(J,{variant:`outline`,size:`sm`,className:`w-full mt-2 text-xs`,onClick:ae,disabled:r||A,children:[(0,X.jsx)(b,{className:`size-3.5`}),`Add Step`]}),i&&(0,X.jsx)(Gt,{phase:`teardown`,title:`Teardown Run Status`,hooks:d??[],selection:_??null,onSelect:v,canRunHook:o,onRunHook:m})]})]}):(0,X.jsx)(`div`,{className:`flex items-center justify-center py-12 text-sm text-muted-foreground`,children:`Enter valid YAML to use the visual builder`})]})})}function qt({testName:e,testId:t,unsaved:n,isCreateMode:r,mode:i=`view`,testHref:a,isSaving:o,isValidating:s,isRunning:c,runDisabled:l=!1,hasInvalidFilename:u,shortcutsOpen:p,showTestId:m=!0,runButtonTourId:h,hasLiveSession:b=!1,liveConnectionState:x=`disconnected`,isLiveActionDisabled:C=!1,liveSessionNumber:w=null,onSave:ee,onValidate:T,onRun:E,onLiveConnect:D,onLiveEnd:O,onSettingsOpen:te,onToggleShortcuts:k}){let A=i===`view`&&!r,j=!!D||!!O||b||x===`connecting`,M=!r||j,N=!r&&!A&&i===`edit`,P=!A&&b&&typeof w==`number`&&(x===`connected`||x===`executing`),F=`Start a disposable live session for this test. Setup hooks run on connect, teardown hooks run when the session ends, and changes are not saved automatically.`;return(0,X.jsxs)(`div`,{className:`flex h-14 shrink-0 items-center justify-between border-b px-4 min-w-0`,children:[(0,X.jsxs)(`div`,{className:`flex items-center gap-2 min-w-0`,children:[(0,X.jsx)(q,{to:`/tests`,className:`text-sm text-muted-foreground hover:text-foreground transition-colors shrink-0`,children:`Tests`}),(0,X.jsx)(ye,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),r?(0,X.jsx)(`span`,{className:`text-sm font-medium truncate`,children:`New Test`}):a&&!A?(0,X.jsx)(q,{to:a,className:`truncate text-sm font-medium hover:text-primary transition-colors`,children:e}):(0,X.jsx)(`span`,{className:`text-sm font-medium truncate`,children:e}),N&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(ye,{className:`h-3.5 w-3.5 text-muted-foreground shrink-0`}),(0,X.jsx)(`span`,{className:`text-sm font-medium truncate`,children:`Edit`})]}),n&&(0,X.jsx)(Ne,{variant:`outline`,className:`text-xs`,children:`Unsaved`}),!A&&!r&&t&&m&&(0,X.jsx)(re,{label:`T`,value:t})]}),(0,X.jsx)(`div`,{className:`flex items-center gap-3 shrink-0`,children:A?(0,X.jsxs)(X.Fragment,{children:[a?(0,X.jsx)(J,{variant:`outline`,size:`sm`,asChild:!0,children:(0,X.jsxs)(q,{to:a,children:[`Edit`,(0,X.jsx)(v,{shortcut:`E`})]})}):(0,X.jsxs)(J,{variant:`outline`,size:`sm`,disabled:!0,children:[`Edit`,(0,X.jsx)(v,{shortcut:`E`})]}),(0,X.jsx)(y,{onRun:E,disabled:c||l,label:c?`Running...`:`Run`,shortcutKey:`R`,size:`sm`,runButtonTourId:h}),j&&(0,X.jsxs)(H,{children:[(0,X.jsx)(B,{asChild:!0,children:(0,X.jsxs)(J,{size:`sm`,onClick:D,disabled:C||!D,children:[x===`connecting`?(0,X.jsx)(K,{className:`h-3.5 w-3.5 animate-spin`}):(0,X.jsx)(f,{className:`h-3.5 w-3.5`}),x===`connecting`?`Connecting...`:`Connect Live Session`,(0,X.jsx)(v,{shortcut:`L`,className:`border-primary-foreground/20 bg-primary-foreground/10 text-primary-foreground`})]})}),(0,X.jsx)(W,{className:`max-w-sm text-[13px]`,children:F})]}),!r&&(0,X.jsxs)(z,{open:p,onOpenChange:e=>{e||k()},children:[(0,X.jsxs)(H,{children:[(0,X.jsx)(B,{asChild:!0,children:(0,X.jsx)(ce,{asChild:!0,children:(0,X.jsx)(J,{variant:`ghost`,size:`icon-sm`,onClick:k,"aria-label":`Shortcuts`,children:(0,X.jsx)(_,{className:`h-3.5 w-3.5`})})})}),(0,X.jsx)(W,{children:`Shortcuts`})]}),(0,X.jsx)(R,{align:`end`,sideOffset:8,className:`w-72 p-4`,children:(0,X.jsx)(`div`,{className:`space-y-3`,children:(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Actions`}),(0,X.jsx)(g,{hints:[{key:`E`,label:`Edit`},{key:`R`,label:`Run`},{key:`L`,label:`Connect Live Session`}]})]})})})]})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:T,disabled:s||u,children:[(0,X.jsx)(U,{className:`h-3.5 w-3.5`}),s?`Validating...`:`Validate`]}),(0,X.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:ee,disabled:o||u,children:[(0,X.jsx)(d,{className:`h-3.5 w-3.5`}),o?`Saving...`:`Save`]}),(0,X.jsxs)(J,{variant:`ghost`,size:`sm`,onClick:te,children:[(0,X.jsx)(ae,{className:`h-3.5 w-3.5`}),`Settings`]}),M&&(0,X.jsx)(`div`,{className:`h-4 w-px bg-border`}),!r&&(0,X.jsx)(X.Fragment,{children:(0,X.jsx)(y,{onRun:E,disabled:c||l,label:c?`Running...`:`Run`,size:`sm`,runButtonTourId:h})}),j&&(b&&x!==`connecting`?(0,X.jsxs)(J,{variant:`destructive`,size:`sm`,onClick:O,disabled:!O,children:[(0,X.jsx)(S,{className:`h-3.5 w-3.5`}),`End Live Session`]}):(0,X.jsxs)(H,{children:[(0,X.jsx)(B,{asChild:!0,children:(0,X.jsxs)(J,{size:`sm`,onClick:D,disabled:C||!D,children:[x===`connecting`?(0,X.jsx)(K,{className:`h-3.5 w-3.5 animate-spin`}):(0,X.jsx)(f,{className:`h-3.5 w-3.5`}),x===`connecting`?`Connecting...`:`Connect Live Session`]})}),(0,X.jsx)(W,{className:`max-w-sm text-[13px]`,children:F})]})),P&&(0,X.jsxs)(Ne,{variant:`outline`,"aria-live":`polite`,className:`text-[10px] tracking-wider font-medium text-muted-foreground bg-muted/50 border-border/50`,children:[`Session #`,w]}),!r&&(0,X.jsxs)(z,{open:p,onOpenChange:e=>{e||k()},children:[(0,X.jsxs)(H,{children:[(0,X.jsx)(B,{asChild:!0,children:(0,X.jsx)(ce,{asChild:!0,children:(0,X.jsx)(J,{variant:`ghost`,size:`icon-sm`,onClick:k,"aria-label":`Shortcuts`,children:(0,X.jsx)(_,{className:`h-3.5 w-3.5`})})})}),(0,X.jsx)(W,{children:`Shortcuts`})]}),(0,X.jsx)(R,{align:`end`,sideOffset:8,className:`w-72 p-4`,children:(0,X.jsx)(`div`,{className:`space-y-3`,children:(0,X.jsxs)(`div`,{children:[(0,X.jsx)(`h4`,{className:`text-[10px] uppercase tracking-wider text-muted-foreground font-medium mb-2`,children:`Actions`}),(0,X.jsx)(g,{hints:[{key:`R`,label:`Run test`},{key:`Cmd+S`,label:`Save`},{key:`Esc`,label:`Close results panel`}]})]})})})]})]})})]})}export{Lt as i,Kt as n,Rt as r,qt as t};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./monaco-editor-BQB4vEk_.js";import{t as n}from"./file-code-BTJCyvvJ.js";import{n as r}from"./split-button-BHdketN3.js";import{t as i}from"./zap-DKRM77fm.js";import{n as a,t as o}from"./test-navbar-BfzeL-K8.js";import{a as ee,n as s,o as te,t as c}from"./insights-line-grid-EcYgqiLS.js";import{i as l,n as u,r as d,t as f}from"./tabs-CsAJVEvt.js";import{A as p,D as m,H as h,O as g,Qn as ne,Sc as _,Sr as v,T as re,Tr as y,U as b,V as x,W as S,Xt as C,Zn as ie,_c as ae,hc as w,k as oe,pr as se,r as ce,vc as le,y as T,yc as ue,z as E}from"./index-CXuVkD6-.js";import{t as de}from"./use-page-title-fn79XYtf.js";import{t as fe}from"./badge-B-yh3kbi.js";import{a as D,i as O,n as k,o as A,r as j,t as M}from"./table-e38rtLis.js";import{t as pe}from"./empty-state-2mwYYmoQ.js";import{t as me}from"./use-keyboard-shortcuts-befVnBO6.js";import{t as N}from"./run-status-badge-DRzXddrc.js";import{n as P,t as he}from"./viewer-url-state-BnbixmdH.js";var F=e(_(),1),I=C();function L(e){return e===null?`—`:`${Math.round(e*100)}%`}function ge(e){if(!e)return``;let t=new Date(S(e)),n=Date.now()-t.getTime(),r=Math.floor(n/1e3);if(r<60)return`just now`;let i=Math.floor(r/60);if(i<60)return`${i}m ago`;let a=Math.floor(i/60);if(a<24)return`${a}h ago`;let o=Math.floor(a/24);return o<7?`${o}d ago`:x(e)}function R({configured:e,mode:t,scopedCount:n,totalCount:r,onModeChange:i}){return e?(0,I.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,I.jsx)(`div`,{className:`inline-flex rounded border border-border p-0.5`,children:[`scoped`,`all`].map(e=>(0,I.jsx)(E,{type:`button`,size:`xs`,variant:t===e?`default`:`ghost`,"aria-pressed":t===e,className:`h-7 rounded-[2px] px-2 text-xs`,onClick:()=>i(e),children:e===`scoped`?`Scoped`:`All runs`},e))}),(0,I.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[n,` scoped / `,r,` total runs`]})]}):(0,I.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`No analytics scope configured`})}var _e=[`builder`,`yaml`];function z({run:e}){let t=y(e.status,e.memberOutcome);return t===null?(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):(0,I.jsx)(N,{status:t})}function ve({runs:e}){return e.length===0?(0,I.jsx)(`div`,{className:`flex items-center justify-center h-32 text-sm text-muted-foreground`,children:`No runs yet — click Run to start`}):(0,I.jsxs)(M,{children:[(0,I.jsx)(D,{children:(0,I.jsxs)(A,{children:[(0,I.jsx)(O,{children:`Status`}),(0,I.jsx)(O,{children:`Duration`}),(0,I.jsx)(O,{children:`Date`})]})}),(0,I.jsx)(k,{children:e.map(e=>(0,I.jsxs)(A,{className:`relative cursor-pointer hover:bg-muted/50`,children:[(0,I.jsxs)(j,{children:[(0,I.jsx)(w,{to:v.runDetailOrLive(e.id,e.status),className:`absolute inset-0`,tabIndex:-1}),(0,I.jsx)(z,{run:e})]}),(0,I.jsx)(j,{children:e.status===`running`?(0,I.jsx)(`span`,{className:`text-blue-500 text-sm`,children:`In progress...`}):(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:b(e.duration)})}),(0,I.jsx)(j,{children:(0,I.jsxs)(m,{children:[(0,I.jsx)(p,{asChild:!0,children:(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:x(e.createdAt)})}),(0,I.jsx)(g,{children:h(e.createdAt)})]})})]},e.id))})]})}function B(){let{t_id:e}=le(),p=ae(),{defaultRunMode:m}=r(),[h,g]=ue(),_=re(),y=e??``,x=(0,F.useMemo)(()=>he(h,_e),[h]),S=(0,F.useMemo)(()=>P(x,h),[h,x]),C=x.tab,E=x.view,[N,B]=(0,F.useState)(``),[V,ye]=(0,F.useState)(``),[H,be]=(0,F.useState)(``),[xe,U]=(0,F.useState)(!0),[Se,W]=(0,F.useState)(!1),[G,Ce]=(0,F.useState)(null),[K,q]=(0,F.useState)(`all`),[J,Y]=(0,F.useState)(!1),[we,Te]=(0,F.useState)(!1),X=(0,F.useMemo)(()=>{let e=N.match(/^name:\s*(.+)$/m);return e?e[1].trim():null},[N]);de(X||`Test`);let Z=G?.scope?.configured===!0,Q=K===`scoped`&&Z&&G?.scopedTrends?G.scopedTrends:G?.trends,Ee=K===`scoped`&&Z&&G?.scopedFlakyScore!==void 0?G.scopedFlakyScore:G?.flakyScore??0,De=K===`scoped`&&Z?G?.scopedRuns??[]:G?.runs??[],Oe=(0,F.useMemo)(()=>Q?.daily?Q.daily.filter(e=>e.passed+e.failed>0).map(e=>({date:e.date,passRate:Math.round(e.passed/(e.passed+e.failed)*1e3)/10})):[],[Q]),ke=(0,F.useMemo)(()=>G?.trends.daily?G.trends.daily.map(e=>({date:e.date,duration:e.avgDuration})):[],[G]),$=De;(0,F.useEffect)(()=>{G&&q(G.scope?.configured?`scoped`:`all`)},[G]),(0,F.useEffect)(()=>{S.toString()!==h.toString()&&g(S,{replace:!0})},[S,h,g]),(0,F.useEffect)(()=>{if(!y){W(!0),U(!1);return}let e=!1;return ne(y).then(t=>{e||(B(t.content),ye(t.path),be(t.testId))}).catch(()=>{e||(W(!0),T.error(`Failed to load test file`))}).finally(()=>{e||U(!1)}),()=>{e=!0}},[y]),(0,F.useEffect)(()=>{if(!X||!H&&!V)return;let e=!1;return ie(X,{testId:H||void 0,filePath:V||void 0,limit:50}).then(t=>{e||Ce(t)}).catch(()=>{}),()=>{e=!0}},[X,H,V]);let Ae=async e=>{if(!J){Y(!0);try{let t=await se({file:V,local:e});T.success(`Run started`),_?.advanceAfterRunStarted(t.runId,t.status),p(v.runLive(t.runId))}catch(e){T.error(`Failed to start run: ${e instanceof Error?e.message:String(e)}`)}finally{Y(!1)}}},je=v.testEdit(y),Me=v.testEditLive(y);me({e:()=>p(je),r:()=>{Ae(m===`local`)},l:()=>p(Me)});let Ne=e=>{g(P(e,h),{replace:!0})};if(xe)return(0,I.jsx)(ce,{});if(Se)return(0,I.jsx)(pe,{icon:n,title:`Test not found`,description:`This test file doesn't exist`,actionLabel:`View All Tests`,onAction:()=>p(v.tests)});let Pe=(0,I.jsx)(a,{content:N,onChange:()=>{},disabled:!0}),Fe=(0,I.jsx)(t,{value:N,onChange:()=>{},readOnly:!0,className:`h-full`}),Ie=G&&(0,I.jsxs)(`aside`,{"data-testid":`test-detail-analytics-sidebar`,className:`flex flex-col gap-0 overflow-y-auto border-t border-border md:border-t-0 md:border-l md:border-border`,children:[(0,I.jsx)(`div`,{className:`border-b border-border px-3 py-2`,children:(0,I.jsx)(R,{configured:Z,mode:K,scopedCount:G.scope?.scopedCount??0,totalCount:G.scope?.totalCount??G.total,onModeChange:q})}),(0,I.jsxs)(s,{className:`grid-cols-2 divide-x divide-y-0 border-x-0 border-t-0`,children:[(0,I.jsxs)(c,{className:`flex flex-col gap-0.5 px-3 py-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Pass Rate`}),(0,I.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:L((Q??G.trends).passRate)})]}),(0,I.jsxs)(c,{className:`flex flex-col gap-0.5 px-3 py-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Avg Duration`}),(0,I.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:b(G.trends.avgDuration)})]}),(0,I.jsxs)(c,{className:`flex flex-col gap-0.5 border-t border-border px-3 py-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Total Runs`}),(0,I.jsx)(`span`,{className:`text-xl font-semibold text-foreground`,children:G.total.toLocaleString()})]}),(0,I.jsxs)(c,{className:`flex flex-col gap-0.5 border-t border-border px-3 py-2`,children:[(0,I.jsx)(`span`,{className:`text-[10px] font-medium uppercase tracking-wider text-muted-foreground`,children:`Flaky Score`}),(0,I.jsxs)(`span`,{className:`text-xl font-semibold text-foreground`,children:[(Ee*100).toFixed(0),`%`]})]})]}),(0,I.jsx)(s,{className:`border-x-0 border-y-0`,children:(0,I.jsxs)(c,{className:`flex flex-col gap-2 px-3 py-3`,children:[(0,I.jsxs)(`span`,{className:`text-sm font-medium text-foreground`,children:[K===`scoped`&&Z?`Scoped Runs`:`All Runs`,` (`,$.length,`)`]}),$.length===0?(0,I.jsx)(`div`,{className:`flex items-center justify-center h-16 text-sm text-muted-foreground`,children:`No runs yet`}):(0,I.jsxs)(M,{children:[(0,I.jsx)(D,{children:(0,I.jsxs)(A,{children:[(0,I.jsx)(O,{children:`Status`}),(0,I.jsx)(O,{children:`Duration`}),(0,I.jsx)(O,{children:`Date`})]})}),(0,I.jsx)(k,{children:$.slice(0,5).map(e=>(0,I.jsxs)(A,{className:`relative cursor-pointer hover:bg-muted/50`,children:[(0,I.jsxs)(j,{children:[(0,I.jsx)(w,{to:v.runDetailOrLive(e.id,e.status),className:`absolute inset-0`,tabIndex:-1}),(0,I.jsx)(z,{run:e})]}),(0,I.jsx)(j,{children:e.status===`running`?(0,I.jsx)(`span`,{className:`text-blue-500 text-sm`,children:`In progress...`}):(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:b(e.duration)})}),(0,I.jsx)(j,{children:(0,I.jsx)(`span`,{className:`text-muted-foreground`,children:ge(e.createdAt)})})]},e.id))})]})]})})]});return(0,I.jsx)(oe,{children:(0,I.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,I.jsx)(o,{testName:X||`Test`,testId:y,unsaved:!1,isCreateMode:!1,mode:`view`,testHref:je,isSaving:!1,isValidating:!1,isRunning:J,runButtonTourId:`tour-test-run-action`,hasInvalidFilename:!1,showTestId:!1,onBack:()=>p(v.tests),onSave:()=>{},onValidate:()=>{},onRun:e=>Ae(e),onLiveConnect:()=>p(Me),onSettingsOpen:()=>{},shortcutsOpen:we,onToggleShortcuts:()=>Te(e=>!e)}),(0,I.jsxs)(f,{value:C,onValueChange:e=>Ne({tab:e,view:E}),className:`flex-1 min-h-0 flex flex-col`,children:[(0,I.jsx)(`div`,{className:`px-4 border-b border-border`,children:(0,I.jsxs)(d,{variant:`line`,children:[(0,I.jsx)(l,{value:`overview`,children:`Overview`}),(0,I.jsx)(l,{value:`insights`,children:`Insights`})]})}),(0,I.jsxs)(u,{value:`overview`,"data-tour-id":`tour-test-detail-overview`,className:`flex-1 min-h-0 mt-0 grid grid-cols-1 md:grid-cols-[minmax(480px,1fr)_minmax(260px,320px)]`,children:[(0,I.jsx)(`div`,{className:`min-w-0 min-h-0 flex flex-col`,children:(0,I.jsxs)(f,{value:E,onValueChange:e=>Ne({tab:C,view:e}),className:`flex-1 min-h-0 flex flex-col`,children:[(0,I.jsx)(`div`,{className:`px-4 border-b border-border`,children:(0,I.jsxs)(d,{variant:`line`,className:`w-full grid grid-cols-2 md:w-fit md:inline-flex`,children:[(0,I.jsx)(l,{value:`builder`,children:`Builder`}),(0,I.jsx)(l,{value:`yaml`,children:`YAML`})]})}),(0,I.jsxs)(`div`,{className:`relative flex-1 min-h-0`,children:[(0,I.jsx)(u,{value:`builder`,className:`absolute inset-0 overflow-y-auto data-[state=inactive]:hidden`,children:Pe}),(0,I.jsx)(u,{value:`yaml`,className:`absolute inset-0 data-[state=inactive]:hidden`,children:Fe})]})]})}),Ie]}),(0,I.jsx)(u,{value:`insights`,className:`flex-1 overflow-y-auto mt-0`,children:(0,I.jsx)(`div`,{"data-testid":`test-detail-insights`,className:`px-4 py-3`,children:G?(0,I.jsxs)(`div`,{className:`space-y-3`,children:[G.isFlaky&&(0,I.jsxs)(fe,{variant:`destructive`,children:[(0,I.jsx)(i,{className:`size-3`}),`Flaky (score: `,G.flakyScore.toFixed(2),`)`]}),(0,I.jsxs)(s,{className:`grid-cols-2 divide-x divide-y-0 md:grid-cols-4`,children:[(0,I.jsx)(c,{className:`border-b border-border md:border-b-0`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Total Runs`}),(0,I.jsx)(`p`,{className:`text-2xl font-semibold mt-0.5`,children:G.total.toLocaleString()})]})}),(0,I.jsx)(c,{className:`border-b border-border md:border-b-0 md:border-r`,children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Pass Rate`}),(0,I.jsx)(`p`,{className:`text-2xl font-semibold mt-0.5`,children:L((Q??G.trends).passRate)})]})}),(0,I.jsx)(c,{children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Avg Duration`}),(0,I.jsx)(`p`,{className:`text-2xl font-semibold mt-0.5`,children:b(G.trends.avgDuration)})]})}),(0,I.jsx)(c,{children:(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Flaky Score`}),(0,I.jsxs)(`p`,{className:`text-2xl font-semibold mt-0.5`,children:[(Ee*100).toFixed(0),`%`]})]})})]}),(0,I.jsx)(s,{children:(0,I.jsx)(c,{className:`px-4 py-3`,children:(0,I.jsx)(R,{configured:Z,mode:K,scopedCount:G.scope?.scopedCount??0,totalCount:G.scope?.totalCount??G.total,onModeChange:q})})}),(Q?.daily.length??0)>0&&(0,I.jsxs)(s,{className:`md:grid-cols-2 md:divide-x md:divide-y-0`,children:[(0,I.jsxs)(c,{className:`px-4 py-3`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Pass Rate`}),(0,I.jsx)(`div`,{className:`h-[160px] overflow-hidden`,children:(0,I.jsx)(te,{data:Oe})})]}),(0,I.jsxs)(c,{className:`px-4 py-3`,children:[(0,I.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Duration`}),(0,I.jsx)(`div`,{className:`h-[160px] overflow-hidden`,children:(0,I.jsx)(ee,{data:ke})})]})]}),(0,I.jsx)(s,{children:(0,I.jsxs)(c,{className:`px-4 py-3`,children:[(0,I.jsxs)(`p`,{className:`text-sm font-medium mb-2`,children:[K===`scoped`&&Z?`Scoped Runs`:`All Runs`,` (`,$.length,`)`]}),(0,I.jsx)(ve,{runs:$})]})})]}):(0,I.jsx)(s,{children:(0,I.jsx)(c,{className:`flex h-32 items-center justify-center text-sm text-muted-foreground`,children:`No analytics data available`})})})})]})]})})}export{B as default};
@@ -1 +0,0 @@
1
- import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./arrow-up-down-CKc1J6oh.js";import{a as n,i as r,n as i,r as a,t as o}from"./select-JI5Kadjp.js";import{n as s,r as c}from"./shortcut-hints-_J-i7rAL.js";import{n as l}from"./split-button-BHdketN3.js";import{t as u}from"./plus-DNc2RueT.js";import{$n as d,A as f,B as p,D as ee,Mt as m,O as te,Or as h,R as ne,Sc as g,Sr as _,Tr as re,V as v,Vt as ie,Xt as y,_c as ae,a as oe,er as se,fn as ce,hc as le,k as ue,pn as de,pr as fe,sr as pe,y as b,yc as x,z as S}from"./index-CXuVkD6-.js";import{t as me}from"./use-page-title-fn79XYtf.js";import{a as he,i as ge,n as _e,o as C,r as ve,t as ye}from"./table-e38rtLis.js";import{n as be,t as xe}from"./scroll-area-WFIgUp-0.js";import{t as Se}from"./empty-state-2mwYYmoQ.js";import{t as Ce}from"./use-keyboard-shortcuts-befVnBO6.js";import{i as we,n as w,o as Te,r as Ee,s as De,t as Oe}from"./batch-action-bar-MMUxALHz.js";import{n as ke,t as Ae}from"./use-selection-queue-BAssrkmC.js";import{t as T}from"./run-status-badge-DRzXddrc.js";import{n as je,r as E,t as Me}from"./tests-suites-table-widths-nMJHxqRN.js";var D=e(g(),1),O=new Set([`asc`,`desc`]),k=50;function A(e){if(!e)return 1;let t=Number.parseInt(e,10);return Number.isFinite(t)&&t>1?t:1}function j(e){let t=new URLSearchParams;return e.search&&t.set(`search`,e.search),e.status&&t.set(`status`,e.status),e.platform&&t.set(`platform`,e.platform),e.target&&t.set(`target`,e.target),e.sort&&(t.set(`sort`,e.sort),t.set(`order`,e.order)),e.page>1&&t.set(`page`,String(e.page)),t}function Ne(){let[e,t]=x(),n=e.get(`search`)??``,r=e.get(`status`)??``,i=e.get(`platform`)??``,a=e.get(`target`)??``,o=e.get(`sort`)??``,s=e.get(`order`)??`desc`,c=O.has(s)?s:`desc`,l=A(e.get(`page`)),u=(0,D.useMemo)(()=>o?[{id:o,desc:c===`desc`}]:[],[o,c]),d=(0,D.useRef)(u);d.current=u;let f=(0,D.useMemo)(()=>({search:n,status:r,platform:i,target:a,sort:o,order:c,page:l}),[n,r,i,a,o,c,l]);(0,D.useEffect)(()=>{let n=j(f);e.toString()!==n.toString()&&t(n,{replace:!0})},[e,t,f]);let p=(0,D.useCallback)((e,n)=>{let r={...f,...e};n?.resetPage&&(r.page=1),t(j(r),{replace:!0})},[t,f]),ee=(0,D.useCallback)(e=>{let t=typeof e==`function`?e(d.current):e;t.length>0?p({sort:t[0].id,order:t[0].desc?`desc`:`asc`}):p({sort:``,order:`desc`})},[p]),m=(0,D.useMemo)(()=>({pageIndex:l-1,pageSize:k}),[l]);return{search:n,status:r,platform:i,target:a,sort:o,order:c,page:l,sorting:u,pagination:m,onSortingChange:ee,onPaginationChange:(0,D.useCallback)(e=>{p({page:(typeof e==`function`?e(m):e).pageIndex+1})},[m,p]),setSearch:(0,D.useCallback)(e=>p({search:e},{resetPage:!0}),[p]),setStatus:(0,D.useCallback)(e=>p({status:e},{resetPage:!0}),[p]),setPlatform:(0,D.useCallback)(e=>p({platform:e},{resetPage:!0}),[p]),setTarget:(0,D.useCallback)(e=>p({target:e},{resetPage:!0}),[p]),setPage:(0,D.useCallback)(e=>p({page:e}),[p])}}var M=y();function N(e){return e?e===`ios`?`iOS`:e.charAt(0).toUpperCase()+e.slice(1):`—`}function P(e){return e.replace(/\\/g,`/`)}function F(e){let t=P(e).split(`/`).filter(Boolean);return t.length>1?t.slice(1).join(`/`):t[0]??e}function I(e){return e?.createdAt||e?.startedAt||``}function Pe(e){return p(`h-10 bg-background text-[13px] font-medium text-foreground/90`,e===`select`?`px-2 text-center`:`px-3`,(e===`passRate`||e===`lastRun`)&&`text-right`)}function Fe(e){return p(`py-2 align-top`,e===`select`&&`px-2`,e===`name`&&`max-w-0 px-3`,(e===`target`||e===`targetName`)&&`max-w-0 px-3`,e===`platform`&&`px-3`,e===`passRate`&&`px-3 text-right`,e===`lastRun`&&`max-w-0 px-3 text-right`)}function Ie({isActive:e,isBatchSelected:t}){return p(`cursor-pointer outline-none hover:bg-muted/20 focus-visible:bg-primary/10 focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-primary/60`,t&&!e&&`bg-muted/20`,e&&`bg-primary/10 ring-1 ring-inset ring-primary/60`)}var Le=[{accessorKey:`name`,header:({column:e})=>(0,M.jsxs)(S,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Test Name`,(0,M.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>(0,M.jsxs)(`div`,{className:`min-w-0 space-y-0.5`,children:[(0,M.jsx)(`span`,{className:`block whitespace-normal break-words text-sm font-medium leading-snug text-foreground`,children:e.getValue(`name`)}),(0,M.jsx)(`span`,{className:`block whitespace-normal break-all text-xs leading-snug text-muted-foreground`,children:F(e.original.path)})]}),filterFn:(e,t,n)=>{let r=e.getValue(`name`).toLowerCase(),i=e.original.path.toLowerCase(),a=n.toLowerCase();return r.includes(a)||i.includes(a)}},{accessorKey:`targetName`,header:({column:e})=>(0,M.jsxs)(S,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Target`,(0,M.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>(0,M.jsx)(`span`,{className:`block whitespace-normal break-words text-sm leading-snug text-muted-foreground`,children:e.original.targetName??`No target`})},{accessorKey:`platform`,header:({column:e})=>(0,M.jsxs)(S,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Platform`,(0,M.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>(0,M.jsx)(`span`,{className:`text-sm text-muted-foreground`,children:N(e.getValue(`platform`))})},{accessorKey:`passRate`,header:({column:e})=>(0,M.jsxs)(S,{variant:`ghost`,className:`-ml-4`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Pass rate`,(0,M.jsx)(t,{className:`ml-2 h-4 w-4`})]}),cell:({row:e})=>e.original.historyKnown?e.original.passRate===null?(0,M.jsxs)(`div`,{className:`space-y-0.5 text-right`,children:[(0,M.jsx)(`div`,{className:`text-sm font-medium text-foreground`,children:`—`}),(0,M.jsx)(`div`,{className:`text-xs tabular-nums text-muted-foreground`,children:`0 completed`})]}):(0,M.jsxs)(`div`,{className:`space-y-0.5 text-right`,children:[(0,M.jsxs)(`div`,{className:`text-sm font-medium tabular-nums text-foreground`,children:[e.original.passRate,`%`]}),(0,M.jsxs)(`div`,{className:`text-xs tabular-nums text-muted-foreground`,children:[e.original.passCount,`/`,e.original.completedRunCount]})]}):null},{id:`lastRun`,accessorFn:e=>I(e.lastRun),header:({column:e})=>(0,M.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,M.jsxs)(S,{variant:`ghost`,className:`h-auto justify-end px-0 text-[13px] font-medium text-foreground/90 hover:bg-transparent`,onClick:()=>e.toggleSorting(e.getIsSorted()===`asc`),children:[`Last run`,(0,M.jsx)(t,{className:`ml-2 h-4 w-4`})]})}),cell:({row:e})=>e.original.historyKnown?e.original.lastRun?(0,M.jsxs)(le,{to:_.runDetail(e.original.lastRun.id),className:`relative z-10 flex w-full flex-col items-end gap-1 rounded-sm text-right focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/60`,onClick:e=>e.stopPropagation(),children:[e.original.lastRunStatus===null?(0,M.jsx)(`span`,{className:`text-muted-foreground`,children:`—`}):(0,M.jsx)(T,{status:e.original.lastRunStatus}),(0,M.jsx)(`span`,{className:`whitespace-normal break-words text-xs leading-snug text-muted-foreground`,children:v(I(e.original.lastRun))})]}):(0,M.jsx)(`span`,{className:`block text-sm text-muted-foreground`,children:`No runs`}):null,sortingFn:(e,t)=>I(e.original.lastRun).localeCompare(I(t.original.lastRun))}];function Re(){me(`Tests`);let[e,t]=(0,D.useState)([]),[g,v]=(0,D.useState)(null),[y,le]=(0,D.useState)([]),[x,T]=(0,D.useState)(!0),[O,k]=(0,D.useState)(!1),[A,j]=(0,D.useState)(!1),[N,F]=(0,D.useState)(!0),I=ae(),{hasFarm:Re,isLoading:ze}=l();(0,D.useEffect)(()=>{let e=!1,n=se().then(e=>Array.isArray(e?.tests)?e.tests:null).catch(()=>null);return Promise.all([d(),n]).then(([n,r])=>{e||(t(n.files),le(n.targets??[]),v(r===null?null:new Map(r.map(e=>[P(e.path),e]))),r===null&&b.error(`Failed to load run history`))}).catch(()=>{e||b.error(`Failed to load test files`)}).finally(()=>{e||T(!1)}),()=>{e=!0}},[]);let{search:L,status:R,platform:z,target:B,page:Be,sorting:Ve,pagination:V,onSortingChange:He,onPaginationChange:Ue,setSearch:We,setStatus:Ge,setPlatform:Ke,setTarget:qe,setPage:Je}=Ne(),[H,U]=(0,D.useState)(-1),Ye=(0,D.useRef)([]),W=(0,D.useMemo)(()=>e.map(e=>{let t=g?.get(P(e.path)),n=t?.lastRun??null;return{path:e.path,name:e.name,testId:e.testId,targetName:e.targetName,platform:e.platform,historyKnown:t!==void 0,lastRunStatus:n?re(n.status,n.memberOutcome):null,lastRun:n,passRate:t&&t.passRate!==null?Math.round(t.passRate*100):null,passCount:t?.passed??0,completedRunCount:t?.decided??0}}),[e,g]),G=(0,D.useMemo)(()=>{let e=W;if(L){let t=L.toLowerCase();e=e.filter(e=>{let n=e.targetName?.toLowerCase()??``;return e.name.toLowerCase().includes(t)||e.path.toLowerCase().includes(t)||n.includes(t)})}if(R===`no-runs`)e=e.filter(e=>e.historyKnown&&e.lastRun===null);else if(R){let t=h(R);e=e.filter(e=>e.historyKnown&&t!==void 0&&h(e.lastRunStatus??``)===t)}return z&&(e=e.filter(e=>e.platform===z)),B&&(e=e.filter(e=>e.targetName===B)),e},[W,L,R,z,B]),K=Ae({items:W,getId:e=>e.path,visibleIds:G.map(e=>e.path)}),Xe=(0,D.useMemo)(()=>Array.from(new Set([B,...y,...W.map(e=>e.targetName??``)].filter(e=>!!e))),[W,B,y]),Ze={id:`select`,header:({table:e})=>(0,M.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,M.jsx)(E,{checked:K.getVisibleSelectionState(e.getRowModel().rows.map(e=>e.original.path)),onCheckedChange:t=>K.setItemsSelected(e.getRowModel().rows.map(e=>e.original),t),ariaLabel:`Select all`})}),cell:({row:e})=>(0,M.jsx)(E,{checked:K.isSelected(e.original.path),onCheckedChange:t=>K.setItemSelected(e.original,t)}),enableSorting:!1,size:48},q=K.selectedIds,J=K.selectedItems,Qe=(0,D.useCallback)(()=>{K.clearSelection(),j(!1),F(!0)},[K]),Y=(0,D.useCallback)(async e=>{if(q.length!==0){k(!0);try{let t=await Promise.allSettled(q.map(t=>fe({file:t,local:e,noCache:!N}))),n=t.filter(e=>e.status===`fulfilled`).length,r=t.length-n;if(r>0){let e=de(t);b.error(`${n} runs queued, ${r} failed${e===void 0?``:`. ${e}`}`)}else b.success(`${n} runs queued`);j(!1)}finally{k(!1)}}},[q,N]),$e=(0,D.useCallback)(async()=>{if(q.length!==0){k(!0);try{let e=await Promise.allSettled(q.map(e=>pe({file:e}))),t=e.filter(e=>e.status===`fulfilled`).length,n=e.filter(e=>e.status===`fulfilled`).reduce((e,t)=>e+t.value.purged,0),r=e.length-t;r>0?b.error(`Purged ${n} plans from ${t} tests, ${r} failed`):b.success(`Purged ${n} cached plan${n===1?``:`s`}`)}finally{k(!1)}}},[q]),et=(0,D.useCallback)(async()=>{if(J.length!==0){k(!0);try{let e=await Promise.allSettled(J.map(e=>e.testId?ce(e.testId):Promise.reject(Error(`Missing test id for ${e.path}`)))),n=J.filter((t,n)=>e[n]?.status===`fulfilled`),r=new Set(n.map(e=>e.path)),i=e.length-n.length;n.length>0&&(K.setItemsSelected(n,!1),t(e=>e.filter(e=>!r.has(e.path))),j(!1)),i>0?b.error(`Deleted ${n.length} test${n.length===1?``:`s`}, ${i} failed`):b.success(`Deleted ${n.length} test${n.length===1?``:`s`}`)}finally{k(!1)}}},[J,K]),X=Ee({data:G,columns:[Ze,...Le],getCoreRowModel:we(),getSortedRowModel:De(),getPaginationRowModel:Te(),onSortingChange:He,onPaginationChange:Ue,getRowId:e=>e.path,state:{sorting:Ve,pagination:V}}),Z=X.getRowModel().rows,Q=K.hiddenCount,tt=L;(0,D.useEffect)(()=>{if(x)return;let e=Math.max(1,Math.ceil(G.length/V.pageSize));Be>e&&Je(e)},[G.length,x,Be,V.pageSize,Je]);let nt=(0,D.useCallback)(e=>{We(e),U(-1)},[We]);Ce((0,D.useMemo)(()=>{let e=()=>U(e=>Math.min(e+1,Z.length-1)),t=()=>U(e=>Math.max(e-1,0));return{j:e,arrowdown:e,k:t,arrowup:t,enter:e=>{if(H>=0&&Z[H]){let t=Z[H].original,n=_.testView(t.testId??t.path);e.metaKey||e.ctrlKey?window.open(n,`_blank`):I(n)}}}},[Z,H,I])),(0,D.useEffect)(()=>{if(H<0)return;let e=Ye.current[H];e&&document.activeElement!==e&&e.focus()},[H,Z.length]);let rt=(0,D.useCallback)((e,t)=>{t&&t.preventDefault(),I(_.testView(e.testId??e.path))},[I]);if(x)return(0,M.jsx)(oe,{});if(e.length===0)return(0,M.jsx)(`div`,{"data-tour-id":`tour-tests-table`,children:(0,M.jsx)(Se,{icon:ie,title:`No tests found`,description:`Create your first test file to get started`,actionLabel:`Create Test`,onAction:()=>I(_.testNew)})});let $=G.length,it=V.pageIndex,at=V.pageSize,ot=it*at+1,st=Math.min(ot+at-1,$);return(0,M.jsx)(ue,{children:(0,M.jsxs)(`div`,{className:`space-y-4`,children:[(0,M.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,M.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Tests`}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsxs)(ee,{children:[(0,M.jsx)(f,{asChild:!0,children:(0,M.jsx)(S,{variant:`ghost`,size:`icon-sm`,"aria-label":`Keyboard shortcuts`,children:(0,M.jsx)(c,{className:`h-4 w-4`})})}),(0,M.jsx)(te,{side:`bottom`,className:`p-3`,children:(0,M.jsx)(s,{hints:[{key:`J / ↓`,label:`Next row`},{key:`K / ↑`,label:`Previous row`},{key:`Enter`,label:`Open test`},{key:`⌘+Enter`,label:`Open in new tab`}]})})]}),(0,M.jsxs)(S,{size:`sm`,"data-tour-id":`tour-tests-new`,onClick:()=>I(_.testNew),children:[(0,M.jsx)(u,{className:`size-4`}),`New Test`]})]})]}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,M.jsx)(ne,{placeholder:`Search tests...`,value:tt,onChange:e=>nt(e.target.value),className:`max-w-[220px]`}),(0,M.jsxs)(o,{value:R||`all`,onValueChange:e=>{Ge(e===`all`?``:e),U(-1)},children:[(0,M.jsx)(r,{className:`w-[150px]`,children:(0,M.jsx)(n,{placeholder:`All statuses`})}),(0,M.jsxs)(i,{children:[(0,M.jsx)(a,{value:`all`,children:`All statuses`}),(0,M.jsx)(a,{value:`passed`,children:`Passed`}),(0,M.jsx)(a,{value:`failed`,children:`Failed`}),(0,M.jsx)(a,{value:`running`,children:`Running`}),(0,M.jsx)(a,{value:`no-runs`,children:`No runs`})]})]}),(0,M.jsxs)(o,{value:z||`all`,onValueChange:e=>{Ke(e===`all`?``:e),U(-1)},children:[(0,M.jsx)(r,{className:`w-[140px]`,children:(0,M.jsx)(n,{placeholder:`All platforms`})}),(0,M.jsxs)(i,{children:[(0,M.jsx)(a,{value:`all`,children:`All platforms`}),(0,M.jsx)(a,{value:`web`,children:`Web`}),(0,M.jsx)(a,{value:`android`,children:`Android`}),(0,M.jsx)(a,{value:`ios`,children:`iOS`})]})]}),(0,M.jsxs)(o,{value:B||`all`,onValueChange:e=>{qe(e===`all`?``:e),U(-1)},children:[(0,M.jsx)(r,{className:`w-[180px]`,children:(0,M.jsx)(n,{placeholder:`All targets`})}),(0,M.jsxs)(i,{children:[(0,M.jsx)(a,{value:`all`,children:`All targets`}),Xe.map(e=>(0,M.jsx)(a,{value:e,children:e},e))]})]})]}),(0,M.jsxs)(xe,{"data-tour-id":`tour-tests-table`,className:`rounded-md border`,children:[(0,M.jsxs)(ye,{className:`min-w-full table-fixed`,children:[(0,M.jsx)(`colgroup`,{children:Me.map(e=>{let t=je(e);return(0,M.jsx)(`col`,{"data-column-id":e,style:t?{width:t}:void 0},e)})}),(0,M.jsx)(he,{children:X.getHeaderGroups().map(e=>(0,M.jsx)(C,{className:`hover:bg-transparent`,children:e.headers.map(e=>(0,M.jsx)(ge,{className:Pe(e.column.id),children:e.isPlaceholder?null:w(e.column.columnDef.header,e.getContext())},e.id))},e.id))}),(0,M.jsx)(_e,{children:Z.length?Z.map((e,t)=>{let n=t===H,r=K.isSelected(e.original.path);return(0,M.jsx)(C,{ref:e=>{Ye.current[t]=e},"data-runs-row-surface":e.id,tabIndex:n?0:-1,"aria-selected":n,className:Ie({isActive:n,isBatchSelected:r}),onClick:()=>rt(e.original),onFocus:()=>U(t),onKeyDown:t=>{t.key===`Enter`&&rt(e.original,t)},children:e.getVisibleCells().map(e=>{let t=e.column.id===`select`;return(0,M.jsx)(ve,{className:p(Fe(e.column.id),t&&`relative z-10`),children:w(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)}):(0,M.jsx)(C,{children:(0,M.jsx)(ve,{colSpan:Le.length+1,className:`h-24 text-center`,children:`No tests match the current search or filters.`})})})]}),(0,M.jsx)(be,{orientation:`horizontal`})]}),(0,M.jsxs)(`div`,{className:`flex items-center justify-between px-2`,children:[(0,M.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:$>0?`Showing ${ot}-${st} of ${$}${tt||R||z||B?` (${W.length} total)`:``}`:`No tests found`}),(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(S,{variant:`outline`,size:`sm`,onClick:()=>X.previousPage(),disabled:!X.getCanPreviousPage(),children:`Previous`}),(0,M.jsx)(S,{variant:`outline`,size:`sm`,onClick:()=>X.nextPage(),disabled:!X.getCanNextPage(),children:`Next`})]})]}),(0,M.jsx)(Oe,{selectedCount:K.selectedCount,summaryMeta:Q>0?`${Q} hidden by filters`:void 0,secondaryIcon:(0,M.jsx)(m,{className:`size-4`}),secondaryAriaLabel:`Clear queue`,onDelete:et,actionSlot:(0,M.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,M.jsx)(ke,{selectedCount:K.selectedCount,hiddenCount:Q,useCache:N,browserStackAvailable:!ze&&Re,open:A,onOpenChange:j,onUseCacheChange:F,onRunLocal:()=>Y(!0),onRunBrowserStack:()=>Y(!1),disabled:O}),(0,M.jsx)(S,{variant:`outline`,size:`sm`,onClick:$e,disabled:O,children:`Purge cache`})]}),onCancel:Qe,isRunning:O})]})})}export{Re as default};