@piwitests/server 0.16.0 → 0.17.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/{DqnyWaSQ.js → -9tk1FrT.js} +1 -1
- package/.output/public/_nuxt/26ll_vBr.js +1 -0
- package/.output/public/_nuxt/{BR9H8k-L.js → 3QTorEhJ.js} +1 -1
- package/.output/public/_nuxt/{CgoAUz76.js → 3QTvYrZp.js} +1 -1
- package/.output/public/_nuxt/{l0gdGdar.js → 73aPL7Ir.js} +1 -1
- package/.output/public/_nuxt/{N3pCB6-m.js → 8jZmK2De.js} +1 -1
- package/.output/public/_nuxt/{B33X4zrC.js → 8xyZSRSO.js} +1 -1
- package/.output/public/_nuxt/{B3NbDoBP.js → 99tAfVF5.js} +1 -1
- package/.output/public/_nuxt/{ze9-Ill2.js → B1CUXGbl.js} +1 -1
- package/.output/public/_nuxt/{CQeMb57w.js → B6hPf4UR.js} +1 -1
- package/.output/public/_nuxt/{DL20rwkA.js → B6w76fJT.js} +1 -1
- package/.output/public/_nuxt/{Bvfmwzgw.js → BDcIWTTq.js} +1 -1
- package/.output/public/_nuxt/{DgYM3eyi.js → BE8ykmwr.js} +1 -1
- package/.output/public/_nuxt/{BY4oA2IH.js → BEsJE07U.js} +1 -1
- package/.output/public/_nuxt/{oNq5pd3r.js → BGZQONfm.js} +1 -1
- package/.output/public/_nuxt/{BZekCf_x.js → BRdhP5lm.js} +1 -1
- package/.output/public/_nuxt/{Br2K9yi_.js → BU6xjw05.js} +1 -1
- package/.output/public/_nuxt/{DjZKuUMz.js → BWFY2RuU.js} +1 -1
- package/.output/public/_nuxt/{CCRRqXez.js → B_QIrc7l.js} +1 -1
- package/.output/public/_nuxt/{BQrSEuzu.js → Ba4_ydKG.js} +1 -1
- package/.output/public/_nuxt/{Dz55UR7w.js → BcLXUmKT.js} +1 -1
- package/.output/public/_nuxt/{nCjfWTGm.js → BciovqwK.js} +1 -1
- package/.output/public/_nuxt/{JCFZINev.js → BgDEjrcz.js} +1 -1
- package/.output/public/_nuxt/{DCpmQ47_.js → BoRJdCd4.js} +1 -1
- package/.output/public/_nuxt/{C8RBRg7I.js → Bpha13F_.js} +1 -1
- package/.output/public/_nuxt/{BdFEUAlx.js → Bq0PQfQY.js} +1 -1
- package/.output/public/_nuxt/{BPKwYP2Q.js → BrT_Sys2.js} +2 -2
- package/.output/public/_nuxt/{CTdvGdc2.js → Bua_L6p4.js} +1 -1
- package/.output/public/_nuxt/{BIksQZfR.js → BwKwWgQe.js} +1 -1
- package/.output/public/_nuxt/{d5ZB3uxF.js → BxRsAYRS.js} +1 -1
- package/.output/public/_nuxt/{mGJLLqyN.js → ByoIgYX_.js} +1 -1
- package/.output/public/_nuxt/{CSYJwpXG.js → C7nwFokE.js} +1 -1
- package/.output/public/_nuxt/CEuVRSr0.js +3 -0
- package/.output/public/_nuxt/{2xvsvjLO.js → CHHqhAsw.js} +1 -1
- package/.output/public/_nuxt/{DhA17dqR.js → CHIbdzqp.js} +1 -1
- package/.output/public/_nuxt/{IFqRT_xJ.js → CMB-NkFa.js} +1 -1
- package/.output/public/_nuxt/{mfzslNx_.js → CNULGfLp.js} +1 -1
- package/.output/public/_nuxt/{CKB_doYB.js → COVRAesU.js} +1 -1
- package/.output/public/_nuxt/{Bzl2H_vl.js → CSAmL8XJ.js} +1 -1
- package/.output/public/_nuxt/{bAfTAihV.js → CWmQcueG.js} +1 -1
- package/.output/public/_nuxt/{BBdfPriC.js → CYuWAvXE.js} +1 -1
- package/.output/public/_nuxt/CbuWynGG.js +1 -0
- package/.output/public/_nuxt/{e1zUTrBb.js → Ce3tBrN7.js} +1 -1
- package/.output/public/_nuxt/{BGYbnqA7.js → Cf4h8qty.js} +1 -1
- package/.output/public/_nuxt/{Kc7La4sL.js → Cl96oI21.js} +1 -1
- package/.output/public/_nuxt/{DdbrJwT-.js → ClJkng9p.js} +1 -1
- package/.output/public/_nuxt/{B7yG1G_l.js → CoKEjZX7.js} +1 -1
- package/.output/public/_nuxt/CvtYJHkY.js +1 -0
- package/.output/public/_nuxt/{DszOHBMG.js → CxLN5Tmq.js} +1 -1
- package/.output/public/_nuxt/{B3sNtVnf.js → Cz2HhsB6.js} +1 -1
- package/.output/public/_nuxt/{C38aZbFJ.js → D0-HTQTD.js} +1 -1
- package/.output/public/_nuxt/{D2jhe9JK.js → D13ybpY3.js} +1 -1
- package/.output/public/_nuxt/{k-z_VVTK.js → D7P0ML0H.js} +1 -1
- package/.output/public/_nuxt/{BV83yObd.js → D811X8KM.js} +1 -1
- package/.output/public/_nuxt/DATh_1DQ.js +1 -0
- package/.output/public/_nuxt/{1AB111xL.js → DAeYmPfX.js} +1 -1
- package/.output/public/_nuxt/DCffDvxl.js +1 -0
- package/.output/public/_nuxt/DDPptydi.js +2 -0
- package/.output/public/_nuxt/{BpNqHxg2.js → DFM2jv9I.js} +1 -1
- package/.output/public/_nuxt/{BuZOa2M3.js → DJHNEqb7.js} +1 -1
- package/.output/public/_nuxt/{CMYQpoOI.js → DPSOtRoz.js} +1 -1
- package/.output/public/_nuxt/{BkDfdHFm.js → DRTxhZBV.js} +1 -1
- package/.output/public/_nuxt/{B2lYFco4.js → DS9yGVFL.js} +1 -1
- package/.output/public/_nuxt/{DfcAIbcX.js → DT5rhzhJ.js} +1 -1
- package/.output/public/_nuxt/{BpceIssd.js → DTH2lteW.js} +1 -1
- package/.output/public/_nuxt/DUe6xuKQ.js +1 -0
- package/.output/public/_nuxt/{DcCNnjKl.js → D_A6axXa.js} +1 -1
- package/.output/public/_nuxt/D_TbJDHY.js +1 -0
- package/.output/public/_nuxt/{DIkLLyR6.js → Df3QtbpW.js} +1 -1
- package/.output/public/_nuxt/{Dzz9_Z0u.js → DjRhouSr.js} +1 -1
- package/.output/public/_nuxt/{CuYYdFBL.js → Dn6cGVYB.js} +1 -1
- package/.output/public/_nuxt/{CoHGrO41.js → DpJrGwCr.js} +2 -2
- package/.output/public/_nuxt/DqsMiUoW.js +2 -0
- package/.output/public/_nuxt/{D33On6AX.js → Ds2Y3oms.js} +1 -1
- package/.output/public/_nuxt/Ds4Lb1vi.js +7 -0
- package/.output/public/_nuxt/{DuMv-ugy.js → DtXREpk_.js} +1 -1
- package/.output/public/_nuxt/{BRKa6EQR.js → DvC5Adg1.js} +1 -1
- package/.output/public/_nuxt/{BVW5qIDP.js → DvXvJzFP.js} +1 -1
- package/.output/public/_nuxt/{BIf1R_fu.js → Dvc1aWpA.js} +1 -1
- package/.output/public/_nuxt/{-KQO1A4C.js → DwZiG9xH.js} +1 -1
- package/.output/public/_nuxt/Dx1oCMgy.js +47 -0
- package/.output/public/_nuxt/{CpO-ABDW.js → DxQq_L07.js} +1 -1
- package/.output/public/_nuxt/{BoRFLTAO.js → Dym66h3p.js} +1 -1
- package/.output/public/_nuxt/{ABGJk0pu.js → Dz3Wbekz.js} +1 -1
- package/.output/public/_nuxt/{qzAP_nm7.js → HCK35QD8.js} +1 -1
- package/.output/public/_nuxt/{DuBBqqbF.js → L6HlmmEa.js} +1 -1
- package/.output/public/_nuxt/{BS0gKVuF.js → PxPbRVF-.js} +1 -1
- package/.output/public/_nuxt/{DbeHHTk-.js → QFMx1VKs.js} +1 -1
- package/.output/public/_nuxt/{C3r_Sv1p.js → Sgf5OLhm.js} +1 -1
- package/.output/public/_nuxt/US3YSX4T.js +1 -0
- package/.output/public/_nuxt/{xUrLy-Zn.js → Wfk1m0ni.js} +1 -1
- package/.output/public/_nuxt/builds/latest.json +1 -1
- package/.output/public/_nuxt/builds/meta/05a2dd95-d1c1-4e3a-8625-ac6bfea83837.json +1 -0
- package/.output/public/_nuxt/{B43OGXzV.js → cBj9fai9.js} +1 -1
- package/.output/public/_nuxt/{BpIsBP5g.js → csqspBeX.js} +1 -1
- package/.output/public/_nuxt/entry.BaIGwMjT.css +1 -0
- package/.output/public/_nuxt/{CJFqA_QW.js → jlBi8Byu.js} +1 -1
- package/.output/public/_nuxt/{D4VpoHDP.js → lCkcEykv.js} +1 -1
- package/.output/public/_nuxt/{DOuoR2Pk.js → qYFZH4Z8.js} +1 -1
- package/.output/public/_nuxt/{uKeO2H7F.js → r9WApUfF.js} +1 -1
- package/.output/public/_nuxt/{DRtTLQri.js → rw7Hdll3.js} +1 -1
- package/.output/public/_nuxt/{C1K3r_fc.js → sMFaPAAR.js} +1 -1
- package/.output/public/_nuxt/{DAWn6Z7h.js → vzXhOO8R.js} +1 -1
- package/.output/public/_nuxt/{DJS3Bf50.js → yZ4LuI9d.js} +1 -1
- package/.output/public/_nuxt/{iwD5atI2.js → z7PmsnBG.js} +1 -1
- package/.output/public/_nuxt/{Bb64FEFL.js → za5M7BGh.js} +1 -1
- package/.output/public/sw.js +1 -1
- package/.output/server/chunks/build/{Checkbox-7ZiMz60w.mjs → Checkbox-cVOSIY93.mjs} +2 -2
- package/.output/server/chunks/build/Checkbox-cVOSIY93.mjs.map +1 -0
- package/.output/server/chunks/build/{CiEnvCard-DNxBVvx4.mjs → CiEnvCard-DXPOhdSG.mjs} +2 -2
- package/.output/server/chunks/build/CiEnvCard-DXPOhdSG.mjs.map +1 -0
- package/.output/server/chunks/build/DataLocationCard-D6xSOrme.mjs +102 -0
- package/.output/server/chunks/build/DataLocationCard-D6xSOrme.mjs.map +1 -0
- package/.output/server/chunks/build/DesktopMcpCard-B4JuUTKj.mjs +122 -0
- package/.output/server/chunks/build/DesktopMcpCard-B4JuUTKj.mjs.map +1 -0
- package/.output/server/chunks/build/{ProjectTestCasesTable-9418EI8J.mjs → ProjectTestCasesTable-9Ia825h8.mjs} +2 -2
- package/.output/server/chunks/build/ProjectTestCasesTable-9Ia825h8.mjs.map +1 -0
- package/.output/server/chunks/build/{Select-COwTIQlV.mjs → Select-ppPz926C.mjs} +3 -2
- package/.output/server/chunks/build/Select-ppPz926C.mjs.map +1 -0
- package/.output/server/chunks/build/{SelectMenu-BkyAHFCM.mjs → SelectMenu-799c_Ils.mjs} +2 -2
- package/.output/server/chunks/build/{SelectMenu-BkyAHFCM.mjs.map → SelectMenu-799c_Ils.mjs.map} +1 -1
- package/.output/server/chunks/build/{Switch-htSKgC38.mjs → Switch-xQQ3_ME1.mjs} +2 -2
- package/.output/server/chunks/build/Switch-xQQ3_ME1.mjs.map +1 -0
- package/.output/server/chunks/build/{_id_-CnwAyvvS.mjs → _id_-B2yirIuA.mjs} +5 -4
- package/.output/server/chunks/build/{_id_-CnwAyvvS.mjs.map → _id_-B2yirIuA.mjs.map} +1 -1
- package/.output/server/chunks/build/{_id_-BDqvTM9D.mjs → _id_-B4V5fop6.mjs} +5 -4
- package/.output/server/chunks/build/{_id_-BDqvTM9D.mjs.map → _id_-B4V5fop6.mjs.map} +1 -1
- package/.output/server/chunks/build/{_id_-Dy67M9Dj.mjs → _id_-bWcP2xFl.mjs} +8 -7
- package/.output/server/chunks/build/{_id_-Dy67M9Dj.mjs.map → _id_-bWcP2xFl.mjs.map} +1 -1
- package/.output/server/chunks/build/about-TuEZ9n1Q.mjs +625 -0
- package/.output/server/chunks/build/about-TuEZ9n1Q.mjs.map +1 -0
- package/.output/server/chunks/build/{ai-V3YOh3yx.mjs → ai-7jdaPOmj.mjs} +6 -5
- package/.output/server/chunks/build/{ai-V3YOh3yx.mjs.map → ai-7jdaPOmj.mjs.map} +1 -1
- package/.output/server/chunks/build/{analytics-BBlAEmj5.mjs → analytics-B276WPeU.mjs} +7 -6
- package/.output/server/chunks/build/{analytics-BBlAEmj5.mjs.map → analytics-B276WPeU.mjs.map} +1 -1
- package/.output/server/chunks/build/client.precomputed.mjs +1 -1
- package/.output/server/chunks/build/{default-BfMirIgG.mjs → default-BSzdkM_L.mjs} +9 -7
- package/.output/server/chunks/build/default-BSzdkM_L.mjs.map +1 -0
- package/.output/server/chunks/build/{docs-DtNcJCyb.mjs → docs-EXhN3sqC.mjs} +4 -3
- package/.output/server/chunks/build/{docs-DtNcJCyb.mjs.map → docs-EXhN3sqC.mjs.map} +1 -1
- package/.output/server/chunks/build/{edit-Dsf11mL5.mjs → edit-C9Z7oZeu.mjs} +5 -4
- package/.output/server/chunks/build/edit-C9Z7oZeu.mjs.map +1 -0
- package/.output/server/chunks/build/handleAndDispatchCustomEvent-Bk_AVSSo.mjs +13 -0
- package/.output/server/chunks/build/handleAndDispatchCustomEvent-Bk_AVSSo.mjs.map +1 -0
- package/.output/server/chunks/build/{index-DzEgjHlB.mjs → index-BK9PTRpd.mjs} +24 -8
- package/.output/server/chunks/build/{index-DzEgjHlB.mjs.map → index-BK9PTRpd.mjs.map} +1 -1
- package/.output/server/chunks/build/{index-BgpEKTSq.mjs → index-DVUtBexc.mjs} +9 -8
- package/.output/server/chunks/build/{index-BgpEKTSq.mjs.map → index-DVUtBexc.mjs.map} +1 -1
- package/.output/server/chunks/build/{mcp-CXwa3xU3.mjs → mcp-CQ-21rwc.mjs} +132 -25
- package/.output/server/chunks/build/mcp-CQ-21rwc.mjs.map +1 -0
- package/.output/server/chunks/build/{notifications-hJj8tbAT.mjs → notifications-Dzm9c0u_.mjs} +4 -3
- package/.output/server/chunks/build/notifications-Dzm9c0u_.mjs.map +1 -0
- package/.output/server/chunks/build/server.mjs +17 -17
- package/.output/server/chunks/build/{settings-metadata-Cp0dx0vm.mjs → settings-metadata-B0wo5R-W.mjs} +3 -1
- package/.output/server/chunks/build/settings-metadata-B0wo5R-W.mjs.map +1 -0
- package/.output/server/chunks/build/{settings-Ci_7EXYQ.mjs → settings-pNyPBXVa.mjs} +4 -3
- package/.output/server/chunks/build/settings-pNyPBXVa.mjs.map +1 -0
- package/.output/server/chunks/build/{storage-CM-Pd-9E.mjs → storage-XelzuyPy.mjs} +16 -182
- package/.output/server/chunks/build/storage-XelzuyPy.mjs.map +1 -0
- package/.output/server/chunks/build/{test-cases-DkGQB027.mjs → test-cases-pmOxi-AN.mjs} +5 -4
- package/.output/server/chunks/build/test-cases-pmOxi-AN.mjs.map +1 -0
- package/.output/server/chunks/build/useFormControl-BLpq1s4O.mjs +9 -0
- package/.output/server/chunks/build/useFormControl-BLpq1s4O.mjs.map +1 -0
- package/.output/server/chunks/build/useIsDesktop-BS13spVj.mjs +9 -0
- package/.output/server/chunks/build/useIsDesktop-BS13spVj.mjs.map +1 -0
- package/.output/server/chunks/build/{useSettingsNav-D2knPCqF.mjs → useSettingsNav-NjI2seBy.mjs} +5 -3
- package/.output/server/chunks/build/useSettingsNav-NjI2seBy.mjs.map +1 -0
- package/.output/server/chunks/build/{virtualizer-0-UBy7xl.mjs → virtualizer-ZaqK4guJ.mjs} +3 -2
- package/.output/server/chunks/build/virtualizer-ZaqK4guJ.mjs.map +1 -0
- package/.output/server/chunks/build/{wasted-time-L4kBV5Nh.mjs → wasted-time-CguAF9zc.mjs} +2 -2
- package/.output/server/chunks/build/wasted-time-CguAF9zc.mjs.map +1 -0
- package/.output/server/chunks/nitro/nitro.mjs +703 -681
- package/.output/server/package.json +1 -1
- package/package.json +1 -1
- package/.output/public/_nuxt/B6Jp7fpa.js +0 -46
- package/.output/public/_nuxt/BP_SWi7S.js +0 -1
- package/.output/public/_nuxt/Bf62wdzp.js +0 -1
- package/.output/public/_nuxt/C219JuBV.js +0 -1
- package/.output/public/_nuxt/CX1dcT4v.js +0 -1
- package/.output/public/_nuxt/CdME81ij.js +0 -2
- package/.output/public/_nuxt/Dsk4Ic18.js +0 -7
- package/.output/public/_nuxt/HoKG9cc2.js +0 -1
- package/.output/public/_nuxt/WctJXszi.js +0 -3
- package/.output/public/_nuxt/builds/meta/5182c9fb-56a6-4df2-9685-4020a08ce7a5.json +0 -1
- package/.output/public/_nuxt/entry.BsmKRJzR.css +0 -1
- package/.output/public/_nuxt/jIF87ALb.js +0 -1
- package/.output/server/chunks/build/Checkbox-7ZiMz60w.mjs.map +0 -1
- package/.output/server/chunks/build/CiEnvCard-DNxBVvx4.mjs.map +0 -1
- package/.output/server/chunks/build/ProjectTestCasesTable-9418EI8J.mjs.map +0 -1
- package/.output/server/chunks/build/Select-COwTIQlV.mjs.map +0 -1
- package/.output/server/chunks/build/Switch-htSKgC38.mjs.map +0 -1
- package/.output/server/chunks/build/about-FB9PYAHK.mjs +0 -313
- package/.output/server/chunks/build/about-FB9PYAHK.mjs.map +0 -1
- package/.output/server/chunks/build/default-BfMirIgG.mjs.map +0 -1
- package/.output/server/chunks/build/edit-Dsf11mL5.mjs.map +0 -1
- package/.output/server/chunks/build/mcp-CXwa3xU3.mjs.map +0 -1
- package/.output/server/chunks/build/notifications-hJj8tbAT.mjs.map +0 -1
- package/.output/server/chunks/build/settings-Ci_7EXYQ.mjs.map +0 -1
- package/.output/server/chunks/build/settings-metadata-Cp0dx0vm.mjs.map +0 -1
- package/.output/server/chunks/build/storage-CM-Pd-9E.mjs.map +0 -1
- package/.output/server/chunks/build/test-cases-DkGQB027.mjs.map +0 -1
- package/.output/server/chunks/build/useFormControl-DFTjniPG.mjs +0 -19
- package/.output/server/chunks/build/useFormControl-DFTjniPG.mjs.map +0 -1
- package/.output/server/chunks/build/useSettingsNav-D2knPCqF.mjs.map +0 -1
- package/.output/server/chunks/build/virtualizer-0-UBy7xl.mjs.map +0 -1
- package/.output/server/chunks/build/wasted-time-L4kBV5Nh.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Y as G,d as K,S as O,X as J,aq as T,o as i,c as B,f,g as v,T as C,k as e,U as _,Q as W,H as Z,ae as D,V as $,q as x,F as ee,h as m,a_ as E,aL as P,j as R,aA as ae,a0 as re,a1 as te,a3 as se,a4 as le,a5 as ie,aM as oe,aN as ne,i as de,p as c,v as j,m as N,t as M,a6 as ue}from"./
|
|
1
|
+
import{Y as G,d as K,S as O,X as J,aq as T,o as i,c as B,f,g as v,T as C,k as e,U as _,Q as W,H as Z,ae as D,V as $,q as x,F as ee,h as m,a_ as E,aL as P,j as R,aA as ae,a0 as re,a1 as te,a3 as se,a4 as le,a5 as ie,aM as oe,aN as ne,i as de,p as c,v as j,m as N,t as M,a6 as ue}from"./BrT_Sys2.js";import{i as L}from"./vzXhOO8R.js";import{u as ce}from"./26ll_vBr.js";import{u as pe}from"./DATh_1DQ.js";import{V as fe}from"./ByoIgYX_.js";import{R as ve}from"./D0-HTQTD.js";import{L as U}from"./rw7Hdll3.js";const[be]=G("CheckboxGroupRoot");function A(o){return o==="indeterminate"}function H(o){return A(o)?"indeterminate":o?"checked":"unchecked"}const[me,he]=G("CheckboxRoot");var ge=K({inheritAttrs:!1,__name:"CheckboxRoot",props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:"on"},id:{type:String,required:!1},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(o,{emit:h}){const r=o,l=h,{forwardRef:g,currentElement:a}=O(),s=be(null),d=J(r,"modelValue",l,{defaultValue:r.defaultValue??r.falseValue,passive:r.modelValue===void 0}),p=m(()=>s?.disabled.value||r.disabled),q=m(()=>P(d.value,r.trueValue)),u=m(()=>E(s?.modelValue.value)?d.value==="indeterminate"?"indeterminate":q.value:L(s.modelValue.value,r.value));function z(){if(E(s?.modelValue.value))d.value==="indeterminate"?d.value=r.trueValue:d.value=q.value?r.falseValue:r.trueValue;else{const t=[...s.modelValue.value||[]];if(L(t,r.value)){const y=t.findIndex(I=>P(I,r.value));t.splice(y,1)}else t.push(r.value);s.modelValue.value=t}}const F=ce(a),k=pe(),S=T(),V=m(()=>{if(!S["aria-label"])return r.id&&a.value?document.querySelector(`[for="${r.id}"]`)?.innerText:void 0});return he({disabled:p,state:u}),(t,y)=>(i(),B(ee,null,[(i(),f(D(e(s)?.rovingFocus.value?e(ve):e($)),_({...t.$attrs,...e(k)},{id:t.id,ref:e(g),role:"checkbox","as-child":t.asChild,as:t.as,type:t.as==="button"?"button":void 0,"aria-checked":e(A)(u.value)?"mixed":u.value,"aria-required":t.required,"aria-label":t.$attrs["aria-label"]||V.value,"data-state":e(H)(u.value),"data-disabled":p.value?"":void 0,disabled:p.value,focusable:e(s)?.rovingFocus.value?!p.value:void 0,onKeydown:W(Z(()=>{},["prevent"]),["enter"]),onClick:z}),{default:v(()=>[C(t.$slots,"default",{modelValue:e(d),state:u.value})]),_:3},16,["id","as-child","as","type","aria-checked","aria-required","aria-label","data-state","data-disabled","disabled","focusable","onKeydown"])),e(F)&&t.name&&!e(s)?(i(),f(e(fe),_({key:0,type:"checkbox",checked:!!u.value,name:t.name,value:t.value,disabled:p.value,required:t.required},e(k)),null,16,["checked","name","value","disabled","required"])):x("v-if",!0)],64))}}),ye=ge,qe=K({__name:"CheckboxIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(o){const{forwardRef:h}=O(),r=me();return(l,g)=>(i(),f(e(ae),{present:l.forceMount||e(A)(e(r).state.value)||e(r).state.value===!0},{default:v(()=>[R(e($),_({ref:e(h),"data-state":e(H)(e(r).state.value),"data-disabled":e(r).disabled.value?"":void 0,style:{pointerEvents:"none"},"as-child":l.asChild,as:l.as},l.$attrs),{default:v(()=>[C(l.$slots,"default")]),_:3},16,["data-state","data-disabled","as-child","as"])]),_:3},8,["present"]))}}),ke=qe;const Ve={slots:{root:"relative flex items-start",container:"flex items-center",base:"rounded-sm ring ring-inset ring-accented overflow-hidden focus-visible:outline-3",indicator:"flex items-center justify-center size-full text-inverted",icon:"shrink-0 size-full",wrapper:"w-full",label:"block font-medium text-default",description:"text-muted"},variants:{color:{primary:{base:"outline-primary/25 focus-visible:ring-primary",indicator:"bg-primary"},secondary:{base:"outline-secondary/25 focus-visible:ring-secondary",indicator:"bg-secondary"},success:{base:"outline-success/25 focus-visible:ring-success",indicator:"bg-success"},info:{base:"outline-info/25 focus-visible:ring-info",indicator:"bg-info"},warning:{base:"outline-warning/25 focus-visible:ring-warning",indicator:"bg-warning"},error:{base:"outline-error/25 focus-visible:ring-error",indicator:"bg-error"},neutral:{base:"outline-inverted/25 focus-visible:ring-inverted",indicator:"bg-inverted"}},variant:{list:{root:""},card:{root:"border border-muted rounded-lg"}},indicator:{start:{root:"flex-row",wrapper:"ms-2"},end:{root:"flex-row-reverse",wrapper:"me-2"},hidden:{base:"sr-only",wrapper:"text-center"}},size:{xs:{base:"size-3",container:"h-4",wrapper:"text-xs"},sm:{base:"size-3.5",container:"h-4",wrapper:"text-xs"},md:{base:"size-4",container:"h-5",wrapper:"text-sm"},lg:{base:"size-4.5",container:"h-5",wrapper:"text-sm"},xl:{base:"size-5",container:"h-6",wrapper:"text-base"}},required:{true:{label:"after:content-['*'] after:ms-0.5 after:text-error"}},disabled:{true:{root:"opacity-75",base:"cursor-not-allowed",label:"cursor-not-allowed",description:"cursor-not-allowed"}},highlight:{true:""},checked:{true:""}},compoundVariants:[{size:"xs",variant:"card",class:{root:"p-2.5"}},{size:"sm",variant:"card",class:{root:"p-3"}},{size:"md",variant:"card",class:{root:"p-3.5"}},{size:"lg",variant:"card",class:{root:"p-4"}},{size:"xl",variant:"card",class:{root:"p-4.5"}},{color:"primary",variant:"card",class:{root:"has-data-[state=checked]:border-primary"}},{color:"secondary",variant:"card",class:{root:"has-data-[state=checked]:border-secondary"}},{color:"success",variant:"card",class:{root:"has-data-[state=checked]:border-success"}},{color:"info",variant:"card",class:{root:"has-data-[state=checked]:border-info"}},{color:"warning",variant:"card",class:{root:"has-data-[state=checked]:border-warning"}},{color:"error",variant:"card",class:{root:"has-data-[state=checked]:border-error"}},{color:"neutral",variant:"card",class:{root:"has-data-[state=checked]:border-inverted"}},{variant:"card",disabled:!0,class:{root:"cursor-not-allowed"}},{color:"primary",highlight:!0,class:{base:"ring-primary"}},{color:"secondary",highlight:!0,class:{base:"ring-secondary"}},{color:"success",highlight:!0,class:{base:"ring-success"}},{color:"info",highlight:!0,class:{base:"ring-info"}},{color:"warning",highlight:!0,class:{base:"ring-warning"}},{color:"error",highlight:!0,class:{base:"ring-error"}},{color:"neutral",highlight:!0,class:{base:"ring-inverted"}}],defaultVariants:{size:"md",color:"primary",variant:"list",indicator:"start"}},Ie=Object.assign({inheritAttrs:!1},{__name:"UCheckbox",props:{as:{type:null,required:!1},label:{type:String,required:!1},description:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},indicator:{type:null,required:!1},highlight:{type:Boolean,required:!1},icon:{type:null,required:!1},indeterminateIcon:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},disabled:{type:Boolean,required:!1},required:{type:Boolean,required:!1},name:{type:String,required:!1},value:{type:null,required:!1},id:{type:String,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},trueValue:{type:null,required:!1},falseValue:{type:null,required:!1}},emits:["change","update:modelValue"],setup(o,{emit:h}){const r=o,l=re(),g=h,a=te("checkbox",r),s=se(),d=le(ie(a,"required","value","defaultValue","modelValue","trueValue","falseValue"),g),{id:p,emitFormChange:q,emitFormInput:u,size:z,color:F,highlight:k,name:S,disabled:V,ariaAttrs:t}=oe(r),y=p.value??ne(),I=T(),Q=m(()=>{const{"data-state":b,...w}=I;return w}),n=m(()=>ue({extend:Ve,...s.ui?.checkbox||{}})({size:z.value??a.size,color:F.value??a.color,variant:a.variant,indicator:a.indicator,highlight:k.value??a.highlight,required:a.required,disabled:V.value}));function X(b){const w=new Event("change",{target:{value:b}});g("change",w),q(),u()}return(b,w)=>(i(),f(e($),{as:!e(a).variant||e(a).variant==="list"?e(a).as:e(U),"data-slot":b.$attrs["data-slot"]??"root",class:c(n.value.root({class:[e(a).ui?.root,e(a).class]}))},{default:v(()=>[de("div",{"data-slot":"container",class:c(n.value.container({class:e(a).ui?.container}))},[R(e(ye),_({id:e(y)},{...e(d),...Q.value,...e(t)},{name:e(S),disabled:e(V),"data-slot":"base",class:n.value.base({class:e(a).ui?.base}),"onUpdate:modelValue":X}),{default:v(({state:Y})=>[R(e(ke),{"data-slot":"indicator",class:c(n.value.indicator({class:e(a).ui?.indicator}))},{default:v(()=>[Y==="indeterminate"?(i(),f(j,{key:0,name:e(a).indeterminateIcon||e(s).ui.icons.minus,"data-slot":"icon",class:c(n.value.icon({class:e(a).ui?.icon}))},null,8,["name","class"])):(i(),f(j,{key:1,name:e(a).icon||e(s).ui.icons.check,"data-slot":"icon",class:c(n.value.icon({class:e(a).ui?.icon}))},null,8,["name","class"]))]),_:2},1032,["class"])]),_:1},16,["id","name","disabled","class"])],2),e(a).label||l.label||e(a).description||l.description?(i(),B("div",{key:0,"data-slot":"wrapper",class:c(n.value.wrapper({class:e(a).ui?.wrapper}))},[e(a).label||l.label?(i(),f(D(!e(a).variant||e(a).variant==="list"?e(U):"p"),{key:0,for:e(y),"data-slot":"label",class:c(n.value.label({class:e(a).ui?.label}))},{default:v(()=>[C(b.$slots,"label",{label:e(a).label},()=>[N(M(e(a).label),1)])]),_:3},8,["for","class"])):x("",!0),e(a).description||l.description?(i(),B("p",{key:1,"data-slot":"description",class:c(n.value.description({class:e(a).ui?.description}))},[C(b.$slots,"description",{description:e(a).description},()=>[N(M(e(a).description),1)])],2)):x("",!0)],2)):x("",!0)]),_:3},8,["as","data-slot","class"]))}});export{Ie as _};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as ue,a as me}from"./
|
|
1
|
+
import{_ as ue,a as me}from"./BDcIWTTq.js";import{_ as de,a as pe}from"./CMB-NkFa.js";import{_ as fe}from"./3QTvYrZp.js";import{d as H,o as n,c as a,F as B,y as P,i,t as c,k as s,q as h,m as R,f as U,h as f,av as he,I as se,r as z,j as w,_ as Y,D as oe,l as X,s as ee,g as V,p as Q,K as ae,v as _e,e as xe}from"./BrT_Sys2.js";import{_ as ye}from"./COVRAesU.js";import{_ as ge}from"./BU6xjw05.js";import{_ as be}from"./sMFaPAAR.js";import{_ as ve}from"./Dz3Wbekz.js";import{_ as ke}from"./DpJrGwCr.js";import{e as $e}from"./D7P0ML0H.js";import{_ as we}from"./Wfk1m0ni.js";import{u as Ae}from"./DtXREpk_.js";import{u as je}from"./Dvc1aWpA.js";import"./z7PmsnBG.js";import"./26ll_vBr.js";const Ue=["get","post","put","patch","delete","head","options","trace"];function Oe(e){switch(e.toLowerCase()){case"get":return"success";case"post":return"info";case"put":case"patch":return"warning";case"delete":return"error";default:return"neutral"}}function Se(e,t){return`op-${e}-${t}`.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function qe(e){const t=new Map;for(const[r,o]of Object.entries(e?.paths??{})){if(!o)continue;const l=o.parameters??[];for(const m of Ue){const $=o[m];if(!$)continue;const p=$.tags?.[0]??"Other",g={path:r,method:m,operation:$,parameters:[...l,...$.parameters??[]],tag:p,anchor:Se(m,r)},b=t.get(p);b?b.push(g):t.set(p,[g])}}return[...t.entries()].map(([r,o])=>({tag:r,operations:o})).sort((r,o)=>r.tag.localeCompare(o.tag))}function re(e,t){return Array.isArray(e.security)?e.security.length>0:Array.isArray(t?.security)&&t.security.length>0}function Ce(e){return Array.isArray(e.security)&&e.security.length===0}function I(e,t){if(!e?.$ref)return e;const r=/^#\/components\/schemas\/(.+)$/.exec(e.$ref);return r?.[1]?t?.components?.schemas?.[r[1]]??e:e}const Be=["administrator","reporter","user"];function ne(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Re(e){const t=e["x-required-roles"];if(!t||t.length===0)return null;const r=Be.every(o=>t.includes(o));return{roles:t,label:r?"Any signed-in user":t.map(ne).join(" or "),shortLabel:r?"Any user":t.map(o=>o==="administrator"?"Admin":ne(o)).join(" / "),elevated:!r&&!t.includes("user")}}function te(e){if(!e)return"any";if(e.$ref)return e.$ref.split("/").pop()??"object";const t=Array.isArray(e.type)?e.type.join(" | "):e.type;if(t==="array"){const r=e.items;return`array<${r?te(r):"any"}>`}return!t&&e.properties||!t&&(e.oneOf||e.anyOf||e.allOf)?"object":t??"any"}const Te={class:"space-y-2"},Pe={class:"flex flex-wrap items-baseline gap-x-2 gap-y-0.5"},Ve={class:"font-mono text-primary"},Le={class:"text-xs text-muted font-mono"},ze={key:0,class:"text-xs text-dimmed font-mono"},Ie={key:1,class:"text-xs font-medium text-error"},Ne={key:0,class:"text-muted mt-0.5"},Ee={key:1,class:"text-xs text-dimmed mt-0.5"},Je={class:"font-mono"},Me=H({__name:"ApiSchema",props:{schema:{},spec:{default:null},depth:{default:0}},setup(e){const t=e,r=f(()=>I(t.schema,t.spec)??t.schema),o=f(()=>{const p=r.value.type==="array"?I(r.value.items,t.spec):r.value,g=p?.properties;if(!g)return[];const b=new Set(p?.required??[]);return Object.entries(g).map(([u,_])=>({name:u,required:b.has(u),schema:I(_,t.spec)??_}))}),l=f(()=>(t.depth??0)<6);function m(p){const g=p.type==="array"?I(p.items,t.spec):p;return!!(g?.properties&&Object.keys(g.properties).length>0)}function $(p){return(p.enum??[]).map(g=>JSON.stringify(g)).join(", ")}return(p,g)=>{const b=ie;return n(),a("div",Te,[(n(!0),a(B,null,P(s(o),u=>(n(),a("div",{key:u.name,class:"text-sm"},[i("div",Pe,[i("code",Ve,c(u.name),1),i("span",Le,c(("schemaTypeLabel"in p?p.schemaTypeLabel:s(te))(u.schema)),1),u.schema.format?(n(),a("span",ze,"("+c(u.schema.format)+")",1)):h("",!0),u.required?(n(),a("span",Ie,"required")):h("",!0)]),u.schema.description?(n(),a("p",Ne,c(u.schema.description),1)):h("",!0),u.schema.enum?.length?(n(),a("p",Ee,[g[0]||(g[0]=R(" Allowed values: ",-1)),i("span",Je,c($(u.schema)),1)])):h("",!0),s(l)&&m(u.schema)?(n(),U(b,{key:2,schema:u.schema,spec:e.spec,depth:(e.depth??0)+1,class:"mt-1.5 border-l border-default pl-3"},null,8,["schema","spec","depth"])):h("",!0)]))),128))])}}}),ie=Object.assign(Me,{__name:"ApiSchema"});function De(){return{token:he("piwi-api-token","")}}function He(e,t){return e.replace(/\{([^}]+)\}/g,(r,o)=>{const l=t[o];return l?encodeURIComponent(l):r})}function We(e){const t=new URLSearchParams;for(const[o,l]of Object.entries(e))l!==void 0&&l!==""&&t.append(o,l);const r=t.toString();return r?`?${r}`:""}function Z(e,t,r=0){const o=I(e,t);if(!o||r>6)return null;if(o.example!==void 0)return o.example;if(o.default!==void 0)return o.default;if(o.enum?.length)return o.enum[0];const l=Array.isArray(o.type)?o.type.find(m=>m!=="null"):o.type;if(l==="object"||!l&&o.properties){const m={};for(const[$,p]of Object.entries(o.properties??{}))m[$]=Z(p,t,r+1);return m}if(l==="array")return[Z(o.items,t,r+1)];switch(l){case"string":return o.format==="date-time"?"2024-01-01T00:00:00Z":o.format==="date"?"2024-01-01":o.format==="uuid"?"00000000-0000-0000-0000-000000000000":"string";case"integer":case"number":return 0;case"boolean":return!1;default:return null}}function Fe(e,t){const r=e.requestBody?.content?.["application/json"]?.schema;return r?JSON.stringify(Z(r,t),null,2):null}function Qe(e){return!!e.requestBody?.content?.["application/json"]}function K(e){return`'${e.replace(/'/g,"'\\''")}'`}function Ge({method:e,url:t,headers:r,body:o}){const l=["curl"];e.toUpperCase()!=="GET"&&l.push("-X",e.toUpperCase());for(const[m,$]of Object.entries(r))l.push("-H",K(`${m}: ${$}`));return o&&l.push("-d",K(o)),l.push(K(t)),l.join(" ")}function Ke({method:e,url:t,headers:r,body:o}){const l=[` method: ${JSON.stringify(e.toUpperCase())},`];return Object.keys(r).length&&l.push(` headers: ${JSON.stringify(r)},`),o&&l.push(` body: ${JSON.stringify(o)},`),`const res = await fetch(${JSON.stringify(t)}, {
|
|
2
2
|
${l.join(`
|
|
3
3
|
`)}
|
|
4
4
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a0 as $,a1 as j,a3 as z,am as y,aT as S,r as V,aN as w,aU as B,B as P,o,f as C,g as b,i as q,p as s,k as t,c as u,j as N,T as n,m as c,t as m,q as f,V as F,h,a6 as D,J as g,c1 as K,c2 as O}from"./
|
|
1
|
+
import{a0 as $,a1 as j,a3 as z,am as y,aT as S,r as V,aN as w,aU as B,B as P,o,f as C,g as b,i as q,p as s,k as t,c as u,j as N,T as n,m as c,t as m,q as f,V as F,h,a6 as D,J as g,c1 as K,c2 as O}from"./BrT_Sys2.js";import{L as W}from"./rw7Hdll3.js";const E={slots:{root:"",wrapper:"",labelWrapper:"flex content-center items-center justify-between gap-1",label:"block font-medium text-default",container:"relative",description:"text-muted",error:"mt-2 text-error",hint:"text-muted",help:"mt-2 text-muted"},variants:{size:{xs:{root:"text-xs"},sm:{root:"text-xs"},md:{root:"text-sm"},lg:{root:"text-sm"},xl:{root:"text-base"}},required:{true:{label:"after:content-['*'] after:ms-0.5 after:text-error"}},orientation:{vertical:{container:"mt-1"},horizontal:{root:"flex justify-between place-items-baseline gap-2"}}},defaultVariants:{size:"md"}},T=["id"],L=["id"],U=["id"],A=["id"],M={__name:"UFormField",props:{as:{type:null,required:!1},name:{type:String,required:!1},errorPattern:{type:null,required:!1},label:{type:String,required:!1},description:{type:String,required:!1},help:{type:String,required:!1},error:{type:[Boolean,String],required:!1,default:void 0},hint:{type:String,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},eagerValidation:{type:Boolean,required:!1},validateOnInputDelay:{type:Number,required:!1},orientation:{type:null,required:!1,default:"vertical"},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(x){const _=x,l=$(),e=j("formField",_),I=z(),a=h(()=>D({extend:E,...I.ui?.formField||{}})({size:e.size,required:e.required,orientation:e.orientation})),k=y(S,null),i=h(()=>e.error||k?.value?.find(r=>r.name===e.name||e.errorPattern&&r.name?.match(e.errorPattern))?.message),d=V(w()),p=d.value,v=y(B,void 0);return P(d,()=>{v&&e.name&&(v.value[e.name]={id:d.value,pattern:e.errorPattern})},{immediate:!0}),g(K,d),g(O,h(()=>({error:i.value,name:e.name,size:e.size,eagerValidation:e.eagerValidation,validateOnInputDelay:e.validateOnInputDelay,errorPattern:e.errorPattern,hint:e.hint,description:e.description,help:e.help,ariaId:p}))),(r,J)=>(o(),C(t(F),{as:t(e).as,"data-orientation":t(e).orientation,"data-slot":"root",class:s(a.value.root({class:[t(e).ui?.root,t(e).class]}))},{default:b(()=>[q("div",{"data-slot":"wrapper",class:s(a.value.wrapper({class:t(e).ui?.wrapper}))},[t(e).label||l.label?(o(),u("div",{key:0,"data-slot":"labelWrapper",class:s(a.value.labelWrapper({class:t(e).ui?.labelWrapper}))},[N(t(W),{for:d.value,"data-slot":"label",class:s(a.value.label({class:t(e).ui?.label}))},{default:b(()=>[n(r.$slots,"label",{label:t(e).label},()=>[c(m(t(e).label),1)])]),_:3},8,["for","class"]),t(e).hint||l.hint?(o(),u("span",{key:0,id:`${t(p)}-hint`,"data-slot":"hint",class:s(a.value.hint({class:t(e).ui?.hint}))},[n(r.$slots,"hint",{hint:t(e).hint},()=>[c(m(t(e).hint),1)])],10,T)):f("",!0)],2)):f("",!0),t(e).description||l.description?(o(),u("p",{key:1,id:`${t(p)}-description`,"data-slot":"description",class:s(a.value.description({class:t(e).ui?.description}))},[n(r.$slots,"description",{description:t(e).description},()=>[c(m(t(e).description),1)])],10,L)):f("",!0)],2),q("div",{class:s([(t(e).label||!!l.label||t(e).description||!!l.description)&&a.value.container({class:t(e).ui?.container})])},[n(r.$slots,"default",{error:i.value}),t(e).error!==!1&&(typeof i.value=="string"&&i.value||l.error)?(o(),u("div",{key:0,id:`${t(p)}-error`,"data-slot":"error",class:s(a.value.error({class:t(e).ui?.error}))},[n(r.$slots,"error",{error:i.value},()=>[c(m(i.value),1)])],10,U)):t(e).help||l.help?(o(),u("div",{key:1,id:`${t(p)}-help`,"data-slot":"help",class:s(a.value.help({class:t(e).ui?.help}))},[n(r.$slots,"help",{help:t(e).help},()=>[c(m(t(e).help),1)])],10,A)):f("",!0)],2)]),_:3},8,["as","data-orientation","class"]))}};export{M as _};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a0 as m,a1 as y,a3 as g,o as i,f as h,g as b,k as t,c as l,p as o,T as d,m as u,t as c,q as n,V as k,h as x,a6 as q}from"./
|
|
1
|
+
import{a0 as m,a1 as y,a3 as g,o as i,f as h,g as b,k as t,c as l,p as o,T as d,m as u,t as c,q as n,V as k,h as x,a6 as q}from"./BrT_Sys2.js";const C={slots:{root:"rounded-lg overflow-hidden",header:"p-4 sm:px-6",title:"text-highlighted font-semibold",description:"mt-1 text-muted text-sm",body:"p-4 sm:p-6",footer:"p-4 sm:px-6"},variants:{variant:{solid:{root:"bg-inverted text-inverted",title:"text-inverted",description:"text-dimmed"},outline:{root:"bg-default ring ring-default divide-y divide-default"},soft:{root:"bg-elevated/50 divide-y divide-default"},subtle:{root:"bg-elevated/50 ring ring-default divide-y divide-default"}}},defaultVariants:{variant:"outline"}},V={__name:"UCard",props:{as:{type:null,required:!1},title:{type:String,required:!1},description:{type:String,required:!1},variant:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(p){const f=p,s=m(),e=y("card",f),v=g(),a=x(()=>q({extend:C,...v.ui?.card||{}})({variant:e.variant}));return(r,S)=>(i(),h(t(k),{as:t(e).as,"data-slot":"root",class:o(a.value.root({class:[t(e).ui?.root,t(e).class]}))},{default:b(()=>[s.header||t(e).title||s.title||t(e).description||s.description?(i(),l("div",{key:0,"data-slot":"header",class:o(a.value.header({class:t(e).ui?.header}))},[d(r.$slots,"header",{},()=>[t(e).title||s.title?(i(),l("div",{key:0,"data-slot":"title",class:o(a.value.title({class:t(e).ui?.title}))},[d(r.$slots,"title",{},()=>[u(c(t(e).title),1)])],2)):n("",!0),t(e).description||s.description?(i(),l("div",{key:1,"data-slot":"description",class:o(a.value.description({class:t(e).ui?.description}))},[d(r.$slots,"description",{},()=>[u(c(t(e).description),1)])],2)):n("",!0)])],2)):n("",!0),s.default?(i(),l("div",{key:1,"data-slot":"body",class:o(a.value.body({class:t(e).ui?.body}))},[d(r.$slots,"default")],2)):n("",!0),s.footer?(i(),l("div",{key:2,"data-slot":"footer",class:o(a.value.footer({class:t(e).ui?.footer}))},[d(r.$slots,"footer")],2)):n("",!0)]),_:3},8,["as","class"]))}};export{V as _};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as $,a as y}from"./BDcIWTTq.js";import{_ as k,a as C}from"./CMB-NkFa.js";import{u as B,_ as D}from"./CbuWynGG.js";import{a1 as M,a3 as S,o as f,f as d,g as i,T as c,i as p,p as u,k as s,V as U,h as _,a6 as N,C as P,r as T,d as j,e as q,j as o,aH as H}from"./BrT_Sys2.js";import"./z7PmsnBG.js";import"./vzXhOO8R.js";import"./DTH2lteW.js";import"./D_TbJDHY.js";import"./r3SBLxtE.js";import"./DUe6xuKQ.js";const V={slots:{root:"shrink-0 flex items-center justify-between border-b border-default px-4 sm:px-6 gap-1.5 overflow-x-auto min-h-[49px]",left:"flex items-center gap-1.5",right:"flex items-center gap-1.5"}},z={__name:"UDashboardToolbar",props:{as:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(t){const a=M("dashboardToolbar",t),e=S(),l=_(()=>N({extend:V,...e.ui?.dashboardToolbar||{}})());return(r,m)=>(f(),d(s(U),{as:s(a).as,"data-slot":"root",class:u(l.value.root({class:[s(a).ui?.root,s(a).class]}))},{default:i(()=>[c(r.$slots,"default",{},()=>[p("div",{"data-slot":"left",class:u(l.value.left({class:[s(a).ui?.left]}))},[c(r.$slots,"left")],2),p("div",{"data-slot":"right",class:u(l.value.right({class:[s(a).ui?.right]}))},[c(r.$slots,"right")],2)])]),_:3},8,["as","class"]))}};function A(){const t=T({account:!1,users:!1,notifications:!1,tags:!1,storage:!1,"wasted-time":!1,"timeout-hygiene":!1,ai:!1,about:!1});async function n(){const a=[];a.push($fetch("/api/settings/ai").then(e=>{t.value.ai=!!e.envManaged}).catch(()=>{})),a.push($fetch("/api/settings/wasted-waits").then(e=>{t.value["wasted-time"]=!!e.envManaged}).catch(()=>{})),a.push($fetch("/api/settings/smtp").then(e=>{t.value.notifications=!!(e.envManaged&&e.configured)}).catch(()=>{})),await Promise.all(a)}return P(()=>{n()}),{envManaged:t,refresh:n}}const E={class:"flex flex-col gap-4 sm:gap-6 lg:gap-12 w-full lg:max-w-4xl mx-auto"},X=j({__name:"settings",setup(t){q({title:"Settings — Piwi Dashboard"});const{envManaged:n}=A(),a=B(n),e=_(()=>[a.value,[{label:"Documentation",icon:"i-lucide-book-open",to:"https://github.com/piwitests/platform",target:"_blank"}]]);return(l,r)=>{const m=$,g=y,h=C,b=D,v=z,x=H,w=k;return f(),d(w,{id:"settings",ui:{body:"lg:py-12"}},{header:i(()=>[o(h,null,{leading:i(()=>[o(m),o(g,{items:[{label:"Home",icon:"i-lucide-house",to:"/"},{label:"Settings"}]})]),_:1}),o(v,null,{default:i(()=>[o(b,{items:s(e),highlight:"",class:"-mx-1 flex-1",ui:{list:"overflow-x-auto",root:"min-w-0"}},null,8,["items"])]),_:1})]),body:i(()=>[p("div",E,[o(x)])]),_:1})}}});export{X as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as S,W as L,ax as O,S as C,X as N,ay as D,o as c,f as y,g,T as h,k as a,V as I,r as q,az as j,Y as E,C as U,ad as W,j as w,O as G,q as k,aA as Q,h as _,B as X,aB as Y,aC as J,U as T,aD as Z,aE as aa,Q as ta,H as ea,a0 as ia,a1 as sa,a3 as oa,a4 as la,a5 as ra,p as x,c as B,F as $,y as M,aF as z,v as na,aG as da,m as R,t as K,s as ua,a6 as ca}from"./BPKwYP2Q.js";import{R as va}from"./C38aZbFJ.js";const[V,fa]=E("TabsRoot");var ga=S({__name:"TabsRoot",props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:"automatic"},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(d,{emit:r}){const u=d,i=r,{orientation:v,unmountOnHide:n,dir:t}=L(u),o=O(t);C();const s=N(u,"modelValue",i,{defaultValue:u.defaultValue,passive:u.modelValue===void 0}),l=q(),p=j(new Set);return fa({modelValue:s,changeModelValue:b=>{s.value=b},orientation:v,dir:o,unmountOnHide:n,activationMode:u.activationMode,baseId:D(void 0,"reka-tabs"),tabsList:l,contentIds:p,registerContent:b=>{p.value=new Set([...p.value,b])},unregisterContent:b=>{const f=new Set(p.value);f.delete(b),p.value=f}}),(b,f)=>(c(),y(a(I),{dir:a(o),"data-orientation":a(v),"as-child":b.asChild,as:b.as},{default:g(()=>[h(b.$slots,"default",{modelValue:a(s)})]),_:3},8,["dir","data-orientation","as-child","as"]))}}),pa=ga;function F(d,r){return`${d}-trigger-${r}`}function P(d,r){return`${d}-content-${r}`}var ba=S({__name:"TabsContent",props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(d){const r=d,{forwardRef:u}=C(),i=V(),v=_(()=>F(i.baseId,r.value)),n=_(()=>P(i.baseId,r.value)),t=_(()=>r.value===i.modelValue.value),o=q(t.value);return U(()=>{i.registerContent(r.value),requestAnimationFrame(()=>{o.value=!1})}),W(()=>{i.unregisterContent(r.value)}),(s,l)=>(c(),y(a(Q),{present:s.forceMount||t.value,"force-mount":""},{default:g(({present:p})=>[w(a(I),{id:n.value,ref:a(u),"as-child":s.asChild,as:s.as,role:"tabpanel","data-state":t.value?"active":"inactive","data-orientation":a(i).orientation.value,"aria-labelledby":v.value,hidden:!p,tabindex:"0",style:G({animationDuration:o.value?"0s":void 0})},{default:g(()=>[!a(i).unmountOnHide.value||p?h(s.$slots,"default",{key:0}):k("v-if",!0)]),_:2},1032,["id","as-child","as","data-state","data-orientation","aria-labelledby","hidden","style"])]),_:3},8,["present"]))}}),ya=ba,ha=S({__name:"TabsIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(d,{expose:r}){const u=d,i=V();r({updateIndicatorStyle:o}),C();const v=Z(),n=q({size:null,thickness:null,position:null}),t=q([]);X(()=>[i.modelValue.value,i?.dir.value],()=>{o()},{immediate:!0,flush:"post"}),Y(()=>{t.value=Array.from(i.tabsList.value?.querySelectorAll('[role="tab"]')||[])}),J(_(()=>[i.tabsList.value,...t.value]),o);function o(){const s=i.tabsList.value?.querySelector('[role="tab"][data-state="active"]');s&&(i.orientation.value==="horizontal"?n.value={size:s.offsetWidth,thickness:s.offsetHeight,position:s.offsetLeft}:n.value={size:s.offsetHeight,thickness:s.offsetWidth,position:s.offsetTop})}return(s,l)=>a(v)&&typeof n.value.size=="number"?(c(),y(a(I),T({key:0},u,{style:{"--reka-tabs-indicator-size":`${n.value.size}px`,"--reka-tabs-indicator-thickness":`${n.value.thickness}px`,"--reka-tabs-indicator-position":`${n.value.position}px`}}),{default:g(()=>[h(s.$slots,"default")]),_:3},16,["style"])):k("v-if",!0)}}),ma=ha,_a=S({__name:"TabsList",props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(d){const r=d,{loop:u}=L(r),{forwardRef:i,currentElement:v}=C(),n=V();return n.tabsList=v,(t,o)=>(c(),y(a(aa),{"as-child":"",orientation:a(n).orientation.value,dir:a(n).dir.value,loop:a(u)},{default:g(()=>[w(a(I),{ref:a(i),role:"tablist","as-child":t.asChild,as:t.as,"aria-orientation":a(n).orientation.value},{default:g(()=>[h(t.$slots,"default")]),_:3},8,["as-child","as","aria-orientation"])]),_:3},8,["orientation","dir","loop"]))}}),xa=_a,za=S({__name:"TabsTrigger",props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(d){const r=d,{forwardRef:u}=C(),i=V(),v=_(()=>F(i.baseId,r.value)),n=_(()=>i.contentIds.value.has(r.value)?P(i.baseId,r.value):void 0),t=_(()=>r.value===i.modelValue.value);return(o,s)=>(c(),y(a(va),{"as-child":"",focusable:!o.disabled,active:t.value},{default:g(()=>[w(a(I),{id:v.value,ref:a(u),role:"tab",type:o.as==="button"?"button":void 0,as:o.as,"as-child":o.asChild,"aria-selected":t.value?"true":"false","aria-controls":n.value,"data-state":t.value?"active":"inactive",disabled:o.disabled,"data-disabled":o.disabled?"":void 0,"data-orientation":a(i).orientation.value,onMousedown:s[0]||(s[0]=ea(l=>{!o.disabled&&l.ctrlKey===!1?a(i).changeModelValue(o.value):l.preventDefault()},["left"])),onKeydown:s[1]||(s[1]=ta(l=>a(i).changeModelValue(o.value),["enter","space"])),onFocus:s[2]||(s[2]=()=>{const l=a(i).activationMode!=="manual";!t.value&&!o.disabled&&l&&a(i).changeModelValue(o.value)})},{default:g(()=>[h(o.$slots,"default")]),_:3},8,["id","type","as","as-child","aria-selected","aria-controls","data-state","disabled","data-disabled","data-orientation"])]),_:3},8,["focusable","active"]))}}),ka=za;const qa={slots:{root:"flex items-center gap-2",list:"relative flex p-1 group",indicator:"absolute transition-[translate,width] duration-200",trigger:["group relative inline-flex items-center min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leadingIcon:"shrink-0",leadingAvatar:"shrink-0",leadingAvatarSize:"",label:"truncate",trailingBadge:"shrink-0",trailingBadgeSize:"sm",content:"w-full rounded-md focus-visible:outline-3"},variants:{color:{primary:{content:"outline-primary/25"},secondary:{content:"outline-secondary/25"},success:{content:"outline-success/25"},info:{content:"outline-info/25"},warning:{content:"outline-warning/25"},error:{content:"outline-error/25"},neutral:{content:"outline-inverted/25"}},variant:{pill:{list:"bg-elevated rounded-lg",trigger:["grow","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:inset-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:rounded-md in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:shadow-xs in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:-z-10 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:isolate"],indicator:"rounded-md shadow-xs"},link:{list:"border-default",indicator:"rounded-full",trigger:"in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:rounded-full"}},orientation:{horizontal:{root:"flex-col",list:"w-full",indicator:"left-0 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position)",trigger:"justify-center"},vertical:{list:"flex-col",indicator:"top-0 h-(--reka-tabs-indicator-size) translate-y-(--reka-tabs-indicator-position)"}},size:{xs:{trigger:"px-2 py-1 text-xs gap-1",leadingIcon:"size-4",leadingAvatarSize:"3xs"},sm:{trigger:"px-2.5 py-1.5 text-xs gap-1.5",leadingIcon:"size-4",leadingAvatarSize:"3xs"},md:{trigger:"px-3 py-1.5 text-sm gap-1.5",leadingIcon:"size-5",leadingAvatarSize:"2xs"},lg:{trigger:"px-3 py-2 text-sm gap-2",leadingIcon:"size-5",leadingAvatarSize:"2xs"},xl:{trigger:"px-3 py-2 text-base gap-2",leadingIcon:"size-6",leadingAvatarSize:"xs"}}},compoundVariants:[{orientation:"horizontal",variant:"pill",class:{indicator:"inset-y-1"}},{orientation:"horizontal",variant:"link",class:{list:"border-b -mb-px",indicator:"-bottom-px h-px",trigger:"in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-x-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-bottom-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:h-px"}},{orientation:"vertical",variant:"pill",class:{indicator:"inset-x-1",list:"items-center",trigger:"w-full justify-center"}},{orientation:"vertical",variant:"link",class:{list:"border-s -ms-px",indicator:"-start-px w-px",trigger:"in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-y-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-start-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:w-px"}},{color:"primary",variant:"pill",class:{indicator:"bg-primary",trigger:["data-[state=active]:text-inverted outline-primary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-primary"]}},{color:"secondary",variant:"pill",class:{indicator:"bg-secondary",trigger:["data-[state=active]:text-inverted outline-secondary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-secondary"]}},{color:"success",variant:"pill",class:{indicator:"bg-success",trigger:["data-[state=active]:text-inverted outline-success/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-success"]}},{color:"info",variant:"pill",class:{indicator:"bg-info",trigger:["data-[state=active]:text-inverted outline-info/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-info"]}},{color:"warning",variant:"pill",class:{indicator:"bg-warning",trigger:["data-[state=active]:text-inverted outline-warning/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-warning"]}},{color:"error",variant:"pill",class:{indicator:"bg-error",trigger:["data-[state=active]:text-inverted outline-error/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-error"]}},{color:"neutral",variant:"pill",class:{indicator:"bg-inverted",trigger:["data-[state=active]:text-inverted outline-inverted/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-inverted"]}},{color:"primary",variant:"link",class:{indicator:"bg-primary",trigger:["data-[state=active]:text-primary outline-primary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-primary"]}},{color:"secondary",variant:"link",class:{indicator:"bg-secondary",trigger:["data-[state=active]:text-secondary outline-secondary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-secondary"]}},{color:"success",variant:"link",class:{indicator:"bg-success",trigger:["data-[state=active]:text-success outline-success/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-success"]}},{color:"info",variant:"link",class:{indicator:"bg-info",trigger:["data-[state=active]:text-info outline-info/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-info"]}},{color:"warning",variant:"link",class:{indicator:"bg-warning",trigger:["data-[state=active]:text-warning outline-warning/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-warning"]}},{color:"error",variant:"link",class:{indicator:"bg-error",trigger:["data-[state=active]:text-error outline-error/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-error"]}},{color:"neutral",variant:"link",class:{indicator:"bg-inverted",trigger:["data-[state=active]:text-highlighted outline-inverted/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-inverted"]}}],defaultVariants:{color:"primary",variant:"pill",size:"md"}},Ca={__name:"UTabs",props:{as:{type:null,required:!1},items:{type:Array,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},orientation:{type:null,required:!1,default:"horizontal"},content:{type:Boolean,required:!1,default:!0},valueKey:{type:null,required:!1,default:"value"},labelKey:{type:null,required:!1,default:"label"},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultValue:{type:[String,Number],required:!1,default:"0"},modelValue:{type:[String,Number],required:!1},activationMode:{type:String,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:["update:modelValue"],setup(d,{expose:r,emit:u}){const i=d,v=u,n=ia(),t=sa("tabs",i),o=oa(),s=la(ra(t,"as","unmountOnHide"),v),l=_(()=>ca({extend:qa,...o.ui?.tabs||{}})({color:t.color,variant:t.variant,size:t.size,orientation:t.orientation})),p=q([]);function b(f,A){p.value[f]=A}return r({triggersRef:p}),(f,A)=>(c(),y(a(pa),T(a(s),{"model-value":a(t).modelValue,"default-value":a(t).defaultValue,orientation:a(t).orientation,"activation-mode":a(t).activationMode,"data-slot":"root",class:l.value.root({class:[a(t).ui?.root,a(t).class]})}),{default:g(()=>[w(a(xa),{"data-slot":"list",class:x(l.value.list({class:a(t).ui?.list}))},{default:g(()=>[w(a(ma),{"data-slot":"indicator",class:x(l.value.indicator({class:a(t).ui?.indicator}))},null,8,["class"]),h(f.$slots,"list-leading"),(c(!0),B($,null,M(a(t).items,(e,m)=>(c(),y(a(ka),{key:a(z)(e,a(t).valueKey)??m,ref_for:!0,ref:H=>b(m,H),value:a(z)(e,a(t).valueKey)??String(m),disabled:e.disabled,"data-slot":"trigger",class:x(l.value.trigger({class:[a(t).ui?.trigger,e.ui?.trigger]}))},{default:g(()=>[h(f.$slots,"leading",{item:e,index:m,ui:l.value},()=>[e.icon?(c(),y(na,{key:0,name:e.icon,"data-slot":"leadingIcon",class:x(l.value.leadingIcon({class:[a(t).ui?.leadingIcon,e.ui?.leadingIcon]}))},null,8,["name","class"])):e.avatar?(c(),y(da,T({key:1,size:e.ui?.leadingAvatarSize||a(t).ui?.leadingAvatarSize||l.value.leadingAvatarSize()},{ref_for:!0},e.avatar,{"data-slot":"leadingAvatar",class:l.value.leadingAvatar({class:[a(t).ui?.leadingAvatar,e.ui?.leadingAvatar]})}),null,16,["size","class"])):k("",!0)]),a(z)(e,a(t).labelKey)||n.default?(c(),B("span",{key:0,"data-slot":"label",class:x(l.value.label({class:[a(t).ui?.label,e.ui?.label]}))},[h(f.$slots,"default",{item:e,index:m},()=>[R(K(a(z)(e,a(t).labelKey)),1)])],2)):k("",!0),h(f.$slots,"trailing",{item:e,index:m,ui:l.value},()=>[e.badge||e.badge===0?(c(),y(ua,T({key:0,color:"neutral",variant:"outline",size:e.ui?.trailingBadgeSize||a(t).ui?.trailingBadgeSize||l.value.trailingBadgeSize()},{ref_for:!0},typeof e.badge=="string"||typeof e.badge=="number"?{label:e.badge}:e.badge,{"data-slot":"trailingBadge",class:l.value.trailingBadge({class:[a(t).ui?.trailingBadge,e.ui?.trailingBadge]})}),null,16,["size","class"])):k("",!0)])]),_:2},1032,["value","disabled","class"]))),128)),h(f.$slots,"list-trailing")]),_:3},8,["class"]),a(t).content?(c(!0),B($,{key:0},M(a(t).items,(e,m)=>(c(),y(a(ya),{key:a(z)(e,a(t).valueKey)??m,value:a(z)(e,a(t).valueKey)??String(m),"data-slot":"content",class:x(l.value.content({class:[a(t).ui?.content,e.ui?.content,e.class]}))},{default:g(()=>[h(f.$slots,e.slot||"content",{item:e,index:m,ui:l.value},()=>[R(K(e.content),1)])]),_:2},1032,["value","class"]))),128)):k("",!0)]),_:3},16,["model-value","default-value","orientation","activation-mode","class"]))}};export{Ca as _};
|
|
1
|
+
import{d as S,W as L,ax as O,S as C,X as N,ay as D,o as c,f as y,g,T as h,k as a,V as I,r as q,az as j,Y as E,C as U,ad as W,j as w,O as G,q as k,aA as Q,h as _,B as X,aB as Y,aC as J,U as T,aD as Z,aE as aa,Q as ta,H as ea,a0 as ia,a1 as sa,a3 as oa,a4 as la,a5 as ra,p as x,c as B,F as $,y as M,aF as z,v as na,aG as da,m as R,t as K,s as ua,a6 as ca}from"./BrT_Sys2.js";import{R as va}from"./D0-HTQTD.js";const[V,fa]=E("TabsRoot");var ga=S({__name:"TabsRoot",props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:"automatic"},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(d,{emit:r}){const u=d,i=r,{orientation:v,unmountOnHide:n,dir:t}=L(u),o=O(t);C();const s=N(u,"modelValue",i,{defaultValue:u.defaultValue,passive:u.modelValue===void 0}),l=q(),p=j(new Set);return fa({modelValue:s,changeModelValue:b=>{s.value=b},orientation:v,dir:o,unmountOnHide:n,activationMode:u.activationMode,baseId:D(void 0,"reka-tabs"),tabsList:l,contentIds:p,registerContent:b=>{p.value=new Set([...p.value,b])},unregisterContent:b=>{const f=new Set(p.value);f.delete(b),p.value=f}}),(b,f)=>(c(),y(a(I),{dir:a(o),"data-orientation":a(v),"as-child":b.asChild,as:b.as},{default:g(()=>[h(b.$slots,"default",{modelValue:a(s)})]),_:3},8,["dir","data-orientation","as-child","as"]))}}),pa=ga;function F(d,r){return`${d}-trigger-${r}`}function P(d,r){return`${d}-content-${r}`}var ba=S({__name:"TabsContent",props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(d){const r=d,{forwardRef:u}=C(),i=V(),v=_(()=>F(i.baseId,r.value)),n=_(()=>P(i.baseId,r.value)),t=_(()=>r.value===i.modelValue.value),o=q(t.value);return U(()=>{i.registerContent(r.value),requestAnimationFrame(()=>{o.value=!1})}),W(()=>{i.unregisterContent(r.value)}),(s,l)=>(c(),y(a(Q),{present:s.forceMount||t.value,"force-mount":""},{default:g(({present:p})=>[w(a(I),{id:n.value,ref:a(u),"as-child":s.asChild,as:s.as,role:"tabpanel","data-state":t.value?"active":"inactive","data-orientation":a(i).orientation.value,"aria-labelledby":v.value,hidden:!p,tabindex:"0",style:G({animationDuration:o.value?"0s":void 0})},{default:g(()=>[!a(i).unmountOnHide.value||p?h(s.$slots,"default",{key:0}):k("v-if",!0)]),_:2},1032,["id","as-child","as","data-state","data-orientation","aria-labelledby","hidden","style"])]),_:3},8,["present"]))}}),ya=ba,ha=S({__name:"TabsIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(d,{expose:r}){const u=d,i=V();r({updateIndicatorStyle:o}),C();const v=Z(),n=q({size:null,thickness:null,position:null}),t=q([]);X(()=>[i.modelValue.value,i?.dir.value],()=>{o()},{immediate:!0,flush:"post"}),Y(()=>{t.value=Array.from(i.tabsList.value?.querySelectorAll('[role="tab"]')||[])}),J(_(()=>[i.tabsList.value,...t.value]),o);function o(){const s=i.tabsList.value?.querySelector('[role="tab"][data-state="active"]');s&&(i.orientation.value==="horizontal"?n.value={size:s.offsetWidth,thickness:s.offsetHeight,position:s.offsetLeft}:n.value={size:s.offsetHeight,thickness:s.offsetWidth,position:s.offsetTop})}return(s,l)=>a(v)&&typeof n.value.size=="number"?(c(),y(a(I),T({key:0},u,{style:{"--reka-tabs-indicator-size":`${n.value.size}px`,"--reka-tabs-indicator-thickness":`${n.value.thickness}px`,"--reka-tabs-indicator-position":`${n.value.position}px`}}),{default:g(()=>[h(s.$slots,"default")]),_:3},16,["style"])):k("v-if",!0)}}),ma=ha,_a=S({__name:"TabsList",props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(d){const r=d,{loop:u}=L(r),{forwardRef:i,currentElement:v}=C(),n=V();return n.tabsList=v,(t,o)=>(c(),y(a(aa),{"as-child":"",orientation:a(n).orientation.value,dir:a(n).dir.value,loop:a(u)},{default:g(()=>[w(a(I),{ref:a(i),role:"tablist","as-child":t.asChild,as:t.as,"aria-orientation":a(n).orientation.value},{default:g(()=>[h(t.$slots,"default")]),_:3},8,["as-child","as","aria-orientation"])]),_:3},8,["orientation","dir","loop"]))}}),xa=_a,za=S({__name:"TabsTrigger",props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(d){const r=d,{forwardRef:u}=C(),i=V(),v=_(()=>F(i.baseId,r.value)),n=_(()=>i.contentIds.value.has(r.value)?P(i.baseId,r.value):void 0),t=_(()=>r.value===i.modelValue.value);return(o,s)=>(c(),y(a(va),{"as-child":"",focusable:!o.disabled,active:t.value},{default:g(()=>[w(a(I),{id:v.value,ref:a(u),role:"tab",type:o.as==="button"?"button":void 0,as:o.as,"as-child":o.asChild,"aria-selected":t.value?"true":"false","aria-controls":n.value,"data-state":t.value?"active":"inactive",disabled:o.disabled,"data-disabled":o.disabled?"":void 0,"data-orientation":a(i).orientation.value,onMousedown:s[0]||(s[0]=ea(l=>{!o.disabled&&l.ctrlKey===!1?a(i).changeModelValue(o.value):l.preventDefault()},["left"])),onKeydown:s[1]||(s[1]=ta(l=>a(i).changeModelValue(o.value),["enter","space"])),onFocus:s[2]||(s[2]=()=>{const l=a(i).activationMode!=="manual";!t.value&&!o.disabled&&l&&a(i).changeModelValue(o.value)})},{default:g(()=>[h(o.$slots,"default")]),_:3},8,["id","type","as","as-child","aria-selected","aria-controls","data-state","disabled","data-disabled","data-orientation"])]),_:3},8,["focusable","active"]))}}),ka=za;const qa={slots:{root:"flex items-center gap-2",list:"relative flex p-1 group",indicator:"absolute transition-[translate,width] duration-200",trigger:["group relative inline-flex items-center min-w-0 data-[state=inactive]:text-muted hover:data-[state=inactive]:not-disabled:text-default font-medium rounded-md disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leadingIcon:"shrink-0",leadingAvatar:"shrink-0",leadingAvatarSize:"",label:"truncate",trailingBadge:"shrink-0",trailingBadgeSize:"sm",content:"w-full rounded-md focus-visible:outline-3"},variants:{color:{primary:{content:"outline-primary/25"},secondary:{content:"outline-secondary/25"},success:{content:"outline-success/25"},info:{content:"outline-info/25"},warning:{content:"outline-warning/25"},error:{content:"outline-error/25"},neutral:{content:"outline-inverted/25"}},variant:{pill:{list:"bg-elevated rounded-lg",trigger:["grow","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:inset-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:rounded-md in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:shadow-xs in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:-z-10 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:isolate"],indicator:"rounded-md shadow-xs"},link:{list:"border-default",indicator:"rounded-full",trigger:"in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:content-[''] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:absolute in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:rounded-full"}},orientation:{horizontal:{root:"flex-col",list:"w-full",indicator:"left-0 w-(--reka-tabs-indicator-size) translate-x-(--reka-tabs-indicator-position)",trigger:"justify-center"},vertical:{list:"flex-col",indicator:"top-0 h-(--reka-tabs-indicator-size) translate-y-(--reka-tabs-indicator-position)"}},size:{xs:{trigger:"px-2 py-1 text-xs gap-1",leadingIcon:"size-4",leadingAvatarSize:"3xs"},sm:{trigger:"px-2.5 py-1.5 text-xs gap-1.5",leadingIcon:"size-4",leadingAvatarSize:"3xs"},md:{trigger:"px-3 py-1.5 text-sm gap-1.5",leadingIcon:"size-5",leadingAvatarSize:"2xs"},lg:{trigger:"px-3 py-2 text-sm gap-2",leadingIcon:"size-5",leadingAvatarSize:"2xs"},xl:{trigger:"px-3 py-2 text-base gap-2",leadingIcon:"size-6",leadingAvatarSize:"xs"}}},compoundVariants:[{orientation:"horizontal",variant:"pill",class:{indicator:"inset-y-1"}},{orientation:"horizontal",variant:"link",class:{list:"border-b -mb-px",indicator:"-bottom-px h-px",trigger:"in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-x-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-bottom-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:h-px"}},{orientation:"vertical",variant:"pill",class:{indicator:"inset-x-1",list:"items-center",trigger:"w-full justify-center"}},{orientation:"vertical",variant:"link",class:{list:"border-s -ms-px",indicator:"-start-px w-px",trigger:"in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:inset-y-0 in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:-start-[calc(var(--spacing)+1px)] in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:w-px"}},{color:"primary",variant:"pill",class:{indicator:"bg-primary",trigger:["data-[state=active]:text-inverted outline-primary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-primary"]}},{color:"secondary",variant:"pill",class:{indicator:"bg-secondary",trigger:["data-[state=active]:text-inverted outline-secondary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-secondary"]}},{color:"success",variant:"pill",class:{indicator:"bg-success",trigger:["data-[state=active]:text-inverted outline-success/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-success"]}},{color:"info",variant:"pill",class:{indicator:"bg-info",trigger:["data-[state=active]:text-inverted outline-info/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-info"]}},{color:"warning",variant:"pill",class:{indicator:"bg-warning",trigger:["data-[state=active]:text-inverted outline-warning/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-warning"]}},{color:"error",variant:"pill",class:{indicator:"bg-error",trigger:["data-[state=active]:text-inverted outline-error/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-error"]}},{color:"neutral",variant:"pill",class:{indicator:"bg-inverted",trigger:["data-[state=active]:text-inverted outline-inverted/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:before:bg-inverted"]}},{color:"primary",variant:"link",class:{indicator:"bg-primary",trigger:["data-[state=active]:text-primary outline-primary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-primary"]}},{color:"secondary",variant:"link",class:{indicator:"bg-secondary",trigger:["data-[state=active]:text-secondary outline-secondary/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-secondary"]}},{color:"success",variant:"link",class:{indicator:"bg-success",trigger:["data-[state=active]:text-success outline-success/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-success"]}},{color:"info",variant:"link",class:{indicator:"bg-info",trigger:["data-[state=active]:text-info outline-info/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-info"]}},{color:"warning",variant:"link",class:{indicator:"bg-warning",trigger:["data-[state=active]:text-warning outline-warning/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-warning"]}},{color:"error",variant:"link",class:{indicator:"bg-error",trigger:["data-[state=active]:text-error outline-error/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-error"]}},{color:"neutral",variant:"link",class:{indicator:"bg-inverted",trigger:["data-[state=active]:text-highlighted outline-inverted/25 focus-visible:outline-3","in-[[data-slot=list]:not(:has([data-slot=indicator]))]:data-[state=active]:after:bg-inverted"]}}],defaultVariants:{color:"primary",variant:"pill",size:"md"}},Ca={__name:"UTabs",props:{as:{type:null,required:!1},items:{type:Array,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},orientation:{type:null,required:!1,default:"horizontal"},content:{type:Boolean,required:!1,default:!0},valueKey:{type:null,required:!1,default:"value"},labelKey:{type:null,required:!1,default:"label"},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultValue:{type:[String,Number],required:!1,default:"0"},modelValue:{type:[String,Number],required:!1},activationMode:{type:String,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0}},emits:["update:modelValue"],setup(d,{expose:r,emit:u}){const i=d,v=u,n=ia(),t=sa("tabs",i),o=oa(),s=la(ra(t,"as","unmountOnHide"),v),l=_(()=>ca({extend:qa,...o.ui?.tabs||{}})({color:t.color,variant:t.variant,size:t.size,orientation:t.orientation})),p=q([]);function b(f,A){p.value[f]=A}return r({triggersRef:p}),(f,A)=>(c(),y(a(pa),T(a(s),{"model-value":a(t).modelValue,"default-value":a(t).defaultValue,orientation:a(t).orientation,"activation-mode":a(t).activationMode,"data-slot":"root",class:l.value.root({class:[a(t).ui?.root,a(t).class]})}),{default:g(()=>[w(a(xa),{"data-slot":"list",class:x(l.value.list({class:a(t).ui?.list}))},{default:g(()=>[w(a(ma),{"data-slot":"indicator",class:x(l.value.indicator({class:a(t).ui?.indicator}))},null,8,["class"]),h(f.$slots,"list-leading"),(c(!0),B($,null,M(a(t).items,(e,m)=>(c(),y(a(ka),{key:a(z)(e,a(t).valueKey)??m,ref_for:!0,ref:H=>b(m,H),value:a(z)(e,a(t).valueKey)??String(m),disabled:e.disabled,"data-slot":"trigger",class:x(l.value.trigger({class:[a(t).ui?.trigger,e.ui?.trigger]}))},{default:g(()=>[h(f.$slots,"leading",{item:e,index:m,ui:l.value},()=>[e.icon?(c(),y(na,{key:0,name:e.icon,"data-slot":"leadingIcon",class:x(l.value.leadingIcon({class:[a(t).ui?.leadingIcon,e.ui?.leadingIcon]}))},null,8,["name","class"])):e.avatar?(c(),y(da,T({key:1,size:e.ui?.leadingAvatarSize||a(t).ui?.leadingAvatarSize||l.value.leadingAvatarSize()},{ref_for:!0},e.avatar,{"data-slot":"leadingAvatar",class:l.value.leadingAvatar({class:[a(t).ui?.leadingAvatar,e.ui?.leadingAvatar]})}),null,16,["size","class"])):k("",!0)]),a(z)(e,a(t).labelKey)||n.default?(c(),B("span",{key:0,"data-slot":"label",class:x(l.value.label({class:[a(t).ui?.label,e.ui?.label]}))},[h(f.$slots,"default",{item:e,index:m},()=>[R(K(a(z)(e,a(t).labelKey)),1)])],2)):k("",!0),h(f.$slots,"trailing",{item:e,index:m,ui:l.value},()=>[e.badge||e.badge===0?(c(),y(ua,T({key:0,color:"neutral",variant:"outline",size:e.ui?.trailingBadgeSize||a(t).ui?.trailingBadgeSize||l.value.trailingBadgeSize()},{ref_for:!0},typeof e.badge=="string"||typeof e.badge=="number"?{label:e.badge}:e.badge,{"data-slot":"trailingBadge",class:l.value.trailingBadge({class:[a(t).ui?.trailingBadge,e.ui?.trailingBadge]})}),null,16,["size","class"])):k("",!0)])]),_:2},1032,["value","disabled","class"]))),128)),h(f.$slots,"list-trailing")]),_:3},8,["class"]),a(t).content?(c(!0),B($,{key:0},M(a(t).items,(e,m)=>(c(),y(a(ya),{key:a(z)(e,a(t).valueKey)??m,value:a(z)(e,a(t).valueKey)??String(m),"data-slot":"content",class:x(l.value.content({class:[a(t).ui?.content,e.ui?.content,e.class]}))},{default:g(()=>[h(f.$slots,e.slot||"content",{item:e,index:m,ui:l.value},()=>[R(K(e.content),1)])]),_:2},1032,["value","class"]))),128)):k("",!0)]),_:3},16,["model-value","default-value","orientation","activation-mode","class"]))}};export{Ca as _};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as oe,o as n,c as l,j as $,g as S,M as mt,i as d,T as Re,ac as ft,k as t,Q as ge,H as he,v as ye,f as P,p as re,q as k,m as L,t as p,F as D,G as pt,r as j,y as ne,s as Ie,_ as Me,h as w,z as ot,B as Be,ad as Le,C as st,b as gt,D as ht,l as Oe,O as Qe,A as qe,aa as Ae,x as vt,U as Ue,ae as Se,K as je,R as yt,ab as xt,af as bt,ag as kt,ah as _t,Z as $t,$ as wt}from"./BPKwYP2Q.js";import{_ as Ze}from"./Br2K9yi_.js";import{q as Ct,u as St,e as Tt,f as We,v as at,l as Pe,k as Lt,w as At}from"./k-z_VVTK.js";import{_ as It,a as zt}from"./CQeMb57w.js";import{_ as Ne}from"./DhA17dqR.js";import{_ as Bt}from"./nCjfWTGm.js";import{u as Ge}from"./DuMv-ugy.js";import{u as Ee}from"./BIf1R_fu.js";import{_ as Rt}from"./DszOHBMG.js";import{_ as Pt}from"./BpceIssd.js";import{_ as Ot}from"./CoHGrO41.js";import{l as Ut,i as Et,b as Mt}from"./Dz55UR7w.js";import{_ as rt}from"./BdFEUAlx.js";import{_ as jt}from"./B7yG1G_l.js";const Nt={class:"flex items-center justify-between gap-2"},Kt=["aria-expanded","title"],Vt={class:"text-lg font-medium inline-flex items-center gap-1 shrink-0"},Dt={key:2,class:"min-w-0 flex-1 truncate text-sm text-gray-500 dark:text-gray-400"},Ht={key:0,class:"flex items-center gap-1 shrink-0"},Ft={key:0,class:"text-sm text-gray-500 mt-1 ml-11"},qt=oe({__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:m,toggle:o,setFolded:a}=Ut(`piwi-section-fold-${i.storageKey}`,i.defaultFolded),s=j(null);function g(){a(!1),pt(()=>s.value?.scrollIntoView({behavior:"smooth",block:"start"}))}return r({setFolded:a,reveal:g}),(c,h)=>{const C=ye,T=It,x=jt;return n(),l("div",{ref_key:"rootEl",ref:s,class:"scroll-mt-4"},[$(x,{ui:{header:"p-3 sm:px-4 sm:py-3",body:t(m)?"p-0 sm:p-0":""},class:re(t(m)&&"divide-y-0")},{header:S(()=>[d("div",Nt,[d("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(m),title:t(m)?"Expand section":"Collapse section",onClick:h[1]||(h[1]=(...A)=>t(o)&&t(o)(...A)),onKeydown:[h[2]||(h[2]=ge((...A)=>t(o)&&t(o)(...A),["enter"])),h[3]||(h[3]=ge(he((...A)=>t(o)&&t(o)(...A),["prevent"]),["space"]))]},[$(C,{name:t(m)?"i-lucide-chevron-right":"i-lucide-chevron-down",class:"size-4 shrink-0 text-gray-400"},null,8,["name"]),e.icon?(n(),P(C,{key:0,name:e.icon,class:re(["size-5 shrink-0",e.iconClass])},null,8,["name","class"])):k("",!0),d("h3",Vt,[L(p(e.title),1),e.count!=null?(n(),l(D,{key:0},[L(" ("+p(e.count)+")",1)],64)):k("",!0)]),e.help?(n(),l("span",{key:1,onClick:h[0]||(h[0]=he(()=>{},["stop"]))},[$(T,{topic:e.help},null,8,["topic"])])):k("",!0),t(m)&&c.$slots.folded?(n(),l("span",Dt,[Re(c.$slots,"folded")])):k("",!0)],40,Kt),c.$slots.actions?(n(),l("div",Ht,[Re(c.$slots,"actions")])):k("",!0)]),!t(m)&&(e.subtitle||c.$slots.subtitle)?(n(),l("p",Ft,[Re(c.$slots,"subtitle",{},()=>[L(p(e.subtitle),1)])])):k("",!0)]),default:S(()=>[mt(d("div",null,[Re(c.$slots,"default")],512),[[ft,!t(m)]])]),_:3},8,["ui","class"])],512)}}}),Ke=Object.assign(qt,{__name:"CollapsibleSectionCard"}),Zt={class:"overflow-x-auto text-xs font-mono"},Wt=oe({__name:"DiffPatch",props:{patch:{}},setup(e){return(r,i)=>(n(),l("div",Zt,[(n(!0),l(D,null,ne(("parsePatchLines"in r?r.parsePatchLines:t(St))(e.patch),(m,o)=>(n(),l("div",{key:o,class:re(["px-3 py-px whitespace-pre leading-5 min-w-0",("patchLineClass"in r?r.patchLineClass:t(Ct))[m.type]])},p(m.text||" "),3))),128))]))}}),Gt=Object.assign(Wt,{__name:"DiffPatch"}),Yt=["role","aria-checked","tabindex"],Jt={class:"flex-1 min-w-0"},Qt=["title"],Xt={key:0,class:"text-[11px] leading-4 text-gray-500 truncate"},en=oe({__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 m(a){const{method:s,score:g,args:c}=a;return c&&(c.anchorTestId||c.anchorSelector||c.anchorRole)?"scoped to a stable ancestor — survives renames":g>=100?"most stable — purpose-built for testing":s==="getByRole"&&c&&!("name"in c)?"name-free role — survives renames":s==="getByRole"?"browser ARIA tree — semantic and stable":s==="getByLabel"?"associated <label> element":s==="getByPlaceholder"?"input placeholder":s==="getByText"?"visible text":s==="getByAltText"?"image alt text":s==="getByTitle"?"title attribute":s==="locator"&&g>=50?"stable selector":s==="locator"?"CSS class — may be fragile":""}const o=w(()=>r.note??m(r.alt));return(a,s)=>{const g=Ie,c=ye,h=Me;return n(),l("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:s[1]||(s[1]=C=>e.selectable&&a.$emit("select")),onKeydown:[s[2]||(s[2]=ge(he(C=>e.selectable&&a.$emit("select"),["prevent"]),["enter"])),s[3]||(s[3]=ge(he(C=>e.selectable&&a.$emit("select"),["prevent"]),["space"]))]},[$(g,{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:S(()=>[L(p(e.alt.score),1)]),_:1},8,["color","class","title"]),d("div",Jt,[d("code",{class:"text-xs font-mono block truncate",title:e.alt.locator},p(e.alt.locator),9,Qt),t(o)?(n(),l("p",Xt,p(t(o)),1)):k("",!0)]),e.alt.pickedByUser&&e.dense?(n(),P(c,{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(g,{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"})):k("",!0),$(h,{size:"xs",variant:"ghost",color:"neutral",icon:e.copied?"i-lucide-check":"i-lucide-copy",title:e.copied?"Copied!":"Copy",class:"shrink-0",onClick:s[0]||(s[0]=he(C=>a.$emit("copy"),["stop"]))},null,8,["icon","title"])],42,Yt)}}}),it=Object.assign(en,{__name:"LocatorAlternativeRow"}),Xe={getByTestId:"testid",getByRole:"semantic",getByLabel:"label",getByPlaceholder:"label",getByText:"text",getByAltText:"text",getByTitle:"text",locator:"css","page.locator":"css"},tn=50;function lt(e,r,i=tn){const m=r[0]??null;if(!m)return{recommended:null,durable:null,preservesConvention:!1,hasDurableAlternative:!1,suggestAddTestId:!1};const o=e?Xe[e]:void 0,a=(e?r.find(c=>c.method===e&&c.score>=i):void 0)??(o?r.find(c=>Xe[c.method]===o&&c.score>=i):void 0),g=r.find(c=>c.pickedByUser)??a??m;return{recommended:g,durable:m,preservesConvention:!!a&&g===a,hasDurableAlternative:g.locator!==m.locator,suggestAddTestId:m.score<i}}const ct={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"},nn={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"},on=["id","class","name","data-testid","placeholder","alt","title","aria-label","aria-level","role","type","href","multiple"];function sn(e){const r=e.attributes.role;if(r)return r;const i=e.tagName;if(!i)return null;if(i==="input"){const m=(e.attributes.type??"text").toLowerCase();return nn[m]??"textbox"}return i==="select"?e.attributes.multiple!=null?"listbox":"combobox":i==="a"?e.attributes.href!=null?"link":null:ct[i]??null}function an(e,r){if(r!=="heading")return null;const i=e.tagName.match(/^h([1-6])$/);if(i)return Number(i[1]);const m=e.attributes["aria-level"];return m&&/^\d+$/.test(m)?Number(m):null}const $e=(e,r)=>e.attributes[r]||null,pe=e=>e.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),He=e=>e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),et=e=>/^[A-Za-z][A-Za-z0-9_-]*$/.test(e);function rn(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 tt(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 ln(e){const r=[],i=new Set,m=y=>{i.has(y.locator)||(i.add(y.locator),r.push(y))},{accessibleName:o}=e,a=e.tagName,s=sn(e),g=e.selectorCounts,c=y=>y==null||y<=1,h=e.textContent?e.textContent.replace(/\s+/g," ").trim():null,C=$e(e,"data-testid");C&&c(g?.testId)&&m({locator:`getByTestId('${pe(C)}')`,method:"getByTestId",args:{testId:C},score:100});const T=an(e,s),x=T!=null?`, level: ${T}`:"",A=y=>T!=null?{...y,level:T}:y;s&&o&&m({locator:`getByRole('${s}', { name: '${pe(o)}'${x} })`,method:"getByRole",args:A({role:s,name:o}),score:90});const z=$e(e,"aria-label");if(s&&z&&z!==o&&m({locator:`getByRole('${s}', { name: '${pe(z)}'${x} })`,method:"getByRole",args:A({role:s,name:z}),score:85}),o&&["input","select","textarea"].includes(a)){const y=$e(e,"aria-label");(e.hasLabel===void 0||e.hasLabel===!0||y===o)&&m({locator:`getByLabel('${pe(o)}')`,method:"getByLabel",args:{label:o},score:85})}const B=$e(e,"placeholder");B&&m({locator:`getByPlaceholder('${pe(B)}')`,method:"getByPlaceholder",args:{placeholder:B},score:80}),h&&h.length<80&&m({locator:`getByText('${pe(h)}')`,method:"getByText",args:{text:h},score:75});const Z=$e(e,"id");if(Z&&!tt(Z)&&c(g?.id)){const y=et(Z)?`#${Z}`:`[id="${He(Z)}"]`;m({locator:`locator('${pe(y)}')`,method:"locator",args:{selector:y},score:65})}const Y=$e(e,"name");if(Y&&c(g?.name)){const y=`[name="${He(Y)}"]`;m({locator:`locator('${pe(y)}')`,method:"locator",args:{selector:y},score:60})}const E=$e(e,"alt");E&&m({locator:`getByAltText('${pe(E)}')`,method:"getByAltText",args:{text:E},score:60});const O=$e(e,"title");O&&m({locator:`getByTitle('${pe(O)}')`,method:"getByTitle",args:{title:O},score:50});const ce=!!(C&&c(g?.testId));if(s&&!ce){const y=T!=null?`'${s}', { level: ${T} }`:`'${s}'`,H=A({role:s});let M=!1,K=!1,W=!1;for(const Q of e.ancestors??[]){if(Q.scopedRoleCount!==1)continue;if(!M&&Q.testId&&Q.testIdCount===1&&(M=!0,m({locator:`getByTestId('${pe(Q.testId)}').getByRole(${y})`,method:"getByRole",args:{...H,anchorTestId:Q.testId},score:72})),!K&&Q.id&&!tt(Q.id)&&Q.idCount===1){K=!0;const xe=et(Q.id)?`#${Q.id}`:`[id="${He(Q.id)}"]`;m({locator:`locator('${pe(xe)}').getByRole(${y})`,method:"getByRole",args:{...H,anchorSelector:xe},score:64})}const ve=Q.role||ct[Q.tag]||null;!W&&ve&&ve!==s&&Q.roleCount===1&&(W=!0,m({locator:`getByRole('${pe(ve)}').getByRole(${y})`,method:"getByRole",args:{...H,anchorRole:ve},score:55}))}const F=e.rolePosition;F&&F.role===s&&(F.count===1||T!=null&&F.levelCount===1)&&m({locator:`getByRole(${y})`,method:"getByRole",args:H,score:58})}const ee=$e(e,"class");if(ee){const y=g?.classes,H=ee.split(/\s+/).filter(M=>M.length>1&&/^[A-Za-z_-][A-Za-z0-9_-]*$/.test(M)&&c(y?.[M])).map(M=>({cls:M,score:rn(M)})).sort((M,K)=>K.score-M.score).slice(0,3);for(const{cls:M,score:K}of H)m({locator:`locator('.${pe(M)}')`,method:"locator",args:{selector:`.${M}`},score:K})}return r.sort((y,H)=>H.score-y.score)}function cn(e){const r=e.attributes,i=r["aria-label"];if(i)return i;if(e.textContent)return e.textContent;const m=r.title;if(m)return m;const o=r.placeholder;return o||null}function un(e){if(window.__piwiPickerInstalled)return;window.__piwiPickerInstalled=!0;var r=document,i=window,m=2147483600,o=e.probedAttrs,a=r.createElement("div");a.id="__piwi_picker_highlight",a.style.cssText="position:fixed;pointer-events:none;z-index:"+m+";display:none;box-sizing:border-box;border:2px solid #7c3aed;background:rgba(124,58,237,.12);border-radius:3px;",r.body.appendChild(a);var s=r.createElement("div");s.id="__piwi_picker_banner",s.style.cssText="position:fixed;top:12px;left:50%;transform:translateX(-50%);z-index:"+(m+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;",s.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(s),i.parent.postMessage({type:"pickerReady"},"*");function g(u){var b=(u.tagName||"?").toLowerCase(),I=u.getAttribute&&u.getAttribute("data-testid");if(I)return"getByTestId('"+I+"')";if(u.labels&&u.labels.length>0){var U=(u.labels[0].textContent||"").replace(/\s+/g," ").trim().slice(0,80);if(U)return"getByLabel('"+U+"')"}var X=u.getAttribute&&u.getAttribute("aria-label");if(X)return"getByLabel('"+X+"')";var J=u.getAttribute&&u.getAttribute("placeholder");if(J)return"getByPlaceholder('"+J+"')";var q=u.getAttribute&&u.getAttribute("alt");if(q)return"getByAltText('"+q+"')";var ae=u.getAttribute&&u.getAttribute("title");if(ae)return"getByTitle('"+ae+"')";if(u.id)return"locator('#"+u.id+"')";var fe=(u.getAttribute&&u.getAttribute("class")||"").split(/\s+/).find(function(_){return _.length>1});return fe?"locator('."+fe+"')":b}function c(u){for(var b=[],I=u;I&&b.length<15;){var U=(I.tagName||"").toLowerCase();if(U==="body"||U==="html")break;b.push(I),I=I.parentElement}return b.length?b:[u]}var h=["button","a","input","select","textarea","summary","option"];function C(u){for(var b=0;b<Math.min(u.length,4);b++){var I=u[b],U=(I.tagName||"").toLowerCase();if(h.indexOf(U)!==-1||I.getAttribute&&(I.getAttribute("role")||I.getAttribute("data-testid")))return b}return 0}var T=[],x=0,A=null;function z(){return T[x]||null}function B(){var u=z();if(!u){a.style.display="none";return}var b=u.getBoundingClientRect();a.style.display="block",a.style.left=b.left+"px",a.style.top=b.top+"px",a.style.width=b.width+"px",a.style.height=b.height+"px";var I=r.getElementById("__piwi_picker_foot");I&&(I.textContent=g(u)+" — click to pick · ↑ parent · ↓ child · Esc skip")}var Z=s.querySelector("[style*=margin]");Z&&(Z.id="__piwi_picker_foot");function Y(u){for(var b={},I=0;I<o.length;I++){var U=o[I],X=u.getAttribute(U)||u[U];b[U]=typeof X=="string"?X.slice(0,200):X?String(X).slice(0,200):null}var J=u.getBoundingClientRect(),q={};try{var ae=function(we){return i.CSS.escape(we)},fe=function(we){try{return r.querySelectorAll(we).length}catch{return}};b["data-testid"]&&(q.testId=fe("[data-testid="+JSON.stringify(b["data-testid"])+"]")),b.id&&(q.id=fe("#"+ae(b.id))),b.name&&(q.name=fe("[name="+JSON.stringify(b.name)+"]"));var _=(b.class||"").split(/\s+/).filter(function(we){return we.length>1}).slice(0,10);if(_.length>0){for(var v={},G=0;G<_.length;G++){var le=fe("."+ae(_[G]));le!==void 0&&(v[_[G]]=le)}q.classes=v}}catch{}var Ve=null;return u.labels&&u.labels.length>0&&(Ve=(u.labels[0].textContent||"").replace(/\s+/g," ").trim().slice(0,120)||null),{tagName:(u.tagName||"").toLowerCase(),attributes:b,textContent:(u.textContent||"").replace(/\s+/g," ").trim().slice(0,80)||null,center:{x:Math.round(J.x+J.width/2),y:Math.round(J.y+J.height/2)},hasLabel:!!(u.labels&&u.labels.length>0),labelText:Ve,selectorCounts:q}}function E(u){u.preventDefault(),u.stopImmediatePropagation()}function O(u){return u===s||u===a||s.contains&&s.contains(u)||u&&u.__piwiHint}var ce="top";function ee(u){ce!==u&&(ce=u,u==="bottom"?(s.style.top="auto",s.style.bottom="12px"):(s.style.top="12px",s.style.bottom="auto"))}function y(u){var b=u.target;if(!b||O(b)){a.style.display="none";return}b!==A&&(A=b,T=c(b),x=C(T)),B();var I=z();if(I){var U=I.getBoundingClientRect(),X=s.getBoundingClientRect(),J=8;U.left<X.right+J&&U.right>X.left-J&&U.top<X.bottom+J&&U.bottom>X.top-J&&ee(ce==="top"?"bottom":"top")}}function H(u){if(u==="Escape"){Te();return}u==="ArrowUp"&&(x=Math.min(x+1,T.length-1),B()),u==="ArrowDown"&&(x=Math.max(x-1,0),B())}function M(u){(u.key==="Escape"||u.key==="ArrowUp"||u.key==="ArrowDown")&&(E(u),H(u.key))}var K=[];function W(){for(var u=0;u<K.length;u++)K[u].parentNode&&K[u].parentNode.removeChild(K[u]);K=[]}function F(u){return(u||"").replace(/\s+/g," ").trim().toLowerCase()}function Q(u){var b=F(u);if(b.length<2)return[];for(var I=r.querySelectorAll("button,a,[role],h1,h2,h3,h4,h5,h6,label,summary,input,textarea,select,option,span,li,td,th,p"),U=[],X=[],J=0;J<I.length;J++){var q=I[J],ae=F(q.textContent);if(!ae){var fe=F(q.getAttribute&&(q.getAttribute("placeholder")||q.getAttribute("aria-label"))||"");fe&&(fe===b||fe.indexOf(b)!==-1)&&U.push(q);continue}ae.length>120||(ae===b?U.push(q):ae.indexOf(b)!==-1&&ae.length<b.length+30&&X.push(q))}return U.concat(X)}function ve(u,b){var I=u.getBoundingClientRect();if(I.width===0&&I.height===0)return null;var U=r.createElement("div");return U.__piwiHint=!0,U.style.cssText="position:fixed;pointer-events:none;z-index:"+(m+1)+";box-sizing:border-box;border-radius:3px;transition:opacity .3s;border:2px solid "+b+";box-shadow:0 0 0 3px "+b+"55;left:"+I.left+"px;top:"+I.top+"px;width:"+I.width+"px;height:"+I.height+"px;",r.body.appendChild(U),K.push(U),U}function xe(u){var b=u.getBoundingClientRect();i.parent.postMessage({type:"piwiScrollTo",y:b.top},"*")}function ze(u){if(W(),!(!u||!u.length)){for(var b=null,I=0;I<u.length;I++)for(var U=u[I],X=Q(U&&U.text),J=0;J<Math.min(X.length,3);J++)ve(X[J],"#f59e0b"),b||(b=X[J]);b&&xe(b),setTimeout(function(){for(var q=0;q<K.length;q++)K[q].style.opacity="0"},2600),setTimeout(W,3e3)}}var te=[],ke=0;function R(){i.parent.postMessage({type:"piwiSearchResult",count:te.length,index:te.length?ke:-1},"*")}function f(){W();var u=te[ke];u&&(ve(u,"#7c3aed"),xe(u),R())}function N(u){if(te=Q(u),ke=0,!te.length){W(),R();return}f()}function be(){te.length&&(ke=(ke+1)%te.length,f())}function me(u){var b=u.data;if(!(!b||typeof b.type!="string")){if(b.type==="piwiPickerKey"&&typeof b.key=="string")H(b.key);else if(b.type==="piwiHighlight")try{ze(b.hints)}catch{}else if(b.type==="piwiSearch")try{N(b.q)}catch{}else if(b.type==="piwiSearchNext")try{be()}catch{}else if(b.type==="piwiClearHints")try{W()}catch{}}}function ue(u){E(u);var b=z();if(!(!b||O(u.target))){var I=Y(b);a.style.display="none",W(),s.innerHTML='<div style="text-align:center;color:#9ca3af;">Analyzing element…</div>',Ce(),i.parent.postMessage({type:"elementPicked",attrs:I},"*")}}var _e=["mousedown","mouseup","pointerdown","pointerup","auxclick","dblclick"];function Ce(){r.removeEventListener("mousemove",y,!0),r.removeEventListener("click",ue,!0),r.removeEventListener("keydown",M,!0),i.removeEventListener("message",me,!1);for(var u=0;u<_e.length;u++)r.removeEventListener(_e[u],E,!0)}function Te(){Ce(),W(),a.remove(),s.remove(),i.parent.postMessage({type:"pickerClosed"},"*")}r.addEventListener("mousemove",y,!0),r.addEventListener("click",ue,!0),r.addEventListener("keydown",M,!0),i.addEventListener("message",me,!1);for(var se=0;se<_e.length;se++)r.addEventListener(_e[se],E,!0);function V(){var u=Math.max(r.documentElement?r.documentElement.scrollHeight:0,r.body?r.body.scrollHeight:0);u>0&&i.parent.postMessage({type:"piwiContentHeight",height:u},"*")}V();try{if(i.ResizeObserver){var ie=new i.ResizeObserver(V);r.documentElement&&ie.observe(r.documentElement),r.body&&ie.observe(r.body)}}catch{}}function dn(e){const r=[],i=new Set,m=a=>{if(typeof a!="string")return;const s=a.trim();if(s.length<2||s.length>80)return;const g=s.toLowerCase();i.has(g)||(i.add(g),r.push({text:s}))},o=a=>a&&(a.name??a.text??a.label??a.placeholder??a.alt??a.title);m(o(e.failingLocator?.args));for(const a of e.fromElementMatch??[])m(o(a.args));for(const a of e.fromAriaSnapshot??[])m(o(a.args));return r.slice(0,6)}function mn(e){return`<script>(${String(un).replace(/<\/(script)/gi,"<\\/$1")})(${JSON.stringify(e)})<\/script>`}function fn(e){return e.replace(/<base\b[^>]*>/gi,"")}function pn(e,r){return fn(e)+mn(r)}const gn={key:0,class:"flex items-center justify-center py-20"},hn={key:1,class:"py-8 text-center"},vn={class:"text-xs text-gray-400 mt-1"},yn={key:2,class:"py-8 text-center"},xn={class:"mb-2 flex items-center gap-2 flex-wrap"},bn={key:1,class:"ml-auto inline-flex rounded-md border border-default overflow-hidden text-xs"},kn={key:0,class:"flex items-center gap-1 mb-1.5 text-xs text-gray-500"},_n={class:"tabular-nums w-11 text-center select-none"},$n={class:"ml-auto text-gray-400 tabular-nums"},wn={key:1,class:"flex items-center gap-2 mb-1.5"},Cn={key:0,class:"text-xs text-gray-500 tabular-nums"},Sn={key:1,class:"text-xs text-gray-400"},Tn={key:0,class:"absolute inset-0 flex items-center justify-center bg-white dark:bg-gray-900 z-10"},Ln=["src"],An={key:2,class:"mt-4 space-y-3"},In={class:"flex items-center gap-3 bg-elevated rounded-lg p-3"},zn={class:"flex-1 min-w-0"},Bn={class:"text-sm font-medium"},Rn={class:"text-xs"},Pn={key:0,class:"text-xs text-gray-400 ml-1"},On={key:0,class:"text-xs text-gray-500 mt-0.5 truncate"},Un={class:"space-y-1",role:"radiogroup","aria-label":"Alternative locators"},En={class:"flex-1 min-w-0"},Mn={class:"text-xs font-medium text-primary"},jn={class:"text-sm font-mono block truncate mt-0.5"},Nn={class:"flex justify-between w-full"},Kn={key:1},Vn={class:"flex gap-2"},Dn=oe({__name:"SnapshotLocatorPicker",props:qe({runId:{},testRunsCaseId:{},failingLocator:{},healing:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:qe(["close","confirmed"],["update:open"]),setup(e,{emit:r}){const i=e,m=r,o=ot(e,"open"),a=j(!1),s=j(null),g=j(null),c=j(void 0);async function h(){a.value=!0,g.value=null;try{const _=c.value?`?source=${c.value}`:"";s.value=await $fetch(`/api/test-runs/${i.runId}/cases/${i.testRunsCaseId}/dom-snapshot${_}`),s.value?.source&&(c.value=s.value.source)}catch(_){g.value=_ instanceof Error?_.message:"Unknown error"}finally{a.value=!1}}const C=w(()=>s.value?.availableSources??[]);function T(_){_===c.value||a.value||(c.value=_,z.value=!1,x.value="pick-element",ee.value=0,H.value=!1,B.value=null,Z.value=[],se.value=null,N.value="",be.value=0,me.value=-1,h())}Be(o,_=>{_&&(s.value=null,z.value=!1,x.value="pick-element",ee.value=0,H.value=!1,c.value=void 0,B.value=null,Z.value=[],se.value=null,N.value="",be.value=0,me.value=-1,h())});const x=j("pick-element"),A=j(null),z=j(!1),B=j(null),Z=j([]),Y=j(void 0);function E(_){return URL.createObjectURL(new Blob([pn(_,{probedAttrs:on})],{type:"text/html"}))}Be(()=>s.value?.html,_=>{Y.value&&(URL.revokeObjectURL(Y.value),Y.value=void 0),_&&(Y.value=E(_))},{immediate:!0});const O=j(null),ce=j(0),ee=j(0),y=j(1),H=j(!1),M=w(()=>s.value?.viewport??null),K=w(()=>{const _=M.value;return!_?.width||!ce.value?1:Math.min(ce.value/_.width,1)}),W=w(()=>{const _=M.value;if(!_)return{width:"100%",height:ee.value?`${ee.value}px`:"100%"};const v=ee.value||_.height;return{width:`${Math.round(_.width*y.value)}px`,height:`${Math.round(v*y.value)}px`}}),F=w(()=>{const _=M.value;if(!_)return{width:"100%",height:ee.value?`${ee.value}px`:"100%",border:"0"};const v=ee.value||_.height;return{width:`${_.width}px`,height:`${v}px`,transform:`scale(${y.value})`,transformOrigin:"top left",border:"0"}}),Q=w(()=>Math.round(y.value*100)),ve=_=>Math.min(4,Math.max(.1,_));function xe(_){H.value=!0,y.value=ve(y.value*_)}function ze(){H.value=!1,y.value=K.value}Be([K,M],()=>{H.value||(y.value=K.value)});let te=null;Be(O,_=>{te?.disconnect(),_&&(ce.value=_.clientWidth,te=new ResizeObserver(v=>{for(const G of v)ce.value=G.contentRect.width}),te.observe(_))}),Le(()=>{te?.disconnect()}),Le(()=>{Y.value&&URL.revokeObjectURL(Y.value)});function ke(_){if(!A.value||_.source!==A.value.contentWindow)return;const v=_.data;if(v?.type==="pickerReady"){z.value=!0,f();return}if(v?.type==="piwiContentHeight"&&typeof v.height=="number"){ee.value=Math.max(v.height,M.value?.height??0);return}if(v?.type==="piwiScrollTo"&&typeof v.y=="number"){const G=O.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,me.value=typeof v.index=="number"?v.index:-1;return}if(v?.type==="elementPicked"&&v.attrs){const{labelText:G,...le}=v.attrs;B.value={...le,accessibleName:G??cn(le)},Z.value=ln(B.value),se.value=null,x.value="review"}v?.type==="pickerClosed"&&U()}function R(_){A.value?.contentWindow?.postMessage(_,"*")}function f(){const _=dn({failingLocator:i.failingLocator,fromElementMatch:i.healing?.fromElementMatch??null,fromAriaSnapshot:i.healing?.fromAriaSnapshot??null});_.length&&R({type:"piwiHighlight",hints:_})}const N=j(""),be=j(0),me=j(-1);let ue=null;Be(N,_=>{ue&&clearTimeout(ue),ue=setTimeout(()=>R({type:"piwiSearch",q:_}),180)});function _e(){R({type:"piwiSearchNext"})}Le(()=>{ue&&clearTimeout(ue)});function Ce(_){if(!o.value||x.value!=="pick-element"||!z.value||_.key!=="ArrowUp"&&_.key!=="ArrowDown")return;const v=(document.activeElement?.tagName??"").toLowerCase();if(v==="input"||v==="textarea")return;const G=A.value?.contentWindow;G&&(_.preventDefault(),G.postMessage({type:"piwiPickerKey",key:_.key},"*"))}function Te(){A.value&&(A.value.src="about:blank")}st(()=>{window.addEventListener("message",ke),window.addEventListener("keydown",Ce,!0)}),Le(()=>{window.removeEventListener("message",ke),window.removeEventListener("keydown",Ce,!0)});const se=j(null),V=j(!1);function ie(_){se.value=_}const u=w(()=>lt(i.failingLocator.method,Z.value)),b=gt();async function I(){if(se.value){V.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:B.value}})).status==="ok"?m("confirmed",se.value):b.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"}),o.value=!1}catch(_){b.add({title:"Could not save the pick",description:Tt(_),color:"error",icon:"i-lucide-alert-triangle"})}finally{V.value=!1}}}function U(){Te(),o.value=!1}function X(){B.value=null,Z.value=[],se.value=null,x.value="pick-element",z.value=!1,N.value="",be.value=0,me.value=-1;const _=s.value?.html;_&&(Y.value&&URL.revokeObjectURL(Y.value),Y.value=E(_))}const{copy:J}=Ge(),q=j(null);let ae=null;function fe(_,v){J(_,{toast:"Locator copied"}),q.value=v,ae&&clearTimeout(ae),ae=setTimeout(()=>{q.value=null},2e3)}return Le(()=>{ae&&clearTimeout(ae)}),(_,v)=>{const G=ye,le=Me,Ve=ht,we=Ie,Je=Bt;return n(),P(Je,{open:o.value,"onUpdate:open":v[8]||(v[8]=de=>o.value=de),ui:{content:"max-w-6xl w-[95vw]"},onAfterLeave:U},{header:S(()=>[...v[9]||(v[9]=[d("div",null,[d("h3",{class:"text-lg font-medium"},"Pick a locator from the DOM snapshot"),d("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:S(()=>[t(a)?(n(),l("div",gn,[$(G,{name:"i-lucide-loader",class:"size-6 animate-spin text-gray-400"}),v[10]||(v[10]=d("span",{class:"ml-2 text-sm text-gray-500"},"Loading DOM snapshot...",-1))])):t(g)?(n(),l("div",hn,[$(G,{name:"i-lucide-alert-triangle",class:"size-8 text-red-300 mx-auto mb-2"}),v[12]||(v[12]=d("p",{class:"text-sm text-red-500"},"Failed to load snapshot",-1)),d("p",vn,p(t(g)),1),$(le,{size:"xs",variant:"outline",color:"neutral",class:"mt-3",onClick:h},{default:S(()=>[...v[11]||(v[11]=[L("Retry",-1)])]),_:1})])):t(s)?.status!=="ok"||!t(s).html?(n(),l("div",yn,[$(G,{name:"i-lucide-file-x",class:"size-8 text-gray-300 mx-auto mb-2"}),v[13]||(v[13]=d("p",{class:"text-sm text-gray-500"},"No DOM snapshot or ARIA data available for this execution",-1)),v[14]||(v[14]=d("p",{class:"text-xs text-gray-400 mt-1"},"This test run has no stored trace or ARIA snapshot to pick from.",-1))])):(n(),l(D,{key:3},[d("div",xn,[t(s).source?(n(),l("div",{key:0,class:re(["text-xs flex items-center gap-1",t(s).source==="aria"?"text-amber-600 dark:text-amber-400":"text-green-600 dark:text-green-400"])},[$(G,{name:t(s).source==="aria"?"i-lucide-accessibility":"i-lucide-check",class:"size-3.5 shrink-0"},null,8,["name"]),t(s).source==="aria"?(n(),l(D,{key:0},[L(" Accessibility tree from the failure-time ARIA snapshot — element styles are approximate ")],64)):(n(),l(D,{key:1},[L(" Rendered from the failure-time DOM snapshot ")],64))],2)):k("",!0),t(C).length>1?(n(),l("div",bn,[d("button",{type:"button",class:re(["px-2 py-1 flex items-center gap-1 transition-colors",t(c)==="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=>T("dom"))},[$(G,{name:"i-lucide-layout-panel-top",class:"size-3.5"}),v[15]||(v[15]=L(" DOM ",-1))],2),d("button",{type:"button",class:re(["px-2 py-1 flex items-center gap-1 border-l border-default transition-colors",t(c)==="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=>T("aria"))},[$(G,{name:"i-lucide-accessibility",class:"size-3.5"}),v[16]||(v[16]=L(" Tree ",-1))],2)])):k("",!0)]),t(M)?(n(),l("div",kn,[$(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))}),d("span",_n,p(t(Q))+"%",1),$(le,{size:"xs",variant:"ghost",color:"neutral",icon:"i-lucide-zoom-in",title:"Zoom in",onClick:v[3]||(v[3]=de=>xe(1.25))}),$(le,{size:"xs",variant:"outline",color:"neutral",class:"ml-1",onClick:ze},{default:S(()=>[...v[17]||(v[17]=[L("Fit",-1)])]),_:1}),d("span",$n,p(t(M).width)+"×"+p(t(M).height),1)])):k("",!0),t(x)==="pick-element"?(n(),l("div",wn,[$(Ve,{modelValue:t(N),"onUpdate:modelValue":v[4]||(v[4]=de=>Oe(N)?N.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(N)&&t(be)>0?(n(),l("span",Cn,p(t(me)+1)+"/"+p(t(be)),1)):t(N)?(n(),l("span",Sn,"no matches")):k("",!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})):k("",!0)])):k("",!0),d("div",{ref_key:"stageRef",ref:O,class:re(["relative border border-default rounded-lg overflow-auto",[t(x)==="pick-element"?"h-[75vh]":"h-80",t(M)?"bg-gray-100 dark:bg-gray-800":""]])},[t(z)?k("",!0):(n(),l("div",Tn,[$(G,{name:"i-lucide-loader",class:"size-5 animate-spin text-gray-400"}),v[18]||(v[18]=d("span",{class:"ml-2 text-sm text-gray-500"},"Initializing picker...",-1))])),d("div",{style:Qe(t(W))},[d("iframe",{ref_key:"iframeRef",ref:A,src:t(Y),style:Qe(t(F)),class:"bg-white",sandbox:"allow-scripts",title:"DOM snapshot"},null,12,Ln)],4)],2),t(x)==="review"&&t(B)?(n(),l("div",An,[d("div",In,[$(G,{name:"i-lucide-crosshair",class:"size-5 text-primary shrink-0"}),d("div",zn,[d("p",Bn,[v[19]||(v[19]=L(" Picked: ",-1)),d("code",Rn,p(t(B).tagName),1),t(B).attributes.id?(n(),l("code",Pn,"#"+p(t(B).attributes.id),1)):k("",!0),t(B).attributes["data-testid"]?(n(),P(we,{key:1,size:"xs",color:"primary",variant:"subtle",class:"ml-1"},{default:S(()=>[L(p(t(B).attributes["data-testid"]),1)]),_:1})):k("",!0)]),t(B).textContent?(n(),l("p",On,' "'+p(t(B).textContent)+'" ',1)):k("",!0)]),$(le,{size:"xs",variant:"ghost",color:"neutral",icon:"i-lucide-rotate-ccw",title:"Pick a different element",onClick:X})]),d("div",Un,[(n(!0),l(D,null,ne(t(Z),(de,De)=>(n(),P(it,{key:De,alt:de,copied:t(q)===`picked-${De}`,dense:!0,selectable:!0,selected:t(se)?.locator===de.locator,onCopy:dt=>fe(de.locator,`picked-${De}`),onSelect:dt=>ie(de)},null,8,["alt","copied","selected","onCopy","onSelect"]))),128))]),t(u).recommended?(n(),l("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(u).recommended)),onKeydown:v[7]||(v[7]=ge(he(de=>ie(t(u).recommended),["prevent"]),["enter"]))},[$(G,{name:"i-lucide-star",class:"size-5 text-primary shrink-0"}),d("div",En,[d("p",Mn," Recommended (score: "+p(t(u).recommended.score)+") ",1),d("code",jn,p(t(u).recommended.locator),1)]),$(le,{size:"sm",color:"primary",variant:"solid","trailing-icon":t(q)==="rec"?"i-lucide-check":"i-lucide-copy",onClick:v[5]||(v[5]=he(de=>fe(t(u).recommended.locator,"rec"),["stop"]))},{default:S(()=>[...v[20]||(v[20]=[L(" Copy ",-1)])]),_:1},8,["trailing-icon"])],32)):k("",!0)])):k("",!0)],64))]),footer:S(()=>[d("div",Nn,[t(x)==="review"?(n(),P(le,{key:0,size:"sm",variant:"outline",color:"neutral",icon:"i-lucide-rotate-ccw",onClick:X},{default:S(()=>[...v[21]||(v[21]=[L(" Pick a different element ",-1)])]),_:1})):(n(),l("div",Kn)),d("div",Vn,[$(le,{size:"sm",variant:"outline",color:"neutral",onClick:U},{default:S(()=>[...v[22]||(v[22]=[L("Cancel",-1)])]),_:1}),t(x)==="review"?(n(),P(le,{key:0,size:"sm",color:"primary",loading:t(V),disabled:!t(se),onClick:I},{default:S(()=>[...v[23]||(v[23]=[L(" Confirm pick ",-1)])]),_:1},8,["loading","disabled"])):k("",!0)])])]),_:1},8,["open"])}}}),Hn=Object.assign(Dn,{__name:"SnapshotLocatorPicker"});function Fn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qn(e,r){let i=0,m=null;for(let o=r;o<e.length;o++){const a=e[o];if(m){if(a==="\\"){o++;continue}a===m&&(m=null);continue}if(a==="'"||a==='"'||a==="`"){m=a;continue}if(a==="(")i++;else if(a===")"&&(i--,i===0))return o}return-1}function Zn(e,r,i){if(!e||!r||!i)return null;const m=new RegExp(`${Fn(r)}\\s*\\(`,"g");let o;for(;(o=m.exec(e))!==null;){const a=o.index,s=a>0?e[a-1]:"";if(s&&/[A-Za-z0-9_$]/.test(s))continue;const g=a+o[0].lastIndexOf("("),c=qn(e,g);if(c===-1)return null;const h=e.slice(0,a)+i+e.slice(c+1);return h===e?null:{old:e,new:h}}return null}function Wn(e,r){return`${r?`@@ ${r} @@
|
|
1
|
+
import{d as oe,o as n,c as l,j as $,g as S,M as mt,i as d,T as Re,ac as ft,k as t,Q as ge,H as he,v as ye,f as P,p as re,q as k,m as L,t as p,F as D,G as pt,r as j,y as ne,s as Ie,_ as Me,h as w,z as ot,B as Be,ad as Le,C as st,b as gt,D as ht,l as Oe,O as Qe,A as qe,aa as Ae,x as vt,U as Ue,ae as Se,K as je,R as yt,ab as xt,af as bt,ag as kt,ah as _t,Z as $t,$ as wt}from"./BrT_Sys2.js";import{_ as Ze}from"./BU6xjw05.js";import{q as Ct,u as St,e as Tt,f as We,v as at,l as Pe,k as Lt,w as At}from"./D7P0ML0H.js";import{_ as It,a as zt}from"./B6hPf4UR.js";import{_ as Ne}from"./CHIbdzqp.js";import{_ as Bt}from"./BciovqwK.js";import{u as Ge}from"./DtXREpk_.js";import{u as Ee}from"./Dvc1aWpA.js";import{_ as Rt}from"./CxLN5Tmq.js";import{_ as Pt}from"./DTH2lteW.js";import{_ as Ot}from"./DpJrGwCr.js";import{l as Ut,i as Et,b as Mt}from"./BcLXUmKT.js";import{_ as rt}from"./Bq0PQfQY.js";import{_ as jt}from"./CoKEjZX7.js";const Nt={class:"flex items-center justify-between gap-2"},Kt=["aria-expanded","title"],Vt={class:"text-lg font-medium inline-flex items-center gap-1 shrink-0"},Dt={key:2,class:"min-w-0 flex-1 truncate text-sm text-gray-500 dark:text-gray-400"},Ht={key:0,class:"flex items-center gap-1 shrink-0"},Ft={key:0,class:"text-sm text-gray-500 mt-1 ml-11"},qt=oe({__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:m,toggle:o,setFolded:a}=Ut(`piwi-section-fold-${i.storageKey}`,i.defaultFolded),s=j(null);function g(){a(!1),pt(()=>s.value?.scrollIntoView({behavior:"smooth",block:"start"}))}return r({setFolded:a,reveal:g}),(c,h)=>{const C=ye,T=It,x=jt;return n(),l("div",{ref_key:"rootEl",ref:s,class:"scroll-mt-4"},[$(x,{ui:{header:"p-3 sm:px-4 sm:py-3",body:t(m)?"p-0 sm:p-0":""},class:re(t(m)&&"divide-y-0")},{header:S(()=>[d("div",Nt,[d("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(m),title:t(m)?"Expand section":"Collapse section",onClick:h[1]||(h[1]=(...A)=>t(o)&&t(o)(...A)),onKeydown:[h[2]||(h[2]=ge((...A)=>t(o)&&t(o)(...A),["enter"])),h[3]||(h[3]=ge(he((...A)=>t(o)&&t(o)(...A),["prevent"]),["space"]))]},[$(C,{name:t(m)?"i-lucide-chevron-right":"i-lucide-chevron-down",class:"size-4 shrink-0 text-gray-400"},null,8,["name"]),e.icon?(n(),P(C,{key:0,name:e.icon,class:re(["size-5 shrink-0",e.iconClass])},null,8,["name","class"])):k("",!0),d("h3",Vt,[L(p(e.title),1),e.count!=null?(n(),l(D,{key:0},[L(" ("+p(e.count)+")",1)],64)):k("",!0)]),e.help?(n(),l("span",{key:1,onClick:h[0]||(h[0]=he(()=>{},["stop"]))},[$(T,{topic:e.help},null,8,["topic"])])):k("",!0),t(m)&&c.$slots.folded?(n(),l("span",Dt,[Re(c.$slots,"folded")])):k("",!0)],40,Kt),c.$slots.actions?(n(),l("div",Ht,[Re(c.$slots,"actions")])):k("",!0)]),!t(m)&&(e.subtitle||c.$slots.subtitle)?(n(),l("p",Ft,[Re(c.$slots,"subtitle",{},()=>[L(p(e.subtitle),1)])])):k("",!0)]),default:S(()=>[mt(d("div",null,[Re(c.$slots,"default")],512),[[ft,!t(m)]])]),_:3},8,["ui","class"])],512)}}}),Ke=Object.assign(qt,{__name:"CollapsibleSectionCard"}),Zt={class:"overflow-x-auto text-xs font-mono"},Wt=oe({__name:"DiffPatch",props:{patch:{}},setup(e){return(r,i)=>(n(),l("div",Zt,[(n(!0),l(D,null,ne(("parsePatchLines"in r?r.parsePatchLines:t(St))(e.patch),(m,o)=>(n(),l("div",{key:o,class:re(["px-3 py-px whitespace-pre leading-5 min-w-0",("patchLineClass"in r?r.patchLineClass:t(Ct))[m.type]])},p(m.text||" "),3))),128))]))}}),Gt=Object.assign(Wt,{__name:"DiffPatch"}),Yt=["role","aria-checked","tabindex"],Jt={class:"flex-1 min-w-0"},Qt=["title"],Xt={key:0,class:"text-[11px] leading-4 text-gray-500 truncate"},en=oe({__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 m(a){const{method:s,score:g,args:c}=a;return c&&(c.anchorTestId||c.anchorSelector||c.anchorRole)?"scoped to a stable ancestor — survives renames":g>=100?"most stable — purpose-built for testing":s==="getByRole"&&c&&!("name"in c)?"name-free role — survives renames":s==="getByRole"?"browser ARIA tree — semantic and stable":s==="getByLabel"?"associated <label> element":s==="getByPlaceholder"?"input placeholder":s==="getByText"?"visible text":s==="getByAltText"?"image alt text":s==="getByTitle"?"title attribute":s==="locator"&&g>=50?"stable selector":s==="locator"?"CSS class — may be fragile":""}const o=w(()=>r.note??m(r.alt));return(a,s)=>{const g=Ie,c=ye,h=Me;return n(),l("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:s[1]||(s[1]=C=>e.selectable&&a.$emit("select")),onKeydown:[s[2]||(s[2]=ge(he(C=>e.selectable&&a.$emit("select"),["prevent"]),["enter"])),s[3]||(s[3]=ge(he(C=>e.selectable&&a.$emit("select"),["prevent"]),["space"]))]},[$(g,{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:S(()=>[L(p(e.alt.score),1)]),_:1},8,["color","class","title"]),d("div",Jt,[d("code",{class:"text-xs font-mono block truncate",title:e.alt.locator},p(e.alt.locator),9,Qt),t(o)?(n(),l("p",Xt,p(t(o)),1)):k("",!0)]),e.alt.pickedByUser&&e.dense?(n(),P(c,{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(g,{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"})):k("",!0),$(h,{size:"xs",variant:"ghost",color:"neutral",icon:e.copied?"i-lucide-check":"i-lucide-copy",title:e.copied?"Copied!":"Copy",class:"shrink-0",onClick:s[0]||(s[0]=he(C=>a.$emit("copy"),["stop"]))},null,8,["icon","title"])],42,Yt)}}}),it=Object.assign(en,{__name:"LocatorAlternativeRow"}),Xe={getByTestId:"testid",getByRole:"semantic",getByLabel:"label",getByPlaceholder:"label",getByText:"text",getByAltText:"text",getByTitle:"text",locator:"css","page.locator":"css"},tn=50;function lt(e,r,i=tn){const m=r[0]??null;if(!m)return{recommended:null,durable:null,preservesConvention:!1,hasDurableAlternative:!1,suggestAddTestId:!1};const o=e?Xe[e]:void 0,a=(e?r.find(c=>c.method===e&&c.score>=i):void 0)??(o?r.find(c=>Xe[c.method]===o&&c.score>=i):void 0),g=r.find(c=>c.pickedByUser)??a??m;return{recommended:g,durable:m,preservesConvention:!!a&&g===a,hasDurableAlternative:g.locator!==m.locator,suggestAddTestId:m.score<i}}const ct={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"},nn={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"},on=["id","class","name","data-testid","placeholder","alt","title","aria-label","aria-level","role","type","href","multiple"];function sn(e){const r=e.attributes.role;if(r)return r;const i=e.tagName;if(!i)return null;if(i==="input"){const m=(e.attributes.type??"text").toLowerCase();return nn[m]??"textbox"}return i==="select"?e.attributes.multiple!=null?"listbox":"combobox":i==="a"?e.attributes.href!=null?"link":null:ct[i]??null}function an(e,r){if(r!=="heading")return null;const i=e.tagName.match(/^h([1-6])$/);if(i)return Number(i[1]);const m=e.attributes["aria-level"];return m&&/^\d+$/.test(m)?Number(m):null}const $e=(e,r)=>e.attributes[r]||null,pe=e=>e.replace(/\\/g,"\\\\").replace(/'/g,"\\'"),He=e=>e.replace(/\\/g,"\\\\").replace(/"/g,'\\"'),et=e=>/^[A-Za-z][A-Za-z0-9_-]*$/.test(e);function rn(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 tt(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 ln(e){const r=[],i=new Set,m=y=>{i.has(y.locator)||(i.add(y.locator),r.push(y))},{accessibleName:o}=e,a=e.tagName,s=sn(e),g=e.selectorCounts,c=y=>y==null||y<=1,h=e.textContent?e.textContent.replace(/\s+/g," ").trim():null,C=$e(e,"data-testid");C&&c(g?.testId)&&m({locator:`getByTestId('${pe(C)}')`,method:"getByTestId",args:{testId:C},score:100});const T=an(e,s),x=T!=null?`, level: ${T}`:"",A=y=>T!=null?{...y,level:T}:y;s&&o&&m({locator:`getByRole('${s}', { name: '${pe(o)}'${x} })`,method:"getByRole",args:A({role:s,name:o}),score:90});const z=$e(e,"aria-label");if(s&&z&&z!==o&&m({locator:`getByRole('${s}', { name: '${pe(z)}'${x} })`,method:"getByRole",args:A({role:s,name:z}),score:85}),o&&["input","select","textarea"].includes(a)){const y=$e(e,"aria-label");(e.hasLabel===void 0||e.hasLabel===!0||y===o)&&m({locator:`getByLabel('${pe(o)}')`,method:"getByLabel",args:{label:o},score:85})}const B=$e(e,"placeholder");B&&m({locator:`getByPlaceholder('${pe(B)}')`,method:"getByPlaceholder",args:{placeholder:B},score:80}),h&&h.length<80&&m({locator:`getByText('${pe(h)}')`,method:"getByText",args:{text:h},score:75});const Z=$e(e,"id");if(Z&&!tt(Z)&&c(g?.id)){const y=et(Z)?`#${Z}`:`[id="${He(Z)}"]`;m({locator:`locator('${pe(y)}')`,method:"locator",args:{selector:y},score:65})}const Y=$e(e,"name");if(Y&&c(g?.name)){const y=`[name="${He(Y)}"]`;m({locator:`locator('${pe(y)}')`,method:"locator",args:{selector:y},score:60})}const E=$e(e,"alt");E&&m({locator:`getByAltText('${pe(E)}')`,method:"getByAltText",args:{text:E},score:60});const O=$e(e,"title");O&&m({locator:`getByTitle('${pe(O)}')`,method:"getByTitle",args:{title:O},score:50});const ce=!!(C&&c(g?.testId));if(s&&!ce){const y=T!=null?`'${s}', { level: ${T} }`:`'${s}'`,H=A({role:s});let M=!1,K=!1,W=!1;for(const Q of e.ancestors??[]){if(Q.scopedRoleCount!==1)continue;if(!M&&Q.testId&&Q.testIdCount===1&&(M=!0,m({locator:`getByTestId('${pe(Q.testId)}').getByRole(${y})`,method:"getByRole",args:{...H,anchorTestId:Q.testId},score:72})),!K&&Q.id&&!tt(Q.id)&&Q.idCount===1){K=!0;const xe=et(Q.id)?`#${Q.id}`:`[id="${He(Q.id)}"]`;m({locator:`locator('${pe(xe)}').getByRole(${y})`,method:"getByRole",args:{...H,anchorSelector:xe},score:64})}const ve=Q.role||ct[Q.tag]||null;!W&&ve&&ve!==s&&Q.roleCount===1&&(W=!0,m({locator:`getByRole('${pe(ve)}').getByRole(${y})`,method:"getByRole",args:{...H,anchorRole:ve},score:55}))}const F=e.rolePosition;F&&F.role===s&&(F.count===1||T!=null&&F.levelCount===1)&&m({locator:`getByRole(${y})`,method:"getByRole",args:H,score:58})}const ee=$e(e,"class");if(ee){const y=g?.classes,H=ee.split(/\s+/).filter(M=>M.length>1&&/^[A-Za-z_-][A-Za-z0-9_-]*$/.test(M)&&c(y?.[M])).map(M=>({cls:M,score:rn(M)})).sort((M,K)=>K.score-M.score).slice(0,3);for(const{cls:M,score:K}of H)m({locator:`locator('.${pe(M)}')`,method:"locator",args:{selector:`.${M}`},score:K})}return r.sort((y,H)=>H.score-y.score)}function cn(e){const r=e.attributes,i=r["aria-label"];if(i)return i;if(e.textContent)return e.textContent;const m=r.title;if(m)return m;const o=r.placeholder;return o||null}function un(e){if(window.__piwiPickerInstalled)return;window.__piwiPickerInstalled=!0;var r=document,i=window,m=2147483600,o=e.probedAttrs,a=r.createElement("div");a.id="__piwi_picker_highlight",a.style.cssText="position:fixed;pointer-events:none;z-index:"+m+";display:none;box-sizing:border-box;border:2px solid #7c3aed;background:rgba(124,58,237,.12);border-radius:3px;",r.body.appendChild(a);var s=r.createElement("div");s.id="__piwi_picker_banner",s.style.cssText="position:fixed;top:12px;left:50%;transform:translateX(-50%);z-index:"+(m+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;",s.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(s),i.parent.postMessage({type:"pickerReady"},"*");function g(u){var b=(u.tagName||"?").toLowerCase(),I=u.getAttribute&&u.getAttribute("data-testid");if(I)return"getByTestId('"+I+"')";if(u.labels&&u.labels.length>0){var U=(u.labels[0].textContent||"").replace(/\s+/g," ").trim().slice(0,80);if(U)return"getByLabel('"+U+"')"}var X=u.getAttribute&&u.getAttribute("aria-label");if(X)return"getByLabel('"+X+"')";var J=u.getAttribute&&u.getAttribute("placeholder");if(J)return"getByPlaceholder('"+J+"')";var q=u.getAttribute&&u.getAttribute("alt");if(q)return"getByAltText('"+q+"')";var ae=u.getAttribute&&u.getAttribute("title");if(ae)return"getByTitle('"+ae+"')";if(u.id)return"locator('#"+u.id+"')";var fe=(u.getAttribute&&u.getAttribute("class")||"").split(/\s+/).find(function(_){return _.length>1});return fe?"locator('."+fe+"')":b}function c(u){for(var b=[],I=u;I&&b.length<15;){var U=(I.tagName||"").toLowerCase();if(U==="body"||U==="html")break;b.push(I),I=I.parentElement}return b.length?b:[u]}var h=["button","a","input","select","textarea","summary","option"];function C(u){for(var b=0;b<Math.min(u.length,4);b++){var I=u[b],U=(I.tagName||"").toLowerCase();if(h.indexOf(U)!==-1||I.getAttribute&&(I.getAttribute("role")||I.getAttribute("data-testid")))return b}return 0}var T=[],x=0,A=null;function z(){return T[x]||null}function B(){var u=z();if(!u){a.style.display="none";return}var b=u.getBoundingClientRect();a.style.display="block",a.style.left=b.left+"px",a.style.top=b.top+"px",a.style.width=b.width+"px",a.style.height=b.height+"px";var I=r.getElementById("__piwi_picker_foot");I&&(I.textContent=g(u)+" — click to pick · ↑ parent · ↓ child · Esc skip")}var Z=s.querySelector("[style*=margin]");Z&&(Z.id="__piwi_picker_foot");function Y(u){for(var b={},I=0;I<o.length;I++){var U=o[I],X=u.getAttribute(U)||u[U];b[U]=typeof X=="string"?X.slice(0,200):X?String(X).slice(0,200):null}var J=u.getBoundingClientRect(),q={};try{var ae=function(we){return i.CSS.escape(we)},fe=function(we){try{return r.querySelectorAll(we).length}catch{return}};b["data-testid"]&&(q.testId=fe("[data-testid="+JSON.stringify(b["data-testid"])+"]")),b.id&&(q.id=fe("#"+ae(b.id))),b.name&&(q.name=fe("[name="+JSON.stringify(b.name)+"]"));var _=(b.class||"").split(/\s+/).filter(function(we){return we.length>1}).slice(0,10);if(_.length>0){for(var v={},G=0;G<_.length;G++){var le=fe("."+ae(_[G]));le!==void 0&&(v[_[G]]=le)}q.classes=v}}catch{}var Ve=null;return u.labels&&u.labels.length>0&&(Ve=(u.labels[0].textContent||"").replace(/\s+/g," ").trim().slice(0,120)||null),{tagName:(u.tagName||"").toLowerCase(),attributes:b,textContent:(u.textContent||"").replace(/\s+/g," ").trim().slice(0,80)||null,center:{x:Math.round(J.x+J.width/2),y:Math.round(J.y+J.height/2)},hasLabel:!!(u.labels&&u.labels.length>0),labelText:Ve,selectorCounts:q}}function E(u){u.preventDefault(),u.stopImmediatePropagation()}function O(u){return u===s||u===a||s.contains&&s.contains(u)||u&&u.__piwiHint}var ce="top";function ee(u){ce!==u&&(ce=u,u==="bottom"?(s.style.top="auto",s.style.bottom="12px"):(s.style.top="12px",s.style.bottom="auto"))}function y(u){var b=u.target;if(!b||O(b)){a.style.display="none";return}b!==A&&(A=b,T=c(b),x=C(T)),B();var I=z();if(I){var U=I.getBoundingClientRect(),X=s.getBoundingClientRect(),J=8;U.left<X.right+J&&U.right>X.left-J&&U.top<X.bottom+J&&U.bottom>X.top-J&&ee(ce==="top"?"bottom":"top")}}function H(u){if(u==="Escape"){Te();return}u==="ArrowUp"&&(x=Math.min(x+1,T.length-1),B()),u==="ArrowDown"&&(x=Math.max(x-1,0),B())}function M(u){(u.key==="Escape"||u.key==="ArrowUp"||u.key==="ArrowDown")&&(E(u),H(u.key))}var K=[];function W(){for(var u=0;u<K.length;u++)K[u].parentNode&&K[u].parentNode.removeChild(K[u]);K=[]}function F(u){return(u||"").replace(/\s+/g," ").trim().toLowerCase()}function Q(u){var b=F(u);if(b.length<2)return[];for(var I=r.querySelectorAll("button,a,[role],h1,h2,h3,h4,h5,h6,label,summary,input,textarea,select,option,span,li,td,th,p"),U=[],X=[],J=0;J<I.length;J++){var q=I[J],ae=F(q.textContent);if(!ae){var fe=F(q.getAttribute&&(q.getAttribute("placeholder")||q.getAttribute("aria-label"))||"");fe&&(fe===b||fe.indexOf(b)!==-1)&&U.push(q);continue}ae.length>120||(ae===b?U.push(q):ae.indexOf(b)!==-1&&ae.length<b.length+30&&X.push(q))}return U.concat(X)}function ve(u,b){var I=u.getBoundingClientRect();if(I.width===0&&I.height===0)return null;var U=r.createElement("div");return U.__piwiHint=!0,U.style.cssText="position:fixed;pointer-events:none;z-index:"+(m+1)+";box-sizing:border-box;border-radius:3px;transition:opacity .3s;border:2px solid "+b+";box-shadow:0 0 0 3px "+b+"55;left:"+I.left+"px;top:"+I.top+"px;width:"+I.width+"px;height:"+I.height+"px;",r.body.appendChild(U),K.push(U),U}function xe(u){var b=u.getBoundingClientRect();i.parent.postMessage({type:"piwiScrollTo",y:b.top},"*")}function ze(u){if(W(),!(!u||!u.length)){for(var b=null,I=0;I<u.length;I++)for(var U=u[I],X=Q(U&&U.text),J=0;J<Math.min(X.length,3);J++)ve(X[J],"#f59e0b"),b||(b=X[J]);b&&xe(b),setTimeout(function(){for(var q=0;q<K.length;q++)K[q].style.opacity="0"},2600),setTimeout(W,3e3)}}var te=[],ke=0;function R(){i.parent.postMessage({type:"piwiSearchResult",count:te.length,index:te.length?ke:-1},"*")}function f(){W();var u=te[ke];u&&(ve(u,"#7c3aed"),xe(u),R())}function N(u){if(te=Q(u),ke=0,!te.length){W(),R();return}f()}function be(){te.length&&(ke=(ke+1)%te.length,f())}function me(u){var b=u.data;if(!(!b||typeof b.type!="string")){if(b.type==="piwiPickerKey"&&typeof b.key=="string")H(b.key);else if(b.type==="piwiHighlight")try{ze(b.hints)}catch{}else if(b.type==="piwiSearch")try{N(b.q)}catch{}else if(b.type==="piwiSearchNext")try{be()}catch{}else if(b.type==="piwiClearHints")try{W()}catch{}}}function ue(u){E(u);var b=z();if(!(!b||O(u.target))){var I=Y(b);a.style.display="none",W(),s.innerHTML='<div style="text-align:center;color:#9ca3af;">Analyzing element…</div>',Ce(),i.parent.postMessage({type:"elementPicked",attrs:I},"*")}}var _e=["mousedown","mouseup","pointerdown","pointerup","auxclick","dblclick"];function Ce(){r.removeEventListener("mousemove",y,!0),r.removeEventListener("click",ue,!0),r.removeEventListener("keydown",M,!0),i.removeEventListener("message",me,!1);for(var u=0;u<_e.length;u++)r.removeEventListener(_e[u],E,!0)}function Te(){Ce(),W(),a.remove(),s.remove(),i.parent.postMessage({type:"pickerClosed"},"*")}r.addEventListener("mousemove",y,!0),r.addEventListener("click",ue,!0),r.addEventListener("keydown",M,!0),i.addEventListener("message",me,!1);for(var se=0;se<_e.length;se++)r.addEventListener(_e[se],E,!0);function V(){var u=Math.max(r.documentElement?r.documentElement.scrollHeight:0,r.body?r.body.scrollHeight:0);u>0&&i.parent.postMessage({type:"piwiContentHeight",height:u},"*")}V();try{if(i.ResizeObserver){var ie=new i.ResizeObserver(V);r.documentElement&&ie.observe(r.documentElement),r.body&&ie.observe(r.body)}}catch{}}function dn(e){const r=[],i=new Set,m=a=>{if(typeof a!="string")return;const s=a.trim();if(s.length<2||s.length>80)return;const g=s.toLowerCase();i.has(g)||(i.add(g),r.push({text:s}))},o=a=>a&&(a.name??a.text??a.label??a.placeholder??a.alt??a.title);m(o(e.failingLocator?.args));for(const a of e.fromElementMatch??[])m(o(a.args));for(const a of e.fromAriaSnapshot??[])m(o(a.args));return r.slice(0,6)}function mn(e){return`<script>(${String(un).replace(/<\/(script)/gi,"<\\/$1")})(${JSON.stringify(e)})<\/script>`}function fn(e){return e.replace(/<base\b[^>]*>/gi,"")}function pn(e,r){return fn(e)+mn(r)}const gn={key:0,class:"flex items-center justify-center py-20"},hn={key:1,class:"py-8 text-center"},vn={class:"text-xs text-gray-400 mt-1"},yn={key:2,class:"py-8 text-center"},xn={class:"mb-2 flex items-center gap-2 flex-wrap"},bn={key:1,class:"ml-auto inline-flex rounded-md border border-default overflow-hidden text-xs"},kn={key:0,class:"flex items-center gap-1 mb-1.5 text-xs text-gray-500"},_n={class:"tabular-nums w-11 text-center select-none"},$n={class:"ml-auto text-gray-400 tabular-nums"},wn={key:1,class:"flex items-center gap-2 mb-1.5"},Cn={key:0,class:"text-xs text-gray-500 tabular-nums"},Sn={key:1,class:"text-xs text-gray-400"},Tn={key:0,class:"absolute inset-0 flex items-center justify-center bg-white dark:bg-gray-900 z-10"},Ln=["src"],An={key:2,class:"mt-4 space-y-3"},In={class:"flex items-center gap-3 bg-elevated rounded-lg p-3"},zn={class:"flex-1 min-w-0"},Bn={class:"text-sm font-medium"},Rn={class:"text-xs"},Pn={key:0,class:"text-xs text-gray-400 ml-1"},On={key:0,class:"text-xs text-gray-500 mt-0.5 truncate"},Un={class:"space-y-1",role:"radiogroup","aria-label":"Alternative locators"},En={class:"flex-1 min-w-0"},Mn={class:"text-xs font-medium text-primary"},jn={class:"text-sm font-mono block truncate mt-0.5"},Nn={class:"flex justify-between w-full"},Kn={key:1},Vn={class:"flex gap-2"},Dn=oe({__name:"SnapshotLocatorPicker",props:qe({runId:{},testRunsCaseId:{},failingLocator:{},healing:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:qe(["close","confirmed"],["update:open"]),setup(e,{emit:r}){const i=e,m=r,o=ot(e,"open"),a=j(!1),s=j(null),g=j(null),c=j(void 0);async function h(){a.value=!0,g.value=null;try{const _=c.value?`?source=${c.value}`:"";s.value=await $fetch(`/api/test-runs/${i.runId}/cases/${i.testRunsCaseId}/dom-snapshot${_}`),s.value?.source&&(c.value=s.value.source)}catch(_){g.value=_ instanceof Error?_.message:"Unknown error"}finally{a.value=!1}}const C=w(()=>s.value?.availableSources??[]);function T(_){_===c.value||a.value||(c.value=_,z.value=!1,x.value="pick-element",ee.value=0,H.value=!1,B.value=null,Z.value=[],se.value=null,N.value="",be.value=0,me.value=-1,h())}Be(o,_=>{_&&(s.value=null,z.value=!1,x.value="pick-element",ee.value=0,H.value=!1,c.value=void 0,B.value=null,Z.value=[],se.value=null,N.value="",be.value=0,me.value=-1,h())});const x=j("pick-element"),A=j(null),z=j(!1),B=j(null),Z=j([]),Y=j(void 0);function E(_){return URL.createObjectURL(new Blob([pn(_,{probedAttrs:on})],{type:"text/html"}))}Be(()=>s.value?.html,_=>{Y.value&&(URL.revokeObjectURL(Y.value),Y.value=void 0),_&&(Y.value=E(_))},{immediate:!0});const O=j(null),ce=j(0),ee=j(0),y=j(1),H=j(!1),M=w(()=>s.value?.viewport??null),K=w(()=>{const _=M.value;return!_?.width||!ce.value?1:Math.min(ce.value/_.width,1)}),W=w(()=>{const _=M.value;if(!_)return{width:"100%",height:ee.value?`${ee.value}px`:"100%"};const v=ee.value||_.height;return{width:`${Math.round(_.width*y.value)}px`,height:`${Math.round(v*y.value)}px`}}),F=w(()=>{const _=M.value;if(!_)return{width:"100%",height:ee.value?`${ee.value}px`:"100%",border:"0"};const v=ee.value||_.height;return{width:`${_.width}px`,height:`${v}px`,transform:`scale(${y.value})`,transformOrigin:"top left",border:"0"}}),Q=w(()=>Math.round(y.value*100)),ve=_=>Math.min(4,Math.max(.1,_));function xe(_){H.value=!0,y.value=ve(y.value*_)}function ze(){H.value=!1,y.value=K.value}Be([K,M],()=>{H.value||(y.value=K.value)});let te=null;Be(O,_=>{te?.disconnect(),_&&(ce.value=_.clientWidth,te=new ResizeObserver(v=>{for(const G of v)ce.value=G.contentRect.width}),te.observe(_))}),Le(()=>{te?.disconnect()}),Le(()=>{Y.value&&URL.revokeObjectURL(Y.value)});function ke(_){if(!A.value||_.source!==A.value.contentWindow)return;const v=_.data;if(v?.type==="pickerReady"){z.value=!0,f();return}if(v?.type==="piwiContentHeight"&&typeof v.height=="number"){ee.value=Math.max(v.height,M.value?.height??0);return}if(v?.type==="piwiScrollTo"&&typeof v.y=="number"){const G=O.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,me.value=typeof v.index=="number"?v.index:-1;return}if(v?.type==="elementPicked"&&v.attrs){const{labelText:G,...le}=v.attrs;B.value={...le,accessibleName:G??cn(le)},Z.value=ln(B.value),se.value=null,x.value="review"}v?.type==="pickerClosed"&&U()}function R(_){A.value?.contentWindow?.postMessage(_,"*")}function f(){const _=dn({failingLocator:i.failingLocator,fromElementMatch:i.healing?.fromElementMatch??null,fromAriaSnapshot:i.healing?.fromAriaSnapshot??null});_.length&&R({type:"piwiHighlight",hints:_})}const N=j(""),be=j(0),me=j(-1);let ue=null;Be(N,_=>{ue&&clearTimeout(ue),ue=setTimeout(()=>R({type:"piwiSearch",q:_}),180)});function _e(){R({type:"piwiSearchNext"})}Le(()=>{ue&&clearTimeout(ue)});function Ce(_){if(!o.value||x.value!=="pick-element"||!z.value||_.key!=="ArrowUp"&&_.key!=="ArrowDown")return;const v=(document.activeElement?.tagName??"").toLowerCase();if(v==="input"||v==="textarea")return;const G=A.value?.contentWindow;G&&(_.preventDefault(),G.postMessage({type:"piwiPickerKey",key:_.key},"*"))}function Te(){A.value&&(A.value.src="about:blank")}st(()=>{window.addEventListener("message",ke),window.addEventListener("keydown",Ce,!0)}),Le(()=>{window.removeEventListener("message",ke),window.removeEventListener("keydown",Ce,!0)});const se=j(null),V=j(!1);function ie(_){se.value=_}const u=w(()=>lt(i.failingLocator.method,Z.value)),b=gt();async function I(){if(se.value){V.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:B.value}})).status==="ok"?m("confirmed",se.value):b.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"}),o.value=!1}catch(_){b.add({title:"Could not save the pick",description:Tt(_),color:"error",icon:"i-lucide-alert-triangle"})}finally{V.value=!1}}}function U(){Te(),o.value=!1}function X(){B.value=null,Z.value=[],se.value=null,x.value="pick-element",z.value=!1,N.value="",be.value=0,me.value=-1;const _=s.value?.html;_&&(Y.value&&URL.revokeObjectURL(Y.value),Y.value=E(_))}const{copy:J}=Ge(),q=j(null);let ae=null;function fe(_,v){J(_,{toast:"Locator copied"}),q.value=v,ae&&clearTimeout(ae),ae=setTimeout(()=>{q.value=null},2e3)}return Le(()=>{ae&&clearTimeout(ae)}),(_,v)=>{const G=ye,le=Me,Ve=ht,we=Ie,Je=Bt;return n(),P(Je,{open:o.value,"onUpdate:open":v[8]||(v[8]=de=>o.value=de),ui:{content:"max-w-6xl w-[95vw]"},onAfterLeave:U},{header:S(()=>[...v[9]||(v[9]=[d("div",null,[d("h3",{class:"text-lg font-medium"},"Pick a locator from the DOM snapshot"),d("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:S(()=>[t(a)?(n(),l("div",gn,[$(G,{name:"i-lucide-loader",class:"size-6 animate-spin text-gray-400"}),v[10]||(v[10]=d("span",{class:"ml-2 text-sm text-gray-500"},"Loading DOM snapshot...",-1))])):t(g)?(n(),l("div",hn,[$(G,{name:"i-lucide-alert-triangle",class:"size-8 text-red-300 mx-auto mb-2"}),v[12]||(v[12]=d("p",{class:"text-sm text-red-500"},"Failed to load snapshot",-1)),d("p",vn,p(t(g)),1),$(le,{size:"xs",variant:"outline",color:"neutral",class:"mt-3",onClick:h},{default:S(()=>[...v[11]||(v[11]=[L("Retry",-1)])]),_:1})])):t(s)?.status!=="ok"||!t(s).html?(n(),l("div",yn,[$(G,{name:"i-lucide-file-x",class:"size-8 text-gray-300 mx-auto mb-2"}),v[13]||(v[13]=d("p",{class:"text-sm text-gray-500"},"No DOM snapshot or ARIA data available for this execution",-1)),v[14]||(v[14]=d("p",{class:"text-xs text-gray-400 mt-1"},"This test run has no stored trace or ARIA snapshot to pick from.",-1))])):(n(),l(D,{key:3},[d("div",xn,[t(s).source?(n(),l("div",{key:0,class:re(["text-xs flex items-center gap-1",t(s).source==="aria"?"text-amber-600 dark:text-amber-400":"text-green-600 dark:text-green-400"])},[$(G,{name:t(s).source==="aria"?"i-lucide-accessibility":"i-lucide-check",class:"size-3.5 shrink-0"},null,8,["name"]),t(s).source==="aria"?(n(),l(D,{key:0},[L(" Accessibility tree from the failure-time ARIA snapshot — element styles are approximate ")],64)):(n(),l(D,{key:1},[L(" Rendered from the failure-time DOM snapshot ")],64))],2)):k("",!0),t(C).length>1?(n(),l("div",bn,[d("button",{type:"button",class:re(["px-2 py-1 flex items-center gap-1 transition-colors",t(c)==="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=>T("dom"))},[$(G,{name:"i-lucide-layout-panel-top",class:"size-3.5"}),v[15]||(v[15]=L(" DOM ",-1))],2),d("button",{type:"button",class:re(["px-2 py-1 flex items-center gap-1 border-l border-default transition-colors",t(c)==="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=>T("aria"))},[$(G,{name:"i-lucide-accessibility",class:"size-3.5"}),v[16]||(v[16]=L(" Tree ",-1))],2)])):k("",!0)]),t(M)?(n(),l("div",kn,[$(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))}),d("span",_n,p(t(Q))+"%",1),$(le,{size:"xs",variant:"ghost",color:"neutral",icon:"i-lucide-zoom-in",title:"Zoom in",onClick:v[3]||(v[3]=de=>xe(1.25))}),$(le,{size:"xs",variant:"outline",color:"neutral",class:"ml-1",onClick:ze},{default:S(()=>[...v[17]||(v[17]=[L("Fit",-1)])]),_:1}),d("span",$n,p(t(M).width)+"×"+p(t(M).height),1)])):k("",!0),t(x)==="pick-element"?(n(),l("div",wn,[$(Ve,{modelValue:t(N),"onUpdate:modelValue":v[4]||(v[4]=de=>Oe(N)?N.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(N)&&t(be)>0?(n(),l("span",Cn,p(t(me)+1)+"/"+p(t(be)),1)):t(N)?(n(),l("span",Sn,"no matches")):k("",!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})):k("",!0)])):k("",!0),d("div",{ref_key:"stageRef",ref:O,class:re(["relative border border-default rounded-lg overflow-auto",[t(x)==="pick-element"?"h-[75vh]":"h-80",t(M)?"bg-gray-100 dark:bg-gray-800":""]])},[t(z)?k("",!0):(n(),l("div",Tn,[$(G,{name:"i-lucide-loader",class:"size-5 animate-spin text-gray-400"}),v[18]||(v[18]=d("span",{class:"ml-2 text-sm text-gray-500"},"Initializing picker...",-1))])),d("div",{style:Qe(t(W))},[d("iframe",{ref_key:"iframeRef",ref:A,src:t(Y),style:Qe(t(F)),class:"bg-white",sandbox:"allow-scripts",title:"DOM snapshot"},null,12,Ln)],4)],2),t(x)==="review"&&t(B)?(n(),l("div",An,[d("div",In,[$(G,{name:"i-lucide-crosshair",class:"size-5 text-primary shrink-0"}),d("div",zn,[d("p",Bn,[v[19]||(v[19]=L(" Picked: ",-1)),d("code",Rn,p(t(B).tagName),1),t(B).attributes.id?(n(),l("code",Pn,"#"+p(t(B).attributes.id),1)):k("",!0),t(B).attributes["data-testid"]?(n(),P(we,{key:1,size:"xs",color:"primary",variant:"subtle",class:"ml-1"},{default:S(()=>[L(p(t(B).attributes["data-testid"]),1)]),_:1})):k("",!0)]),t(B).textContent?(n(),l("p",On,' "'+p(t(B).textContent)+'" ',1)):k("",!0)]),$(le,{size:"xs",variant:"ghost",color:"neutral",icon:"i-lucide-rotate-ccw",title:"Pick a different element",onClick:X})]),d("div",Un,[(n(!0),l(D,null,ne(t(Z),(de,De)=>(n(),P(it,{key:De,alt:de,copied:t(q)===`picked-${De}`,dense:!0,selectable:!0,selected:t(se)?.locator===de.locator,onCopy:dt=>fe(de.locator,`picked-${De}`),onSelect:dt=>ie(de)},null,8,["alt","copied","selected","onCopy","onSelect"]))),128))]),t(u).recommended?(n(),l("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(u).recommended)),onKeydown:v[7]||(v[7]=ge(he(de=>ie(t(u).recommended),["prevent"]),["enter"]))},[$(G,{name:"i-lucide-star",class:"size-5 text-primary shrink-0"}),d("div",En,[d("p",Mn," Recommended (score: "+p(t(u).recommended.score)+") ",1),d("code",jn,p(t(u).recommended.locator),1)]),$(le,{size:"sm",color:"primary",variant:"solid","trailing-icon":t(q)==="rec"?"i-lucide-check":"i-lucide-copy",onClick:v[5]||(v[5]=he(de=>fe(t(u).recommended.locator,"rec"),["stop"]))},{default:S(()=>[...v[20]||(v[20]=[L(" Copy ",-1)])]),_:1},8,["trailing-icon"])],32)):k("",!0)])):k("",!0)],64))]),footer:S(()=>[d("div",Nn,[t(x)==="review"?(n(),P(le,{key:0,size:"sm",variant:"outline",color:"neutral",icon:"i-lucide-rotate-ccw",onClick:X},{default:S(()=>[...v[21]||(v[21]=[L(" Pick a different element ",-1)])]),_:1})):(n(),l("div",Kn)),d("div",Vn,[$(le,{size:"sm",variant:"outline",color:"neutral",onClick:U},{default:S(()=>[...v[22]||(v[22]=[L("Cancel",-1)])]),_:1}),t(x)==="review"?(n(),P(le,{key:0,size:"sm",color:"primary",loading:t(V),disabled:!t(se),onClick:I},{default:S(()=>[...v[23]||(v[23]=[L(" Confirm pick ",-1)])]),_:1},8,["loading","disabled"])):k("",!0)])])]),_:1},8,["open"])}}}),Hn=Object.assign(Dn,{__name:"SnapshotLocatorPicker"});function Fn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qn(e,r){let i=0,m=null;for(let o=r;o<e.length;o++){const a=e[o];if(m){if(a==="\\"){o++;continue}a===m&&(m=null);continue}if(a==="'"||a==='"'||a==="`"){m=a;continue}if(a==="(")i++;else if(a===")"&&(i--,i===0))return o}return-1}function Zn(e,r,i){if(!e||!r||!i)return null;const m=new RegExp(`${Fn(r)}\\s*\\(`,"g");let o;for(;(o=m.exec(e))!==null;){const a=o.index,s=a>0?e[a-1]:"";if(s&&/[A-Za-z0-9_$]/.test(s))continue;const g=a+o[0].lastIndexOf("("),c=qn(e,g);if(c===-1)return null;const h=e.slice(0,a)+i+e.slice(c+1);return h===e?null:{old:e,new:h}}return null}function Wn(e,r){return`${r?`@@ ${r} @@
|
|
2
2
|
`:""}-${e.old.trimEnd()}
|
|
3
3
|
+${e.new.trimEnd()}`}function Gn(e,r){const i=e??{},m=r??{},o=s=>s==null?null:typeof s=="string"?s:JSON.stringify(s),a=[];for(const s of new Set([...Object.keys(i),...Object.keys(m)])){const g=o(i[s]),c=o(m[s]);g!==c&&a.push({key:s,from:g,to:c})}return a}function Yn(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
4
|
`)}const Jn={key:0,class:"text-xs font-mono"},Qn={key:1},Xn={class:"flex items-center gap-1"},eo={key:1,class:"rounded-lg border border-primary/50 bg-primary/10 p-3 mb-3 flex items-center gap-3"},to={class:"flex-1 min-w-0"},no={class:"text-xs font-medium text-primary flex items-center gap-1.5"},oo={class:"text-sm font-mono block truncate mt-0.5"},so={key:2,class:"flex items-center gap-2 bg-elevated rounded p-2 mb-3 border border-red-200 dark:border-red-800"},ao={class:"text-xs font-mono text-red-600 dark:text-red-400 flex-1 truncate"},ro={key:4,class:"rounded-lg border border-primary/40 bg-primary/5 p-3 mb-3 space-y-2"},io={class:"flex items-center gap-2 min-w-0"},lo={key:0,class:"text-[11px] text-gray-500 truncate min-w-0"},co={key:0,class:"rounded border border-default overflow-hidden bg-default"},uo={class:"text-sm font-mono block truncate"},mo={key:0,class:"text-xs flex flex-wrap items-center gap-x-1.5 gap-y-0.5"},fo={class:"font-mono text-gray-500"},po={key:0,class:"font-mono text-red-500 line-through"},go={key:1,class:"text-gray-400"},ho={key:2,class:"font-mono text-green-600 dark:text-green-400"},vo={key:3,class:"text-gray-400"},yo={key:2,class:"text-xs text-gray-500"},xo={key:3,class:"text-xs text-primary/90 flex items-center gap-1"},bo={class:"flex items-center gap-2"},ko={key:5,class:"rounded-lg border border-default bg-elevated p-3 mb-3 flex items-center gap-3"},_o={class:"flex-1 min-w-0"},$o={class:"text-xs font-medium text-success-600 dark:text-success-400"},wo={class:"text-sm font-mono block truncate mt-0.5"},Co={class:"space-y-2"},So={key:6,class:"mt-3"},To={class:"space-y-2"},Lo={class:"flex items-center gap-1"},nt=3,Ao=oe({__name:"LocatorHealingPanel",props:{runId:{},testRunsCaseId:{},storageKey:{},affectedCount:{}},setup(e){const r=e,i=w(()=>r.storageKey?Ke:Ne),m=w(()=>r.storageKey?{storageKey:r.storageKey}:{}),{data:o,pending:a,error:s}=Ee(()=>`/api/test-runs/${r.runId}/cases/${r.testRunsCaseId}/locator-healing`,{lazy:!0},"$z1C7vU2CXe"),g=w(()=>!!o.value&&o.value.source!=="none"&&!!(o.value.fromElementMatch?.length||o.value.fromPriorSuccess?.length||o.value.fromAriaSnapshot?.length)),c=w(()=>o.value?o.value.fromElementMatch??o.value.fromPriorSuccess??o.value.fromAriaSnapshot??[]:[]),h=w(()=>c.value.find(R=>R.pickedByUser)??null),C=w(()=>o.value?.recommendation?o.value.recommendation:o.value?.priorNameMayBeStale||!c.value.length?null:lt(o.value?.failingLocator?.method,c.value)),T=w(()=>o.value?.priorNameMayBeStale&&o.value.fromPriorSuccess?.length?o.value.fromAriaSnapshot??[]:[]),x=w(()=>{const R=C.value;return R?.recommended?R.recommended.pickedByUser?"Confirmed with the locator picker on the failing page":R.preservesConvention?"Keeps your original locator style — minimal, idiomatic edit":R.suggestAddTestId?"Most stable available, but still fragile":"Most stable available — a sturdier style than the original":""}),A=w(()=>{const R=o.value?.priorNameMayBeStale,f=(()=>{switch(o.value?.source){case"prior-run":return R?"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""}})(),N=o.value?.capturedAt;return N?`${f} · captured ${We(N)}`:f}),z=w(()=>{if(o.value?.priorNameMayBeStale)return"text-warning-600 dark:text-warning-400";switch(o.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"}}),B=w(()=>{const R=o.value?.failingLocator;return R?`${R.method}(${JSON.stringify(R.args)})`:""}),Z=je(),{data:Y}=Ee(()=>`/api/test-run-cases/${r.testRunsCaseId}/traces`,{lazy:!0},"$vsBboELop9"),E=w(()=>{const R=Y.value?.[0];if(!R)return null;const f=!!Z.public.demoMode&&R.filePath.startsWith("demo/");return at(R.filePath,Z.app?.baseURL,f)}),O=j(!1);async function ce(){await yt(`/api/test-runs/${r.runId}/cases/${r.testRunsCaseId}/locator-healing`)}const{copy:ee}=Ge(),y=j(null);let H=null;function M(R,f,N){ee(R,{toast:N}),y.value=f,H&&clearTimeout(H),H=setTimeout(()=>{y.value=null},2e3)}function K(R,f){M(R,f,"Locator copied")}Le(()=>{H&&clearTimeout(H)});const W=w(()=>C.value?.recommended??null),F=w(()=>r.affectedCount&&r.affectedCount>1&&W.value?`Same break affects ${r.affectedCount} tests in this cluster — one fix`:""),Q=w(()=>{if(W.value?.pickedByUser)return"your confirmed pick";switch(o.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=w(()=>{const R=o.value?.sourceLine,f=W.value;if(!R||!f)return null;const N=Zn(R.text,o.value?.failingLocator?.method,f.locator);return N?{edit:N,patch:Wn(N,o.value?.location??null)}:null}),xe=w(()=>{if(ve.value)return[];const R=o.value?.failingLocator,f=W.value;return!R||!f||f.method!==R.method?[]:Gn(R.args,f.args)});function ze(){const R=W.value;!R||!o.value||M(Yn({location:o.value.location??null,sourceLine:o.value.sourceLine??null,failing:B.value,recommended:R.locator}),"fix-prompt","Fix prompt copied")}const te=j(!1),ke=w(()=>te.value?c.value:c.value.slice(0,nt));return(R,f)=>{const N=Me,be=vt,me=Ze,ue=ye,_e=Ie,Ce=Gt,Te=it,se=zt;return n(),l(D,null,[!t(a)&&!t(s)&&t(g)?(n(),P(Se(t(i)),Ue({key:0},t(m),{icon:"i-lucide-bandage",title:"Alternative locators",count:t(c).length,help:"locator-healing"}),Ae({subtitle:S(()=>[d("span",{class:re(t(z))},p(t(A)),3)]),default:S(()=>[t(o)?.healedInRunId?(n(),P(me,{key:0,class:"mb-3",color:"success",icon:"i-lucide-circle-check",variant:"subtle",title:"Locator healed"},{description:S(()=>[f[11]||(f[11]=L(" The recommended locator now passes at this call site — ",-1)),$(be,{to:`/test-runs/${t(o).healedInRunId}`,class:"underline font-medium"},{default:S(()=>[L(" see run #"+p(t(o).healedInRunId),1)]),_:1},8,["to"]),f[12]||(f[12]=L(". ",-1))]),_:1})):k("",!0),t(h)?(n(),l("div",eo,[$(ue,{name:"i-lucide-user-check",class:"size-5 text-primary shrink-0"}),d("div",to,[d("p",no,[f[14]||(f[14]=L(" Your pick ",-1)),$(_e,{size:"sm",color:"primary",variant:"subtle"},{default:S(()=>[...f[13]||(f[13]=[L("confirmed on the failing page",-1)])]),_:1})]),d("code",oo,p(t(h).locator),1)]),$(N,{size:"sm",color:"primary",variant:"solid","trailing-icon":t(y)==="user-pick"?"i-lucide-check":"i-lucide-copy",onClick:f[1]||(f[1]=V=>K(t(h).locator,"user-pick"))},{default:S(()=>[...f[15]||(f[15]=[L(" Copy ",-1)])]),_:1},8,["trailing-icon"])])):k("",!0),t(o)?.failingLocator?(n(),l("div",so,[$(ue,{name:"i-lucide-x-circle",class:"size-4 text-red-500 shrink-0"}),d("code",ao,p(t(B)),1),$(N,{size:"xs",variant:"ghost",color:"neutral",icon:t(y)==="failing"?"i-lucide-check":"i-lucide-copy",title:t(y)==="failing"?"Copied!":"Copy",onClick:f[2]||(f[2]=V=>K(t(B),"failing"))},null,8,["icon","title"])])):k("",!0),t(o)?.priorNameMayBeStale?(n(),P(me,{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."})):k("",!0),t(W)?(n(),l("div",ro,[d("div",io,[$(ue,{name:"i-lucide-star",class:"size-4 text-primary shrink-0"}),f[16]||(f[16]=d("p",{class:"text-xs font-medium text-primary shrink-0"},"Recommended fix",-1)),t(Q)?(n(),l("span",lo," · "+p(t(Q)),1)):k("",!0),f[17]||(f[17]=d("span",{class:"flex-1"},null,-1)),$(_e,{size:"xs",color:"primary",variant:"subtle",class:"font-mono tabular-nums shrink-0"},{default:S(()=>[L(p(t(W).score),1)]),_:1})]),t(ve)?(n(),l("div",co,[$(Ce,{patch:t(ve).patch},null,8,["patch"])])):(n(),l(D,{key:1},[d("code",uo,p(t(W).locator),1),t(xe).length?(n(),l("p",mo,[(n(!0),l(D,null,ne(t(xe),(V,ie)=>(n(),l(D,{key:ie},[d("span",fo,p(V.key)+":",1),V.from?(n(),l("span",po,p(V.from),1)):(n(),l("span",go,"—")),$(ue,{name:"i-lucide-arrow-right",class:"size-3 text-gray-400"}),V.to?(n(),l("span",ho,p(V.to),1)):(n(),l("span",vo,"removed"))],64))),128))])):k("",!0)],64)),t(x)?(n(),l("p",yo,p(t(x)),1)):k("",!0),t(F)?(n(),l("p",xo,[$(ue,{name:"i-lucide-layers",class:"size-3 shrink-0"}),L(p(t(F)),1)])):k("",!0),d("div",bo,[$(N,{size:"xs",color:"primary",variant:"solid","trailing-icon":t(y)==="top"?"i-lucide-check":"i-lucide-copy",onClick:f[3]||(f[3]=V=>K(t(W).locator,"top"))},{default:S(()=>[...f[18]||(f[18]=[L(" Copy locator ",-1)])]),_:1},8,["trailing-icon"]),$(N,{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:ze},{default:S(()=>[...f[19]||(f[19]=[L(" Copy fix prompt ",-1)])]),_:1},8,["icon"])])])):k("",!0),t(C)?.hasDurableAlternative&&t(C).durable?(n(),l("div",ko,[$(ue,{name:"i-lucide-shield-check",class:"size-5 text-success shrink-0"}),d("div",_o,[d("p",$o," Most stable option (score: "+p(t(C).durable.score)+") ",1),d("code",wo,p(t(C).durable.locator),1),f[20]||(f[20]=d("p",{class:"text-xs text-gray-500 mt-0.5"},"Sturdier, but changes the locator style",-1))]),$(N,{size:"sm",color:"neutral",variant:"outline","trailing-icon":t(y)==="durable"?"i-lucide-check":"i-lucide-copy",onClick:f[4]||(f[4]=V=>K(t(C).durable.locator,"durable"))},{default:S(()=>[...f[21]||(f[21]=[L(" Copy ",-1)])]),_:1},8,["trailing-icon"])])):k("",!0),d("div",Co,[f[22]||(f[22]=d("p",{class:"text-xs font-medium text-gray-500"},"All alternatives",-1)),(n(!0),l(D,null,ne(t(ke),(V,ie)=>(n(),P(Te,{key:ie,alt:V,copied:t(y)===`alt-${ie}`,onCopy:u=>K(V.locator,`alt-${ie}`)},null,8,["alt","copied","onCopy"]))),128)),t(c).length>nt?(n(),P(N,{key:0,size:"xs",variant:"ghost",color:"neutral",block:"",icon:t(te)?"i-lucide-chevron-up":"i-lucide-chevron-down",onClick:f[5]||(f[5]=V=>te.value=!t(te))},{default:S(()=>[L(p(t(te)?"Show fewer":`Show all ${t(c).length} alternatives`),1)]),_:1},8,["icon"])):k("",!0)]),t(T).length?(n(),l("div",So,[f[23]||(f[23]=d("p",{class:"text-xs font-medium text-gray-500 mb-2"},"From the failing page",-1)),d("div",To,[(n(!0),l(D,null,ne(t(T),(V,ie)=>(n(),P(Te,{key:ie,alt:V,note:"candidate from the failure-time ARIA snapshot",copied:t(y)===`supp-${ie}`,onCopy:u=>K(V.locator,`supp-${ie}`)},null,8,["alt","copied","onCopy"]))),128))])])):k("",!0),t(C)?.suggestAddTestId?(n(),P(me,{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."})):k("",!0),t(o)?.source==="aria-snapshot"?(n(),P(me,{key:8,class:"mt-3",color:"info",icon:"i-lucide-info",variant:"subtle"},{description:S(()=>[f[25]||(f[25]=L(" No HTML attributes were available. ",-1)),$(se,{to:"capture-fixtures","no-icon":"",class:"text-primary hover:underline"},{default:S(()=>[...f[24]||(f[24]=[L("Enable Piwi fixture capture",-1)])]),_:1}),f[26]||(f[26]=L(" for full alternatives including data-testid and CSS selectors. ",-1))]),_:1})):k("",!0)]),_:2},[e.storageKey?{name:"folded",fn:S(()=>[t(C)?.recommended?(n(),l("code",Jn,p(t(C).recommended.locator),1)):(n(),l("span",Qn,p(t(c).length)+" alternative"+p(t(c).length===1?"":"s"),1))]),key:"0"}:void 0,t(E)||t(o)?.failingLocator?{name:"actions",fn:S(()=>[d("div",Xn,[t(o)?.failingLocator?(n(),P(N,{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:f[0]||(f[0]=V=>O.value=!0)},{default:S(()=>[...f[9]||(f[9]=[L(" Pick from snapshot ",-1)])]),_:1})):k("",!0),t(E)?(n(),P(N,{key:1,to:t(E),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:S(()=>[...f[10]||(f[10]=[L(" Pick from trace ",-1)])]),_:1},8,["to"])):k("",!0)])]),key:"1"}:void 0]),1040,["count"])):!t(a)&&!t(s)&&!t(g)?(n(),P(Se(t(i)),Ue({key:1},t(m),{icon:"i-lucide-bandage",title:"Alternative locators",subtitle:"No alternatives available",help:"locator-healing"}),Ae({default:S(()=>[$(me,{color:"neutral",icon:"i-lucide-info",variant:"subtle"},{description:S(()=>[f[31]||(f[31]=L(" No pre-captured alternatives — this locator has never passed in a previous run. ",-1)),$(se,{to:"capture-fixtures","no-icon":"",class:"text-primary hover:underline"},{default:S(()=>[...f[30]||(f[30]=[L("Enable Piwi dashboard fixtures",-1)])]),_:1}),f[32]||(f[32]=L(" 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:S(()=>[f[27]||(f[27]=d("span",null,"No alternatives available",-1))]),key:"0"}:void 0,t(E)||t(o)?.failingLocator?{name:"actions",fn:S(()=>[d("div",Lo,[t(o)?.failingLocator?(n(),P(N,{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:f[6]||(f[6]=V=>O.value=!0)},{default:S(()=>[...f[28]||(f[28]=[L(" Pick from snapshot ",-1)])]),_:1})):k("",!0),t(E)?(n(),P(N,{key:1,to:t(E),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:S(()=>[...f[29]||(f[29]=[L(" Pick from trace ",-1)])]),_:1},8,["to"])):k("",!0)])]),key:"1"}:void 0]),1040)):k("",!0),t(o)?.failingLocator?(n(),P(Hn,{key:2,open:t(O),"onUpdate:open":f[7]||(f[7]=V=>Oe(O)?O.value=V:null),"run-id":e.runId,"test-runs-case-id":e.testRunsCaseId,"failing-locator":t(o).failingLocator,healing:t(o),onConfirmed:ce,onClose:f[8]||(f[8]=V=>O.value=!1)},null,8,["open","run-id","test-runs-case-id","failing-locator","healing"])):k("",!0)],64)}}}),wa=Object.assign(Ao,{__name:"LocatorHealingPanel"}),Io={key:1,class:"space-y-2"},zo={class:"text-xs font-medium text-gray-500 dark:text-gray-400 sm:w-40 shrink-0"},Bo={class:"flex flex-wrap items-center gap-1.5 min-w-0 text-xs font-mono"},Ro={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"},Po={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"},Oo={key:0,class:"text-xs text-gray-400 dark:text-gray-500"},Uo={key:0},Eo=oe({__name:"EnvironmentDiffCard",props:{runId:{},testRunsCaseId:{},storageKey:{}},setup(e,{expose:r}){const i=e,m=w(()=>i.storageKey?Ke:Ne),o=w(()=>i.storageKey?{storageKey:i.storageKey}:{}),{data:a,pending:s,error:g}=Ee(()=>`/api/test-runs/${i.runId}/cases/${i.testRunsCaseId}/environment-diff`,{lazy:!0},"$yASgALxNz3"),c=w(()=>a.value?.entries??[]),h=w(()=>c.value.filter(z=>!z.informational)),C=w(()=>c.value.filter(z=>z.informational)),T=w(()=>{const z=a.value?.baseline;if(!z)return"";const B=z.startTime?` · ${We(new Date(z.startTime))}`:"";return`vs last pass in run #${z.runId}${B}`}),x=w(()=>{if(a.value?.status!=="ok")return"No passing baseline to compare against";const z=h.value.length;return z===0?"Identical to last pass — no environment drift":`${z} change${z===1?"":"s"}: ${h.value.map(B=>B.label).join(", ")}`}),A=j(null);return r({reveal:()=>A.value?.reveal?.()}),(z,B)=>{const Z=Ze,Y=ye;return!t(s)&&!t(g)&&t(a)?.status==="ok"?(n(),P(Se(t(m)),Ue({key:0,ref_key:"card",ref:A},t(o),{icon:"i-lucide-git-compare-arrows",title:"Environment diff",count:t(h).length||void 0,help:"environment-diff",subtitle:t(T)}),Ae({default:S(()=>[t(c).length===0?(n(),P(Z,{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(),l("div",Io,[(n(!0),l(D,null,ne(t(h),E=>(n(),l("div",{key:E.key,class:"rounded-lg border border-default p-3 flex flex-col gap-1 sm:flex-row sm:items-center sm:gap-3"},[d("span",zo,p(E.label),1),d("div",Bo,[d("code",Ro,p(E.failing??"(unset)"),1),$(Y,{name:"i-lucide-arrow-left",class:"size-3 shrink-0 text-gray-400"}),d("code",Po,p(E.baseline??"(unset)"),1)])]))),128)),t(C).length>0?(n(),l("p",Oo,[B[0]||(B[0]=L(" Also changed (varies naturally between runs): ",-1)),(n(!0),l(D,null,ne(t(C),(E,O)=>(n(),l("span",{key:E.key},[L(p(E.label.toLowerCase())+" "+p(E.baseline??"—")+" → "+p(E.failing??"—"),1),O<t(C).length-1?(n(),l("span",Uo,", ")):k("",!0)]))),128))])):k("",!0)]))]),_:2},[e.storageKey?{name:"folded",fn:S(()=>[d("span",null,p(t(x)),1)]),key:"0"}:void 0]),1040,["count","subtitle"])):k("",!0)}}}),Ca=Object.assign(Eo,{__name:"EnvironmentDiffCard"}),Mo={class:"absolute top-4 left-4 text-white/70 text-sm font-medium"},jo=["src","alt"],No=oe({__name:"ScreenshotLightbox",props:{images:{},modelValue:{}},emits:["update:modelValue"],setup(e,{emit:r}){const i=e,m=r,o=w(()=>i.modelValue!==null);function a(){m("update:modelValue",null)}function s(){i.modelValue!==null&&i.modelValue>0&&m("update:modelValue",i.modelValue-1)}function g(){i.modelValue!==null&&i.modelValue<i.images.length-1&&m("update:modelValue",i.modelValue+1)}const c=w(()=>i.modelValue===null?null:i.images[i.modelValue]??null);function h(C){o.value&&(C.key==="Escape"&&a(),C.key==="ArrowLeft"&&s(),C.key==="ArrowRight"&&g())}return st(()=>window.addEventListener("keydown",h)),xt(()=>window.removeEventListener("keydown",h)),(C,T)=>{const x=ye;return n(),P(bt,{to:"body"},[$(kt,{name:"lightbox"},{default:S(()=>[o.value?(n(),l("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/90",onClick:he(a,["self"])},[d("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},[$(x,{name:"i-lucide-x",class:"size-6"})]),d("div",Mo,p((e.modelValue??0)+1)+" / "+p(e.images.length),1),e.images.length>1&&(e.modelValue??0)>0?(n(),l("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:s},[$(x,{name:"i-lucide-chevron-left",class:"size-6"})])):k("",!0),c.value?(n(),l("img",{key:1,src:c.value.src,alt:c.value.name,class:"max-h-[90vh] max-w-[90vw] object-contain rounded-lg",onClick:T[0]||(T[0]=he(()=>{},["stop"]))},null,8,jo)):k("",!0),e.images.length>1&&(e.modelValue??0)<e.images.length-1?(n(),l("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:g},[$(x,{name:"i-lucide-chevron-right",class:"size-6"})])):k("",!0)])):k("",!0)]),_:1})])}}}),ut=Object.assign(_t(No,[["__scopeId","data-v-c02b1e9b"]]),{__name:"ScreenshotLightbox"}),Ko={class:"flex justify-end mb-2"},Vo={key:1,class:"rounded overflow-hidden border border-default bg-gray-50 dark:bg-gray-900"},Do=["src"],Ho={key:2,class:"grid grid-cols-1 sm:grid-cols-2 gap-2"},Fo={class:"rounded overflow-hidden border border-red-200 dark:border-red-900 bg-gray-50 dark:bg-gray-900"},qo=["src"],Zo={class:"rounded overflow-hidden border border-green-200 dark:border-green-900 bg-gray-50 dark:bg-gray-900"},Wo={class:"px-2 py-1 text-[10px] font-medium text-green-600 dark:text-green-400"},Go=["src"],Yo=oe({__name:"VisualDiffCard",props:{runId:{},testRunsCaseId:{},storageKey:{}},setup(e,{expose:r}){const i=e,m=w(()=>i.storageKey?Ke:Ne),o=w(()=>i.storageKey?{storageKey:i.storageKey}:{}),a=je(),{data:s,pending:g,error:c}=Ee(()=>`/api/test-runs/${i.runId}/cases/${i.testRunsCaseId}/visual-diff`,{lazy:!0},"$nTbSHl3faK"),h=w(()=>s.value?.status==="ok"?s.value.diff??null:null),C=j("overlay"),T=[{label:"Overlay",value:"overlay"},{label:"Side by side",value:"side-by-side"}],x=w(()=>h.value?Pe(h.value.path,"image/png",a.app?.baseURL):""),A=w(()=>h.value?Pe(h.value.failingPath,null,a.app?.baseURL):""),z=w(()=>h.value?Pe(h.value.baselinePath,null,a.app?.baseURL):""),B=w(()=>h.value?(h.value.changedPixelRatio*100).toFixed(2):"0"),Z=w(()=>{const ee=h.value?.changedPixelRatio??0;return ee>.1?"error":ee>.01?"warning":"success"}),Y=w(()=>h.value?h.value.dimensionMismatch?`${B.value}% changed — dimensions differ, unreliable`:`${B.value}% of pixels changed vs last pass`:"No comparable screenshots"),E=w(()=>h.value?[{src:A.value,name:"Failing screenshot"},{src:z.value,name:"Last passing screenshot"},{src:x.value,name:"Diff overlay"}]:[]),O=j(null),ce=j(null);return r({reveal:()=>ce.value?.reveal?.()}),(ee,y)=>{const H=Ie,M=Ze,K=Rt,W=ut;return!t(g)&&!t(c)&&t(h)?(n(),P(Se(t(m)),Ue({key:0,ref_key:"card",ref:ce},t(o),{icon:"i-lucide-images",title:"Visual diff",help:"visual-diff"}),Ae({subtitle:S(()=>[d("span",null,"vs last pass in run #"+p(t(h).baselineRunId),1)]),actions:S(()=>[$(H,{color:t(Z),variant:"subtle",size:"sm",class:"font-mono tabular-nums"},{default:S(()=>[L(p(t(B))+"% changed ",1)]),_:1},8,["color"])]),default:S(()=>[t(h).dimensionMismatch?(n(),P(M,{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."})):k("",!0),d("div",Ko,[$(K,{modelValue:t(C),"onUpdate:modelValue":y[0]||(y[0]=F=>Oe(C)?C.value=F:null),items:T,size:"xs",content:!1,ui:{list:"overflow-x-auto",trigger:"shrink-0"}},null,8,["modelValue"])]),t(C)==="overlay"?(n(),l("div",Vo,[d("img",{src:t(x),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]=F=>O.value=2),onKeydown:[y[2]||(y[2]=ge(F=>O.value=2,["enter"])),y[3]||(y[3]=ge(he(F=>O.value=2,["prevent"]),["space"]))]},null,40,Do),y[11]||(y[11]=d("p",{class:"px-2 py-1 text-[10px] text-gray-500"},"Red pixels mark differences against the last passing run",-1))])):(n(),l("div",Ho,[d("div",Fo,[y[12]||(y[12]=d("p",{class:"px-2 py-1 text-[10px] font-medium text-red-600 dark:text-red-400"},"Failing",-1)),d("img",{src:t(A),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]=F=>O.value=0),onKeydown:[y[5]||(y[5]=ge(F=>O.value=0,["enter"])),y[6]||(y[6]=ge(he(F=>O.value=0,["prevent"]),["space"]))]},null,40,qo)]),d("div",Zo,[d("p",Wo," Last pass (run #"+p(t(h).baselineRunId)+") ",1),d("img",{src:t(z),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]=F=>O.value=1),onKeydown:[y[8]||(y[8]=ge(F=>O.value=1,["enter"])),y[9]||(y[9]=ge(he(F=>O.value=1,["prevent"]),["space"]))]},null,40,Go)])])),$(W,{modelValue:t(O),"onUpdate:modelValue":y[10]||(y[10]=F=>Oe(O)?O.value=F:null),images:t(E)},null,8,["modelValue","images"])]),_:2},[e.storageKey?{name:"folded",fn:S(()=>[d("span",null,p(t(Y)),1)]),key:"0"}:void 0]),1040)):k("",!0)}}}),Sa=Object.assign(Yo,{__name:"VisualDiffCard"}),Jo={class:"max-h-96 overflow-y-auto"},Qo={key:0,class:"mt-2 text-xs text-gray-400 dark:text-gray-500"},Fe=2e4,Xo=oe({__name:"DomSnapshotCard",props:{runId:{},testRunsCaseId:{},storageKey:{}},setup(e,{expose:r}){const i=e,m=w(()=>i.storageKey?Ke:Ne),o=w(()=>i.storageKey?{storageKey:i.storageKey}:{}),{data:a,pending:s,error:g}=Ee(()=>`/api/test-runs/${i.runId}/cases/${i.testRunsCaseId}/dom-snapshot`,{lazy:!0},"$AxHFpokm2o"),c=w(()=>(a.value?.html??"").slice(0,Fe)),h=w(()=>(a.value?.html?.length??0)>Fe),C=w(()=>{const z=a.value;return!z||z.status!=="ok"?"":`${Math.round((z.html?.length??0)/1024)} KB · rendered from the uploaded trace${z.snapshotName?` (${z.snapshotName})`:""}`}),{copy:T,copied:x}=Ge(),A=j(null);return r({reveal:()=>A.value?.reveal?.()}),(z,B)=>{const Z=Me,Y=Pt,E=Ot;return!t(s)&&!t(g)&&t(a)?.status==="ok"&&t(a).html?(n(),P(Se(t(m)),Ue({key:0,ref_key:"card",ref:A},t(o),{icon:"i-lucide-file-code",title:"DOM snapshot",help:"dom-snapshot",subtitle:t(C)}),Ae({actions:S(()=>[$(Y,{text:t(x)?"Copied!":"Copy full HTML"},{default:S(()=>[$(Z,{size:"xs",variant:"ghost",color:"neutral",icon:t(x)?"i-lucide-check":"i-lucide-clipboard",onClick:B[0]||(B[0]=O=>t(T)(t(a).html))},null,8,["icon"])]),_:1},8,["text"])]),default:S(()=>[d("div",Jo,[$(E,{code:t(c),lang:"xml"},null,8,["code"])]),t(h)||t(a).truncated?(n(),l("p",Qo,[t(h)?(n(),l(D,{key:0},[L("Showing the first "+p(Math.round(Fe/1e3))+"k characters — use Copy for the full document.",1)],64)):(n(),l(D,{key:1},[L("The snapshot was truncated to its size cap.")],64))])):k("",!0)]),_:2},[e.storageKey?{name:"folded",fn:S(()=>[d("span",null,"Failure-time HTML extracted from the trace — "+p(Math.round((t(a).html.length??0)/1024))+" KB",1)]),key:"0"}:void 0]),1040,["subtitle"])):k("",!0)}}}),Ta=Object.assign(Xo,{__name:"DomSnapshotCard"}),es={class:"rounded-md border border-default overflow-hidden"},ts={class:"text-xs font-semibold text-gray-600 dark:text-gray-300 flex-1"},ns={key:0,class:"text-gray-400 font-normal ml-1"},os={key:0},ss=oe({__name:"TestEvidenceSection",props:qe({icon:{},label:{},count:{},collapsible:{type:Boolean}},{open:{type:Boolean,default:!1},openModifiers:{}}),emits:["update:open"],setup(e){const r=e,i=ot(e,"open"),m=w(()=>r.collapsible===!1||i.value);return(o,a)=>{const s=ye;return n(),l("div",es,[(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]=g=>e.collapsible!==!1&&(i.value=!i.value))},{default:S(()=>[$(s,{name:e.icon,class:"size-3.5 shrink-0 text-primary/70"},null,8,["name"]),d("span",ts,[L(p(e.label),1),e.count!=null?(n(),l("span",ns,"("+p(e.count)+")",1)):k("",!0)]),e.collapsible!==!1?(n(),P(s,{key:0,name:i.value?"i-lucide-chevron-up":"i-lucide-chevron-down",class:"size-3.5 text-gray-400"},null,8,["name"])):k("",!0)]),_:1},8,["class"])),t(m)?(n(),l("div",os,[Re(o.$slots,"default")])):k("",!0)])}}}),Ye=Object.assign(ss,{__name:"TestEvidenceSection"}),as={class:"grid grid-cols-2 gap-2 p-2 bg-gray-50 dark:bg-gray-900"},rs=["aria-label","onClick","onKeydown"],is=["src","alt"],ls={class:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-black/30"},cs={class:"absolute bottom-0 inset-x-0 px-1.5 py-0.5 text-[10px] text-white bg-black/50 truncate"},us=oe({__name:"TestEvidenceScreenshots",props:{attachments:{}},setup(e){const r=e,i=je();function m(s){return s.split("/").pop()||s}const o=w(()=>r.attachments.filter(s=>Et(s.path,s.contentType)).map(s=>({src:Pe(s.path,s.contentType,i.app?.baseURL),name:s.name||m(s.path)}))),a=j(null);return(s,g)=>{const c=ye,h=ut,C=Ye;return t(o).length>0?(n(),P(C,{key:0,icon:"i-lucide-image",label:"Screenshots",count:t(o).length,collapsible:!1},{default:S(()=>[d("div",as,[(n(!0),l(D,null,ne(t(o),(T,x)=>(n(),l("div",{key:T.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 ${T.name}`,onClick:A=>a.value=x,onKeydown:[ge(A=>a.value=x,["enter"]),ge(he(A=>a.value=x,["prevent"]),["space"])]},[d("img",{src:T.src,alt:T.name,class:"w-full h-28 object-cover object-top transition-opacity group-hover:opacity-80",loading:"lazy"},null,8,is),d("div",ls,[$(c,{name:"i-lucide-zoom-in",class:"size-5 text-white"})]),d("p",cs,p(T.name),1)],40,rs))),128))]),$(h,{modelValue:t(a),"onUpdate:modelValue":g[0]||(g[0]=T=>Oe(a)?a.value=T:null),images:t(o)},null,8,["modelValue","images"])]),_:1},8,["count"])):k("",!0)}}}),La=Object.assign(us,{__name:"TestEvidenceScreenshots"}),ds={class:"m-0"},ms={class:"bg-black rounded overflow-hidden"},fs=["src"],ps=["title"],gs=oe({__name:"VideoPlayer",props:{src:{},label:{}},setup(e){return(r,i)=>(n(),l("figure",ds,[d("div",ms,[d("video",{src:e.src,controls:"",preload:"metadata",class:"w-full max-h-96"}," Your browser does not support the video tag. ",8,fs)]),e.label?(n(),l("figcaption",{key:0,class:"mt-1 text-xs text-gray-400 truncate",title:e.label},p(e.label),9,ps)):k("",!0)]))}}),hs=Object.assign(gs,{__name:"VideoPlayer"}),vs={class:"space-y-2 p-2 bg-gray-50 dark:bg-gray-900"},ys=oe({__name:"TestEvidenceVideos",props:{attachments:{}},setup(e){const r=e,i=je();function m(a){return a.split("/").pop()||a}const o=w(()=>r.attachments.filter(a=>Mt(a.path,a.contentType)).map(a=>({src:Pe(a.path,a.contentType,i.app?.baseURL),name:a.name||m(a.path)})));return(a,s)=>{const g=hs,c=Ye;return t(o).length>0?(n(),P(c,{key:0,icon:"i-lucide-video",label:"Videos",count:t(o).length,collapsible:!1},{default:S(()=>[d("div",vs,[(n(!0),l(D,null,ne(t(o),h=>(n(),P(g,{key:h.src,src:h.src,label:h.name},null,8,["src","label"]))),128))])]),_:1},8,["count"])):k("",!0)}}}),Aa=Object.assign(ys,{__name:"TestEvidenceVideos"}),xs={class:"flex items-center justify-between gap-2"},bs={class:"flex items-center gap-2 min-w-0"},ks={class:"text-sm truncate"},_s={key:0,class:"text-xs text-gray-400 shrink-0"},$s={key:1,class:"text-xs text-gray-400 shrink-0"},ws={class:"flex items-center gap-1.5 shrink-0"},Cs=oe({__name:"TraceListItem",props:{trace:{},showTime:{type:Boolean,default:!0}},setup(e){const r=e,i=je(),m=w(()=>(i.app?.baseURL??"/").replace(/\/$/,"")),o=w(()=>!!i.public.demoMode&&r.trace.filePath.startsWith("demo/")),a=w(()=>r.trace.filePath.split("/").pop()||r.trace.filePath),s=w(()=>at(r.trace.filePath,i.app?.baseURL,o.value)),g=w(()=>o.value?`${m.value}/${r.trace.filePath}`:`${m.value}/api/files/${At(r.trace.filePath)}`);return(c,h)=>{const C=ye,T=Me;return n(),l("div",xs,[d("div",bs,[$(C,{name:"i-lucide-file-archive",class:"size-4 text-gray-400 shrink-0"}),d("span",ks,p(t(a)),1),e.trace.size?(n(),l("span",_s,p(("formatBytes"in c?c.formatBytes:t(Lt))(e.trace.size)),1)):k("",!0),e.showTime?(n(),l("span",$s,p(("formatRelativeTime"in c?c.formatRelativeTime:t(We))(e.trace.createdAt)),1)):k("",!0)]),d("div",ws,[$(T,{to:t(s),target:"_blank",icon:"i-lucide-bug-play",size:"xs",label:"View trace"},null,8,["to"]),$(T,{to:t(g),target:"_blank",icon:"i-lucide-download",size:"xs",color:"neutral",variant:"soft",label:"Download"},null,8,["to"])])])}}}),Ss=Object.assign(Cs,{__name:"TraceListItem"}),Ts={key:0,class:"flex items-center justify-center py-4"},Ls={key:1,class:"divide-y divide-default"},As=oe({__name:"TestEvidenceTraces",props:{traces:{},loading:{type:Boolean}},setup(e){return(r,i)=>{const m=ye,o=Ss,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:S(()=>[e.loading&&!e.traces.length?(n(),l("div",Ts,[$(m,{name:"i-lucide-loader-circle",class:"size-4 animate-spin text-gray-400"})])):(n(),l("div",Ls,[(n(!0),l(D,null,ne(e.traces,s=>(n(),P(o,{key:s.id,trace:s,class:"px-3 py-2"},null,8,["trace"]))),128))]))]),_:1},8,["count"])):k("",!0)}}}),Ia=Object.assign(As,{__name:"TestEvidenceTraces"}),Is={class:"space-y-2"},zs={key:0,class:"rounded-lg border border-default overflow-hidden"},Bs=["title"],Rs={key:2,class:"truncate text-gray-400 dark:text-gray-500"},Ps={class:"font-mono"},Os={key:0,class:"overflow-x-auto text-xs font-mono leading-relaxed py-1"},Us={class:"min-w-max"},Es={key:1,class:"rounded-lg border border-dashed border-default"},Ms=["onClick"],js={key:0,class:"px-3 pb-2 space-y-1"},Ns=["title"],Ks={key:0,class:"truncate font-mono shrink-0"},Vs=oe({__name:"TraceCallStack",props:{frames:{},projectKey:{},projectName:{}},setup(e){const r=e,i=w(()=>{if(!r.frames.some(T=>T.inProject))return r.frames.map((T,x)=>({kind:"frame",frame:T,frameIndex:x}));const c=[];let h=[];const C=()=>{h.length!==0&&(c.push({kind:"group",frames:h,key:`group-${c.length}`}),h=[])};return r.frames.forEach((T,x)=>{T.inProject?(C(),c.push({kind:"frame",frame:T,frameIndex:x})):h.push(T)}),C(),c}),m=w(()=>{const g=r.frames.findIndex(c=>c.inProject);return g>=0?g:0}),o=j(new Set);function a(g){const c=new Set(o.value);c.has(g)?c.delete(g):c.add(g),o.value=c}function s(g){return g.source?g.source.lines.map((c,h)=>{const C=g.source.startLine+h;return{lineNo:C,text:c,failing:C===g.line}}):[]}return(g,c)=>{const h=ye,C=rt,T=Ie;return n(),l("div",Is,[(n(!0),l(D,null,ne(t(i),x=>(n(),l(D,{key:x.kind==="frame"?`f-${x.frameIndex}`:x.key},[x.kind==="frame"?(n(),l("div",zs,[d("div",{class:re(["flex items-center gap-2 px-3 py-1.5 bg-elevated/40 text-xs",x.frame.source?"border-b border-default":""])},[$(h,{name:x.frameIndex===t(m)?"i-lucide-circle-x":"i-lucide-corner-left-up",class:re([x.frameIndex===t(m)?"text-red-500":"text-gray-400","size-3.5 shrink-0"])},null,8,["name","class"]),x.frame.inProject?(n(),P(C,{key:0,"file-path":x.frame.file,line:x.frame.line,column:x.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(),l("code",{key:1,class:"truncate text-gray-500 dark:text-gray-400",title:x.frame.absFile||x.frame.file},p(x.frame.file)+":"+p(x.frame.line),9,Bs)),x.frame.functionName?(n(),l("span",Rs,[c[0]||(c[0]=L(" in ",-1)),d("span",Ps,p(x.frame.functionName),1)])):k("",!0),$(T,{color:x.frameIndex===t(m)?"error":"neutral",variant:"subtle",size:"xs",class:"ml-auto shrink-0"},{default:S(()=>[L(p(x.frameIndex===t(m)?"Failed here":"Caller"),1)]),_:2},1032,["color"])],2),x.frame.source?(n(),l("div",Os,[d("div",Us,[(n(!0),l(D,null,ne(s(x.frame),A=>(n(),l("div",{key:A.lineNo,class:re(["px-3 whitespace-pre flex",A.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"])},[d("span",{class:re(["w-10 shrink-0 text-right pr-3 tabular-nums select-none",A.failing?"text-red-400 dark:text-red-500":"text-gray-300 dark:text-gray-600"])},p(A.lineNo),3),d("span",null,p(A.text),1)],2))),128))])])):k("",!0)])):(n(),l("div",Es,[d("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:A=>a(x.key)},[$(h,{name:t(o).has(x.key)?"i-lucide-chevron-down":"i-lucide-chevron-right",class:"size-3.5 shrink-0"},null,8,["name"]),L(" "+p(x.frames.length)+" frame"+p(x.frames.length===1?"":"s")+" in dependencies ",1)],8,Ms),t(o).has(x.key)?(n(),l("div",js,[(n(!0),l(D,null,ne(x.frames,(A,z)=>(n(),l("div",{key:z,class:"flex items-center gap-2 text-xs text-gray-400 dark:text-gray-500 min-w-0"},[$(h,{name:"i-lucide-corner-left-up",class:"size-3 shrink-0"}),d("code",{class:"truncate",title:A.absFile||A.file},p(A.file)+":"+p(A.line),9,Ns),A.functionName?(n(),l("span",Ks,p(A.functionName),1)):k("",!0)]))),128))])):k("",!0)]))],64))),128))])}}}),za=Object.assign(Vs,{__name:"TraceCallStack"}),Ds={class:"space-y-2"},Hs={class:"flex items-center gap-2 px-3 py-1.5 bg-elevated/40 border-b border-default text-xs"},Fs={class:"overflow-x-auto text-xs font-mono leading-relaxed py-1"},qs={class:"min-w-max"},Zs=oe({__name:"TestSourceStack",props:{frames:{},projectKey:{},projectName:{}},setup(e){function r(i){return i.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as v,b4 as I,ay as y,b5 as F,C as g,ab as h,B as C,o as K,f as S,g as i,j as T,k as r,V as w,T as B,h as u,b6 as R,b7 as q,G as k,b8 as x}from"./
|
|
1
|
+
import{d as v,b4 as I,ay as y,b5 as F,C as g,ab as h,B as C,o as K,f as S,g as i,j as T,k as r,V as w,T as B,h as u,b6 as R,b7 as q,G as k,b8 as x}from"./BrT_Sys2.js";var _=v({__name:"RovingFocusItem",props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(d){const n=d,a=I(),f=y(),l=u(()=>n.tabStopId||f),c=u(()=>a.currentTabStopId.value===l.value),{getItems:p,CollectionItem:b}=F();g(()=>{n.focusable&&a.onFocusableItemAdd()}),h(()=>{n.focusable&&a.onFocusableItemRemove()}),C(()=>n.focusable,(e,t)=>{e!==t&&(e?a.onFocusableItemAdd():a.onFocusableItemRemove())});function m(e){if(e.key==="Tab"&&e.shiftKey){a.onItemShiftTab();return}if(e.target!==e.currentTarget)return;const t=R(e,a.orientation.value,a.dir.value);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||!n.allowShiftKey&&e.shiftKey)return;e.preventDefault();let o=[...p().map(s=>s.ref).filter(s=>s.dataset.disabled!=="")];if(t==="last")o.reverse();else if(t==="prev"||t==="next"){t==="prev"&&o.reverse();const s=o.indexOf(e.currentTarget);o=a.loop.value?q(o,s+1):o.slice(s+1)}k(()=>x(o))}}return(e,t)=>(K(),S(r(b),null,{default:i(()=>[T(r(w),{tabindex:c.value?0:-1,"data-orientation":r(a).orientation.value,"data-active":e.active?"":void 0,"data-disabled":e.focusable?void 0:"",as:e.as,"as-child":e.asChild,onMousedown:t[0]||(t[0]=o=>{e.focusable?r(a).onItemFocus(l.value):o.preventDefault()}),onFocus:t[1]||(t[1]=o=>r(a).onItemFocus(l.value)),onKeydown:m},{default:i(()=>[B(e.$slots,"default")]),_:3},8,["tabindex","data-orientation","data-active","data-disabled","as","as-child"])]),_:3}))}}),j=_;export{j as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as o,o as a,f as e,g as c,v as u,q as r,m,t as l,k as g,s as d}from"./
|
|
1
|
+
import{d as o,o as a,f as e,g as c,v as u,q as r,m,t as l,k as g,s as d}from"./BrT_Sys2.js";import{i as f}from"./D7P0ML0H.js";const _=o({__name:"RunStatusBadge",props:{status:{},size:{}},setup(t){return(s,z)=>{const n=u,i=d;return a(),e(i,{color:("getStatusColor"in s?s.getStatusColor:g(f))(t.status),size:t.size,class:"capitalize gap-1 items-center"},{default:c(()=>[t.status==="running"||t.status==="initialising"||t.status==="finalizing"?(a(),e(n,{key:0,name:"i-lucide-loader-circle",class:"size-3 animate-spin shrink-0"})):r("",!0),m(" "+l(t.status),1)]),_:1},8,["color","size"])}}}),k=Object.assign(_,{__name:"RunStatusBadge"});export{k as _};
|