@piwitests/server 0.19.0 → 0.20.0
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/.output/nitro.json +1 -1
- package/.output/public/_nuxt/{eptP4pGv.js → -f7BAm1H.js} +1 -1
- package/.output/public/_nuxt/{Bti38m-M.js → 4gYNA-d4.js} +1 -1
- package/.output/public/_nuxt/{CHEFCN8Q.js → 5A6ITZXj.js} +1 -1
- package/.output/public/_nuxt/{DoUy4UHi.js → 8PUUncmO.js} +2 -2
- package/.output/public/_nuxt/{DS636elg.js → A1pj0VnG.js} +1 -1
- package/.output/public/_nuxt/{B9WhzpKO.js → AbmKWFQQ.js} +1 -1
- package/.output/public/_nuxt/{rWNTSFD6.js → B3obW6cw.js} +3 -3
- package/.output/public/_nuxt/{Bu2aaVIY.js → B7FTvFWq.js} +1 -1
- package/.output/public/_nuxt/{CpjgB2aY.js → B8zkOmwo.js} +1 -1
- package/.output/public/_nuxt/B96M2gdj.js +1 -0
- package/.output/public/_nuxt/{FUXhyidq.js → B99fbi73.js} +1 -1
- package/.output/public/_nuxt/{DslPMqfa.js → B9OLmp0f.js} +1 -1
- package/.output/public/_nuxt/{BccXfBfI.js → BKkF4pPD.js} +1 -1
- package/.output/public/_nuxt/{DP8hfJ9h.js → BT3wGCTI.js} +1 -1
- package/.output/public/_nuxt/{B3B9Ii2A.js → BUa0V0Ly.js} +1 -1
- package/.output/public/_nuxt/{B3HO8kuh.js → BUkim3TM.js} +1 -1
- package/.output/public/_nuxt/{BVaxh6Nl.js → BVc14Ncz.js} +3 -3
- package/.output/public/_nuxt/{DW0xl3I6.js → BY0HxR3t.js} +1 -1
- package/.output/public/_nuxt/B_xAMWQS.js +2 -0
- package/.output/public/_nuxt/{C2_3mdPC.js → BdQoBaOv.js} +1 -1
- package/.output/public/_nuxt/{DT53RWbC.js → BdfhYr-u.js} +1 -1
- package/.output/public/_nuxt/{CtQBsNUb.js → BgRu_3tT.js} +1 -1
- package/.output/public/_nuxt/{SlIRLREZ.js → BiO7RBWb.js} +1 -1
- package/.output/public/_nuxt/BicAJ6U8.js +1 -0
- package/.output/public/_nuxt/{C7P1UCO2.js → Bm62iDV5.js} +1 -1
- package/.output/public/_nuxt/{CZfMdzfk.js → BmUfSNMV.js} +1 -1
- package/.output/public/_nuxt/{tvgqrYDd.js → Bnxf8nbZ.js} +1 -1
- package/.output/public/_nuxt/{ndShiWE8.js → Bow4tTR0.js} +1 -1
- package/.output/public/_nuxt/{D0HNloZ9.js → BrQEE053.js} +1 -1
- package/.output/public/_nuxt/{CV9-fTmY.js → BzRRzmwm.js} +1 -1
- package/.output/public/_nuxt/{DprVVyUQ.js → C0_yH0N7.js} +1 -1
- package/.output/public/_nuxt/{DLSrtpsA.js → C1gTN4Q8.js} +1 -1
- package/.output/public/_nuxt/{ClOqkAcc.js → C2hkrSey.js} +1 -1
- package/.output/public/_nuxt/{ZFiQCMUB.js → C8e1EbJI.js} +1 -1
- package/.output/public/_nuxt/{nv9-6vBK.js → CA9B2HE5.js} +1 -1
- package/.output/public/_nuxt/{KnfsST6Y.js → CAAwCT7H.js} +1 -1
- package/.output/public/_nuxt/{ybDYeNxd.js → CAvY22RE.js} +1 -1
- package/.output/public/_nuxt/{C5iG7O4O.js → CEfS4-oS.js} +1 -1
- package/.output/public/_nuxt/{Bp5ELvx9.js → CIoSMkpp.js} +1 -1
- package/.output/public/_nuxt/{C95YAaJq.js → CIrFl3MW.js} +1 -1
- package/.output/public/_nuxt/{DiOLdHBC.js → CJFtzlQ4.js} +1 -1
- package/.output/public/_nuxt/{BX9ZXe98.js → CNyV9YpI.js} +1 -1
- package/.output/public/_nuxt/CSJ-eOQM.js +1 -0
- package/.output/public/_nuxt/{fVcG504p.js → CTU1mrhq.js} +1 -1
- package/.output/public/_nuxt/{279D2RYp.js → CXEH9OPk.js} +1 -1
- package/.output/public/_nuxt/CahpB9Z2.js +5 -0
- package/.output/public/_nuxt/{B7NBP1C-.js → Cbh--1MW.js} +1 -1
- package/.output/public/_nuxt/CeG9pBAD.js +1 -0
- package/.output/public/_nuxt/{D55D4EYo.js → CeW8v31b.js} +1 -1
- package/.output/public/_nuxt/{BuMC3WjZ.js → CjPfj7ya.js} +1 -1
- package/.output/public/_nuxt/{HXerICAi.js → Cnsmicv2.js} +1 -1
- package/.output/public/_nuxt/{DgE2YE3R.js → CsLojMwR.js} +1 -1
- package/.output/public/_nuxt/{C9_jrmk9.js → Cus22Ud3.js} +2 -2
- package/.output/public/_nuxt/{DX-MDGb3.js → CwGWJbiy.js} +1 -1
- package/.output/public/_nuxt/{BJ0XQElc.js → Cx6gc2VW.js} +1 -1
- package/.output/public/_nuxt/{cHAnlQbv.js → CxyAzHr3.js} +1 -1
- package/.output/public/_nuxt/{BxCKKeYs.js → CzAPFPpL.js} +1 -1
- package/.output/public/_nuxt/{B33iXw77.js → D--H4jLI.js} +1 -1
- package/.output/public/_nuxt/D1POo6S4.js +10 -0
- package/.output/public/_nuxt/{BDicZ1gQ.js → D5tke0B5.js} +1 -1
- package/.output/public/_nuxt/D8nkF-OO.js +3 -0
- package/.output/public/_nuxt/{CzGyac8q.js → DA25RkyK.js} +1 -1
- package/.output/public/_nuxt/{CUtJobDm.js → DIB-5fUJ.js} +1 -1
- package/.output/public/_nuxt/{BPRffDuo.js → DJmoLeVt.js} +1 -1
- package/.output/public/_nuxt/{DGfAxLHV.js → DJxlKFGb.js} +1 -1
- package/.output/public/_nuxt/{81InBX9v.js → DMec-OLo.js} +1 -1
- package/.output/public/_nuxt/{CK_2LZBS.js → DPCxhHri.js} +1 -1
- package/.output/public/_nuxt/{Bn0YQDyy.js → DSqHUrvO.js} +1 -1
- package/.output/public/_nuxt/{BqV0l12c.js → DabzhQB1.js} +1 -1
- package/.output/public/_nuxt/{BfTuX0wq.js → DdwHkKfV.js} +1 -1
- package/.output/public/_nuxt/{C-elpgyr.js → DeY2JkR2.js} +1 -1
- package/.output/public/_nuxt/{DEFEpYzn.js → DfgOx_ou.js} +1 -1
- package/.output/public/_nuxt/DmkUdSS4.js +1 -0
- package/.output/public/_nuxt/{Ar3IelOY.js → DoIREDVb.js} +1 -1
- package/.output/public/_nuxt/DpZ1r1HA.js +1 -0
- package/.output/public/_nuxt/{Jo8kRmHz.js → Dpd16JVI.js} +1 -1
- package/.output/public/_nuxt/{BSIxhGsh.js → DqcKngf3.js} +1 -1
- package/.output/public/_nuxt/{BMvCSA6h.js → DrfE8IY0.js} +1 -1
- package/.output/public/_nuxt/{eaVkJRSa.js → DsesNydr.js} +1 -1
- package/.output/public/_nuxt/{zQyPuvV1.js → DtHJgCS8.js} +1 -1
- package/.output/public/_nuxt/Dtd4rC58.js +9 -0
- package/.output/public/_nuxt/{NQikbhmK.js → Du2W7Jne.js} +37 -36
- package/.output/public/_nuxt/{CDk0q2hV.js → DuwtTfO8.js} +1 -1
- package/.output/public/_nuxt/{B44A4LSJ.js → Dy-TJ0Mt.js} +1 -1
- package/.output/public/_nuxt/{-09h6CA9.js → Dy86h-7P.js} +1 -1
- package/.output/public/_nuxt/{Cdff9XNh.js → Dyeqn3aG.js} +1 -1
- package/.output/public/_nuxt/{Dnpkl-1q.js → FaFoMVKo.js} +1 -1
- package/.output/public/_nuxt/GPNI1ffD.js +4 -0
- package/.output/public/_nuxt/{BCMuIgP5.js → H94BMf3L.js} +1 -1
- package/.output/public/_nuxt/HPNQD6v3.js +1 -0
- package/.output/public/_nuxt/HXadJrHu.js +2 -0
- package/.output/public/_nuxt/{YVN7WG7q.js → KyA_4Ks-.js} +1 -1
- package/.output/public/_nuxt/{CYsTqbBS.js → L3kAWB2a.js} +1 -1
- package/.output/public/_nuxt/{Dk9fwOCm.js → McL25vkx.js} +2 -2
- package/.output/public/_nuxt/Nn93e_Mz.js +1 -0
- package/.output/public/_nuxt/UdR3DBPS.js +1 -0
- package/.output/public/_nuxt/{SfMRXW25.js → Und3xXFc.js} +1 -1
- package/.output/public/_nuxt/_mj6CfPa.js +1 -0
- package/.output/public/_nuxt/{BPQoBGg5.js → b-GYfcrQ.js} +1 -1
- package/.output/public/_nuxt/{DHDtnj7p.js → bLcjFslv.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/e659b3e1-0e61-4971-940e-10063f9f4763.json +1 -0
- package/.output/public/_nuxt/entry.DmptwB51.css +1 -0
- package/.output/public/_nuxt/{y17lMTFy.js → hC_z4G8p.js} +1 -1
- package/.output/public/_nuxt/{CTxDO9fB.js → hNh4CIL0.js} +1 -1
- package/.output/public/_nuxt/{CGNkHojN.js → l5WKbU4h.js} +1 -1
- package/.output/public/_nuxt/{DcmZRa_F.js → oAClCn_h.js} +1 -1
- package/.output/public/_nuxt/{IvQlbZk6.js → pQqGiNch.js} +1 -1
- package/.output/public/_nuxt/ryMzSDUj.js +2 -0
- package/.output/server/chunks/_/collect.mjs +1 -1
- package/.output/server/chunks/_/markers.mjs +1 -1
- package/.output/server/chunks/_/quarantine.mjs +1 -1
- package/.output/server/chunks/_/users.mjs +1 -1
- package/.output/server/chunks/build/{BrowserBadge-D33lqUcj.mjs → BrowserBadge-MFvBwxmD.mjs} +66 -6
- package/.output/server/chunks/build/BrowserBadge-MFvBwxmD.mjs.map +1 -0
- package/.output/server/chunks/build/{Checkbox-DvUBGagc.mjs → Checkbox-4Q5d0fa0.mjs} +4 -4
- package/.output/server/chunks/build/Checkbox-4Q5d0fa0.mjs.map +1 -0
- package/.output/server/chunks/build/CiEnvCard-DB5DvBh1.mjs +1492 -0
- package/.output/server/chunks/build/CiEnvCard-DB5DvBh1.mjs.map +1 -0
- package/.output/server/chunks/build/CodeBlock-BgE-NSmE.mjs +1 -1
- package/.output/server/chunks/build/DashboardSidebarToggle-DCTnHiIv.mjs +1 -1
- package/.output/server/chunks/build/{DiagnosisPanel-B646dK4p.mjs → DiagnosisPanel-CALyEmcJ.mjs} +3 -3
- package/.output/server/chunks/build/DiagnosisPanel-CALyEmcJ.mjs.map +1 -0
- package/.output/server/chunks/build/{EmptyState-Dtlab7S9.mjs → EmptyState-DC2q_7TD.mjs} +3 -3
- package/.output/server/chunks/build/EmptyState-DC2q_7TD.mjs.map +1 -0
- package/.output/server/chunks/build/{EntityLinks-D3fp57pR.mjs → EntityLinks-BBHWssHH.mjs} +4 -4
- package/.output/server/chunks/build/EntityLinks-BBHWssHH.mjs.map +1 -0
- package/.output/server/chunks/build/{EnvManagedBadge-Bg3FSiU1.mjs → EnvManagedBadge-UwD2b9v2.mjs} +2 -2
- package/.output/server/chunks/build/EnvManagedBadge-UwD2b9v2.mjs.map +1 -0
- package/.output/server/chunks/build/{Modal-Ck2XLt8d.mjs → Modal-pSDlXzT3.mjs} +2 -2
- package/.output/server/chunks/build/Modal-pSDlXzT3.mjs.map +1 -0
- package/.output/server/chunks/build/{OpenInIdeLink-C4MXA8ya.mjs → OpenInIdeLink-CQWKKChd.mjs} +3 -3
- package/.output/server/chunks/build/{OpenInIdeLink-C4MXA8ya.mjs.map → OpenInIdeLink-CQWKKChd.mjs.map} +1 -1
- package/.output/server/chunks/build/{ProjectTestCasesTable-CxfQ5wtN.mjs → ProjectTestCasesTable-Bo61P5K1.mjs} +8 -8
- package/.output/server/chunks/build/{ProjectTestCasesTable-CxfQ5wtN.mjs.map → ProjectTestCasesTable-Bo61P5K1.mjs.map} +1 -1
- package/.output/server/chunks/build/{RovingFocusItem-BJSzTBjy.mjs → RovingFocusItem--OEHI2P3.mjs} +2 -2
- package/.output/server/chunks/build/RovingFocusItem--OEHI2P3.mjs.map +1 -0
- package/.output/server/chunks/build/RunReports-DFLv51TX.mjs +1 -1
- package/.output/server/chunks/build/{Select-CUqj50wi.mjs → Select-5DK9frQ7.mjs} +3 -3
- package/.output/server/chunks/build/Select-5DK9frQ7.mjs.map +1 -0
- package/.output/server/chunks/build/{SelectMenu-Db7osY7J.mjs → SelectMenu-D-2FSqBU.mjs} +939 -7
- package/.output/server/chunks/build/{SelectMenu-Db7osY7J.mjs.map → SelectMenu-D-2FSqBU.mjs.map} +1 -1
- package/.output/server/chunks/build/{SettingsField-D6iEYbEc.mjs → SettingsField-BZfx4ma1.mjs} +2 -2
- package/.output/server/chunks/build/SettingsField-BZfx4ma1.mjs.map +1 -0
- package/.output/server/chunks/build/{Slideover-DgCa80mf.mjs → Slideover-D270EZZD.mjs} +3 -3
- package/.output/server/chunks/build/Slideover-D270EZZD.mjs.map +1 -0
- package/.output/server/chunks/build/{Switch-CgUioOYB.mjs → Switch-B5Fp8ULt.mjs} +2 -2
- package/.output/server/chunks/build/Switch-B5Fp8ULt.mjs.map +1 -0
- package/.output/server/chunks/build/Table-BRk04Hd2.mjs +1 -1
- package/.output/server/chunks/build/{Tabs-Bbsg9wag.mjs → Tabs-BkSOnbaB.mjs} +2 -2
- package/.output/server/chunks/build/Tabs-BkSOnbaB.mjs.map +1 -0
- package/.output/server/chunks/build/{TestCaseHistoryChart-nMLPhdvD.mjs → TestCaseHistoryChart-CSi64vVA.mjs} +5 -5
- package/.output/server/chunks/build/TestCaseHistoryChart-CSi64vVA.mjs.map +1 -0
- package/.output/server/chunks/build/{TestStatusBar-j6h2Jp6A.mjs → TestStatusBar-DX3EhlyP.mjs} +2 -2
- package/.output/server/chunks/build/TestStatusBar-DX3EhlyP.mjs.map +1 -0
- package/.output/server/chunks/build/{Tooltip-BOazooWP.mjs → Tooltip-Dv4htNP6.mjs} +3 -3
- package/.output/server/chunks/build/Tooltip-Dv4htNP6.mjs.map +1 -0
- package/.output/server/chunks/build/{VisuallyHiddenInput-D6kBJxVd.mjs → VisuallyHiddenInput-BHvzNumK.mjs} +2 -2
- package/.output/server/chunks/build/VisuallyHiddenInput-BHvzNumK.mjs.map +1 -0
- package/.output/server/chunks/build/{_id_-z5N6HPyC.mjs → _id_-BdG37K7s.mjs} +12 -12
- package/.output/server/chunks/build/_id_-BdG37K7s.mjs.map +1 -0
- package/.output/server/chunks/build/{_id_-BHh65pfg.mjs → _id_-BdJs7BJZ.mjs} +57 -33
- package/.output/server/chunks/build/{_id_-BHh65pfg.mjs.map → _id_-BdJs7BJZ.mjs.map} +1 -1
- package/.output/server/chunks/build/{_id_-B78ky13D.mjs → _id_-BxA6IgWr.mjs} +96 -73
- package/.output/server/chunks/build/_id_-BxA6IgWr.mjs.map +1 -0
- package/.output/server/chunks/build/{_id_-Rzkqx55x.mjs → _id_-C_uSBiyU.mjs} +22 -23
- package/.output/server/chunks/build/{_id_-Rzkqx55x.mjs.map → _id_-C_uSBiyU.mjs.map} +1 -1
- package/.output/server/chunks/build/{about-CvSP73Ug.mjs → about-BE0UV-8-.mjs} +365 -18
- package/.output/server/chunks/build/about-BE0UV-8-.mjs.map +1 -0
- package/.output/server/chunks/build/{ai-B4VJ9K1K.mjs → ai-Cn05ch0u.mjs} +9 -9
- package/.output/server/chunks/build/{ai-B4VJ9K1K.mjs.map → ai-Cn05ch0u.mjs.map} +1 -1
- package/.output/server/chunks/build/{analytics-CJPC6t4L.mjs → analytics-Bo_B_jko.mjs} +20 -21
- package/.output/server/chunks/build/analytics-Bo_B_jko.mjs.map +1 -0
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/{default-zvbFgDJG.mjs → default-CbNHaFsy.mjs} +603 -71
- package/.output/server/chunks/build/default-CbNHaFsy.mjs.map +1 -0
- package/.output/server/chunks/build/{docs-DyuVEgtB.mjs → docs-B_llWMxx.mjs} +6 -6
- package/.output/server/chunks/build/{docs-DyuVEgtB.mjs.map → docs-B_llWMxx.mjs.map} +1 -1
- package/.output/server/chunks/build/{edit-CFR5g2Qf.mjs → edit-J0asTFg8.mjs} +4 -5
- package/.output/server/chunks/build/edit-J0asTFg8.mjs.map +1 -0
- package/.output/server/chunks/build/fetch-B4FwBOzu.mjs +1 -1
- package/.output/server/chunks/build/{import-CZo3djDi.mjs → import-CS9oylTN.mjs} +4 -4
- package/.output/server/chunks/build/import-CS9oylTN.mjs.map +1 -0
- package/.output/server/chunks/build/{index-Stqw0dEI.mjs → index-DE45ycdZ.mjs} +9 -9
- package/.output/server/chunks/build/index-DE45ycdZ.mjs.map +1 -0
- package/.output/server/chunks/build/{index-gCw_y4ZJ.mjs → index-e9skCi-V.mjs} +10 -11
- package/.output/server/chunks/build/{index-gCw_y4ZJ.mjs.map → index-e9skCi-V.mjs.map} +1 -1
- package/.output/server/chunks/build/{index-D7fe97l3.mjs → index-hGHlmyxj.mjs} +299 -91
- package/.output/server/chunks/build/index-hGHlmyxj.mjs.map +1 -0
- package/.output/server/chunks/build/isValueEqualOrExist-D2qw9YEr.mjs +1 -1
- package/.output/server/chunks/build/login-Da4u1IlW.mjs +1 -1
- package/.output/server/chunks/build/{mcp-B3IUvRgD.mjs → mcp-uhVCCwQM.mjs} +339 -10
- package/.output/server/chunks/build/mcp-uhVCCwQM.mjs.map +1 -0
- package/.output/server/chunks/build/{notifications-abDv0id8.mjs → notifications-fx_qnKGA.mjs} +4 -4
- package/.output/server/chunks/build/notifications-fx_qnKGA.mjs.map +1 -0
- package/.output/server/chunks/build/{pr-feedback-DjZID6q-.mjs → pr-feedback-X6-70iF0.mjs} +3 -3
- package/.output/server/chunks/build/pr-feedback-X6-70iF0.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +24 -24
- package/.output/server/chunks/build/{settings-Du7YqF8i.mjs → settings-CCYe7rsc.mjs} +3 -3
- package/.output/server/chunks/build/settings-CCYe7rsc.mjs.map +1 -0
- package/.output/server/chunks/build/{storage-B4vzxd8G.mjs → storage-CJEmviCD.mjs} +5 -5
- package/.output/server/chunks/build/storage-CJEmviCD.mjs.map +1 -0
- package/.output/server/chunks/build/{test-cases-DUvaO1He.mjs → test-cases-thBbAykw.mjs} +9 -9
- package/.output/server/chunks/build/test-cases-thBbAykw.mjs.map +1 -0
- package/.output/server/chunks/build/{useAiStatus-CWvIo32Q.mjs → useAiStatus-CxjMmDDY.mjs} +8 -8
- package/.output/server/chunks/build/useAiStatus-CxjMmDDY.mjs.map +1 -0
- package/.output/server/chunks/build/{useCopyRich-BemRsKgv.mjs → useCopyRich-RJKhWoyj.mjs} +74 -44
- package/.output/server/chunks/build/useCopyRich-RJKhWoyj.mjs.map +1 -0
- package/.output/server/chunks/build/{useDesktopDownload-D49JRQSw.mjs → useDesktopDownload-BepjqxOt.mjs} +2 -2
- package/.output/server/chunks/build/useDesktopDownload-BepjqxOt.mjs.map +1 -0
- package/.output/server/chunks/build/{useOpenInIde-4GFf-kdi.mjs → useOpenInIde-BbTnPhFA.mjs} +2 -2
- package/.output/server/chunks/build/useOpenInIde-BbTnPhFA.mjs.map +1 -0
- package/.output/server/chunks/build/{useSettingsNav-C3O866KC.mjs → useSettingsNav-DnQKacz8.mjs} +4 -4
- package/.output/server/chunks/build/useSettingsNav-DnQKacz8.mjs.map +1 -0
- package/.output/server/chunks/build/useTauri-Kf3HE_42.mjs +11 -0
- package/.output/server/chunks/build/useTauri-Kf3HE_42.mjs.map +1 -0
- package/.output/server/chunks/build/{wasted-time-lYkx5YO4.mjs → wasted-time-BNTPIyrC.mjs} +4 -4
- package/.output/server/chunks/build/wasted-time-BNTPIyrC.mjs.map +1 -0
- package/.output/server/chunks/nitro/nitro.mjs +3471 -2802
- package/.output/server/chunks/nitro/nitro.mjs.map +1 -1
- package/.output/server/chunks/routes/__piwi/session.get.mjs +1 -1
- package/.output/server/chunks/routes/api/desktop/import-local.post.mjs +88 -0
- package/.output/server/chunks/routes/api/desktop/import-local.post.mjs.map +1 -0
- package/.output/server/chunks/routes/api/failure-clusters/_id/base-commit.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/branches.get.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/commit-diff.get.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/commits.get.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/context.get.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/diagnose/stream.post.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/diagnose.post.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/diagnoses.get.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/diagnosis.get.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/export.get.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/extract-cases.post.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/fix-plan.get.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id/status.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-clusters/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/failure-diagnoses/_id/feedback.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/files/_...path_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/health.get.mjs +1 -1
- package/.output/server/chunks/routes/api/index.get2.mjs +1 -1
- package/.output/server/chunks/routes/api/index.get3.mjs +1 -1
- package/.output/server/chunks/routes/api/index.get4.mjs +1 -1
- package/.output/server/chunks/routes/api/index.post2.mjs +1 -1
- package/.output/server/chunks/routes/api/index.post3.mjs +1 -1
- package/.output/server/chunks/routes/api/index.post4.mjs +1 -1
- package/.output/server/chunks/routes/api/index.post5.mjs +1 -1
- package/.output/server/chunks/routes/api/links/_id/refresh.post.mjs +1 -1
- package/.output/server/chunks/routes/api/links/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/links/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/markers/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/markers/_id_.put.mjs +1 -1
- package/.output/server/chunks/routes/api/notifications/stream.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/cluster-merge-suggestions.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/failure-clusters.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/flaky-classify.post.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/flaky-tests.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/latest-run.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/markers.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/markers.post.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/members.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/members.put.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/performance.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/quarantine/_testCaseId_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/quarantine.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/quarantine.post.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/slow-tests.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/spec-health.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/test-cases.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id/timeout-opportunities.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/_id_.put.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/menu.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects/overview.get.mjs +1 -1
- package/.output/server/chunks/routes/api/projects.get.mjs +1 -1
- package/.output/server/chunks/routes/api/search.get.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/ai/limits.get.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/ai/limits.put.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/ai/test.post.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/ai/usage.get.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/ai.get.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/ai.put.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/pr-feedback.get.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/pr-feedback.put.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/smtp.get.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/timeout-hygiene.get.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/timeout-hygiene.put.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/wasted-waits.get.mjs +1 -1
- package/.output/server/chunks/routes/api/settings/wasted-waits.put.mjs +1 -1
- package/.output/server/chunks/routes/api/stream.get.mjs +1 -1
- package/.output/server/chunks/routes/api/subscriptions/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/subscriptions/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/tags/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/tags/_id_.put.mjs +1 -1
- package/.output/server/chunks/routes/api/test-cases/_id/history.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-cases/_id/stability-trend.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-cases/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-run-cases/_id/diagnose.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-run-cases/_id/diagnosis-context.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-run-cases/_id/diagnosis.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-run-cases/_id/export.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-run-cases/_id/traces.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-run-cases/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/begin.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/case-files.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/dom-snapshot.get.mjs +5 -3
- package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/dom-snapshot.get.mjs.map +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/environment-diff.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/locator-healing.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/locator-pick.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/trace-network-body.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/trace-network.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/trace-stacks.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/cases/_caseId/visual-diff.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/events.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/failure-groups.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/finish.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/gate.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/heartbeat.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/insights.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/network-requests.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/regression-context.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/stream.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id/summary.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id_.delete.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id_.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/_id_.patch.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/import/check.post.mjs +1 -2
- package/.output/server/chunks/routes/api/test-runs/import/check.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/test-runs/import.post.mjs +4 -128
- package/.output/server/chunks/routes/api/test-runs/import.post.mjs.map +1 -1
- package/.output/server/chunks/routes/api/test-runs/recent.get.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/setup.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/start.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/submit.post.mjs +1 -1
- package/.output/server/chunks/routes/api/test-runs/upload.post.mjs +1 -1
- package/.output/server/chunks/routes/api/tests/cleanup.delete.mjs +3 -1
- package/.output/server/chunks/routes/api/tests/cleanup.delete.mjs.map +1 -1
- package/.output/server/chunks/routes/api/traces/check.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id/index.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id/invite.post.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id/projects.get.mjs +1 -1
- package/.output/server/chunks/routes/api/users/_id/projects.put.mjs +1 -1
- package/.output/server/chunks/routes/api/version.get.mjs +1 -1
- package/.output/server/chunks/routes/mcp.post.mjs +1 -1
- package/.output/server/chunks/routes/renderer.mjs +1 -1
- package/.output/server/index.mjs +1 -1
- package/.output/server/package.json +1 -1
- package/package.json +1 -1
- package/.output/public/_nuxt/BYDaY0Z7.js +0 -1
- package/.output/public/_nuxt/Bc8mOoz9.js +0 -4
- package/.output/public/_nuxt/BeLWlVK0.js +0 -1
- package/.output/public/_nuxt/BpUaY9nH.js +0 -2
- package/.output/public/_nuxt/CHNwfU1y.js +0 -1
- package/.output/public/_nuxt/CNFYDQmj.js +0 -1
- package/.output/public/_nuxt/CU5S9GCh.js +0 -1
- package/.output/public/_nuxt/CrwJAwhk.js +0 -1
- package/.output/public/_nuxt/CuSVQEkS.js +0 -3
- package/.output/public/_nuxt/CylWPruw.js +0 -1
- package/.output/public/_nuxt/DDDpCFpF.js +0 -1
- package/.output/public/_nuxt/DVDXJYq2.js +0 -2
- package/.output/public/_nuxt/Dgf5N4Ng.js +0 -1
- package/.output/public/_nuxt/DiZyJYez.js +0 -1
- package/.output/public/_nuxt/OSduWzyz.js +0 -1
- package/.output/public/_nuxt/WsxFTEFq.js +0 -10
- package/.output/public/_nuxt/aQgs_c6e.js +0 -9
- package/.output/public/_nuxt/builds/meta/ab473028-4b37-4884-b243-b8f6e5046e5e.json +0 -1
- package/.output/public/_nuxt/dYCKgE-3.js +0 -5
- package/.output/public/_nuxt/entry.CPhW41mh.css +0 -1
- package/.output/public/_nuxt/g26aVPxc.js +0 -1
- package/.output/server/chunks/_/import-runs.mjs +0 -351
- package/.output/server/chunks/_/import-runs.mjs.map +0 -1
- package/.output/server/chunks/build/BrowserBadge-D33lqUcj.mjs.map +0 -1
- package/.output/server/chunks/build/Checkbox-DvUBGagc.mjs.map +0 -1
- package/.output/server/chunks/build/CiEnvCard-CrjOM17n.mjs +0 -631
- package/.output/server/chunks/build/CiEnvCard-CrjOM17n.mjs.map +0 -1
- package/.output/server/chunks/build/DiagnosisPanel-B646dK4p.mjs.map +0 -1
- package/.output/server/chunks/build/EmptyState-Dtlab7S9.mjs.map +0 -1
- package/.output/server/chunks/build/EntityLinks-D3fp57pR.mjs.map +0 -1
- package/.output/server/chunks/build/EnvManagedBadge-Bg3FSiU1.mjs.map +0 -1
- package/.output/server/chunks/build/Modal-Ck2XLt8d.mjs.map +0 -1
- package/.output/server/chunks/build/RovingFocusItem-BJSzTBjy.mjs.map +0 -1
- package/.output/server/chunks/build/Select-CUqj50wi.mjs.map +0 -1
- package/.output/server/chunks/build/SettingsField-D6iEYbEc.mjs.map +0 -1
- package/.output/server/chunks/build/Slideover-DgCa80mf.mjs.map +0 -1
- package/.output/server/chunks/build/Switch-CgUioOYB.mjs.map +0 -1
- package/.output/server/chunks/build/Tabs-Bbsg9wag.mjs.map +0 -1
- package/.output/server/chunks/build/TestCaseHistoryChart-nMLPhdvD.mjs.map +0 -1
- package/.output/server/chunks/build/TestStatusBar-j6h2Jp6A.mjs.map +0 -1
- package/.output/server/chunks/build/Tooltip-BOazooWP.mjs.map +0 -1
- package/.output/server/chunks/build/VisuallyHiddenInput-D6kBJxVd.mjs.map +0 -1
- package/.output/server/chunks/build/_id_-B78ky13D.mjs.map +0 -1
- package/.output/server/chunks/build/_id_-z5N6HPyC.mjs.map +0 -1
- package/.output/server/chunks/build/about-CvSP73Ug.mjs.map +0 -1
- package/.output/server/chunks/build/analytics-CJPC6t4L.mjs.map +0 -1
- package/.output/server/chunks/build/default-zvbFgDJG.mjs.map +0 -1
- package/.output/server/chunks/build/edit-CFR5g2Qf.mjs.map +0 -1
- package/.output/server/chunks/build/import-CZo3djDi.mjs.map +0 -1
- package/.output/server/chunks/build/index-D7fe97l3.mjs.map +0 -1
- package/.output/server/chunks/build/index-Stqw0dEI.mjs.map +0 -1
- package/.output/server/chunks/build/mcp-B3IUvRgD.mjs.map +0 -1
- package/.output/server/chunks/build/notifications-abDv0id8.mjs.map +0 -1
- package/.output/server/chunks/build/pr-feedback-DjZID6q-.mjs.map +0 -1
- package/.output/server/chunks/build/settings-Du7YqF8i.mjs.map +0 -1
- package/.output/server/chunks/build/storage-B4vzxd8G.mjs.map +0 -1
- package/.output/server/chunks/build/test-cases-DUvaO1He.mjs.map +0 -1
- package/.output/server/chunks/build/useAiStatus-CWvIo32Q.mjs.map +0 -1
- package/.output/server/chunks/build/useCopyRich-BemRsKgv.mjs.map +0 -1
- package/.output/server/chunks/build/useDesktopDownload-D49JRQSw.mjs.map +0 -1
- package/.output/server/chunks/build/useOpenInIde-4GFf-kdi.mjs.map +0 -1
- package/.output/server/chunks/build/useSettingsNav-C3O866KC.mjs.map +0 -1
- package/.output/server/chunks/build/useTauri-lRT8zkLv.mjs +0 -7
- package/.output/server/chunks/build/useTauri-lRT8zkLv.mjs.map +0 -1
- package/.output/server/chunks/build/virtualizer-Cd1hhlxC.mjs +0 -940
- package/.output/server/chunks/build/virtualizer-Cd1hhlxC.mjs.map +0 -1
- package/.output/server/chunks/build/wasted-time-lYkx5YO4.mjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as ut,a as dt}from"./279D2RYp.js";import{_ as mt,a as pt}from"./C7P1UCO2.js";import{_ as _t}from"./BuMC3WjZ.js";import{_ as ft,a as gt}from"./CHEFCN8Q.js";import{d as yt,e as xt,b as bt,c as l,j as o,g as s,F as R,R as vt,o as a,i as c,I as ht,m as d,y as P,f as m,_ as kt,v as _,t as y,k as i,D as jt,h as N,r as x,L as Rt}from"./NQikbhmK.js";import{_ as $t}from"./DcmZRa_F.js";import{_ as Ct}from"./CV9-fTmY.js";import{_ as Tt}from"./tvgqrYDd.js";import{_ as Pt}from"./BSIxhGsh.js";import{_ as Nt}from"./BccXfBfI.js";import{_ as Ut}from"./C9_jrmk9.js";import{_ as Dt}from"./DiOLdHBC.js";import{_ as Ft}from"./Cdff9XNh.js";import{_ as St}from"./DLSrtpsA.js";import{_ as Bt}from"./CK_2LZBS.js";import{o as Kt,s as U,_ as Lt}from"./C5iG7O4O.js";import{_ as Vt}from"./B3HO8kuh.js";import{p as wt,i as b}from"./CDk0q2hV.js";import{u as w}from"./CpjgB2aY.js";import"./YVN7WG7q.js";import"./BjaRappk.js";import"./Bn0YQDyy.js";import"./DP8hfJ9h.js";import"./D-c8ZSws.js";import"./FUXhyidq.js";import"./B9WhzpKO.js";import"./CYsTqbBS.js";import"./eaVkJRSa.js";import"./DiZyJYez.js";import"./BeLWlVK0.js";import"./g26aVPxc.js";import"./BYDaY0Z7.js";const zt={class:"flex flex-wrap items-center gap-3 mb-4"},Ht={key:0,class:"flex flex-wrap items-center gap-2"},It={class:"text-sm text-muted shrink-0 inline-flex items-center gap-1"},At=["onClick"],Ot={class:"flex flex-col gap-1"},qt={class:"flex items-center gap-2"},Mt={key:0,class:"flex flex-wrap gap-1"},Et={key:0,class:"text-xs text-gray-600 italic"},Gt={key:1},Qt={key:0,class:"text-xs text-gray-600"},Xt={key:1,class:"text-xs text-gray-600 italic"},Jt={key:0,class:"flex items-center gap-1 flex-wrap"},Wt={key:0,class:"text-xs font-medium bg-gray-100 dark:bg-gray-800 px-1.5 py-0.5 rounded"},Yt={key:1,class:"text-xs text-gray-500"},Zt={key:1,class:"text-xs text-gray-600 italic"},te={key:1,class:"text-xs text-gray-600 italic"},ee={key:1,class:"text-xs text-gray-600 italic"},ae={class:"flex justify-end gap-2"},se={key:1,class:"space-y-2","aria-busy":"true"},oe={key:2,class:"text-center py-12 text-gray-500"},ne={class:"text-xs text-gray-400 max-w-sm"},le={class:"flex w-full justify-end gap-2"},He=yt({__name:"index",setup(re){xt({title:"Projects — Piwi Dashboard"});const{data:v,refresh:D,status:z}=w("/api/projects",{key:"projects",lazy:!0,default:()=>[]},"$AIGg5yw_0K"),{data:H,refresh:I}=w("/api/tags",{lazy:!0},"$qcllBXh9C_"),F=bt(),$=N(()=>H.value?.tags||[]),A=N(()=>z.value==="pending"&&!v.value?.length),h=x(""),u=x([]),S=N(()=>{let n=v.value||[];if(h.value.trim()){const e=h.value.trim().toLowerCase();n=n.filter(p=>(p.label||p.name).toLowerCase().includes(e)||p.name.toLowerCase().includes(e))}return u.value.length>0&&(n=n.filter(e=>u.value.some(p=>(e.tags||[]).some(T=>T.id===p)))),n});function O(n){const e=u.value.indexOf(n);e===-1?u.value.push(n):u.value.splice(e,1)}function q(n){return u.value.includes(n)}const f=x(!1),M=Kt({name:U().min(1,"Project name is required").max(100),label:U().optional(),description:U().optional()}),r=Rt({name:"",label:"",description:""}),k=x([]),C=x(!1);async function E(){if(r.name?.trim())try{C.value=!0,await $fetch("/api/projects",{method:"POST",body:{name:r.name.trim(),label:r.label?.trim()||null,description:r.description?.trim()||null,tagIds:k.value.map(n=>n.id)}}),F.add({title:"Project created",description:`Project "${r.name}" has been created`,color:"success"}),f.value=!1,r.name="",r.label="",r.description="",k.value=[],await D()}catch(n){const e=n&&typeof n=="object"&&"data"in n?n.data?.message:void 0;F.add({title:"Failed to create project",description:e||"An error occurred",color:"error"})}finally{C.value=!1}}const G=[{header:"Project",columns:[{accessorKey:"name",header:b("Name")},{accessorKey:"totalRuns",header:b("Runs")}]},{accessorKey:"latestRunData",header:"Latest run",columns:[{accessorKey:"latestRun",header:b("Date")},{accessorKey:"branch",header:"Branch"},{accessorKey:"duration",header:b("Duration")},{accessorKey:"status",header:b("Status")},{accessorKey:"testRatio",header:"Test status"},{accessorKey:"report",header:"Reports"}]},{accessorKey:"actions",header:"Project actions"}];return(n,e)=>{const p=ut,T=dt,B=mt,Q=_t,X=gt,J=ht,K=$t,g=kt,L=jt,W=Ct,Y=Tt,Z=Pt,tt=Nt,et=Ut,at=Dt,V=Ft,st=pt,ot=St,nt=ft,lt=Bt,rt=Lt,it=Vt,ct=vt;return a(),l(R,null,[o(nt,{id:"projects"},{header:s(()=>[o(X,null,{leading:s(()=>[o(p),o(T,{items:[{label:"Home",icon:"i-lucide-house",to:"/"},{label:"Projects"}]})]),right:s(()=>[o(Q,{actions:[{label:"New project",icon:"i-lucide-plus",onClick:()=>f.value=!0},{label:"Refresh",icon:"i-lucide-refresh-cw",variant:"outline",onClick:()=>i(D)()}]},{leading:s(()=>[o(B,{topic:"projects.table",size:"sm"})]),_:1},8,["actions"])]),_:1})]),body:s(()=>[c("div",zt,[o(J,{modelValue:h.value,"onUpdate:modelValue":e[0]||(e[0]=t=>h.value=t),icon:"i-lucide-search",placeholder:"Search projects by name...",class:"min-w-48 flex-1",ui:{base:"w-full"}},null,8,["modelValue"]),$.value.length>0?(a(),l("div",Ht,[c("span",It,[e[10]||(e[10]=d(" Filter by tag (any match): ",-1)),o(B,{topic:"projects.tag-filter"})]),(a(!0),l(R,null,P($.value,t=>(a(),l("button",{key:t.id,type:"button",class:"cursor-pointer focus:outline-none",onClick:j=>O(t.id)},[o(K,{text:t.text,color:t.color,variant:q(t.id)?"solid":"outline"},null,8,["text","color","variant"])],8,At))),128)),u.value.length>0?(a(),m(g,{key:0,size:"xs",variant:"ghost",color:"neutral",icon:"i-lucide-x",label:"Clear filters",onClick:e[1]||(e[1]=t=>u.value=[])})):_("",!0)])):_("",!0)]),S.value.length>0?(a(),m(at,{key:0,"min-width":"60rem",bleed:!1},{default:s(()=>[o(et,{data:S.value,columns:G,ui:{base:"table-fixed border-separate border-spacing-0",thead:"[&>tr]:bg-elevated/50 [&>tr]:after:content-none",tbody:"[&>tr]:last:[&>td]:border-b-0",th:"first:rounded-l-lg last:rounded-r-lg border-y border-default first:border-l last:border-r",td:"border-b border-default"}},{"name-cell":s(({row:t})=>[c("div",Ot,[c("div",qt,[o(L,{to:`/projects/${t.original.id}`,class:"text-primary hover:underline font-medium"},{default:s(()=>[d(y(t.original.label||t.original.name),1)]),_:2},1032,["to"])]),t.original.tags?.length?(a(),l("div",Mt,[(a(!0),l(R,null,P(t.original.tags,j=>(a(),m(K,{key:j.id,text:j.text,color:j.color},null,8,["text","color"]))),128))])):_("",!0)])]),"totalRuns-cell":s(({row:t})=>[t.original.totalRuns===0?(a(),l("span",Et,"No data")):(a(),l("span",Gt,y(t.original.totalRuns)+" runs",1))]),"latestRun-cell":s(({row:t})=>[t.original.latestRun?(a(),l("span",Qt,y(("prettyDateFormat"in n?n.prettyDateFormat:i(wt))(t.original.latestRun.startTime)),1)):(a(),l("span",Xt,"No data"))]),"branch-cell":s(({row:t})=>[t.original.latestRun?.metadata?.scm?(a(),l("div",Jt,[t.original.latestRun.metadata.scm.branch?(a(),l("span",Wt,y(t.original.latestRun.metadata.scm.branch),1)):_("",!0),t.original.latestRun.metadata.scm.commit?(a(),l("code",Yt,y(t.original.latestRun.metadata.scm.commit.substring(0,7)),1)):_("",!0)])):_("",!0)]),"duration-cell":s(({row:t})=>[t.original.latestRun?.duration!=null?(a(),m(W,{key:0,ms:t.original.latestRun.duration,class:"text-sm text-gray-600"},null,8,["ms"])):(a(),l("span",Zt,"No data"))]),"status-cell":s(({row:t})=>[t.original.latestRun?(a(),m(Y,{key:0,status:t.original.latestRun.status},null,8,["status"])):(a(),l("span",te,"No data"))]),"testRatio-cell":s(({row:t})=>[t.original.latestRun?(a(),m(Z,{key:0,passed:t.original.latestRun.passedTests,failed:t.original.latestRun.failedTests,skipped:t.original.latestRun.skippedTests,flaky:t.original.latestRun.flakyTests,"did-not-run":t.original.latestRun.didNotRunTests??0,total:t.original.latestRun.totalTests},null,8,["passed","failed","skipped","flaky","did-not-run","total"])):(a(),l("span",ee,"No data"))]),"report-cell":s(({row:t})=>[t.original.latestRun?(a(),m(tt,{key:0,reports:t.original.latestRun.reports},null,8,["reports"])):_("",!0)]),"actions-header":s(()=>[...e[11]||(e[11]=[c("div",{class:"text-right"},"Project actions",-1)])]),"actions-cell":s(({row:t})=>[c("div",ae,[o(g,{to:`/projects/${t.original.id}`,size:"sm",variant:"outline"},{default:s(()=>[...e[12]||(e[12]=[d("View details",-1)])]),_:1},8,["to"]),o(g,{to:`/projects/${t.original.id}/edit`,size:"sm",variant:"ghost",icon:"i-lucide-pencil"},null,8,["to"])])]),_:1},8,["data"])]),_:1})):A.value?(a(),l("div",se,[e[13]||(e[13]=c("span",{class:"sr-only",role:"status"},"Loading projects…",-1)),o(V,{class:"h-10 w-full rounded-lg"}),(a(),l(R,null,P(6,t=>o(V,{key:t,class:"h-14 w-full rounded-lg"})),64))])):i(v)&&i(v).length>0?(a(),l("div",oe,[...e[14]||(e[14]=[c("p",{class:"text-lg mb-2"},"No projects match your search",-1),c("p",{class:"text-sm"},"Try adjusting your search or filters",-1)])])):(a(),m(ot,{key:3,icon:"i-lucide-rocket",text:"No projects yet"},{default:s(()=>[c("p",ne,[e[17]||(e[17]=d(" Projects are created automatically once the reporter submits its first run — see the ",-1)),o(L,{to:"/",class:"text-primary hover:underline"},{default:s(()=>[...e[15]||(e[15]=[d("home page",-1)])]),_:1}),e[18]||(e[18]=d(" for a copy-paste setup snippet, or the ",-1)),o(st,{to:"reporter","no-icon":"",class:"text-primary hover:underline"},{default:s(()=>[...e[16]||(e[16]=[d("reporter docs",-1)])]),_:1}),e[19]||(e[19]=d(". ",-1))]),o(g,{icon:"i-lucide-plus",label:"New project",variant:"ghost",size:"sm",class:"mt-2",onClick:e[2]||(e[2]=t=>f.value=!0)})]),_:1}))]),_:1}),o(ct,null,{default:s(()=>[o(it,{open:f.value,title:"Create new project","onUpdate:open":e[9]||(e[9]=t=>f.value=t)},{body:s(()=>[o(rt,{schema:i(M),state:i(r)},{default:s(()=>[o(lt,{mode:"create",name:i(r).name,"onUpdate:name":e[3]||(e[3]=t=>i(r).name=t),label:i(r).label,"onUpdate:label":e[4]||(e[4]=t=>i(r).label=t),description:i(r).description,"onUpdate:description":e[5]||(e[5]=t=>i(r).description=t),tags:k.value,"onUpdate:tags":e[6]||(e[6]=t=>k.value=t),"all-tags":$.value,onTagCreated:e[7]||(e[7]=t=>i(I)())},null,8,["name","label","description","tags","all-tags"])]),_:1},8,["schema","state"])]),footer:s(()=>[c("div",le,[o(g,{color:"neutral",variant:"ghost",label:"Cancel",onClick:e[8]||(e[8]=t=>f.value=!1)}),o(g,{label:"Create project",icon:"i-lucide-plus",loading:C.value,onClick:E},null,8,["loading"])])]),_:1},8,["open"])]),_:1})],64)}}});export{He as default};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{_ as Q,a as Y}from"./Ar3IelOY.js";import{_ as B}from"./DprVVyUQ.js";import{_ as H}from"./DT53RWbC.js";import{_ as V}from"./rWNTSFD6.js";import{_ as J}from"./B44A4LSJ.js";import{d as D,f as k,g as _,o as m,i as t,j as n,m as l,t as I,k as e,h as S,_ as M,b as X,B as Z,c as $,p as N,r as w,ax as L,w as P,F as tt,v as b,A as et,x as ot}from"./NQikbhmK.js";import{u as E}from"./Bn0YQDyy.js";import{_ as nt}from"./Jo8kRmHz.js";import{a as st}from"./C7P1UCO2.js";import{f as at}from"./CDk0q2hV.js";import{u as it}from"./CHNwfU1y.js";import{u as j}from"./CpjgB2aY.js";import"./eptP4pGv.js";import"./CYsTqbBS.js";import"./g26aVPxc.js";import"./CNFYDQmj.js";import"./BYDaY0Z7.js";import"./BjaRappk.js";const lt={class:"space-y-4 text-sm"},rt={class:"space-y-1"},ct={class:"space-y-3"},ut={class:"space-y-1"},dt={class:"flex items-start gap-2"},pt={class:"text-xs break-all flex-1"},mt={class:"space-y-1"},_t=`reporter: [
|
|
2
|
-
['@piwitests/reporter', { projectName: 'my-project' }],
|
|
3
|
-
],`,ft=D({__name:"DesktopReporterCard",props:{url:{},token:{}},setup(f){const s=f,{copy:u}=E(),r=S(()=>`reporter: [
|
|
4
|
-
['@piwitests/reporter', {
|
|
5
|
-
serverUrl: '${s.url}',
|
|
6
|
-
projectName: 'my-project',
|
|
7
|
-
apiKey: '${s.token}',
|
|
8
|
-
}],
|
|
9
|
-
],`);return(d,a)=>{const o=V,p=J,y=M,v=B;return m(),k(v,{icon:"i-lucide-upload",title:"Send results to this app"},{subtitle:_(()=>[...a[1]||(a[1]=[l(" While this app is running, the Playwright reporter finds it on its own — no URL and no token in your config. ",-1)])]),default:_(()=>[t("div",lt,[t("div",rt,[a[2]||(a[2]=t("div",{class:"text-muted"},"playwright.config.ts",-1)),n(o,{code:_t,lang:"typescript"}),a[3]||(a[3]=t("p",{class:"text-muted text-xs"},[l(" The app publishes its address and token to "),t("code",null,"~/.piwi/desktop.json"),l(" while it runs. The reporter reads that file only when your config and environment set no "),t("code",null,"serverUrl"),l(" and no "),t("code",null,"apiKey"),l(", so a project already pointed at another dashboard is never redirected here. ")],-1))]),n(p),t("div",ct,[a[6]||(a[6]=t("p",{class:"text-muted"},[l(" Configure it by hand when discovery cannot apply — tests running as another user, in a container, or with a config that already sets "),t("code",null,"serverUrl"),l(". The token is a local secret: prefer the "),t("code",null,"PIWI_API_KEY"),l(" env var over committing it. ")],-1)),t("div",ut,[a[4]||(a[4]=t("div",{class:"text-muted"},"Access token",-1)),t("div",dt,[t("code",pt,I(f.token),1),n(y,{icon:"i-lucide-copy",color:"neutral",variant:"ghost",size:"xs","aria-label":"Copy access token",onClick:a[0]||(a[0]=c=>e(u)(f.token,{toast:!0}))})])]),t("div",mt,[a[5]||(a[5]=t("div",{class:"text-muted"},"playwright.config.ts",-1)),n(o,{code:e(r),lang:"typescript"},null,8,["code"])])])])]),_:1})}}}),vt=Object.assign(ft,{__name:"DesktopReporterCard"}),kt={class:"space-y-3 text-sm"},yt={class:"space-y-1"},gt={class:"flex items-start gap-2"},xt={class:"text-xs break-all flex-1"},ht={class:"space-y-1"},bt={class:"flex items-start gap-2"},Ct={class:"text-xs break-all flex-1"},wt={class:"space-y-1"},$t=D({__name:"DesktopMcpCard",props:{url:{},token:{}},setup(f){const s=f,{copy:u}=E(),r=S(()=>`${s.url}/mcp`),d=S(()=>`claude mcp add --transport http piwi ${r.value} \\
|
|
10
|
-
--header "Authorization: Bearer ${s.token}"`);return(a,o)=>{const p=M,y=V,v=B;return m(),k(v,{icon:"i-lucide-plug",title:"Connect an AI assistant (MCP)"},{subtitle:_(()=>[...o[2]||(o[2]=[l(" This app exposes a local MCP endpoint. Point your client at the URL below and authenticate with the access token — it is the Bearer token, even though sign-in is off. ",-1)])]),default:_(()=>[t("div",kt,[t("div",yt,[o[3]||(o[3]=t("div",{class:"text-muted"},"MCP URL",-1)),t("div",gt,[t("code",xt,I(e(r)),1),n(p,{icon:"i-lucide-copy",color:"neutral",variant:"ghost",size:"xs","aria-label":"Copy MCP URL",onClick:o[0]||(o[0]=c=>e(u)(e(r),{toast:!0}))})])]),t("div",ht,[o[4]||(o[4]=t("div",{class:"text-muted"},"Access token",-1)),t("div",bt,[t("code",Ct,I(f.token),1),n(p,{icon:"i-lucide-copy",color:"neutral",variant:"ghost",size:"xs","aria-label":"Copy access token",onClick:o[1]||(o[1]=c=>e(u)(f.token,{toast:!0}))})])]),t("div",wt,[o[5]||(o[5]=t("div",{class:"text-muted"},"Claude Code",-1)),n(y,{code:e(d),lang:"sh"},null,8,["code"])])])]),_:1})}}}),St=Object.assign($t,{__name:"DesktopMcpCard"}),Bt={key:0,class:"flex items-center gap-2 text-sm text-muted"},Dt={key:1,class:"space-y-4"},Rt={class:"flex items-start justify-between gap-4"},Ut={class:"flex items-start justify-between gap-4"},Lt={key:2,class:"space-y-1 text-sm text-muted"},Pt=D({__name:"DesktopServiceCard",setup(f){const s=X(),u=w(!0),r=w(!1),d=w(!1),a=w(!1),o=w(!1);async function p(){const c=L();if(!c){r.value=!1,u.value=!1;return}try{const i=await c.invoke("desktop_get_service_settings");a.value=!!i.run_in_background,o.value=!!i.start_on_login,r.value=!0}catch{r.value=!1}finally{u.value=!1}}Z(p);async function y(c){const i=L();if(i){d.value=!0;try{await i.invoke("desktop_set_run_in_background",{enabled:c}),a.value=c}catch{s.add({title:'Could not update "Run in background"',color:"error"})}finally{d.value=!1}}}async function v(c){const i=L();if(i){d.value=!0;try{await i.invoke("desktop_set_start_on_login",{enabled:c}),o.value=c}catch{s.add({title:'Could not update "Start on login"',color:"error"})}finally{d.value=!1}}}return(c,i)=>{const R=N,C=nt,U=B;return m(),k(U,{icon:"i-lucide-monitor-cog",title:"Desktop app"},{subtitle:_(()=>[...i[0]||(i[0]=[l(" Keep Piwi running in the background and start it automatically when you log in. ",-1)])]),default:_(()=>[e(u)?(m(),$("div",Bt,[n(R,{name:"i-lucide-loader-2",class:"size-4 animate-spin"}),i[1]||(i[1]=l(" Checking… ",-1))])):e(r)?(m(),$("div",Dt,[t("div",Rt,[i[2]||(i[2]=t("div",{class:"space-y-0.5"},[t("p",{class:"text-sm font-medium"},"Run in background"),t("p",{class:"text-xs text-muted"},"Closing the window keeps the server running in the tray instead of quitting.")],-1)),n(C,{"model-value":e(a),disabled:e(d),"onUpdate:modelValue":y},null,8,["model-value","disabled"])]),t("div",Ut,[i[3]||(i[3]=t("div",{class:"space-y-0.5"},[t("p",{class:"text-sm font-medium"},"Start on login"),t("p",{class:"text-xs text-muted"}," Launch Piwi automatically (hidden in the tray) when you sign in to your computer. ")],-1)),n(C,{"model-value":e(o),disabled:e(d),"onUpdate:modelValue":v},null,8,["model-value","disabled"])])])):(m(),$("div",Lt,[...i[4]||(i[4]=[t("p",null,"Manage these from the Piwi tray icon:",-1),t("p",{class:"text-xs"},[l(" Right-click the Piwi icon in your system tray for "),t("strong",null,"Run in background"),l(" and "),t("strong",null,"Start on login"),l(". On Windows the icon may be hidden under the “show hidden icons” arrow (▲) next to the clock — drag it onto the taskbar to keep it in view. ")],-1)])]))]),_:1})}}}),jt=Object.assign(Pt,{__name:"DesktopServiceCard"}),It={class:"space-y-6"},Tt={class:"flex flex-wrap items-center gap-x-6 gap-y-3 text-sm"},te=D({__name:"about",async setup(f){let s,u;const r=et(),d=it(),{data:a}=([s,u]=P(()=>j("/api/version","$mIoGdvWYhF")),s=await s,u(),s),{data:o}=([s,u]=P(()=>j("/api/admin/stats",{immediate:d,default:()=>null},"$IuuLVEbWlE")),s=await s,u(),s),{data:p}=([s,u]=P(()=>j("/api/desktop/reporter-config",{immediate:d,default:()=>null},"$A4rSe7BAN_")),s=await s,u(),s),y=r.public.appVersion,v=r.public.buildSha,c=r.public.buildTime,i=r.public.nodeVersion,R=r.public.authEnabled,C=S(()=>v?v.slice(0,7):null),U=S(()=>{const g=a.value?.dbBackend;return g==="postgresql"?"PostgreSQL":g==="sqlite"?"SQLite":g??null});return(g,x)=>{const h=Y,O=Q,T=B,z=H,W=vt,F=St,K=jt,q=st,A=ot,G=N;return m(),$("div",It,[n(T,{icon:"i-lucide-info",title:"Application"},{default:_(()=>[n(O,null,{default:_(()=>[n(h,{label:"Version",value:`v${e(y)}`},null,8,["value"]),e(C)?(m(),k(h,{key:0,label:"Build",value:e(C),hint:e(v)},null,8,["value","hint"])):b("",!0),e(c)?(m(),k(h,{key:1,label:"Built",value:("formatRelativeTime"in g?g.formatRelativeTime:e(at))(e(c)),hint:e(c)},null,8,["value","hint"])):b("",!0),n(h,{label:"Node.js",value:e(i)},null,8,["value"]),n(h,{label:"Database",value:e(U)},null,8,["value"]),n(h,{label:"Authentication",value:e(R)?"Enabled":"Disabled"},null,8,["value"])]),_:1})]),_:1}),e(d)?(m(),$(tt,{key:0},[e(o)?(m(),k(z,{key:0,database:e(o).databaseLocation,storage:e(o).storageLocation},null,8,["database","storage"])):b("",!0),e(p)?(m(),k(W,{key:1,url:e(p).url,token:e(p).token},null,8,["url","token"])):b("",!0),e(p)?(m(),k(F,{key:2,url:e(p).url,token:e(p).token},null,8,["url","token"])):b("",!0),n(K)],64)):b("",!0),n(T,{icon:"i-lucide-book-open",title:"Resources"},{default:_(()=>[t("div",Tt,[n(q,{to:""},{default:_(()=>[...x[0]||(x[0]=[l("Documentation",-1)])]),_:1}),n(A,{to:"/docs",class:"inline-flex items-center gap-1 text-primary hover:underline"},{default:_(()=>[...x[1]||(x[1]=[l(" API reference ",-1)])]),_:1}),n(A,{to:"https://github.com/piwitests/platform",target:"_blank",rel:"noopener noreferrer",class:"inline-flex items-center gap-1 text-primary hover:underline"},{default:_(()=>[x[2]||(x[2]=l(" GitHub ",-1)),n(G,{name:"i-lucide-external-link",class:"w-3.5 h-3.5 shrink-0"})]),_:1})])]),_:1})])}}});export{te as default};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{_ as Jt}from"./279D2RYp.js";import{_ as qt}from"./BqV0l12c.js";import{d as re,o as t,f as k,g as d,i as n,q,k as e,j as i,t as c,c as o,F as B,y as te,s as fe,m as g,v as l,R as yt,p as ce,h as C,D as Pe,_ as Ie,b as Qt,B as xt,l as pe,r as A,ab as we,H as he,ac as Zt,A as Oe,Q as $e,u as Xt,a as Yt,w as gt,e as es,ad as ts,M as ss}from"./NQikbhmK.js";import{d as ns,e as as,h as He,a as os,b as rs,c as is,_ as ls,n as cs,o as us,p as ds,u as ms,f as gs,i as ps,j as fs,k as ys,l as xs,m as hs}from"./dYCKgE-3.js";import{_ as vs}from"./BuMC3WjZ.js";import{_ as _s,a as ks}from"./CHEFCN8Q.js";import{_ as bs,a as ws,b as $s,c as Cs,d as Ts}from"./Dgf5N4Ng.js";import{_ as Re}from"./CV9-fTmY.js";import{_ as Ss}from"./BPQoBGg5.js";import{_ as Is}from"./nv9-6vBK.js";import{_ as ht,a as Ke}from"./C7P1UCO2.js";import{_ as Rs}from"./eptP4pGv.js";import{_ as Ls}from"./y17lMTFy.js";import{u as zs,_ as Ms,d as Ds,e as Ns,f as js,g as As,h as Ps,j as Us,a as vt,i as Te,b as Ae,c as Bs}from"./HXerICAi.js";import{f as Se,m as Fs,c as Vs,g as Es,n as _t,o as We,q as Ge,a as Os,j as Hs,r as pt}from"./CDk0q2hV.js";import{_ as kt}from"./DP8hfJ9h.js";import{_ as ye}from"./DprVVyUQ.js";import{_ as Ks}from"./eaVkJRSa.js";import{_ as Je}from"./cHAnlQbv.js";import{_ as qe}from"./BxCKKeYs.js";import{_ as bt}from"./DLSrtpsA.js";import{f as be}from"./D-c8ZSws.js";import{_ as Ws}from"./rWNTSFD6.js";import{_ as Gs}from"./DGfAxLHV.js";import{_ as Js}from"./BPRffDuo.js";import{_ as qs}from"./C9_jrmk9.js";import{_ as Qs}from"./DiOLdHBC.js";import{_ as Zs,a as Xs}from"./Ar3IelOY.js";import{_ as Ys}from"./D55D4EYo.js";import{b as en}from"./CylWPruw.js";import{u as ft}from"./CpjgB2aY.js";import{u as tn}from"./Bn0YQDyy.js";import"./YVN7WG7q.js";import"./B44A4LSJ.js";import"./CtQBsNUb.js";import"./CHNwfU1y.js";import"./D0HNloZ9.js";import"./B3HO8kuh.js";import"./DS636elg.js";import"./g26aVPxc.js";import"./BjaRappk.js";import"./IvQlbZk6.js";import"./FUXhyidq.js";import"./ZFiQCMUB.js";import"./Dnpkl-1q.js";import"./D7W_4Sqc.js";import"./DX-MDGb3.js";const sn={class:"text-sm font-semibold truncate min-w-0"},nn={class:"flex items-center gap-3 ml-auto max-sm:hidden"},an={class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},on={class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},rn={class:"text-gray-700 dark:text-gray-300"},ln={class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},cn={class:"text-gray-700 dark:text-gray-300"},un={class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},dn={class:"text-gray-700 dark:text-gray-300"},mn={key:0,class:"text-xs text-gray-500 tabular-nums whitespace-nowrap"},gn={class:"text-gray-700 dark:text-gray-300"},pn={class:"grid grid-cols-1 lg:grid-cols-12 gap-4"},fn={class:"space-y-3"},yn={class:"flex items-start gap-3"},xn={class:"min-w-0 flex-1"},hn={class:"flex items-center gap-2 flex-wrap"},vn={class:"text-base font-bold truncate"},_n={class:"text-xs text-gray-500 mt-0.5"},kn={key:0},bn=["title"],wn={key:1,class:"ml-2"},$n={class:"grid grid-cols-2 sm:grid-cols-4 gap-2"},Cn={class:"rounded-lg bg-gray-50 dark:bg-gray-900 p-3"},Tn={class:"text-xl font-bold mt-0.5"},Sn={class:"rounded-lg bg-gray-50 dark:bg-gray-900 p-3"},In={class:"text-xl font-bold mt-0.5"},Rn={class:"rounded-lg bg-gray-50 dark:bg-gray-900 p-3"},Ln={class:"text-xl font-bold mt-0.5"},zn={class:"rounded-lg bg-gray-50 dark:bg-gray-900 p-3"},Mn={class:"text-xl font-bold mt-0.5"},Dn={key:0,class:"flex items-center gap-2 text-sm"},Nn={class:"text-gray-700 dark:text-gray-300 truncate"},jn={key:0,class:"text-gray-500 shrink-0"},An={key:1,class:"flex items-center gap-1.5 text-sm"},Pn=re({__name:"TestCaseSummary",props:{testCase:{},scmInfo:{},ciInfo:{},browser:{},environment:{},stepsCount:{},historicalTiming:{},stableLinks:{}},emits:["refresh"],setup(s){const _=s,x=C(()=>{const u=_.testCase;if(!u)return[];const r=[];return u.isNewRegression&&r.push({label:"New regression",color:"error",title:"Passed in the baseline run, failing here"}),u.isNewFlaky&&r.push({label:"New flaky",color:"warning",title:"Newly started passing only on retry"}),u.status==="passed"&&(u.retries??0)>0&&r.push({label:"Passed on retry",color:"warning",title:"This test failed then passed on a retry"}),r}),b=C(()=>(_.testCase?.testAnnotations??[]).filter(u=>!Fs(u.type))),w=C(()=>_.testCase?.startedAt??null),{summaryColSpanClass:p,blockColSpanClass:a}=zs(()=>{let u=0;return _.scmInfo&&u++,(_.ciInfo||_.environment||_.browser)&&u++,u++,u});return(u,r)=>{const P=bs,z=Re,$=Ss,h=fe,F=Is,M=yt,m=ce,I=ht,E=Rs,U=ws,R=$s,W=Ls,G=Cs,N=Ms;return t(),k(N,{"storage-key":"test-case"},{folded:d(()=>[i(P,{status:s.testCase?.status??"",size:"sm"},null,8,["status"]),n("span",sn,c(s.testCase?.title),1),n("div",nn,[n("span",an,[r[0]||(r[0]=g(" Dur: ",-1)),i(z,{ms:s.testCase?.duration,class:"font-bold text-gray-700 dark:text-gray-300"},null,8,["ms"])]),n("span",on,[r[1]||(r[1]=g(" Retries: ",-1)),n("strong",rn,c(s.testCase?.retries??0),1)]),n("span",ln,[r[2]||(r[2]=g(" Steps: ",-1)),n("strong",cn,c(s.stepsCount),1)]),n("span",un,[r[3]||(r[3]=g(" Worker: ",-1)),n("strong",dn,c(s.testCase?.workerIndex??"—"),1)]),s.testCase?.shardIndex!=null?(t(),o("span",mn,[r[4]||(r[4]=g(" Shard: ",-1)),n("strong",gn,c(s.testCase.shardIndex),1)])):l("",!0)]),s.browser?(t(),k($,{key:0,browser:s.browser,size:"sm",class:"shrink-0 max-sm:hidden"},null,8,["browser"])):l("",!0)]),default:d(()=>[n("div",pn,[n("div",{class:q(e(p))},[i(E,{class:"shadow-xs h-full"},{default:d(()=>[n("div",fn,[n("div",yn,[i(P,{status:s.testCase?.status??"",size:"md"},null,8,["status"]),n("div",xn,[n("div",hn,[n("h2",vn,c(s.testCase?.title),1),(t(!0),o(B,null,te(e(x),Z=>(t(),k(h,{key:Z.label,color:Z.color,variant:"subtle",size:"xs",title:Z.title},{default:d(()=>[g(c(Z.label),1)]),_:2},1032,["color","title"]))),128)),(t(!0),o(B,null,te(e(b),(Z,Q)=>(t(),k(h,{key:`ann-${Q}`,color:"neutral",variant:"soft",size:"xs",class:"font-mono",title:Z.description||Z.type},{default:d(()=>[g(" @"+c(Z.type),1)]),_:2},1032,["title"]))),128)),i(F,{tags:s.testCase?.tags,meta:s.testCase?.testMeta},null,8,["tags","meta"])]),n("p",_n,[s.testCase?.location?(t(),o("span",kn,c(s.testCase.location),1)):l("",!0),i(M,null,{default:d(()=>[e(w)?(t(),o("span",{key:0,class:"ml-2 text-gray-400",title:new Date(e(w)).toLocaleString()}," started "+c(("formatRelativeTime"in u?u.formatRelativeTime:e(Se))(e(w))),9,bn)):l("",!0)]),_:1}),s.historicalTiming?(t(),o("span",wn,[r[5]||(r[5]=g(" Avg ",-1)),i(z,{ms:s.historicalTiming.avg},null,8,["ms"]),r[6]||(r[6]=g(" · ",-1)),n("span",{class:q(s.historicalTiming.diff>0?"text-red-600":"text-green-600")},c(s.historicalTiming.diff>0?"+":"")+c(s.historicalTiming.pct)+"% ",3)])):l("",!0)])])]),n("div",$n,[n("div",Cn,[r[7]||(r[7]=n("p",{class:"text-xs font-medium text-gray-500 uppercase tracking-wider"},"Duration",-1)),n("p",Tn,[i(z,{ms:s.testCase?.duration},null,8,["ms"])])]),n("div",Sn,[r[8]||(r[8]=n("p",{class:"text-xs font-medium text-gray-500 uppercase tracking-wider"},"Retries",-1)),n("p",In,c(s.testCase?.retries??0),1)]),n("div",Rn,[r[9]||(r[9]=n("p",{class:"text-xs font-medium text-gray-500 uppercase tracking-wider"},"Steps",-1)),n("p",Ln,c(s.stepsCount),1)]),n("div",zn,[r[10]||(r[10]=n("p",{class:"text-xs font-medium text-gray-500 uppercase tracking-wider"},"Worker",-1)),n("p",Mn,c(s.testCase?.workerIndex??"—"),1)])]),s.testCase?.slowestStep?(t(),o("div",Dn,[i(m,{name:"i-lucide-zap",class:"size-4 text-amber-500 shrink-0"}),r[13]||(r[13]=n("span",{class:"font-medium text-amber-700 dark:text-amber-300"},"Slowest step:",-1)),n("span",Nn,c(s.testCase.slowestStep),1),s.testCase.slowestStepDuration?(t(),o("span",jn,[r[11]||(r[11]=g("(",-1)),i(z,{ms:s.testCase.slowestStepDuration},null,8,["ms"]),r[12]||(r[12]=g(")",-1))])):l("",!0)])):l("",!0),(s.testCase?.wastedTimeMs??0)>0?(t(),o("div",An,[i(m,{name:"i-lucide-hourglass",class:"size-4 text-amber-500 shrink-0"}),r[14]||(r[14]=n("span",{class:"font-medium text-amber-700 dark:text-amber-300"},"Wasted in fixed waits:",-1)),i(z,{ms:s.testCase?.wastedTimeMs,class:"text-gray-700 dark:text-gray-300"},null,8,["ms"]),i(I,{topic:"case.wasted-time"})])):l("",!0)])]),_:1})],2),s.scmInfo?(t(),k(U,{key:0,scm:s.scmInfo,class:q(e(a))},null,8,["scm","class"])):l("",!0),s.ciInfo||s.environment||s.browser?(t(),k(R,{key:1,ci:s.ciInfo,environment:s.environment,browser:s.browser,class:q(e(a))},null,8,["ci","environment","browser","class"])):l("",!0),i(G,{class:q(e(a)),title:"Links",icon:"i-lucide-link"},{default:d(()=>[s.testCase?.id?(t(),k(W,{key:0,"entity-type":"test_case","entity-id":s.testCase.id,links:s.stableLinks??null},null,8,["entity-id","links"])):l("",!0)]),_:1},8,["class"])])]),_:1})}}}),Un=Object.assign(Pn,{__name:"TestCaseSummary"}),Bn={class:"space-y-3"},Fn={key:0,class:"flex flex-wrap gap-1.5"},Vn={key:0,class:"text-sm text-gray-600 dark:text-gray-400"},En={class:"text-gray-800 dark:text-gray-200"},On={key:1},Hn={class:"flex items-center gap-1 flex-wrap"},Kn=re({__name:"TestCaseVerdictCard",props:{testCase:{},history:{},currentId:{}},setup(s){const _=s,x=u=>u==="failed"||u==="timedOut"||u==="timedout",b=C(()=>{const u=_.testCase;if(!u)return[];const r=[];return u.isNewRegression&&r.push({label:"New regression",color:"error",icon:"i-lucide-git-pull-request-arrow",title:"Passed in the baseline run, failing here — likely fallout from the latest change"}),u.isNewFlaky&&r.push({label:"New flaky",color:"warning",icon:"i-lucide-shuffle",title:"Newly started passing only on retry — intermittent failure"}),u.status==="timedOut"&&r.push({label:"Timed out",color:"warning",icon:"i-lucide-timer-off",title:"The test exceeded its timeout"}),(u.retries??0)>0&&r.push({label:u.status==="passed"?`Passed on retry ${u.retries}`:`Retried ${u.retries}×`,color:u.status==="passed"?"warning":"neutral",icon:"i-lucide-refresh-cw",title:`This execution retried ${u.retries} time${u.retries===1?"":"s"}`}),r}),w=C(()=>_.history.slice(0,24).slice().reverse()),p=C(()=>{const u=_.history;if(!u.length)return null;const r=Math.max(0,u.findIndex($=>$.id===_.currentId));let P=0;for(let $=r;$<u.length&&x(u[$].status);$++)P++;let z=null;for(let $=r+1;$<u.length;$++)if(u[$].status==="passed"){z=u[$];break}return{streak:P,lastPass:z,total:u.length,anchorFailing:x(u[r]?.status)}}),a=u=>({"bg-red-500 hover:bg-red-600":x(u),"bg-green-500 hover:bg-green-600":u==="passed","bg-yellow-500 hover:bg-yellow-600":u==="skipped","bg-gray-400 hover:bg-gray-500":!x(u)&&!["passed","skipped"].includes(u)});return(u,r)=>{const P=ce,z=fe,$=Pe,h=kt,F=yt,M=ye;return t(),k(M,{icon:"i-lucide-clipboard-check","icon-class":"text-amber-500",title:"Verdict",help:"case.verdict"},{default:d(()=>[n("div",Bn,[e(b).length?(t(),o("div",Fn,[(t(!0),o(B,null,te(e(b),m=>(t(),k(z,{key:m.label,color:m.color,variant:"subtle",size:"sm",title:m.title,class:"inline-flex items-center gap-1"},{default:d(()=>[i(P,{name:m.icon,class:"size-3 shrink-0"},null,8,["name"]),g(" "+c(m.label),1)]),_:2},1032,["color","title"]))),128))])):l("",!0),i(F,null,{default:d(()=>[e(p)?(t(),o("p",Vn,[e(p).streak>=1?(t(),o(B,{key:0},[r[1]||(r[1]=g(" Failing for ",-1)),n("strong",En,c(e(p).streak),1),g(" consecutive run"+c(e(p).streak===1?"":"s")+". ",1),e(p).lastPass?(t(),o(B,{key:0},[r[0]||(r[0]=g(" Last passed in ",-1)),i($,{to:`/test-run-cases/${e(p).lastPass.id}`,class:"text-primary hover:underline"},{default:d(()=>[g(" run #"+c(e(p).lastPass.runId),1)]),_:1},8,["to"]),g(" ("+c(("formatRelativeTime"in u?u.formatRelativeTime:e(Se))(e(p).lastPass.startTime))+"). ",1)],64)):e(p).total>1?(t(),o(B,{key:1},[g(" No passing run in the last "+c(e(p).total)+" recorded. ",1)],64)):(t(),o(B,{key:2},[g(" First recorded run of this test. ")],64))],64)):s.testCase?.status==="passed"?(t(),o(B,{key:1},[g(" This execution passed. ")],64)):l("",!0)])):l("",!0),e(w).length>1?(t(),o("div",On,[r[2]||(r[2]=n("p",{class:"text-xs text-gray-400 mb-1"},"Recent runs (oldest → newest)",-1)),n("div",Hn,[(t(!0),o(B,null,te(e(w),m=>(t(),k(h,{key:m.id,text:`Run #${m.runId}: ${m.status}`},{default:d(()=>[i($,{to:`/test-run-cases/${m.id}`,class:q(["size-3.5 rounded-sm inline-block transition-colors",[a(m.status),m.id===s.currentId?"ring-2 ring-offset-1 ring-primary":""]])},null,8,["to","class"])]),_:2},1032,["text"]))),128))])])):l("",!0)]),_:1})])]),_:1})}}}),Wn=Object.assign(Kn,{__name:"TestCaseVerdictCard"}),Gn={class:"space-y-3"},Jn={class:"space-y-1.5"},qn={class:"flex items-center gap-2 flex-wrap"},Qn={class:"text-xs text-gray-500"},Zn=["title"],Xn={class:"text-xs text-gray-500 dark:text-gray-400"},Yn={key:0,class:"rounded-lg border border-default bg-elevated/40 p-2.5 space-y-1"},ea={class:"flex items-center gap-1.5 flex-wrap"},ta={class:"text-xs text-gray-600 dark:text-gray-400 line-clamp-3"},sa=["title"],na=re({__name:"FailureClusterCard",props:{cluster:{}},setup(s){const _=s,x=C(()=>Math.max(0,_.cluster.sameRunCaseCount-1)),b=C(()=>{const p=_.cluster.diagnosis;return p&&p.status==="completed"&&p.summary?p:null}),w=p=>p==="high"?"success":p==="medium"?"warning":"neutral";return(p,a)=>{const u=fe,r=Pe,P=ce,z=Ie,$=ye;return t(),k($,{icon:"i-lucide-layers","icon-class":"text-primary",title:"Failure cluster",help:"cluster.concept"},{actions:d(()=>[s.cluster.isNew?(t(),k(u,{key:0,color:"warning",variant:"subtle",size:"sm"},{default:d(()=>[...a[0]||(a[0]=[g("New",-1)])]),_:1})):l("",!0),s.cluster.status&&s.cluster.status!=="open"?(t(),k(u,{key:1,color:s.cluster.status==="resolved"?"success":"neutral",variant:"subtle",size:"sm",class:"capitalize"},{default:d(()=>[g(c(s.cluster.status),1)]),_:1},8,["color"])):l("",!0)]),default:d(()=>[n("div",Gn,[n("div",Jn,[n("div",qn,[s.cluster.errorType?(t(),k(u,{key:0,color:e(Vs)(s.cluster.errorType),variant:"soft",size:"sm"},{default:d(()=>[g(c(s.cluster.errorType),1)]),_:1},8,["color"])):l("",!0),n("span",Qn,c(s.cluster.occurrences??0)+" occurrence"+c((s.cluster.occurrences??0)===1?"":"s"),1)]),n("p",{class:"font-mono text-xs text-gray-600 dark:text-gray-400 break-all line-clamp-2",title:s.cluster.signature},c(s.cluster.signature),9,Zn)]),n("p",Xn,[e(x)>0?(t(),o(B,{key:0},[g(" Matches "+c(e(x))+" other failing "+c(e(x)===1?"test":"tests")+" in this run. ",1)],64)):l("",!0),s.cluster.isNew?(t(),o(B,{key:2},[g("Opened a new cluster in this run.")],64)):(t(),o(B,{key:1},[a[1]||(a[1]=g(" Known failure — first seen in ",-1)),i(r,{to:`/test-runs/${s.cluster.firstSeenRunId}`,class:"text-primary hover:underline"},{default:d(()=>[g(" run #"+c(s.cluster.firstSeenRunId),1)]),_:1},8,["to"]),s.cluster.firstSeenAt?(t(),o(B,{key:0},[g(" ("+c(("formatRelativeTime"in p?p.formatRelativeTime:e(Se))(s.cluster.firstSeenAt))+")",1)],64)):l("",!0),a[2]||(a[2]=g(". ",-1))],64))]),e(b)?(t(),o("div",Yn,[n("div",ea,[i(P,{name:"i-lucide-sparkles",class:"size-3.5 text-primary shrink-0"}),a[3]||(a[3]=n("span",{class:"text-xs font-medium"},"AI verdict",-1)),e(b).category?(t(),k(u,{key:0,color:"neutral",variant:"soft",size:"xs"},{default:d(()=>[g(c(e(b).category),1)]),_:1})):l("",!0),e(b).confidence?(t(),k(u,{key:1,color:w(e(b).confidence),variant:"soft",size:"xs"},{default:d(()=>[g(c(e(b).confidence)+" confidence ",1)]),_:1},8,["color"])):l("",!0)]),n("p",ta,c(e(b).summary),1)])):l("",!0),s.cluster.triageNote?(t(),o("p",{key:1,class:"text-xs italic text-gray-500 dark:text-gray-400",title:s.cluster.triageNote}," “"+c(s.cluster.triageNote)+"” ",9,sa)):l("",!0),i(z,{to:`/failure-clusters/${s.cluster.id}`,size:"sm",color:"primary",variant:"solid",block:"","trailing-icon":"i-lucide-arrow-right"},{default:d(()=>[...a[4]||(a[4]=[g(" Open cluster investigation ",-1)])]),_:1},8,["to"])])]),_:1})}}}),aa=Object.assign(na,{__name:"FailureClusterCard"}),oa={class:"space-y-3"},ra={class:"text-xs text-gray-400 inline-flex items-center gap-1"},ia={key:0,class:"text-primary"},la={key:0,class:"flex items-center justify-between gap-2 rounded-lg border border-default bg-elevated/40 p-2.5"},ca={class:"inline-flex items-center gap-2 text-sm text-gray-500"},ua={key:1,class:"flex items-center gap-2"},da={key:2,class:"rounded-lg border border-dashed border-default p-4 text-center text-gray-400"},ma={class:"text-sm inline-flex items-center gap-1 justify-center"},ga={class:"pt-1 text-center"},pa=re({__name:"TestCaseAiCard",props:{testRunsCaseId:{}},setup(s){const _=s,{aiStatus:x}=Ds(),b=Qt(),w=A(null),p=A(!1),a=A(null),u=A([]),r=A(0),P=A(0),z=A(null),$=A(!1),h=A(!1),F=A(null),M=A(!1),m=A("");async function I(){$.value=!0;try{const y=await $fetch(`/api/test-run-cases/${_.testRunsCaseId}/diagnosis-context`,{query:{format:"json"}});a.value=y.text,u.value=y.sections,r.value=y.tokenEstimate,P.value=y.imageTokenEstimate??0,z.value=y.coverage}catch{a.value=null,u.value=[],r.value=0,z.value=null}finally{$.value=!1}}async function E(){try{const y=await $fetch(`/api/test-run-cases/${_.testRunsCaseId}/diagnosis`);w.value=y.diagnosis}catch{}}xt(()=>{E(),I()});const U=C(()=>{const y=w.value?.details;if(!y)return[];const j=[];if(Array.isArray(y.evidence)&&j.push(...y.evidence),Array.isArray(y.hypotheses))for(const ne of y.hypotheses)Array.isArray(ne?.evidence)&&j.push(...ne.evidence);return Us(j)});function R(y){F.value=y,h.value=!0}function W(y){m.value=m.value?`${m.value}
|
|
2
|
-
|
|
3
|
-
${y}`:y,M.value=!0}async function G(y=!1){p.value=!0;try{const j=y?`/api/test-run-cases/${_.testRunsCaseId}/diagnose?force=true`:`/api/test-run-cases/${_.testRunsCaseId}/diagnose`,ne=m.value.trim()?{additionalContext:m.value.trim()}:void 0;w.value=await $fetch(j,{method:"POST",body:ne})}catch(j){const ne=j?.statusCode;ne===409?(b.add({title:"Diagnosis already running",color:"warning"}),E()):ne===503?b.add({title:"AI diagnosis is not configured",color:"warning"}):b.add({title:"Diagnosis failed",description:Es(j),color:"error"})}finally{p.value=!1}}function N(y){return y.status==="running"&&Date.now()-new Date(y.updatedAt).getTime()>300*1e3}const Z=C(()=>w.value&&(w.value.status==="completed"||w.value.status==="failed")),Q=C(()=>!w.value||w.value.status==="failed"||w.value.status==="running"&&N(w.value)),de=C(()=>w.value?.status==="running"&&!N(w.value)&&!p.value);return(y,j)=>{const ne=Ps,v=ce,S=Ns,H=Ks,J=Ie,X=js,se=ht,O=As,Y=Pe,ee=ye;return t(),k(ee,{icon:"i-lucide-sparkles","icon-class":"text-primary",title:"AI diagnosis",help:"case.ai"},{actions:d(()=>[i(ne,{"context-endpoint":`/api/test-run-cases/${s.testRunsCaseId}/diagnosis-context`},null,8,["context-endpoint"])]),default:d(()=>[n("div",oa,[n("p",ra,[i(v,{name:"i-lucide-triangle-alert",class:"size-3 shrink-0"}),j[6]||(j[6]=g(" AI-generated — verify before applying. ",-1))]),e(x)?.configured?(t(),k(S,{key:0,sections:e(u),"not-applicable":e(z)?.notApplicable,"token-estimate":e(r),loading:e($),onViewSection:R,onOpen:j[0]||(j[0]=ae=>h.value=!0)},null,8,["sections","not-applicable","token-estimate","loading"])):l("",!0),e(x)?.configured?(t(),o(B,{key:1},[n("div",null,[n("button",{class:"flex items-center gap-1.5 text-xs font-medium text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",onClick:j[1]||(j[1]=ae=>M.value=!e(M))},[i(v,{name:e(M)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3.5"},null,8,["name"]),j[7]||(j[7]=g(" Additional context ",-1)),e(m).trim()?(t(),o("span",ia,"(1)")):l("",!0)]),e(M)?(t(),k(H,{key:0,modelValue:e(m),"onUpdate:modelValue":j[2]||(j[2]=ae=>pe(m)?m.value=ae:null),placeholder:"e.g. We deployed a new auth middleware yesterday…",rows:3,class:"w-full text-sm mt-1"},null,8,["modelValue"])):l("",!0)]),e(de)?(t(),o("div",la,[n("span",ca,[i(v,{name:"i-lucide-loader-circle",class:"size-4 animate-spin text-primary shrink-0"}),j[8]||(j[8]=g(" Diagnosis in progress… ",-1))]),i(J,{size:"xs",color:"neutral",variant:"outline",icon:"i-lucide-refresh-cw",loading:e(p),onClick:E},{default:d(()=>[...j[9]||(j[9]=[g(" Refresh ",-1)])]),_:1},8,["loading"])])):(t(),o("div",ua,[e(Q)?(t(),k(J,{key:0,icon:"i-lucide-sparkles",size:"sm",color:"primary",variant:"solid",loading:e(p),onClick:j[3]||(j[3]=ae=>G(e(w)?.status==="running"))},{default:d(()=>[g(c(e(w)?.status==="running"?"Restart diagnosis":"Diagnose with AI"),1)]),_:1},8,["loading"])):e(w)?.status==="completed"?(t(),k(J,{key:1,icon:"i-lucide-refresh-cw",size:"xs",color:"primary",variant:"soft",loading:e(p),onClick:j[4]||(j[4]=ae=>G(!0))},{default:d(()=>[...j[10]||(j[10]=[g(" Re-diagnose ",-1)])]),_:1},8,["loading"])):l("",!0)])),e(Z)?(t(),k(X,{key:2,diagnosis:e(w),onViewSection:R,onPrefillContext:W},null,8,["diagnosis"])):l("",!0)],64)):(t(),o("div",da,[n("p",ma,[j[11]||(j[11]=g(" AI diagnosis is not configured ",-1)),i(se,{topic:"cluster.ai-setup"})]),j[13]||(j[13]=n("p",{class:"text-xs mt-2 max-w-xs mx-auto"},[g(" Use "),n("strong",null,"Export → AI context"),g(" in the header to grab the full evidence bundle for your own AI tool, or configure a provider. ")],-1)),i(J,{to:"/settings/ai",size:"xs",color:"neutral",variant:"outline",class:"mt-3"},{default:d(()=>[...j[12]||(j[12]=[g(" Configure in Settings ",-1)])]),_:1})])),i(O,{open:e(h),sections:e(u),"token-estimate":e(r),"image-token-estimate":e(P),loading:e($),"focus-section":e(F),"cited-sections":e(U),"not-applicable-sections":e(z)?.notApplicable,"onUpdate:open":j[5]||(j[5]=ae=>{h.value=ae,ae||(F.value=null)}),onRefresh:I},null,8,["open","sections","token-estimate","image-token-estimate","loading","focus-section","cited-sections","not-applicable-sections"]),n("div",ga,[i(Y,{to:"/mcp",class:"inline-flex items-center gap-1 text-xs text-gray-400 hover:text-primary transition-colors"},{default:d(()=>[i(v,{name:"i-lucide-bot",class:"size-3"}),j[14]||(j[14]=g(" Query this failure from your AI agent via MCP ",-1))]),_:1})])])]),_:1})}}}),fa=Object.assign(pa,{__name:"TestCaseAiCard"});function wt(s,_,x){const b=A(null),w=A(!1),p=A(!1);async function a(){const u=s();if(!(!u||!we(_)||w.value)){p.value=!0,w.value=!0;try{b.value=await $fetch(u)}catch{b.value=null}finally{w.value=!1}}}return xt(()=>{he(()=>we(_),u=>{u&&(x||p.value)&&!b.value&&a()},{immediate:!0})}),{data:b,pending:w,load:a}}function ya(s,_,x,b={}){return wt(()=>{const w=we(s),p=we(_);return w&&p?`/api/test-runs/${w}/cases/${p}/trace-stacks`:null},x,b.auto??!0)}function xa(s,_,x,b={}){return wt(()=>{const w=we(s),p=we(_);return w&&p?`/api/test-runs/${w}/cases/${p}/trace-network`:null},x,b.auto??!1)}const ha={class:"max-h-[32rem] overflow-y-auto"},va={key:0,class:"mb-2 flex items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500"},_a={key:0,class:"mt-3 flex items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500"},ka=re({__name:"TestSourceCard",props:{frames:{},testSource:{},runId:{},testRunsCaseId:{},hasTrace:{type:Boolean},projectKey:{},projectName:{},storageKey:{}},setup(s,{expose:_}){const x=s,{data:b,pending:w}=ya(()=>x.runId,()=>x.testRunsCaseId,()=>x.hasTrace,{auto:!0}),p=C(()=>b.value?.status==="ok"?b.value.frames??[]:[]),a=C(()=>p.value.length>0),u=C(()=>x.frames?.length??0),r=C(()=>u.value>0||!!x.testSource),P=A(null),z=C({get:()=>P.value??(a.value?"trace":"captured"),set:M=>{P.value=M}}),$=C(()=>[{label:`Full stack (${p.value.length})`,value:"trace"},{label:`Captured (${u.value||1})`,value:"captured"}]),h=C(()=>z.value==="trace"&&a.value?p.value.length:u.value||null),F=A(null);return _({reveal:()=>F.value?.reveal()}),(M,m)=>{const I=Je,E=ce,U=ns,R=as,W=vt,G=qe,N=Ke,Z=He;return t(),k(Z,{ref_key:"card",ref:F,"storage-key":s.storageKey,icon:"i-lucide-code",count:e(h),title:"Test source",help:"case.test-source"},Zt({folded:d(()=>[e(z)==="trace"&&e(a)?(t(),o(B,{key:0},[g(" Full call stack from the trace"+c(e(b)?.hasSources===!1?" (recorded without sources)":""),1)],64)):e(u)>1?(t(),o(B,{key:1},[g(" The failing line and "+c(e(u)-1)+" caller"+c(e(u)-1===1?"":"s"),1)],64)):(t(),o(B,{key:2},[g("Source around the failing assertion")],64))]),default:d(()=>[n("div",ha,[e(z)==="trace"&&e(a)?(t(),o(B,{key:0},[e(b)?.hasSources===!1?(t(),o("p",va,[i(E,{name:"i-lucide-info",class:"size-3.5 shrink-0"}),m[1]||(m[1]=g(" Trace recorded without sources — frame list only. ",-1))])):l("",!0),i(U,{frames:e(p),"project-key":s.projectKey,"project-name":s.projectName},null,8,["frames","project-key","project-name"])],64)):(t(),o(B,{key:1},[s.frames?.length?(t(),k(R,{key:0,frames:s.frames,"project-key":s.projectKey,"project-name":s.projectName},null,8,["frames","project-key","project-name"])):s.testSource?(t(),k(W,{key:1,text:"```typescript\n"+s.testSource+"\n```"},null,8,["text"])):s.hasTrace&&e(w)?(t(),k(G,{key:2,text:"Loading call stack from trace…"})):l("",!0)],64))]),s.hasTrace?l("",!0):(t(),o("p",_a,[i(E,{name:"i-lucide-info",class:"size-3.5 shrink-0"}),n("span",null,[m[3]||(m[3]=g(" Want to go deeper? Record traces (",-1)),m[4]||(m[4]=n("code",null,"trace: 'retain-on-failure'",-1)),m[5]||(m[5]=g(") to see the full call stack with source here. ",-1)),i(N,{to:"ui-overview#trace-powered-deep-views","no-icon":"",class:"underline"},{default:d(()=>[...m[2]||(m[2]=[g("Learn more",-1)])]),_:1})])]))]),_:2},[e(a)&&e(r)?{name:"actions",fn:d(()=>[i(I,{modelValue:e(z),"onUpdate:modelValue":m[0]||(m[0]=Q=>pe(z)?z.value=Q:null),items:e($),size:"xs",variant:"link",ui:{list:"gap-2",trigger:"px-1.5"}},null,8,["modelValue","items"])]),key:"0"}:void 0]),1032,["storage-key","count"])}}}),ba=Object.assign(ka,{__name:"TestSourceCard"}),wa={class:"space-y-3"},$a={class:"divide-y divide-default"},Ca={class:"flex items-center gap-2 min-w-0"},Ta={class:"text-sm truncate"},Sa={key:0,class:"text-xs text-gray-400 shrink-0"},Ia=re({__name:"TestCaseEvidenceCard",props:{attachments:{},traces:{},storageKey:{}},setup(s,{expose:_}){const x=s,b=Oe(),w=C(()=>x.attachments.filter(h=>Te(h.path,h.contentType)).length),p=C(()=>x.attachments.filter(h=>Ae(h.path,h.contentType)).length),a=C(()=>x.attachments.filter(h=>!Te(h.path,h.contentType)&&!Ae(h.path,h.contentType))),u=C(()=>w.value+p.value+x.traces.length+a.value.length),r=C(()=>{const h=[];return w.value&&h.push(`${w.value} screenshot${w.value===1?"":"s"}`),p.value&&h.push(`${p.value} video${p.value===1?"":"s"}`),x.traces.length&&h.push(`${x.traces.length} trace${x.traces.length===1?"":"s"}`),a.value.length&&h.push(`${a.value.length} file${a.value.length===1?"":"s"}`),h.join(" · ")||"No evidence captured"});function P(h,F){return _t(h,F,b.app?.baseURL)}function z(h){return h.split("/").pop()||h}const $=A(null);return _({reveal:()=>$.value?.reveal?.()}),(h,F)=>{const M=os,m=rs,I=is,E=ce,U=Ie,R=ls,W=bt,G=He;return t(),k(G,{ref_key:"card",ref:$,"storage-key":s.storageKey,icon:"i-lucide-camera",title:"Failure evidence",count:e(u),help:"case.evidence"},{folded:d(()=>[g(c(e(r)),1)]),default:d(()=>[n("div",wa,[i(M,{attachments:s.attachments},null,8,["attachments"]),i(m,{attachments:s.attachments},null,8,["attachments"]),i(I,{traces:s.traces},null,8,["traces"]),e(a).length?(t(),k(R,{key:0,icon:"i-lucide-paperclip",label:"Attachments",count:e(a).length,collapsible:!1},{default:d(()=>[n("div",$a,[(t(!0),o(B,null,te(e(a),N=>(t(),o("div",{key:N.id,class:"flex items-center justify-between gap-2 px-3 py-2"},[n("div",Ca,[i(E,{name:"i-lucide-file",class:"size-4 text-gray-400 shrink-0"}),n("span",Ta,c(z(N.path)),1),N.size?(t(),o("span",Sa,c(("formatBytes"in h?h.formatBytes:e(be))(N.size)),1)):l("",!0)]),i(U,{to:P(N.path,N.contentType),target:"_blank",icon:"i-lucide-external-link",size:"xs",color:"neutral",variant:"soft",label:"Open"},null,8,["to"])]))),128))])]),_:1},8,["count"])):l("",!0),e(u)===0?(t(),k(W,{key:1,icon:"i-lucide-camera-off",text:"No screenshots, video or traces captured"})):l("",!0)])]),_:1},8,["storage-key","count"])}}}),Ra=Object.assign(Ia,{__name:"TestCaseEvidenceCard"}),La={class:"space-y-1 max-h-80 overflow-y-auto"},za={class:"min-w-0 flex-1"},Ma={class:"flex items-center gap-2"},Da={class:"truncate"},Na={key:0,class:"text-xs text-gray-400 mt-0.5 ml-0"},ja=re({__name:"TestCaseConsoleCard",props:{entries:{}},setup(s){function _(b){switch(b){case"error":return"error";case"warning":return"warning";case"assert":return"error";default:return"neutral"}}function x(b){switch(b){case"error":return"i-lucide-octagon-x";case"warning":return"i-lucide-alert-triangle";case"assert":return"i-lucide-octagon-x";default:return"i-lucide-message-square"}}return(b,w)=>{const p=ce,a=fe,u=ye;return s.entries.length>0?(t(),k(u,{key:0,icon:"i-lucide-terminal",title:"Console output",count:s.entries.length,help:"case.console"},{default:d(()=>[n("div",La,[(t(!0),o(B,null,te(s.entries,(r,P)=>(t(),o("div",{key:P,class:"flex items-start gap-2 py-1.5 px-2 rounded hover:bg-gray-50 dark:hover:bg-gray-800 text-sm"},[i(p,{name:x(r.type),class:q([r.type==="error"||r.type==="assert"?"text-red-500":r.type==="warning"?"text-amber-500":"text-gray-400","size-4 mt-0.5 shrink-0"])},null,8,["name","class"]),n("div",za,[n("div",Ma,[i(a,{color:_(r.type),variant:"soft",size:"xs",class:"shrink-0"},{default:d(()=>[g(c(r.type),1)]),_:2},1032,["color"]),n("span",Da,c(r.text),1)]),r.location?(t(),o("div",Na,c(r.location),1)):l("",!0)])]))),128))])]),_:1},8,["count"])):l("",!0)}}}),Aa=Object.assign(ja,{__name:"TestCaseConsoleCard"}),Pa={key:0,class:"space-y-4 text-sm"},Ua={class:"space-y-1.5"},Ba={class:"flex items-center gap-2"},Fa={key:0,class:"text-xs text-gray-500"},Va={class:"block text-xs break-all text-gray-700 dark:text-gray-300"},Ea={key:0,class:"text-xs text-red-600 dark:text-red-400 font-mono"},Oa={class:"flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-gray-400"},Ha={key:0,class:"font-mono"},Ka={key:1,class:"font-mono"},Wa={key:2},Ga={key:3,title:"Bytes on the wire"},Ja={key:0},qa={class:"flex h-2 rounded overflow-hidden bg-gray-100 dark:bg-gray-800"},Qa=["title"],Za={class:"flex flex-wrap gap-x-3 gap-y-1 mt-1.5 text-xs text-gray-500"},Xa={class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1.5 capitalize"},Ya={key:0,class:"rounded border border-default divide-y divide-default max-h-48 overflow-y-auto"},eo={class:"text-gray-500 dark:text-gray-400 shrink-0"},to={class:"break-all text-gray-700 dark:text-gray-300"},so={key:1,class:"text-xs text-gray-400"},no={key:1},ao={key:0,class:"rounded border border-default p-2"},oo=["src","alt"],ro={key:1,class:"max-h-96 overflow-y-auto"},io={key:0,class:"mt-1 text-xs text-gray-400"},lo={key:2,class:"text-xs text-gray-400"},co={key:2,class:"text-xs text-gray-400"},uo=re({__name:"TraceNetworkDrawer",props:{open:{type:Boolean},entry:{},runId:{},testRunsCaseId:{}},emits:["update:open"],setup(s,{emit:_}){const x=s,b=_,w=[{key:"dns",label:"DNS",color:"bg-sky-400"},{key:"connect",label:"Connect",color:"bg-violet-400"},{key:"ssl",label:"TLS",color:"bg-rose-400"},{key:"send",label:"Send",color:"bg-amber-400"},{key:"wait",label:"Wait",color:"bg-blue-400"},{key:"receive",label:"Receive",color:"bg-emerald-400"}],p=C(()=>{const $=x.entry?.timings;return $?w.map(h=>({...h,value:$[h.key]??-1})).filter(h=>typeof h.value=="number"&&h.value>=0):[]}),a=C(()=>p.value.reduce(($,h)=>$+h.value,0)),u=C(()=>{const $=x.entry?.requestPostData??"";return $.startsWith("{")||$.startsWith("[")}),r=A(null),P=A(!1),z=new Map;return he(()=>[x.open,x.entry?.bodySha1],async([$,h])=>{if(r.value=null,!$||!h||!x.runId)return;const F=z.get(h);if(F){r.value=F;return}P.value=!0;try{const M=await $fetch(`/api/test-runs/${x.runId}/cases/${x.testRunsCaseId}/trace-network-body`,{query:{sha1:h}});z.set(h,M),r.value=M}catch{r.value={status:"not-found"}}finally{P.value=!1}},{immediate:!0}),($,h)=>{const F=fe,M=Re,m=Ws,I=qe,E=Gs;return t(),k(E,{open:s.open,title:"Request detail",ui:{content:"max-w-xl"},"onUpdate:open":h[0]||(h[0]=U=>b("update:open",U))},{body:d(()=>[s.entry?(t(),o("div",Pa,[n("div",Ua,[n("div",Ba,[i(F,{color:("httpMethodColor"in $?$.httpMethodColor:e(We))(s.entry.method),variant:"soft",size:"sm",class:"font-mono shrink-0"},{default:d(()=>[g(c(s.entry.method),1)]),_:1},8,["color"]),i(F,{color:("httpStatusColor"in $?$.httpStatusColor:e(Ge))(s.entry.status),variant:"soft",size:"sm",class:"font-mono shrink-0 tabular-nums"},{default:d(()=>[g(c(s.entry.status>0?s.entry.status:"—"),1)]),_:1},8,["color"]),s.entry.statusText?(t(),o("span",Fa,c(s.entry.statusText),1)):l("",!0)]),n("code",Va,c(s.entry.url),1),s.entry.failureText?(t(),o("p",Ea,c(s.entry.failureText),1)):l("",!0),n("div",Oa,[s.entry.resourceType?(t(),o("span",Ha,c(s.entry.resourceType),1)):l("",!0),s.entry.mimeType?(t(),o("span",Ka,c(s.entry.mimeType),1)):l("",!0),s.entry.responseBodySize!=null?(t(),o("span",Wa,c(("formatBytes"in $?$.formatBytes:e(be))(s.entry.responseBodySize)),1)):l("",!0),s.entry.transferSize!=null?(t(),o("span",Ga,c(("formatBytes"in $?$.formatBytes:e(be))(s.entry.transferSize))+" transferred",1)):l("",!0),i(M,{ms:s.entry.duration},null,8,["ms"]),s.entry.duringFailure?(t(),k(F,{key:4,color:"error",variant:"subtle",size:"xs"},{default:d(()=>[...h[1]||(h[1]=[g("During failing action",-1)])]),_:1})):l("",!0)])]),e(p).length>0&&e(a)>0?(t(),o("div",Ja,[h[2]||(h[2]=n("p",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1.5"},"Timing",-1)),n("div",qa,[(t(!0),o(B,null,te(e(p),U=>(t(),o("div",{key:U.key,class:q(U.color),style:$e({width:`${Math.max(.5,U.value/e(a)*100)}%`}),title:`${U.label}: ${("formatDuration"in $?$.formatDuration:e(Os))(U.value)}`},null,14,Qa))),128))]),n("div",Za,[(t(!0),o(B,null,te(e(p),U=>(t(),o("span",{key:U.key,class:"inline-flex items-center gap-1"},[n("span",{class:q(["size-2 rounded-full",U.color])},null,2),g(" "+c(U.label)+" ",1),i(M,{ms:U.value,"no-title":""},null,8,["ms"])]))),128))])])):l("",!0),(t(),o(B,null,te(["request","response"],U=>n("div",{key:U},[n("p",Xa,c(U)+" headers",1),(U==="request"?s.entry.requestHeaders:s.entry.responseHeaders).length>0?(t(),o("div",Ya,[(t(!0),o(B,null,te(U==="request"?s.entry.requestHeaders:s.entry.responseHeaders,R=>(t(),o("div",{key:`${U}-${R.name}`,class:"px-2 py-1 text-xs font-mono flex gap-2"},[n("span",eo,c(R.name)+":",1),n("span",to,c(R.value),1)]))),128))])):(t(),o("p",so,"None recorded."))])),64)),s.entry.requestPostData?(t(),o("div",no,[h[3]||(h[3]=n("p",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1.5"},"Request body",-1)),i(m,{code:s.entry.requestPostData,lang:e(u)?"json":"text"},null,8,["code","lang"])])):l("",!0),n("div",null,[h[4]||(h[4]=n("p",{class:"text-xs font-medium text-gray-500 dark:text-gray-400 mb-1.5"},"Response body",-1)),e(P)?(t(),k(I,{key:0,text:"Loading body…",padded:!1})):e(r)?(t(),o(B,{key:1},[e(r).status==="ok"&&e(r).kind==="image"?(t(),o("div",ao,[n("img",{src:e(r).dataUri,alt:s.entry.url,class:"max-w-full max-h-96"},null,8,oo)])):e(r).status==="ok"?(t(),o("div",ro,[i(m,{code:e(r).content??"",lang:e(r).kind==="json"?"json":"text"},null,8,["code","lang"]),e(r).truncated?(t(),o("p",io,"Preview truncated.")):l("",!0)])):(t(),o("p",lo,c(e(r).status==="too-large"?`Body too large to preview (${("formatBytes"in $?$.formatBytes:e(be))(e(r).size??0)}) — open the trace viewer to inspect it.`:e(r).status==="unsupported"?`No preview for ${e(r).mimeType||"this content type"} — open the trace viewer to inspect it.`:"Body not stored in the trace."),1))],64)):s.entry.bodySha1?l("",!0):(t(),o("p",co,"No body captured for this request."))])])):l("",!0)]),_:1},8,["open"])}}}),mo=Object.assign(uo,{__name:"TraceNetworkDrawer"}),go={class:"flex items-center justify-between gap-2 mb-2"},po={key:0,class:"hidden sm:flex items-center gap-1.5 text-xs text-gray-400"},fo={class:"space-y-1 max-h-[28rem] overflow-y-auto"},yo=["title","onClick"],xo={class:"flex items-center gap-2 text-sm min-w-0"},ho={class:"truncate text-xs flex-1 min-w-0"},vo={key:0,class:"shrink-0 text-xs text-gray-400 font-mono hidden md:inline"},_o={key:1,class:"shrink-0 text-xs text-gray-400 tabular-nums hidden sm:inline"},ko={class:"relative h-1.5 mt-1 rounded bg-gray-100 dark:bg-gray-800 overflow-hidden"},bo={key:0,class:"mt-2 text-xs text-gray-400 dark:text-gray-500"},wo=re({__name:"TraceNetworkList",props:{data:{},runId:{},testRunsCaseId:{}},setup(s){const _=s,x=A("all"),b=C(()=>_.data.requests??[]),w=C(()=>({total:b.value.length,failed:b.value.filter(I=>I.failed).length,duringFailure:b.value.filter(I=>I.duringFailure).length})),p=C(()=>[{label:`All (${w.value.total})`,value:"all"},{label:`Failed (${w.value.failed})`,value:"failed",disabled:w.value.failed===0},{label:`During failure (${w.value.duringFailure})`,value:"duringFailure",disabled:w.value.duringFailure===0}]),a=C(()=>x.value==="failed"?b.value.filter(I=>I.failed):x.value==="duringFailure"?b.value.filter(I=>I.duringFailure):b.value);function u(I){try{return new URL(I).pathname||I}catch{return I}}const r=C(()=>Math.max(1,_.data.timelineDuration??1));function P(I){const E=Math.max(0,Math.min(100,I.start/r.value*100)),U=Math.min(100-E,Math.max(1.5,I.duration/r.value*100));return{left:`${E}%`,width:`${U}%`}}const z=C(()=>{const I=_.data.failingWindow;if(!I||I.end<=I.start)return null;const E=Math.max(0,Math.min(100,I.start/r.value*100)),U=Math.max(.5,Math.min(100-E,(I.end-I.start)/r.value*100));return{left:`${E}%`,width:`${U}%`}});function $(I){return I.failed?"bg-red-500":I.duration>1e3?"bg-orange-400":"bg-gray-400 dark:bg-gray-500"}function h(I){return I.failed?"border-l-2 border-l-red-400 dark:border-l-red-600":I.duringFailure?"border-l-2 border-l-amber-400 dark:border-l-amber-600":"border-l-2 border-l-transparent"}const F=A(null),M=A(!1);function m(I){F.value=I,M.value=!0}return(I,E)=>{const U=Je,R=fe,W=Re,G=mo;return t(),o("div",null,[n("div",go,[i(U,{modelValue:e(x),"onUpdate:modelValue":E[0]||(E[0]=N=>pe(x)?x.value=N:null),items:e(p),size:"xs",variant:"link",ui:{list:"gap-2",trigger:"px-1.5"}},null,8,["modelValue","items"]),s.data.failingWindow?(t(),o("span",po,[...E[2]||(E[2]=[n("span",{class:"inline-block w-3 h-2 rounded-sm bg-red-500/10 border border-red-300 dark:border-red-800"},null,-1),g(" failing action ",-1)])])):l("",!0)]),n("div",fo,[(t(!0),o(B,null,te(e(a),N=>(t(),o("button",{key:N.index,type:"button",class:q([h(N),"w-full rounded bg-gray-50/60 dark:bg-gray-800/40 py-1.5 px-2 text-left cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800"]),title:N.url,onClick:Z=>m(N)},[n("div",xo,[i(R,{color:("httpMethodColor"in I?I.httpMethodColor:e(We))(N.method),variant:"soft",size:"xs",class:"font-mono shrink-0"},{default:d(()=>[g(c(N.method),1)]),_:2},1032,["color"]),i(R,{color:("httpStatusColor"in I?I.httpStatusColor:e(Ge))(N.status),variant:"soft",size:"xs",class:"font-mono shrink-0 tabular-nums",title:N.failureText||N.statusText},{default:d(()=>[g(c(N.status>0?N.status:"—"),1)]),_:2},1032,["color","title"]),n("code",ho,c(u(N.url)),1),N.resourceType?(t(),o("span",vo,c(N.resourceType),1)):l("",!0),N.responseBodySize!=null?(t(),o("span",_o,c(("formatBytes"in I?I.formatBytes:e(be))(N.responseBodySize)),1)):l("",!0),n("span",{class:q(["ml-1 shrink-0 text-xs tabular-nums",N.duration>1e3?"text-red-600 font-medium":N.duration>500?"text-orange-500":"text-gray-500"])},[i(W,{ms:N.duration,"unit-class":"opacity-60"},null,8,["ms"])],2)]),n("div",ko,[e(z)?(t(),o("div",{key:0,class:"absolute inset-y-0 bg-red-500/10 border-x border-red-300/60 dark:border-red-800/60",style:$e(e(z))},null,4)):l("",!0),n("div",{class:q(["absolute inset-y-0 rounded-full",$(N)]),style:$e(P(N))},null,6)])],10,yo))),128))]),s.data.truncated?(t(),o("p",bo," Showing the first "+c(e(b).length)+" of "+c(s.data.totalBeforeCap)+" requests recorded in the trace. ",1)):l("",!0),i(G,{open:e(M),"onUpdate:open":E[1]||(E[1]=N=>pe(M)?M.value=N:null),entry:e(F),"run-id":s.runId,"test-runs-case-id":s.testRunsCaseId},null,8,["open","entry","run-id","test-runs-case-id"])])}}}),$o=Object.assign(wo,{__name:"TraceNetworkList"}),Co={class:"flex flex-wrap items-center gap-x-3 gap-y-1"},To={key:0,class:"flex items-center gap-2 text-xs"},So={key:0,class:"flex items-center gap-1 text-red-600 dark:text-red-400"},Io={key:1,class:"flex items-center gap-1 text-amber-600 dark:text-amber-400"},Ro={key:2,class:"text-xs text-gray-400 py-2"},Lo={key:1,class:"space-y-1 max-h-[28rem] overflow-y-auto"},zo=["disabled","onClick"],Mo={key:1,class:"size-3.5 shrink-0"},Do=["title"],No=["title"],jo=["title"],Ao=["title"],Po=["title"],Uo=["title"],Bo={key:0,class:"px-2 pt-1.5 pb-2 pl-7 space-y-1"},Fo={class:"flex items-center gap-1.5 text-[11px] uppercase tracking-wide text-gray-400"},Vo=["title"],Eo={key:0,class:"shrink-0 text-[10px] uppercase text-gray-400 font-mono hidden sm:inline"},Oo={class:"relative flex-1 h-3 rounded bg-gray-100 dark:bg-gray-800 min-w-0"},Ho={key:1,class:"px-2 pb-2 pl-7 space-y-1.5"},Ko={class:"flex items-start gap-2"},Wo={key:0,class:"text-gray-400 shrink-0 font-mono"},Go={class:"font-mono break-all text-gray-700 dark:text-gray-300 flex-1 min-w-0"},Jo=["title"],qo={key:0,class:"mt-1.5"},Qo=["onClick"],Zo={key:0,class:"mt-1 whitespace-pre-wrap break-all font-mono text-[11px] leading-relaxed text-gray-500 dark:text-gray-400 max-h-48 overflow-y-auto"},Xo={key:2,class:"mt-3 flex items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500"},Yo={key:3,class:"mt-3 flex items-center gap-1.5 text-xs text-gray-400 dark:text-gray-500"},er=re({__name:"TestCaseNetworkRequests",props:{requests:{},runId:{},testRunsCaseId:{},hasTrace:{type:Boolean}},setup(s,{expose:_}){const x=s,b=A("all"),{data:w,pending:p,load:a}=xa(()=>x.runId,()=>x.testRunsCaseId,()=>!!x.hasTrace),u=A(null),r=C({get:()=>u.value??(x.requests.length===0&&x.hasTrace?"trace":"captured"),set:v=>{u.value=v}});he(()=>r.value==="trace",v=>{v&&a()},{immediate:!0});const P=C(()=>w.value?.status==="ok"?w.value.requests?.length??0:null),z=C(()=>[{label:`Captured (${x.requests.length})`,value:"captured",disabled:x.requests.length===0},{label:P.value!=null?`Full trace (${P.value})`:"Full trace",value:"trace"}]);function $(){x.hasTrace&&(u.value="trace")}_({showTraceMode:$});const h=A(new Set);function F(v){const S=new Set(h.value);S.has(v)?S.delete(v):S.add(v),h.value=S}const M=A(new Set);function m(v){const S=new Set(M.value);S.has(v)?S.delete(v):S.add(v),M.value=S}function I(v){if(v.length===0)return[];const S=Math.min(...v.map(O=>O.startMs)),H=Math.max(...v.map(O=>O.startMs+O.durMs)),J=Math.max(1,H-S),X=new Map(v.map(O=>[O.id,O])),se=O=>{let Y=0,ee=O;const ae=new Set;for(;ee?.parentId&&X.has(ee.parentId)&&!ae.has(ee.id)&&(ae.add(ee.id),ee=X.get(ee.parentId),Y++,!(Y>8)););return Y};return[...v].sort((O,Y)=>O.startMs-Y.startMs||Y.durMs-O.durMs).map(O=>({...O,offsetPct:(O.startMs-S)/J*100,widthPct:Math.max(1.5,O.durMs/J*100),depth:se(O)}))}function E(v){return v.status==="error"?"bg-red-400 dark:bg-red-500":v.kind==="db"?"bg-violet-400 dark:bg-violet-500":v.kind==="client"?"bg-sky-400 dark:bg-sky-500":v.kind==="internal"?"bg-gray-400 dark:bg-gray-500":"bg-emerald-400 dark:bg-emerald-500"}function U(v){const S=v.toLowerCase();return S==="critical"||S==="fatal"?3:S==="error"?2:S==="warning"||S==="warn"?1:0}function R(v){const S=U(v);if(S>=2)return"error";if(S===1)return"warning";const H=v.toLowerCase();return H==="info"||H==="information"?"info":"neutral"}function W(v){try{return new URL(v).pathname||v}catch{return v}}function G(v){return(v.split("/")[1]??v).replace(/^vnd\.[^+]*\+?/,"").replace(/^x-/,"")||v}function N(v){return v?new Date(v).toLocaleString():""}const Z=C(()=>x.requests.map((v,S)=>{const H=Array.isArray(v.serverLogs)?v.serverLogs:[],J=Array.isArray(v.serverTraces)?v.serverTraces:[];let X=0,se=0;for(const Y of H){const ee=U(Y.level);ee>=2?X++:ee===1&&se++}const O=J.find(Y=>!Y.parentId)??J[0];return{...v,_index:S,logs:[...H].sort((Y,ee)=>Y.timestamp-ee.timestamp),spans:J,serverMs:O?O.durMs:null,errorLogCount:X,warnLogCount:se,failed:v.status>=400,hasDetail:H.length>0||J.length>0,path:W(v.url)}})),Q=C(()=>{let v=0,S=0,H=0,J=0,X=0;for(const se of Z.value)se.failed&&v++,se.logs.length>0&&S++,se.spans.length>0&&H++,J+=se.errorLogCount,X+=se.warnLogCount;return{total:Z.value.length,failed:v,withLogs:S,withSpans:H,errorLogs:J,warnLogs:X}}),de=C(()=>{let v=Z.value;return b.value==="failed"?v=v.filter(S=>S.failed):b.value==="logs"&&(v=v.filter(S=>S.logs.length>0)),[...v].sort((S,H)=>{const J=X=>(X.errorLogCount>0?3:0)+(X.failed?2:0)+(X.logs.length>0?1:0);return J(H)-J(S)||S._index-H._index})}),y=C(()=>[{label:`All (${Q.value.total})`,value:"all"},{label:`Failed (${Q.value.failed})`,value:"failed",disabled:Q.value.failed===0},{label:`With logs (${Q.value.withLogs})`,value:"logs",disabled:Q.value.withLogs===0}]),j=C(()=>Q.value.withLogs>0);function ne(v){return v.errorLogCount>0||v.status>=500?"border-l-2 border-l-red-400 dark:border-l-red-600":v.failed||v.warnLogCount>0?"border-l-2 border-l-amber-400 dark:border-l-amber-600":"border-l-2 border-l-transparent"}return(v,S)=>{const H=ce,J=Je,X=qe,se=$o,O=fe,Y=Re,ee=Ke,ae=ye;return t(),k(ae,{icon:"i-lucide-network",title:"Network & backend logs",count:e(r)==="trace"?e(P):e(Q).total,help:"case.network"},{actions:d(()=>[n("div",Co,[e(r)==="captured"?(t(),o(B,{key:0},[e(Q).errorLogs>0||e(Q).warnLogs>0?(t(),o("div",To,[e(Q).errorLogs>0?(t(),o("span",So,[i(H,{name:"i-lucide-octagon-alert",class:"size-3.5"}),g(c(e(Q).errorLogs),1)])):l("",!0),e(Q).warnLogs>0?(t(),o("span",Io,[i(H,{name:"i-lucide-triangle-alert",class:"size-3.5"}),g(c(e(Q).warnLogs),1)])):l("",!0)])):l("",!0),i(J,{modelValue:e(b),"onUpdate:modelValue":S[0]||(S[0]=D=>pe(b)?b.value=D:null),items:e(y),size:"xs",variant:"link",ui:{list:"gap-2",trigger:"px-1.5"}},null,8,["modelValue","items"])],64)):l("",!0),s.hasTrace?(t(),k(J,{key:1,modelValue:e(r),"onUpdate:modelValue":S[1]||(S[1]=D=>pe(r)?r.value=D:null),items:e(z),size:"xs",variant:"pill",ui:{list:"gap-1 p-0.5",trigger:"px-2"}},null,8,["modelValue","items"])):l("",!0)])]),default:d(()=>[e(r)==="trace"?(t(),o(B,{key:0},[e(p)||!e(w)?(t(),k(X,{key:0,text:"Parsing trace network stream…"})):e(w).status==="ok"?(t(),k(se,{key:1,data:e(w),"run-id":s.runId??null,"test-runs-case-id":s.testRunsCaseId??0},null,8,["data","run-id","test-runs-case-id"])):(t(),o("p",Ro,"No network activity recorded in this trace."))],64)):(t(),o("div",Lo,[(t(!0),o(B,null,te(e(de),D=>(t(),o("div",{key:D._index,class:q([ne(D),"rounded bg-gray-50/60 dark:bg-gray-800/40"])},[n("button",{type:"button",class:q(["w-full flex items-center gap-2 py-1.5 px-2 text-sm text-left",D.hasDetail?"cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800":"cursor-default"]),disabled:!D.hasDetail,onClick:K=>D.hasDetail&&F(D._index)},[D.hasDetail?(t(),k(H,{key:0,name:e(h).has(D._index)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3.5 shrink-0 text-gray-400"},null,8,["name"])):(t(),o("span",Mo)),i(O,{color:("httpMethodColor"in v?v.httpMethodColor:e(We))(D.method),variant:"soft",size:"xs",class:"font-mono shrink-0"},{default:d(()=>[g(c(D.method),1)]),_:2},1032,["color"]),i(O,{color:("httpStatusColor"in v?v.httpStatusColor:e(Ge))(D.status),variant:"soft",size:"xs",class:"font-mono shrink-0 tabular-nums"},{default:d(()=>[g(c(D.status||"—"),1)]),_:2},1032,["color"]),n("code",{class:"truncate text-xs flex-1 min-w-0",title:D.url},c(D.path),9,Do),D.contentType?(t(),o("span",{key:2,class:"shrink-0 text-xs text-gray-400 font-mono hidden md:inline",title:`Response content type: ${D.contentType}`},c(G(D.contentType)),9,No)):l("",!0),D.errorLogCount>0?(t(),o("span",{key:3,class:"shrink-0 inline-flex items-center gap-1 text-xs text-red-600 dark:text-red-400",title:`${D.errorLogCount} backend error log(s)`},[i(H,{name:"i-lucide-octagon-alert",class:"size-3.5"}),g(c(D.errorLogCount),1)],8,jo)):l("",!0),D.warnLogCount>0?(t(),o("span",{key:4,class:"shrink-0 inline-flex items-center gap-1 text-xs text-amber-600 dark:text-amber-400",title:`${D.warnLogCount} backend warning log(s)`},[i(H,{name:"i-lucide-triangle-alert",class:"size-3.5"}),g(c(D.warnLogCount),1)],8,Ao)):l("",!0),D.serverMs!=null?(t(),o("span",{key:5,class:"shrink-0 inline-flex items-center gap-1 text-xs text-emerald-600 dark:text-emerald-400 tabular-nums",title:`Server-side processing time (${D.spans.length} span${D.spans.length===1?"":"s"})`},[i(H,{name:"i-lucide-server",class:"size-3.5"}),i(Y,{ms:D.serverMs,"no-title":""},null,8,["ms"])],8,Po)):l("",!0),D.startTime?(t(),o("span",{key:6,class:"shrink-0 text-xs text-gray-400 hidden sm:inline",title:N(D.startTime)},c(("formatRelativeTime"in v?v.formatRelativeTime:e(Se))(D.startTime)),9,Uo)):l("",!0),n("span",{class:q(["ml-1 shrink-0 text-xs tabular-nums",(D.duration??0)>1e3?"text-red-600 font-medium":(D.duration??0)>500?"text-orange-500":"text-gray-500"])},[i(Y,{ms:D.duration,"unit-class":"opacity-60"},null,8,["ms"])],2)],10,zo),D.spans.length>0&&e(h).has(D._index)?(t(),o("div",Bo,[n("div",Fo,[i(H,{name:"i-lucide-waypoints",class:"size-3.5"}),S[2]||(S[2]=g("Server trace ",-1))]),(t(!0),o(B,null,te(I(D.spans),K=>(t(),o("div",{key:K.id,class:"flex items-center gap-2 text-xs",title:K.status==="error"?`${K.name} (error)`:K.name},[n("div",{class:"w-40 sm:w-56 shrink-0 flex items-center gap-1 min-w-0",style:$e({paddingLeft:`${K.depth*12}px`})},[K.kind?(t(),o("span",Eo,c(K.kind),1)):l("",!0),n("span",{class:q(["truncate font-mono",K.status==="error"?"text-red-600 dark:text-red-400":"text-gray-600 dark:text-gray-300"])},c(K.name),3)],4),n("div",Oo,[n("div",{class:q(["absolute top-0 h-3 rounded",E(K)]),style:$e({left:`${K.offsetPct}%`,width:`${K.widthPct}%`})},null,6)]),i(Y,{ms:K.durMs,class:"w-12 shrink-0 text-right text-gray-500"},null,8,["ms"])],8,Vo))),128))])):l("",!0),D.logs.length>0&&e(h).has(D._index)?(t(),o("div",Ho,[(t(!0),o(B,null,te(D.logs,(K,ve)=>(t(),o("div",{key:ve,class:"rounded border border-default bg-white dark:bg-gray-900/60 p-2 text-xs"},[n("div",Ko,[i(O,{color:R(K.level),variant:"soft",size:"xs",class:"shrink-0 capitalize"},{default:d(()=>[g(c(K.level),1)]),_:2},1032,["color"]),K.category?(t(),o("span",Wo,"["+c(K.category)+"]",1)):l("",!0),n("span",Go,c(K.message),1),K.timestamp?(t(),o("span",{key:1,class:"shrink-0 text-gray-400 tabular-nums",title:N(K.timestamp)},c(("formatRelativeTime"in v?v.formatRelativeTime:e(Se))(K.timestamp)),9,Jo)):l("",!0)]),K.stack?(t(),o("div",qo,[n("button",{type:"button",class:"inline-flex items-center gap-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200",onClick:Qe=>m(`${D._index}:${ve}`)},[i(H,{name:e(M).has(`${D._index}:${ve}`)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3"},null,8,["name"]),S[3]||(S[3]=g(" Stack trace ",-1))],8,Qo),e(M).has(`${D._index}:${ve}`)?(t(),o("pre",Zo,c(K.stack),1)):l("",!0)])):l("",!0)]))),128))])):l("",!0)],2))),128))])),e(r)==="captured"&&!e(j)?(t(),o("p",Xo,[i(H,{name:"i-lucide-info",class:"size-3.5 shrink-0"}),S[5]||(S[5]=g(" No backend server logs captured — install ",-1)),i(ee,{to:"backend-logs","no-icon":"",class:"underline"},{default:d(()=>[...S[4]||(S[4]=[g("a Piwi backend integration",-1)])]),_:1}),S[6]||(S[6]=g(" to see server-side warnings and errors under each request. ",-1))])):l("",!0),s.hasTrace?l("",!0):(t(),o("p",Yo,[i(H,{name:"i-lucide-info",class:"size-3.5 shrink-0"}),n("span",null,[S[8]||(S[8]=g(" Want to go deeper? Record traces (",-1)),S[9]||(S[9]=n("code",null,"trace: 'retain-on-failure'",-1)),S[10]||(S[10]=g(") to see every request with headers, timing and bodies here. ",-1)),i(ee,{to:"ui-overview#trace-powered-deep-views","no-icon":"",class:"underline"},{default:d(()=>[...S[7]||(S[7]=[g("Learn more",-1)])]),_:1})])]))]),_:1},8,["count"])}}}),tr=Object.assign(er,{__name:"TestCaseNetworkRequests"}),sr={class:"space-y-2"},nr=re({__name:"TestCaseTracesCard",props:{traces:{}},setup(s){return(_,x)=>{const b=cs,w=ye;return s.traces.length>0?(t(),k(w,{key:0,icon:"i-lucide-bug-play",title:"Traces",count:s.traces.length,help:"case.traces"},{default:d(()=>[n("div",sr,[(t(!0),o(B,null,te(s.traces,p=>(t(),k(b,{key:p.id,trace:p,class:"py-2 px-3 rounded-lg border"},null,8,["trace"]))),128))])]),_:1},8,["count"])):l("",!0)}}}),ar=Object.assign(nr,{__name:"TestCaseTracesCard"}),or={class:"space-y-3"},rr={class:"flex items-center justify-between px-3 py-2 bg-gray-50 dark:bg-gray-800/50 border-b"},ir={class:"flex items-center gap-2 min-w-0"},lr={class:"text-sm font-medium truncate"},cr={key:0,class:"text-xs text-gray-400 shrink-0"},ur={class:"text-xs text-gray-400"},dr={class:"flex items-center gap-1 shrink-0"},mr=["href"],gr={key:0,class:"bg-gray-100 dark:bg-gray-900"},pr=["src","alt","onClick"],fr={key:1,class:"bg-black"},yr={key:2,class:"bg-gray-50 dark:bg-gray-900"},xr={key:0,class:"flex items-center justify-center py-8"},hr={key:1,class:"p-4 text-red-500 text-sm"},vr={key:2,class:"p-4 overflow-auto max-h-96"},_r={class:"text-sm whitespace-pre-wrap font-sans leading-relaxed"},kr=re({__name:"TestCaseAttachmentsCard",props:{attachments:{}},setup(s){const _=s,x=Oe(),b=A(null),w=C(()=>_.attachments.filter(R=>Te(R.path,R.contentType)).map(R=>({src:z(R.path,R.contentType),name:R.name||$(R.path)})));function p(R){b.value=R}const a=new Set([".md",".mdx",".markdown"]),u=new Set(["text/markdown","text/x-markdown"]);function r(R){return R.toLowerCase().split(".").pop()||""}function P(R,W){return!!(a.has(r(R))||W&&u.has(W.toLowerCase()))}function z(R,W){return _t(R,W,x.app?.baseURL)}function $(R){return R.split("/").pop()||R}function h(R){return R==null?"":be(R)}const F=A({}),M=A({}),m=A({}),I=A(new Set);async function E(R){if(F.value[R.id]===void 0&&!m.value[R.id]){m.value[R.id]=!0,M.value[R.id]=null;try{const W=await $fetch(z(R.path,R.contentType),{responseType:"text"});F.value[R.id]=W}catch{M.value[R.id]="Failed to load preview"}finally{m.value[R.id]=!1}}}function U(R,W){const G=new Set(I.value);G.has(R)?G.delete(R):(G.add(R),E(W)),I.value=G}return(R,W)=>{const G=ce,N=Ie,Z=us,Q=ds,de=ye;return s.attachments.length>0?(t(),k(de,{key:0,icon:"i-lucide-paperclip",title:"Attachments",count:s.attachments.length},{default:d(()=>[n("div",or,[(t(!0),o(B,null,te(s.attachments,y=>(t(),o("div",{key:y.id,class:"rounded-lg border overflow-hidden"},[n("div",rr,[n("div",ir,[i(G,{name:e(Te)(y.path,y.contentType)?"i-lucide-image":e(Ae)(y.path,y.contentType)?"i-lucide-video":P(y.path,y.contentType)?"i-lucide-file-text":"i-lucide-file",class:"size-4 text-gray-400 shrink-0"},null,8,["name"]),n("span",lr,c($(y.path)),1),y.name&&y.name!==$(y.path)?(t(),o("span",cr,c(y.name),1)):l("",!0),n("span",ur,c(h(y.size)),1)]),n("div",dr,[P(y.path,y.contentType)?(t(),k(N,{key:0,size:"xs",color:"neutral",variant:"soft",onClick:j=>U(y.id,y)},{default:d(()=>[g(c(e(I).has(y.id)?"Hide preview":"Preview"),1)]),_:2},1032,["onClick"])):l("",!0),n("a",{href:z(y.path,y.contentType),target:"_blank",class:"text-primary hover:underline text-xs shrink-0"},"Open",8,mr)])]),e(Te)(y.path,y.contentType)?(t(),o("div",gr,[n("img",{src:z(y.path,y.contentType),alt:y.name||"Screenshot",class:"max-w-full max-h-96 object-contain mx-auto cursor-pointer hover:opacity-90 transition-opacity",loading:"lazy",onClick:j=>p(e(w).findIndex(ne=>ne.src===z(y.path,y.contentType)))},null,8,pr)])):e(Ae)(y.path,y.contentType)?(t(),o("div",fr,[i(Z,{src:z(y.path,y.contentType)},null,8,["src"])])):P(y.path,y.contentType)&&e(I).has(y.id)?(t(),o("div",yr,[e(m)[y.id]?(t(),o("div",xr,[i(G,{name:"i-lucide-loader-circle",class:"size-5 animate-spin text-gray-400"})])):e(M)[y.id]?(t(),o("div",hr,c(e(M)[y.id]),1)):e(F)[y.id]?(t(),o("div",vr,[n("pre",_r,c(e(F)[y.id]),1)])):l("",!0)])):l("",!0)]))),128))]),i(Q,{modelValue:e(b),"onUpdate:modelValue":W[0]||(W[0]=y=>pe(b)?b.value=y:null),images:e(w)},null,8,["modelValue","images"])]),_:1},8,["count"])):l("",!0)}}}),br=Object.assign(kr,{__name:"TestCaseAttachmentsCard"});function wr(s){return Array.isArray(s)?s.some(_=>_&&typeof _.type=="string"&&_.type.toLowerCase()==="slow"):!1}function $r(s){const _=[];if(!s)return _;const x=s.steps||[],w=x.filter(a=>a.category==="navigation").filter(a=>a.duration>3e3);if(w.length>0){const a=w.sort((u,r)=>r.duration-u.duration)[0];_.push({type:"warning",message:"Slow navigation detected",details:`"${a.title}" took ${(a.duration/1e3).toFixed(1)}s. The tested page may have performance issues (slow server response, heavy JS bundles, etc.).`})}x.length>20&&_.push({type:"info",message:"Many sequential actions",details:`This test has ${x.length} steps. Consider splitting it into smaller, focused tests for better isolation and faster feedback.`}),s.status==="passed"&&(s.retries||0)>0&&_.push({type:"warning",message:"Flaky test — passed after retries",details:`This test needed ${s.retries} ${s.retries===1?"retry":"retries"} to pass. Consider reviewing locator strategies, adding explicit waits, or checking for race conditions.`});const p=x.filter(a=>a.category==="assertion"&&a.duration>2e3);if(p.length>0){const a=p.sort((u,r)=>r.duration-u.duration)[0];_.push({type:"info",message:"Slow assertions detected",details:`"${a.title}" took ${(a.duration/1e3).toFixed(1)}s. The UI may be slow to render or the assertion timeout may need tuning.`})}return wr(s.testAnnotations)&&typeof s.duration=="number"&&s.duration<1e4&&_.push({type:"info",message:"test.slow() may be unnecessary",details:`This run finished in ${(s.duration/1e3).toFixed(1)}s, yet the test is marked test.slow(), which triples its timeout budget. If it is consistently this fast, removing test.slow() lets a failure surface sooner.`}),typeof s.timeout=="number"&&s.timeout>0&&typeof s.duration=="number"&&s.duration>0&&s.timeout>=4*s.duration&&s.timeout-s.duration>=3e4&&_.push({type:"info",message:"Oversized timeout",details:`The timeout is ${(s.timeout/1e3).toFixed(0)}s but this run took ${(s.duration/1e3).toFixed(1)}s. A large timeout means a hang or failure waits far longer than necessary — consider lowering it toward the test's real duration.`}),_}function Cr(s,_){const x=s.search(/\n at /);if(x===-1)return _!==void 0&&s.length>_?s.slice(0,_)+`
|
|
4
|
-
[truncated]`:s;const b=s.slice(0,x),p=s.slice(x).split(`
|
|
5
|
-
`),a=[];let u=0;const r=()=>{u>0&&(a.push(`… (${u} internal frame${u>1?"s":""})`),u=0)};for(const z of p){const $=z.trimStart();$.startsWith("at ")?z.includes("node_modules")||$.startsWith("at node:")?u++:(r(),a.push(z)):($===""||r(),a.push(z))}r();let P=b+`
|
|
6
|
-
`+a.join(`
|
|
7
|
-
`);return _!==void 0&&P.length>_&&(P=P.slice(0,_)+`
|
|
8
|
-
[truncated]`),P}const Tr={class:"space-y-4"},Sr=["innerHTML"],Ir={class:"grid grid-cols-1 xl:grid-cols-[3fr_2fr] gap-4"},Rr={class:"space-y-4 xl:order-2"},Lr={class:"space-y-4 xl:order-1 min-w-0"},zr={class:"max-h-96 overflow-y-auto"},Mr={class:"space-y-3"},Dr={key:0},Nr={class:"flex flex-wrap items-center gap-x-3 gap-y-1.5 text-xs mb-3"},jr={class:"font-medium text-gray-600 dark:text-gray-300"},Ar={class:"tabular-nums text-gray-500 dark:text-gray-400"},Pr={class:"text-xs tabular-nums text-gray-400 dark:text-gray-500"},Ur={key:0,class:"inline-flex items-center justify-center size-5 rounded-full bg-red-100 dark:bg-red-900/30 text-red-600 dark:text-red-400 text-xs leading-none",title:"Step failed"},Br={key:1,class:"inline-flex items-center justify-center size-5 rounded-full bg-green-100 dark:bg-green-900/30 text-green-600 dark:text-green-400 text-xs leading-none",title:"Step passed"},Fr={class:"flex items-center gap-2"},Vr={key:0,class:"text-xs text-red-500 mt-1 whitespace-pre-wrap break-words font-mono"},Er={class:"min-w-[6rem]"},Or={class:"flex items-center justify-between gap-2"},Hr={key:0,class:"text-xs tabular-nums text-gray-400 dark:text-gray-500"},Kr={class:"relative mt-1 h-1.5 w-full overflow-hidden rounded-full bg-gray-100 dark:bg-gray-800"},Wr={class:"space-y-4 pt-4"},Gr={key:3,class:"flex flex-col items-center justify-center py-12 text-gray-400"},Jr={class:"space-y-4 pt-1"},qr={key:0,class:"space-y-2"},Qr={class:"flex items-start gap-2"},Zr={class:"space-y-4"},Xr={key:3,class:"text-xs text-gray-400 pt-1"},Yr={class:"bg-gray-100 dark:bg-gray-800 px-1 rounded"},ei={class:"text-xs text-gray-400"},ti={class:"space-y-4 pt-4"},si={key:0,class:"space-y-4"},ni={class:"flex items-center justify-end"},ai={class:"text-xs whitespace-nowrap"},oi={class:"text-gray-500"},ri={class:"text-gray-400 ml-1"},ii={key:1,class:"text-gray-400"},li=["title"],sl=re({__name:"[id]",async setup(s){let _,x;const b=Xt(),w=Yt(),p=b.params.id,{data:a,refresh:u}=([_,x]=gt(()=>ft(`/api/test-run-cases/${p}`,"$cViH4nbiGI")),_=await _,x(),_),r=A([]);he(()=>a.value?.testCaseId,async f=>{if(f)try{r.value=await $fetch(`/api/test-cases/${f}/history`)}catch{r.value=[]}else r.value=[]},{immediate:!0});const{data:P,refresh:z}=([_,x]=gt(()=>ft(`/api/test-run-cases/${p}/traces`,"$GsSNbTq_Ec")),_=await _,x(),_),$=C(()=>(P.value?.length??0)>0);es(C(()=>({title:`${a.value?.title||`Test run case #${p}`} — Piwi Dashboard`})));const h=C(()=>!!a.value?.error),F=C(()=>a.value?$r(a.value):[]),M=C(()=>a.value?.steps?a.value.steps:[]),m=C(()=>a.value?.webVitals??null),I=C(()=>a.value?.networkRequests??[]),E=C(()=>{if(!r.value||r.value.length<2||!a.value?.duration)return null;const f=r.value.filter(le=>le.duration!==null&&le.id!==a.value?.id);if(f.length===0)return null;const T=f.reduce((le,ge)=>le+(ge.duration||0),0)/f.length,V=a.value.duration,oe=V-T,me=T>0?Math.round(oe/T*100):0;return{avg:Math.round(T),current:V,diff:Math.round(oe),pct:me}}),U=C(()=>a.value?.testRun?.metadata),R=C(()=>{const f=U.value;return f?.scm?f.scm:null}),W=C(()=>{const f=U.value;return f?.ci?f.ci:null}),G=C(()=>a.value?.failureCluster??null),N=C(()=>{const f=[];return h.value&&f.push({label:"Diagnosis",icon:"i-lucide-stethoscope",value:"diagnosis",slot:"diagnosis"}),f.push({label:`Steps (${M.value.length})`,icon:"i-lucide-list-checks",value:"steps",slot:"steps"}),h.value||f.push({label:"Artifacts",icon:"i-lucide-paperclip",value:"artifacts",slot:"artifacts"}),f.push({label:"Performance",icon:"i-lucide-gauge",value:"performance",slot:"performance"}),f.push({label:`History${r.value?.length?` (${r.value.length})`:""}`,icon:"i-lucide-trending-up",value:"history",slot:"history"}),f}),Z=C(()=>N.value.map(f=>f.value));function Q(){return h.value?"diagnosis":"steps"}function de(f){let T=typeof f=="string"?f:"";return T==="error"&&(T="diagnosis"),T==="traces"&&(T=h.value?"diagnosis":"artifacts"),Z.value.includes(T)?T:Q()}const y=A(de(b.query.tab));he(Z,f=>{f.includes(y.value)||(y.value=de(b.query.tab))}),he(y,f=>{b.query.tab!==f&&w.replace({query:{...b.query,tab:f}})},{immediate:!0});const j=[{accessorKey:"startTime",header:"Date"},{accessorKey:"status",header:"Status"},{accessorKey:"duration",header:"Duration"},{accessorKey:"retries",header:"Retries"},{accessorKey:"runId",header:"Run"},{accessorKey:"error",header:"Error"}],ne={navigation:"info",assertion:"success",action:"warning",input:"warning",api:"info",wait:"neutral",hook:"neutral",fixture:"neutral"},v=[{id:"index",header:"#",meta:{class:{th:"w-12",td:"w-12"}}},{id:"status",header:"",meta:{class:{th:"w-10",td:"w-10"}}},{accessorKey:"category",header:"Category",meta:{class:{th:"w-28",td:"w-28"}}},{accessorKey:"title",header:"Step"},{accessorKey:"duration",header:"Duration",meta:{class:{th:"w-44",td:"w-44"}}}],S=C(()=>{const f=new Map;for(const T of M.value){const V=f.get(T.category)??{count:0,duration:0};V.count+=1,V.duration+=T.duration||0,f.set(T.category,V)}return Array.from(f,([T,V])=>({category:T,...V})).sort((T,V)=>V.duration-T.duration)}),H=C(()=>{let f=-1,T=-1;return M.value.forEach((V,oe)=>{(V.duration||0)>T&&(T=V.duration||0,f=oe)}),f}),J=C(()=>M.value.reduce((f,T)=>Math.max(f,T.duration||0),0)),X=C(()=>M.value.length>0&&M.value.every(f=>typeof f.startTime=="number")),se=C(()=>a.value?.startedAt??(X.value?Math.min(...M.value.map(f=>f.startTime)):0)),O=C(()=>{const f=a.value?.duration??0;if(f>0)return f;if(X.value){const T=Math.max(...M.value.map(V=>V.startTime+(V.duration||0)));return Math.max(1,T-se.value)}return 0});function Y(f){if(X.value&&O.value>0){const V=Math.max(0,Math.min(100,(f.startTime-se.value)/O.value*100)),oe=Math.min(100-V,Math.max(1.5,(f.duration||0)/O.value*100));return{left:`${V}%`,width:`${oe}%`}}return{left:"0%",width:`${J.value>0?Math.max(2,(f.duration||0)/J.value*100):0}%`}}function ee(f){const T=a.value?.duration??0;if(T<=0)return"";const V=f/T*100;return V>0&&V<1?"<1%":`${Math.round(V)}%`}function ae(f){return f>2e3?"text-red-600 font-medium":f>500?"text-orange-500":"text-gray-500"}function D(f){return f>2e3?"bg-red-500":f>500?"bg-orange-400":"bg-gray-400 dark:bg-gray-500"}const K=C(()=>a.value?.testRun?.environment),ve=C(()=>en([{filePath:a.value?.filePath??"",title:a.value?.title??"",line:a.value?.line??null,projectName:a.value?.browser?.projectName??null}])),{copy:Qe,copied:Ze}=tn(),$t=C(()=>[{label:Ze.value?"Copied":"Retry command",icon:Ze.value?"i-lucide-check":"i-lucide-play",onClick:()=>Qe(ve.value,{toast:"Retry command copied"})},{label:"Refresh",icon:"i-lucide-refresh-cw",onClick:()=>u()}]),Ct=!!Oe().public.demoMode;let xe=null;const Xe=C(()=>{const f=a.value?.testRun?.status;return f==="running"||f==="finalizing"});function Tt(){if(Ct||xe)return;const f=a.value?.testRun?.id;f&&(xe=new EventSource(`/api/test-runs/${f}/stream`),xe.onmessage=T=>{try{const V=JSON.parse(T.data);V.type==="case-files"&&V.data?.testRunsCaseId===Number(p)?(u(),z()):V.type==="run-finished"&&(u(),z(),Ue())}catch{}},xe.onerror=()=>{})}function Ue(){xe&&(xe.close(),xe=null)}he(Xe,f=>{f?Tt():Ue()},{immediate:!0}),ts(Ue);const{copyRich:St,copied:Ye}=ms();function It(){const f=a.value;if(!f?.error)return;const T=window.location.origin,V=f.title??"Unknown test",oe=f.location??"",me=f.error.replace(/\x1b\[[0-9;]*[a-zA-Z]/g,""),le=Ce=>Ce.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),ge=G.value?`${T}/failure-clusters/${G.value.id}`:null,De=`${T}/test-run-cases/${p}?tab=diagnosis`,ke=a.value?.testCaseId?`${T}/test-cases/${a.value.testCaseId}`:null,Fe=[`❌ Test failed: ${V}`,oe?`Location: ${oe}`:null,"","Error:",me,"",ge?`Failure cluster: ${ge}`:null,`Execution: ${De}`,ke?`History: ${ke}`:null].filter(Ce=>Ce!==null).join(`
|
|
9
|
-
`),Ne=[`<p><strong>❌ Test failed: ${le(V)}</strong>${oe?`<br><code>${le(oe)}</code>`:""}</p>`,`<p><strong>Error:</strong></p><pre>${pt(f.error)}</pre>`,`<p>🔗 ${ge?`<a href="${ge}">View failure cluster</a> · `:""}<a href="${De}">Execution details</a>${ke?` · <a href="${ke}">Test history</a>`:""}</p>`].join("");St(Fe,Ne,{toast:"Failure copied"})}const Be=A(null),et=A(null),Le=A(null),ze=A(null),tt=A(null),Me=A(null),st=A(null),nt=A(null),at=A(null),ot=A(null);function _e(f){f?.scrollIntoView({behavior:"smooth",block:"start"})}const rt={sampleError:()=>_e(Be.value),executionError:()=>_e(Be.value),testSource:()=>ze.value?.reveal(),sourceFiles:()=>ze.value?.reveal(),environmentDiff:()=>st.value?.reveal(),visualDiff:()=>nt.value?.reveal(),domSnapshot:()=>at.value?.reveal(),ariaSnapshot:()=>ot.value?.reveal(),screenshots:()=>Me.value?.reveal(),tracePointers:()=>Me.value?.reveal(),artifacts:()=>Me.value?.reveal(),console:()=>_e(et.value),networkRequests:()=>_e(Le.value),serverTraces:()=>_e(Le.value),traceCallStack:()=>ze.value?.reveal(),traceNetwork:()=>{tt.value?.showTraceMode(),_e(Le.value)},steps:()=>{y.value="steps"},failingSteps:()=>{y.value="steps"}};return ss(Bs,{canLocate:f=>f in rt,open:f=>rt[f]?.()}),(f,T)=>{const V=Jt,oe=qt,me=ce,le=Pe,ge=hs,De=vs,ke=ks,Fe=Un,Ne=Ie,Ce=kt,it=ye,Rt=Wn,Lt=aa,zt=fa,Mt=ba,Dt=Ra,Nt=ps,jt=fs,At=ys,lt=Aa,ct=tr,ut=gs,Pt=vt,Ut=He,Bt=xs,je=fe,ie=Re,Ft=Js,dt=qs,mt=Qs,Ve=bt,Vt=ar,Et=br,ue=Xs,Ee=Zs,Ot=Ke,Ht=Ys,Kt=Ts,Wt=_s;return t(),k(Wt,{id:"test-run-case-detail"},{header:d(()=>[i(ke,null,{leading:d(()=>[i(V),i(oe,{items:[{label:"Home",icon:"i-lucide-house",to:"/"},{label:"Projects",to:"/projects"},...e(a)?.testRun?.project?.id?[{label:e(a).testRun.project.name||"Project",to:`/projects/${e(a).testRun.project.id}`}]:[{label:"Project"}],...e(a)?.testRun?.id?[{label:`Run #${e(a).testRun.id}`+(e(a).testRun.label?` — ${e(a).testRun.label}`:""),to:`/test-runs/${e(a).testRun.id}`}]:[{label:"Test run"}],{label:e(a)?.title||`Test run case #${e(p)}`}]},null,8,["items"])]),right:d(()=>[e(a)?.testCaseId?(t(),k(le,{key:0,to:`/test-cases/${e(a).testCaseId}`,class:"text-xs text-gray-500 hover:text-primary mr-2 flex items-center gap-1",title:"View test case evolution and history"},{default:d(()=>[i(me,{name:"i-lucide-trending-up",class:"size-3.5"}),T[2]||(T[2]=n("span",{class:"hidden sm:inline"},"Evolution",-1))]),_:1},8,["to"])):l("",!0),e(a)?(t(),k(ge,{key:1,endpoint:`/api/test-run-cases/${e(a).id}/export`,"base-name":`piwi-execution-${e(a).id}`,class:"mr-2"},null,8,["endpoint","base-name"])):l("",!0),i(De,{actions:e($t)},null,8,["actions"])]),_:1})]),body:d(()=>[i(Kt,{modelValue:e(y),"onUpdate:modelValue":T[1]||(T[1]=L=>pe(y)?y.value=L:null),"tab-items":e(N)},{summary:d(()=>[i(Fe,{"test-case":e(a)??null,"scm-info":e(R),"ci-info":e(W),browser:e(a)?.browser??null,environment:e(K),"steps-count":e(M).length,"historical-timing":e(E),"stable-links":e(a)?.stableLinks??null,onRefresh:T[0]||(T[0]=L=>e(u)())},null,8,["test-case","scm-info","ci-info","browser","environment","steps-count","historical-timing","stable-links"])]),"tab-diagnosis":d(()=>[n("div",Tr,[n("div",{ref_key:"errorEl",ref:Be,class:"scroll-mt-4"},[e(a)?.error?(t(),k(it,{key:0,icon:"i-lucide-circle-x","icon-class":"text-red-500",title:"Error"},{actions:d(()=>[i(Ce,{text:e(Ye)?"Copied!":"Copy failure"},{default:d(()=>[i(Ne,{size:"xs",variant:"ghost",color:"neutral",icon:e(Ye)?"i-lucide-check":"i-lucide-clipboard",onClick:It},null,8,["icon"])]),_:1},8,["text"])]),default:d(()=>[n("div",{class:"text-xs font-mono whitespace-pre-wrap break-words max-h-96 overflow-y-auto rounded bg-red-50 dark:bg-red-950/20 p-3",innerHTML:e(pt)(e(Cr)(e(a).error))},null,8,Sr)]),_:1})):l("",!0)],512),n("div",Ir,[n("div",Rr,[i(Rt,{"test-case":e(a)??null,history:e(r),"current-id":Number(e(p))},null,8,["test-case","history","current-id"]),e(G)?(t(),k(Lt,{key:0,cluster:e(G)},null,8,["cluster"])):l("",!0),i(zt,{"test-runs-case-id":Number(e(p))},null,8,["test-runs-case-id"])]),n("div",Lr,[e(a)?.testSourceFrames?.length||e(a)?.testSource||e($)?(t(),k(Mt,{key:0,ref_key:"testSourceCard",ref:ze,"storage-key":"case-test-source",frames:e(a)?.testSourceFrames??null,"test-source":e(a)?.testSource??null,"run-id":e(a)?.testRun?.id??null,"test-runs-case-id":Number(e(p)),"has-trace":e($),"project-key":e(a)?.testRun?.project?.id,"project-name":e(a)?.testRun?.project?.name},null,8,["frames","test-source","run-id","test-runs-case-id","has-trace","project-key","project-name"])):l("",!0),i(Dt,{ref_key:"evidenceCard",ref:Me,"storage-key":"case-evidence",attachments:e(a)?.attachments??[],traces:e(P)??[]},null,8,["attachments","traces"]),e(a)?.testRun?.id?(t(),k(Nt,{key:1,"storage-key":"case-locators","run-id":e(a).testRun.id,"test-runs-case-id":Number(e(p))},null,8,["run-id","test-runs-case-id"])):l("",!0),e(a)?.testRun?.id?(t(),k(jt,{key:2,ref_key:"envDiffCard",ref:st,"storage-key":"case-env-diff","run-id":e(a).testRun.id,"test-runs-case-id":Number(e(p))},null,8,["run-id","test-runs-case-id"])):l("",!0),e(a)?.testRun?.id?(t(),k(At,{key:3,ref_key:"visualDiffCard",ref:nt,"storage-key":"case-visual-diff","run-id":e(a).testRun.id,"test-runs-case-id":Number(e(p))},null,8,["run-id","test-runs-case-id"])):l("",!0),e(a)?.consoleLogs?.length?(t(),o("div",{key:4,ref_key:"consoleEl",ref:et,class:"scroll-mt-4"},[i(lt,{entries:e(a)?.consoleLogs??[]},null,8,["entries"])],512)):l("",!0),e(I).length>0||e($)?(t(),o("div",{key:5,ref_key:"networkEl",ref:Le,class:"scroll-mt-4"},[i(ct,{ref_key:"networkCard",ref:tt,requests:e(I),"run-id":e(a)?.testRun?.id??null,"test-runs-case-id":Number(e(p)),"has-trace":e($)},null,8,["requests","run-id","test-runs-case-id","has-trace"])],512)):l("",!0),e(a)?.pageState?(t(),k(ut,{key:6,"storage-key":"case-page-state","page-state":e(a).pageState},null,8,["page-state"])):l("",!0),e(a)?.ariaSnapshot?(t(),k(Ut,{key:7,ref_key:"ariaCard",ref:ot,"storage-key":"case-aria",icon:"i-lucide-scan-text",title:"ARIA snapshot",help:"case.aria"},{folded:d(()=>[...T[3]||(T[3]=[g("Accessibility tree captured at the moment of failure",-1)])]),default:d(()=>[n("div",zr,[i(Pt,{text:"```yaml\n"+e(a).ariaSnapshot+"\n```"},null,8,["text"])])]),_:1},512)):l("",!0),e(a)?.testRun?.id?(t(),k(Bt,{key:8,ref_key:"domSnapshotCard",ref:at,"storage-key":"case-dom-snapshot","run-id":e(a).testRun.id,"test-runs-case-id":Number(e(p))},null,8,["run-id","test-runs-case-id"])):l("",!0)])])])]),"tab-steps":d(()=>[n("div",Mr,[e(M).length>0?(t(),o("div",Dr,[n("div",Nr,[n("span",jr,c(e(M).length)+" steps",1),T[4]||(T[4]=n("span",{class:"text-gray-300 dark:text-gray-600"},"·",-1)),(t(!0),o(B,null,te(e(S),L=>(t(),o("span",{key:L.category,class:"inline-flex items-center gap-1"},[i(je,{color:ne[L.category]||"neutral",variant:"soft",size:"xs"},{default:d(()=>[g(c(L.category),1)]),_:2},1032,["color"]),n("span",Ar,[g("×"+c(L.count)+" · ",1),i(ie,{ms:L.duration},null,8,["ms"])])]))),128))]),i(mt,{"min-width":"40rem",bleed:!1},{default:d(()=>[i(dt,{data:e(M),columns:v,ui:{base:"table-fixed w-full border-separate border-spacing-0 min-w-[40rem]",thead:"[&>tr]:bg-elevated/50 [&>tr]:after:content-none",tbody:"[&>tr]:last:[&>td]:border-b-0",th:"first:rounded-l-lg last:rounded-r-lg border-y border-default first:border-l last:border-r",td:"border-b border-default align-top"}},{"index-cell":d(({row:L})=>[n("span",Pr,c(L.index+1),1)]),"status-cell":d(({row:L})=>[L.original.failed?(t(),o("span",Ur,"✗")):(t(),o("span",Br,"✓"))]),"category-cell":d(({row:L})=>[i(je,{color:ne[L.original.category]||"neutral",variant:"soft",size:"xs"},{default:d(()=>[g(c(L.original.category),1)]),_:2},1032,["color"])]),"title-cell":d(({row:L})=>[n("div",Fr,[n("span",{class:q(L.original.failed?"text-red-600 dark:text-red-400 font-medium":"")},c(L.original.title),3),L.index===e(H)?(t(),k(je,{key:0,color:"warning",variant:"subtle",size:"xs",class:"shrink-0",title:"Slowest step in this test"},{default:d(()=>[...T[5]||(T[5]=[g(" slowest ",-1)])]),_:1})):l("",!0)]),L.original.failed&&L.original.error?.message?(t(),o("p",Vr,c(L.original.error.message),1)):l("",!0),L.original.location?(t(),k(Ft,{key:1,location:L.original.location,"project-key":e(a)?.testRun?.project?.id,"project-name":e(a)?.testRun?.project?.name,class:"text-xs text-gray-400 dark:text-gray-500 mt-0.5"},null,8,["location","project-key","project-name"])):l("",!0)]),"duration-cell":d(({row:L})=>[n("div",Er,[n("div",Or,[i(ie,{ms:L.original.duration,class:q(`text-sm ${ae(L.original.duration)}`),"unit-class":"opacity-60"},null,8,["ms","class"]),ee(L.original.duration)?(t(),o("span",Hr,c(ee(L.original.duration)),1)):l("",!0)]),n("div",Kr,[n("div",{class:q(["absolute inset-y-0 rounded-full",D(L.original.duration)]),style:$e(Y(L.original))},null,6)])])]),_:1},8,["data"])]),_:1})])):(t(),k(Ve,{key:1,icon:"i-lucide-list-checks",text:"No steps recorded for this execution"}))])]),"tab-artifacts":d(()=>[n("div",Wr,[i(Vt,{traces:e(P)||[]},null,8,["traces"]),i(Et,{attachments:e(a)?.attachments??[]},null,8,["attachments"]),e(a)?.pageState?(t(),k(ut,{key:0,"storage-key":"case-page-state","page-state":e(a).pageState},null,8,["page-state"])):l("",!0),e(a)?.consoleLogs?.length?(t(),k(lt,{key:1,entries:e(a)?.consoleLogs??[]},null,8,["entries"])):l("",!0),e(I).length>0||e($)?(t(),k(ct,{key:2,requests:e(I),"run-id":e(a)?.testRun?.id??null,"test-runs-case-id":Number(e(p)),"has-trace":e($)},null,8,["requests","run-id","test-runs-case-id","has-trace"])):l("",!0),!e(P)?.length&&!e(a)?.attachments?.length&&!e(a)?.consoleLogs?.length&&!e(I).length?(t(),o("div",Gr,[e(Xe)?(t(),o(B,{key:0},[i(me,{name:"i-lucide-loader-circle",class:"size-8 mb-2 animate-spin"}),T[6]||(T[6]=n("p",{class:"text-sm"}," Run in progress — traces and attachments appear here as soon as they are uploaded. ",-1))],64)):(t(),o(B,{key:1},[i(me,{name:"i-lucide-inbox",class:"size-8 mb-2"}),T[7]||(T[7]=n("p",{class:"text-sm"},"No traces, console logs, or network requests captured for this test case.",-1))],64))])):l("",!0)])]),"tab-performance":d(()=>[n("div",Jr,[e(F).length>0?(t(),o("div",qr,[(t(!0),o(B,null,te(e(F),(L,Gt)=>(t(),o("div",{key:Gt,class:q(["p-3 rounded-lg border",L.type==="warning"?"bg-amber-50 dark:bg-amber-900/20 border-amber-200 dark:border-amber-800":"bg-blue-50 dark:bg-blue-900/20 border-blue-200 dark:border-blue-800"])},[n("div",Qr,[i(me,{name:L.type==="warning"?"i-lucide-alert-triangle":"i-lucide-lightbulb",class:q([L.type==="warning"?"text-amber-600":"text-blue-600","size-4 mt-0.5 shrink-0"])},null,8,["name","class"]),n("div",null,[n("p",{class:q(L.type==="warning"?"text-amber-800 dark:text-amber-200 font-medium":"text-blue-800 dark:text-blue-200 font-medium")},c(L.message),3),n("p",{class:q([L.type==="warning"?"text-amber-700 dark:text-amber-300":"text-blue-700 dark:text-blue-300","mt-1"])},c(L.details),3)])])],2))),128))])):l("",!0),e(m)?(t(),k(it,{key:1,icon:"i-lucide-gauge",title:"Browser performance (Web Vitals)",help:"case.web-vitals"},{default:d(()=>[n("div",Zr,[e(m).navigation?(t(),k(Ee,{key:0,"min-tile-width":"10rem"},{default:d(()=>[i(ue,{label:"TTFB",hint:"Time to first byte","value-class":e(m).navigation.ttfb>600?"text-red-600":e(m).navigation.ttfb>200?"text-orange-500":"text-green-600"},{default:d(()=>[i(ie,{ms:e(m).navigation.ttfb},null,8,["ms"])]),_:1},8,["value-class"]),i(ue,{label:"DOM Interactive",hint:"DOM interactive","value-class":e(m).navigation.domInteractive>3e3?"text-red-600":e(m).navigation.domInteractive>1500?"text-orange-500":"text-green-600"},{default:d(()=>[i(ie,{ms:e(m).navigation.domInteractive},null,8,["ms"])]),_:1},8,["value-class"]),i(ue,{label:"DOMContentLoaded",hint:"DOMContentLoaded","value-class":e(m).navigation.domContentLoaded>3e3?"text-red-600":e(m).navigation.domContentLoaded>1500?"text-orange-500":"text-green-600"},{default:d(()=>[i(ie,{ms:e(m).navigation.domContentLoaded},null,8,["ms"])]),_:1},8,["value-class"]),i(ue,{label:"Load Complete",hint:"Page fully loaded","value-class":e(m).navigation.loadComplete>5e3?"text-red-600":e(m).navigation.loadComplete>3e3?"text-orange-500":"text-green-600"},{default:d(()=>[i(ie,{ms:e(m).navigation.loadComplete},null,8,["ms"])]),_:1},8,["value-class"])]),_:1})):l("",!0),e(m).paint&&(e(m).paint.firstPaint||e(m).paint.firstContentfulPaint)?(t(),k(Ee,{key:1,"min-tile-width":"10rem",class:"pt-2 border-t"},{default:d(()=>[e(m).paint.firstPaint!==void 0?(t(),k(ue,{key:0,label:"First Paint (FP)"},{default:d(()=>[i(ie,{ms:e(m).paint.firstPaint},null,8,["ms"])]),_:1})):l("",!0),e(m).paint.firstContentfulPaint!==void 0?(t(),k(ue,{key:1,label:"First Contentful Paint (FCP)","value-class":e(m).paint.firstContentfulPaint>3e3?"text-red-600":e(m).paint.firstContentfulPaint>1800?"text-orange-500":"text-green-600"},{default:d(()=>[i(ie,{ms:e(m).paint.firstContentfulPaint},null,8,["ms"])]),_:1},8,["value-class"])):l("",!0)]),_:1})):l("",!0),e(m).vitals?(t(),k(Ee,{key:2,"min-tile-width":"10rem",class:"pt-2 border-t"},{default:d(()=>[i(ue,{label:"Largest Contentful Paint (LCP)","value-class":e(m).vitals.lcp==null?"text-gray-400":e(m).vitals.lcp>4e3?"text-red-600":e(m).vitals.lcp>2500?"text-orange-500":"text-green-600"},{default:d(()=>[i(ie,{ms:e(m).vitals.lcp,fallback:"n/a"},null,8,["ms"])]),_:1},8,["value-class"]),i(ue,{label:"Cumulative Layout Shift (CLS)",value:e(m).vitals.cls!=null?String(e(m).vitals.cls):"n/a","value-class":e(m).vitals.cls==null?"text-gray-400":e(m).vitals.cls>.25?"text-red-600":e(m).vitals.cls>.1?"text-orange-500":"text-green-600"},null,8,["value","value-class"]),i(ue,{label:"Interaction to Next Paint (INP)","value-class":e(m).vitals.inp==null?"text-gray-400":e(m).vitals.inp>500?"text-red-600":e(m).vitals.inp>200?"text-orange-500":"text-green-600"},{default:d(()=>[i(ie,{ms:e(m).vitals.inp,fallback:"n/a"},null,8,["ms"])]),_:1},8,["value-class"])]),_:1})):l("",!0),e(m).navigation?.url?(t(),o("div",Xr,[T[8]||(T[8]=g(" Page: ",-1)),n("code",Yr,c(e(m).navigation.url),1)])):l("",!0)])]),_:1})):l("",!0),e(F).length===0&&!e(m)?(t(),k(Ve,{key:2,icon:"i-lucide-gauge",text:"No performance hints or Web Vitals were captured for this execution."},{default:d(()=>[n("p",ei,[T[10]||(T[10]=g(" Web Vitals and timing come from the ",-1)),i(Ot,{to:"capture-fixtures"},{default:d(()=>[...T[9]||(T[9]=[g("capture fixtures",-1)])]),_:1}),T[11]||(T[11]=g(". ",-1))])]),_:1})):l("",!0)])]),"tab-history":d(()=>[n("div",ti,[e(r)&&e(r).length>0?(t(),o("div",si,[n("div",ni,[e(a)?.testCaseId?(t(),k(Ne,{key:0,to:`/test-cases/${e(a).testCaseId}`,size:"xs",variant:"outline",color:"neutral","trailing-icon":"i-lucide-arrow-right"},{default:d(()=>[...T[12]||(T[12]=[g(" View full test history ",-1)])]),_:1},8,["to"])):l("",!0)]),i(Ht,{data:e(r),height:200},null,8,["data"]),i(mt,{"min-width":"44rem",bleed:!1},{default:d(()=>[i(dt,{data:e(r),columns:j,ui:{base:"table-fixed border-separate border-spacing-0 min-w-[44rem]",thead:"[&>tr]:bg-elevated/50 [&>tr]:after:content-none",tbody:"[&>tr]:last:[&>td]:border-b-0",th:"first:rounded-l-lg last:rounded-r-lg border-y border-default first:border-l last:border-r",td:"border-b border-default"}},{"startTime-cell":d(({row:L})=>[n("span",ai,[n("span",oi,c(new Date(L.original.startTime).toLocaleDateString("en-US",{month:"short",day:"numeric"})),1),n("span",ri,c(new Date(L.original.startTime).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit"})),1)])]),"status-cell":d(({row:L})=>[i(je,{color:("getStatusColor"in f?f.getStatusColor:e(Hs))(L.original.status),variant:"subtle",class:"capitalize"},{default:d(()=>[g(c(L.original.status),1)]),_:2},1032,["color"])]),"duration-cell":d(({row:L})=>[L.original.duration!==null?(t(),k(ie,{key:0,ms:L.original.duration},null,8,["ms"])):(t(),o("span",ii,"—"))]),"runId-cell":d(({row:L})=>[i(le,{to:`/test-runs/${L.original.runId}`,class:"text-primary hover:underline"},{default:d(()=>[g(" #"+c(L.original.runId),1)]),_:2},1032,["to"])]),"error-cell":d(({row:L})=>[L.original.error?(t(),o("span",{key:0,class:"text-red-600 text-xs truncate max-w-xs block",title:L.original.error},c(L.original.error.length>80?`${L.original.error.substring(0,80)}…`:L.original.error),9,li)):l("",!0)]),_:1},8,["data"])]),_:1})])):(t(),k(Ve,{key:1,icon:"i-lucide-trending-up",text:"No prior executions of this test yet."},{default:d(()=>[...T[13]||(T[13]=[n("p",{class:"text-xs text-gray-400"}," This is the first recorded run. Once it runs again, its status and duration trend appear here. ",-1)])]),_:1}))])]),_:1},8,["modelValue","tab-items"])]),_:1})}}});export{sl as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"ab473028-4b37-4884-b243-b8f6e5046e5e","timestamp":1785080338123,"prerendered":[]}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{d as te,b as We,o as n,f as P,g as C,j as k,_ as Ie,m as z,i as u,k as t,l as ze,r as E,J as gt,h as S,A as Re,c,O as ht,V as Ee,ae as vt,S as ge,C as he,p as ye,q as re,v as $,t as h,F,K as yt,y as oe,s as Be,E as st,H as Oe,af as Le,B as at,I as xt,Q as Xe,G as Ze,ac as Ae,D as bt,W as je,ag as Se,T as kt,ad as _t,ah as $t,ai as wt,aj as Ct,a0 as St,a1 as Tt}from"./NQikbhmK.js";import{_ as rt,a as Lt}from"./C7P1UCO2.js";import{_ as zt}from"./B44A4LSJ.js";import{u as At}from"./CtQBsNUb.js";import{u as Ve}from"./Bn0YQDyy.js";import{g as it,u as It,v as Rt,f as Je,w as lt,n as Ue,x as Bt}from"./CDk0q2hV.js";import{_ as Ge}from"./D0HNloZ9.js";import{_ as Ne}from"./DprVVyUQ.js";import{_ as Pt}from"./B3HO8kuh.js";import{u as Me}from"./CpjgB2aY.js";import{_ as Ot}from"./cHAnlQbv.js";import{_ as Et}from"./DP8hfJ9h.js";import{_ as Ut}from"./rWNTSFD6.js";import{k as jt,i as Mt,b as Nt}from"./HXerICAi.js";import{f as Kt}from"./D-c8ZSws.js";import{_ as ct}from"./BPRffDuo.js";import{_ as Dt}from"./eptP4pGv.js";const Vt={class:"w-64 p-1 space-y-0.5"},Ht={class:"flex items-center justify-between px-2 pt-1 pb-1"},Ft=te({__name:"ExportMenu",props:{endpoint:{},baseName:{}},setup(e){const r=e,{download:i}=At(),{copy:f}=Ve(),s=We(),a=E(!1),o=E(""),p=S(()=>(Re().app?.baseURL??"/").replace(/\/$/,""));function l(L){return`${p.value}${L}`}async function g(L){a.value=!1,await i(l(`${r.endpoint}?format=${L}`),`${r.baseName}.${L}`,{binary:L==="zip"})}function T(){a.value=!1,window.open(l(`${r.endpoint}?format=html&print=1`),"_blank")}async function A(L,x,I){o.value=x;try{const M=await fetch(l(L));if(!M.ok)throw new Error(`Request failed (${M.status})`);const D=await M.text();f(I?I(D):D,{toast:`${x} copied`}),a.value=!1}catch(M){s.add({title:`Could not copy ${x.toLowerCase()}`,description:it(M),color:"error"})}finally{o.value=""}}function b(){return A(`${r.endpoint}?format=md`,"Report")}return(L,x)=>{const I=Ie,M=rt,D=zt,U=gt;return n(),P(U,{open:t(a),"onUpdate:open":x[4]||(x[4]=B=>ze(a)?a.value=B:null)},{content:C(()=>[u("div",Vt,[u("div",Ht,[x[6]||(x[6]=u("p",{class:"text-xs font-medium text-gray-500"},"Download",-1)),k(M,{topic:"export.offline"})]),k(I,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-file-code",title:"One self-contained HTML file with screenshots and video embedded",onClick:x[0]||(x[0]=B=>g("html"))},{default:C(()=>[...x[7]||(x[7]=[z(" HTML — single file ",-1)])]),_:1}),k(I,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-file-archive",title:"Report plus the raw artifacts, including trace archives and data.json",onClick:x[1]||(x[1]=B=>g("zip"))},{default:C(()=>[...x[8]||(x[8]=[z(" ZIP — with all evidence ",-1)])]),_:1}),k(I,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-printer",title:"Opens the report with your browser's print dialog, for Save as PDF",onClick:T},{default:C(()=>[...x[9]||(x[9]=[z(" PDF — via print ",-1)])]),_:1}),k(I,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-file-text",title:"The Markdown report as a file",onClick:x[2]||(x[2]=B=>g("md"))},{default:C(()=>[...x[10]||(x[10]=[z(" Markdown ",-1)])]),_:1}),k(I,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-file-json",title:"Everything the report contains, machine-readable",onClick:x[3]||(x[3]=B=>g("json"))},{default:C(()=>[...x[11]||(x[11]=[z(" JSON ",-1)])]),_:1}),k(D,{class:"my-1"}),x[13]||(x[13]=u("p",{class:"text-xs font-medium text-gray-500 px-2 pt-1 pb-1"},"Copy to clipboard",-1)),k(I,{block:"",size:"sm",color:"neutral",variant:"ghost",class:"justify-start",icon:"i-lucide-clipboard-list",loading:t(o)==="Report",title:"The whole investigation as Markdown, for an issue or a chat",onClick:b},{default:C(()=>[...x[12]||(x[12]=[z(" Report (Markdown) ",-1)])]),_:1},8,["loading"])])]),default:C(()=>[k(I,{icon:"i-lucide-share",size:"xs",color:"neutral",variant:"outline",title:"Take this investigation away"},{default:C(()=>[...x[5]||(x[5]=[z(" Export ",-1)])]),_:1})]),_:1},8,["open"])}}}),Ba=Object.assign(Ft,{__name:"ExportMenu"}),qt={class:"flex items-center justify-between gap-2"},Zt=["aria-expanded","title"],Wt={class:"text-lg font-medium inline-flex items-center gap-1 shrink-0"},Jt={key:2,class:"min-w-0 flex-1 truncate text-sm text-gray-500 dark:text-gray-400"},Gt={key:0,class:"flex items-center gap-1 shrink-0"},Yt={key:0,class:"text-sm text-gray-500 mt-1 ml-11"},Qt=te({__name:"CollapsibleSectionCard",props:{title:{},icon:{},subtitle:{},count:{},iconClass:{default:"text-primary"},help:{},storageKey:{},defaultFolded:{type:Boolean,default:!0}},setup(e,{expose:r}){const i=e,{folded:f,toggle:s,setFolded:a}=jt(`piwi-section-fold-${i.storageKey}`,i.defaultFolded),o=E(null);function p(){a(!1),yt(()=>o.value?.scrollIntoView({behavior:"smooth",block:"start"}))}return r({setFolded:a,reveal:p}),(l,g)=>{const T=ye,A=rt,b=Dt;return n(),c("div",{ref_key:"rootEl",ref:o,class:"scroll-mt-4"},[k(b,{ui:{header:"p-3 sm:px-4 sm:py-3",body:t(f)?"p-0 sm:p-0":""},class:re(t(f)&&"divide-y-0")},{header:C(()=>[u("div",qt,[u("div",{class:"flex items-center gap-2 min-w-0 flex-1 cursor-pointer select-none rounded-sm outline-none focus-visible:outline-2 focus-visible:outline-primary",role:"button",tabindex:"0","aria-expanded":!t(f),title:t(f)?"Expand section":"Collapse section",onClick:g[1]||(g[1]=(...L)=>t(s)&&t(s)(...L)),onKeydown:[g[2]||(g[2]=ge((...L)=>t(s)&&t(s)(...L),["enter"])),g[3]||(g[3]=ge(he((...L)=>t(s)&&t(s)(...L),["prevent"]),["space"]))]},[k(T,{name:t(f)?"i-lucide-chevron-right":"i-lucide-chevron-down",class:"size-4 shrink-0 text-gray-400"},null,8,["name"]),e.icon?(n(),P(T,{key:0,name:e.icon,class:re(["size-5 shrink-0",e.iconClass])},null,8,["name","class"])):$("",!0),u("h3",Wt,[z(h(e.title),1),e.count!=null?(n(),c(F,{key:0},[z(" ("+h(e.count)+")",1)],64)):$("",!0)]),e.help?(n(),c("span",{key:1,onClick:g[0]||(g[0]=he(()=>{},["stop"]))},[k(A,{topic:e.help},null,8,["topic"])])):$("",!0),t(f)&&l.$slots.folded?(n(),c("span",Jt,[Ee(l.$slots,"folded")])):$("",!0)],40,Zt),l.$slots.actions?(n(),c("div",Gt,[Ee(l.$slots,"actions")])):$("",!0)]),!t(f)&&(e.subtitle||l.$slots.subtitle)?(n(),c("p",Yt,[Ee(l.$slots,"subtitle",{},()=>[z(h(e.subtitle),1)])])):$("",!0)]),default:C(()=>[ht(u("div",null,[Ee(l.$slots,"default")],512),[[vt,!t(f)]])]),_:3},8,["ui","class"])],512)}}}),Ke=Object.assign(Qt,{__name:"CollapsibleSectionCard"}),Xt={class:"overflow-x-auto text-xs font-mono"},en=te({__name:"DiffPatch",props:{patch:{}},setup(e){return(r,i)=>(n(),c("div",Xt,[(n(!0),c(F,null,oe(("parsePatchLines"in r?r.parsePatchLines:t(Rt))(e.patch),(f,s)=>(n(),c("div",{key:s,class:re(["px-3 py-px whitespace-pre leading-5 min-w-0",("patchLineClass"in r?r.patchLineClass:t(It))[f.type]])},h(f.text||" "),3))),128))]))}}),tn=Object.assign(en,{__name:"DiffPatch"}),nn=["role","aria-checked","tabindex"],on={class:"flex-1 min-w-0"},sn=["title"],an={key:0,class:"text-[11px] leading-4 text-gray-500 truncate"},rn=te({__name:"LocatorAlternativeRow",props:{alt:{},note:{default:void 0},copied:{type:Boolean,default:!1},dense:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},selected:{type:Boolean,default:!1}},emits:["copy","select"],setup(e){const r=e;function i(a){return a>=80?"success":a>=50?"warning":"error"}function f(a){const{method:o,score:p,args:l}=a;return l&&(l.anchorTestId||l.anchorSelector||l.anchorRole)?"scoped to a stable ancestor — survives renames":p>=100?"most stable — purpose-built for testing":o==="getByRole"&&l&&!("name"in l)?"name-free role — survives renames":o==="getByRole"?"browser ARIA tree — semantic and stable":o==="getByLabel"?"associated <label> element":o==="getByPlaceholder"?"input placeholder":o==="getByText"?"visible text":o==="getByAltText"?"image alt text":o==="getByTitle"?"title attribute":o==="locator"&&p>=50?"stable selector":o==="locator"?"CSS class — may be fragile":""}const s=S(()=>r.note??f(r.alt));return(a,o)=>{const p=Be,l=ye,g=Ie;return n(),c("div",{class:re(["flex items-center gap-2 rounded border",[e.dense?"py-1 px-2":"py-1.5 px-2.5",e.selectable?"cursor-pointer hover:bg-elevated transition-colors focus-visible:outline-2 focus-visible:outline-primary":"",e.selectable&&e.selected?"border-primary/60 ring-1 ring-primary/50":"border-default/50"]]),role:e.selectable?"radio":void 0,"aria-checked":e.selectable?e.selected:void 0,tabindex:e.selectable?0:void 0,onClick:o[1]||(o[1]=T=>e.selectable&&a.$emit("select")),onKeydown:[o[2]||(o[2]=ge(he(T=>e.selectable&&a.$emit("select"),["prevent"]),["enter"])),o[3]||(o[3]=ge(he(T=>e.selectable&&a.$emit("select"),["prevent"]),["space"]))]},[k(p,{size:"xs",color:i(e.alt.score),variant:"subtle",class:re(["shrink-0 font-mono tabular-nums cursor-default text-center",e.dense?"min-w-[2.25rem]":"min-w-[2.5rem]"]),title:`Stability score: ${e.alt.score}/100`},{default:C(()=>[z(h(e.alt.score),1)]),_:1},8,["color","class","title"]),u("div",on,[u("code",{class:"text-xs font-mono block truncate",title:e.alt.locator},h(e.alt.locator),9,sn),t(s)?(n(),c("p",an,h(t(s)),1)):$("",!0)]),e.alt.pickedByUser&&e.dense?(n(),P(l,{key:0,name:"i-lucide-user-check",class:"size-3.5 text-primary shrink-0",title:"Confirmed with the locator picker"})):e.alt.pickedByUser?(n(),P(p,{key:1,size:"xs",color:"primary",variant:"subtle",icon:"i-lucide-user-check",class:"shrink-0",title:"Confirmed with the locator picker on the failing page"})):$("",!0),k(g,{size:"xs",variant:"ghost",color:"neutral",icon:e.copied?"i-lucide-check":"i-lucide-copy",title:e.copied?"Copied!":"Copy",class:"shrink-0",onClick:o[0]||(o[0]=he(T=>a.$emit("copy"),["stop"]))},null,8,["icon","title"])],42,nn)}}}),ut=Object.assign(rn,{__name:"LocatorAlternativeRow"}),et={getByTestId:"testid",getByRole:"semantic",getByLabel:"label",getByPlaceholder:"label",getByText:"text",getByAltText:"text",getByTitle:"text",locator:"css","page.locator":"css"},ln=50;function dt(e,r,i=ln){const f=r[0]??null;if(!f)return{recommended:null,durable:null,preservesConvention:!1,hasDurableAlternative:!1,suggestAddTestId:!1};const s=e?et[e]:void 0,a=(e?r.find(l=>l.method===e&&l.score>=i):void 0)??(s?r.find(l=>et[l.method]===s&&l.score>=i):void 0),p=r.find(l=>l.pickedByUser)??a??f;return{recommended:p,durable:f,preservesConvention:!!a&&p===a,hasDurableAlternative:p.locator!==f.locator,suggestAddTestId:f.score<i}}const ft={a:"link",button:"button",nav:"navigation",main:"main",article:"article",section:"region",form:"form",img:"img",figure:"figure",figcaption:"caption",blockquote:"blockquote",table:"table",ul:"list",ol:"list",li:"listitem",dialog:"dialog",output:"status",progress:"progressbar",meter:"meter",textarea:"textbox",h1:"heading",h2:"heading",h3:"heading",h4:"heading",h5:"heading",h6:"heading",details:"group",summary:"button",search:"search"},cn={button:"button",submit:"button",reset:"button",image:"button",checkbox:"checkbox",radio:"radio",range:"slider",search:"searchbox",number:"spinbutton",text:"textbox",email:"textbox",tel:"textbox",url:"textbox",password:"textbox"},un=["id","class","name","data-testid","placeholder","alt","title","aria-label","aria-level","role","type","href","multiple"];function dn(e){const r=e.attributes.role;if(r)return r;const i=e.tagName;if(!i)return null;if(i==="input"){const f=(e.attributes.type??"text").toLowerCase();return cn[f]??"textbox"}return i==="select"?e.attributes.multiple!=null?"listbox":"combobox":i==="a"?e.attributes.href!=null?"link":null:ft[i]??null}function fn(e,r){if(r!=="heading")return null;const i=e.tagName.match(/^h([1-6])$/);if(i)return Number(i[1]);const f=e.attributes["aria-level"];return f&&/^\d+$/.test(f)?Number(f):null}const $e=(e,r)=>e.attributes[r]||null,pe=e=>e.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),Fe=e=>e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),tt=e=>/^[A-Za-z][A-Za-z0-9_-]*$/.test(e);function mn(e){return/[a-f0-9]{8,}/i.test(e)?10:/^(?:css|sc|emotion|styled)-/i.test(e)?15:/^(bg|text|border|shadow|opacity|font|w-|h-|m[tblrxy]?-|p[tblrxy]?-|flex|grid|gap|rounded|absolute|relative|fixed|sticky|block|inline|hidden|overflow|z-|top-|right-|bottom-|left-|inset-|justify-|items-|self-|content-|order-|col-|row-)/.test(e)?25:/__/.test(e)||/--/.test(e)?35:/^[a-z]+(-[a-z]+)+$/.test(e)||/^[a-z]+[A-Z][a-zA-Z]+$/.test(e)?40:(e.includes("_")||/^[a-z]+-[a-z0-9]{5,}$/.test(e)&&/[0-9]/.test(e),15)}function nt(e){return!!(/^[a-f0-9]{8}-([a-f0-9]{4}-){3}[a-f0-9]{12}$/i.test(e)||/^[a-f0-9]{8,}$/i.test(e)||/^[a-z]+-\d+$/.test(e)||/^(emotion-|styled-|css-|sc-)/.test(e)||e.startsWith("ng-")||/^(radix-|headlessui-|mui-|mantine-|chakra-)/i.test(e)||/^:r[0-9a-z]+:$/i.test(e)||/^«r[0-9a-z]+»$/i.test(e))}function pn(e){const r=[],i=new Set,f=y=>{i.has(y.locator)||(i.add(y.locator),r.push(y))},{accessibleName:s}=e,a=e.tagName,o=dn(e),p=e.selectorCounts,l=y=>y==null||y<=1,g=e.textContent?e.textContent.replace(/\s+/g," ").trim():null,T=$e(e,"data-testid");T&&l(p?.testId)&&f({locator:`getByTestId('${pe(T)}')`,method:"getByTestId",args:{testId:T},score:100});const A=fn(e,o),b=A!=null?`, level: ${A}`:"",L=y=>A!=null?{...y,level:A}:y;o&&s&&f({locator:`getByRole('${o}', { name: '${pe(s)}'${b} })`,method:"getByRole",args:L({role:o,name:s}),score:90});const x=$e(e,"aria-label");if(o&&x&&x!==s&&f({locator:`getByRole('${o}', { name: '${pe(x)}'${b} })`,method:"getByRole",args:L({role:o,name:x}),score:85}),s&&["input","select","textarea"].includes(a)){const y=$e(e,"aria-label");(e.hasLabel===void 0||e.hasLabel===!0||y===s)&&f({locator:`getByLabel('${pe(s)}')`,method:"getByLabel",args:{label:s},score:85})}const I=$e(e,"placeholder");I&&f({locator:`getByPlaceholder('${pe(I)}')`,method:"getByPlaceholder",args:{placeholder:I},score:80}),g&&g.length<80&&f({locator:`getByText('${pe(g)}')`,method:"getByText",args:{text:g},score:75});const M=$e(e,"id");if(M&&!nt(M)&&l(p?.id)){const y=tt(M)?`#${M}`:`[id="${Fe(M)}"]`;f({locator:`locator('${pe(y)}')`,method:"locator",args:{selector:y},score:65})}const D=$e(e,"name");if(D&&l(p?.name)){const y=`[name="${Fe(D)}"]`;f({locator:`locator('${pe(y)}')`,method:"locator",args:{selector:y},score:60})}const U=$e(e,"alt");U&&f({locator:`getByAltText('${pe(U)}')`,method:"getByAltText",args:{text:U},score:60});const B=$e(e,"title");B&&f({locator:`getByTitle('${pe(B)}')`,method:"getByTitle",args:{title:B},score:50});const ce=!!(T&&l(p?.testId));if(o&&!ce){const y=A!=null?`'${o}', { level: ${A} }`:`'${o}'`,q=L({role:o});let N=!1,V=!1,J=!1;for(const Q of e.ancestors??[]){if(Q.scopedRoleCount!==1)continue;if(!N&&Q.testId&&Q.testIdCount===1&&(N=!0,f({locator:`getByTestId('${pe(Q.testId)}').getByRole(${y})`,method:"getByRole",args:{...q,anchorTestId:Q.testId},score:72})),!V&&Q.id&&!nt(Q.id)&&Q.idCount===1){V=!0;const xe=tt(Q.id)?`#${Q.id}`:`[id="${Fe(Q.id)}"]`;f({locator:`locator('${pe(xe)}').getByRole(${y})`,method:"getByRole",args:{...q,anchorSelector:xe},score:64})}const ve=Q.role||ft[Q.tag]||null;!J&&ve&&ve!==o&&Q.roleCount===1&&(J=!0,f({locator:`getByRole('${pe(ve)}').getByRole(${y})`,method:"getByRole",args:{...q,anchorRole:ve},score:55}))}const Z=e.rolePosition;Z&&Z.role===o&&(Z.count===1||A!=null&&Z.levelCount===1)&&f({locator:`getByRole(${y})`,method:"getByRole",args:q,score:58})}const ee=$e(e,"class");if(ee){const y=p?.classes,q=ee.split(/\s+/).filter(N=>N.length>1&&/^[A-Za-z_-][A-Za-z0-9_-]*$/.test(N)&&l(y?.[N])).map(N=>({cls:N,score:mn(N)})).sort((N,V)=>V.score-N.score).slice(0,3);for(const{cls:N,score:V}of q)f({locator:`locator('.${pe(N)}')`,method:"locator",args:{selector:`.${N}`},score:V})}return r.sort((y,q)=>q.score-y.score)}function gn(e){const r=e.attributes,i=r["aria-label"];if(i)return i;if(e.textContent)return e.textContent;const f=r.title;if(f)return f;const s=r.placeholder;return s||null}function hn(e){if(window.__piwiPickerInstalled)return;window.__piwiPickerInstalled=!0;var r=document,i=window,f=2147483600,s=e.probedAttrs,a=r.createElement("div");a.id="__piwi_picker_highlight",a.style.cssText="position:fixed;pointer-events:none;z-index:"+f+";display:none;box-sizing:border-box;border:2px solid #7c3aed;background:rgba(124,58,237,.12);border-radius:3px;",r.body.appendChild(a);var o=r.createElement("div");o.id="__piwi_picker_banner",o.style.cssText="position:fixed;top:12px;left:50%;transform:translateX(-50%);z-index:"+(f+2)+";background:#111827;color:#f9fafb;font:13px/1.5 system-ui,sans-serif;padding:10px 16px;border-radius:8px;box-shadow:0 4px 24px rgba(0,0,0,.4);max-width:80vw;",o.innerHTML='<div>Click an element to generate locators</div><div style="color:#9ca3af;margin-top:3px;font-size:11px">↑ parent · ↓ child · Esc skip</div>',r.body.appendChild(o),i.parent.postMessage({type:"pickerReady"},"*");function p(d){var _=(d.tagName||"?").toLowerCase(),R=d.getAttribute&&d.getAttribute("data-testid");if(R)return"getByTestId('"+R+"')";if(d.labels&&d.labels.length>0){var j=(d.labels[0].textContent||"").replace(/\s+/g," ").trim().slice(0,80);if(j)return"getByLabel('"+j+"')"}var X=d.getAttribute&&d.getAttribute("aria-label");if(X)return"getByLabel('"+X+"')";var Y=d.getAttribute&&d.getAttribute("placeholder");if(Y)return"getByPlaceholder('"+Y+"')";var W=d.getAttribute&&d.getAttribute("alt");if(W)return"getByAltText('"+W+"')";var ae=d.getAttribute&&d.getAttribute("title");if(ae)return"getByTitle('"+ae+"')";if(d.id)return"locator('#"+d.id+"')";var me=(d.getAttribute&&d.getAttribute("class")||"").split(/\s+/).find(function(w){return w.length>1});return me?"locator('."+me+"')":_}function l(d){for(var _=[],R=d;R&&_.length<15;){var j=(R.tagName||"").toLowerCase();if(j==="body"||j==="html")break;_.push(R),R=R.parentElement}return _.length?_:[d]}var g=["button","a","input","select","textarea","summary","option"];function T(d){for(var _=0;_<Math.min(d.length,4);_++){var R=d[_],j=(R.tagName||"").toLowerCase();if(g.indexOf(j)!==-1||R.getAttribute&&(R.getAttribute("role")||R.getAttribute("data-testid")))return _}return 0}var A=[],b=0,L=null;function x(){return A[b]||null}function I(){var d=x();if(!d){a.style.display="none";return}var _=d.getBoundingClientRect();a.style.display="block",a.style.left=_.left+"px",a.style.top=_.top+"px",a.style.width=_.width+"px",a.style.height=_.height+"px";var R=r.getElementById("__piwi_picker_foot");R&&(R.textContent=p(d)+" — click to pick · ↑ parent · ↓ child · Esc skip")}var M=o.querySelector("[style*=margin]");M&&(M.id="__piwi_picker_foot");function D(d){for(var _={},R=0;R<s.length;R++){var j=s[R],X=d.getAttribute(j)||d[j];_[j]=typeof X=="string"?X.slice(0,200):X?String(X).slice(0,200):null}var Y=d.getBoundingClientRect(),W={};try{var ae=function(we){return i.CSS.escape(we)},me=function(we){try{return r.querySelectorAll(we).length}catch{return}};_["data-testid"]&&(W.testId=me("[data-testid="+JSON.stringify(_["data-testid"])+"]")),_.id&&(W.id=me("#"+ae(_.id))),_.name&&(W.name=me("[name="+JSON.stringify(_.name)+"]"));var w=(_.class||"").split(/\s+/).filter(function(we){return we.length>1}).slice(0,10);if(w.length>0){for(var v={},G=0;G<w.length;G++){var le=me("."+ae(w[G]));le!==void 0&&(v[w[G]]=le)}W.classes=v}}catch{}var De=null;return d.labels&&d.labels.length>0&&(De=(d.labels[0].textContent||"").replace(/\s+/g," ").trim().slice(0,120)||null),{tagName:(d.tagName||"").toLowerCase(),attributes:_,textContent:(d.textContent||"").replace(/\s+/g," ").trim().slice(0,80)||null,center:{x:Math.round(Y.x+Y.width/2),y:Math.round(Y.y+Y.height/2)},hasLabel:!!(d.labels&&d.labels.length>0),labelText:De,selectorCounts:W}}function U(d){d.preventDefault(),d.stopImmediatePropagation()}function B(d){return d===o||d===a||o.contains&&o.contains(d)||d&&d.__piwiHint}var ce="top";function ee(d){ce!==d&&(ce=d,d==="bottom"?(o.style.top="auto",o.style.bottom="12px"):(o.style.top="12px",o.style.bottom="auto"))}function y(d){var _=d.target;if(!_||B(_)){a.style.display="none";return}_!==L&&(L=_,A=l(_),b=T(A)),I();var R=x();if(R){var j=R.getBoundingClientRect(),X=o.getBoundingClientRect(),Y=8;j.left<X.right+Y&&j.right>X.left-Y&&j.top<X.bottom+Y&&j.bottom>X.top-Y&&ee(ce==="top"?"bottom":"top")}}function q(d){if(d==="Escape"){Te();return}d==="ArrowUp"&&(b=Math.min(b+1,A.length-1),I()),d==="ArrowDown"&&(b=Math.max(b-1,0),I())}function N(d){(d.key==="Escape"||d.key==="ArrowUp"||d.key==="ArrowDown")&&(U(d),q(d.key))}var V=[];function J(){for(var d=0;d<V.length;d++)V[d].parentNode&&V[d].parentNode.removeChild(V[d]);V=[]}function Z(d){return(d||"").replace(/\s+/g," ").trim().toLowerCase()}function Q(d){var _=Z(d);if(_.length<2)return[];for(var R=r.querySelectorAll("button,a,[role],h1,h2,h3,h4,h5,h6,label,summary,input,textarea,select,option,span,li,td,th,p"),j=[],X=[],Y=0;Y<R.length;Y++){var W=R[Y],ae=Z(W.textContent);if(!ae){var me=Z(W.getAttribute&&(W.getAttribute("placeholder")||W.getAttribute("aria-label"))||"");me&&(me===_||me.indexOf(_)!==-1)&&j.push(W);continue}ae.length>120||(ae===_?j.push(W):ae.indexOf(_)!==-1&&ae.length<_.length+30&&X.push(W))}return j.concat(X)}function ve(d,_){var R=d.getBoundingClientRect();if(R.width===0&&R.height===0)return null;var j=r.createElement("div");return j.__piwiHint=!0,j.style.cssText="position:fixed;pointer-events:none;z-index:"+(f+1)+";box-sizing:border-box;border-radius:3px;transition:opacity .3s;border:2px solid "+_+";box-shadow:0 0 0 3px "+_+"55;left:"+R.left+"px;top:"+R.top+"px;width:"+R.width+"px;height:"+R.height+"px;",r.body.appendChild(j),V.push(j),j}function xe(d){var _=d.getBoundingClientRect();i.parent.postMessage({type:"piwiScrollTo",y:_.top},"*")}function Pe(d){if(J(),!(!d||!d.length)){for(var _=null,R=0;R<d.length;R++)for(var j=d[R],X=Q(j&&j.text),Y=0;Y<Math.min(X.length,3);Y++)ve(X[Y],"#f59e0b"),_||(_=X[Y]);_&&xe(_),setTimeout(function(){for(var W=0;W<V.length;W++)V[W].style.opacity="0"},2600),setTimeout(J,3e3)}}var ne=[],ke=0;function O(){i.parent.postMessage({type:"piwiSearchResult",count:ne.length,index:ne.length?ke:-1},"*")}function m(){J();var d=ne[ke];d&&(ve(d,"#7c3aed"),xe(d),O())}function K(d){if(ne=Q(d),ke=0,!ne.length){J(),O();return}m()}function be(){ne.length&&(ke=(ke+1)%ne.length,m())}function fe(d){var _=d.data;if(!(!_||typeof _.type!="string")){if(_.type==="piwiPickerKey"&&typeof _.key=="string")q(_.key);else if(_.type==="piwiHighlight")try{Pe(_.hints)}catch{}else if(_.type==="piwiSearch")try{K(_.q)}catch{}else if(_.type==="piwiSearchNext")try{be()}catch{}else if(_.type==="piwiClearHints")try{J()}catch{}}}function ue(d){U(d);var _=x();if(!(!_||B(d.target))){var R=D(_);a.style.display="none",J(),o.innerHTML='<div style="text-align:center;color:#9ca3af;">Analyzing element…</div>',Ce(),i.parent.postMessage({type:"elementPicked",attrs:R},"*")}}var _e=["mousedown","mouseup","pointerdown","pointerup","auxclick","dblclick"];function Ce(){r.removeEventListener("mousemove",y,!0),r.removeEventListener("click",ue,!0),r.removeEventListener("keydown",N,!0),i.removeEventListener("message",fe,!1);for(var d=0;d<_e.length;d++)r.removeEventListener(_e[d],U,!0)}function Te(){Ce(),J(),a.remove(),o.remove(),i.parent.postMessage({type:"pickerClosed"},"*")}r.addEventListener("mousemove",y,!0),r.addEventListener("click",ue,!0),r.addEventListener("keydown",N,!0),i.addEventListener("message",fe,!1);for(var se=0;se<_e.length;se++)r.addEventListener(_e[se],U,!0);function H(){var d=Math.max(r.documentElement?r.documentElement.scrollHeight:0,r.body?r.body.scrollHeight:0);d>0&&i.parent.postMessage({type:"piwiContentHeight",height:d},"*")}H();try{if(i.ResizeObserver){var ie=new i.ResizeObserver(H);r.documentElement&&ie.observe(r.documentElement),r.body&&ie.observe(r.body)}}catch{}}function vn(e){const r=[],i=new Set,f=a=>{if(typeof a!="string")return;const o=a.trim();if(o.length<2||o.length>80)return;const p=o.toLowerCase();i.has(p)||(i.add(p),r.push({text:o}))},s=a=>a&&(a.name??a.text??a.label??a.placeholder??a.alt??a.title);f(s(e.failingLocator?.args));for(const a of e.fromElementMatch??[])f(s(a.args));for(const a of e.fromAriaSnapshot??[])f(s(a.args));return r.slice(0,6)}function yn(e){return`<script>(${String(hn).replace(/<\/(script)/gi,"<\\/$1")})(${JSON.stringify(e)})<\/script>`}function xn(e){return e.replace(/<base\b[^>]*>/gi,"")}function bn(e,r){return xn(e)+yn(r)}const kn={key:0,class:"flex items-center justify-center py-20"},_n={key:1,class:"py-8 text-center"},$n={class:"text-xs text-gray-400 mt-1"},wn={key:2,class:"py-8 text-center"},Cn={class:"mb-2 flex items-center gap-2 flex-wrap"},Sn={key:1,class:"ml-auto inline-flex rounded-md border border-default overflow-hidden text-xs"},Tn={key:0,class:"flex items-center gap-1 mb-1.5 text-xs text-gray-500"},Ln={class:"tabular-nums w-11 text-center select-none"},zn={class:"ml-auto text-gray-400 tabular-nums"},An={key:1,class:"flex items-center gap-2 mb-1.5"},In={key:0,class:"text-xs text-gray-500 tabular-nums"},Rn={key:1,class:"text-xs text-gray-400"},Bn={key:0,class:"absolute inset-0 flex items-center justify-center bg-white dark:bg-gray-900 z-10"},Pn=["src"],On={key:2,class:"mt-4 space-y-3"},En={class:"flex items-center gap-3 bg-elevated rounded-lg p-3"},Un={class:"flex-1 min-w-0"},jn={class:"text-sm font-medium"},Mn={class:"text-xs"},Nn={key:0,class:"text-xs text-gray-400 ml-1"},Kn={key:0,class:"text-xs text-gray-500 mt-0.5 truncate"},Dn={class:"space-y-1",role:"radiogroup","aria-label":"Alternative locators"},Vn={class:"flex-1 min-w-0"},Hn={class:"text-xs font-medium text-primary"},Fn={class:"text-sm font-mono block truncate mt-0.5"},qn={class:"flex justify-between w-full"},Zn={key:1},Wn={class:"flex gap-2"},Jn=te({__name:"SnapshotLocatorPicker",props:Ze({runId:{},testRunsCaseId:{},failingLocator:{},healing:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:Ze(["close","confirmed"],["update:open"]),setup(e,{emit:r}){const i=e,f=r,s=st(e,"open"),a=E(!1),o=E(null),p=E(null),l=E(void 0);async function g(){a.value=!0,p.value=null;try{const w=l.value?`?source=${l.value}`:"";o.value=await $fetch(`/api/test-runs/${i.runId}/cases/${i.testRunsCaseId}/dom-snapshot${w}`),o.value?.source&&(l.value=o.value.source)}catch(w){p.value=w instanceof Error?w.message:"Unknown error"}finally{a.value=!1}}const T=S(()=>o.value?.availableSources??[]);function A(w){w===l.value||a.value||(l.value=w,x.value=!1,b.value="pick-element",ee.value=0,q.value=!1,I.value=null,M.value=[],se.value=null,K.value="",be.value=0,fe.value=-1,g())}Oe(s,w=>{w&&(o.value=null,x.value=!1,b.value="pick-element",ee.value=0,q.value=!1,l.value=void 0,I.value=null,M.value=[],se.value=null,K.value="",be.value=0,fe.value=-1,g())});const b=E("pick-element"),L=E(null),x=E(!1),I=E(null),M=E([]),D=E(void 0);function U(w){return URL.createObjectURL(new Blob([bn(w,{probedAttrs:un})],{type:"text/html"}))}Oe(()=>o.value?.html,w=>{D.value&&(URL.revokeObjectURL(D.value),D.value=void 0),w&&(D.value=U(w))},{immediate:!0});const B=E(null),ce=E(0),ee=E(0),y=E(1),q=E(!1),N=S(()=>o.value?.viewport??null),V=S(()=>{const w=N.value;return!w?.width||!ce.value?1:Math.min(ce.value/w.width,1)}),J=S(()=>{const w=N.value;if(!w)return{width:"100%",height:ee.value?`${ee.value}px`:"100%"};const v=ee.value||w.height;return{width:`${Math.round(w.width*y.value)}px`,height:`${Math.round(v*y.value)}px`}}),Z=S(()=>{const w=N.value;if(!w)return{width:"100%",height:ee.value?`${ee.value}px`:"100%",border:"0"};const v=ee.value||w.height;return{width:`${w.width}px`,height:`${v}px`,transform:`scale(${y.value})`,transformOrigin:"top left",border:"0"}}),Q=S(()=>Math.round(y.value*100)),ve=w=>Math.min(4,Math.max(.1,w));function xe(w){q.value=!0,y.value=ve(y.value*w)}function Pe(){q.value=!1,y.value=V.value}Oe([V,N],()=>{q.value||(y.value=V.value)});let ne=null;Oe(B,w=>{ne?.disconnect(),w&&(ce.value=w.clientWidth,ne=new ResizeObserver(v=>{for(const G of v)ce.value=G.contentRect.width}),ne.observe(w))}),Le(()=>{ne?.disconnect()}),Le(()=>{D.value&&URL.revokeObjectURL(D.value)});function ke(w){if(!L.value||w.source!==L.value.contentWindow)return;const v=w.data;if(v?.type==="pickerReady"){x.value=!0,m();return}if(v?.type==="piwiContentHeight"&&typeof v.height=="number"){ee.value=Math.max(v.height,N.value?.height??0);return}if(v?.type==="piwiScrollTo"&&typeof v.y=="number"){const G=B.value;G&&G.scrollTo({top:Math.max(0,v.y*y.value-80),behavior:"smooth"});return}if(v?.type==="piwiSearchResult"){be.value=typeof v.count=="number"?v.count:0,fe.value=typeof v.index=="number"?v.index:-1;return}if(v?.type==="elementPicked"&&v.attrs){const{labelText:G,...le}=v.attrs;I.value={...le,accessibleName:G??gn(le)},M.value=pn(I.value),se.value=null,b.value="review"}v?.type==="pickerClosed"&&j()}function O(w){L.value?.contentWindow?.postMessage(w,"*")}function m(){const w=vn({failingLocator:i.failingLocator,fromElementMatch:i.healing?.fromElementMatch??null,fromAriaSnapshot:i.healing?.fromAriaSnapshot??null});w.length&&O({type:"piwiHighlight",hints:w})}const K=E(""),be=E(0),fe=E(-1);let ue=null;Oe(K,w=>{ue&&clearTimeout(ue),ue=setTimeout(()=>O({type:"piwiSearch",q:w}),180)});function _e(){O({type:"piwiSearchNext"})}Le(()=>{ue&&clearTimeout(ue)});function Ce(w){if(!s.value||b.value!=="pick-element"||!x.value||w.key!=="ArrowUp"&&w.key!=="ArrowDown")return;const v=(document.activeElement?.tagName??"").toLowerCase();if(v==="input"||v==="textarea")return;const G=L.value?.contentWindow;G&&(w.preventDefault(),G.postMessage({type:"piwiPickerKey",key:w.key},"*"))}function Te(){L.value&&(L.value.src="about:blank")}at(()=>{window.addEventListener("message",ke),window.addEventListener("keydown",Ce,!0)}),Le(()=>{window.removeEventListener("message",ke),window.removeEventListener("keydown",Ce,!0)});const se=E(null),H=E(!1);function ie(w){se.value=w}const d=S(()=>dt(i.failingLocator.method,M.value)),_=We();async function R(){if(se.value){H.value=!0;try{(await $fetch(`/api/test-runs/${i.runId}/cases/${i.testRunsCaseId}/locator-pick`,{method:"POST",body:{failingLocator:i.failingLocator,pickedLocator:se.value,element:I.value}})).status==="ok"?f("confirmed",se.value):_.add({title:"Pick not saved",description:"This failure has no call-site or locator signature to attach the pick to.",color:"warning",icon:"i-lucide-alert-triangle"}),s.value=!1}catch(w){_.add({title:"Could not save the pick",description:it(w),color:"error",icon:"i-lucide-alert-triangle"})}finally{H.value=!1}}}function j(){Te(),s.value=!1}function X(){I.value=null,M.value=[],se.value=null,b.value="pick-element",x.value=!1,K.value="",be.value=0,fe.value=-1;const w=o.value?.html;w&&(D.value&&URL.revokeObjectURL(D.value),D.value=U(w))}const{copy:Y}=Ve(),W=E(null);let ae=null;function me(w,v){Y(w,{toast:"Locator copied"}),W.value=v,ae&&clearTimeout(ae),ae=setTimeout(()=>{W.value=null},2e3)}return Le(()=>{ae&&clearTimeout(ae)}),(w,v)=>{const G=ye,le=Ie,De=xt,we=Be,Qe=Pt;return n(),P(Qe,{open:s.value,"onUpdate:open":v[8]||(v[8]=de=>s.value=de),ui:{content:"max-w-6xl w-[95vw]"},onAfterLeave:j},{header:C(()=>[...v[9]||(v[9]=[u("div",null,[u("h3",{class:"text-lg font-medium"},"Pick a locator from the DOM snapshot"),u("p",{class:"text-sm text-gray-500 mt-0.5"}," Click the element the failing locator should target. Use ↑↓ to walk the DOM tree. ")],-1)])]),body:C(()=>[t(a)?(n(),c("div",kn,[k(G,{name:"i-lucide-loader",class:"size-6 animate-spin text-gray-400"}),v[10]||(v[10]=u("span",{class:"ml-2 text-sm text-gray-500"},"Loading DOM snapshot...",-1))])):t(p)?(n(),c("div",_n,[k(G,{name:"i-lucide-alert-triangle",class:"size-8 text-red-300 mx-auto mb-2"}),v[12]||(v[12]=u("p",{class:"text-sm text-red-500"},"Failed to load snapshot",-1)),u("p",$n,h(t(p)),1),k(le,{size:"xs",variant:"outline",color:"neutral",class:"mt-3",onClick:g},{default:C(()=>[...v[11]||(v[11]=[z("Retry",-1)])]),_:1})])):t(o)?.status!=="ok"||!t(o).html?(n(),c("div",wn,[k(G,{name:"i-lucide-file-x",class:"size-8 text-gray-300 mx-auto mb-2"}),v[13]||(v[13]=u("p",{class:"text-sm text-gray-500"},"No DOM snapshot or ARIA data available for this execution",-1)),v[14]||(v[14]=u("p",{class:"text-xs text-gray-400 mt-1"},"This test run has no stored trace or ARIA snapshot to pick from.",-1))])):(n(),c(F,{key:3},[u("div",Cn,[t(o).source?(n(),c("div",{key:0,class:re(["text-xs flex items-center gap-1",t(o).source==="aria"?"text-amber-600 dark:text-amber-400":"text-green-600 dark:text-green-400"])},[k(G,{name:t(o).source==="aria"?"i-lucide-accessibility":"i-lucide-check",class:"size-3.5 shrink-0"},null,8,["name"]),t(o).source==="aria"?(n(),c(F,{key:0},[z(" Accessibility tree from the failure-time ARIA snapshot — element styles are approximate ")],64)):(n(),c(F,{key:1},[z(" Rendered from the failure-time DOM snapshot ")],64))],2)):$("",!0),t(T).length>1?(n(),c("div",Sn,[u("button",{type:"button",class:re(["px-2 py-1 flex items-center gap-1 transition-colors",t(l)==="dom"?"bg-primary/10 text-primary font-medium":"text-gray-500 hover:bg-elevated"]),title:"Rendered page from the trace",onClick:v[0]||(v[0]=de=>A("dom"))},[k(G,{name:"i-lucide-layout-panel-top",class:"size-3.5"}),v[15]||(v[15]=z(" DOM ",-1))],2),u("button",{type:"button",class:re(["px-2 py-1 flex items-center gap-1 border-l border-default transition-colors",t(l)==="aria"?"bg-primary/10 text-primary font-medium":"text-gray-500 hover:bg-elevated"]),title:"Accessibility tree from the ARIA snapshot",onClick:v[1]||(v[1]=de=>A("aria"))},[k(G,{name:"i-lucide-accessibility",class:"size-3.5"}),v[16]||(v[16]=z(" Tree ",-1))],2)])):$("",!0)]),t(N)?(n(),c("div",Tn,[k(le,{size:"xs",variant:"ghost",color:"neutral",icon:"i-lucide-zoom-out",title:"Zoom out",onClick:v[2]||(v[2]=de=>xe(1/1.25))}),u("span",Ln,h(t(Q))+"%",1),k(le,{size:"xs",variant:"ghost",color:"neutral",icon:"i-lucide-zoom-in",title:"Zoom in",onClick:v[3]||(v[3]=de=>xe(1.25))}),k(le,{size:"xs",variant:"outline",color:"neutral",class:"ml-1",onClick:Pe},{default:C(()=>[...v[17]||(v[17]=[z("Fit",-1)])]),_:1}),u("span",zn,h(t(N).width)+"×"+h(t(N).height),1)])):$("",!0),t(b)==="pick-element"?(n(),c("div",An,[k(De,{modelValue:t(K),"onUpdate:modelValue":v[4]||(v[4]=de=>ze(K)?K.value=de:null),size:"xs",icon:"i-lucide-search",placeholder:"Find an element by its text…",class:"max-w-xs",onKeydown:ge(he(_e,["prevent"]),["enter"])},null,8,["modelValue","onKeydown"]),t(K)&&t(be)>0?(n(),c("span",In,h(t(fe)+1)+"/"+h(t(be)),1)):t(K)?(n(),c("span",Rn,"no matches")):$("",!0),t(be)>1?(n(),P(le,{key:2,size:"xs",variant:"ghost",color:"neutral",icon:"i-lucide-chevron-down",title:"Next match (Enter)",onClick:_e})):$("",!0)])):$("",!0),u("div",{ref_key:"stageRef",ref:B,class:re(["relative border border-default rounded-lg overflow-auto",[t(b)==="pick-element"?"h-[75vh]":"h-80",t(N)?"bg-gray-100 dark:bg-gray-800":""]])},[t(x)?$("",!0):(n(),c("div",Bn,[k(G,{name:"i-lucide-loader",class:"size-5 animate-spin text-gray-400"}),v[18]||(v[18]=u("span",{class:"ml-2 text-sm text-gray-500"},"Initializing picker...",-1))])),u("div",{style:Xe(t(J))},[u("iframe",{ref_key:"iframeRef",ref:L,src:t(D),style:Xe(t(Z)),class:"bg-white",sandbox:"allow-scripts",title:"DOM snapshot"},null,12,Pn)],4)],2),t(b)==="review"&&t(I)?(n(),c("div",On,[u("div",En,[k(G,{name:"i-lucide-crosshair",class:"size-5 text-primary shrink-0"}),u("div",Un,[u("p",jn,[v[19]||(v[19]=z(" Picked: ",-1)),u("code",Mn,h(t(I).tagName),1),t(I).attributes.id?(n(),c("code",Nn,"#"+h(t(I).attributes.id),1)):$("",!0),t(I).attributes["data-testid"]?(n(),P(we,{key:1,size:"xs",color:"primary",variant:"subtle",class:"ml-1"},{default:C(()=>[z(h(t(I).attributes["data-testid"]),1)]),_:1})):$("",!0)]),t(I).textContent?(n(),c("p",Kn,' "'+h(t(I).textContent)+'" ',1)):$("",!0)]),k(le,{size:"xs",variant:"ghost",color:"neutral",icon:"i-lucide-rotate-ccw",title:"Pick a different element",onClick:X})]),u("div",Dn,[(n(!0),c(F,null,oe(t(M),(de,He)=>(n(),P(ut,{key:He,alt:de,copied:t(W)===`picked-${He}`,dense:!0,selectable:!0,selected:t(se)?.locator===de.locator,onCopy:pt=>me(de.locator,`picked-${He}`),onSelect:pt=>ie(de)},null,8,["alt","copied","selected","onCopy","onSelect"]))),128))]),t(d).recommended?(n(),c("div",{key:0,class:"rounded-lg border border-primary/40 bg-primary/5 p-3 flex items-center gap-3 cursor-pointer",role:"button",tabindex:"0",title:"Select this locator for Confirm",onClick:v[6]||(v[6]=de=>ie(t(d).recommended)),onKeydown:v[7]||(v[7]=ge(he(de=>ie(t(d).recommended),["prevent"]),["enter"]))},[k(G,{name:"i-lucide-star",class:"size-5 text-primary shrink-0"}),u("div",Vn,[u("p",Hn," Recommended (score: "+h(t(d).recommended.score)+") ",1),u("code",Fn,h(t(d).recommended.locator),1)]),k(le,{size:"sm",color:"primary",variant:"solid","trailing-icon":t(W)==="rec"?"i-lucide-check":"i-lucide-copy",onClick:v[5]||(v[5]=he(de=>me(t(d).recommended.locator,"rec"),["stop"]))},{default:C(()=>[...v[20]||(v[20]=[z(" Copy ",-1)])]),_:1},8,["trailing-icon"])],32)):$("",!0)])):$("",!0)],64))]),footer:C(()=>[u("div",qn,[t(b)==="review"?(n(),P(le,{key:0,size:"sm",variant:"outline",color:"neutral",icon:"i-lucide-rotate-ccw",onClick:X},{default:C(()=>[...v[21]||(v[21]=[z(" Pick a different element ",-1)])]),_:1})):(n(),c("div",Zn)),u("div",Wn,[k(le,{size:"sm",variant:"outline",color:"neutral",onClick:j},{default:C(()=>[...v[22]||(v[22]=[z("Cancel",-1)])]),_:1}),t(b)==="review"?(n(),P(le,{key:0,size:"sm",color:"primary",loading:t(H),disabled:!t(se),onClick:R},{default:C(()=>[...v[23]||(v[23]=[z(" Confirm pick ",-1)])]),_:1},8,["loading","disabled"])):$("",!0)])])]),_:1},8,["open"])}}}),Gn=Object.assign(Jn,{__name:"SnapshotLocatorPicker"});function Yn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Qn(e,r){let i=0,f=null;for(let s=r;s<e.length;s++){const a=e[s];if(f){if(a==="\\"){s++;continue}a===f&&(f=null);continue}if(a==="'"||a==='"'||a==="`"){f=a;continue}if(a==="(")i++;else if(a===")"&&(i--,i===0))return s}return-1}function Xn(e,r,i){if(!e||!r||!i)return null;const f=new RegExp(`${Yn(r)}\\s*\\(`,"g");let s;for(;(s=f.exec(e))!==null;){const a=s.index,o=a>0?e[a-1]:"";if(o&&/[A-Za-z0-9_$]/.test(o))continue;const p=a+s[0].lastIndexOf("("),l=Qn(e,p);if(l===-1)return null;const g=e.slice(0,a)+i+e.slice(l+1);return g===e?null:{old:e,new:g}}return null}function eo(e,r){return`${r?`@@ ${r} @@
|
|
2
|
-
`:""}-${e.old.trimEnd()}
|
|
3
|
-
+${e.new.trimEnd()}`}function to(e,r){const i=e??{},f=r??{},s=o=>o==null?null:typeof o=="string"?o:JSON.stringify(o),a=[];for(const o of new Set([...Object.keys(i),...Object.keys(f)])){const p=s(i[o]),l=s(f[o]);p!==l&&a.push({key:o,from:p,to:l})}return a}function no(e){const i=[`In ${e.location??(e.sourceLine?`line ${e.sourceLine.line}`:"the failing test")}, the Playwright locator \`${e.failing}\` no longer matches its element.`,`Replace it with \`${e.recommended}\`.`];return e.sourceLine&&i.push("","Current line:",e.sourceLine.text.trim()),i.join(`
|
|
4
|
-
`)}const oo={key:0,class:"text-xs font-mono"},so={key:1},ao={class:"flex items-center gap-1"},ro={key:1,class:"rounded-lg border border-primary/50 bg-primary/10 p-3 mb-3 flex items-center gap-3"},io={class:"flex-1 min-w-0"},lo={class:"text-xs font-medium text-primary flex items-center gap-1.5"},co={class:"text-sm font-mono block truncate mt-0.5"},uo={key:2,class:"flex items-center gap-2 bg-elevated rounded p-2 mb-3 border border-red-200 dark:border-red-800"},fo={class:"text-xs font-mono text-red-600 dark:text-red-400 flex-1 truncate"},mo={key:4,class:"rounded-lg border border-primary/40 bg-primary/5 p-3 mb-3 space-y-2"},po={class:"flex items-center gap-2 min-w-0"},go={key:0,class:"text-[11px] text-gray-500 truncate min-w-0"},ho={key:0,class:"rounded border border-default overflow-hidden bg-default"},vo={class:"text-sm font-mono block truncate"},yo={key:0,class:"text-xs flex flex-wrap items-center gap-x-1.5 gap-y-0.5"},xo={class:"font-mono text-gray-500"},bo={key:0,class:"font-mono text-red-500 line-through"},ko={key:1,class:"text-gray-400"},_o={key:2,class:"font-mono text-green-600 dark:text-green-400"},$o={key:3,class:"text-gray-400"},wo={key:2,class:"text-xs text-gray-500"},Co={key:3,class:"text-xs text-primary/90 flex items-center gap-1"},So={class:"flex items-center gap-2"},To={key:5,class:"rounded-lg border border-default bg-elevated p-3 mb-3 flex items-center gap-3"},Lo={class:"flex-1 min-w-0"},zo={class:"text-xs font-medium text-success-600 dark:text-success-400"},Ao={class:"text-sm font-mono block truncate mt-0.5"},Io={class:"space-y-2"},Ro={key:6,class:"mt-3"},Bo={class:"space-y-2"},Po={class:"flex items-center gap-1"},ot=3,Oo=te({__name:"LocatorHealingPanel",props:{runId:{},testRunsCaseId:{},storageKey:{},affectedCount:{}},setup(e){const r=e,i=S(()=>r.storageKey?Ke:Ne),f=S(()=>r.storageKey?{storageKey:r.storageKey}:{}),{data:s,pending:a,error:o}=Me(()=>`/api/test-runs/${r.runId}/cases/${r.testRunsCaseId}/locator-healing`,{lazy:!0},"$z1C7vU2CXe"),p=S(()=>!!s.value&&s.value.source!=="none"&&!!(s.value.fromElementMatch?.length||s.value.fromPriorSuccess?.length||s.value.fromAriaSnapshot?.length)),l=S(()=>s.value?s.value.fromElementMatch??s.value.fromPriorSuccess??s.value.fromAriaSnapshot??[]:[]),g=S(()=>l.value.find(O=>O.pickedByUser)??null),T=S(()=>s.value?.recommendation?s.value.recommendation:s.value?.priorNameMayBeStale||!l.value.length?null:dt(s.value?.failingLocator?.method,l.value)),A=S(()=>s.value?.priorNameMayBeStale&&s.value.fromPriorSuccess?.length?s.value.fromAriaSnapshot??[]:[]),b=S(()=>{const O=T.value;return O?.recommended?O.recommended.pickedByUser?"Confirmed with the locator picker on the failing page":O.preservesConvention?"Keeps your original locator style — minimal, idiomatic edit":O.suggestAddTestId?"Most stable available, but still fragile":"Most stable available — a sturdier style than the original":""}),L=S(()=>{const O=s.value?.priorNameMayBeStale,m=(()=>{switch(s.value?.source){case"prior-run":return O?"Pre-captured from the last passing run — the element looks changed since":"Pre-captured from the last passing run — highest confidence";case"element-match":return"The element looks renamed or moved — these are fresh locators for its current identity on the failing page";case"fingerprint":return"Matched by locator signature (line numbers shifted)";case"cross-test":return"Captured by another test in this project that uses the same locator";case"aria-snapshot":return"Generated from the failure-time ARIA snapshot — limited, no HTML attributes";default:return""}})(),K=s.value?.capturedAt;return K?`${m} · captured ${Je(K)}`:m}),x=S(()=>{if(s.value?.priorNameMayBeStale)return"text-warning-600 dark:text-warning-400";switch(s.value?.source){case"prior-run":case"fingerprint":case"cross-test":return"text-success-600 dark:text-success-400";case"element-match":return"text-primary-600 dark:text-primary-400";default:return"text-warning-600 dark:text-warning-400"}}),I=S(()=>{const O=s.value?.failingLocator;return O?`${O.method}(${JSON.stringify(O.args)})`:""}),M=Re(),{data:D}=Me(()=>`/api/test-run-cases/${r.testRunsCaseId}/traces`,{lazy:!0},"$vsBboELop9"),U=S(()=>{const O=D.value?.[0];if(!O)return null;const m=!!M.public.demoMode&&O.filePath.startsWith("demo/");return lt(O.filePath,M.app?.baseURL,m)}),B=E(!1);async function ce(){await kt(`/api/test-runs/${r.runId}/cases/${r.testRunsCaseId}/locator-healing`)}const{copy:ee}=Ve(),y=E(null);let q=null;function N(O,m,K){ee(O,{toast:K}),y.value=m,q&&clearTimeout(q),q=setTimeout(()=>{y.value=null},2e3)}function V(O,m){N(O,m,"Locator copied")}Le(()=>{q&&clearTimeout(q)});const J=S(()=>T.value?.recommended??null),Z=S(()=>r.affectedCount&&r.affectedCount>1&&J.value?`Same break affects ${r.affectedCount} tests in this cluster — one fix`:""),Q=S(()=>{if(J.value?.pickedByUser)return"your confirmed pick";switch(s.value?.source){case"prior-run":return"from the last passing run";case"fingerprint":return"from a prior run (line shifted)";case"cross-test":return"from another test in this project";case"element-match":return"from the current failing page";case"aria-snapshot":return"from the ARIA snapshot";default:return""}}),ve=S(()=>{const O=s.value?.sourceLine,m=J.value;if(!O||!m)return null;const K=Xn(O.text,s.value?.failingLocator?.method,m.locator);return K?{edit:K,patch:eo(K,s.value?.location??null)}:null}),xe=S(()=>{if(ve.value)return[];const O=s.value?.failingLocator,m=J.value;return!O||!m||m.method!==O.method?[]:to(O.args,m.args)});function Pe(){const O=J.value;!O||!s.value||N(no({location:s.value.location??null,sourceLine:s.value.sourceLine??null,failing:I.value,recommended:O.locator}),"fix-prompt","Fix prompt copied")}const ne=E(!1),ke=S(()=>ne.value?l.value:l.value.slice(0,ot));return(O,m)=>{const K=Ie,be=bt,fe=Ge,ue=ye,_e=Be,Ce=tn,Te=ut,se=Lt;return n(),c(F,null,[!t(a)&&!t(o)&&t(p)?(n(),P(Se(t(i)),je({key:0},t(f),{icon:"i-lucide-bandage",title:"Alternative locators",count:t(l).length,help:"locator-healing"}),Ae({subtitle:C(()=>[u("span",{class:re(t(x))},h(t(L)),3)]),default:C(()=>[t(s)?.healedInRunId?(n(),P(fe,{key:0,class:"mb-3",color:"success",icon:"i-lucide-circle-check",variant:"subtle",title:"Locator healed"},{description:C(()=>[m[11]||(m[11]=z(" The recommended locator now passes at this call site — ",-1)),k(be,{to:`/test-runs/${t(s).healedInRunId}`,class:"underline font-medium"},{default:C(()=>[z(" see run #"+h(t(s).healedInRunId),1)]),_:1},8,["to"]),m[12]||(m[12]=z(". ",-1))]),_:1})):$("",!0),t(g)?(n(),c("div",ro,[k(ue,{name:"i-lucide-user-check",class:"size-5 text-primary shrink-0"}),u("div",io,[u("p",lo,[m[14]||(m[14]=z(" Your pick ",-1)),k(_e,{size:"sm",color:"primary",variant:"subtle"},{default:C(()=>[...m[13]||(m[13]=[z("confirmed on the failing page",-1)])]),_:1})]),u("code",co,h(t(g).locator),1)]),k(K,{size:"sm",color:"primary",variant:"solid","trailing-icon":t(y)==="user-pick"?"i-lucide-check":"i-lucide-copy",onClick:m[1]||(m[1]=H=>V(t(g).locator,"user-pick"))},{default:C(()=>[...m[15]||(m[15]=[z(" Copy ",-1)])]),_:1},8,["trailing-icon"])])):$("",!0),t(s)?.failingLocator?(n(),c("div",uo,[k(ue,{name:"i-lucide-x-circle",class:"size-4 text-red-500 shrink-0"}),u("code",fo,h(t(I)),1),k(K,{size:"xs",variant:"ghost",color:"neutral",icon:t(y)==="failing"?"i-lucide-check":"i-lucide-copy",title:t(y)==="failing"?"Copied!":"Copy",onClick:m[2]||(m[2]=H=>V(t(I),"failing"))},null,8,["icon","title"])])):$("",!0),t(s)?.priorNameMayBeStale?(n(),P(fe,{key:3,class:"mb-3",color:"warning",icon:"i-lucide-alert-triangle",variant:"subtle",title:"The element's name looks changed",description:"The captured accessible name no longer appears on the failing page, so name-based alternatives (and the failing locator itself) probably no longer match. Prefer the structural options, or the failing-page candidates below."})):$("",!0),t(J)?(n(),c("div",mo,[u("div",po,[k(ue,{name:"i-lucide-star",class:"size-4 text-primary shrink-0"}),m[16]||(m[16]=u("p",{class:"text-xs font-medium text-primary shrink-0"},"Recommended fix",-1)),t(Q)?(n(),c("span",go," · "+h(t(Q)),1)):$("",!0),m[17]||(m[17]=u("span",{class:"flex-1"},null,-1)),k(_e,{size:"xs",color:"primary",variant:"subtle",class:"font-mono tabular-nums shrink-0"},{default:C(()=>[z(h(t(J).score),1)]),_:1})]),t(ve)?(n(),c("div",ho,[k(Ce,{patch:t(ve).patch},null,8,["patch"])])):(n(),c(F,{key:1},[u("code",vo,h(t(J).locator),1),t(xe).length?(n(),c("p",yo,[(n(!0),c(F,null,oe(t(xe),(H,ie)=>(n(),c(F,{key:ie},[u("span",xo,h(H.key)+":",1),H.from?(n(),c("span",bo,h(H.from),1)):(n(),c("span",ko,"—")),k(ue,{name:"i-lucide-arrow-right",class:"size-3 text-gray-400"}),H.to?(n(),c("span",_o,h(H.to),1)):(n(),c("span",$o,"removed"))],64))),128))])):$("",!0)],64)),t(b)?(n(),c("p",wo,h(t(b)),1)):$("",!0),t(Z)?(n(),c("p",Co,[k(ue,{name:"i-lucide-layers",class:"size-3 shrink-0"}),z(h(t(Z)),1)])):$("",!0),u("div",So,[k(K,{size:"xs",color:"primary",variant:"solid","trailing-icon":t(y)==="top"?"i-lucide-check":"i-lucide-copy",onClick:m[3]||(m[3]=H=>V(t(J).locator,"top"))},{default:C(()=>[...m[18]||(m[18]=[z(" Copy locator ",-1)])]),_:1},8,["trailing-icon"]),k(K,{size:"xs",color:"neutral",variant:"outline",icon:t(y)==="fix-prompt"?"i-lucide-check":"i-lucide-sparkles",title:"Copy an instruction an AI coding agent can apply directly to the test",onClick:Pe},{default:C(()=>[...m[19]||(m[19]=[z(" Copy fix prompt ",-1)])]),_:1},8,["icon"])])])):$("",!0),t(T)?.hasDurableAlternative&&t(T).durable?(n(),c("div",To,[k(ue,{name:"i-lucide-shield-check",class:"size-5 text-success shrink-0"}),u("div",Lo,[u("p",zo," Most stable option (score: "+h(t(T).durable.score)+") ",1),u("code",Ao,h(t(T).durable.locator),1),m[20]||(m[20]=u("p",{class:"text-xs text-gray-500 mt-0.5"},"Sturdier, but changes the locator style",-1))]),k(K,{size:"sm",color:"neutral",variant:"outline","trailing-icon":t(y)==="durable"?"i-lucide-check":"i-lucide-copy",onClick:m[4]||(m[4]=H=>V(t(T).durable.locator,"durable"))},{default:C(()=>[...m[21]||(m[21]=[z(" Copy ",-1)])]),_:1},8,["trailing-icon"])])):$("",!0),u("div",Io,[m[22]||(m[22]=u("p",{class:"text-xs font-medium text-gray-500"},"All alternatives",-1)),(n(!0),c(F,null,oe(t(ke),(H,ie)=>(n(),P(Te,{key:ie,alt:H,copied:t(y)===`alt-${ie}`,onCopy:d=>V(H.locator,`alt-${ie}`)},null,8,["alt","copied","onCopy"]))),128)),t(l).length>ot?(n(),P(K,{key:0,size:"xs",variant:"ghost",color:"neutral",block:"",icon:t(ne)?"i-lucide-chevron-up":"i-lucide-chevron-down",onClick:m[5]||(m[5]=H=>ne.value=!t(ne))},{default:C(()=>[z(h(t(ne)?"Show fewer":`Show all ${t(l).length} alternatives`),1)]),_:1},8,["icon"])):$("",!0)]),t(A).length?(n(),c("div",Ro,[m[23]||(m[23]=u("p",{class:"text-xs font-medium text-gray-500 mb-2"},"From the failing page",-1)),u("div",Bo,[(n(!0),c(F,null,oe(t(A),(H,ie)=>(n(),P(Te,{key:ie,alt:H,note:"candidate from the failure-time ARIA snapshot",copied:t(y)===`supp-${ie}`,onCopy:d=>V(H.locator,`supp-${ie}`)},null,8,["alt","copied","onCopy"]))),128))])])):$("",!0),t(T)?.suggestAddTestId?(n(),P(fe,{key:7,class:"mt-3",color:"warning",icon:"i-lucide-info",variant:"subtle",title:"All alternatives are fragile",description:"Every captured locator scores below 50. Add a stable data-testid attribute to this element in the app for a durable fix."})):$("",!0),t(s)?.source==="aria-snapshot"?(n(),P(fe,{key:8,class:"mt-3",color:"info",icon:"i-lucide-info",variant:"subtle"},{description:C(()=>[m[25]||(m[25]=z(" No HTML attributes were available. ",-1)),k(se,{to:"capture-fixtures","no-icon":"",class:"text-primary hover:underline"},{default:C(()=>[...m[24]||(m[24]=[z("Enable Piwi fixture capture",-1)])]),_:1}),m[26]||(m[26]=z(" for full alternatives including data-testid and CSS selectors. ",-1))]),_:1})):$("",!0)]),_:2},[e.storageKey?{name:"folded",fn:C(()=>[t(T)?.recommended?(n(),c("code",oo,h(t(T).recommended.locator),1)):(n(),c("span",so,h(t(l).length)+" alternative"+h(t(l).length===1?"":"s"),1))]),key:"0"}:void 0,t(U)||t(s)?.failingLocator?{name:"actions",fn:C(()=>[u("div",ao,[t(s)?.failingLocator?(n(),P(K,{key:0,size:"xs",color:"neutral",variant:"outline",icon:"i-lucide-mouse-pointer",title:"Open the failure-time DOM snapshot and click the element to pick a locator",onClick:m[0]||(m[0]=H=>B.value=!0)},{default:C(()=>[...m[9]||(m[9]=[z(" Pick from snapshot ",-1)])]),_:1})):$("",!0),t(U)?(n(),P(K,{key:1,to:t(U),target:"_blank",size:"xs",color:"neutral",variant:"outline",icon:"i-lucide-crosshair",title:"Open the failure trace in the trace viewer — its Pick locator tool works on the recorded page snapshots"},{default:C(()=>[...m[10]||(m[10]=[z(" Pick from trace ",-1)])]),_:1},8,["to"])):$("",!0)])]),key:"1"}:void 0]),1040,["count"])):!t(a)&&!t(o)&&!t(p)?(n(),P(Se(t(i)),je({key:1},t(f),{icon:"i-lucide-bandage",title:"Alternative locators",subtitle:"No alternatives available",help:"locator-healing"}),Ae({default:C(()=>[k(fe,{color:"neutral",icon:"i-lucide-info",variant:"subtle"},{description:C(()=>[m[31]||(m[31]=z(" No pre-captured alternatives — this locator has never passed in a previous run. ",-1)),k(se,{to:"capture-fixtures","no-icon":"",class:"text-primary hover:underline"},{default:C(()=>[...m[30]||(m[30]=[z("Enable Piwi dashboard fixtures",-1)])]),_:1}),m[32]||(m[32]=z(" to capture element attributes at test time, or use “Pick from snapshot” above to choose a locator by hand on the failure-time page. ",-1))]),_:1})]),_:2},[e.storageKey?{name:"folded",fn:C(()=>[m[27]||(m[27]=u("span",null,"No alternatives available",-1))]),key:"0"}:void 0,t(U)||t(s)?.failingLocator?{name:"actions",fn:C(()=>[u("div",Po,[t(s)?.failingLocator?(n(),P(K,{key:0,size:"xs",color:"neutral",variant:"outline",icon:"i-lucide-mouse-pointer",title:"Open the failure-time DOM snapshot and click the element to pick a locator",onClick:m[6]||(m[6]=H=>B.value=!0)},{default:C(()=>[...m[28]||(m[28]=[z(" Pick from snapshot ",-1)])]),_:1})):$("",!0),t(U)?(n(),P(K,{key:1,to:t(U),target:"_blank",size:"xs",color:"neutral",variant:"outline",icon:"i-lucide-crosshair",title:"Open the failure trace in the trace viewer — its Pick locator tool works on the recorded page snapshots"},{default:C(()=>[...m[29]||(m[29]=[z(" Pick from trace ",-1)])]),_:1},8,["to"])):$("",!0)])]),key:"1"}:void 0]),1040)):$("",!0),t(s)?.failingLocator?(n(),P(Gn,{key:2,open:t(B),"onUpdate:open":m[7]||(m[7]=H=>ze(B)?B.value=H:null),"run-id":e.runId,"test-runs-case-id":e.testRunsCaseId,"failing-locator":t(s).failingLocator,healing:t(s),onConfirmed:ce,onClose:m[8]||(m[8]=H=>B.value=!1)},null,8,["open","run-id","test-runs-case-id","failing-locator","healing"])):$("",!0)],64)}}}),Pa=Object.assign(Oo,{__name:"LocatorHealingPanel"}),Eo={key:1,class:"space-y-2"},Uo={class:"text-xs font-medium text-gray-500 dark:text-gray-400 sm:w-40 shrink-0"},jo={class:"flex flex-wrap items-center gap-1.5 min-w-0 text-xs font-mono"},Mo={class:"rounded bg-red-50 px-1.5 py-0.5 text-red-700 dark:bg-red-950/30 dark:text-red-400 break-all"},No={class:"rounded bg-green-50 px-1.5 py-0.5 text-green-700 dark:bg-green-950/30 dark:text-green-400 break-all"},Ko={key:0,class:"text-xs text-gray-400 dark:text-gray-500"},Do={key:0},Vo=te({__name:"EnvironmentDiffCard",props:{runId:{},testRunsCaseId:{},storageKey:{}},setup(e,{expose:r}){const i=e,f=S(()=>i.storageKey?Ke:Ne),s=S(()=>i.storageKey?{storageKey:i.storageKey}:{}),{data:a,pending:o,error:p}=Me(()=>`/api/test-runs/${i.runId}/cases/${i.testRunsCaseId}/environment-diff`,{lazy:!0},"$yASgALxNz3"),l=S(()=>a.value?.entries??[]),g=S(()=>l.value.filter(x=>!x.informational)),T=S(()=>l.value.filter(x=>x.informational)),A=S(()=>{const x=a.value?.baseline;if(!x)return"";const I=x.startTime?` · ${Je(new Date(x.startTime))}`:"";return`vs last pass in run #${x.runId}${I}`}),b=S(()=>{if(a.value?.status!=="ok")return"No passing baseline to compare against";const x=g.value.length;return x===0?"Identical to last pass — no environment drift":`${x} change${x===1?"":"s"}: ${g.value.map(I=>I.label).join(", ")}`}),L=E(null);return r({reveal:()=>L.value?.reveal?.()}),(x,I)=>{const M=Ge,D=ye;return!t(o)&&!t(p)&&t(a)?.status==="ok"?(n(),P(Se(t(f)),je({key:0,ref_key:"card",ref:L},t(s),{icon:"i-lucide-git-compare-arrows",title:"Environment diff",count:t(g).length||void 0,help:"environment-diff",subtitle:t(A)}),Ae({default:C(()=>[t(l).length===0?(n(),P(M,{key:0,color:"success",icon:"i-lucide-check-circle",variant:"subtle",description:"The environment is identical to the last passing run — environment drift is unlikely to explain this failure."})):(n(),c("div",Eo,[(n(!0),c(F,null,oe(t(g),U=>(n(),c("div",{key:U.key,class:"rounded-lg border border-default p-3 flex flex-col gap-1 sm:flex-row sm:items-center sm:gap-3"},[u("span",Uo,h(U.label),1),u("div",jo,[u("code",Mo,h(U.failing??"(unset)"),1),k(D,{name:"i-lucide-arrow-left",class:"size-3 shrink-0 text-gray-400"}),u("code",No,h(U.baseline??"(unset)"),1)])]))),128)),t(T).length>0?(n(),c("p",Ko,[I[0]||(I[0]=z(" Also changed (varies naturally between runs): ",-1)),(n(!0),c(F,null,oe(t(T),(U,B)=>(n(),c("span",{key:U.key},[z(h(U.label.toLowerCase())+" "+h(U.baseline??"—")+" → "+h(U.failing??"—"),1),B<t(T).length-1?(n(),c("span",Do,", ")):$("",!0)]))),128))])):$("",!0)]))]),_:2},[e.storageKey?{name:"folded",fn:C(()=>[u("span",null,h(t(b)),1)]),key:"0"}:void 0]),1040,["count","subtitle"])):$("",!0)}}}),Oa=Object.assign(Vo,{__name:"EnvironmentDiffCard"}),Ho={class:"absolute top-4 left-4 text-white/70 text-sm font-medium"},Fo=["src","alt"],qo=te({__name:"ScreenshotLightbox",props:{images:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:r}){const i=e,f=r,s=S(()=>i.modelValue!==null);function a(){f("update:modelValue",null)}function o(){i.modelValue!==null&&i.modelValue>0&&f("update:modelValue",i.modelValue-1)}function p(){i.modelValue!==null&&i.modelValue<i.images.length-1&&f("update:modelValue",i.modelValue+1)}const l=S(()=>i.modelValue===null?null:i.images[i.modelValue]??null);function g(T){s.value&&(T.key==="Escape"&&a(),T.key==="ArrowLeft"&&o(),T.key==="ArrowRight"&&p())}return at(()=>window.addEventListener("keydown",g)),_t(()=>window.removeEventListener("keydown",g)),(T,A)=>{const b=ye;return n(),P($t,{to:"body"},[k(wt,{name:"lightbox"},{default:C(()=>[s.value?(n(),c("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/90",onClick:he(a,["self"])},[u("button",{class:"absolute top-4 right-4 size-10 flex items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/20 transition-colors",onClick:a},[k(b,{name:"i-lucide-x",class:"size-6"})]),u("div",Ho,h((e.modelValue??0)+1)+" / "+h(e.images.length),1),e.images.length>1&&(e.modelValue??0)>0?(n(),c("button",{key:0,class:"absolute left-4 size-10 flex items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/20 transition-colors",onClick:o},[k(b,{name:"i-lucide-chevron-left",class:"size-6"})])):$("",!0),l.value?(n(),c("img",{key:1,src:l.value.src,alt:l.value.name,class:"max-h-[90vh] max-w-[90vw] object-contain rounded-lg",onClick:A[0]||(A[0]=he(()=>{},["stop"]))},null,8,Fo)):$("",!0),e.images.length>1&&(e.modelValue??0)<e.images.length-1?(n(),c("button",{key:2,class:"absolute right-4 size-10 flex items-center justify-center rounded-full bg-white/10 text-white hover:bg-white/20 transition-colors",onClick:p},[k(b,{name:"i-lucide-chevron-right",class:"size-6"})])):$("",!0)])):$("",!0)]),_:1})])}}}),mt=Object.assign(Ct(qo,[["__scopeId","data-v-c02b1e9b"]]),{__name:"ScreenshotLightbox"}),Zo={class:"flex justify-end mb-2"},Wo={key:1,class:"rounded overflow-hidden border border-default bg-gray-50 dark:bg-gray-900"},Jo=["src"],Go={key:2,class:"grid grid-cols-1 sm:grid-cols-2 gap-2"},Yo={class:"rounded overflow-hidden border border-red-200 dark:border-red-900 bg-gray-50 dark:bg-gray-900"},Qo=["src"],Xo={class:"rounded overflow-hidden border border-green-200 dark:border-green-900 bg-gray-50 dark:bg-gray-900"},es={class:"px-2 py-1 text-[10px] font-medium text-green-600 dark:text-green-400"},ts=["src"],ns=te({__name:"VisualDiffCard",props:{runId:{},testRunsCaseId:{},storageKey:{}},setup(e,{expose:r}){const i=e,f=S(()=>i.storageKey?Ke:Ne),s=S(()=>i.storageKey?{storageKey:i.storageKey}:{}),a=Re(),{data:o,pending:p,error:l}=Me(()=>`/api/test-runs/${i.runId}/cases/${i.testRunsCaseId}/visual-diff`,{lazy:!0},"$nTbSHl3faK"),g=S(()=>o.value?.status==="ok"?o.value.diff??null:null),T=E("overlay"),A=[{label:"Overlay",value:"overlay"},{label:"Side by side",value:"side-by-side"}],b=S(()=>g.value?Ue(g.value.path,"image/png",a.app?.baseURL):""),L=S(()=>g.value?Ue(g.value.failingPath,null,a.app?.baseURL):""),x=S(()=>g.value?Ue(g.value.baselinePath,null,a.app?.baseURL):""),I=S(()=>g.value?(g.value.changedPixelRatio*100).toFixed(2):"0"),M=S(()=>{const ee=g.value?.changedPixelRatio??0;return ee>.1?"error":ee>.01?"warning":"success"}),D=S(()=>g.value?g.value.dimensionMismatch?`${I.value}% changed — dimensions differ, unreliable`:`${I.value}% of pixels changed vs last pass`:"No comparable screenshots"),U=S(()=>g.value?[{src:L.value,name:"Failing screenshot"},{src:x.value,name:"Last passing screenshot"},{src:b.value,name:"Diff overlay"}]:[]),B=E(null),ce=E(null);return r({reveal:()=>ce.value?.reveal?.()}),(ee,y)=>{const q=Be,N=Ge,V=Ot,J=mt;return!t(p)&&!t(l)&&t(g)?(n(),P(Se(t(f)),je({key:0,ref_key:"card",ref:ce},t(s),{icon:"i-lucide-images",title:"Visual diff",help:"visual-diff"}),Ae({subtitle:C(()=>[u("span",null,"vs last pass in run #"+h(t(g).baselineRunId),1)]),actions:C(()=>[k(q,{color:t(M),variant:"subtle",size:"sm",class:"font-mono tabular-nums"},{default:C(()=>[z(h(t(I))+"% changed ",1)]),_:1},8,["color"])]),default:C(()=>[t(g).dimensionMismatch?(n(),P(N,{key:0,class:"mb-3",color:"warning",icon:"i-lucide-alert-triangle",variant:"subtle",title:"Screenshot dimensions differ",description:"The failing and passing screenshots have different sizes (viewport change?). They are compared on a padded canvas, so the changed-pixel ratio is inflated and unreliable."})):$("",!0),u("div",Zo,[k(V,{modelValue:t(T),"onUpdate:modelValue":y[0]||(y[0]=Z=>ze(T)?T.value=Z:null),items:A,size:"xs",content:!1,ui:{list:"overflow-x-auto",trigger:"shrink-0"}},null,8,["modelValue"])]),t(T)==="overlay"?(n(),c("div",Wo,[u("img",{src:t(b),alt:"Diff overlay (red = changed pixels)",class:"w-full max-h-96 object-contain cursor-zoom-in outline-none focus-visible:outline-2 focus-visible:outline-primary",loading:"lazy",role:"button",tabindex:"0","aria-label":"Open diff overlay in lightbox",onClick:y[1]||(y[1]=Z=>B.value=2),onKeydown:[y[2]||(y[2]=ge(Z=>B.value=2,["enter"])),y[3]||(y[3]=ge(he(Z=>B.value=2,["prevent"]),["space"]))]},null,40,Jo),y[11]||(y[11]=u("p",{class:"px-2 py-1 text-[10px] text-gray-500"},"Red pixels mark differences against the last passing run",-1))])):(n(),c("div",Go,[u("div",Yo,[y[12]||(y[12]=u("p",{class:"px-2 py-1 text-[10px] font-medium text-red-600 dark:text-red-400"},"Failing",-1)),u("img",{src:t(L),alt:"Failing screenshot",class:"w-full max-h-80 object-contain cursor-zoom-in outline-none focus-visible:outline-2 focus-visible:outline-primary",loading:"lazy",role:"button",tabindex:"0","aria-label":"Open failing screenshot in lightbox",onClick:y[4]||(y[4]=Z=>B.value=0),onKeydown:[y[5]||(y[5]=ge(Z=>B.value=0,["enter"])),y[6]||(y[6]=ge(he(Z=>B.value=0,["prevent"]),["space"]))]},null,40,Qo)]),u("div",Xo,[u("p",es," Last pass (run #"+h(t(g).baselineRunId)+") ",1),u("img",{src:t(x),alt:"Last passing screenshot",class:"w-full max-h-80 object-contain cursor-zoom-in outline-none focus-visible:outline-2 focus-visible:outline-primary",loading:"lazy",role:"button",tabindex:"0","aria-label":"Open last passing screenshot in lightbox",onClick:y[7]||(y[7]=Z=>B.value=1),onKeydown:[y[8]||(y[8]=ge(Z=>B.value=1,["enter"])),y[9]||(y[9]=ge(he(Z=>B.value=1,["prevent"]),["space"]))]},null,40,ts)])])),k(J,{modelValue:t(B),"onUpdate:modelValue":y[10]||(y[10]=Z=>ze(B)?B.value=Z:null),images:t(U)},null,8,["modelValue","images"])]),_:2},[e.storageKey?{name:"folded",fn:C(()=>[u("span",null,h(t(D)),1)]),key:"0"}:void 0]),1040)):$("",!0)}}}),Ea=Object.assign(ns,{__name:"VisualDiffCard"}),os={class:"max-h-96 overflow-y-auto"},ss={key:0,class:"mt-2 text-xs text-gray-400 dark:text-gray-500"},qe=2e4,as=te({__name:"DomSnapshotCard",props:{runId:{},testRunsCaseId:{},storageKey:{}},setup(e,{expose:r}){const i=e,f=S(()=>i.storageKey?Ke:Ne),s=S(()=>i.storageKey?{storageKey:i.storageKey}:{}),{data:a,pending:o,error:p}=Me(()=>`/api/test-runs/${i.runId}/cases/${i.testRunsCaseId}/dom-snapshot`,{lazy:!0},"$AxHFpokm2o"),l=S(()=>(a.value?.html??"").slice(0,qe)),g=S(()=>(a.value?.html?.length??0)>qe),T=S(()=>{const x=a.value;return!x||x.status!=="ok"?"":`${Math.round((x.html?.length??0)/1024)} KB · rendered from the uploaded trace${x.snapshotName?` (${x.snapshotName})`:""}`}),{copy:A,copied:b}=Ve(),L=E(null);return r({reveal:()=>L.value?.reveal?.()}),(x,I)=>{const M=Ie,D=Et,U=Ut;return!t(o)&&!t(p)&&t(a)?.status==="ok"&&t(a).html?(n(),P(Se(t(f)),je({key:0,ref_key:"card",ref:L},t(s),{icon:"i-lucide-file-code",title:"DOM snapshot",help:"dom-snapshot",subtitle:t(T)}),Ae({actions:C(()=>[k(D,{text:t(b)?"Copied!":"Copy full HTML"},{default:C(()=>[k(M,{size:"xs",variant:"ghost",color:"neutral",icon:t(b)?"i-lucide-check":"i-lucide-clipboard",onClick:I[0]||(I[0]=B=>t(A)(t(a).html))},null,8,["icon"])]),_:1},8,["text"])]),default:C(()=>[u("div",os,[k(U,{code:t(l),lang:"xml"},null,8,["code"])]),t(g)||t(a).truncated?(n(),c("p",ss,[t(g)?(n(),c(F,{key:0},[z("Showing the first "+h(Math.round(qe/1e3))+"k characters — use Copy for the full document.",1)],64)):(n(),c(F,{key:1},[z("The snapshot was truncated to its size cap.")],64))])):$("",!0)]),_:2},[e.storageKey?{name:"folded",fn:C(()=>[u("span",null,"Failure-time HTML extracted from the trace — "+h(Math.round((t(a).html.length??0)/1024))+" KB",1)]),key:"0"}:void 0]),1040,["subtitle"])):$("",!0)}}}),Ua=Object.assign(as,{__name:"DomSnapshotCard"}),rs={class:"rounded-md border border-default overflow-hidden"},is={class:"text-xs font-semibold text-gray-600 dark:text-gray-300 flex-1"},ls={key:0,class:"text-gray-400 font-normal ml-1"},cs={key:0},us=te({__name:"TestEvidenceSection",props:Ze({icon:{},label:{},count:{},collapsible:{type:Boolean}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:open"],setup(e){const r=e,i=st(e,"open"),f=S(()=>r.collapsible===!1||i.value);return(s,a)=>{const o=ye;return n(),c("div",rs,[(n(),P(Se(e.collapsible===!1?"div":"button"),{class:re(["w-full flex items-center gap-1.5 px-3 py-2 bg-elevated border-b border-default text-left",e.collapsible!==!1&&"hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors cursor-pointer"]),onClick:a[0]||(a[0]=p=>e.collapsible!==!1&&(i.value=!i.value))},{default:C(()=>[k(o,{name:e.icon,class:"size-3.5 shrink-0 text-primary/70"},null,8,["name"]),u("span",is,[z(h(e.label),1),e.count!=null?(n(),c("span",ls,"("+h(e.count)+")",1)):$("",!0)]),e.collapsible!==!1?(n(),P(o,{key:0,name:i.value?"i-lucide-chevron-up":"i-lucide-chevron-down",class:"size-3.5 text-gray-400"},null,8,["name"])):$("",!0)]),_:1},8,["class"])),t(f)?(n(),c("div",cs,[Ee(s.$slots,"default")])):$("",!0)])}}}),Ye=Object.assign(us,{__name:"TestEvidenceSection"}),ds={class:"grid grid-cols-2 gap-2 p-2 bg-gray-50 dark:bg-gray-900"},fs=["aria-label","onClick","onKeydown"],ms=["src","alt"],ps={class:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-black/30"},gs={class:"absolute bottom-0 inset-x-0 px-1.5 py-0.5 text-[10px] text-white bg-black/50 truncate"},hs=te({__name:"TestEvidenceScreenshots",props:{attachments:{}},setup(e){const r=e,i=Re();function f(o){return o.split("/").pop()||o}const s=S(()=>r.attachments.filter(o=>Mt(o.path,o.contentType)).map(o=>({src:Ue(o.path,o.contentType,i.app?.baseURL),name:o.name||f(o.path)}))),a=E(null);return(o,p)=>{const l=ye,g=mt,T=Ye;return t(s).length>0?(n(),P(T,{key:0,icon:"i-lucide-image",label:"Screenshots",count:t(s).length,collapsible:!1},{default:C(()=>[u("div",ds,[(n(!0),c(F,null,oe(t(s),(A,b)=>(n(),c("div",{key:A.src,class:"relative group cursor-pointer rounded overflow-hidden border border-default outline-none focus-visible:outline-2 focus-visible:outline-primary",role:"button",tabindex:"0","aria-label":`View screenshot ${A.name}`,onClick:L=>a.value=b,onKeydown:[ge(L=>a.value=b,["enter"]),ge(he(L=>a.value=b,["prevent"]),["space"])]},[u("img",{src:A.src,alt:A.name,class:"w-full h-28 object-cover object-top transition-opacity group-hover:opacity-80",loading:"lazy"},null,8,ms),u("div",ps,[k(l,{name:"i-lucide-zoom-in",class:"size-5 text-white"})]),u("p",gs,h(A.name),1)],40,fs))),128))]),k(g,{modelValue:t(a),"onUpdate:modelValue":p[0]||(p[0]=A=>ze(a)?a.value=A:null),images:t(s)},null,8,["modelValue","images"])]),_:1},8,["count"])):$("",!0)}}}),ja=Object.assign(hs,{__name:"TestEvidenceScreenshots"}),vs={class:"m-0"},ys={class:"bg-black rounded overflow-hidden"},xs=["src"],bs=["title"],ks=te({__name:"VideoPlayer",props:{src:{},label:{}},setup(e){return(r,i)=>(n(),c("figure",vs,[u("div",ys,[u("video",{src:e.src,controls:"",preload:"metadata",class:"w-full max-h-96"}," Your browser does not support the video tag. ",8,xs)]),e.label?(n(),c("figcaption",{key:0,class:"mt-1 text-xs text-gray-400 truncate",title:e.label},h(e.label),9,bs)):$("",!0)]))}}),_s=Object.assign(ks,{__name:"VideoPlayer"}),$s={class:"space-y-2 p-2 bg-gray-50 dark:bg-gray-900"},ws=te({__name:"TestEvidenceVideos",props:{attachments:{}},setup(e){const r=e,i=Re();function f(a){return a.split("/").pop()||a}const s=S(()=>r.attachments.filter(a=>Nt(a.path,a.contentType)).map(a=>({src:Ue(a.path,a.contentType,i.app?.baseURL),name:a.name||f(a.path)})));return(a,o)=>{const p=_s,l=Ye;return t(s).length>0?(n(),P(l,{key:0,icon:"i-lucide-video",label:"Videos",count:t(s).length,collapsible:!1},{default:C(()=>[u("div",$s,[(n(!0),c(F,null,oe(t(s),g=>(n(),P(p,{key:g.src,src:g.src,label:g.name},null,8,["src","label"]))),128))])]),_:1},8,["count"])):$("",!0)}}}),Ma=Object.assign(ws,{__name:"TestEvidenceVideos"}),Cs={class:"flex items-center justify-between gap-2"},Ss={class:"flex items-center gap-2 min-w-0"},Ts={class:"text-sm truncate"},Ls={key:0,class:"text-xs text-gray-400 shrink-0"},zs={key:1,class:"text-xs text-gray-400 shrink-0"},As={class:"flex items-center gap-1.5 shrink-0"},Is=te({__name:"TraceListItem",props:{trace:{},showTime:{type:Boolean,default:!0}},setup(e){const r=e,i=Re(),f=S(()=>(i.app?.baseURL??"/").replace(/\/$/,"")),s=S(()=>!!i.public.demoMode&&r.trace.filePath.startsWith("demo/")),a=S(()=>r.trace.filePath.split("/").pop()||r.trace.filePath),o=S(()=>lt(r.trace.filePath,i.app?.baseURL,s.value)),p=S(()=>s.value?`${f.value}/${r.trace.filePath}`:`${f.value}/api/files/${Bt(r.trace.filePath)}`);return(l,g)=>{const T=ye,A=Ie;return n(),c("div",Cs,[u("div",Ss,[k(T,{name:"i-lucide-file-archive",class:"size-4 text-gray-400 shrink-0"}),u("span",Ts,h(t(a)),1),e.trace.size?(n(),c("span",Ls,h(("formatBytes"in l?l.formatBytes:t(Kt))(e.trace.size)),1)):$("",!0),e.showTime?(n(),c("span",zs,h(("formatRelativeTime"in l?l.formatRelativeTime:t(Je))(e.trace.createdAt)),1)):$("",!0)]),u("div",As,[k(A,{to:t(o),target:"_blank",icon:"i-lucide-bug-play",size:"xs",label:"View trace"},null,8,["to"]),k(A,{to:t(p),target:"_blank",icon:"i-lucide-download",size:"xs",color:"neutral",variant:"soft",label:"Download"},null,8,["to"])])])}}}),Rs=Object.assign(Is,{__name:"TraceListItem"}),Bs={key:0,class:"flex items-center justify-center py-4"},Ps={key:1,class:"divide-y divide-default"},Os=te({__name:"TestEvidenceTraces",props:{traces:{},loading:{type:Boolean}},setup(e){return(r,i)=>{const f=ye,s=Rs,a=Ye;return e.loading||e.traces.length>0?(n(),P(a,{key:0,icon:"i-lucide-bug-play",label:"Traces",count:e.traces.length||null,collapsible:!1},{default:C(()=>[e.loading&&!e.traces.length?(n(),c("div",Bs,[k(f,{name:"i-lucide-loader-circle",class:"size-4 animate-spin text-gray-400"})])):(n(),c("div",Ps,[(n(!0),c(F,null,oe(e.traces,o=>(n(),P(s,{key:o.id,trace:o,class:"px-3 py-2"},null,8,["trace"]))),128))]))]),_:1},8,["count"])):$("",!0)}}}),Na=Object.assign(Os,{__name:"TestEvidenceTraces"}),Es={class:"space-y-2"},Us={key:0,class:"rounded-lg border border-default overflow-hidden"},js=["title"],Ms={key:2,class:"truncate text-gray-400 dark:text-gray-500"},Ns={class:"font-mono"},Ks={key:0,class:"overflow-x-auto text-xs font-mono leading-relaxed py-1"},Ds={class:"min-w-max"},Vs={key:1,class:"rounded-lg border border-dashed border-default"},Hs=["onClick"],Fs={key:0,class:"px-3 pb-2 space-y-1"},qs=["title"],Zs={key:0,class:"truncate font-mono shrink-0"},Ws=te({__name:"TraceCallStack",props:{frames:{},projectKey:{},projectName:{}},setup(e){const r=e,i=S(()=>{if(!r.frames.some(A=>A.inProject))return r.frames.map((A,b)=>({kind:"frame",frame:A,frameIndex:b}));const l=[];let g=[];const T=()=>{g.length!==0&&(l.push({kind:"group",frames:g,key:`group-${l.length}`}),g=[])};return r.frames.forEach((A,b)=>{A.inProject?(T(),l.push({kind:"frame",frame:A,frameIndex:b})):g.push(A)}),T(),l}),f=S(()=>{const p=r.frames.findIndex(l=>l.inProject);return p>=0?p:0}),s=E(new Set);function a(p){const l=new Set(s.value);l.has(p)?l.delete(p):l.add(p),s.value=l}function o(p){return p.source?p.source.lines.map((l,g)=>{const T=p.source.startLine+g;return{lineNo:T,text:l,failing:T===p.line}}):[]}return(p,l)=>{const g=ye,T=ct,A=Be;return n(),c("div",Es,[(n(!0),c(F,null,oe(t(i),b=>(n(),c(F,{key:b.kind==="frame"?`f-${b.frameIndex}`:b.key},[b.kind==="frame"?(n(),c("div",Us,[u("div",{class:re(["flex items-center gap-2 px-3 py-1.5 bg-elevated/40 text-xs",b.frame.source?"border-b border-default":""])},[k(g,{name:b.frameIndex===t(f)?"i-lucide-circle-x":"i-lucide-corner-left-up",class:re([b.frameIndex===t(f)?"text-red-500":"text-gray-400","size-3.5 shrink-0"])},null,8,["name","class"]),b.frame.inProject?(n(),P(T,{key:0,"file-path":b.frame.file,line:b.frame.line,column:b.frame.column,"project-key":e.projectKey,"project-name":e.projectName,class:"min-w-0"},null,8,["file-path","line","column","project-key","project-name"])):(n(),c("code",{key:1,class:"truncate text-gray-500 dark:text-gray-400",title:b.frame.absFile||b.frame.file},h(b.frame.file)+":"+h(b.frame.line),9,js)),b.frame.functionName?(n(),c("span",Ms,[l[0]||(l[0]=z(" in ",-1)),u("span",Ns,h(b.frame.functionName),1)])):$("",!0),k(A,{color:b.frameIndex===t(f)?"error":"neutral",variant:"subtle",size:"xs",class:"ml-auto shrink-0"},{default:C(()=>[z(h(b.frameIndex===t(f)?"Failed here":"Caller"),1)]),_:2},1032,["color"])],2),b.frame.source?(n(),c("div",Ks,[u("div",Ds,[(n(!0),c(F,null,oe(o(b.frame),L=>(n(),c("div",{key:L.lineNo,class:re(["px-3 whitespace-pre flex",L.failing?"bg-red-50 dark:bg-red-950/30 text-red-700 dark:text-red-300 font-medium":"text-gray-600 dark:text-gray-400"])},[u("span",{class:re(["w-10 shrink-0 text-right pr-3 tabular-nums select-none",L.failing?"text-red-400 dark:text-red-500":"text-gray-300 dark:text-gray-600"])},h(L.lineNo),3),u("span",null,h(L.text),1)],2))),128))])])):$("",!0)])):(n(),c("div",Vs,[u("button",{type:"button",class:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-gray-400 dark:text-gray-500 hover:text-gray-600 dark:hover:text-gray-300",onClick:L=>a(b.key)},[k(g,{name:t(s).has(b.key)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3.5 shrink-0"},null,8,["name"]),z(" "+h(b.frames.length)+" frame"+h(b.frames.length===1?"":"s")+" in dependencies ",1)],8,Hs),t(s).has(b.key)?(n(),c("div",Fs,[(n(!0),c(F,null,oe(b.frames,(L,x)=>(n(),c("div",{key:x,class:"flex items-center gap-2 text-xs text-gray-400 dark:text-gray-500 min-w-0"},[k(g,{name:"i-lucide-corner-left-up",class:"size-3 shrink-0"}),u("code",{class:"truncate",title:L.absFile||L.file},h(L.file)+":"+h(L.line),9,qs),L.functionName?(n(),c("span",Zs,h(L.functionName),1)):$("",!0)]))),128))])):$("",!0)]))],64))),128))])}}}),Ka=Object.assign(Ws,{__name:"TraceCallStack"}),Js={class:"space-y-2"},Gs={class:"flex items-center gap-2 px-3 py-1.5 bg-elevated/40 border-b border-default text-xs"},Ys={class:"overflow-x-auto text-xs font-mono leading-relaxed py-1"},Qs={class:"min-w-max"},Xs=te({__name:"TestSourceStack",props:{frames:{},projectKey:{},projectName:{}},setup(e){function r(i){return i.split(`
|
|
5
|
-
`).map(f=>({text:f,failing:f.startsWith(">")}))}return(i,f)=>{const s=ye,a=ct,o=Be;return n(),c("div",Js,[(n(!0),c(F,null,oe(e.frames,(p,l)=>(n(),c("div",{key:`${p.file}:${p.line}:${l}`,class:"rounded-lg border border-default overflow-hidden"},[u("div",Gs,[k(s,{name:l===0?"i-lucide-circle-x":"i-lucide-corner-left-up",class:re([l===0?"text-red-500":"text-gray-400","size-3.5 shrink-0"])},null,8,["name","class"]),k(a,{"file-path":p.file,line:p.line,"project-key":e.projectKey,"project-name":e.projectName,class:"min-w-0"},null,8,["file-path","line","project-key","project-name"]),k(o,{color:l===0?"error":"neutral",variant:"subtle",size:"xs",class:"ml-auto shrink-0"},{default:C(()=>[z(h(l===0?"Failed here":"Caller"),1)]),_:2},1032,["color"])]),u("div",Ys,[u("div",Qs,[(n(!0),c(F,null,oe(r(p.snippet),(g,T)=>(n(),c("div",{key:T,class:re(["px-3 whitespace-pre",g.failing?"bg-red-50 dark:bg-red-950/30 text-red-700 dark:text-red-300 font-medium":"text-gray-600 dark:text-gray-400"])},h(g.text),3))),128))])])]))),128))])}}}),Da=Object.assign(Xs,{__name:"TestSourceStack"}),ea={class:"space-y-3 text-sm"},ta={key:0,class:"flex flex-col gap-0.5"},na={class:"text-xs font-mono break-all"},oa={key:1,class:"flex flex-col gap-0.5"},sa={class:"text-xs font-mono break-all"},aa={class:"grid grid-cols-1 gap-3 sm:grid-cols-2"},ra={class:"text-xs font-medium text-gray-500 dark:text-gray-400"},ia={key:0,class:"text-xs text-gray-400"},la={key:1,class:"mt-1 space-y-0.5"},ca={class:"text-gray-400"},ua={class:"text-xs font-medium text-gray-500 dark:text-gray-400"},da={key:0,class:"text-xs text-gray-400"},fa={key:1,class:"mt-1 space-y-0.5"},ma={key:0,class:"text-gray-400"},pa={class:"text-gray-400"},ga=te({__name:"PageStateCard",props:{pageState:{},storageKey:{},plain:{type:Boolean}},setup(e){const r=e,i=S(()=>r.plain?"div":r.storageKey?Ke:Ne),f=S(()=>r.plain?{}:{icon:"i-lucide-database",title:"App state at test end",help:"page-state",...r.storageKey?{storageKey:r.storageKey}:{}}),s=o=>[o.httpOnly?"HttpOnly":null,o.secure?"Secure":null,o.sameSite??null].filter(Boolean).join(", "),a=S(()=>{const o=r.pageState;return[`${o.localStorage.length} localStorage`,`${o.sessionStorage.length} sessionStorage`,`${o.cookies.length} cookie${o.cookies.length===1?"":"s"}`].join(" · ")});return(o,p)=>(n(),P(Se(t(i)),St(Tt(t(f))),Ae({default:C(()=>[u("div",ea,[e.pageState.url?(n(),c("div",ta,[p[0]||(p[0]=u("span",{class:"text-xs font-medium text-gray-500 dark:text-gray-400"},"URL",-1)),u("code",na,h(e.pageState.url)+h(e.pageState.hash??""),1)])):$("",!0),e.pageState.historyState?(n(),c("div",oa,[p[1]||(p[1]=u("span",{class:"text-xs font-medium text-gray-500 dark:text-gray-400"},"History state",-1)),u("code",sa,h(e.pageState.historyState),1)])):$("",!0),u("div",aa,[(n(!0),c(F,null,oe({localStorage:e.pageState.localStorage,sessionStorage:e.pageState.sessionStorage},(l,g)=>(n(),c("div",{key:g},[u("span",ra,h(g)+" ("+h(l.length)+")",1),l.length===0?(n(),c("p",ia,"empty")):(n(),c("ul",la,[(n(!0),c(F,null,oe(l,T=>(n(),c("li",{key:T.key,class:"text-xs font-mono truncate"},[z(h(T.key)+" ",1),u("span",ca,"("+h(T.length)+" ch)",1)]))),128))]))]))),128))]),u("div",null,[u("span",ua,"Cookies ("+h(e.pageState.cookies.length)+")",1),e.pageState.cookies.length===0?(n(),c("p",da,"none")):(n(),c("ul",fa,[(n(!0),c(F,null,oe(e.pageState.cookies,l=>(n(),c("li",{key:l.name+l.domain,class:"text-xs font-mono truncate"},[z(h(l.name)+" ",1),s(l)?(n(),c("span",ma,"["+h(s(l))+"]",1)):$("",!0),u("span",pa,"· "+h(l.domain),1)]))),128))]))]),p[2]||(p[2]=u("p",{class:"text-[11px] text-gray-400 dark:text-gray-500"}," Storage values and cookie values are never captured — key names, lengths and flags only. ",-1))])]),_:2},[e.storageKey&&!e.plain?{name:"folded",fn:C(()=>[u("span",null,h(t(a)),1)]),key:"0"}:void 0]),1040))}}),Va=Object.assign(ga,{__name:"PageStateCard"});function Ha(e={}){const r=E(!1),i=We();let f=null;async function s(a,o,p={}){try{typeof ClipboardItem<"u"?await navigator.clipboard.write([new ClipboardItem({"text/plain":new Blob([a],{type:"text/plain"}),"text/html":new Blob([o],{type:"text/html"})})]):await navigator.clipboard.writeText(a),r.value=!0,f&&clearTimeout(f),f=setTimeout(()=>{r.value=!1,f=null},e.duration??2e3),p.toast&&i.add({title:typeof p.toast=="string"?p.toast:"Copied to clipboard",icon:"i-lucide-check",color:"success",duration:2e3})}catch{}}return{copyRich:s,copied:r}}export{Ye as _,ja as a,Ma as b,Na as c,Ka as d,Da as e,Va as f,tn as g,Ke as h,Pa as i,Oa as j,Ea as k,Ua as l,Ba as m,Rs as n,_s as o,mt as p,Ha as u};
|