@vostride/agent-qa-dashboard-ui 0.1.21 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{arrow-up-down-B4k_G_pz.js → arrow-up-down-CKc1J6oh.js} +1 -1
- package/dist/assets/{badge-DHCU59H0.js → badge-B-yh3kbi.js} +1 -1
- package/dist/assets/batch-action-bar-MMUxALHz.js +4 -0
- package/dist/assets/check-DH5_3cK-.js +1 -0
- package/dist/assets/checkbox-B5x0V2a2.js +1 -0
- package/dist/assets/circle-DjggEctd.js +1 -0
- package/dist/assets/circle-dashed-WDoZ8ADk.js +1 -0
- package/dist/assets/circle-slash-Baq9Dw6f.js +1 -0
- package/dist/assets/{circle-x-ITZ_DbXH.js → circle-x-1lf_9y_c.js} +1 -1
- package/dist/assets/config-CnN4bOco.js +3 -0
- package/dist/assets/{cssMode-Ci86QdEV.js → cssMode-CIWhUqfG.js} +1 -1
- package/dist/assets/display-step-opeACkeD.js +1 -0
- package/dist/assets/dist-Cy8QoEce.js +1 -0
- package/dist/assets/{empty-state-3cB27tBp.js → empty-state-2mwYYmoQ.js} +1 -1
- package/dist/assets/{file-code-DDa3GwxK.js → file-code-BTJCyvvJ.js} +1 -1
- package/dist/assets/filename-validation-I94bcMf7.js +1 -0
- package/dist/assets/{freemarker2-BAginoYi.js → freemarker2-BiVXttLB.js} +1 -1
- package/dist/assets/globe-B0WEPp3h.js +1 -0
- package/dist/assets/{grip-vertical-MY-i_r9J.js → grip-vertical-B87oMfre.js} +1 -1
- package/dist/assets/{handlebars-C6jsxsLs.js → handlebars-C_rmhix8.js} +1 -1
- package/dist/assets/hook-editor-DetIWjh8.js +1 -0
- package/dist/assets/{hook-runtime-DCkWsFrF.js → hook-runtime-8xwsNog-.js} +1 -1
- package/dist/assets/hook-viewer-C_nzb-qD.js +1 -0
- package/dist/assets/hooks-BIXR5djX.js +1 -0
- package/dist/assets/{html-Cyb0M0oP.js → html-v4GGDD2l.js} +1 -1
- package/dist/assets/{htmlMode-DshMgI5s.js → htmlMode-DsnRJeF2.js} +1 -1
- package/dist/assets/id-badge-CIbcJUv0.js +111 -0
- package/dist/assets/index-0GfHLQ0v.css +2 -0
- package/dist/assets/index-CXuVkD6-.js +116 -0
- package/dist/assets/insights-CfqFVe4T.js +1 -0
- package/dist/assets/{insights-line-grid-eCcWaGgD.js → insights-line-grid-EcYgqiLS.js} +6 -6
- package/dist/assets/{javascript-BsU_m_4o.js → javascript-B12FD1Gz.js} +1 -1
- package/dist/assets/{jsonMode-DUKNqYzB.js → jsonMode-C_mhVvGR.js} +1 -1
- package/dist/assets/knowledge-view-BHNh7MwX.js +1 -0
- package/dist/assets/label-CYpyu7PJ.js +1 -0
- package/dist/assets/{liquid-BYz2oQ7r.js → liquid-l2oB7oKx.js} +1 -1
- package/dist/assets/live-run-DOfPiVKU.js +1 -0
- package/dist/assets/live-step-row-BtLYYCKS.js +1 -0
- package/dist/assets/{lspLanguageFeatures-CPMJ3OMK.js → lspLanguageFeatures-By4f0cSm.js} +1 -1
- package/dist/assets/{mdx-Bfn3OASJ.js → mdx-Cyix08OW.js} +1 -1
- package/dist/assets/monaco-editor-BQB4vEk_.js +2 -0
- package/dist/assets/{monaco-editor-inner-B2iWC3vK.js → monaco-editor-inner-DBI8AgAJ.js} +4 -4
- package/dist/assets/{monaco.contribution-B-XUbmv5.js → monaco.contribution-C7Dknl5j.js} +2 -2
- package/dist/assets/numeric-input-DcozBggQ.js +1 -0
- package/dist/assets/plus-DNc2RueT.js +1 -0
- package/dist/assets/popover-DThBIgGA.js +1 -0
- package/dist/assets/{python-D7QiYvsM.js → python-cdSYU9zt.js} +1 -1
- package/dist/assets/radio-group-DDMpRS3x.js +1 -0
- package/dist/assets/{razor-ByxQWcvk.js → razor-BWMXhgx8.js} +1 -1
- package/dist/assets/{refresh-cw-BtT1wl9S.js → refresh-cw-BQdOC6UA.js} +1 -1
- package/dist/assets/resizable-om0nWp3k.js +1 -0
- package/dist/assets/run-detail-C9oixuvH.js +1 -0
- package/dist/assets/run-status-badge-DRzXddrc.js +1 -0
- package/dist/assets/run-stream-reducer-BXMulZq1.js +1 -0
- package/dist/assets/runs-BDKh94Pq.js +1 -0
- package/dist/assets/{scroll-area-CPuygHdB.js → scroll-area-WFIgUp-0.js} +1 -1
- package/dist/assets/select-JI5Kadjp.js +1 -0
- package/dist/assets/{shortcut-hints-CUbl8p3Z.js → shortcut-hints-_J-i7rAL.js} +1 -1
- package/dist/assets/split-button-BHdketN3.js +1 -0
- package/dist/assets/suite-editor-Ce16nUF9.js +5 -0
- package/dist/assets/suite-navbar-D8RcUReD.js +1 -0
- package/dist/assets/suite-viewer-Bc78bHVL.js +1 -0
- package/dist/assets/suites-D2VXpj7W.js +1 -0
- package/dist/assets/switch-BgfA6DyL.js +1 -0
- package/dist/assets/tab-console-CpnOoTyg.js +1 -0
- package/dist/assets/table-e38rtLis.js +1 -0
- package/dist/assets/tabs-CsAJVEvt.js +1 -0
- package/dist/assets/test-editor-vZsQDd2R.js +9 -0
- package/dist/assets/test-navbar-BfzeL-K8.js +7 -0
- package/dist/assets/test-viewer-Cek_cnB3.js +1 -0
- package/dist/assets/tests-CzPu8CPe.js +1 -0
- package/dist/assets/tests-suites-table-widths-nMJHxqRN.js +1 -0
- package/dist/assets/textarea-BP7XqG3v.js +1 -0
- package/dist/assets/{trash-2-B2a3jDA4.js → trash-2-87f7wzeR.js} +1 -1
- package/dist/assets/{tsMode-CPlGHPm6.js → tsMode-CqMhxF8i.js} +1 -1
- package/dist/assets/{typescript-BAelS_Yl.js → typescript-DOy-nOZu.js} +1 -1
- package/dist/assets/use-clipboard-copy-Bmyv0FFY.js +1 -0
- package/dist/assets/use-hook-run-session-DnSkzl1A.js +1 -0
- package/dist/assets/use-keyboard-shortcuts-befVnBO6.js +1 -0
- package/dist/assets/{use-page-title-C_f72ri7.js → use-page-title-fn79XYtf.js} +1 -1
- package/dist/assets/use-run-status-favicon-vVlATUoT.js +1 -0
- package/dist/assets/use-selection-queue-BAssrkmC.js +1 -0
- package/dist/assets/viewer-url-state-BnbixmdH.js +1 -0
- package/dist/assets/{workers-Br5uqX4Z.js → workers-By3SZV-o.js} +1 -1
- package/dist/assets/wrench-y-wKZ-0A.js +1 -0
- package/dist/assets/{xml-DB-ZrZ2e.js → xml-BEMkcljk.js} +1 -1
- package/dist/assets/{yaml-BeKBVxAt.js → yaml-CfPYAxWJ.js} +1 -1
- package/dist/assets/{zap-CHRkZMyJ.js → zap-DKRM77fm.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +9 -9
- package/dist/assets/batch-action-bar-Dd_8W0p9.js +0 -1
- package/dist/assets/circle-alert-TPWM0719.js +0 -1
- package/dist/assets/config-DMv2WZOF.js +0 -10
- package/dist/assets/copy-D-NZb7QZ.js +0 -1
- package/dist/assets/display-step-CYKXUkbs.js +0 -1
- package/dist/assets/dist-_gv57K8d.js +0 -1
- package/dist/assets/external-link-DvyIDphy.js +0 -1
- package/dist/assets/eye-DkGk2gsF.js +0 -1
- package/dist/assets/file-search-NMd1pdjr.js +0 -1
- package/dist/assets/filename-validation-CaFIUcWo.js +0 -1
- package/dist/assets/hook-editor-Cjix8FD5.js +0 -1
- package/dist/assets/hook-viewer-Ca73H02j.js +0 -1
- package/dist/assets/hooks-3zdPj97l.js +0 -1
- package/dist/assets/id-badge-CIlIhfqv.js +0 -111
- package/dist/assets/index-Bu0wLCES.css +0 -2
- package/dist/assets/index-CWwAjH9Q.js +0 -58
- package/dist/assets/insights-_VG03kv7.js +0 -1
- package/dist/assets/lib-B4PNeU44.js +0 -4
- package/dist/assets/live-run-CL1uuNh1.js +0 -1
- package/dist/assets/marked.esm-DGP46SGL.js +0 -64
- package/dist/assets/memory-CAPirlHn.js +0 -1
- package/dist/assets/memory-product-CBcChlmH.js +0 -2
- package/dist/assets/monaco-editor-q3UYuc-5.js +0 -2
- package/dist/assets/observation-block-DR8MBlgg.js +0 -1
- package/dist/assets/observation-markdown-BOJNfOw1.js +0 -1
- package/dist/assets/pencil-DBjmgk_1.js +0 -1
- package/dist/assets/plus-DWwmmJlz.js +0 -1
- package/dist/assets/popover-CuqW26_E.js +0 -1
- package/dist/assets/resizable-C3bJVUPo.js +0 -1
- package/dist/assets/run-detail-Bo30AusG.js +0 -1
- package/dist/assets/runs-BDWggMSA.js +0 -1
- package/dist/assets/select-DF8sGWfv.js +0 -1
- package/dist/assets/split-button-BKCtgFiC.js +0 -1
- package/dist/assets/square-CEW9RAjr.js +0 -1
- package/dist/assets/step-name-pills-RalYL-ZJ.js +0 -1
- package/dist/assets/suite-editor-DMnWq7BC.js +0 -5
- package/dist/assets/suite-navbar-D9wliAeW.js +0 -1
- package/dist/assets/suite-viewer-D55qWO4b.js +0 -1
- package/dist/assets/suites-C02UROvF.js +0 -1
- package/dist/assets/switch-CgiZ-8Q1.js +0 -1
- package/dist/assets/tab-console-vamiKOKH.js +0 -1
- package/dist/assets/table-cLA2Rr2t.js +0 -1
- package/dist/assets/tabs-xxRH91gb.js +0 -1
- package/dist/assets/test-editor-SQG9pODg.js +0 -9
- package/dist/assets/test-navbar-DGyMPxYJ.js +0 -7
- package/dist/assets/test-viewer-D3UUL8p1.js +0 -1
- package/dist/assets/tests-Dz-BuO2B.js +0 -1
- package/dist/assets/tests-suites-table-widths-CAr7nQWt.js +0 -1
- package/dist/assets/textarea-wN2tIsDn.js +0 -1
- package/dist/assets/use-hook-run-session-RU-LfCyB.js +0 -1
- package/dist/assets/use-keyboard-shortcuts-O6nfytzm.js +0 -1
- package/dist/assets/use-run-status-favicon-CoVHCGAy.js +0 -1
- package/dist/assets/use-selection-queue-3FNZ4lRr.js +0 -1
- package/dist/assets/viewer-url-state-Dsu1DY22.js +0 -1
- /package/dist/assets/{abap-BEq1sfI-.js → abap-CpHUwCVK.js} +0 -0
- /package/dist/assets/{apex-B44QgtCx.js → apex-DlD7oJX6.js} +0 -0
- /package/dist/assets/{azcli-DMZ9GGL6.js → azcli-CmXFAbc-.js} +0 -0
- /package/dist/assets/{bat-C9UmLmb8.js → bat-DdNJq4hH.js} +0 -0
- /package/dist/assets/{bicep-DftblL_H.js → bicep-Bppz7WOA.js} +0 -0
- /package/dist/assets/{cameligo-CzLnGslK.js → cameligo-0MRMdSmg.js} +0 -0
- /package/dist/assets/{clojure-ByLwyAQs.js → clojure-B5dKj863.js} +0 -0
- /package/dist/assets/{coffee-68kO868m.js → coffee-DSbWjzk7.js} +0 -0
- /package/dist/assets/{cpp-DzwB3t3R.js → cpp-SBF8SAh9.js} +0 -0
- /package/dist/assets/{csharp-DYYXYf_U.js → csharp-Lzuq_1t-.js} +0 -0
- /package/dist/assets/{csp-CM2i4rGd.js → csp-BEzxZqi1.js} +0 -0
- /package/dist/assets/{css-DeSoHz_W.js → css-C3D3PKln.js} +0 -0
- /package/dist/assets/{cypher-BKNyhJD3.js → cypher-CQ3dEPmv.js} +0 -0
- /package/dist/assets/{dart-BQc3JPCX.js → dart-DCPmxolI.js} +0 -0
- /package/dist/assets/{dockerfile-BGxPbctm.js → dockerfile-B_2_aaTO.js} +0 -0
- /package/dist/assets/{ecl-CKjBzfQ2.js → ecl-rADUeXsV.js} +0 -0
- /package/dist/assets/{editor.api2-CX0IWJmc.js → editor.api2-DXR_ThFM.js} +0 -0
- /package/dist/assets/{elixir-BBLR1E4J.js → elixir-DOd-TuJO.js} +0 -0
- /package/dist/assets/{flow9-DZyS6Im9.js → flow9-Bf7zg_j0.js} +0 -0
- /package/dist/assets/{format-Y_Dbfary.js → format-BpI4TiHn.js} +0 -0
- /package/dist/assets/{fsharp-B_k18Kji.js → fsharp-BqROZjbA.js} +0 -0
- /package/dist/assets/{go-B5m-VPlE.js → go-oQTP5uLe.js} +0 -0
- /package/dist/assets/{graphql-B4NvZBRl.js → graphql-CSHfTU3q.js} +0 -0
- /package/dist/assets/{hcl-CXiUP62m.js → hcl-CeG-RoFJ.js} +0 -0
- /package/dist/assets/{ini-DIf6wU5x.js → ini-B2Dv4ohc.js} +0 -0
- /package/dist/assets/{java-CpjOue3Z.js → java-aUDDeufb.js} +0 -0
- /package/dist/assets/{julia-dxHeF5LM.js → julia-C5LbruO5.js} +0 -0
- /package/dist/assets/{kotlin-DRRSuc55.js → kotlin-C6mOuSKk.js} +0 -0
- /package/dist/assets/{less-tNOoNPeH.js → less-D5qC3caW.js} +0 -0
- /package/dist/assets/{lexon-zuaObGAE.js → lexon-Dr2La-fj.js} +0 -0
- /package/dist/assets/{lua-BDGwBzPZ.js → lua-Zy6u5z6Z.js} +0 -0
- /package/dist/assets/{m3-FllEI98A.js → m3-C7XHeDz_.js} +0 -0
- /package/dist/assets/{markdown-Dg9O28Mh.js → markdown-PiF7r-2h.js} +0 -0
- /package/dist/assets/{mips-BSEXxt-j.js → mips-nn07GiyE.js} +0 -0
- /package/dist/assets/{msdax-BUYxl4Gb.js → msdax-DaKFVMST.js} +0 -0
- /package/dist/assets/{mysql-CKjgZvko.js → mysql-C6d6xrbU.js} +0 -0
- /package/dist/assets/{objective-c-CMAdlqWg.js → objective-c-B6KMtI-k.js} +0 -0
- /package/dist/assets/{pascal-DnrBRw9P.js → pascal-DYr8MPE7.js} +0 -0
- /package/dist/assets/{pascaligo-DGZxRh0P.js → pascaligo-B3pd-jJ_.js} +0 -0
- /package/dist/assets/{perl-CKcCV5P6.js → perl-z2xUzoaL.js} +0 -0
- /package/dist/assets/{pgsql-D117QWhR.js → pgsql-DUvT-09-.js} +0 -0
- /package/dist/assets/{php-B7LpRV3v.js → php-CGyOmJfy.js} +0 -0
- /package/dist/assets/{pla-75s5EwYc.js → pla-CMqgvyD0.js} +0 -0
- /package/dist/assets/{postiats-FKqEVO_y.js → postiats-Dx5LUn4Z.js} +0 -0
- /package/dist/assets/{powerquery-D2B9xeZA.js → powerquery-DazYxvJ6.js} +0 -0
- /package/dist/assets/{powershell-DVyjSbmt.js → powershell-B3nwlDka.js} +0 -0
- /package/dist/assets/{protobuf-BBsLf-fq.js → protobuf-BGuu2u2s.js} +0 -0
- /package/dist/assets/{pug-CWV-ph9P.js → pug-Dbte1MXA.js} +0 -0
- /package/dist/assets/{qsharp-QhIGXK1X.js → qsharp-DJLwBOvG.js} +0 -0
- /package/dist/assets/{r-BQomAm4N.js → r-DmGBRSHj.js} +0 -0
- /package/dist/assets/{redis-DzIifZp4.js → redis-VvUYn0a4.js} +0 -0
- /package/dist/assets/{redshift-C4TPhoa0.js → redshift-6GdDrxg3.js} +0 -0
- /package/dist/assets/{restructuredtext-Dapr4eTe.js → restructuredtext-CfAB8aRU.js} +0 -0
- /package/dist/assets/{ruby-BfU5yBGC.js → ruby-CIYK6MXY.js} +0 -0
- /package/dist/assets/{rust-BkuRlY3p.js → rust-CTHZfjj9.js} +0 -0
- /package/dist/assets/{sb-C5vEAPYs.js → sb-CkKTdkz_.js} +0 -0
- /package/dist/assets/{scala-CUr1vafD.js → scala-Bx-Wr9TM.js} +0 -0
- /package/dist/assets/{scheme-wTgw6IJZ.js → scheme-Dcfi6f83.js} +0 -0
- /package/dist/assets/{scss-D_2qOFds.js → scss-ByL-7PFQ.js} +0 -0
- /package/dist/assets/{shell-CYPHnmAv.js → shell-Csnb9Yqd.js} +0 -0
- /package/dist/assets/{solidity-Dg-teBwM.js → solidity-Dbw5-0QP.js} +0 -0
- /package/dist/assets/{sophia-BZcSzYf2.js → sophia-ZQ3saZQx.js} +0 -0
- /package/dist/assets/{sparql-B198P2td.js → sparql-BEtOel8u.js} +0 -0
- /package/dist/assets/{sql-DTwIGDsL.js → sql-DGPDbzB7.js} +0 -0
- /package/dist/assets/{st-DRydv-vG.js → st-GeW2MOgh.js} +0 -0
- /package/dist/assets/{swift-DsJ-FzuB.js → swift-BVYTN8jq.js} +0 -0
- /package/dist/assets/{systemverilog-BfzGNA0B.js → systemverilog-Deg2a8Lr.js} +0 -0
- /package/dist/assets/{tcl-i-A18rYd.js → tcl-6DnLmROF.js} +0 -0
- /package/dist/assets/{twig-BcTx4v-O.js → twig-XbbXW9Yz.js} +0 -0
- /package/dist/assets/{typespec-C8pW8LGC.js → typespec-CRlV8GhI.js} +0 -0
- /package/dist/assets/{vb-DhhgAOPk.js → vb-BHE2izPH.js} +0 -0
- /package/dist/assets/{wgsl-CLi0cHxr.js → wgsl-Bf5vkfmY.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{a as t,i as n,n as r}from"./run-stream-reducer-BXMulZq1.js";import{d as i,o as a}from"./use-clipboard-copy-Bmyv0FFY.js";import{M as o,N as s,a as c,n as l,r as u,t as d}from"./tab-console-CpnOoTyg.js";import{t as f}from"./check-DH5_3cK-.js";import{a as p,i as m,n as h,r as ee,s as te,t as g}from"./select-JI5Kadjp.js";import{n as ne}from"./textarea-BP7XqG3v.js";import{r as _}from"./monaco-editor-BQB4vEk_.js";import{t as re}from"./globe-B0WEPp3h.js";import{a as v,i as ie,n as y,r as ae,t as oe}from"./live-step-row-BtLYYCKS.js";import{t as se}from"./refresh-cw-BQdOC6UA.js";import{C as ce,c as le,i as ue,n as b,r as de}from"./id-badge-CIbcJUv0.js";import{t as x}from"./label-CYpyu7PJ.js";import{n as S,r as fe,t as C}from"./popover-DThBIgGA.js";import{t as w}from"./switch-BgfA6DyL.js";import{i as T,n as E,r as pe,t as me}from"./tabs-CsAJVEvt.js";import{As as he,B as D,Cn as ge,Cr as O,Ht as k,Kt as A,L as j,Lt as M,Mt as N,Nt as _e,Pt as P,R as F,Rt as I,Sc as L,Tn as ve,Ut as ye,Wt as be,Xt as R,ar as xe,ln as Se,yn as z,z as B}from"./index-CXuVkD6-.js";import{t as V}from"./numeric-input-DcozBggQ.js";import{t as H}from"./badge-B-yh3kbi.js";import{t as U}from"./scroll-area-WFIgUp-0.js";import{n as Ce,r as we,t as Te}from"./resizable-om0nWp3k.js";import{t as Ee}from"./empty-state-2mwYYmoQ.js";import{r as De}from"./display-step-opeACkeD.js";var Oe=A(`eye`,[[`path`,{d:`M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0`,key:`1nclc0`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),ke=A(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),W=e(L(),1);function Ae(e){function t(e){if(de(e)){e.flow=!1;for(let n of e.items)t(n.value)}if(ue(e)){e.flow=!1;for(let n of e.items)t(n)}}t(e.contents)}function je(e){function t(e){return de(e)?(e.items=e.items.filter(e=>!t(e.value)),e.items.length===0):!1}t(e.contents)}var Me=[`name`,`test-id`,`target`,`use`,`meta`,`context`,`steps`];function G(e){function t(e,n){if(de(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 Ne(e){return je(e),Ae(e),G(e),e.toString()}function K(e){let t=(0,W.useRef)(null),{doc:n,error:r}=(0,W.useMemo)(()=>{if(!e)return{doc:null,error:null};try{let n=b(e);return t.current=n,{doc:n,error:null}}catch(e){return{doc:t.current,error:e instanceof Error?e.message:`Invalid YAML`}}},[e]);return{doc:n,error:r,getIn:(0,W.useCallback)(e=>{if(n)return n.getIn(e)},[n]),setIn:(0,W.useCallback)((t,n)=>{let r=b(e);return r.setIn(t,n),Ne(r)},[e]),deleteIn:(0,W.useCallback)(t=>{let n=b(e);return n.deleteIn(t),Ne(n)},[e])}}var q=R(),Pe=[{value:`chromium`,label:`Chromium`},{value:`firefox`,label:`Firefox`},{value:`webkit`,label:`WebKit`}];function J(e){return e==null?``:`${e} (inherited)`}function Fe(e){return e===!0?`(inherited: on)`:e===!1?`(inherited: off)`:`(inherited)`}var Ie=/^[a-z][a-z0-9-]*[a-z0-9]$/,Y=new Set([`name`,`load`,`capture`]);function Le(e){return e===`preserve`?`Preserve app data (inherited)`:e===`reset`?`Reset app data (inherited)`:`Select app state`}function Re(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function X(e){return Ie.test(e)}function Z(e){if(e===void 0)return{present:!1,valid:!1,name:``,load:!0,capture:!1};if(typeof e==`string`){let t=e.trim();return X(t)?{present:!0,valid:!0,name:t,load:!0,capture:!1}:{present:!0,valid:!1,name:``,load:!0,capture:!1}}if(Re(e)){let t=Object.keys(e).every(e=>Y.has(e)),n=typeof e.name==`string`?e.name.trim():``,r=e.load===void 0||typeof e.load==`boolean`,i=e.capture===void 0||typeof e.capture==`boolean`;if(t&&X(n)&&r&&i)return{present:!0,valid:!0,name:n,load:e.load!==!1,capture:e.capture===!0}}return{present:!0,valid:!1,name:``,load:!0,capture:!1}}function ze(e,t,n){return t&&!n?e:{name:e,...t?{}:{load:!1},...n?{capture:!0}:{}}}function Be({label:e,value:t,placeholder:n,onCommit:r}){let i=(0,W.useId)(),[a,o]=(0,W.useState)(t===void 0?``:String(t)),[s,c]=(0,W.useState)(null),[l,u]=(0,W.useState)(t),d=t=>V(t,{label:e,min:1,integer:!0,allowEmpty:!0});if(l!==t){u(t);let e=d(a);(e.error!==null||e.value!==t)&&(o(t===void 0?``:String(t)),c(null))}function f(e){o(e);let t=d(e);c(t.error),t.error===null&&r(t.value)}return(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:e}),(0,q.jsx)(F,{type:`text`,inputMode:`numeric`,value:a,onChange:e=>f(e.target.value),placeholder:n,"aria-invalid":s===null?void 0:!0,"aria-describedby":s===null?void 0:i,className:`h-7 text-xs`}),s!==null&&(0,q.jsx)(`p`,{id:i,className:`text-[11px] text-destructive break-words`,children:s})]})}function Ve({content:e,onChange:t,selectedTarget:n,showMeta:r=!0}){let{doc:i,getIn:a,setIn:o,deleteIn:s}=K(e);function c(e,n){t(n===``||n==null?s(e):o(e,n))}function l(e,n,r){t(n===(r??!1)?s(e):o(e,n))}let{targets:u,globalUse:d}=le(),f=n?u[n]?.platform:void 0,te=f===`android`||f===`ios`,ne=a([`use`,`browser`,`name`]),_=a([`use`,`browser`,`headless`]),re=a([`use`,`browser`,`viewport`,`width`]),v=a([`use`,`browser`,`viewport`,`height`]),ie=a([`use`,`timeout`,`step`]),y=a([`use`,`timeout`,`test`]),ae=a([`use`,`timeout`,`navigation`]),oe=a([`use`,`planner`,`maxActions`]),se=a([`use`,`planner`,`maxPlanningTurns`]),ce=a([`use`,`planner`,`previousStepCount`]),ue=a([`use`,`logCapture`,`console`]),b=a([`use`,`logCapture`,`network`]),de=a([`use`,`llm`]),S=a([`use`,`parallel`]),fe=a([`use`,`device`]),C=a([`use`,`mobile`,`appState`]),T=(0,W.useMemo)(()=>{try{return(i?.toJSON())?.use?.authState}catch{return}},[i]),E=(0,W.useMemo)(()=>Z(T),[T]),[pe,me]=(0,W.useState)(E.valid?E.name:``),D=a([`meta`,`retries`]),ge=a([`meta`,`record`]),O=d?.browser?.headless,k=d?.logCapture?.console,A=d?.logCapture?.network,M=d?.parallel,N=d?.mobile?.appState,_e=r?`Select a device for this mobile test.`:`Select a device for this mobile suite.`,P=pe.trim(),I=P.length>0&&!X(P),L=P.length>0&&!I,ve=E.valid?E.load:!0,ye=E.valid?E.capture:!1;(0,W.useEffect)(()=>{me(E.valid?E.name:``)},[E.valid,E.name]);function be(e){t(e===N?s([`use`,`mobile`,`appState`]):o([`use`,`mobile`,`appState`],e))}function R(e,n,r){t(o([`use`,`authState`],ze(e,n,r)))}function xe(e){me(e);let n=e.trim();if(n.length===0){t(s([`use`,`authState`]));return}X(n)&&R(n,ve,ye)}function Se(e){L&&R(P,e,ye)}function z(e){L&&R(P,ve,e)}return(0,q.jsxs)(`div`,{className:`space-y-3`,children:[te?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`space-y-1 opacity-50`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Browser`}),(0,q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Not applicable to mobile targets`})]}),(0,q.jsx)(j,{})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Browser`}),(0,q.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Engine`}),(0,q.jsxs)(g,{value:ne??``,onValueChange:e=>c([`use`,`browser`,`name`],e||void 0),children:[(0,q.jsx)(m,{className:`w-full h-7 text-xs`,children:(0,q.jsx)(p,{placeholder:J(d?.browser?.name??`chromium`)})}),(0,q.jsx)(h,{children:Pe.map(e=>(0,q.jsx)(ee,{value:e.value,children:e.label},e.value))})]})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(x,{className:`text-[11px] text-muted-foreground`,children:[`Headless `,_===void 0&&(0,q.jsx)(`span`,{className:`text-muted-foreground/50`,children:Fe(O)})]}),(0,q.jsx)(w,{checked:_??O??!0,onCheckedChange:e=>l([`use`,`browser`,`headless`],e,O)})]}),(0,q.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Viewport W`}),(0,q.jsx)(F,{type:`number`,value:re??``,onChange:e=>c([`use`,`browser`,`viewport`,`width`],e.target.value?Number(e.target.value):void 0),placeholder:J(d?.browser?.viewport?.width??1280),className:`h-7 text-xs`})]}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Viewport H`}),(0,q.jsx)(F,{type:`number`,value:v??``,onChange:e=>c([`use`,`browser`,`viewport`,`height`],e.target.value?Number(e.target.value):void 0),placeholder:J(d?.browser?.viewport?.height??720),className:`h-7 text-xs`})]})]})]}),(0,q.jsx)(j,{})]}),te?E.present?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`space-y-1 opacity-70`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Auth State`}),(0,q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:`Web auth state is not available for mobile targets. Use Mobile / App state to preserve app data.`})]}),(0,q.jsx)(j,{})]}):null:(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Auth State`}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{htmlFor:`auth-state-name`,className:`text-[11px] text-muted-foreground`,children:`Auth state name`}),(0,q.jsx)(F,{id:`auth-state-name`,value:pe,onChange:e=>xe(e.target.value),placeholder:`demo-acc`,className:`h-7 text-xs font-mono`}),I?(0,q.jsx)(`p`,{className:`text-[11px] text-destructive`,children:`Auth state name must be a lowercase slug.`}):null]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsx)(x,{htmlFor:`auth-state-load`,className:`text-[11px] text-muted-foreground`,children:`Load before run`}),(0,q.jsx)(w,{id:`auth-state-load`,checked:L?ve:!0,disabled:!L,onCheckedChange:Se})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,q.jsx)(x,{htmlFor:`auth-state-capture`,className:`text-[11px] text-muted-foreground`,children:`Capture after success`}),(0,q.jsx)(w,{id:`auth-state-capture`,checked:L?ye:!1,disabled:!L,onCheckedChange:z})]}),L&&ye?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(`p`,{className:`text-[11px] text-muted-foreground`,children:ve?`Loads this state first, then replaces it after a successful run.`:`Starts without saved auth state, then saves this name after a successful run.`}),(0,q.jsx)(`p`,{className:`rounded border border-amber-500/30 bg-amber-500/10 px-2 py-1 text-[11px] text-amber-700 dark:text-amber-300`,children:`Capture creates or replaces the saved state after the run succeeds.`})]}):null]}),(0,q.jsx)(j,{})]}),te?(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Mobile`}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Device`}),(0,q.jsx)(F,{value:fe??``,onChange:e=>c([`use`,`device`],e.target.value||void 0),placeholder:_e,className:`h-7 text-xs`})]}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`App state`}),(0,q.jsxs)(g,{value:C??``,onValueChange:e=>be(e),children:[(0,q.jsx)(m,{className:`w-full h-7 text-xs`,children:(0,q.jsx)(p,{placeholder:Le(N)})}),(0,q.jsxs)(h,{children:[(0,q.jsx)(ee,{value:`preserve`,children:`Preserve app data`}),(0,q.jsx)(ee,{value:`reset`,children:`Reset app data`})]})]})]})]}),(0,q.jsx)(j,{})]}):null,(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Timeouts`}),(0,q.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Step`}),(0,q.jsx)(F,{value:ie??``,onChange:e=>c([`use`,`timeout`,`step`],e.target.value||void 0),placeholder:J(d?.timeout?.step??`30s`),className:`h-7 text-xs`})]}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Test`}),(0,q.jsx)(F,{value:y??``,onChange:e=>c([`use`,`timeout`,`test`],e.target.value||void 0),placeholder:J(d?.timeout?.test??`5m`),className:`h-7 text-xs`})]}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Navigation`}),(0,q.jsx)(F,{value:ae??``,onChange:e=>c([`use`,`timeout`,`navigation`],e.target.value||void 0),placeholder:J(d?.timeout?.navigation??`15s`),className:`h-7 text-xs`})]})]})]}),(0,q.jsx)(j,{}),(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Agent`}),(0,q.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,q.jsx)(Be,{label:`Max Actions`,value:oe,onCommit:e=>c([`use`,`planner`,`maxActions`],e),placeholder:J(d?.planner?.maxActions??he.maxActions)}),(0,q.jsx)(Be,{label:`Planner Calls`,value:se,onCommit:e=>c([`use`,`planner`,`maxPlanningTurns`],e),placeholder:J(d?.planner?.maxPlanningTurns??he.maxPlanningTurns)}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Prev Steps`}),(0,q.jsx)(F,{type:`number`,min:0,value:ce??``,onChange:e=>c([`use`,`planner`,`previousStepCount`],e.target.value?Number(e.target.value):void 0),placeholder:J(d?.planner?.previousStepCount??3),className:`h-7 text-xs`})]})]})]}),(0,q.jsx)(j,{}),(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Log Capture`}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(x,{className:`text-[11px] text-muted-foreground`,children:[`Console `,ue===void 0&&(0,q.jsx)(`span`,{className:`text-muted-foreground/50`,children:Fe(k)})]}),(0,q.jsx)(w,{checked:ue??k??!1,onCheckedChange:e=>l([`use`,`logCapture`,`console`],e,k)})]}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(x,{className:`text-[11px] text-muted-foreground`,children:[`Network `,b===void 0&&(0,q.jsx)(`span`,{className:`text-muted-foreground/50`,children:Fe(A)})]}),(0,q.jsx)(w,{checked:b??A??!1,onCheckedChange:e=>l([`use`,`logCapture`,`network`],e,A)})]})]}),(0,q.jsx)(j,{}),(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`LLM`}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`LLM Config`}),(0,q.jsx)(F,{value:de??``,onChange:e=>c([`use`,`llm`],e.target.value||void 0),placeholder:J(d?.llm??`default`),className:`h-7 text-xs`})]})]}),(0,q.jsx)(j,{}),(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`span`,{className:`text-sm font-semibold text-foreground tracking-tight`,children:`Execution`}),(0,q.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,q.jsxs)(x,{className:`text-[11px] text-muted-foreground`,children:[`Parallel `,S===void 0&&(0,q.jsx)(`span`,{className:`text-muted-foreground/50`,children:Fe(M)})]}),(0,q.jsx)(w,{checked:S??M??!1,onCheckedChange:e=>l([`use`,`parallel`],e,M)})]}),r&&(0,q.jsxs)(`div`,{className:`grid grid-cols-2 gap-2`,children:[(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsx)(x,{className:`text-[11px] text-muted-foreground`,children:`Retries`}),(0,q.jsx)(F,{type:`number`,min:0,value:D??``,onChange:e=>c([`meta`,`retries`],e.target.value?Number(e.target.value):void 0),placeholder:`0 (inherited)`,className:`h-7 text-xs`})]}),(0,q.jsxs)(`div`,{className:`space-y-0.5`,children:[(0,q.jsxs)(x,{className:`text-[11px] text-muted-foreground`,children:[`Record `,ge===void 0&&(0,q.jsx)(`span`,{className:`text-muted-foreground/50`,children:`(inherited: off)`})]}),(0,q.jsx)(`div`,{className:`flex items-center h-7`,children:(0,q.jsx)(w,{checked:ge??!1,onCheckedChange:e=>l([`meta`,`record`],e,!1)})})]})]})]})]})}var He={passed:`passed`,failed:`failed`,healed:`healed`,timeout:`failed`,cancelled:`cancelled`};function Ue({runId:e,onClose:t}){let[i,a]=(0,W.useState)(r),[o,s]=(0,W.useState)(`connecting`),[c,l]=(0,W.useState)(!1);(0,W.useEffect)(()=>{if(!e)return;let t=!1;a(r()),s(`connecting`),l(!1);let i=xe(e,{onEvent:e=>{t||(l(!1),s(`running`),a(t=>n(t,e,Date.now())))},onError:()=>{t||l(!0)}});return()=>{t=!0,i.close()}},[e]);let u=i.verdict,d=u?O(u):null,f=(0,W.useMemo)(()=>i.steps.filter(y).map(e=>e.status===`running`&&u!==void 0?{...e,status:He[u]}:e),[i.steps,u]);if(!e)return null;let p=d?d.normalized===`passed`?`complete`:`error`:c?`error`:o;return(0,q.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,q.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-3 border-b border-border`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium`,children:p===`connecting`?`Connecting...`:p===`running`?`Running`:d?.label??(p===`complete`?`Passed`:`Failed`)}),(0,q.jsx)(B,{variant:`ghost`,size:`icon-xs`,onClick:t,children:(0,q.jsx)(N,{className:`size-3.5`})})]}),(0,q.jsxs)(U,{className:`flex-1 [&>[data-slot=scroll-area-viewport]>div]:!block`,children:[f.length>0&&(0,q.jsx)(`ul`,{className:`flex flex-col py-1`,children:f.map(e=>(0,q.jsx)(oe,{row:e},`${String(e.testIndex)}:${String(e.stepIndex)}`))}),f.length===0&&(p===`connecting`||p===`running`)&&(0,q.jsx)(`div`,{className:`text-sm text-muted-foreground text-center py-8`,children:`Waiting for events...`})]})]})}function We({ariaTree:e,onRefresh:t,isExecuting:n}){return e?(0,q.jsxs)(`div`,{className:`flex flex-col h-full`,children:[(0,q.jsx)(`div`,{className:`flex items-center justify-end px-3 py-1 border-b border-border/50`,children:t&&(0,q.jsxs)(`button`,{type:`button`,onClick:t,disabled:n,className:`flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50`,"aria-label":`Refresh ARIA tree`,children:[(0,q.jsx)(se,{className:`size-3`}),`Refresh`]})}),(0,q.jsx)(U,{className:`flex-1`,children:(0,q.jsx)(`pre`,{className:`font-mono text-xs p-3 whitespace-pre-wrap`,children:e})})]}):(0,q.jsxs)(`div`,{className:`flex flex-col items-center justify-center h-full gap-2 text-sm text-muted-foreground`,children:[(0,q.jsx)(`span`,{children:`Run a step or click Fetch to capture the accessibility tree`}),t&&(0,q.jsxs)(`button`,{type:`button`,onClick:t,disabled:n,className:`flex items-center gap-1.5 text-xs px-2.5 py-1 rounded border border-border hover:bg-muted transition-colors disabled:opacity-50`,children:[(0,q.jsx)(se,{className:`size-3`}),`Fetch`]})]})}function Ge({confidence:e}){let t=Math.round(e*100);return(0,q.jsxs)(H,{variant:`outline`,className:D(`text-xs font-mono`,t>80?`bg-emerald-500/10 text-emerald-500 border-emerald-500/20`:t>=50?`bg-amber-500/10 text-amber-500 border-amber-500/20`:`bg-red-500/10 text-red-500 border-red-500/20`),children:[t,`%`]})}function Ke(e){return e.result===`no-input`?a[`no-input`]:e.result}function qe(e){return e.result===`no-input`?`text-muted-foreground`:e.result===`success`?`text-emerald-500`:`text-red-500`}function Je(e){let n=[];return e.observation&&n.push({key:`observation`,label:`Observation`,icon:Oe,content:e.observation,duration:e.phaseDurations?.observe??null}),e.reasoning&&n.push({key:`reasoning`,label:`Reasoning`,icon:s,content:e.reasoning,duration:e.phaseDurations?.plan??null}),e.plannedAction!=null&&n.push({key:`plannedAction`,label:`Planned Action`,icon:M,content:null,duration:e.phaseDurations?.execute??null,children:(0,q.jsx)(`pre`,{className:`max-w-full min-w-0 text-[10px] font-mono bg-muted/30 rounded-sm p-2 overflow-x-auto whitespace-pre-wrap break-words`,children:typeof e.plannedAction==`string`?e.plannedAction:JSON.stringify(e.plannedAction,null,2)})}),e.verifierReasoning&&n.push({key:`verifier`,label:`Verifier`,icon:t,content:e.verifierReasoning,duration:e.phaseDurations?.verify??null}),n}function Ye(e){let t=[];return e.observation&&t.push({key:`observation`,label:`Observation`,icon:Oe,content:e.observation,duration:null}),e.reasoning&&t.push({key:`reasoning`,label:`Reasoning`,icon:s,content:e.reasoning,duration:null}),e.plannedAction!=null&&t.push({key:`plannedAction`,label:`Planned Action`,icon:M,content:null,duration:null,children:(0,q.jsx)(`pre`,{className:`max-w-full min-w-0 text-[10px] font-mono bg-muted/30 rounded-sm p-2 overflow-x-auto whitespace-pre-wrap break-words`,children:typeof e.plannedAction==`string`?e.plannedAction:JSON.stringify(e.plannedAction,null,2)})}),t}function Xe({step:e,subAction:t}){if(t){let e=Je(t);return(0,q.jsxs)(`div`,{className:`p-3 space-y-3 min-w-0`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,q.jsxs)(`span`,{className:`font-medium`,children:[`Sub-action #`,t.index+1]}),(0,q.jsx)(`span`,{className:`text-xs font-medium ${qe(t)}`,children:Ke(t)}),t.confidence!=null&&(0,q.jsx)(Ge,{confidence:t.confidence})]}),(0,q.jsx)(c,{mode:`static`,sections:e}),t.error&&(0,q.jsx)(`div`,{className:`bg-destructive/10 text-destructive rounded-sm p-2 text-xs break-words [overflow-wrap:anywhere]`,children:t.error})]})}let n=Ye(e);return(0,q.jsxs)(`div`,{className:`p-3 space-y-3 min-w-0`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2 text-sm`,children:[(0,q.jsxs)(`span`,{className:`font-medium`,children:[`Step #`,e.stepOrder+1]}),e.confidence!=null&&(0,q.jsx)(Ge,{confidence:e.confidence})]}),n.length>0?(0,q.jsx)(c,{mode:`static`,sections:n}):(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No reasoning data yet.`}),e.error&&(0,q.jsx)(`div`,{className:`bg-destructive/10 text-destructive rounded-sm p-2 text-xs break-words [overflow-wrap:anywhere]`,children:e.error})]})}var Ze=/^[a-z][a-z0-9-]*[a-z0-9]$/;function Qe(e){let t=e?.trim()??``;return Ze.test(t)?t:``}function $e({capture:e,disabled:t=!1}){let[n,r]=(0,W.useState)(!1),[i,a]=(0,W.useState)(()=>Qe(e.initialName)),[o,s]=(0,W.useState)(null),[c,l]=(0,W.useState)(!1),u=e.targetName,d=i.trim(),f=t||c||e.isSaving===!0;(0,W.useEffect)(()=>{n&&(a(Qe(e.initialName)),s(null))},[e.initialName,n]);let p=(0,W.useMemo)(()=>e.authStates.filter(e=>e.target===u),[e.authStates,u]),m=p.some(e=>e.name===d),h=o??e.error??null;return(0,q.jsxs)(C,{open:n,onOpenChange:e=>!f&&r(e),children:[(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-0.5`,children:[(0,q.jsx)(fe,{asChild:!0,children:(0,q.jsxs)(B,{type:`button`,variant:`outline`,size:`sm`,className:`rounded-r-sm`,disabled:f,onClick:()=>r(!0),children:[(0,q.jsx)(ke,{className:`size-3.5`}),`Save auth state`]})}),(0,q.jsx)(fe,{asChild:!0,children:(0,q.jsx)(B,{type:`button`,variant:`outline`,size:`icon-sm`,className:`rounded-l-sm px-2`,disabled:f,"aria-label":`Open auth state save form`,onClick:()=>r(!0),children:f&&e.isSaving?(0,q.jsx)(I,{className:`size-3.5 animate-spin`}):(0,q.jsx)(te,{className:`size-3.5`})})})]}),(0,q.jsxs)(S,{align:`end`,className:`w-[360px] max-w-[calc(100vw-32px)] space-y-4`,children:[(0,q.jsxs)(`div`,{className:`space-y-1`,children:[(0,q.jsx)(`h3`,{className:`text-sm font-semibold`,children:`Save auth state`}),(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Capture the current browser session for this target.`})]}),(0,q.jsxs)(`div`,{className:`rounded-md border bg-muted/30 px-3 py-2`,children:[(0,q.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Target`}),(0,q.jsx)(`div`,{className:`mt-1 min-w-0 font-mono text-xs [overflow-wrap:anywhere]`,children:u})]}),(0,q.jsxs)(`form`,{className:`space-y-4`,onSubmit:async t=>{if(t.preventDefault(),!f){if(!Ze.test(d)){s(`Auth state name must be a lowercase slug.`);return}s(null),l(!0);try{await e.onSave({name:d,replace:m}),r(!1)}catch{s(`Could not save auth state "${d}" for target "${u}".`)}finally{l(!1)}}},children:[(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(x,{htmlFor:`auth-state-name`,children:`Auth state name`}),(0,q.jsx)(F,{id:`auth-state-name`,name:`authStateName`,value:i,placeholder:`admin`,onChange:e=>{a(e.target.value),s(null)},"aria-invalid":h?`true`:void 0,autoFocus:!0}),(0,q.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Use lowercase letters, numbers, and hyphens.`})]}),(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Saved for this target`}),p.length>0?(0,q.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:p.map(e=>(0,q.jsx)(H,{variant:e.name===d?`secondary`:`outline`,className:`font-mono text-[10px]`,children:e.name},`${e.target}:${e.name}`))}):(0,q.jsx)(`div`,{className:`rounded-md border border-dashed px-3 py-2 text-xs text-muted-foreground`,children:`No auth states saved for this target.`})]}),m&&(0,q.jsxs)(`div`,{className:`flex items-start gap-2 rounded-md border border-amber-500/30 bg-amber-500/10 px-2 py-2 text-xs text-amber-700 dark:text-amber-300`,children:[(0,q.jsx)(P,{className:`mt-0.5 size-3.5 shrink-0`}),(0,q.jsx)(`span`,{children:`Existing auth state will be replaced.`})]}),h&&(0,q.jsx)(`div`,{className:`rounded-md border border-destructive/30 bg-destructive/10 px-2 py-2 text-xs text-destructive`,children:h}),(0,q.jsx)(`div`,{className:`flex justify-end`,children:(0,q.jsxs)(B,{type:`submit`,size:`sm`,disabled:f,className:D(m&&`bg-primary`),children:[c||e.isSaving?(0,q.jsx)(I,{className:`size-3.5 animate-spin`}):null,m?`Replace auth state`:`Save auth state`]})})]})]})]})}function et(e){switch(e){case`invalid`:return{label:`Draft invalid`,className:`border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400`};case`saved`:return{label:`Saved draft`,className:`border-border/70 bg-background text-muted-foreground`};default:return{label:`Using unsaved draft`,className:`border-primary/25 bg-primary/10 text-primary`}}}function tt(e,t){let n=e.trim();if(!n)return``;if(/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n))return n;if(n.startsWith(`/`))try{return new URL(n,t??`https://example.com`).toString()}catch{return n}return/^[\w.-]+(?::\d+)?(?:[/?#]|$)/.test(n)?`https://${n}`:n}function nt({hook:e}){return e.status===`passed`?(0,q.jsxs)(H,{className:`border-emerald-500/20 bg-emerald-500/15 text-emerald-500`,children:[(0,q.jsx)(k,{className:`size-3`}),`Passed`]}):e.status===`failed`?(0,q.jsxs)(H,{variant:`destructive`,children:[(0,q.jsx)(P,{className:`size-3`}),`Failed`]}):e.status===`running`?(0,q.jsxs)(H,{className:`border-primary/20 bg-primary/15 text-primary`,children:[(0,q.jsx)(I,{className:`size-3 animate-spin`}),`Running`]}):(0,q.jsx)(H,{variant:`outline`,children:`Pending`})}function rt({hook:e}){return!e.variables||Object.keys(e.variables).length===0?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`This hook did not emit any variables`}):(0,q.jsx)(`div`,{className:`space-y-2 p-4`,children:Object.entries(e.variables).map(([e,t])=>(0,q.jsxs)(`div`,{className:`rounded-md border bg-background/80 px-3 py-2`,children:[(0,q.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:e}),(0,q.jsx)(`pre`,{className:`mt-1 whitespace-pre-wrap break-all font-mono text-xs`,children:t})]},e))})}function it({hook:e}){return(0,q.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,q.jsx)(_e,{className:`size-4 text-muted-foreground`}),(0,q.jsx)(`span`,{className:`text-sm font-medium`,children:e.name})]}),(0,q.jsx)(H,{variant:`outline`,className:`font-mono text-[10px]`,children:e.id}),(0,q.jsx)(H,{variant:`outline`,className:`text-[10px] uppercase tracking-wide`,children:e.phase}),(0,q.jsx)(nt,{hook:e}),e.duration!=null&&(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.duration<1e3?`${e.duration}ms`:`${(e.duration/1e3).toFixed(1)}s`})]}),e.error&&(0,q.jsx)(`div`,{className:`min-w-0 max-w-full rounded-md border border-destructive/25 bg-destructive/10 px-3 py-2 text-sm text-destructive [overflow-wrap:anywhere]`,children:e.error}),e.stdout&&(0,q.jsxs)(`div`,{className:`space-y-1`,children:[(0,q.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`stdout`}),(0,q.jsx)(`pre`,{className:`rounded-md border bg-background/80 p-3 text-xs whitespace-pre-wrap break-all`,children:e.stdout})]}),e.stderr&&(0,q.jsxs)(`div`,{className:`space-y-1`,children:[(0,q.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`stderr`}),(0,q.jsx)(`pre`,{className:`rounded-md border border-destructive/20 bg-destructive/5 p-3 text-xs whitespace-pre-wrap break-all text-destructive`,children:e.stderr})]}),e.variables&&Object.keys(e.variables).length>0&&(0,q.jsxs)(`div`,{className:`space-y-1`,children:[(0,q.jsx)(`div`,{className:`text-xs font-medium text-muted-foreground`,children:`Emitted Variables`}),(0,q.jsx)(rt,{hook:e})]}),!e.stdout&&!e.stderr&&(!e.variables||Object.keys(e.variables).length===0)&&!e.error&&(0,q.jsx)(Ee,{icon:_e,title:`No hook output yet`,description:`Connect a live session, run a teardown hook, or end the current session to capture hook output.`})]})}function at(e){for(let t=e.length-1;t>=0;--t){let n=e[t];if(n.status!==`idle`||n.phases.length>0||n.executionHistory.length>0||n.consoleLogs.length>0||n.networkLogs.length>0)return n}return null}function ot(e){switch(e){case`running`:return`border-primary/20 bg-primary/10 text-primary`;case`passed`:return`border-emerald-500/20 bg-emerald-500/10 text-emerald-500`;case`failed`:return`border-destructive/20 bg-destructive/10 text-destructive`;case`cancelled`:return`border-amber-500/20 bg-amber-500/10 text-amber-600 dark:text-amber-400`;default:return`border-border/70 bg-background text-muted-foreground`}}function st(e){switch(e){case`running`:return`border-primary/20 bg-primary/10 text-primary`;case`passed`:case`healed`:case`flaky`:return`border-emerald-500/20 bg-emerald-500/10 text-emerald-500`;case`failed`:case`cancelled`:case`skipped`:return`border-destructive/20 bg-destructive/10 text-destructive`;default:return`border-border/70 bg-background text-muted-foreground`}}function ct({test:e,selectedStep:t,subAction:n}){let r=e.liveSteps.map(e=>De(e,e.stepIndex));return(0,q.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,q.jsxs)(`div`,{className:`min-w-0`,children:[(0,q.jsx)(`div`,{className:`text-sm font-medium`,children:e.name}),(0,q.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.path})]}),(0,q.jsx)(H,{variant:`outline`,className:D(`text-[10px] uppercase tracking-wide`,ot(e.status)),children:e.status}),typeof e.duration==`number`&&(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.duration<1e3?`${e.duration}ms`:`${(e.duration/1e3).toFixed(1)}s`})]}),e.error&&(0,q.jsx)(`div`,{className:`min-w-0 max-w-full rounded-md border border-destructive/25 bg-destructive/10 px-3 py-2 text-sm text-destructive [overflow-wrap:anywhere]`,children:e.error}),(0,q.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-2`,children:[(0,q.jsxs)(`div`,{className:`rounded-md border bg-background/80 px-3 py-2`,children:[(0,q.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:`Setup Hooks`}),(0,q.jsx)(`div`,{className:`mt-2 text-sm`,children:e.perTestSetupHooks.length>0?e.perTestSetupHooks.map(e=>`${e.name} (${e.status})`).join(`, `):`No per-test setup hooks`})]}),(0,q.jsxs)(`div`,{className:`rounded-md border bg-background/80 px-3 py-2`,children:[(0,q.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:`Teardown Hooks`}),(0,q.jsx)(`div`,{className:`mt-2 text-sm`,children:e.perTestTeardownHooks.length>0?e.perTestTeardownHooks.map(e=>`${e.name} (${e.status})`).join(`, `):`No per-test teardown hooks`})]})]}),r.length>0?(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`div`,{className:`text-[11px] font-medium uppercase tracking-wide text-muted-foreground`,children:`Steps`}),(0,q.jsx)(`div`,{className:`space-y-3`,children:r.map(e=>{let r=t?.id===e.id,i=e.liveSubActions??[];return(0,q.jsxs)(`div`,{className:D(`overflow-hidden rounded-md border bg-background/80`,r&&`border-primary/30 ring-1 ring-primary/20`),children:[(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-2 border-b px-3 py-2`,children:[(0,q.jsxs)(`span`,{className:`shrink-0 text-sm font-medium`,children:[`Step #`,e.stepOrder+1]}),(0,q.jsx)(H,{variant:`outline`,className:D(`text-[10px] uppercase tracking-wide`,st(e.status)),children:e.status}),(0,q.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-foreground`,children:e.name}),e.duration>0&&(0,q.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:e.duration<1e3?`${e.duration}ms`:`${(e.duration/1e3).toFixed(1)}s`})]}),i.length>0?(0,q.jsx)(`div`,{className:`divide-y divide-border/60`,children:i.map(t=>(0,q.jsx)(`div`,{className:D(r&&n?.index===t.index&&`bg-primary/5`),children:(0,q.jsx)(Xe,{step:e,subAction:t})},`${e.id}-sub-${t.index}`))}):(0,q.jsx)(Xe,{step:e,subAction:r?n:null})]},e.id)})})]}):(0,q.jsx)(`div`,{className:`rounded-md border border-dashed px-4 py-6 text-sm text-muted-foreground`,children:`This test has not produced any live step detail yet. Run it from the queue to inspect reasoning, console, network, and hook output.`})]})}function lt({connectionState:e,isLaunching:t,targetName:n,targetLabel:r,platform:a,liveSessionId:s,sessionGone:c=!1,currentUrl:p,pendingNavigation:m,steps:h,setupHooks:ee,teardownHooks:te,tests:g=[],selection:v,runningStepId:ie,terminalState:y,draftState:oe,ariaTree:le,errorMessage:ue,devtoolsTab:b,canRunAll:de,isRunningAll:x,isStoppingRunAll:S,setupHooksStale:fe=!1,onDevtoolsTabChange:C,onRunAll:w,onStopAll:he,onEndSession:ge,onRestartSession:O,showEndSessionAction:k=!1,onCloseLiveMode:A,onStartFreshSession:j,onBack:M,onForward:N,onRefresh:_e,onNavigate:F,onRequestAriaTree:L,executionUnit:ve=`step`,runAllLabel:R,stopAllLabel:xe,unitRowsSlot:Se,authStateCapture:z=null}){let[V,Oe]=(0,W.useState)(!1),[ke,Ae]=(0,W.useState)(``),[je,Me]=(0,W.useState)(!1),G=t?`connecting`:e,Ne=(0,W.useMemo)(()=>h.map((e,t)=>De(e,t)),[h]),K=ve===`test`,Pe=!K,J=(0,W.useMemo)(()=>[...ee,...te],[ee,te]),Fe=(0,W.useMemo)(()=>ie||(at(h)?.id??null),[ie,h]),Ie=v&&`stepId`in v?v.stepId:Fe,Y=(0,W.useMemo)(()=>Ne.find(e=>e.id===Ie)??null,[Ne,Ie]),Le=(0,W.useMemo)(()=>v?.type!==`subaction`||!Y?null:Y.liveSubActions?.[v.subIndex]??null,[v,Y]),Re=(0,W.useMemo)(()=>h.find(e=>e.id===Y?.id)??null,[Y,h]),X=(0,W.useMemo)(()=>v?.type===`hook`?J.find(e=>e.id===v.hookId)??null:null,[v,J]),Z=(0,W.useMemo)(()=>!K||!v?null:v.type===`test`||v.type===`test-hook`?g[v.testIndex]??null:`stepId`in v?g.find(e=>e.liveSteps.some(e=>e.id===v.stepId))??null:null,[v,K,g]),ze=(0,W.useMemo)(()=>!K||v?.type!==`suite-hook`?null:(v.phase===`setup`?ee:te).find(e=>e.id===v.hookId)??null,[v,ee,K,te]),Be=(0,W.useMemo)(()=>{if(!K||v?.type!==`test-hook`)return null;let e=g[v.testIndex];return e?(v.phase===`setup`?e.perTestSetupHooks:e.perTestTeardownHooks).find(e=>e.id===v.hookId)??null:null},[v,K,g]),Ve=(0,W.useMemo)(()=>{if(!K||!Z)return null;if(v&&`stepId`in v){let e=Z.liveSteps.find(e=>e.id===v.stepId);if(e)return e}if(Z.runningStepIndex!==null){let e=Z.liveSteps.find(e=>e.stepIndex===Z.runningStepIndex);if(e)return e}return at(Z.liveSteps)},[v,Z,K]),He=(0,W.useMemo)(()=>Ve?De(Ve,Ve.stepIndex):null,[Ve]),Ue=(0,W.useMemo)(()=>v?.type!==`subaction`||!He?null:He.liveSubActions?.[v.subIndex]??null,[v,He]),Ge=(0,W.useMemo)(()=>Z?.liveSteps.map(e=>De(e,e.stepIndex))??[],[Z]),Ke=Ve?.executionLogs??[],qe=Re?.executionLogs??[],Je=et(oe),Ye=a===`web`?p||r||`Configured start URL`:r||(a===`android`?`Android device`:`iOS device`),Ze=!!(a===`web`&&z&&n&&(G===`connected`||G===`executing`)&&!y);(0,W.useEffect)(()=>{je||Ae(Ye)},[Ye,je]);let Qe=async()=>{Ye&&(await navigator.clipboard.writeText(Ye),Oe(!0),window.setTimeout(()=>Oe(!1),1500))},nt=()=>{let e=tt(ke,p);if(!e){Ae(Ye);return}Ae(e),Me(!1),F(e)},ot=a===`web`?(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[(0,q.jsx)(B,{variant:`ghost`,size:`icon-sm`,onClick:M,disabled:G===`executing`||G===`idle`,"aria-label":`Go back`,children:(0,q.jsx)(be,{className:`size-3.5`})}),(0,q.jsx)(B,{variant:`ghost`,size:`icon-sm`,onClick:N,disabled:G===`executing`||G===`idle`,"aria-label":`Go forward`,children:(0,q.jsx)(ye,{className:`size-3.5`})}),(0,q.jsx)(B,{variant:`ghost`,size:`icon-sm`,onClick:_e,disabled:G===`executing`||G===`idle`,"aria-label":`Refresh page`,children:(0,q.jsx)(se,{className:`size-3.5`})})]}),(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2 rounded-full border bg-background px-3 py-1`,children:[m?(0,q.jsx)(I,{className:`size-3.5 shrink-0 animate-spin text-muted-foreground`}):(0,q.jsx)(re,{className:`size-3.5 shrink-0 text-muted-foreground`}),(0,q.jsx)(`input`,{value:ke,title:Ye,onFocus:()=>Me(!0),onBlur:()=>{Me(!1),Ae(Ye)},onChange:e=>Ae(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),nt()),e.key===`Escape`&&(e.preventDefault(),Me(!1),Ae(Ye))},disabled:G===`executing`||G===`idle`,className:D(`min-w-0 flex-1 bg-transparent text-sm outline-none`,je?`text-left`:`text-center`)})]}),(0,q.jsxs)(`div`,{className:`flex shrink-0 items-center justify-end gap-1`,children:[Ze&&z&&(0,q.jsx)($e,{capture:z,disabled:G===`executing`}),(0,q.jsx)(B,{variant:`ghost`,size:`icon-sm`,onClick:Qe,disabled:!Ye,"aria-label":V?`URL copied`:`Copy URL`,title:V?`URL copied`:`Copy URL`,children:V?(0,q.jsx)(f,{className:`size-3.5`}):(0,q.jsx)(ne,{className:`size-3.5`})})]})]}):null,st=!K&&!!(v&&v.type!==`hook`&&!Y);return(0,q.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col bg-card/30`,children:[(0,q.jsxs)(`div`,{"data-live-header":!0,className:`border-b px-4 py-3`,children:[(0,q.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,q.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,q.jsx)(`span`,{className:`text-sm font-medium`,children:n||`Live Session`}),ue&&!y&&(0,q.jsx)(`div`,{className:`min-w-0 max-w-2xl text-xs text-destructive [overflow-wrap:anywhere]`,children:ue})]}),!y&&(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-end gap-2`,children:[(0,q.jsx)(H,{variant:`outline`,className:D(`text-[10px]`,Je.className),children:Je.label}),Pe&&(x?(0,q.jsxs)(B,{variant:`outline`,size:`sm`,onClick:he,disabled:S,children:[S?(0,q.jsx)(I,{className:`size-3.5 animate-spin`}):(0,q.jsx)(ce,{className:`size-3.5`}),S?`Stopping...`:xe??`Stop All Steps`]}):(0,q.jsxs)(B,{variant:`outline`,size:`sm`,onClick:w,disabled:!de,children:[(0,q.jsx)(_,{className:`size-3.5`}),R??`Run All Steps`]})),k&&(0,q.jsxs)(B,{variant:`destructive`,size:`sm`,onClick:ge,children:[(0,q.jsx)(ce,{className:`size-3.5`}),`End Live Session`]})]})]}),fe&&!y&&(0,q.jsxs)(`div`,{className:`mt-3 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,q.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-start gap-2`,children:[(0,q.jsx)(P,{className:`mt-0.5 size-4 shrink-0`}),(0,q.jsx)(`span`,{children:`Hook order or names changed after this live session started. Continue using the current disposable session, or restart to apply the latest setup and teardown hooks.`})]}),O&&(0,q.jsx)(B,{type:`button`,size:`sm`,className:`shrink-0`,onClick:O,children:`Restart Live Session`})]})]}),ve===`test`&&Se,(0,q.jsxs)(we,{orientation:`vertical`,className:`min-h-0 flex-1`,children:[(0,q.jsx)(Ce,{defaultSize:62,minSize:32,children:y?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center px-6 py-8`,children:(0,q.jsxs)(`div`,{className:`flex max-w-lg flex-col items-center gap-4 rounded-lg border bg-background/80 px-6 py-8 text-center`,children:[(0,q.jsx)(`div`,{className:`rounded-full bg-muted p-3`,children:(0,q.jsx)(i,{className:`size-6 text-muted-foreground`})}),(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold`,children:y.title}),(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:y.description})]}),(0,q.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[A&&(0,q.jsx)(B,{variant:`outline`,size:`sm`,onClick:A,children:`Close Live Mode`}),j&&(0,q.jsx)(B,{size:`sm`,onClick:j,children:`Start Fresh Session`})]})]})}):G===`idle`?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center px-6 py-8`,children:(0,q.jsxs)(`div`,{className:`flex max-w-md flex-col items-center gap-4 rounded-lg border bg-background/70 px-6 py-8 text-center`,children:[(0,q.jsx)(`div`,{className:`rounded-full bg-muted p-3`,children:(0,q.jsx)(i,{className:`size-6 text-muted-foreground`})}),(0,q.jsxs)(`div`,{className:`space-y-2`,children:[(0,q.jsx)(`h3`,{className:`text-base font-semibold`,children:`Live mode is target-scoped`}),(0,q.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This workspace runs the current builder draft against the selected target. Sessions are disposable and draft changes only persist when you save the test.`})]})]})}):s?(0,q.jsx)(ae,{subject:{kind:`editor`,sessionId:s,sessionGone:c,onStartFresh:j??ge},chrome:ot}):(0,q.jsxs)(`div`,{className:`flex h-full items-center justify-center gap-3 text-sm text-muted-foreground`,children:[(0,q.jsx)(I,{className:`size-5 animate-spin`}),`Connecting to browser...`]})}),(0,q.jsx)(Te,{withHandle:!0}),(0,q.jsx)(Ce,{defaultSize:38,minSize:20,children:(0,q.jsxs)(me,{value:b,onValueChange:e=>C(e),className:`flex h-full min-h-0 flex-col`,children:[(0,q.jsxs)(pe,{variant:`line`,className:`h-9 justify-start rounded-none border-b px-3`,children:[(0,q.jsx)(T,{value:`reasoning`,className:`rounded-none text-xs`,children:`Reasoning`}),(0,q.jsx)(T,{value:`env`,className:`rounded-none text-xs`,children:`Env`}),(0,q.jsx)(T,{value:`network`,className:`rounded-none text-xs`,children:`Network`}),(0,q.jsx)(T,{value:`console`,className:`rounded-none text-xs`,children:`Console`}),(0,q.jsx)(T,{value:`aria`,className:`rounded-none text-xs`,children:`ARIA Tree`})]}),(0,q.jsx)(E,{value:`reasoning`,className:`m-0 flex-1 overflow-hidden`,children:(0,q.jsx)(U,{className:`h-full`,children:K?ze?(0,q.jsx)(it,{hook:ze}):Be?(0,q.jsx)(it,{hook:Be}):Z?(0,q.jsx)(ct,{test:Z,selectedStep:He,subAction:Ue}):(0,q.jsx)(Ee,{icon:o,title:`Select a test to inspect it`,description:`Choose a test in the live queue to see its reasoning, logs, hooks, and network activity.`}):X?(0,q.jsx)(it,{hook:X}):Y?(0,q.jsx)(Xe,{step:Y,subAction:Le}):st?(0,q.jsx)(Ee,{icon:o,title:`Selection is no longer available`,description:`Pick another step in the builder to inspect its reasoning.`}):(0,q.jsx)(Ee,{icon:o,title:`No reasoning yet`,description:`Run a step from the builder or use Run All Steps to populate the live reasoning trace.`})})}),(0,q.jsx)(E,{value:`env`,className:`m-0 flex-1 overflow-hidden`,children:K?ze?(0,q.jsx)(U,{className:`h-full`,children:(0,q.jsx)(rt,{hook:ze})}):Be?(0,q.jsx)(U,{className:`h-full`,children:(0,q.jsx)(rt,{hook:Be})}):Ve?(0,q.jsx)(U,{className:`h-full`,children:(0,q.jsx)(u,{step:Ve,executionLogs:Ke})}):Z?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Select a test-owned hook or run a step to inspect variables and runJS output`}):(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Select a test to inspect it`}):X?(0,q.jsx)(U,{className:`h-full`,children:(0,q.jsx)(rt,{hook:X})}):Re?(0,q.jsx)(U,{className:`h-full`,children:(0,q.jsx)(u,{step:Re,executionLogs:qe})}):(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Select a step to inspect variables and runJS output`})}),(0,q.jsx)(E,{value:`network`,className:`m-0 flex-1 overflow-hidden`,children:K?ze||Be?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center px-6 text-sm text-muted-foreground`,children:`Hooks do not capture browser network activity. Select a test step to inspect requests.`}):Ve?(0,q.jsx)(U,{className:`h-full`,children:(0,q.jsx)(l,{step:He,allSteps:Ge,platform:a})}):Z?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Run this test to inspect its network activity`}):(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Select a test to inspect it`}):X?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center px-6 text-sm text-muted-foreground`,children:`Hooks do not capture browser network activity. Select a step to inspect requests.`}):Y?(0,q.jsx)(U,{className:`h-full`,children:(0,q.jsx)(l,{step:Y,allSteps:Ne,platform:a})}):(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Select a step to inspect network activity`})}),(0,q.jsx)(E,{value:`console`,className:`m-0 flex-1 overflow-hidden`,children:K?ze?(0,q.jsx)(U,{className:`h-full`,children:(0,q.jsx)(it,{hook:ze})}):Be?(0,q.jsx)(U,{className:`h-full`,children:(0,q.jsx)(it,{hook:Be})}):Ve?(0,q.jsx)(U,{className:`h-full`,children:(0,q.jsx)(d,{step:He,allSteps:Ge,executionLogs:Ke,isHookStep:Ke.length>0})}):Z?(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Run this test to inspect console output`}):(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Select a test to inspect it`}):X?(0,q.jsx)(U,{className:`h-full`,children:(0,q.jsx)(it,{hook:X})}):Y?(0,q.jsx)(U,{className:`h-full`,children:(0,q.jsx)(d,{step:Y,allSteps:Ne,executionLogs:qe,isHookStep:qe.length>0})}):(0,q.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:`Select a step to inspect console output`})}),(0,q.jsx)(E,{value:`aria`,className:`m-0 flex-1 overflow-hidden`,children:(0,q.jsx)(We,{ariaTree:le,onRefresh:L,isExecuting:G===`executing`})})]})})]})]})}function ut(){return typeof window<`u`&&window.localStorage!==void 0}function dt(){if(!ut())return!1;try{return window.localStorage.getItem(`agent-qa:live-debug`)===`1`}catch{return!1}}function Q(e,t,n){if(!dt())return;let r=`[agent-qa live:${e}] ${t}`;if(n){console.info(r,n);return}console.info(r)}function ft(e){return e?.subActionsData??null}function pt(e,t){let n=typeof e==`string`?{instruction:e}:e;return{id:t?.id??n.draftId??crypto.randomUUID(),draftId:n.draftId??t?.draftId??null,instruction:n.instruction,status:t?.status??`idle`,duration:t?.duration,error:t?.error,phases:t?.phases??[],executionHistory:t?.executionHistory??[],capturedVariables:t?.capturedVariables,consoleLogs:t?.consoleLogs??[],networkLogs:t?.networkLogs??[],variableSnapshot:t?.variableSnapshot??null,originalStepName:t?.originalStepName??null,liveSubActions:t?.liveSubActions??null,executionLogs:t?.executionLogs??[],executionGeneration:t?.executionGeneration??0}}function mt(e,t){return{id:e.hookId,executionId:t?.executionId??null,name:e.name??t?.name??e.hookId,phase:e.phase,status:t?.status??`pending`,duration:t?.duration,stdout:t?.stdout??null,stderr:t?.stderr??null,variables:t?.variables??null,error:t?.error,createdAt:t?.createdAt}}function ht(e,t){return{...pt({draftId:t?.draftId,instruction:e.instruction},t),id:t?.id??crypto.randomUUID(),stepIndex:e.stepIndex}}function gt(e,t){let n=e.findIndex(e=>e.id===t.id);return n===-1?[...e,t]:e.map((e,r)=>r===n?{...e,...t}:e)}function _t(e,t,n){let r=e.find(e=>e.stepIndex===t.stepIndex),i={...ht(t,r),...n};return[...r?e.map(e=>e.stepIndex===t.stepIndex?i:e):[...e,i]].sort((e,t)=>e.stepIndex-t.stepIndex)}function vt(e,t){let n=t.map(e=>({draftId:e.draftId,instruction:e.instruction}));if(e.length===n.length&&e.every((e,t)=>e.instruction===n[t].instruction&&e.draftId===n[t].draftId))return e;let r=new Map(e.filter(e=>!!e.draftId).map(e=>[e.draftId,e]));return n.map((t,n)=>pt(t,t.draftId?r.get(t.draftId):e[n]))}function yt(e,t,n){if(e.length===t.length&&e.every((e,r)=>e.id===t[r]&&e.phase===n))return e;let r=new Map(e.map(e=>[e.id,e]));return t.map(e=>mt({hookId:e,phase:n},r.get(e)))}function bt(e,t,n){return{id:n?.id??`${e.testId}:${e.path}:${t}`,draftId:e.draftId??n?.draftId??null,testId:e.testId,path:e.path,name:e.name,status:n?.status??`idle`,duration:n?.duration,error:n?.error,testExecutionId:n?.testExecutionId??null,liveSteps:n?.liveSteps??[],runningStepIndex:n?.runningStepIndex??null,perTestSetupHooks:n?.perTestSetupHooks??[],perTestTeardownHooks:n?.perTestTeardownHooks??[],lastRunAt:n?.lastRunAt}}function xt(e,t){let n=e.findIndex(e=>e.testExecutionId===t.testExecutionId);if(n!==-1)return n;let r=e.findIndex(e=>e.testId===t.testId&&e.name===t.testName);return r===-1?t.testIndex>=0&&t.testIndex<e.length?t.testIndex:-1:r}function $(e,t,n){let r=xt(e,t);return r===-1?e:e.map((e,t)=>t===r?n(e):e)}function St(e){return e.scope===`test`}function Ct(e){e.onopen=null,e.onmessage=null,e.onerror=null,e.onclose=null,e.close()}function wt(e,t={}){let n=t.steps,r=t.tests,i=t.setupHooks??[],a=t.teardownHooks??[],o=t.allowReconnect??!n,[s,c]=(0,W.useState)(`idle`),[l,u]=(0,W.useState)([]),[d,f]=(0,W.useState)(()=>yt([],i,`setup`)),[p,m]=(0,W.useState)(()=>yt([],a,`teardown`)),[h,ee]=(0,W.useState)(null),[te,g]=(0,W.useState)(null),[ne,_]=(0,W.useState)(null),[re,y]=(0,W.useState)(null),[ae,oe]=(0,W.useState)([]),[se,ce]=(0,W.useState)(`web`),[le,ue]=(0,W.useState)(null),[b,de]=(0,W.useState)(!1),[x,S]=(0,W.useState)(!1),[fe,C]=(0,W.useState)([]),[w,T]=(0,W.useState)(null),[E,pe]=(0,W.useState)(!1),[me,he]=(0,W.useState)(!1),[D,ge]=(0,W.useState)(!1),O=(0,W.useRef)(null),k=(0,W.useRef)(0),A=(0,W.useRef)(null),j=(0,W.useRef)(`idle`),M=(0,W.useRef)([]),N=(0,W.useRef)(null),_e=(0,W.useRef)(!1),P=(0,W.useRef)(null),F=(0,W.useRef)(null),I=(0,W.useRef)(!1),L=(0,W.useRef)(0),ve=(0,W.useRef)(`web`),ye=(0,W.useRef)(null),be=(0,W.useRef)(!!n),R=(0,W.useRef)(null),xe=(0,W.useRef)([]),z=(0,W.useRef)(null),B=(0,W.useRef)(!1),V=(0,W.useRef)(null);j.current=s,M.current=l,N.current=re,ve.current=se,be.current=!!n,xe.current=fe,z.current=w;let H=(0,W.useCallback)(e=>{let t=O.current;t&&t.readyState===WebSocket.OPEN&&t.send(JSON.stringify(e))},[]),U=(0,W.useCallback)(()=>new Promise(e=>{F.current=e,setTimeout(()=>{F.current===e&&(F.current=null,e())},5e3)}),[]),Ce=(0,W.useCallback)(()=>{let e=ye.current;e&&(ye.current=null,u(t=>vt(t,e)))},[]),we=(0,W.useCallback)(e=>{O.current&&=(Q(`hook`,`closing previous websocket before reconnect`,{sessionId:e}),Ct(O.current),null),c(`connecting`),_e.current=!1,Q(`hook`,`connecting websocket`,{sessionId:e});let t=`${location.protocol===`https:`?`wss:`:`ws:`}//${location.host}/api/live-editor/ws?sessionId=${e}`,n=new WebSocket(t);O.current=n,n.onopen=()=>{k.current=0,Q(`hook`,`websocket opened`,{sessionId:e})},n.onmessage=t=>{let n;try{n=JSON.parse(t.data)}catch{return}switch(n.type){case`session-ready`:{let t=n.platform??`web`;ce(t),ve.current=t;let r=n.interactive!==!1;c(r?`connected`:`error`),_(n.error??null),Q(`hook`,`session ready`,{sessionId:e,platform:t,interactive:r});break}case`hook-start`:{let e=n.hook,t={id:e.hookId,executionId:e.executionId,name:e.hookName,phase:e.phase,status:`running`,duration:void 0,stdout:null,stderr:null,variables:null,error:void 0,createdAt:e.createdAt};if(e.owner.scope===`suite`)(e.phase===`setup`?f:m)(e=>gt(e,t)),R.current&&R.current.phase===e.phase&&R.current.hookId===e.hookId&&(R.current={...R.current,executionId:e.executionId});else if(St(e.owner)){let n=e.owner;C(r=>$(r,n,n=>({...n,perTestSetupHooks:e.phase===`setup`?gt(n.perTestSetupHooks,t):n.perTestSetupHooks,perTestTeardownHooks:e.phase===`teardown`?gt(n.perTestTeardownHooks,t):n.perTestTeardownHooks})))}break}case`hook-complete`:{let e=n.hook,t={id:e.hookId,executionId:e.executionId,name:e.hookName,phase:e.phase,status:e.status,duration:e.duration,stdout:e.stdout??null,stderr:e.stderr??null,variables:e.variables??null,error:e.error,createdAt:e.createdAt};if(e.owner.scope===`suite`)(t.phase===`setup`?f:m)(e=>gt(e,t)),R.current&&R.current.phase===t.phase&&R.current.hookId===t.id&&(!R.current.executionId||R.current.executionId===t.executionId)&&(R.current=null,c(`connected`),Ce());else if(St(e.owner)){let n=e.owner;C(e=>$(e,n,e=>({...e,perTestSetupHooks:t.phase===`setup`?gt(e.perTestSetupHooks,t):e.perTestSetupHooks,perTestTeardownHooks:t.phase===`teardown`?gt(e.perTestTeardownHooks,t):e.perTestTeardownHooks})))}break}case`step-phase`:u(e=>e.map((e,t)=>t===N.current&&e.status===`running`&&e.executionGeneration===L.current?{...e,phases:[...e.phases,{phase:n.phase,text:n.data?.text,confidence:n.data?.confidence,action:n.data?.action,success:n.data?.success,duration:n.data?.duration,timestamp:new Date().toISOString()}]}:e));break;case`step-complete`:{let t=n.result,r=N.current,i=t?.status===`passed`?`passed`:`failed`;u(e=>e.map((e,n)=>n===r&&e.status===`running`?{...e,status:i,duration:t?.duration,error:t?.error,capturedVariables:t?.capturedVariables,consoleLogs:t?.consoleLogs??[],networkLogs:t?.networkLogs??[],variableSnapshot:t?.variableSnapshot??null,originalStepName:t?.originalStepName??null,liveSubActions:ft(t),executionLogs:t?.executionLogs??[]}:e)),y(null),c(`connected`),Q(`hook`,`step completed`,{sessionId:e,stepIndex:r??void 0,status:i}),P.current?.({status:i}),P.current=null,F.current?.(),F.current=null,Ce();break}case`test-start`:{let e=n.test;z.current=e.testIndex,T(e.testIndex),C(t=>$(t,e,t=>({...t,status:`running`,duration:void 0,error:void 0,testExecutionId:e.testExecutionId,runningStepIndex:null,liveSteps:[],perTestSetupHooks:[],perTestTeardownHooks:[]})));break}case`test-step-start`:{let e=n.step;C(t=>$(t,e,t=>({...t,status:`running`,testExecutionId:e.testExecutionId,runningStepIndex:e.stepIndex,liveSteps:_t(t.liveSteps,{stepIndex:e.stepIndex,instruction:e.stepInstruction},{status:`running`,duration:void 0,error:void 0,phases:[],consoleLogs:[],networkLogs:[],variableSnapshot:null,originalStepName:null,liveSubActions:null,executionLogs:[]})})));break}case`test-step-phase`:{let e=n.step;C(t=>$(t,e,t=>({...t,liveSteps:_t(t.liveSteps,{stepIndex:e.stepIndex,instruction:e.stepInstruction},{status:`running`,phases:[...t.liveSteps.find(t=>t.stepIndex===e.stepIndex)?.phases??[],{phase:n.phase,text:n.data?.text,confidence:n.data?.confidence,action:n.data?.action,success:n.data?.success,duration:n.data?.duration,timestamp:new Date().toISOString()}]})})));break}case`test-step-complete`:{let e=n.step,t=n.result;C(n=>$(n,e,n=>({...n,runningStepIndex:n.runningStepIndex===e.stepIndex?null:n.runningStepIndex,liveSteps:_t(n.liveSteps,{stepIndex:e.stepIndex,instruction:e.stepInstruction},{status:t?.status??`failed`,duration:t?.duration,error:t?.error,capturedVariables:t?.capturedVariables,consoleLogs:t?.consoleLogs??[],networkLogs:t?.networkLogs??[],variableSnapshot:t?.variableSnapshot??null,originalStepName:t?.originalStepName??null,liveSubActions:ft(t),executionLogs:t?.executionLogs??[]})})));break}case`test-step-cancelled`:{let e=n.step;C(t=>$(t,e,t=>({...t,runningStepIndex:t.runningStepIndex===e.stepIndex?null:t.runningStepIndex,liveSteps:_t(t.liveSteps,{stepIndex:e.stepIndex,instruction:e.stepInstruction},{status:`cancelled`})})));break}case`test-step-error`:{let e=n.step;C(t=>$(t,e,t=>({...t,runningStepIndex:t.runningStepIndex===e.stepIndex?null:t.runningStepIndex,liveSteps:_t(t.liveSteps,{stepIndex:e.stepIndex,instruction:e.stepInstruction},{status:`failed`,error:n.error})})));break}case`test-complete`:{let e=n.test,t=n.result,r=t?.status??`failed`,i=t?.error;if(!i&&r===`failed`&&Array.isArray(t?.stepResults)){let e=t.stepResults.find(e=>e?.status===`failed`);e?.error&&(i=`Step ${t.stepResults.indexOf(e)+1} failed: ${e.error}`)}C(n=>$(n,e,n=>({...n,status:r,duration:t?.duration,error:i,testExecutionId:e.testExecutionId,runningStepIndex:null,lastRunAt:new Date().toISOString(),liveSteps:Array.isArray(t?.stepResults)?t.stepResults.reduce((e,t,r)=>{let i=n.liveSteps.find(e=>e.stepIndex===r);return i?_t(e,{stepIndex:r,instruction:i.instruction},{status:t?.status??i.status,duration:t?.duration,error:t?.error,capturedVariables:t?.capturedVariables,consoleLogs:t?.consoleLogs??i.consoleLogs,networkLogs:t?.networkLogs??i.networkLogs,variableSnapshot:t?.variableSnapshot??i.variableSnapshot,originalStepName:t?.originalStepName??i.originalStepName,liveSubActions:ft(t)??i.liveSubActions,executionLogs:t?.executionLogs??i.executionLogs}):e},n.liveSteps):n.liveSteps,perTestSetupHooks:Array.isArray(t?.setupHookExecutions)?t.setupHookExecutions.map(e=>({id:e.hookId,executionId:e.executionId??null,name:e.hookName,phase:e.phase,status:e.status,duration:e.duration,stdout:e.stdout??null,stderr:e.stderr??null,variables:e.variables??null,error:e.error,createdAt:e.createdAt})):n.perTestSetupHooks,perTestTeardownHooks:Array.isArray(t?.teardownHookExecutions)?t.teardownHookExecutions.map(e=>({id:e.hookId,executionId:e.executionId??null,name:e.hookName,phase:e.phase,status:e.status,duration:e.duration,stdout:e.stdout??null,stderr:e.stderr??null,variables:e.variables??null,error:e.error,createdAt:e.createdAt})):n.perTestTeardownHooks}))),z.current=null,T(null),c(`connected`);let a=V.current;V.current=null,a?.({status:r});break}case`test-error`:{let e=n.test;C(t=>$(t,e,t=>({...t,status:`failed`,error:n.error,testExecutionId:e.testExecutionId,runningStepIndex:null,lastRunAt:new Date().toISOString()}))),z.current=null,T(null),c(`connected`);let t=V.current;V.current=null,t?.({status:`failed`});break}case`step-error`:Q(`hook`,`step failed`,{sessionId:e,stepIndex:N.current??void 0,error:n.error}),u(e=>e.map((e,t)=>t===N.current?e.status===`cancelling`?{...e,status:`cancelled`}:e.status===`running`?{...e,status:`failed`,error:n.error}:e:e)),y(null),c(`connected`),P.current?.({status:`failed`}),P.current=null,F.current?.(),F.current=null,Ce();break;case`step-cancelled`:u(e=>e.map((e,t)=>t===N.current&&(e.status===`running`||e.status===`cancelling`)?{...e,status:`cancelled`}:e)),y(null),c(`connected`),Q(`hook`,`step cancelled`,{sessionId:e,stepIndex:N.current??void 0}),P.current?.({status:`cancelled`}),P.current=null,F.current?.(),F.current=null,Ce();break;case`step-busy`:g(null),R.current&&(R.current=null,c(`connected`)),_(`Step already in progress: ${n.currentStep}`);break;case`navigate-complete`:ee(n.url??null),g(null);break;case`session-state`:n.state&&`currentUrl`in n.state&&ee(n.state.currentUrl??null),n.state?.interactive===!1&&(c(`error`),_(n.state.terminalError??`Live session is not ready`));break;case`device-logs`:oe(e=>[...e,...n.entries]);break;case`aria-tree`:ue(n.tree);break;case`session-terminated`:c(`disconnected`),g(null),R.current=null,Ce(),Q(`hook`,`session terminated by server`,{sessionId:e});break;case`error`:g(null),R.current&&(R.current=null,c(`connected`),Ce()),_(n.message),Q(`hook`,`server reported error`,{sessionId:e,message:n.message});break}},n.onclose=t=>{if(O.current=null,_e.current){Q(`hook`,`websocket closed after local termination`,{sessionId:e});return}let n=t.code===ie,r=t.code===v,i=!n&&!r&&o&&k.current<3;Q(`hook`,`websocket closed unexpectedly`,{sessionId:e,allowReconnect:o,reconnectCount:k.current,code:t.code}),n&&ge(!0),c(i?`connecting`:`disconnected`),g(null),R.current=null,u(e=>e.map(e=>e.status===`running`||e.status===`cancelling`?{...e,status:`cancelled`}:e)),N.current=null,y(null),P.current?.({status:`cancelled`}),P.current=null,F.current?.(),F.current=null;let a=z.current;a!==null&&C(e=>e.map((e,t)=>t===a&&(e.status===`running`||e.status===`cancelling`)?{...e,status:`cancelled`,runningStepIndex:null}:e)),z.current=null,T(null);let s=V.current;if(V.current=null,s?.({status:`cancelled`}),Ce(),i){let t=2**k.current*1e3;k.current++,Q(`hook`,`scheduling reconnect`,{sessionId:e,delay:t,reconnectCount:k.current}),A.current=setTimeout(()=>we(e),t)}},n.onerror=()=>{Q(`hook`,`websocket error event`,{sessionId:e})}},[o,Ce]);(0,W.useEffect)(()=>{if(n){if(j.current===`executing`){ye.current=n,Q(`hook`,`queued external step sync while executing`,{stepCount:n.length});return}ye.current=null,Q(`hook`,`syncing external steps`,{stepCount:n.length}),u(e=>vt(e,n))}},[n]),(0,W.useEffect)(()=>{f(e=>yt(e,i,`setup`))},[i]),(0,W.useEffect)(()=>{m(e=>yt(e,a,`teardown`))},[a]),(0,W.useEffect)(()=>{r&&C(e=>{let t=new Map(e.map(e=>[`${e.testId}::${e.path}`,e]));return r.map((e,n)=>bt(e,n,t.get(`${e.testId}::${e.path}`)))})},[r]),(0,W.useEffect)(()=>{if(ge(!1),!e){c(`idle`),u(n?vt([],n):[]),f(yt([],i,`setup`)),m(yt([],a,`teardown`)),ee(null),g(null),_(null),R.current=null,oe([]),ce(`web`),ue(null),de(!1),S(!1),C(r?.map((e,t)=>bt(e,t))??[]),T(null),pe(!1),he(!1);return}return we(e),()=>{A.current&&=(clearTimeout(A.current),null),O.current&&=(Q(`hook`,`cleaning up websocket for session effect`,{sessionId:e}),Ct(O.current),null)}},[we,e]);let Te=(0,W.useCallback)(e=>{if(be.current)return;let t=M.current.length;u(t=>[...t,{id:crypto.randomUUID(),draftId:null,instruction:e,status:`running`,phases:[],executionHistory:[],consoleLogs:[],networkLogs:[],variableSnapshot:null,originalStepName:null,liveSubActions:null,executionLogs:[],executionGeneration:0}]),y(t),c(`executing`),_(null),H({type:`execute-step`,stepInstruction:e,stepIndex:t})},[H]),Ee=(0,W.useCallback)(async(t,n)=>{let r=M.current[t];if(!r||!r.instruction.trim())return;if(N.current!==null){let e=N.current;I.current=!0,u(t=>t.map((t,n)=>n===e&&t.status===`running`?{...t,status:`cancelling`}:t)),H({type:`cancel-step`}),await U()}L.current++;let i=L.current;N.current=t,y(t),u(e=>e.map((e,n)=>n===t?{...e,status:`running`,phases:[],executionHistory:e.phases.length>0?[...e.executionHistory,{phases:e.phases,status:e.status,duration:e.duration,error:e.error,timestamp:new Date().toISOString()}]:e.executionHistory,error:void 0,duration:void 0,consoleLogs:[],networkLogs:[],variableSnapshot:null,originalStepName:null,liveSubActions:null,executionLogs:[],executionGeneration:i}:e)),c(`executing`),_(null),Q(`hook`,`executing step`,{sessionId:e,stepIndex:t,instruction:r.instruction,testName:n?.testName}),H({type:`execute-step`,stepInstruction:r.instruction,stepIndex:t,draft:n})},[H,e,U]),De=(0,W.useCallback)(async(t,n)=>{if(j.current!==`connected`){_(`Live session is busy or not ready`);return}R.current={phase:t,hookId:n},(t===`setup`?f:m)(e=>e.map(e=>e.id===n?{...e,status:`running`,duration:void 0,stdout:null,stderr:null,variables:null,error:void 0}:e)),c(`executing`),_(null),Q(`hook`,`executing hook`,{sessionId:e,phase:t,hookId:n}),H({type:`execute-hook`,phase:t,hookId:n})},[H,e]),Oe=(0,W.useCallback)(()=>{be.current||u(e=>[...e,pt(``)])},[]),ke=(0,W.useCallback)(e=>{be.current||u(t=>t.filter((t,n)=>n!==e))},[]),Ae=(0,W.useCallback)((e,t)=>{be.current||u(n=>n.map((n,r)=>r===e?{...n,instruction:t}:n))},[]),je=(0,W.useCallback)((e,t)=>{if(be.current)return;u(n=>{let r=[...n],[i]=r.splice(e,1);return r.splice(t,0,i),r});let n=N.current;if(n!==null){let r=n;n===e?r=t:e<n&&t>=n?r=n-1:e>n&&t<=n&&(r=n+1),r!==n&&(N.current=r,y(r))}},[]),Me=(0,W.useCallback)(()=>{b&&(I.current=!0,S(!0)),u(e=>e.map((e,t)=>t===N.current&&e.status===`running`?{...e,status:`cancelling`}:e)),Q(`hook`,`cancelling active step`,{sessionId:e}),H({type:`cancel-step`})},[b,H,e]),G=(0,W.useCallback)(()=>{g({action:`refresh`}),H({type:`refresh-page`})},[H]),Ne=(0,W.useCallback)(()=>{g({action:`back`}),H({type:`go-back`})},[H]),K=(0,W.useCallback)(()=>{g({action:`forward`}),H({type:`go-forward`})},[H]),q=(0,W.useCallback)(()=>{H({type:`get-aria-tree`})},[H]),Pe=(0,W.useCallback)(e=>{g({action:`navigate`,targetUrl:e}),H({type:`navigate`,url:e})},[H]),J=(0,W.useCallback)((e,t)=>new Promise(n=>{P.current=n;let r=M.current[e];if(!r||!r.instruction.trim()){P.current=null,n({status:`skipped`});return}L.current++;let i=L.current;N.current=e,y(e),u(t=>t.map((t,n)=>n===e?{...t,status:`running`,phases:[],executionHistory:t.phases.length>0?[...t.executionHistory,{phases:t.phases,status:t.status,duration:t.duration,error:t.error,timestamp:new Date().toISOString()}]:t.executionHistory,error:void 0,duration:void 0,consoleLogs:[],networkLogs:[],variableSnapshot:null,originalStepName:null,liveSubActions:null,executionLogs:[],executionGeneration:i}:t)),c(`executing`),_(null),H({type:`execute-step`,stepInstruction:r.instruction,stepIndex:e,draft:t})}),[H]),Fe=(0,W.useCallback)(async t=>{if(b)return;I.current=!1;let n=M.current.length;de(!0),S(!1),Q(`hook`,`running all steps`,{sessionId:e,stepCount:n});try{for(let e=0;e<n&&!I.current;e++){if(!M.current[e].instruction.trim())continue;let n=await J(e,t);if(n.status===`failed`||n.status===`cancelled`)break}}finally{I.current=!1,de(!1),S(!1)}},[J,b,e]),Ie=(0,W.useCallback)(()=>{b&&(I.current=!0,S(!0),u(e=>e.map((e,t)=>t===N.current&&e.status===`running`?{...e,status:`cancelling`}:e)),N.current!==null&&H({type:`cancel-step`}))},[b,H]),Y=(0,W.useCallback)((e,t)=>new Promise(n=>{V.current=n;let r=xe.current[e];if(!r){V.current=null,n({status:`skipped`});return}let i=crypto.randomUUID();z.current=e,T(e),C(t=>t.map((t,n)=>n===e?{...t,status:`running`,duration:void 0,error:void 0,testExecutionId:i,runningStepIndex:null,liveSteps:[],perTestSetupHooks:[],perTestTeardownHooks:[]}:t)),c(`executing`),_(null),H({type:`execute-test`,testExecutionId:i,testId:r.testId,path:r.path,testIndex:e,draft:t})}),[H]),Le=(0,W.useCallback)(async(e,t)=>{xe.current[e]&&await Y(e,t)},[Y]),Re=(0,W.useCallback)(async e=>{if(E)return;B.current=!1;let t=xe.current.length;pe(!0),he(!1);try{for(let n=0;n<t&&!B.current;n++){let t=await Y(n,e);if(t.status===`failed`||t.status===`cancelled`)break}}finally{B.current=!1,pe(!1),he(!1)}},[Y,E]),X=(0,W.useCallback)(()=>{E&&(B.current=!0,he(!0),z.current!==null&&H({type:`cancel-step`}))},[E,H]),Z=(0,W.useCallback)(()=>{I.current=!0,de(!1),S(!1),_e.current=!0,A.current&&=(clearTimeout(A.current),null),Q(`hook`,`terminating session`,{sessionId:e}),H({type:`terminate-session`}),e&&Se(e,{keepalive:!0}).catch(()=>{Q(`hook`,`session delete refused or already gone`,{sessionId:e})})},[H,e]);return(0,W.useEffect)(()=>{if(!e)return;let t=()=>Z();return window.addEventListener(`pagehide`,t),()=>window.removeEventListener(`pagehide`,t)},[e,Z]),{connectionState:s,steps:l,setupHooks:d,teardownHooks:p,currentUrl:h,pendingNavigation:te,error:ne,executeStep:Te,executeStepByIndex:Ee,executeHookById:De,cancelStep:Me,refreshPage:G,goBack:Ne,goForward:K,navigate:Pe,runAll:Fe,cancelRunAll:Ie,terminateSession:Z,addStep:Oe,removeStep:ke,updateStepInstruction:Ae,reorderSteps:je,runningStepIndex:re,runningStepId:re===null?null:l[re]?.id??null,sessionId:e,isTerminated:_e.current,sessionGone:D,deviceLogs:ae,platform:se,ariaTree:le,requestAriaTree:q,isRunningAll:b,isStoppingRunAll:x,tests:fe,executeTestByIndex:Le,runAllTests:Re,cancelRunAllTests:X,runningTestIndex:w,isRunningAllTests:E,isStoppingRunAllTests:me}}var Tt=/^[a-z][a-z0-9-]*[a-z0-9]$/,Et=new Set([`name`,`load`,`capture`]);function Dt(e){try{let t=b(e);if(t.errors.length>0)return{};let n=t.toJSON(),r=n?.use?.mobile?.appState;return{headless:n?.use?.browser?.headless,device:typeof n?.use?.device==`string`?n.use.device:void 0,appState:r===`preserve`||r===`reset`?r:void 0}}catch{return{}}}function Ot(e){try{let t=b(e);if(t.errors.length>0)return null;let n=t.toJSON()?.use?.authState,r=typeof n==`string`?n.trim():n&&typeof n==`object`&&!Array.isArray(n)&&Object.keys(n).every(e=>Et.has(e))&&(n.load===void 0||typeof n.load==`boolean`)&&(n.capture===void 0||typeof n.capture==`boolean`)&&typeof n.name==`string`?n.name.trim():``;return r&&Tt.test(r)?r:null}catch{return null}}function kt(e){let t=e.targets[e.targetName];if(!t)throw Error(`Selected target "${e.targetName}" was not found in workspace config`);let n=Dt(e.content),r=n.headless??e.globalUse?.browser?.headless;if(t.platform===`web`){if(!t.url)throw Error(`Selected web target "${e.targetName}" is missing a URL`);return{platform:`web`,targetName:e.targetName,url:t.url,headless:r}}return{platform:t.platform,targetName:e.targetName,useDeviceName:n.device,appState:n.appState??e.globalUse?.mobile?.appState,bundleId:t.bundleId,appPackage:t.appPackage,appActivity:t.appActivity,headless:r}}var At=[{namespace:`runJS`,name:`document.title`,label:`Page title`},{namespace:`runJS`,name:`Date.now()`,label:`Current timestamp`},{namespace:`runJS`,name:`window.location.href`,label:`Current URL`},{namespace:`runJS`,name:`document.querySelector('...').textContent`,label:`Extract element text`}];function jt(e){let[t,n]=(0,W.useState)([]),[r,i]=(0,W.useState)([]),[a,o]=(0,W.useState)([]),[s,c]=(0,W.useState)(!1);return(0,W.useEffect)(()=>{let t=!1;c(!0);let r=[ge().then(e=>{t||n(e.keys)}).catch(()=>{t||n([])}),ve().then(e=>{t||i(e.hooks.map(e=>({id:e.id,name:e.name})))}).catch(()=>{t||i([])})];return e&&r.push(z(e).then(e=>{t||o(e.names)}).catch(()=>{t||o([])})),Promise.allSettled(r).then(()=>{t||c(!1)}),()=>{t=!0}},[e]),{suggestions:(0,W.useMemo)(()=>{let e=[];for(let n of t)e.push({namespace:`env`,name:n,label:`env`});for(let t of r)e.push({namespace:`runHook`,name:t.name,label:`hook`,insertValue:t.id,description:t.id});for(let t of a)e.push({namespace:`capture`,name:t,label:`captured`});return e.push(...At),e},[t,r,a]),isLoading:s}}var Mt=/^[a-zA-Z0-9._-]+$/,Nt=/\.(yaml|yml)$/;function Pt(e){return e.trim().replace(/\\/g,`/`).replace(/^\.\//,``)}function Ft(e){let t=Pt(e).replace(/[.+^${}()|[\]\\]/g,`\\$&`).replace(/\?/g,`.`).replace(/\*\*\//g,`__DIRSTAR__`).replace(/\*\*/g,`__DIRSTAR__`).replace(/\*/g,`[^/]*`).replace(/__DIRSTAR__/g,`(?:.*/)?`);return RegExp(`^${t}$`)}function It(e,t){let n=Pt(e);return t.some(e=>Ft(e).test(n))}function Lt(e){let t=e.trim();if(!t)return`Filename is required`;if(t.includes(`..`))return`Path must not contain '..' segments`;if(t.startsWith(`/`))return`Path must be relative, not absolute`;let n=t.split(`/`);for(let e of n){if(!e)return`Path contains empty segment (double slash)`;if(!Mt.test(e))return`Path must contain only letters, numbers, hyphens, dots, underscores, and forward slashes, ending with .yaml or .yml`}let r=n[n.length-1];return Nt.test(r)?null:`File must end with .yaml or .yml`}function Rt(e,t,n){let r=Lt(e);if(r)return r;let i=(t??[]).map(e=>e.trim()).filter(Boolean);return i.length===0?`workspace.${n} must contain at least one pattern`:It(e.trim(),i)?null:`File path must match one of your workspace's ${n} patterns (${i.join(`, `)})`}export{wt as a,Ue as c,Ot as i,Ve as l,jt as n,Q as o,kt as r,lt as s,Rt as t};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{u as e}from"./editor.api2-
|
|
1
|
+
import{u as e}from"./editor.api2-DXR_ThFM.js";var t=[`assign`,`flush`,`ftl`,`return`,`global`,`import`,`include`,`break`,`continue`,`local`,`nested`,`nt`,`setting`,`stop`,`t`,`lt`,`rt`,`fallback`],n=[`attempt`,`autoesc`,`autoEsc`,`compress`,`comment`,`escape`,`noescape`,`function`,`if`,`list`,`items`,`sep`,`macro`,`noparse`,`noParse`,`noautoesc`,`noAutoEsc`,`outputformat`,`switch`,`visit`,`recurse`],r={close:`>`,id:`angle`,open:`<`},i={close:`\\]`,id:`bracket`,open:`\\[`},a={close:`[>\\]]`,id:`auto`,open:`[<\\[]`},o={close:`\\}`,id:`dollar`,open1:`\\$`,open2:`\\{`},s={close:`\\]`,id:`bracket`,open1:`\\[`,open2:`=`};function c(r){return{brackets:[[`<`,`>`],[`[`,`]`],[`(`,`)`],[`{`,`}`]],comments:{blockComment:[`${r.open}--`,`--${r.close}`]},autoCloseBefore:`
|
|
2
2
|
\r }]),.:;=`,autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`,notIn:[`string`]},{open:`'`,close:`'`,notIn:[`string`]}],surroundingPairs:[{open:`"`,close:`"`},{open:`'`,close:`'`},{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`<`,close:`>`}],folding:{markers:{start:RegExp(`${r.open}#(?:${n.join(`|`)})([^/${r.close}]*(?!/)${r.close})[^${r.open}]*$`),end:RegExp(`${r.open}/#(?:${n.join(`|`)})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:RegExp(`${r.open}#(?!(?:${t.join(`|`)}))([a-zA-Z_]+)([^/${r.close}]*(?!/)${r.close})[^${r.open}]*$`),afterText:RegExp(`^${r.open}/#([a-zA-Z_]+)[\\r\\n\\t ]*${r.close}$`),action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`${r.open}#(?!(?:${t.join(`|`)}))([a-zA-Z_]+)([^/${r.close}]*(?!/)${r.close})[^${r.open}]*$`),action:{indentAction:e.IndentAction.Indent}}]}}function l(){return{brackets:[[`<`,`>`],[`[`,`]`],[`(`,`)`],[`{`,`}`]],autoCloseBefore:`
|
|
3
3
|
\r }]),.:;=`,autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`,notIn:[`string`]},{open:`'`,close:`'`,notIn:[`string`]}],surroundingPairs:[{open:`"`,close:`"`},{open:`'`,close:`'`},{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`<`,close:`>`}],folding:{markers:{start:RegExp(`[<\\[]#(?:${n.join(`|`)})([^/>\\]]*(?!/)[>\\]])[^<\\[]*$`),end:RegExp(`[<\\[]/#(?:${n.join(`|`)})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:RegExp(`[<\\[]#(?!(?:${t.join(`|`)}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),afterText:RegExp(`^[<\\[]/#([a-zA-Z_]+)[\\r\\n\\t ]*[>\\]]$`),action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`[<\\[]#(?!(?:${t.join(`|`)}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),action:{indentAction:e.IndentAction.Indent}}]}}function u(e,t){let n=`_${e.id}_${t.id}`,r=e=>e.replace(/__id__/g,n),i=e=>{let t=e.source.replace(/__id__/g,n);return new RegExp(t,e.flags)};return{unicode:!0,includeLF:!1,start:r(`default__id__`),ignoreCase:!1,defaultToken:`invalid`,tokenPostfix:`.freemarker2`,brackets:[{open:`{`,close:`}`,token:`delimiter.curly`},{open:`[`,close:`]`,token:`delimiter.square`},{open:`(`,close:`)`,token:`delimiter.parenthesis`},{open:`<`,close:`>`,token:`delimiter.angle`}],[r(`open__id__`)]:new RegExp(e.open),[r(`close__id__`)]:new RegExp(e.close),[r(`iOpen1__id__`)]:new RegExp(t.open1),[r(`iOpen2__id__`)]:new RegExp(t.open2),[r(`iClose__id__`)]:new RegExp(t.close),[r(`startTag__id__`)]:i(/(@open__id__)(#)/),[r(`endTag__id__`)]:i(/(@open__id__)(\/#)/),[r(`startOrEndTag__id__`)]:i(/(@open__id__)(\/?#)/),[r(`closeTag1__id__`)]:i(/((?:@blank)*)(@close__id__)/),[r(`closeTag2__id__`)]:i(/((?:@blank)*\/?)(@close__id__)/),blank:/[ \t\n\r]/,keywords:[`false`,`true`,`in`,`as`,`using`],directiveStartCloseTag1:/attempt|recover|sep|auto[eE]sc|no(?:autoe|AutoE)sc|compress|default|no[eE]scape|comment|no[pP]arse/,directiveStartCloseTag2:/else|break|continue|return|stop|flush|t|lt|rt|nt|nested|recurse|fallback|ftl/,directiveStartBlank:/if|else[iI]f|list|for[eE]ach|switch|case|assign|global|local|include|import|function|macro|transform|visit|stop|return|call|setting|output[fF]ormat|nested|recurse|escape|ftl|items/,directiveEndCloseTag1:/if|list|items|sep|recover|attempt|for[eE]ach|local|global|assign|function|macro|output[fF]ormat|auto[eE]sc|no(?:autoe|AutoE)sc|compress|transform|switch|escape|no[eE]scape/,escapedChar:/\\(?:[ntrfbgla\\'"\{=]|(?:x[0-9A-Fa-f]{1,4}))/,asciiDigit:/[0-9]/,integer:/[0-9]+/,nonEscapedIdStartChar:/[\$@-Z_a-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u1FFF\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183-\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3006\u3031-\u3035\u303B-\u303C\u3040-\u318F\u31A0-\u31BA\u31F0-\u31FF\u3300-\u337F\u3400-\u4DB5\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,escapedIdChar:/\\[\-\.:#]/,idStartChar:/(?:@nonEscapedIdStartChar)|(?:@escapedIdChar)/,id:/(?:@idStartChar)(?:(?:@idStartChar)|(?:@asciiDigit))*/,specialHashKeys:/\*\*|\*|false|true|in|as|using/,namedSymbols:/<=|>=|\\lte|\\lt|<|\\gte|\\gt|>|&&|\\and|->|->|==|!=|\+=|-=|\*=|\/=|%=|\+\+|--|<=|&&|\|\||:|\.\.\.|\.\.\*|\.\.<|\.\.!|\?\?|=|<|\+|-|\*|\/|%|\||\.\.|\?|!|&|\.|,|;/,arrows:[`->`,`->`],delimiters:[`;`,`:`,`,`,`.`],stringOperators:[`lte`,`lt`,`gte`,`gt`],noParseTags:[`noparse`,`noParse`,`comment`],tokenizer:{[r(`default__id__`)]:[{include:r(`@directive_token__id__`)},{include:r(`@interpolation_and_text_token__id__`)}],[r(`fmExpression__id__.directive`)]:[{include:r(`@blank_and_expression_comment_token__id__`)},{include:r(`@directive_end_token__id__`)},{include:r(`@expression_token__id__`)}],[r(`fmExpression__id__.interpolation`)]:[{include:r(`@blank_and_expression_comment_token__id__`)},{include:r(`@expression_token__id__`)},{include:r(`@greater_operators_token__id__`)}],[r(`inParen__id__.plain`)]:[{include:r(`@blank_and_expression_comment_token__id__`)},{include:r(`@directive_end_token__id__`)},{include:r(`@expression_token__id__`)}],[r(`inParen__id__.gt`)]:[{include:r(`@blank_and_expression_comment_token__id__`)},{include:r(`@expression_token__id__`)},{include:r(`@greater_operators_token__id__`)}],[r(`noSpaceExpression__id__`)]:[{include:r(`@no_space_expression_end_token__id__`)},{include:r(`@directive_end_token__id__`)},{include:r(`@expression_token__id__`)}],[r(`unifiedCall__id__`)]:[{include:r(`@unified_call_token__id__`)}],[r(`singleString__id__`)]:[{include:r(`@string_single_token__id__`)}],[r(`doubleString__id__`)]:[{include:r(`@string_double_token__id__`)}],[r(`rawSingleString__id__`)]:[{include:r(`@string_single_raw_token__id__`)}],[r(`rawDoubleString__id__`)]:[{include:r(`@string_double_raw_token__id__`)}],[r(`expressionComment__id__`)]:[{include:r(`@expression_comment_token__id__`)}],[r(`noParse__id__`)]:[{include:r(`@no_parse_token__id__`)}],[r(`terseComment__id__`)]:[{include:r(`@terse_comment_token__id__`)}],[r(`directive_token__id__`)]:[[i(/(?:@startTag__id__)(@directiveStartCloseTag1)(?:@closeTag1__id__)/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:[{token:`@brackets.directive`},{token:`delimiter.directive`},{cases:{"@noParseTags":{token:`tag`,next:r(`@noParse__id__.$3`)},"@default":{token:`tag`}}},{token:`delimiter.directive`},{token:`@brackets.directive`}]],[i(/(?:@startTag__id__)(@directiveStartCloseTag2)(?:@closeTag2__id__)/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:[{token:`@brackets.directive`},{token:`delimiter.directive`},{token:`tag`},{token:`delimiter.directive`},{token:`@brackets.directive`}]],[i(/(?:@startTag__id__)(@directiveStartBlank)(@blank)/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:[{token:`@brackets.directive`},{token:`delimiter.directive`},{token:`tag`},{token:``,next:r(`@fmExpression__id__.directive`)}]],[i(/(?:@endTag__id__)(@directiveEndCloseTag1)(?:@closeTag1__id__)/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:[{token:`@brackets.directive`},{token:`delimiter.directive`},{token:`tag`},{token:`delimiter.directive`},{token:`@brackets.directive`}]],[i(/(@open__id__)(@)/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:[{token:`@brackets.directive`},{token:`delimiter.directive`,next:r(`@unifiedCall__id__`)}]],[i(/(@open__id__)(\/@)((?:(?:@id)(?:\.(?:@id))*)?)(?:@closeTag1__id__)/),[{token:`@brackets.directive`},{token:`delimiter.directive`},{token:`tag`},{token:`delimiter.directive`},{token:`@brackets.directive`}]],[i(/(@open__id__)#--/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:{token:`comment`,next:r(`@terseComment__id__`)}],[i(/(?:@startOrEndTag__id__)([a-zA-Z_]+)/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:[{token:`@brackets.directive`},{token:`delimiter.directive`},{token:`tag.invalid`,next:r(`@fmExpression__id__.directive`)}]]],[r(`interpolation_and_text_token__id__`)]:[[i(/(@iOpen1__id__)(@iOpen2__id__)/),[{token:t.id===`bracket`?`@brackets.interpolation`:`delimiter.interpolation`},{token:t.id===`bracket`?`delimiter.interpolation`:`@brackets.interpolation`,next:r(`@fmExpression__id__.interpolation`)}]],[/[\$#<\[\{]|(?:@blank)+|[^\$<#\[\{\n\r\t ]+/,{token:`source`}]],[r(`string_single_token__id__`)]:[[/[^'\\]/,{token:`string`}],[/@escapedChar/,{token:`string.escape`}],[/'/,{token:`string`,next:`@pop`}]],[r(`string_double_token__id__`)]:[[/[^"\\]/,{token:`string`}],[/@escapedChar/,{token:`string.escape`}],[/"/,{token:`string`,next:`@pop`}]],[r(`string_single_raw_token__id__`)]:[[/[^']+/,{token:`string.raw`}],[/'/,{token:`string.raw`,next:`@pop`}]],[r(`string_double_raw_token__id__`)]:[[/[^"]+/,{token:`string.raw`}],[/"/,{token:`string.raw`,next:`@pop`}]],[r(`expression_token__id__`)]:[[/(r?)(['"])/,{cases:{"r'":[{token:`keyword`},{token:`string.raw`,next:r(`@rawSingleString__id__`)}],'r"':[{token:`keyword`},{token:`string.raw`,next:r(`@rawDoubleString__id__`)}],"'":[{token:`source`},{token:`string`,next:r(`@singleString__id__`)}],'"':[{token:`source`},{token:`string`,next:r(`@doubleString__id__`)}]}}],[/(?:@integer)(?:\.(?:@integer))?/,{cases:{"(?:@integer)":{token:`number`},"@default":{token:`number.float`}}}],[/(\.)(@blank*)(@specialHashKeys)/,[{token:`delimiter`},{token:``},{token:`identifier`}]],[/(?:@namedSymbols)/,{cases:{"@arrows":{token:`meta.arrow`},"@delimiters":{token:`delimiter`},"@default":{token:`operators`}}}],[/@id/,{cases:{"@keywords":{token:`keyword.$0`},"@stringOperators":{token:`operators`},"@default":{token:`identifier`}}}],[/[\[\]\(\)\{\}]/,{cases:{"\\[":{cases:{"$S2==gt":{token:`@brackets`,next:r(`@inParen__id__.gt`)},"@default":{token:`@brackets`,next:r(`@inParen__id__.plain`)}}},"\\]":{cases:{...t.id===`bracket`?{"$S2==interpolation":{token:`@brackets.interpolation`,next:`@popall`}}:{},...e.id===`bracket`?{"$S2==directive":{token:`@brackets.directive`,next:`@popall`}}:{},[r(`$S1==inParen__id__`)]:{token:`@brackets`,next:`@pop`},"@default":{token:`@brackets`}}},"\\(":{token:`@brackets`,next:r(`@inParen__id__.gt`)},"\\)":{cases:{[r(`$S1==inParen__id__`)]:{token:`@brackets`,next:`@pop`},"@default":{token:`@brackets`}}},"\\{":{cases:{"$S2==gt":{token:`@brackets`,next:r(`@inParen__id__.gt`)},"@default":{token:`@brackets`,next:r(`@inParen__id__.plain`)}}},"\\}":{cases:{...t.id===`bracket`?{}:{"$S2==interpolation":{token:`@brackets.interpolation`,next:`@popall`}},[r(`$S1==inParen__id__`)]:{token:`@brackets`,next:`@pop`},"@default":{token:`@brackets`}}}}}],[/\$\{/,{token:`delimiter.invalid`}]],[r(`blank_and_expression_comment_token__id__`)]:[[/(?:@blank)+/,{token:``}],[/[<\[][#!]--/,{token:`comment`,next:r(`@expressionComment__id__`)}]],[r(`directive_end_token__id__`)]:[[/>/,e.id===`bracket`?{token:`operators`}:{token:`@brackets.directive`,next:`@popall`}],[i(/(\/)(@close__id__)/),[{token:`delimiter.directive`},{token:`@brackets.directive`,next:`@popall`}]]],[r(`greater_operators_token__id__`)]:[[/>/,{token:`operators`}],[/>=/,{token:`operators`}]],[r(`no_space_expression_end_token__id__`)]:[[/(?:@blank)+/,{token:``,switchTo:r(`@fmExpression__id__.directive`)}]],[r(`unified_call_token__id__`)]:[[/(@id)((?:@blank)+)/,[{token:`tag`},{token:``,next:r(`@fmExpression__id__.directive`)}]],[i(/(@id)(\/?)(@close__id__)/),[{token:`tag`},{token:`delimiter.directive`},{token:`@brackets.directive`,next:`@popall`}]],[/./,{token:`@rematch`,next:r(`@noSpaceExpression__id__`)}]],[r(`no_parse_token__id__`)]:[[i(/(@open__id__)(\/#?)([a-zA-Z]+)((?:@blank)*)(@close__id__)/),{cases:{"$S2==$3":[{token:`@brackets.directive`},{token:`delimiter.directive`},{token:`tag`},{token:``},{token:`@brackets.directive`,next:`@popall`}],"$S2==comment":[{token:`comment`},{token:`comment`},{token:`comment`},{token:`comment`},{token:`comment`}],"@default":[{token:`source`},{token:`source`},{token:`source`},{token:`source`},{token:`source`}]}}],[/[^<\[\-]+|[<\[\-]/,{cases:{"$S2==comment":{token:`comment`},"@default":{token:`source`}}}]],[r(`expression_comment_token__id__`)]:[[/--[>\]]/,{token:`comment`,next:`@pop`}],[/[^\->\]]+|[>\]\-]/,{token:`comment`}]],[r(`terse_comment_token__id__`)]:[[i(/--(?:@close__id__)/),{token:`comment`,next:`@popall`}],[/[^<\[\-]+|[<\[\-]/,{token:`comment`}]]}}}function d(e){let t=u(r,e),n=u(i,e),o=u(a,e);return{...t,...n,...o,unicode:!0,includeLF:!1,start:`default_auto_${e.id}`,ignoreCase:!1,defaultToken:`invalid`,tokenPostfix:`.freemarker2`,brackets:[{open:`{`,close:`}`,token:`delimiter.curly`},{open:`[`,close:`]`,token:`delimiter.square`},{open:`(`,close:`)`,token:`delimiter.parenthesis`},{open:`<`,close:`>`,token:`delimiter.angle`}],tokenizer:{...t.tokenizer,...n.tokenizer,...o.tokenizer}}}var f={conf:c(r),language:u(r,o)},p={conf:c(i),language:u(i,o)},m={conf:c(r),language:u(r,s)},h={conf:c(i),language:u(i,s)},g={conf:l(),language:d(o)},_={conf:l(),language:d(s)};export{m as TagAngleInterpolationBracket,f as TagAngleInterpolationDollar,_ as TagAutoInterpolationBracket,g as TagAutoInterpolationDollar,h as TagBracketInterpolationBracket,p as TagBracketInterpolationDollar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Kt as e}from"./index-CXuVkD6-.js";var t=e(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Kt as e}from"./index-CXuVkD6-.js";var t=e(`grip-vertical`,[[`circle`,{cx:`9`,cy:`12`,r:`1`,key:`1vctgf`}],[`circle`,{cx:`9`,cy:`5`,r:`1`,key:`hp0tcf`}],[`circle`,{cx:`9`,cy:`19`,r:`1`,key:`fkjjf6`}],[`circle`,{cx:`15`,cy:`12`,r:`1`,key:`1tmaij`}],[`circle`,{cx:`15`,cy:`5`,r:`1`,key:`19l28e`}],[`circle`,{cx:`15`,cy:`19`,r:`1`,key:`f4zoj3`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e}from"./editor.api2-
|
|
1
|
+
import{u as e}from"./editor.api2-DXR_ThFM.js";var t=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`menuitem`,`meta`,`param`,`source`,`track`,`wbr`],n={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:[`{{!--`,`--}}`]},brackets:[[`<!--`,`-->`],[`<`,`>`],[`{{`,`}}`],[`{`,`}`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],surroundingPairs:[{open:`<`,close:`>`},{open:`"`,close:`"`},{open:`'`,close:`'`}],onEnterRules:[{beforeText:RegExp(`<(?!(?:${t.join(`|`)}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`<(?!(?:${t.join(`|`)}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),action:{indentAction:e.IndentAction.Indent}}]},r={defaultToken:``,tokenPostfix:``,tokenizer:{root:[[/\{\{!--/,`comment.block.start.handlebars`,`@commentBlock`],[/\{\{!/,`comment.start.handlebars`,`@comment`],[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.root`}],[/<!DOCTYPE/,`metatag.html`,`@doctype`],[/<!--/,`comment.html`,`@commentHtml`],[/(<)(\w+)(\/>)/,[`delimiter.html`,`tag.html`,`delimiter.html`]],[/(<)(script)/,[`delimiter.html`,{token:`tag.html`,next:`@script`}]],[/(<)(style)/,[`delimiter.html`,{token:`tag.html`,next:`@style`}]],[/(<)([:\w]+)/,[`delimiter.html`,{token:`tag.html`,next:`@otherTag`}]],[/(<\/)(\w+)/,[`delimiter.html`,{token:`tag.html`,next:`@otherTag`}]],[/</,`delimiter.html`],[/\{/,`delimiter.html`],[/[^<{]+/]],doctype:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.comment`}],[/[^>]+/,`metatag.content.html`],[/>/,`metatag.html`,`@pop`]],comment:[[/\}\}/,`comment.end.handlebars`,`@pop`],[/./,`comment.content.handlebars`]],commentBlock:[[/--\}\}/,`comment.block.end.handlebars`,`@pop`],[/./,`comment.content.handlebars`]],commentHtml:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.comment`}],[/-->/,`comment.html`,`@pop`],[/[^-]+/,`comment.content.html`],[/./,`comment.content.html`]],otherTag:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.otherTag`}],[/\/?>/,`delimiter.html`,`@pop`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.script`}],[/type/,`attribute.name`,`@scriptAfterType`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/>/,{token:`delimiter.html`,next:`@scriptEmbedded.text/javascript`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,[`delimiter.html`,`tag.html`,{token:`delimiter.html`,next:`@pop`}]]],scriptAfterType:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.scriptAfterType`}],[/=/,`delimiter`,`@scriptAfterTypeEquals`],[/>/,{token:`delimiter.html`,next:`@scriptEmbedded.text/javascript`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptAfterTypeEquals:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.scriptAfterTypeEquals`}],[/"([^"]*)"/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.$1`}],[/'([^']*)'/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.$1`}],[/>/,{token:`delimiter.html`,next:`@scriptEmbedded.text/javascript`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptWithCustomType:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.scriptWithCustomType.$S2`}],[/>/,{token:`delimiter.html`,next:`@scriptEmbedded.$S2`,nextEmbedded:`$S2`}],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptEmbedded:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInEmbeddedState.scriptEmbedded.$S2`,nextEmbedded:`@pop`}],[/<\/script/,{token:`@rematch`,next:`@pop`,nextEmbedded:`@pop`}]],style:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.style`}],[/type/,`attribute.name`,`@styleAfterType`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/>/,{token:`delimiter.html`,next:`@styleEmbedded.text/css`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,[`delimiter.html`,`tag.html`,{token:`delimiter.html`,next:`@pop`}]]],styleAfterType:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.styleAfterType`}],[/=/,`delimiter`,`@styleAfterTypeEquals`],[/>/,{token:`delimiter.html`,next:`@styleEmbedded.text/css`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleAfterTypeEquals:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.styleAfterTypeEquals`}],[/"([^"]*)"/,{token:`attribute.value`,switchTo:`@styleWithCustomType.$1`}],[/'([^']*)'/,{token:`attribute.value`,switchTo:`@styleWithCustomType.$1`}],[/>/,{token:`delimiter.html`,next:`@styleEmbedded.text/css`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleWithCustomType:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.styleWithCustomType.$S2`}],[/>/,{token:`delimiter.html`,next:`@styleEmbedded.$S2`,nextEmbedded:`$S2`}],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleEmbedded:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInEmbeddedState.styleEmbedded.$S2`,nextEmbedded:`@pop`}],[/<\/style/,{token:`@rematch`,next:`@pop`,nextEmbedded:`@pop`}]],handlebarsInSimpleState:[[/\{\{\{?/,`delimiter.handlebars`],[/\}\}\}?/,{token:`delimiter.handlebars`,switchTo:`@$S2.$S3`}],{include:`handlebarsRoot`}],handlebarsInEmbeddedState:[[/\{\{\{?/,`delimiter.handlebars`],[/\}\}\}?/,{token:`delimiter.handlebars`,switchTo:`@$S2.$S3`,nextEmbedded:`$S3`}],{include:`handlebarsRoot`}],handlebarsRoot:[[/"[^"]*"/,`string.handlebars`],[/[#/][^\s}]+/,`keyword.helper.handlebars`],[/else\b/,`keyword.helper.handlebars`],[/[\s]+/],[/[^}]/,`variable.parameter.handlebars`]]}};export{n as conf,r as language};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{a as t,i as n,n as r,r as ee,t as te}from"./select-JI5Kadjp.js";import{t as ne}from"./monaco-editor-BQB4vEk_.js";import{a as re,i as ie,n as ae,o as oe,r as se,t as ce}from"./use-hook-run-session-DnSkzl1A.js";import{t as le}from"./refresh-cw-BQdOC6UA.js";import{t as i}from"./label-CYpyu7PJ.js";import{t as ue}from"./switch-BgfA6DyL.js";import{B as a,En as de,G as fe,Pt as pe,R as o,Sc as s,Sr as c,Xt as l,Zt as u,_c as me,cn as he,hr as ge,r as _e,rn as ve,vc as ye,z as be}from"./index-CXuVkD6-.js";import{t as xe}from"./use-page-title-fn79XYtf.js";import{t as d}from"./dist-Cy8QoEce.js";import{i as Se,n as f,r as Ce,t as we}from"./hook-runtime-8xwsNog-.js";import{t as Te}from"./scroll-area-WFIgUp-0.js";import{t as Ee}from"./empty-state-2mwYYmoQ.js";var p=e(s(),1),m=l();function De({title:e,body:t,tone:n=`warning`,children:r}){return(0,m.jsxs)(`div`,{className:`rounded-sm border px-4 py-3 text-sm ${n===`error`?`border-destructive/30 bg-destructive/10`:n===`neutral`?`border-border bg-muted/40`:`border-amber-500/30 bg-amber-500/10`}`,children:[(0,m.jsx)(`div`,{className:`font-medium text-foreground`,children:e}),(0,m.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:t}),r?(0,m.jsx)(`div`,{className:`mt-3`,children:r}):null]})}function Oe(e){if(e===0)return`0ms`;for(let t of[{suffix:`d`,value:864e5},{suffix:`h`,value:36e5},{suffix:`m`,value:6e4},{suffix:`s`,value:1e3}])if(e%t.value===0)return`${e/t.value}${t.suffix}`;return`${e}ms`}function h(e){return JSON.stringify({name:e.name,runtime:e.runtime,file:e.file,timeout:e.timeout,network:e.network,source:e.source})}function g(e,t){return e.find(e=>e.field===t)??null}function ke(e){return Array.isArray(e)}function Ae(e){switch(e){case`javascript`:return`JavaScript`;case`typescript`:return`TypeScript`;case`python`:return`Python`;case`shell`:return`Shell`;default:return e}}function _(){let{id:e}=ye(),s=me(),l=fe(),_=!e,v=e??``,y=(0,p.useMemo)(()=>f(`node`),[]),b=(0,p.useRef)(_?d():v),[x,S]=(0,p.useState)(b.current),[C,w]=(0,p.useState)(``),[T,E]=(0,p.useState)(`node`),[D,O]=(0,p.useState)(y.file),[k,A]=(0,p.useState)(`30s`),[j,M]=(0,p.useState)(!0),[N,P]=(0,p.useState)(y.source),[F,I]=(0,p.useState)([]),[je,L]=(0,p.useState)(!_),[Me,R]=(0,p.useState)(!1),[Ne,Pe]=(0,p.useState)(!1),[Fe,z]=(0,p.useState)(null),[Ie,B]=(0,p.useState)([]),[Le,V]=(0,p.useState)(null),[Re,ze]=(0,p.useState)(!1),[Be,Ve]=(0,p.useState)(!1),[He,Ue]=(0,p.useState)(()=>h({name:``,runtime:`node`,file:y.file,timeout:`30s`,network:!0,source:y.source})),H=(0,p.useRef)(y.file),U=(0,p.useRef)(y.source);xe(_?`New Hook`:C.trim()||`Hook`);let W=h({name:C,runtime:T,file:D,timeout:k,network:j,source:N})!==He,We=F.find(e=>e.code===`file_missing`)??null,G=ce({hookId:x}),K=Se(T),Ge=Ae(K),q=(0,p.useMemo)(()=>_||!x||W?`Save this hook to run the latest changes.`:F.length>0?F.map(e=>e.message).join(` `):null,[F,x,_,W]);(0,p.useEffect)(()=>{if(_){S(b.current),R(!1);return}let e=!1;return L(!0),de(v).then(t=>{if(e)return;let n=Oe(t.hook.timeout),r=t.source??``;S(t.hook.id),w(t.hook.name),E(t.hook.runtime),O(t.hook.file),A(n),M(t.hook.network),P(r),I(t.fieldErrors),z(null),V(null),B([]),R(!1),Ue(h({name:t.hook.name,runtime:t.hook.runtime,file:t.hook.file,timeout:n,network:t.hook.network,source:r})),H.current=t.hook.file,U.current=r}).catch(t=>{if(!e){if(t instanceof u&&t.status===404){R(!0);return}z(t instanceof Error?t.message:`Failed to load hook`)}}).finally(()=>{e||L(!1)}),()=>{e=!0}},[_,v]);function Ke(e){if(_){let t=f(e,C);(D===H.current||!D.trim())&&O(t.file),(N===U.current||!N.trim())&&P(t.source),H.current=t.file,U.current=t.source}E(e)}function qe(e){if(w(e),!_)return;let t=f(T,e);(D===H.current||!D.trim())&&O(t.file),H.current=t.file}function Je(){if(!_)return;let e=d();b.current=e,S(e)}async function Ye(){Pe(!0),z(null),V(null),B([]);let e={hook:{id:x,name:C.trim(),runtime:T,file:D.trim(),timeout:k.trim(),network:j},source:N};try{let t=_?await ve(e):await ge(x,e),n=Oe(t.hook.timeout),r=t.source??N;S(t.hook.id),w(t.hook.name),E(t.hook.runtime),O(t.hook.file),A(n),M(t.hook.network),P(r),I(t.fieldErrors),Ue(h({name:t.hook.name,runtime:t.hook.runtime,file:t.hook.file,timeout:n,network:t.hook.network,source:r})),H.current=t.hook.file,U.current=r,_&&s(c.hookEdit(t.hook.id),{replace:!0})}catch(e){if(e instanceof u){let t=e.payload?.error,n=e.payload?.fieldErrors;t===`validation_failed`&&ke(n)?(I(n),z(`Couldn't save this hook. Fix the highlighted issues and try again.`)):z(e.message)}else z(e instanceof Error?e.message:`Failed to save hook`)}finally{Pe(!1)}}async function Xe(e=!1){if(!(_||!x)){ze(!0),V(null);try{await he(x,{force:e}),s(c.hooks)}catch(e){if(e instanceof u){let t=e.payload?.error,n=e.payload?.references;if(t===`hook_in_use`&&Array.isArray(n)){B(n);return}V(e.message)}else V(e instanceof Error?e.message:`Failed to delete hook`)}finally{ze(!1)}}}function Ze(){V(null),B([]),Ve(!0)}function Qe(e){Ve(e),e||(V(null),B([]))}async function $e(){q||await G.submitRun()}if(je)return(0,m.jsx)(_e,{});if(Me)return(0,m.jsx)(Ee,{icon:pe,title:`Hook not found`,description:`This hook doesn't exist or could not be loaded.`,actionLabel:`View All Hooks`,onAction:()=>s(c.hooks)});let J=g(F,`name`),Y=g(F,`runtime`),X=g(F,`file`),Z=g(F,`timeout`),Q=g(F,`network`),$=(0,m.jsxs)(`div`,{className:a(`p-3`,l?`space-y-3`:`flex h-full min-h-0 flex-col gap-3 overflow-hidden`),children:[(0,m.jsxs)(`div`,{className:`space-y-3 shrink-0`,children:[Fe?(0,m.jsx)(De,{title:`Couldn't save this hook.`,body:Fe,tone:`error`}):null,We?(0,m.jsx)(De,{title:`Hook file missing`,body:`This hook is still registered, but its source file can't be found. Update the path or recreate the file, then save again.`}):null,(0,m.jsxs)(`section`,{className:`space-y-3`,children:[(0,m.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,m.jsx)(i,{htmlFor:`hook-name`,children:`Hook name`}),(0,m.jsx)(o,{id:`hook-name`,value:C,onChange:e=>qe(e.currentTarget.value),placeholder:`Capture auth session`,"aria-invalid":!!J}),J?(0,m.jsx)(`p`,{className:`text-xs text-destructive`,children:J.message}):null]}),_?(0,m.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,m.jsx)(i,{htmlFor:`hook-id`,children:`Hook ID`}),(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(o,{id:`hook-id`,value:x,readOnly:!0,disabled:!0,"aria-label":`Hook ID`}),(0,m.jsx)(be,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:Je,"aria-label":`Generate new hook ID`,children:(0,m.jsx)(le,{className:`size-3.5`})})]})]}):null,(0,m.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,m.jsx)(i,{htmlFor:`hook-file`,children:`File path`}),(0,m.jsx)(o,{id:`hook-file`,value:D,onChange:e=>O(e.currentTarget.value),placeholder:`./hooks/login.js`,"aria-invalid":!!X}),X?(0,m.jsx)(`p`,{className:`text-xs text-destructive`,children:X.message}):null]}),(0,m.jsxs)(`div`,{className:`grid gap-3 md:grid-cols-[minmax(0,1fr)_minmax(0,0.8fr)_minmax(0,0.8fr)]`,children:[(0,m.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,m.jsx)(i,{htmlFor:`hook-runtime`,children:`Runtime`}),(0,m.jsxs)(te,{value:T,onValueChange:e=>Ke(e),children:[(0,m.jsx)(n,{id:`hook-runtime`,"aria-invalid":!!Y,children:(0,m.jsx)(t,{placeholder:`Runtime`})}),(0,m.jsx)(r,{children:we.map(e=>(0,m.jsx)(ee,{value:e,children:Ce(e).label},e))})]}),Y?(0,m.jsx)(`p`,{className:`text-xs text-destructive`,children:Y.message}):null]}),(0,m.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,m.jsx)(i,{htmlFor:`hook-timeout`,children:`Timeout`}),(0,m.jsx)(o,{id:`hook-timeout`,value:k,onChange:e=>A(e.currentTarget.value),placeholder:`5s`,"aria-invalid":!!Z}),(0,m.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Examples: 5s, 10m, 250ms`}),Z?(0,m.jsx)(`p`,{className:`text-xs text-destructive`,children:Z.message}):null]}),(0,m.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,m.jsx)(i,{htmlFor:`hook-network`,children:`Network`}),(0,m.jsxs)(`div`,{className:`flex h-10 items-center justify-between rounded-sm border bg-background/70 px-3`,children:[(0,m.jsx)(`span`,{className:`text-sm text-foreground`,children:j?`Enabled`:`Disabled`}),(0,m.jsx)(ue,{id:`hook-network`,checked:j,onCheckedChange:M,"aria-invalid":!!Q})]}),Q?(0,m.jsx)(`p`,{className:`text-xs text-destructive`,children:Q.message}):null]})]})]})]}),(0,m.jsxs)(`section`,{className:a(`space-y-2`,l?``:`flex min-h-[300px] flex-1 flex-col overflow-hidden`),children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Source`}),(0,m.jsx)(`span`,{className:`rounded-sm border px-1.5 py-0.5 text-[11px] text-muted-foreground`,children:Ge})]}),(0,m.jsx)(ne,{value:N,onChange:P,onSave:Ye,language:K,className:a(`rounded-sm`,l?`h-[360px] min-h-[320px]`:`h-full min-h-[300px] flex-1`)})]})]}),et=l?(0,m.jsx)(Te,{className:`h-full`,children:$}):$,tt=(0,m.jsx)(se,{baselineCount:G.baselineVariables.length,baselineFilePath:G.baselineFilePath,baselineInfo:G.baselineInfo,isBaselineLoading:G.isBaselineLoading,overrideRows:G.overrideRows,overridingRowIds:G.overridingRowIds,recentRuns:G.recentRuns,selectedRunId:G.selectedRunId,isRunning:G.isRunning,runDisabledReason:q,runError:G.runError,onAddOverride:()=>G.addOverrideRow(),onUpdateOverride:G.updateOverrideRow,onRemoveOverride:G.removeOverrideRow,onRun:()=>{$e()},onSelectRun:G.selectRun}),nt=(0,m.jsx)(ie,{selectedRun:G.selectedRun});return(0,m.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,m.jsx)(re,{hookName:C.trim()||`New Hook`,isCreateMode:_,mode:`edit`,hookHref:_?void 0:c.hookView(x),editHref:_?void 0:c.hookEdit(x),unsaved:W,isSaving:Ne,isRunning:G.isRunning,isDeleting:Re,onSave:Ye,onRun:_?void 0:()=>{$e()},runDisabled:!!q,onDelete:_?void 0:Ze}),(0,m.jsx)(ae,{isMobile:l,leftPane:et,rightTopPane:tt,rightBottomPane:nt}),_?null:(0,m.jsx)(oe,{open:Be,onOpenChange:Qe,hook:{id:x,name:C.trim()||`Hook`,runtime:T,file:D},isDeleting:Re,deleteError:Le,blockedReferences:Ie,onDelete:()=>{Xe(!1)},onForceDelete:()=>{Xe(!0)}})]})}export{_ as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{E as e,Xt as t}from"./index-CXuVkD6-.js";function n(t){return e({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M432 32H80a64.07 64.07 0 0 0-64 64v320a64.07 64.07 0 0 0 64 64h352a64.07 64.07 0 0 0 64-64V96a64.07 64.07 0 0 0-64-64zM96 256a16 16 0 0 1-10-28.49L150.39 176 86 124.49a16 16 0 1 1 20-25l80 64a16 16 0 0 1 0 25l-80 64A16 16 0 0 1 96 256zm160 0h-64a16 16 0 0 1 0-32h64a16 16 0 0 1 0 32z`},child:[]}]})(t)}function r(t){return e({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M314 36.38c-18.59-3.06-45.8-4.47-64.27-4.38a311.09 311.09 0 0 0-51.66 4.38c-45.74 8-54.07 24.7-54.07 55.54V128h112v16H107.62C66.06 144 32.33 193.67 32 255.12v.88a162.91 162.91 0 0 0 3.13 32c9.29 46.28 38.23 80 72.49 80H128v-54c0-31.3 20.84-59.95 55-66.1l9.87-1.23H314a56.05 56.05 0 0 0 15.06-2A52.48 52.48 0 0 0 368 193.68V91.92c0-28.92-24.68-50.73-54-55.54zM194.93 105.5a20.37 20.37 0 1 1 20.3-20.3 20.29 20.29 0 0 1-20.3 20.3z`},child:[]},{tag:`path`,attr:{d:`M475.28 217c-10.7-42.61-38.41-73-70.9-73h-17.71v47.45c0 39.57-26 68.22-57.74 73.13a63.54 63.54 0 0 1-9.69.75H198.08a60 60 0 0 0-15.23 1.95C160.54 273.14 144 291.7 144 315.77v101.77c0 29 29.14 46 57.73 54.31 34.21 9.95 71.48 11.75 112.42 0 27.19-7.77 53.85-23.48 53.85-54.31V384H256v-16h148.38c29.44 0 54.95-24.93 67.45-61.31A156.83 156.83 0 0 0 480 256a160.64 160.64 0 0 0-4.72-39zM316.51 404a20.37 20.37 0 1 1-20.3 20.3 20.29 20.29 0 0 1 20.3-20.3z`},child:[]}]})(t)}function i(t){return e({tag:`svg`,attr:{viewBox:`0 0 512 512`},child:[{tag:`path`,attr:{d:`M429.76 130.07 274.33 36.85a37 37 0 0 0-36.65 0L82.24 130.06A38.2 38.2 0 0 0 64 162.83V349a38.26 38.26 0 0 0 18.24 32.8L123 406.14l.23.13c20.58 10.53 28.46 10.53 37.59 10.53 32.14 0 52.11-20.8 52.11-54.29V182a8.51 8.51 0 0 0-8.42-8.58h-22.38a8.51 8.51 0 0 0-8.42 8.58v180.51a15 15 0 0 1-6.85 13.07c-5.9 3.6-14.47 2.84-24.14-2.15l-39.06-23.51a1.1 1.1 0 0 1-.48-.92V165.46a1.32 1.32 0 0 1 .59-1.06l151.84-93a.82.82 0 0 1 .73 0l151.93 93a1.34 1.34 0 0 1 .55 1.1V349a1.28 1.28 0 0 1-.45 1l-152.06 90.65a1.22 1.22 0 0 1-.8 0l-38.83-23.06a7.8 7.8 0 0 0-7.83-.41l-.34.2c-10.72 6.35-13.6 8-23.54 11.62-1.62.59-5.43 2-5.76 5.77s3.29 6.45 6.51 8.32l51.9 31.87a35.67 35.67 0 0 0 18.3 5.07h.58a35.87 35.87 0 0 0 17.83-5.07l155.43-93.13A38.37 38.37 0 0 0 448 349V162.83a38.21 38.21 0 0 0-18.24-32.76z`},child:[]},{tag:`path`,attr:{d:`M307.88 318.05c-37.29 0-45.24-10.42-47.6-27.24a8.43 8.43 0 0 0-8.22-7.32h-19.8a8.44 8.44 0 0 0-8.26 8.58c0 14.58 5.12 62.17 83.92 62.17 24.38 0 44.66-5.7 58.63-16.49S388 311.26 388 292.55c0-37.55-24.5-47.83-72.75-54.55-49.05-6.82-49.05-10.29-49.05-17.89 0-5.47 0-18.28 35.46-18.28 25.23 0 38.74 3.19 43.06 20a8.35 8.35 0 0 0 8.06 6.67h19.87a8.24 8.24 0 0 0 6.16-2.86 8.91 8.91 0 0 0 2.12-6.44c-2.57-35.55-28.56-53.58-79.24-53.58-46.06 0-73.55 20.75-73.55 55.5 0 38.1 28.49 48.87 71.29 53.33 50 5.17 50 12.71 50 19.37.03 10.38-4.28 24.23-41.55 24.23z`},child:[]}]})(t)}var a=t();function o({className:e}){return(0,a.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,className:e,children:(0,a.jsx)(`path`,{fill:`currentColor`,d:`M11.966 22.566c6.609 0 11.966-4.326 11.966-9.661 0-3.308-2.051-6.23-5.204-7.963-1.283-.713-2.291-1.353-3.13-1.885-1.58-1.004-2.555-1.623-3.632-1.623-1.094 0-2.327.783-3.955 1.816a49.78 49.78 0 0 1-2.808 1.692C2.051 6.675 0 9.597 0 12.905c0 5.335 5.357 9.66 11.966 9.66Zm-1.397-17.83a5.885 5.885 0 0 0 .497-2.403c0-.144.201-.186.229-.028.656 2.775-.9 4.15-2.051 4.61-.124.048-.199-.12-.103-.208a5.748 5.748 0 0 0 1.428-1.971Zm2.052-.102a5.795 5.795 0 0 0-.78-2.3v-.015c-.068-.123.086-.263.185-.172 1.956 2.105 1.303 4.055.554 5.037-.082.102-.229-.003-.188-.126a5.837 5.837 0 0 0 .229-2.424Zm1.771-.559a5.708 5.708 0 0 0-1.607-1.801V2.26c-.112-.085-.024-.274.113-.218 2.588 1.084 2.766 3.171 2.452 4.395a.116.116 0 0 1-.048.071.11.11 0 0 1-.153-.026.118.118 0 0 1-.022-.083 5.864 5.864 0 0 0-.735-2.324Zm-5.072.559c-.616.544-1.279.758-2.058.997-.116 0-.194-.078-.155-.18 1.747-.907 2.369-1.645 2.99-2.771 0 0 .155-.117.188.085 0 .303-.348 1.325-.965 1.869Zm4.931 11.205a2.949 2.949 0 0 1-.935 1.549 2.16 2.16 0 0 1-1.282.618 2.167 2.167 0 0 1-1.323-.618 2.95 2.95 0 0 1-.923-1.549.243.243 0 0 1 .064-.197.23.23 0 0 1 .192-.069h3.954a.226.226 0 0 1 .19.07.239.239 0 0 1 .063.196Zm-5.443-2.17a1.85 1.85 0 0 1-2.377-.244 1.969 1.969 0 0 1-.233-2.44c.207-.318.502-.565.846-.711a1.84 1.84 0 0 1 1.089-.11c.365.075.701.26.964.53.264.27.443.616.515.99a1.98 1.98 0 0 1-.108 1.118 1.923 1.923 0 0 1-.696.866Zm8.471.005a1.849 1.849 0 0 1-2.374-.252 1.956 1.956 0 0 1-.546-1.362c0-.383.11-.758.319-1.076.207-.318.502-.566.847-.711a1.84 1.84 0 0 1 1.09-.108c.366.076.702.261.965.533s.44.617.512.993a1.98 1.98 0 0 1-.113 1.118 1.922 1.922 0 0 1-.7.865Z`})})}var s=[`node`,`bun`,`python`,`bash`],c={node:i,bun:o,python:r,bash:n},l={node:{label:`Node.js`,shortLabel:`JS`,icon:c.node,monacoLanguage:`javascript`,extension:`.js`,template:[`const fs = require('node:fs')`,``,`const envLines = [`,` 'HOOK_STATUS=ready',`,` 'HOOK_RUNTIME=node',`,`].join('\\n')`,``,"fs.writeFileSync('/tmp/agent-qa.env', `${envLines}\\n`)",`console.log('Hook wrote HOOK_STATUS and HOOK_RUNTIME to /tmp/agent-qa.env')`,`console.error('Sample stderr: replace with warnings or debug details when needed')`,``].join(`
|
|
2
2
|
`)},bun:{label:`Bun`,shortLabel:`BUN`,icon:c.bun,monacoLanguage:`typescript`,extension:`.ts`,template:[`const envLines = [`,` 'HOOK_STATUS=ready',`,` 'HOOK_RUNTIME=bun',`,`].join('\\n')`,``,"await Bun.write('/tmp/agent-qa.env', `${envLines}\\n`)",`console.log('Hook wrote HOOK_STATUS and HOOK_RUNTIME to /tmp/agent-qa.env')`,`console.error('Sample stderr: replace with warnings or debug details when needed')`,``].join(`
|
|
3
3
|
`)},python:{label:`Python`,shortLabel:`PY`,icon:c.python,monacoLanguage:`python`,extension:`.py`,template:[`from pathlib import Path`,`import sys`,``,`env_lines = '\\n'.join([`,` 'HOOK_STATUS=ready',`,` 'HOOK_RUNTIME=python',`,`]) + '\\n'`,``,`Path('/tmp/agent-qa.env').write_text(env_lines, encoding='utf-8')`,`print('Hook wrote HOOK_STATUS and HOOK_RUNTIME to /tmp/agent-qa.env')`,`print('Sample stderr: replace with warnings or debug details when needed', file=sys.stderr)`,``].join(`
|
|
4
4
|
`)},bash:{label:`Bash`,shortLabel:`SH`,icon:c.bash,monacoLanguage:`shell`,extension:`.sh`,template:[`#!/usr/bin/env bash`,`set -euo pipefail`,``,`cat > /tmp/agent-qa.env <<'EOF'`,`HOOK_STATUS=ready`,`HOOK_RUNTIME=bash`,`EOF`,``,`echo 'Hook wrote HOOK_STATUS and HOOK_RUNTIME to /tmp/agent-qa.env'`,`echo 'Sample stderr: replace with warnings or debug details when needed' >&2`,``].join(`
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./chunk-CilyBKbf.js";import{t}from"./monaco-editor-BQB4vEk_.js";import{a as n,i as r,n as ee,o as te,r as ne,t as re}from"./use-hook-run-session-DnSkzl1A.js";import{t as ie}from"./wrench-y-wKZ-0A.js";import{B as i,En as ae,G as oe,Pt as a,Sc as o,Sr as s,U as se,Xt as c,Zt as l,_c as ce,cn as le,k as ue,r as u,vc as d,yc as f}from"./index-CXuVkD6-.js";import{t as p}from"./use-page-title-fn79XYtf.js";import{t as m}from"./badge-B-yh3kbi.js";import{i as h,r as g}from"./hook-runtime-8xwsNog-.js";import{t as de}from"./scroll-area-WFIgUp-0.js";import{t as _}from"./empty-state-2mwYYmoQ.js";import{t as fe}from"./use-keyboard-shortcuts-befVnBO6.js";var v=e(o(),1),y=c(),b=[`overview`,`source`,`run`];function x(e){return e!==null&&b.includes(e)}function pe(e){let t=e.get(`tab`);return x(t)?t:`overview`}function S({title:e,body:t,tone:n=`warning`}){return(0,y.jsxs)(`div`,{className:`rounded-sm border px-4 py-3 text-sm ${n===`error`?`border-destructive/30 bg-destructive/10`:n===`neutral`?`border-border bg-muted/40`:`border-amber-500/30 bg-amber-500/10`}`,children:[(0,y.jsx)(`div`,{className:`font-medium text-foreground`,children:e}),(0,y.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:t})]})}function C({fileMissing:e}){return e?(0,y.jsx)(m,{variant:`outline`,className:`border-amber-500/30 text-amber-600`,children:`File missing`}):(0,y.jsx)(m,{variant:`outline`,className:`border-emerald-500/30 text-emerald-600`,children:`Ready`})}function w({label:e,value:t,mono:n=!1}){return(0,y.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,y.jsx)(`div`,{className:`text-xs font-semibold uppercase tracking-wide text-muted-foreground`,children:e}),(0,y.jsx)(`div`,{className:n?`font-mono text-xs text-foreground break-all`:`text-sm text-foreground`,children:t})]})}function T(){let{id:e}=d(),o=ce(),[c,m]=f(),b=e??``,x=oe(),[T,E]=(0,v.useState)(null),[me,D]=(0,v.useState)(!0),[O,k]=(0,v.useState)(!1),[A,j]=(0,v.useState)(null),[M,N]=(0,v.useState)(!1),[P,F]=(0,v.useState)(null),[I,L]=(0,v.useState)([]),[R,z]=(0,v.useState)(!1),[he,B]=(0,v.useState)(!1),V=(0,v.useRef)(null),H=(0,v.useRef)(null),U=(0,v.useRef)(c.has(`tab`)?pe(c):null),W=re({hookId:b});(0,v.useEffect)(()=>{if(c.has(`tab`)){let e=new URLSearchParams(c);e.delete(`tab`),m(e,{replace:!0})}},[c,m]),(0,v.useEffect)(()=>{let e=!1;return D(!0),k(!1),j(null),ae(b).then(t=>{e||E(t)}).catch(t=>{if(!e){if(E(null),t instanceof l&&t.status===404){k(!0);return}j(t instanceof Error?t.message:`Failed to load hook`)}}).finally(()=>{e||D(!1)}),()=>{e=!0}},[b]),p(T?.hook.name??`Hook`);let G=(0,v.useMemo)(()=>T?g(T.hook.runtime):null,[T]),K=G?.icon,q=T?.fieldErrors.some(e=>e.code===`file_missing`)??!1,J=T?.fieldErrors.filter(e=>e.code!==`file_missing`)??[],Y=(0,v.useMemo)(()=>T?T.fieldErrors.length===0?null:T.fieldErrors.map(e=>e.message).join(` `):`Hook details are still loading.`,[T]),X=(0,v.useCallback)(async()=>{H.current?.scrollIntoView?.({block:`start`}),!Y&&await W.submitRun()},[Y,W]),ge=(0,v.useCallback)(()=>{F(null),L([]),N(!0)},[]),_e=(0,v.useCallback)(e=>{N(e),e||(F(null),L([]))},[]),Z=(0,v.useCallback)(async(e=!1)=>{if(b){z(!0),F(null);try{await le(b,{force:e}),o(s.hooks)}catch(e){if(e instanceof l){let t=e.payload?.error,n=e.payload?.references;if(t===`hook_in_use`&&Array.isArray(n)){L(n);return}F(e.message)}else F(e instanceof Error?e.message:`Failed to delete hook`)}finally{z(!1)}}},[b,o]),Q=s.hookEdit(b);if(fe({e:()=>{T&&o(Q)},r:()=>{X()},"shift+?":()=>B(e=>!e)}),(0,v.useEffect)(()=>{!T||!U.current||(U.current===`source`&&V.current?.scrollIntoView?.({block:`start`}),U.current===`run`&&H.current?.scrollIntoView?.({block:`start`}),U.current=null)},[T]),me)return(0,y.jsx)(u,{});if(O)return(0,y.jsx)(_,{icon:ie,title:`Hook not found`,description:`This hook doesn't exist or could not be loaded.`,actionLabel:`View All Hooks`,onAction:()=>o(s.hooks)});if(!T)return(0,y.jsx)(_,{icon:a,title:`Hook couldn't be loaded`,description:A??`This hook could not be loaded right now.`,actionLabel:`View All Hooks`,onAction:()=>o(s.hooks)});let $=(0,y.jsxs)(`div`,{className:i(`p-3`,x?`space-y-3`:`flex h-full min-h-0 flex-col gap-3 overflow-hidden`),children:[(0,y.jsxs)(`div`,{className:`space-y-3 shrink-0`,children:[A?(0,y.jsx)(S,{title:`Hook could not be loaded`,body:A,tone:`error`}):null,q?(0,y.jsx)(S,{title:`Hook file missing`,body:`This hook is still registered, but its source file can't be found. Update the path or recreate the file, then save again.`}):null,J.length>0?(0,y.jsx)(S,{title:`Hook has recoverable authoring issues`,body:J.map(e=>e.message).join(` `)}):null,(0,y.jsxs)(`section`,{className:`space-y-3`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[(0,y.jsxs)(`div`,{className:`space-y-1`,children:[(0,y.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Hook`}),(0,y.jsx)(`div`,{className:`text-base font-semibold text-foreground`,children:T.hook.name})]}),(0,y.jsx)(C,{fileMissing:q})]}),(0,y.jsxs)(`div`,{className:`grid gap-x-5 gap-y-3 sm:grid-cols-2`,children:[(0,y.jsx)(w,{label:`File`,value:T.hook.file,mono:!0}),(0,y.jsx)(w,{label:`Hook ID`,value:T.hook.id,mono:!0}),(0,y.jsx)(w,{label:`Runtime`,value:(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[K?(0,y.jsx)(K,{className:`h-4 w-4 text-muted-foreground`}):null,(0,y.jsx)(`span`,{children:G?.label??T.hook.runtime})]})}),(0,y.jsx)(w,{label:`Timeout`,value:se(T.hook.timeout)}),(0,y.jsx)(w,{label:`Network`,value:T.hook.network?`Enabled`:`Disabled`}),(0,y.jsx)(w,{label:`Health`,value:(0,y.jsx)(C,{fileMissing:q})})]})]})]}),(0,y.jsxs)(`section`,{ref:V,className:i(`space-y-2`,x?``:`flex min-h-[300px] flex-1 flex-col overflow-hidden`),children:[(0,y.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide text-muted-foreground`,children:`Source`}),T.source?(0,y.jsx)(t,{value:T.source,onChange:()=>{},readOnly:!0,language:h(T.hook.runtime),className:i(`rounded-sm`,x?`h-[360px] min-h-[320px]`:`h-full min-h-[300px] flex-1`)}):(0,y.jsx)(`div`,{className:i(`flex items-center justify-center rounded-sm border border-dashed px-6 py-12 text-center`,x?`min-h-[320px]`:`min-h-[300px] flex-1`),children:(0,y.jsxs)(`div`,{children:[(0,y.jsx)(a,{className:`mx-auto h-5 w-5 text-muted-foreground`}),(0,y.jsx)(`div`,{className:`mt-3 text-sm font-medium text-foreground`,children:`No hook source found for this record.`}),(0,y.jsx)(`div`,{className:`mt-1 text-sm text-muted-foreground`,children:`Update the path or recreate the file in edit mode.`})]})})]})]}),ve=x?(0,y.jsx)(de,{className:`h-full`,children:$}):$,ye=(0,y.jsx)(`div`,{ref:H,className:`h-full`,children:(0,y.jsx)(ne,{baselineCount:W.baselineVariables.length,baselineFilePath:W.baselineFilePath,baselineInfo:W.baselineInfo,isBaselineLoading:W.isBaselineLoading,overrideRows:W.overrideRows,overridingRowIds:W.overridingRowIds,recentRuns:W.recentRuns,selectedRunId:W.selectedRunId,isRunning:W.isRunning,runDisabledReason:Y,runError:W.runError,onAddOverride:()=>W.addOverrideRow(),onUpdateOverride:W.updateOverrideRow,onRemoveOverride:W.removeOverrideRow,onRun:()=>{X()},onSelectRun:W.selectRun})}),be=(0,y.jsx)(r,{selectedRun:W.selectedRun});return(0,y.jsx)(ue,{children:(0,y.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,y.jsx)(n,{hookName:T.hook.name,isCreateMode:!1,mode:`view`,hookHref:s.hookView(T.hook.id),editHref:s.hookEdit(T.hook.id),isRunning:W.isRunning,onRun:()=>{X()},runDisabled:!!Y,onDelete:ge,isDeleting:R,shortcutsOpen:he,onToggleShortcuts:()=>B(e=>!e)}),(0,y.jsx)(ee,{isMobile:x,leftPane:ve,rightTopPane:ye,rightBottomPane:be}),(0,y.jsx)(te,{open:M,onOpenChange:_e,hook:{id:T.hook.id,name:T.hook.name,runtime:T.hook.runtime,file:T.hook.file},isDeleting:R,deleteError:P,blockedReferences:I,onDelete:()=>{Z(!1)},onForceDelete:()=>{Z(!0)}})]})})}export{T as default};
|
|
@@ -0,0 +1 @@
|
|
|
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{t as s}from"./file-code-BTJCyvvJ.js";import{n as c,r as l}from"./shortcut-hints-_J-i7rAL.js";import{t as u}from"./plus-DNc2RueT.js";import{A as d,B as f,D as ee,O as te,R as ne,Sc as p,Sr as m,Tn as h,U as re,Xt as g,_c as ie,a as ae,k as oe,yc as _,z as v}from"./index-CXuVkD6-.js";import{t as se}from"./use-page-title-fn79XYtf.js";import{t as y}from"./badge-B-yh3kbi.js";import{a as ce,i as b,n as le,o as x,r as S,t as ue}from"./table-e38rtLis.js";import{r as C,t as de}from"./hook-runtime-8xwsNog-.js";import{n as fe,t as pe}from"./scroll-area-WFIgUp-0.js";import{t as me}from"./empty-state-2mwYYmoQ.js";import{t as he}from"./use-keyboard-shortcuts-befVnBO6.js";var w=e(p(),1),T=new Set([`asc`,`desc`]);function E(e){let t=new URLSearchParams;return e.search&&t.set(`search`,e.search),e.runtime&&t.set(`runtime`,e.runtime),e.health&&t.set(`health`,e.health),e.sort&&(t.set(`sort`,e.sort),t.set(`order`,e.order)),t}function ge(){let[e,t]=_(),n=e.get(`search`)??``,r=e.get(`runtime`)??``,i=e.get(`health`)??``,a=e.get(`sort`)??``,o=e.get(`order`)??`asc`,s=T.has(o)?o:`asc`,c=(0,w.useMemo)(()=>a?[{id:a,desc:s===`desc`}]:[],[a,s]),l=(0,w.useRef)(c);l.current=c;let u=(0,w.useMemo)(()=>({search:n,runtime:r,health:i,sort:a,order:s}),[n,r,i,a,s]);(0,w.useEffect)(()=>{let n=E(u);n.toString()!==e.toString()&&t(n,{replace:!0})},[e,t,u]);let d=(0,w.useCallback)(e=>{t(E({...u,...e}),{replace:!0})},[t,u]);return{search:n,runtime:r,health:i,sort:a,order:s,sorting:c,onSortingChange:(0,w.useCallback)(e=>{let t=typeof e==`function`?e(l.current):e;t.length>0?d({sort:t[0].id,order:t[0].desc?`desc`:`asc`}):d({sort:``,order:`asc`})},[d]),setSearch:(0,w.useCallback)(e=>d({search:e}),[d]),setRuntime:(0,w.useCallback)(e=>d({runtime:e}),[d]),setHealth:(0,w.useCallback)(e=>d({health:e}),[d])}}var D=g(),O={hooks:[],filePath:null,errors:[],missing:!1},k=50;function A(e){return e.fileMissing?`file-missing`:`ready`}function j(e){return e===`file-missing`?`File missing`:`Ready`}function _e({hook:e}){return A(e)===`file-missing`?(0,D.jsx)(y,{variant:`outline`,className:`border-amber-500/30 text-amber-600`,children:`File missing`}):(0,D.jsx)(y,{variant:`outline`,className:`border-emerald-500/30 text-emerald-600`,children:`Ready`})}function ve({runtime:e}){let t=C(e),n=t.icon;return(0,D.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,D.jsx)(n,{className:`h-4 w-4 shrink-0`}),(0,D.jsx)(`span`,{children:t.label})]})}function ye({title:e,body:t}){return(0,D.jsxs)(`div`,{className:`rounded-md border border-amber-500/30 bg-amber-500/10 px-4 py-3 text-sm`,children:[(0,D.jsx)(`div`,{className:`font-medium text-foreground`,children:e}),(0,D.jsx)(`div`,{className:`mt-1 text-muted-foreground`,children:t})]})}function be({isActive:e}){return f(`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`,e&&`bg-primary/10 ring-1 ring-inset ring-primary/60`)}function M(){se(`Hooks`);let e=ie(),[f,p]=(0,w.useState)(O),[g,_]=(0,w.useState)(null),[y,T]=(0,w.useState)(!0),[E,M]=(0,w.useState)(-1),[N,P]=(0,w.useState)(0),F=(0,w.useRef)([]),{search:I,runtime:L,health:R,sorting:z,onSortingChange:xe,setSearch:B,setRuntime:V,setHealth:H}=ge();(0,w.useEffect)(()=>{let e=!1;return h().then(t=>{e||(p(t),_(null))}).catch(t=>{e||(p(O),_(t instanceof Error?t.message:`Failed to load hooks`))}).finally(()=>{e||T(!1)}),()=>{e=!0}},[]);let U=(0,w.useMemo)(()=>g?{title:`Hooks could not be loaded`,body:g}:f.missing?{title:`${f.filePath??`configured hooks file`} not found`,body:`Create the first hook to generate the configured hooks file for this workspace.`}:f.errors.length>0?{title:`Hooks could not be loaded from ${f.filePath??`configured hooks file`}`,body:f.errors[0]??`Unknown registry error`}:null,[f.errors,f.filePath,f.missing,g]),W=(0,w.useMemo)(()=>{let e=I.trim().toLowerCase(),t=z[0],n=f.hooks.filter(t=>L&&t.runtime!==L||R&&A(t)!==R?!1:e?t.name.toLowerCase().includes(e)||t.file.toLowerCase().includes(e)||t.id.toLowerCase().includes(e):!0);return t?[...n].sort((e,n)=>{let r=0;switch(t.id){case`runtime`:r=C(e.runtime).label.localeCompare(C(n.runtime).label);break;case`timeout`:r=e.timeout-n.timeout;break;case`health`:r=j(A(e)).localeCompare(j(A(n)));break;default:r=e.name.localeCompare(n.name);break}return t.desc?r*-1:r}):n},[f.hooks,R,L,I,z]),G=W.length,K=Math.ceil(G/k),q=K>0?Math.min(N,K-1):0,J=q*k,Y=W.slice(J,J+k),Se=G>0?J+1:0,Ce=Math.min(J+k,G);(0,w.useEffect)(()=>{N!==q&&P(q)},[N,q]);let we=(0,w.useCallback)(e=>{M(-1),P(0),B(e)},[B]),X=(0,w.useCallback)(e=>{M(-1),P(0),V(e===`all`?``:e)},[V]),Te=(0,w.useCallback)(e=>{M(-1),P(0),H(e===`all`?``:e)},[H]),Z=(0,w.useCallback)((t,n=!1)=>{let r=m.hookView(t.id);if(n){window.open(r,`_blank`);return}e(r)},[e]);he((0,w.useMemo)(()=>{let e=()=>M(e=>Math.min(e+1,Y.length-1)),t=()=>M(e=>Math.max(e-1,0));return{j:e,arrowdown:e,k:t,arrowup:t,enter:e=>{E<0||!Y[E]||Z(Y[E],e.metaKey||e.ctrlKey)}}},[Z,E,Y])),(0,w.useEffect)(()=>{if(Y.length===0){E!==-1&&M(-1);return}E>=Y.length&&M(Y.length-1)},[E,Y.length]),(0,w.useEffect)(()=>{if(E<0)return;let e=F.current[E];e&&document.activeElement!==e&&e.focus()},[E,Y.length]);let Ee=(0,w.useCallback)((e,t)=>{t&&t.preventDefault(),Z(e,!!(t&&(t.metaKey||t.ctrlKey)))},[Z]);function Q(e){M(-1),P(0),xe(t=>{let n=t[0];return!n||n.id!==e?[{id:e,desc:!1}]:n.desc?[]:[{id:e,desc:!0}]})}if(y)return(0,D.jsx)(ae,{});let De=G===0,$=!f.errors.length&&!g;return(0,D.jsx)(oe,{children:(0,D.jsxs)(`div`,{className:`space-y-6`,children:[(0,D.jsxs)(`div`,{className:`flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between`,children:[(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:`Hooks`}),(0,D.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:`Manage reusable setup, teardown, and inline hook scripts for this workspace.`})]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsxs)(ee,{children:[(0,D.jsx)(d,{asChild:!0,children:(0,D.jsx)(v,{variant:`ghost`,size:`icon-sm`,type:`button`,"aria-label":`Keyboard shortcuts`,children:(0,D.jsx)(l,{className:`h-4 w-4`})})}),(0,D.jsx)(te,{side:`bottom`,className:`p-3`,children:(0,D.jsx)(c,{hints:[{key:`J / ↓`,label:`Next row`},{key:`K / ↑`,label:`Previous row`},{key:`Enter`,label:`Open hook`},{key:`⌘+Enter`,label:`Open in new tab`}]})})]}),(0,D.jsxs)(v,{type:`button`,"data-tour-id":`tour-hooks-new`,onClick:()=>e(m.hookNew),children:[(0,D.jsx)(u,{className:`h-4 w-4`}),`Create Hook`]})]})]}),U&&(0,D.jsx)(ye,{title:U.title,body:U.body}),(0,D.jsx)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center`,children:(0,D.jsxs)(`div`,{className:`flex flex-col gap-3 lg:flex-row lg:items-center`,children:[(0,D.jsx)(ne,{value:I,onChange:e=>we(e.currentTarget.value),placeholder:`Search hooks`,className:`lg:max-w-sm`,"aria-label":`Search hooks`}),(0,D.jsxs)(`div`,{className:`flex flex-col gap-3 sm:flex-row`,children:[(0,D.jsxs)(o,{value:L||`all`,onValueChange:X,children:[(0,D.jsx)(r,{className:`w-full sm:w-44`,"aria-label":`Runtime filter`,children:(0,D.jsx)(n,{placeholder:`Runtime`})}),(0,D.jsxs)(i,{children:[(0,D.jsx)(a,{value:`all`,children:`All runtimes`}),de.map(e=>(0,D.jsx)(a,{value:e,children:C(e).label},e))]})]}),(0,D.jsxs)(o,{value:R||`all`,onValueChange:Te,children:[(0,D.jsx)(r,{className:`w-full sm:w-44`,"aria-label":`Health filter`,children:(0,D.jsx)(n,{placeholder:`Health`})}),(0,D.jsxs)(i,{children:[(0,D.jsx)(a,{value:`all`,children:`All health`}),(0,D.jsx)(a,{value:`ready`,children:`Ready`}),(0,D.jsx)(a,{value:`file-missing`,children:`File missing`})]})]})]})]})}),De?(0,D.jsx)(`div`,{"data-tour-id":`tour-hooks-table`,children:(0,D.jsx)(me,{icon:s,title:f.hooks.length===0?`No hooks yet`:`No hooks match your filters`,description:f.hooks.length===0?`Create a hook to add reusable setup, teardown, or inline automation to this workspace.`:`Adjust your search or filters to see more hook records.`,actionLabel:$?`Create Hook`:void 0,onAction:$?()=>e(m.hookNew):void 0})}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(pe,{"data-tour-id":`tour-hooks-table`,className:`rounded-md border`,children:[(0,D.jsxs)(ue,{className:`min-w-full`,children:[(0,D.jsx)(ce,{children:(0,D.jsxs)(x,{children:[(0,D.jsx)(b,{className:`w-[40%]`,children:(0,D.jsxs)(v,{type:`button`,variant:`ghost`,className:`-ml-3`,onClick:()=>Q(`name`),children:[`Hook`,(0,D.jsx)(t,{className:`h-4 w-4`})]})}),(0,D.jsx)(b,{children:(0,D.jsxs)(v,{type:`button`,variant:`ghost`,className:`-ml-3`,onClick:()=>Q(`runtime`),children:[`Runtime`,(0,D.jsx)(t,{className:`h-4 w-4`})]})}),(0,D.jsx)(b,{children:(0,D.jsxs)(v,{type:`button`,variant:`ghost`,className:`-ml-3`,onClick:()=>Q(`timeout`),children:[`Timeout / Network`,(0,D.jsx)(t,{className:`h-4 w-4`})]})}),(0,D.jsx)(b,{children:(0,D.jsxs)(v,{type:`button`,variant:`ghost`,className:`-ml-3`,onClick:()=>Q(`health`),children:[`Health`,(0,D.jsx)(t,{className:`h-4 w-4`})]})})]})}),(0,D.jsx)(le,{children:Y.map((e,t)=>{let n=t===E;return(0,D.jsxs)(x,{ref:e=>{F.current[t]=e},"data-hooks-row-surface":e.id,tabIndex:n?0:-1,"aria-selected":n,className:be({isActive:n}),onClick:()=>{M(t),Z(e)},onFocus:()=>M(t),onKeyDown:t=>{t.key===`Enter`&&Ee(e,t)},children:[(0,D.jsx)(S,{className:`max-w-0`,children:(0,D.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,D.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:e.name}),(0,D.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:e.file})]})}),(0,D.jsx)(S,{children:(0,D.jsx)(ve,{runtime:e.runtime})}),(0,D.jsx)(S,{children:(0,D.jsxs)(`div`,{className:`space-y-1`,children:[(0,D.jsx)(`div`,{className:`text-sm text-foreground`,children:re(e.timeout)}),(0,D.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:e.network?`Network on`:`Network off`})]})}),(0,D.jsx)(S,{children:(0,D.jsx)(_e,{hook:e})})]},e.id)})})]}),(0,D.jsx)(fe,{orientation:`horizontal`})]}),(0,D.jsxs)(`div`,{className:`flex items-center justify-between px-2`,children:[(0,D.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Showing `,Se,`-`,Ce,` of `,G]}),(0,D.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,D.jsx)(v,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{M(-1),P(e=>Math.max(e-1,0))},disabled:q===0,children:`Previous`}),(0,D.jsx)(v,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{M(-1),P(e=>Math.min(e+1,Math.max(K-1,0)))},disabled:q>=K-1,children:`Next`})]})]})]})]})})}export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e}from"./editor.api2-
|
|
1
|
+
import{u as e}from"./editor.api2-DXR_ThFM.js";var t=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`menuitem`,`meta`,`param`,`source`,`track`,`wbr`],n={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:[`<!--`,`-->`]},brackets:[[`<!--`,`-->`],[`<`,`>`],[`{`,`}`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],surroundingPairs:[{open:`"`,close:`"`},{open:`'`,close:`'`},{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`<`,close:`>`}],onEnterRules:[{beforeText:RegExp(`<(?!(?:${t.join(`|`)}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`<(?!(?:${t.join(`|`)}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),action:{indentAction:e.IndentAction.Indent}}],folding:{markers:{start:RegExp(`^\\s*<!--\\s*#region\\b.*-->`),end:RegExp(`^\\s*<!--\\s*#endregion\\b.*-->`)}}},r={defaultToken:``,tokenPostfix:`.html`,ignoreCase:!0,tokenizer:{root:[[/<!DOCTYPE/,`metatag`,`@doctype`],[/<!--/,`comment`,`@comment`],[/(<)((?:[\w\-]+:)?[\w\-]+)(\s*)(\/>)/,[`delimiter`,`tag`,``,`delimiter`]],[/(<)(script)/,[`delimiter`,{token:`tag`,next:`@script`}]],[/(<)(style)/,[`delimiter`,{token:`tag`,next:`@style`}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,[`delimiter`,{token:`tag`,next:`@otherTag`}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,[`delimiter`,{token:`tag`,next:`@otherTag`}]],[/</,`delimiter`],[/[^<]+/]],doctype:[[/[^>]+/,`metatag.content`],[/>/,`metatag`,`@pop`]],comment:[[/-->/,`comment`,`@pop`],[/[^-]+/,`comment.content`],[/./,`comment.content`]],otherTag:[[/\/?>/,`delimiter`,`@pop`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/]],script:[[/type/,`attribute.name`,`@scriptAfterType`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/>/,{token:`delimiter`,next:`@scriptEmbedded`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,[`delimiter`,`tag`,{token:`delimiter`,next:`@pop`}]]],scriptAfterType:[[/=/,`delimiter`,`@scriptAfterTypeEquals`],[/>/,{token:`delimiter`,next:`@scriptEmbedded`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptAfterTypeEquals:[[/"module"/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.text/javascript`}],[/'module'/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.text/javascript`}],[/"([^"]*)"/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.$1`}],[/'([^']*)'/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.$1`}],[/>/,{token:`delimiter`,next:`@scriptEmbedded`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptWithCustomType:[[/>/,{token:`delimiter`,next:`@scriptEmbedded.$S2`,nextEmbedded:`$S2`}],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptEmbedded:[[/<\/script/,{token:`@rematch`,next:`@pop`,nextEmbedded:`@pop`}],[/[^<]+/,``]],style:[[/type/,`attribute.name`,`@styleAfterType`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/>/,{token:`delimiter`,next:`@styleEmbedded`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,[`delimiter`,`tag`,{token:`delimiter`,next:`@pop`}]]],styleAfterType:[[/=/,`delimiter`,`@styleAfterTypeEquals`],[/>/,{token:`delimiter`,next:`@styleEmbedded`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:`attribute.value`,switchTo:`@styleWithCustomType.$1`}],[/'([^']*)'/,{token:`attribute.value`,switchTo:`@styleWithCustomType.$1`}],[/>/,{token:`delimiter`,next:`@styleEmbedded`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleWithCustomType:[[/>/,{token:`delimiter`,next:`@styleEmbedded.$S2`,nextEmbedded:`$S2`}],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleEmbedded:[[/<\/style/,{token:`@rematch`,next:`@pop`,nextEmbedded:`@pop`}],[/[^<]+/,``]]}};export{n as conf,r as language};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as e}from"./editor.api2-
|
|
1
|
+
import{u as e}from"./editor.api2-DXR_ThFM.js";import{t}from"./workers-By3SZV-o.js";import{_ as n,a as r,c as i,d as a,f as o,g as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v,v as y}from"./lspLanguageFeatures-By4f0cSm.js";var b=120*1e3,x=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),30*1e3),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){this._worker&&Date.now()-this._lastUsedTime>b&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||=(this._worker=t({moduleId:`vs/language/html/htmlWorker`,createWorker:()=>new Worker(new URL(`/assets/html.worker-CQP8QQsS.js`,``+import.meta.url),{type:`module`}),createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let t;return this._getClient().then(e=>{t=e}).then(t=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(e=>t)}},S=class extends _{constructor(e){super(e,[`.`,`:`,`<`,`"`,`=`,`/`])}};function C(t){let n=new x(t),o=(...e)=>n.getLanguageServiceWorker(...e),s=t.languageId;e.registerCompletionItemProvider(s,new S(o)),e.registerHoverProvider(s,new a(o)),e.registerDocumentHighlightProvider(s,new p(o)),e.registerLinkProvider(s,new g(o)),e.registerFoldingRangeProvider(s,new v(o)),e.registerDocumentSymbolProvider(s,new u(o)),e.registerSelectionRangeProvider(s,new d(o)),e.registerRenameProvider(s,new m(o)),s===`html`&&(e.registerDocumentFormattingEditProvider(s,new r(o)),e.registerDocumentRangeFormattingEditProvider(s,new i(o)))}function w(t){let n=[],o=[],s=new x(t);n.push(s);let c=(...e)=>s.getLanguageServiceWorker(...e);function l(){let{languageId:n,modeConfiguration:s}=t;E(o),s.completionItems&&o.push(e.registerCompletionItemProvider(n,new S(c))),s.hovers&&o.push(e.registerHoverProvider(n,new a(c))),s.documentHighlights&&o.push(e.registerDocumentHighlightProvider(n,new p(c))),s.links&&o.push(e.registerLinkProvider(n,new g(c))),s.documentSymbols&&o.push(e.registerDocumentSymbolProvider(n,new u(c))),s.rename&&o.push(e.registerRenameProvider(n,new m(c))),s.foldingRanges&&o.push(e.registerFoldingRangeProvider(n,new v(c))),s.selectionRanges&&o.push(e.registerSelectionRangeProvider(n,new d(c))),s.documentFormattingEdits&&o.push(e.registerDocumentFormattingEditProvider(n,new r(c))),s.documentRangeFormattingEdits&&o.push(e.registerDocumentRangeFormattingEditProvider(n,new i(c)))}return l(),n.push(T(o)),T(n)}function T(e){return{dispose:()=>E(e)}}function E(e){for(;e.length;)e.pop().dispose()}export{_ as CompletionAdapter,f as DefinitionAdapter,h as DiagnosticsAdapter,l as DocumentColorAdapter,r as DocumentFormattingEditProvider,p as DocumentHighlightAdapter,g as DocumentLinkAdapter,i as DocumentRangeFormattingEditProvider,u as DocumentSymbolAdapter,v as FoldingRangeAdapter,a as HoverAdapter,o as ReferenceAdapter,m as RenameAdapter,d as SelectionRangeAdapter,x as WorkerManager,c as fromPosition,s as fromRange,w as setupMode,C as setupMode1,n as toRange,y as toTextEdit};
|